From 1fb3de296082c61b03ec299c2a1a38575e958d81 Mon Sep 17 00:00:00 2001 From: gigaherz Date: Fri, 16 May 2014 22:36:16 +0200 Subject: [PATCH] cdvdGigaherz: Change the order in which the different reading modes are attempted. Seems to fix some CD-Rom games. While at it, renamed a rude variable with a better name. ;P --- plugins/cdvdGigaherz/src/CDVD.cpp | 8 ++++---- plugins/cdvdGigaherz/src/Windows/IOCtlSrc.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/cdvdGigaherz/src/CDVD.cpp b/plugins/cdvdGigaherz/src/CDVD.cpp index e7a4c4ae18..94bf91c2b5 100644 --- a/plugins/cdvdGigaherz/src/CDVD.cpp +++ b/plugins/cdvdGigaherz/src/CDVD.cpp @@ -243,7 +243,7 @@ s32 CALLBACK CDVDgetDualInfo(s32* dualType, u32* _layer1start) } int lastReadInNewDiskCB=0; -char fuckThisSector[2352]; +char directReadSectorBuffer[2448]; s32 CALLBACK CDVDreadSector(u8* buffer, s32 lsn, int mode) { @@ -257,7 +257,7 @@ s32 CALLBACK CDVDreadTrack(u32 lsn, int mode) if(weAreInNewDiskCB) { - int ret = cdvdDirectReadSector(lsn,mode,fuckThisSector); + int ret = cdvdDirectReadSector(lsn,mode,directReadSectorBuffer); if(ret==0) lastReadInNewDiskCB=1; return ret; } @@ -276,7 +276,7 @@ u8* CALLBACK CDVDgetBuffer() if(lastReadInNewDiskCB) { lastReadInNewDiskCB=0; - return (u8*)fuckThisSector; + return (u8*)directReadSectorBuffer; } u8 *s = (u8*)cdvdGetSector(csector,cmode); @@ -299,7 +299,7 @@ int CALLBACK CDVDgetBuffer2(u8* dest) { lastReadInNewDiskCB=0; - memcpy(dest, fuckThisSector, csize); + memcpy(dest, directReadSectorBuffer, csize); return 0; } diff --git a/plugins/cdvdGigaherz/src/Windows/IOCtlSrc.cpp b/plugins/cdvdGigaherz/src/Windows/IOCtlSrc.cpp index 1632c5631d..ed567cf3fa 100644 --- a/plugins/cdvdGigaherz/src/Windows/IOCtlSrc.cpp +++ b/plugins/cdvdGigaherz/src/Windows/IOCtlSrc.cpp @@ -626,13 +626,13 @@ s32 IOCtlSrc::ReadSectors2352(u32 sector, u32 count, char *buffer) rri.TrackMode=(TRACK_MODE_TYPE)last_read_mode; if(DeviceIoControl(device,IOCTL_CDROM_RAW_READ,&rri,sizeof(rri),buffer, 2352*count, &size, NULL)==0) { - rri.TrackMode=CDDA; + rri.TrackMode=YellowMode2; if(DeviceIoControl(device,IOCTL_CDROM_RAW_READ,&rri,sizeof(rri),buffer, 2352*count, &size, NULL)==0) { rri.TrackMode=XAForm2; if(DeviceIoControl(device,IOCTL_CDROM_RAW_READ,&rri,sizeof(rri),buffer, 2352*count, &size, NULL)==0) { - rri.TrackMode=YellowMode2; + rri.TrackMode=CDDA; if(DeviceIoControl(device,IOCTL_CDROM_RAW_READ,&rri,sizeof(rri),buffer, 2352*count, &size, NULL)==0) { return -1;