2 Skelton for retropc emulator
5 Author : Takeda.Toshiya
14 #include "i8080_base.h"
16 class I8080 : public I8080_BASE
19 /* ---------------------------------------------------------------------------
20 virtual machine interfaces
21 --------------------------------------------------------------------------- */
24 uint8_t __FASTCALL RM8(uint16_t addr) override
26 #ifdef I8080_MEMORY_WAIT
28 uint8_t val = d_mem->read_data8w(addr, &wait);
32 return d_mem->read_data8(addr);
35 void __FASTCALL WM8(uint16_t addr, uint8_t val) override
37 #ifdef I8080_MEMORY_WAIT
39 d_mem->write_data8w(addr, val, &wait);
42 d_mem->write_data8(addr, val);
46 uint16_t __FASTCALL RM16(uint16_t addr) override
48 #ifdef I8080_MEMORY_WAIT
50 uint16_t val = d_mem->read_data16w(addr, &wait);
54 return d_mem->read_data16(addr);
57 void __FASTCALL WM16(uint16_t addr, uint16_t val) override
59 #ifdef I8080_MEMORY_WAIT
61 d_mem->write_data16w(addr, val, &wait);
64 d_mem->write_data16(addr, val);
67 uint8_t __FASTCALL FETCHOP() override
70 uint8_t val = d_mem->fetch_op(PC++, &wait);
71 #ifdef I8080_MEMORY_WAIT
76 uint8_t __FASTCALL FETCH8() override
78 #ifdef I8080_MEMORY_WAIT
80 uint8_t val = d_mem->read_data8w(PC++, &wait);
84 return d_mem->read_data8(PC++);
88 uint16_t __FASTCALL FETCH16() override
90 #ifdef I8080_MEMORY_WAIT
92 uint16_t val = d_mem->read_data16w(PC, &wait);
95 uint16_t val = d_mem->read_data16(PC);
100 uint16_t __FASTCALL POP16() override
102 #ifdef I8080_MEMORY_WAIT
104 uint16_t val = d_mem->read_data16w(SP, &wait);
107 uint16_t val = d_mem->read_data16(SP);
112 void __FASTCALL PUSH16(uint16_t val) override
115 #ifdef I8080_MEMORY_WAIT
117 d_mem->write_data16w(SP, val, &wait);
120 d_mem->write_data16(SP, val);
125 uint8_t __FASTCALL IN8(uint8_t addr) override
129 uint8_t val = d_io->read_io8w(addr, &wait);
133 return d_io->read_io8(addr);
136 void __FASTCALL OUT8(uint8_t addr, uint8_t val) override
140 d_io->write_io8w(addr, val, &wait);
143 d_io->write_io8(addr, val);
148 uint32_t __FASTCALL ACK_INTR() override
150 return d_pic->get_intr_ack();
154 void __FASTCALL dec_count(uint8_t code) override;
155 void __FASTCALL check_reg_c(uint8_t val) override;
156 void __FASTCALL check_reg_e(uint8_t val) override;
157 void __FASTCALL check_reg_l(uint8_t val) override;
158 void __FASTCALL check_reg_sp(uint8_t val) override;
159 void __FASTCALL INSN_0x08(void) override;
160 void __FASTCALL INSN_0x10(void) override;
161 void __FASTCALL RLDE(void) override;
162 void __FASTCALL RIM(void) override;
163 void __FASTCALL _DAA(void) override;
164 void __FASTCALL LDEH(void) override;
165 void __FASTCALL CMA(void) override;
166 void __FASTCALL SIM(void) override;
167 void __FASTCALL LDES(void) override;
168 void __FASTCALL INSN_0xcb(void) override;
169 void __FASTCALL INSN_0xd9(void) override;
170 void __FASTCALL INSN_0xdd(void) override;
171 void __FASTCALL INSN_0xed(void) override;
172 void __FASTCALL INSN_0xfd(void) override;
175 void __FASTCALL JMP(uint8_t c) override;
176 void __FASTCALL CALL(uint8_t c) override;
177 void __FASTCALL ANA(uint8_t n) override;
178 /* ---------------------------------------------------------------------------
180 --------------------------------------------------------------------------- */
181 void __FASTCALL run_one_opecode();
182 void check_interrupt();
183 //void OP(uint8_t code);
185 I8080(VM_TEMPLATE* parent_vm, EMU* parent_emu) : I8080_BASE(parent_vm, parent_emu)
188 set_device_name(_T("i8085 CPU"));
196 int __FASTCALL run(int clock);
197 void __FASTCALL write_signal(int id, uint32_t data, uint32_t mask);
198 bool process_state(FILEIO* state_fio, bool loading);
201 void set_context_debugger(DEBUGGER* device)