Skip to content

Commit

Permalink
CSimulator: Fix how 'BIT n,(IX/Y+d)' affects bits 3 and 5 of the flags
Browse files Browse the repository at this point in the history
  • Loading branch information
skoolkid committed Aug 13, 2024
1 parent 1943199 commit cca6324
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion c/csimulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ static void bit_xy(CSimulatorObject* self, void* lookup, int args[]) {
}
#endif
byte value = BIT[REG(F) & 1][b][PEEK(addr)];
LD(F, (value & 0xD7) + ((xy / 256) & 0x28));
LD(F, (value & 0xD7) + ((addr / 256) & 0x28));

INC_R(2);
INC_T(20);
Expand Down
2 changes: 2 additions & 0 deletions sphinx/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Changelog
-----
* Fixed how the 'ADC A,*', 'SBC A,*', 'ADC HL,rr' and 'SBC HL,rr' instructions
affect the half-carry flag
* Fixed how 'BIT n,(IX/Y+d)' affects bits 3 and 5 of the flags in the C version
of the Z80 simulator

9.3 (2024-08-10)
----------------
Expand Down

0 comments on commit cca6324

Please sign in to comment.