From ceb18a8752b435f0b2a6f4ea2ad33acf16119529 Mon Sep 17 00:00:00 2001 From: suzukiplan Date: Sat, 7 Jan 2023 23:29:05 +0900 Subject: [PATCH] Corrected a degrade in version 1.9.0 --- CHANGELOG.md | 6 ++++++ test/test-repio.cpp | 8 ++++---- test/test-repio.txt | 12 ++++++------ z80.hpp | 2 +- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f190280..a198fea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change log +## Version 1.9.1 (Jan 7, 2023 JST) + +- Corrected a degrade in version 1.9.0 + - `INI`, `INIR`, `IND` and `INDR` -> post decrement the B register (revert to 1.8.0) + - `OUTI`, `OTIR`, `OUTD` and `OTDR` -> pre-decrement the B register (keep 1.9.0) + ## Version 1.9.0 (Jan 7, 2023 JST) - Modify the timing of decrementing the B register with the repeat I/O operands (`INI`, `INIR`, `IND`, `INDR`, `OUTI`, `OTIR`, `OUTD` and `OTDR`). _(NOTE: **Destructive** change)_ diff --git a/test/test-repio.cpp b/test/test-repio.cpp index 3dbf69c..8679983 100644 --- a/test/test-repio.cpp +++ b/test/test-repio.cpp @@ -21,12 +21,12 @@ int main() 0xED, 0xBB, // OTDR }; unsigned short expectPorts[] = { - 0x0210, + 0x0310, + 0x0220, 0x0120, - 0x0020, - 0x0230, + 0x0330, + 0x0240, 0x0140, - 0x0040, 0x0250, 0x0160, 0x0060, diff --git a/test/test-repio.txt b/test/test-repio.txt index 04172e3..9af0fe5 100644 --- a/test/test-repio.txt +++ b/test/test-repio.txt @@ -1,18 +1,18 @@ [0000] LD BC<$0000>, $0310 -IN port A <- $0210 +IN port A <- $0310 [0003] INI ... (HL<$0000>) <- p(C<$10>) = $00 [B<$02>] [0005] LD BC<$0210>, $0220 -IN port A <- $0120 +IN port A <- $0220 [0008] INIR ... (HL<$0001>) <- p(C<$20>) = $00 [B<$01>] -IN port A <- $0020 +IN port A <- $0120 [0008] INIR ... (HL<$0002>) <- p(C<$20>) = $00 [B<$00>] [000A] LD BC<$0020>, $0330 -IN port A <- $0230 +IN port A <- $0330 [000D] IND ... (HL<$0003>) <- p(C<$30>) = $00 [B<$02>] [000F] LD BC<$0230>, $0240 -IN port A <- $0140 +IN port A <- $0240 [0012] INDR ... (HL<$0002>) <- p(C<$40>) = $00 [B<$01>] -IN port A <- $0040 +IN port A <- $0140 [0012] INDR ... (HL<$0001>) <- p(C<$40>) = $00 [B<$00>] [0014] LD BC<$0040>, $0350 [0017] OUTI ... p(C<$50>) <- (HL<$0000>) <$01> [B<$03>] diff --git a/z80.hpp b/z80.hpp index 9744c20..0036843 100644 --- a/z80.hpp +++ b/z80.hpp @@ -4875,8 +4875,8 @@ class Z80 inline void repeatIN(bool isIncHL, bool isRepeat) { reg.WZ = (unsigned short)(getBC() + (isIncHL ? 1 : -1)); - decrementB_forRepeatIO(); unsigned char i = inPort(reg.pair.C); + decrementB_forRepeatIO(); unsigned short hl = getHL(); if (isDebug()) { if (isIncHL) {