27 void printStatus()
const;
28 [[nodiscard]] u16 get_pc()
const;
29 void set_pc(u16 value) { PC = value; }
30 [[nodiscard]] u16 get_sp()
const;
31 void set_sp(u16 value) { SP = value; }
33 [[nodiscard]] u16 get_bc()
const {
return (B << 8) | C; }
34 [[nodiscard]] u16 get_de()
const {
return (D << 8) | E; }
35 [[nodiscard]] u16 get_hl()
const {
return (H << 8) | L; }
36 [[nodiscard]] u16 get_af()
const {
return (A << 8) | F; }
39 [[nodiscard]]
bool get_flag_z()
const {
return (F >> 7) & 1; }
40 [[nodiscard]]
bool get_flag_n()
const {
return (F >> 6) & 1; }
41 [[nodiscard]]
bool get_flag_h()
const {
return (F >> 5) & 1; }
42 [[nodiscard]]
bool get_flag_c()
const {
return (F >> 4) & 1; }
46 void check_interrupts(
MMU &mmu);
47 void execute_interrupt(
MMU &mmu, u16 address,
int bit);
49 int last_instr_cycles = 0;
52 void setHalt(
bool newValue);
54 [[nodiscard]]
bool isHalt()
const;
56 void setIME(
bool newValue);
57 [[nodiscard]]
bool getIME()
const;
62 B, C, D, E, H, L, A, F
77 [[nodiscard]]
const u8& reg(Register r)
const;
90 void setFlag(Flag flag,
bool value)
92 const u8 mask = 1 <<
static_cast<int>(flag);
99 void setStop(
const bool value) { stop = value; }
100 [[nodiscard]]
bool isStop()
const {
return stop; }