- First version of a disc swap that actually works. May not work yet. :p
- It's ugly and incomplete but it works in Star Ocean 3. (I blame the heat!)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3432 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2 2010-07-08 18:33:16 +00:00
parent 284f1c9f4c
commit a213da2346
4 changed files with 22 additions and 0 deletions

View File

@ -476,6 +476,13 @@ s32 cdvdReadSubQ(s32 lsn, cdvdSubQ* subq)
return ret;
}
void openVirtualTray()
{
DiscSwapTimerSeconds = cdvd.RTC.second;
cdvd.Status = CDVD_STATUS_TRAY_OPEN;
cdvd.Ready = CDVD_NOTREADY;
}
s32 cdvdCtrlTrayOpen()
{
s32 ret = CDVD->ctrlTrayOpen();
@ -916,6 +923,16 @@ void cdvdVsync() {
if (cdvd.RTCcount < ((gsRegionMode == Region_NTSC) ? 60 : 50)) return;
cdvd.RTCcount = 0;
if ( cdvd.Status == CDVD_STATUS_TRAY_OPEN )
{
if ( cdvd.RTC.second != DiscSwapTimerSeconds)
{
Console.Warning("Close virtual disk tray");
cdvd.Status = CDVD_STATUS_PAUSE;
cdvd.Ready = CDVD_READY1;
}
}
cdvd.RTC.second++;
if (cdvd.RTC.second < 60) return;
cdvd.RTC.second = 0;

View File

@ -144,5 +144,6 @@ extern u8 cdvdRead(u8 key);
extern void cdvdWrite(u8 key, u8 rt);
extern void cdvdReloadElfInfo(wxString elfoverride = wxEmptyString);
extern void openVirtualTray();
extern wxString DiscSerial;

View File

@ -136,6 +136,7 @@ static const uint PSX_DVD_READSPEED = 1382400 + 256000; // normal is 1 Byte Time
static const uint Cdvd_FullSeek_Cycles = (PSXCLK*100) / 1000; // average number of cycles per fullseek (100ms)
static const uint Cdvd_FastSeek_Cycles = (PSXCLK*30) / 1000; // average number of cycles per fastseek (37ms)
short DiscSwapTimerSeconds = 0;
static const char *mg_zones[8] = {"Japan", "USA", "Europe", "Oceania", "Asia", "Russia", "China", "Mexico"};

View File

@ -400,6 +400,9 @@ void DoCDVDclose()
CDVD->close();
DoCDVDresetDiskTypeCache();
Console.Warning("Closing CDVD plugin > open virtual disk tray");
openVirtualTray();
}
s32 DoCDVDreadSector(u8* buffer, u32 lsn, int mode)