aboutsummaryrefslogtreecommitdiff
path: root/libpcsxcore
diff options
context:
space:
mode:
authorgameblabla2019-07-21 05:39:55 +0200
committergameblabla2019-07-21 05:39:55 +0200
commitbf643fd9c59939266ee95021292a08b5d20a250e (patch)
treeaa373c7dd1a4f08eaf0aab3fa5541c76b143a779 /libpcsxcore
parent18dd7e9e0fa02a4aaf7ce553c4706c60bca312c3 (diff)
downloadpcsx_rearmed-bf643fd9c59939266ee95021292a08b5d20a250e.tar.gz
pcsx_rearmed-bf643fd9c59939266ee95021292a08b5d20a250e.tar.bz2
pcsx_rearmed-bf643fd9c59939266ee95021292a08b5d20a250e.zip
psxbios: Some games read from address 0, fix that.
See Garbage Area at Address 00000000h in Nocash PSX Specifications for more inf> R-types will refuse to boot if psxM[0] is zero. Fade to Black can crash upon memory card access if psxM[5] is set to the wrong > Crash Team Racing will refuse to boot if psxM[2] and psxM[3] are not zero. (Previously, that region of memory would be overwritten above. No explanation why.) It's set as such according to nocash : [00000000h]=3C1A0000h ;<-- but overwritten by 00000003h after soon [00000004h]=275A0C80h ;<-- or 275A0C50h (in older BIOS) [00000008h]=03400008h [0000000Ch]=00000000h Note that setting 00000000h to 00000003h doesn't work for R-types.
Diffstat (limited to 'libpcsxcore')
-rw-r--r--libpcsxcore/psxbios.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c
index ca15943..7b2c05f 100644
--- a/libpcsxcore/psxbios.c
+++ b/libpcsxcore/psxbios.c
@@ -3052,7 +3052,9 @@ void psxBiosInit() {
*/
// opcode HLE
psxRu32ref(0x0000) = SWAPu32((0x3b << 26) | 4);
- psxMu32ref(0x0000) = SWAPu32((0x3b << 26) | 0);
+ /* Whatever this does, it actually breaks CTR, even without the uninitiliazed memory patch.
+ Normally games shouldn't read from address 0 yet they do. See explanation below in details. */
+ //psxMu32ref(0x0000) = SWAPu32((0x3b << 26) | 0);
psxMu32ref(0x00a0) = SWAPu32((0x3b << 26) | 1);
psxMu32ref(0x00b0) = SWAPu32((0x3b << 26) | 2);
psxMu32ref(0x00c0) = SWAPu32((0x3b << 26) | 3);
@@ -3078,6 +3080,21 @@ void psxBiosInit() {
psxHu32ref(0x1060) = SWAPu32(0x00000b88);
hleSoftCall = FALSE;
+
+ /* Some games like R-Types, CTR, Fade to Black read from adress 0x00000000 due to uninitialized pointers.
+ See Garbage Area at Address 00000000h in Nocash PSX Specfications for more information.
+ R-type will work if PsxM[0] is non-zero. (Meaning that it should not be 00000003h as he implies).
+ Crash Team Racing will refuse to boot if psxM[2] and psx[3] are not set to 0.
+ Fade to Black can crash upon memory card access if byte 5 is set to the wrong value.
+ */
+ psxM[0] = SWAPu32(0x3C);
+ psxM[1] = SWAPu32(0x1A);
+ psxM[2] = SWAPu32(0x00);
+ psxM[3] = SWAPu32(0x00);
+ psxM[4] = SWAPu32(0x27);
+ psxM[5] = SWAPu32(0x5A);
+ psxM[6] = SWAPu32(0x0C);
+ psxM[7] = SWAPu32(0x80);
}
void psxBiosShutdown() {