summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/z80/z80.h
diff options
context:
space:
mode:
author holub <andrei.holub@gmail.com>2022-04-25 12:08:07 -0400
committer GitHub <noreply@github.com>2022-04-26 02:08:07 +1000
commit44dae68dbb5cd5d9fbb56e919e7bb59644830d2c (patch)
tree16e83588992432d59667aa8b64a24f246746ff55 /src/devices/cpu/z80/z80.h
parentd7cfc3c187f41ce37a3269c84b184b4474a8ef35 (diff)
cpu/z80: Improved timing within instructions. (#9449)
This allows improved emulation of bus contention in the ZX Spectrum family. Also updated Z80 timings for MSX, Amstrad CPC, and Sega System 1/System 2.
Diffstat (limited to 'src/devices/cpu/z80/z80.h')
-rw-r--r--src/devices/cpu/z80/z80.h41
1 files changed, 24 insertions, 17 deletions
diff --git a/src/devices/cpu/z80/z80.h b/src/devices/cpu/z80/z80.h
index 8e82ccd3353..08eba4eb1d6 100644
--- a/src/devices/cpu/z80/z80.h
+++ b/src/devices/cpu/z80/z80.h
@@ -38,6 +38,7 @@ public:
template <typename... T> void set_io_map(T &&... args) { set_addrmap(AS_IO, std::forward<T>(args)...); }
auto irqack_cb() { return m_irqack_cb.bind(); }
auto refresh_cb() { return m_refresh_cb.bind(); }
+ auto nomreq_cb() { return m_nomreq_cb.bind(); }
auto halt_cb() { return m_halt_cb.bind(); }
protected:
@@ -149,9 +150,11 @@ protected:
uint8_t in(uint16_t port);
void out(uint16_t port, uint8_t value);
virtual uint8_t rm(uint16_t addr);
+ uint8_t rm_reg(uint16_t addr);
void rm16(uint16_t addr, PAIR &r);
virtual void wm(uint16_t addr, uint8_t value);
void wm16(uint16_t addr, PAIR &r);
+ void wm16back(uint16_t addr, PAIR &r);
virtual uint8_t rop();
virtual uint8_t arg();
virtual uint16_t arg16();
@@ -232,6 +235,8 @@ protected:
virtual void check_interrupts();
void take_interrupt();
void take_nmi();
+ void nomreq_ir(s8 cycles);
+ void nomreq_addr(u16 addr, s8 cycles);
// address spaces
const address_space_config m_program_config;
@@ -244,22 +249,23 @@ protected:
devcb_write_line m_irqack_cb;
devcb_write8 m_refresh_cb;
+ devcb_write8 m_nomreq_cb;
devcb_write_line m_halt_cb;
- PAIR m_prvpc;
- PAIR m_pc;
- PAIR m_sp;
- PAIR m_af;
- PAIR m_bc;
- PAIR m_de;
- PAIR m_hl;
- PAIR m_ix;
- PAIR m_iy;
- PAIR m_wz;
- PAIR m_af2;
- PAIR m_bc2;
- PAIR m_de2;
- PAIR m_hl2;
+ PAIR m_prvpc;
+ PAIR m_pc;
+ PAIR m_sp;
+ PAIR m_af;
+ PAIR m_bc;
+ PAIR m_de;
+ PAIR m_hl;
+ PAIR m_ix;
+ PAIR m_iy;
+ PAIR m_wz;
+ PAIR m_af2;
+ PAIR m_bc2;
+ PAIR m_de2;
+ PAIR m_hl2;
uint8_t m_r;
uint8_t m_r2;
uint8_t m_iff1;
@@ -270,13 +276,14 @@ protected:
uint8_t m_nmi_state; /* nmi line state */
uint8_t m_nmi_pending; /* nmi pending */
uint8_t m_irq_state; /* irq line state */
- int m_wait_state; // wait line state
- int m_busrq_state; // bus request line state
+ int m_wait_state; // wait line state
+ int m_busrq_state; // bus request line state
uint8_t m_after_ei; /* are we in the EI shadow? */
uint8_t m_after_ldair; /* same, but for LD A,I or LD A,R */
uint32_t m_ea;
- int m_icount;
+ int m_icount;
+ int m_icount_executing;
uint8_t m_rtemp;
const uint8_t * m_cc_op;
const uint8_t * m_cc_cb;