Starting some much needed CDVD work. No functional change yet.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3431 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2 2010-07-08 17:26:20 +00:00
parent 83d71700d9
commit 284f1c9f4c
2 changed files with 28 additions and 12 deletions

View File

@ -712,26 +712,34 @@ __forceinline void cdvdActionInterrupt()
switch( cdvd.Action )
{
case cdvdAction_Seek:
case cdvdAction_Standby:
cdvd.Spinning = true;
cdvd.Ready = CDVD_READY1;
cdvd.Ready = CDVD_READY1; //check (rama)
cdvd.Sector = cdvd.SeekToSector;
cdvd.Status = CDVD_STATUS_SEEK_COMPLETE;
cdvd.Status = CDVD_STATUS_PAUSE;
break;
case cdvdAction_Standby:
DevCon.Warning("CDVD Standby Call");
cdvd.Spinning = true; //check (rama)
cdvd.Ready = CDVD_READY1; //check (rama)
cdvd.Sector = cdvd.SeekToSector;
cdvd.Status = CDVD_STATUS_PAUSE;
break;
case cdvdAction_Stop:
cdvd.Spinning = false;
cdvd.Ready = CDVD_READY1;
cdvd.Sector = 0;
cdvd.Status = CDVD_STATUS_NONE;
cdvd.Status = CDVD_STATUS_STOP;
break;
case cdvdAction_Break:
// Make sure the cdvd action state is pretty well cleared:
DevCon.Warning("CDVD Break Call");
cdvd.Reading = 0;
cdvd.Readed = 0;
cdvd.Ready = CDVD_READY2; // should be CDVD_READY1 or something else?
cdvd.Status = CDVD_STATUS_NONE;
cdvd.Status = CDVD_STATUS_STOP;
cdvd.RErr = 0;
cdvd.nCommand = 0;
break;
@ -761,7 +769,7 @@ __forceinline void cdvdReadInterrupt()
cdvd.RetryCntP = 0;
cdvd.Reading = 1;
cdvd.Readed = 1;
cdvd.Status = CDVD_STATUS_SEEK_COMPLETE;
cdvd.Status = CDVD_STATUS_PAUSE; // check (rama)
cdvd.Sector = cdvd.SeekToSector;
CDVD_LOG( "Cdvd Seek Complete > Scheduling block read interrupt at iopcycle=%8.8x.",
@ -853,7 +861,7 @@ static uint cdvdStartSeek( uint newsector, CDVD_MODE_TYPE mode )
cdvd.Ready = CDVD_NOTREADY;
cdvd.Reading = 0;
cdvd.Readed = 0;
cdvd.Status = CDVD_STATUS_NONE;
cdvd.Status = CDVD_STATUS_STOP;
if( !cdvd.Spinning )
{
@ -886,7 +894,7 @@ static uint cdvdStartSeek( uint newsector, CDVD_MODE_TYPE mode )
if( delta == 0 )
{
cdvd.Status = CDVD_STATUS_SEEK_COMPLETE;
cdvd.Status = CDVD_STATUS_PAUSE;
cdvd.Readed = 1; // Note: 1, not 0, as implied by the next comment. Need to look into this. --arcum42
cdvd.RetryCntP = 0;
@ -1104,7 +1112,7 @@ static void cdvdWrite04(u8 rt) { // NCOMMAND
CDVD_LOG("cdvdWrite04: NCMD %s (%x) (ParamP = %x)", nCmdName[rt], rt, cdvd.ParamP);
cdvd.nCommand = rt;
cdvd.Status = CDVD_STATUS_NONE;
cdvd.Status = CDVD_STATUS_STOP; // check (rama)
cdvd.PwOff = Irq_None; // good or bad?
switch (rt) {
@ -1333,7 +1341,7 @@ static __forceinline void cdvdWrite07(u8 rt) // BREAK
// Clear the cdvd status:
cdvd.Readed = 0;
cdvd.Reading = 0;
cdvd.Status = CDVD_STATUS_NONE;
cdvd.Status = CDVD_STATUS_STOP;
//cdvd.nCommand = 0;
}

View File

@ -51,10 +51,18 @@ enum CdvdIrqId
};
/* is cdvd.Status only for NCMDS? (linuzappz) */
/* cdvd.Status is a construction site as of now (rama)*/
enum cdvdStatus
{
CDVD_STATUS_NONE = 0x00, // not sure ;)
CDVD_STATUS_SEEK_COMPLETE = 0x0A,
//CDVD_STATUS_NONE = 0x00, // not sure ;)
//CDVD_STATUS_SEEK_COMPLETE = 0x0A,
CDVD_STATUS_STOP = 0x00,
CDVD_STATUS_TRAY_OPEN = 0x01, // confirmed to be tray open
CDVD_STATUS_SPIN = 0x02,
CDVD_STATUS_READ = 0x06,
CDVD_STATUS_PAUSE = 0x0A, // neutral value. Recommended to never rely on this.
CDVD_STATUS_SEEK = 0x12,
CDVD_STATUS_EMERGENCY = 0x20,
};
enum cdvdready