Skip to content

Commit

Permalink
psxhw: adjust sio stat
Browse files Browse the repository at this point in the history
  • Loading branch information
notaz committed Mar 10, 2024
1 parent 9aefd42 commit 1546496
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 1 addition & 6 deletions libpcsxcore/new_dynarec/pcsxmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 7 additions & 1 deletion libpcsxcore/psxhw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions libpcsxcore/psxhw.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1546496

Please sign in to comment.