Implement everything for Gameboy Doctor

This commit is contained in:
madmaurice 2023-09-01 23:19:02 +02:00
parent 66c19caaee
commit c52aa91f26
8 changed files with 136 additions and 14 deletions

View file

@ -23,6 +23,14 @@ u16 Cpu_state::getAF()
(carry ? 0x10 : 0);
}
u8 Cpu_state::getF()
{
return (zero ? 0x80 : 0) |
(subtract ? 0x40 : 0) |
(halfcarry ? 0x20 : 0) |
(carry ? 0x10 : 0);
}
u8& Cpu_state::reg8(Cpu& cpu, u8 idx)
{
switch(idx)

View file

@ -130,6 +130,7 @@ struct Cpu_state {
void setAF(u16 v);
u16 getAF();
u8 getF();
u8& reg8(Cpu& cpu, u8 idx);
u16& reg16(Cpu& cpu, u8 idx);