From c2e49ba2454855ca7d99ca3c77ccf69840b71940 Mon Sep 17 00:00:00 2001 From: gigaherz Date: Thu, 16 Jul 2009 00:04:22 +0000 Subject: [PATCH] Silence a stupid compiler warning, fix the layer1 detection code, and remove the hack I added before, as it does no good. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1527 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/CDVD/CDVD.cpp | 8 -------- pcsx2/CDVD/CDVDisoReader.cpp | 15 ++++++++++----- pcsx2/windows/memzero.h | 2 +- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/pcsx2/CDVD/CDVD.cpp b/pcsx2/CDVD/CDVD.cpp index f0cfa6bbda..00d6ded5c4 100644 --- a/pcsx2/CDVD/CDVD.cpp +++ b/pcsx2/CDVD/CDVD.cpp @@ -1356,14 +1356,6 @@ static void cdvdWrite16(u8 rt) // SCOMMAND cdvd.Result[5] = 0x30;//min break; - case 0x80: // completely stupid code, but might even work... whatever it is menat to be for :P - SetResultSize(1); - if((CDVD.getDiskType()==CDVD_TYPE_NODISC)||(CDVD.getTrayStatus()==CDVD_TRAY_OPEN)) - cdvd.Result[0] = 0x80; - else - cdvd.Result[0] = 0x00; - break; - default: SetResultSize(1); cdvd.Result[0] = 0x80; diff --git a/pcsx2/CDVD/CDVDisoReader.cpp b/pcsx2/CDVD/CDVDisoReader.cpp index f7dfa674a3..f0e63e265c 100644 --- a/pcsx2/CDVD/CDVDisoReader.cpp +++ b/pcsx2/CDVD/CDVDisoReader.cpp @@ -183,18 +183,23 @@ static void FindLayer1Start() { // search for it int off = iso->blockofs; - u8* tempbuffer; + u8 tempbuffer[2352]; Console::Status("CDVD ISO: searching for layer1..."); - tempbuffer = (u8*)malloc(CD_FRAMESIZE_RAW); + //tempbuffer = (u8*)malloc(CD_FRAMESIZE_RAW); for (layer1start = (iso->blocks / 2 - 0x10) & ~0xf; layer1start < 0x200010; layer1start += 16) { - isoReadBlock(iso, tempbuffer, layer1start); + isoReadBlock(iso, tempbuffer+off, layer1start); // CD001 - if (tempbuffer[off+1] == 0x43 && tempbuffer[off+2] == 0x44 && tempbuffer[off+3] == 0x30 && tempbuffer[off+4] == 0x30 && tempbuffer[off+5] == 0x31) + if ((tempbuffer[off+1] == 0x43) && + (tempbuffer[off+2] == 0x44) && + (tempbuffer[off+3] == 0x30) && + (tempbuffer[off+4] == 0x30) && + (tempbuffer[off+5] == 0x31) + ) break; } - free(tempbuffer); + //free(tempbuffer); if(layer1start == 0x200010) { diff --git a/pcsx2/windows/memzero.h b/pcsx2/windows/memzero.h index c66d33ee57..3f7ad0db37 100644 --- a/pcsx2/windows/memzero.h +++ b/pcsx2/windows/memzero.h @@ -178,7 +178,7 @@ static __forceinline void memzero_ptr( void *dest ) enum { - remdat = bytes>>2 + remdat = (bytes>>2) }; // This case statement handles 5 special-case sizes (small blocks)