X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=libpcsxcore%2Fpsxhw.c;h=dbcb9892f4255ad0f2a35d5be6265e00d4808273;hp=6b9125d76b68b9a12bb42153aabc06c39f75254d;hb=3968e69e7fa8f9cb0d44ac79477d5929b9649271;hpb=9705788a21dc36515ba498d45ba2f197f7bcd628 diff --git a/libpcsxcore/psxhw.c b/libpcsxcore/psxhw.c index 6b9125d7..dbcb9892 100644 --- a/libpcsxcore/psxhw.c +++ b/libpcsxcore/psxhw.c @@ -44,7 +44,7 @@ void psxHwReset() { u8 psxHwRead8(u32 add) { unsigned char hard; - switch (add) { + switch (add & 0x1fffffff) { case 0x1f801040: hard = sioRead8();break; #ifdef ENABLE_SIO1API case 0x1f801050: hard = SIO1_readData8(); break; @@ -70,7 +70,7 @@ u8 psxHwRead8(u32 add) { u16 psxHwRead16(u32 add) { unsigned short hard; - switch (add) { + switch (add & 0x1fffffff) { #ifdef PSXHW_LOG case 0x1f801070: PSXHW_LOG("IREG 16bit read %x\n", psxHu16(0x1070)); return psxHu16(0x1070); @@ -123,7 +123,14 @@ u16 psxHwRead16(u32 add) { return hard; case 0x1f80105e: hard = SIO1_readBaud16(); - return hard; + return hard; +#else + /* Fixes Armored Core misdetecting the Link cable being detected. + * We want to turn that thing off and force it to do local multiplayer instead. + * Thanks Sony for the fix, they fixed it in their PS Classic fork. + */ + case 0x1f801054: + return 0x80; #endif case 0x1f801100: hard = psxRcntRcount(0); @@ -204,7 +211,7 @@ u16 psxHwRead16(u32 add) { u32 psxHwRead32(u32 add) { u32 hard; - switch (add) { + switch (add & 0x1fffffff) { case 0x1f801040: hard = sioRead8(); hard |= sioRead8() << 8; @@ -355,7 +362,7 @@ u32 psxHwRead32(u32 add) { } void psxHwWrite8(u32 add, u8 value) { - switch (add) { + switch (add & 0x1fffffff) { case 0x1f801040: sioWrite8(value); break; #ifdef ENABLE_SIO1API case 0x1f801050: SIO1_writeData8(value); break; @@ -379,7 +386,7 @@ void psxHwWrite8(u32 add, u8 value) { } void psxHwWrite16(u32 add, u16 value) { - switch (add) { + switch (add & 0x1fffffff) { case 0x1f801040: sioWrite8((unsigned char)value); sioWrite8((unsigned char)(value>>8)); @@ -493,7 +500,7 @@ void psxHwWrite16(u32 add, u16 value) { default: if (add>=0x1f801c00 && add<0x1f801e00) { - SPU_writeRegister(add, value); + SPU_writeRegister(add, value, psxRegs.cycle); return; } @@ -518,7 +525,7 @@ void psxHwWrite16(u32 add, u16 value) { } void psxHwWrite32(u32 add, u32 value) { - switch (add) { + switch (add & 0x1fffffff) { case 0x1f801040: sioWrite8((unsigned char)value); sioWrite8((unsigned char)((value&0xff) >> 8)); @@ -747,8 +754,8 @@ void psxHwWrite32(u32 add, u32 value) { default: // Dukes of Hazard 2 - car engine noise if (add>=0x1f801c00 && add<0x1f801e00) { - SPU_writeRegister(add, value&0xffff); - SPU_writeRegister(add + 2, value>>16); + SPU_writeRegister(add, value&0xffff, psxRegs.cycle); + SPU_writeRegister(add + 2, value>>16, psxRegs.cycle); return; }