aboutsummaryrefslogtreecommitdiff
path: root/libpcsxcore/psxbios.c
diff options
context:
space:
mode:
authorgameblabla2019-07-22 23:25:49 +0200
committergameblabla2019-07-22 23:25:49 +0200
commit1059caaf959bf28d2cd1020b8bc30d33fb71ed93 (patch)
tree0b5414527071a37e29c9fcc761c342c2f903c6a2 /libpcsxcore/psxbios.c
parent339cc5b6c622b9e4544e67239c048d39f245390b (diff)
downloadpcsx_rearmed-1059caaf959bf28d2cd1020b8bc30d33fb71ed93.tar.gz
pcsx_rearmed-1059caaf959bf28d2cd1020b8bc30d33fb71ed93.tar.bz2
pcsx_rearmed-1059caaf959bf28d2cd1020b8bc30d33fb71ed93.zip
psxbios: Don't accept 400h as a valid sector.
Notaz said this could corrupt the emulator (even though the console allowed this and it was a bug) so limit it to 0x3FF.
Diffstat (limited to 'libpcsxcore/psxbios.c')
-rw-r--r--libpcsxcore/psxbios.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c
index 8c8093b..928f0af 100644
--- a/libpcsxcore/psxbios.c
+++ b/libpcsxcore/psxbios.c
@@ -2450,8 +2450,11 @@ void psxBios__card_write() { // 0x4e
#ifdef PSXBIOS_LOG
PSXBIOS_LOG("psxBios_%s: %x,%x,%x\n", biosB0n[0x4e], a0, a1, a2);
#endif
- /* Function also accepts sector 400h (a bug) */
- if (!(a1 <= 0x400))
+ /*
+ Function also accepts sector 400h (a bug).
+ But notaz said we shouldn't allow sector 400h because it can corrupt the emulator.
+ */
+ if (!(a1 <= 0x3FF))
{
/* Invalid sectors */
v0 = 0; pc0 = ra;
@@ -2483,8 +2486,11 @@ void psxBios__card_read() { // 0x4f
#ifdef PSXBIOS_LOG
PSXBIOS_LOG("psxBios_%s\n", biosB0n[0x4f]);
#endif
- /* Function also accepts sector 400h (a bug) */
- if (!(a1 <= 0x400))
+ /*
+ Function also accepts sector 400h (a bug).
+ But notaz said we shouldn't allow sector 400h because it can corrupt the emulator.
+ */
+ if (!(a1 <= 0x3FF))
{
/* Invalid sectors */
v0 = 0; pc0 = ra;