From 4d55a8b8254dff61fdc7b1959f6aef7eafbd9439 Mon Sep 17 00:00:00 2001 From: "SND\\edgbla_cp" Date: Wed, 9 Nov 2011 20:49:54 +0000 Subject: Patch 10767 (Durandal_1707). git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@72138 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- libpcsxcore/cdriso.c | 3 ++- libpcsxcore/cdrom.c | 4 ++-- libpcsxcore/debug.c | 2 +- libpcsxcore/ix86/iR3000A.c | 6 +++++ libpcsxcore/ix86_64/iR3000A-64.c | 4 +++- libpcsxcore/mdec.c | 10 ++++---- libpcsxcore/psxcounters.c | 2 +- libpcsxcore/psxhw.c | 52 ++++++++++++++++++++-------------------- libpcsxcore/psxinterpreter.c | 8 +++---- 9 files changed, 50 insertions(+), 41 deletions(-) (limited to 'libpcsxcore') diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index 6b075d18..03baad3f 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -29,6 +29,7 @@ #else #include #include +#include #endif static FILE *cdHandle = NULL; @@ -269,7 +270,7 @@ static void *playthread(void *param) // Vib Ribbon: decoded buffer IRQ - iso_play_cdbuf = sndbuffer; + iso_play_cdbuf = (u16 *)sndbuffer; iso_play_bufptr = 0; } diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 8bfa58f7..889beb9a 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -501,7 +501,7 @@ static void ReadTrack( u8 *time ) { } -static CDXA_Attenuation( s16 *buf, int size, int stereo, int attenuate_type ) +static void CDXA_Attenuation( s16 *buf, int size, int stereo, int attenuate_type ) { s16 *spsound; s32 lc,rc; @@ -1632,9 +1632,9 @@ void cdrReadInterrupt() { int ret = xa_decode_sector(&cdr.Xa, cdr.Transfer+4, cdr.FirstSector); if (!ret) { +#if 0 int xa_type; -#if 0 // save - set only for FirstSector xa_type = cdr.Xa.stereo; diff --git a/libpcsxcore/debug.c b/libpcsxcore/debug.c index bcf0ddb4..711d96f3 100644 --- a/libpcsxcore/debug.c +++ b/libpcsxcore/debug.c @@ -396,7 +396,7 @@ void ProcessDebug() { if ((psxRegs.code >> 26) == 3) { MarkMap(_JumpTarget_, MAP_EXEC_JAL); } - if (((psxRegs.code >> 26) == 0) && ((psxRegs.code && 0x3F) == 9)) { + if (((psxRegs.code >> 26) == 0) && ((psxRegs.code & 0x3F) == 9)) { MarkMap(_Rd_, MAP_EXEC_JAL); } } diff --git a/libpcsxcore/ix86/iR3000A.c b/libpcsxcore/ix86/iR3000A.c index a1c761ec..f743d06b 100644 --- a/libpcsxcore/ix86/iR3000A.c +++ b/libpcsxcore/ix86/iR3000A.c @@ -330,6 +330,7 @@ void iLogM32(u32 mem) { ADD32ItoR(ESP, 4*2); } +#if 0 static void iDumpRegs() { int i, j; @@ -340,6 +341,7 @@ static void iDumpRegs() { printf("\n"); } } +#endif void iDumpBlock(char *ptr) { FILE *f; @@ -1628,6 +1630,7 @@ void recLWL() { } } +#if 0 static void recLWBlock(int count) { u32 *code = (u32 *)PSXM(pc); int i, respsave; @@ -1702,6 +1705,7 @@ static void recLWBlock(int count) { x86SetJ32(j32Ptr[5]); resp = respsave; } +#endif extern u32 LWR_MASK[4]; extern u32 LWR_SHIFT[4]; @@ -1983,6 +1987,7 @@ static void recSW() { } //#endif +#if 0 static void recSWBlock(int count) { u32 *code; int i, respsave; @@ -2050,6 +2055,7 @@ static void recSWBlock(int count) { x86SetJ32(j32Ptr[5]); resp = respsave; } +#endif extern u32 SWL_MASK[4]; extern u32 SWL_SHIFT[4]; diff --git a/libpcsxcore/ix86_64/iR3000A-64.c b/libpcsxcore/ix86_64/iR3000A-64.c index 9c5721af..a9a66b7a 100644 --- a/libpcsxcore/ix86_64/iR3000A-64.c +++ b/libpcsxcore/ix86_64/iR3000A-64.c @@ -343,6 +343,7 @@ void iLogM32(u32 mem) { ADD32ItoR(ESP, 8*2); } +#if 0 static void iDumpRegs() { int i, j; @@ -353,6 +354,7 @@ static void iDumpRegs() { printf("\n"); } } +#endif void iDumpBlock(char *ptr) { FILE *f; @@ -2942,7 +2944,7 @@ static void recRecompile() { x86Align(32); ptr = x86Ptr; - PC_RECP(psxRegs.pc) = x86Ptr; + PC_RECP(psxRegs.pc) = (uptr)x86Ptr; pc = psxRegs.pc; pcold = pc; diff --git a/libpcsxcore/mdec.c b/libpcsxcore/mdec.c index 18c8ea13..f8fa31b7 100644 --- a/libpcsxcore/mdec.c +++ b/libpcsxcore/mdec.c @@ -324,7 +324,7 @@ unsigned short *rl2blk(int *blk, unsigned short *mdec_rl) { #define CLAMP_SCALE8(a) (CLAMP8(SCALE8(a))) #define CLAMP_SCALE5(a) (CLAMP5(SCALE5(a))) -inline void putlinebw15(u16 *image, int *Yblk) { +static inline void putlinebw15(u16 *image, int *Yblk) { int i; int A = (mdec.reg0 & MDEC0_STP) ? 0x8000 : 0; @@ -335,7 +335,7 @@ inline void putlinebw15(u16 *image, int *Yblk) { } } -inline void putquadrgb15(u16 *image, int *Yblk, int Cr, int Cb) { +static inline void putquadrgb15(u16 *image, int *Yblk, int Cr, int Cb) { int Y, R, G, B; int A = (mdec.reg0 & MDEC0_STP) ? 0x8000 : 0; R = MULR(Cr); @@ -353,7 +353,7 @@ inline void putquadrgb15(u16 *image, int *Yblk, int Cr, int Cb) { image[17] = MAKERGB15(CLAMP_SCALE5(Y + R), CLAMP_SCALE5(Y + G), CLAMP_SCALE5(Y + B), A); } -inline void yuv2rgb15(int *blk, unsigned short *image) { +static inline void yuv2rgb15(int *blk, unsigned short *image) { int x, y; int *Yblk = blk + DSIZE2 * 2; int *Crblk = blk; @@ -376,7 +376,7 @@ inline void yuv2rgb15(int *blk, unsigned short *image) { } } -inline void putlinebw24(u8 * image, int *Yblk) { +static inline void putlinebw24(u8 * image, int *Yblk) { int i; unsigned char Y; for (i = 0; i < 8 * 3; i += 3, Yblk++) { @@ -387,7 +387,7 @@ inline void putlinebw24(u8 * image, int *Yblk) { } } -inline void putquadrgb24(u8 * image, int *Yblk, int Cr, int Cb) { +static inline void putquadrgb24(u8 * image, int *Yblk, int Cr, int Cb) { int Y, R, G, B; R = MULR(Cr); diff --git a/libpcsxcore/psxcounters.c b/libpcsxcore/psxcounters.c index 454a5e55..51694aa4 100644 --- a/libpcsxcore/psxcounters.c +++ b/libpcsxcore/psxcounters.c @@ -101,7 +101,7 @@ void verboseLog( s32 level, const char *str, ... ) vsnprintf( buf, sizeof(buf), str, va ); va_end( va ); - printf( buf ); + printf( "%s", buf ); fflush( stdout ); } } diff --git a/libpcsxcore/psxhw.c b/libpcsxcore/psxhw.c index bd6a14c9..77e1fd02 100644 --- a/libpcsxcore/psxhw.c +++ b/libpcsxcore/psxhw.c @@ -24,7 +24,7 @@ #include "psxhw.h" #include "mdec.h" #include "cdrom.h" -#include "gpu.h" +#include "gpu.h" void psxHwReset() { if (Config.Sio) psxHu32ref(0x1070) |= SWAP32(0x80); @@ -41,9 +41,9 @@ u8 psxHwRead8(u32 add) { unsigned char hard; switch (add) { - case 0x1f801040: hard = sioRead8();break; + case 0x1f801040: hard = sioRead8();break; #ifdef ENABLE_SIO1API - case 0x1f801050: hard = SIO1_readData8(); break; + case 0x1f801050: hard = SIO1_readData8(); break; #endif case 0x1f801800: hard = cdrRead0(); break; case 0x1f801801: hard = cdrRead1(); break; @@ -106,7 +106,7 @@ u16 psxHwRead16(u32 add) { #ifdef PAD_LOG PAD_LOG("sio read16 %x; ret = %x\n", add&0xf, hard); #endif - return hard; + return hard; #ifdef ENABLE_SIO1API case 0x1f801050: hard = SIO1_readData16(); @@ -119,7 +119,7 @@ u16 psxHwRead16(u32 add) { return hard; case 0x1f80105e: hard = SIO1_readBaud16(); - return hard; + return hard; #endif case 0x1f801100: hard = psxRcntRcount(0); @@ -209,11 +209,11 @@ u32 psxHwRead32(u32 add) { #ifdef PAD_LOG PAD_LOG("sio read32 ;ret = %x\n", hard); #endif - return hard; + return hard; #ifdef ENABLE_SIO1API case 0x1f801050: hard = SIO1_readData32(); - return hard; + return hard; #endif #ifdef PSXHW_LOG case 0x1f801060: @@ -349,9 +349,9 @@ u32 psxHwRead32(u32 add) { void psxHwWrite8(u32 add, u8 value) { switch (add) { - case 0x1f801040: sioWrite8(value); break; + case 0x1f801040: sioWrite8(value); break; #ifdef ENABLE_SIO1API - case 0x1f801050: SIO1_writeData8(value); break; + case 0x1f801050: SIO1_writeData8(value); break; #endif case 0x1f801800: cdrWrite0(value); break; case 0x1f801801: cdrWrite1(value); break; @@ -403,7 +403,7 @@ void psxHwWrite16(u32 add, u16 value) { #ifdef PAD_LOG PAD_LOG ("sio write16 %x, %x\n", add&0xf, value); #endif - return; + return; #ifdef ENABLE_SIO1API case 0x1f801050: SIO1_writeData16(value); @@ -416,7 +416,7 @@ void psxHwWrite16(u32 add, u16 value) { return; case 0x1f80105e: SIO1_writeBaud16(value); - return; + return; #endif case 0x1f801070: #ifdef PSXHW_LOG @@ -518,11 +518,11 @@ void psxHwWrite32(u32 add, u32 value) { #ifdef PAD_LOG PAD_LOG("sio write32 %x\n", value); #endif - return; + return; #ifdef ENABLE_SIO1API case 0x1f801050: SIO1_writeData32(value); - return; + return; #endif #ifdef PSXHW_LOG case 0x1f801060: @@ -725,19 +725,19 @@ void psxHwWrite32(u32 add, u32 value) { psxRcntWtarget(2, value & 0xffff); return; default: - // Dukes of Hazard 2 - car engine noise - if (add>=0x1f801c00 && add<0x1f801e00) { - SPU_writeRegister(add, value&0xffff); - - add += 2; - value >>= 16; - - if (add>=0x1f801c00 && add<0x1f801e00) - SPU_writeRegister(add, value&0xffff); - return; - } - - + // Dukes of Hazard 2 - car engine noise + if (add>=0x1f801c00 && add<0x1f801e00) { + SPU_writeRegister(add, value&0xffff); + + add += 2; + value >>= 16; + + if (add>=0x1f801c00 && add<0x1f801e00) + SPU_writeRegister(add, value&0xffff); + return; + } + + psxHu32ref(add) = SWAPu32(value); #ifdef PSXHW_LOG PSXHW_LOG("*Unknown 32bit write at address %x value %x\n", add, value); diff --git a/libpcsxcore/psxinterpreter.c b/libpcsxcore/psxinterpreter.c index 1f7514b2..b2954b4c 100644 --- a/libpcsxcore/psxinterpreter.c +++ b/libpcsxcore/psxinterpreter.c @@ -38,7 +38,7 @@ static u32 branchPC; #define debugI() #endif -inline void execI(); +static inline void execI(); // Subsets void (*psxBSC[64])(); @@ -409,7 +409,7 @@ static int psxDelayBranchTest(u32 tar1) { return psxDelayBranchExec(tmp2); } -__inline void doBranch(u32 tar) { +static __inline void doBranch(u32 tar) { u32 *code; u32 tmp; @@ -910,7 +910,7 @@ void psxTestSWInts() { } } -__inline void MTC0(int reg, u32 val) { +static __inline void MTC0(int reg, u32 val) { // SysPrintf("MTC0 %d: %x\n", reg, val); switch (reg) { case 12: // Status @@ -1087,7 +1087,7 @@ static void intShutdown() { } // interpreter execution -inline void execI() { +static inline void execI() { u32 *code = Read_ICache(psxRegs.pc, FALSE); psxRegs.code = ((code == NULL) ? 0 : SWAP32(*code)); -- cgit v1.2.3