core, TH input latency only if output was low

This commit is contained in:
kub 2022-10-04 21:11:26 +00:00
parent 6c6d449ec5
commit e2a5b098e0

View file

@ -416,8 +416,8 @@ NOINLINE void io_ports_write(u32 a, u32 d)
// after switching TH to input there's a latency before the pullup value is // after switching TH to input there's a latency before the pullup value is
// read back as input (see Decap Attack, not in Samurai Showdown, 32x WWF Raw) // read back as input (see Decap Attack, not in Samurai Showdown, 32x WWF Raw)
if (4 <= a && a <= 5) { if (4 <= a && a <= 5) {
if ((PicoMem.ioports[a] & 0x40) && !(d & 0x40)) if ((PicoMem.ioports[a] & 0x40) && !(d & 0x40) && !(PicoMem.ioports[a - 3] & 0x40))
// latency after switching to input // latency after switching to input and output was low
padTHLatency[a - 4] = SekCyclesDone() + 25; padTHLatency[a - 4] = SekCyclesDone() + 25;
} }