From: notaz Date: Sun, 10 Mar 2024 23:28:41 +0000 (+0200) Subject: psxhw: adjust sio stat X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1546496fa818dc51e763c37f4f2e2456dafa4e13;p=pcsx_rearmed.git psxhw: adjust sio stat libretro/pcsx_rearmed#822 --- diff --git a/libpcsxcore/new_dynarec/pcsxmem.c b/libpcsxcore/new_dynarec/pcsxmem.c index 905f3a2c..151fb4bb 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 0a468753..67881124 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 3017c901..b2dcee62 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);