read_nothing\r
};\r
\r
+static int padTHLatency[3];\r
+\r
static NOINLINE u32 port_read(int i)\r
{\r
u32 data_reg = PicoMem.ioports[i + 1];\r
// disables output before doing TH-low read, so don't emulate it for TH.\r
// Decap Attack reportedly doesn't work on Nomad but works on must\r
// other MD revisions (different pull-up strength?).\r
- if (PicoIn.AHW & (PAHW_32X|PAHW_MCD)) // don't do it on 32X, it breaks WWF Raw\r
- out |= 0x7f & ~ctrl_reg;\r
- else\r
- out |= 0x3f & ~ctrl_reg;\r
+ u32 mask = 0x3f | (padTHLatency[i] < SekCyclesDone() ? 0x40 : 0);\r
+ out |= mask & ~ctrl_reg;\r
\r
in = port_readers[i](i, out);\r
\r
Pico.m.padTHPhase[a - 1]++;\r
}\r
\r
+ // after pulling down TH there's a latency before the new value can be read\r
+ // back as input (see Decap Attack, not in Samurai Showdown, 32x WWF Raw)\r
+ if (a >= 4 && a <= 5 && !(d & 0x40))\r
+ padTHLatency[a - 4] = SekCyclesDone() + 25;\r
+\r
// certain IO ports can be used as RAM\r
PicoMem.ioports[a] = d;\r
}\r