From 1546496fa818dc51e763c37f4f2e2456dafa4e13 Mon Sep 17 00:00:00 2001 From: notaz Date: Mon, 11 Mar 2024 01:28:41 +0200 Subject: [PATCH] psxhw: adjust sio stat libretro/pcsx_rearmed#822 --- libpcsxcore/new_dynarec/pcsxmem.c | 7 +------ libpcsxcore/psxhw.c | 8 +++++++- libpcsxcore/psxhw.h | 1 + 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/libpcsxcore/new_dynarec/pcsxmem.c b/libpcsxcore/new_dynarec/pcsxmem.c index 905f3a2ca..151fb4bba 100644 --- a/libpcsxcore/new_dynarec/pcsxmem.c +++ b/libpcsxcore/new_dynarec/pcsxmem.c @@ -97,11 +97,6 @@ static void io_write_sio32(u32 value) sioWrite8((unsigned char)(value >> 24)); } -static u32 io_read_sio2_status() -{ - return 0x80; -} - #if !defined(DRC_DBG) && defined(__arm__) static void map_rcnt_rcount0(u32 mode) @@ -386,7 +381,7 @@ void new_dyna_pcsx_mem_init(void) map_item(&mem_iortab[IOMEM16(0x1048)], sioReadMode16, 1); map_item(&mem_iortab[IOMEM16(0x104a)], sioReadCtrl16, 1); map_item(&mem_iortab[IOMEM16(0x104e)], sioReadBaud16, 1); - map_item(&mem_iortab[IOMEM16(0x1054)], io_read_sio2_status, 1); + map_item(&mem_iortab[IOMEM16(0x1054)], sio1ReadStat16, 1); map_item(&mem_iortab[IOMEM16(0x1100)], psxRcntRcount0, 1); map_item(&mem_iortab[IOMEM16(0x1104)], io_rcnt_read_mode0, 1); map_item(&mem_iortab[IOMEM16(0x1108)], io_rcnt_read_target0, 1); diff --git a/libpcsxcore/psxhw.c b/libpcsxcore/psxhw.c index 0a468753a..678811243 100644 --- a/libpcsxcore/psxhw.c +++ b/libpcsxcore/psxhw.c @@ -117,6 +117,12 @@ u32 psxHwReadGpuSR(void) return v; } +u32 sio1ReadStat16(void) +{ + // Armored Core, F1 Link cable misdetection + return 0xa0; +} + u8 psxHwRead8(u32 add) { u8 hard; @@ -180,7 +186,7 @@ u16 psxHwRead16(u32 add) { case 0x1048: hard = sioReadMode16(); break; case 0x104a: hard = sioReadCtrl16(); break; case 0x104e: hard = sioReadBaud16(); break; - case 0x1054: hard = 0x80; break; // Armored Core Link cable misdetection + case 0x1054: hard = sio1ReadStat16(); break; case 0x1100: hard = psxRcntRcount0(); break; case 0x1104: hard = psxRcntRmode(0); break; case 0x1108: hard = psxRcntRtarget(0); break; diff --git a/libpcsxcore/psxhw.h b/libpcsxcore/psxhw.h index 3017c9011..b2dcee62b 100644 --- a/libpcsxcore/psxhw.h +++ b/libpcsxcore/psxhw.h @@ -80,6 +80,7 @@ u32 psxHwRead32(u32 add); void psxHwWrite8(u32 add, u32 value); void psxHwWrite16(u32 add, u32 value); void psxHwWrite32(u32 add, u32 value); +u32 sio1ReadStat16(void); int psxHwFreeze(void *f, int Mode); void psxHwWriteIstat(u32 value);