Skip to content

Commit

Permalink
Merge pull request #53 from suzukiplan/1.9.1
Browse files Browse the repository at this point in the history
Corrected a degrade in version 1.9.0
  • Loading branch information
suzukiplan authored Jan 7, 2023
2 parents 253627b + ceb18a8 commit ebade12
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)_
Expand Down
8 changes: 4 additions & 4 deletions test/test-repio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions test/test-repio.txt
Original file line number Diff line number Diff line change
@@ -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>]
Expand Down
2 changes: 1 addition & 1 deletion z80.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ebade12

Please sign in to comment.