75 uint8_t half_carry_flag;
84 reg_pair af, bc, de, hl;
94 typedef int (*ReadByteCallback)(
void * context,
int addr);
95 typedef void (*WriteByteCallback)(
void * context,
int addr,
int value);
96 typedef int (*ReadWordCallback)(
void * context,
int addr);
97 typedef void (*WriteWordCallback)(
void * context,
int addr,
int value);
98 typedef int (*ReadIOCallback)(
void * context,
int addr);
99 typedef void (*WriteIOCallback)(
void * context,
int addr,
int value);
102 void setCallbacks(
void * context, ReadByteCallback readByte, WriteByteCallback writeByte, ReadWordCallback readWord, WriteWordCallback writeWord, ReadIOCallback readIO, WriteIOCallback writeIO) {
104 m_readByte = readByte;
105 m_writeByte = writeByte;
106 m_readWord = readWord;
107 m_writeWord = writeWord;
115 void setPC(
int addr) { cpu.pc.w = addr & 0xffff; }
116 int getPC() {
return cpu.pc.w; }
118 int regs_bc() {
return cpu.bc.w; }
119 int regs_de() {
return cpu.de.w; }
120 int regs_hl() {
return cpu.hl.w; }
121 int regs_sp() {
return cpu.sp.w; }
123 int regs_a() {
return cpu.af.b.h; }
124 int regs_b() {
return cpu.bc.b.h; }
125 int regs_c() {
return cpu.bc.b.l; }
126 int regs_d() {
return cpu.de.b.h; }
127 int regs_e() {
return cpu.de.b.l; }
128 int regs_h() {
return cpu.hl.b.h; }
129 int regs_l() {
return cpu.hl.b.l; }
135 void retrieve_flags();
152 ReadByteCallback m_readByte;
153 WriteByteCallback m_writeByte;
154 ReadWordCallback m_readWord;
155 WriteWordCallback m_writeWord;
156 ReadIOCallback m_readIO;
157 WriteIOCallback m_writeIO;