From 580447173e4fd6783544054706f91e3afe1d933e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Sainz=20de=20Baranda=20y=20Go=C3=B1i?= Date: Sun, 3 Dec 2023 18:00:00 +0100 Subject: cpu/z80: Update WZ during in block I/O instructions. (#11812) The inir, indr, otir and otdr instructions modify WZ when updating PC when the repeat condition is met. --- src/devices/cpu/z80/z80.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/devices/cpu/z80/z80.cpp b/src/devices/cpu/z80/z80.cpp index 67aaa59f8b9..84baa3e3904 100644 --- a/src/devices/cpu/z80/z80.cpp +++ b/src/devices/cpu/z80/z80.cpp @@ -1299,6 +1299,7 @@ inline void z80_device::inir() { nomreq_addr(HL, 5); PC -= 2; + WZ = PC + 1; block_io_interrupted_flags(data); } } @@ -1313,6 +1314,7 @@ inline void z80_device::otir() { nomreq_addr(BC, 5); PC -= 2; + WZ = PC + 1; block_io_interrupted_flags(data); } } @@ -1359,6 +1361,7 @@ inline void z80_device::indr() { nomreq_addr(HL, 5); PC -= 2; + WZ = PC + 1; block_io_interrupted_flags(data); } } @@ -1373,6 +1376,7 @@ inline void z80_device::otdr() { nomreq_addr(BC, 5); PC -= 2; + WZ = PC + 1; block_io_interrupted_flags(data); } } -- cgit v1.2.3