Ok.. What are they actually using the PIO stuff for on the system?
It is used as an interrupt controller receiving the INT pins from both V9938s. I added logging to demonstrate how fucked up the V9938 interrupt callbacks are:
VINT2 1 y 136 frame 5 VINT2 0 y 155 frame 5 VINT2 1 y 454 frame 5 VINT2 0 y 268 frame 130 VINT2 1 y 454 frame 130 VINT2 0 y 382 frame 255 VINT2 1 y 454 frame 255 VINT2 0 y 16 frame 381 VINT2 1 y 454 frame 381 VINT2 0 y 126 frame 506 VINT2 1 y 454 frame 506 VINT2 0 y 237 frame 631 VINT2 1 y 454 frame 631 VINT2 0 y 347 frame 756 VINT2 1 y 454 frame 756 VINT2 0 y 468 frame 881 VINT2 1 y 454 frame 882
If the Z80 code is expecting a 60 Hz interrupt, this might throw it off a bit.