diff options
author | 2022-12-14 22:03:56 +0100 | |
---|---|---|
committer | 2023-02-22 11:29:45 +0100 | |
commit | 74971c2f530c0996dbb8112f227f4cfcaf4b0045 (patch) | |
tree | ed1af70fedce7bdae59d2364415db53dc7d4f5f1 /src/devices/machine | |
parent | b733fd4b4324ab269ad603d8a12d17bacf7fcd93 (diff) |
m68000: New implementation, generated from the micro/nanocode
Diffstat (limited to 'src/devices/machine')
-rw-r--r-- | src/devices/machine/68307.cpp | 55 | ||||
-rw-r--r-- | src/devices/machine/68307.h | 6 | ||||
-rw-r--r-- | src/devices/machine/68307bus.cpp | 24 | ||||
-rw-r--r-- | src/devices/machine/68307sim.cpp | 20 | ||||
-rw-r--r-- | src/devices/machine/68307tmu.cpp | 24 | ||||
-rw-r--r-- | src/devices/machine/68340.cpp | 4 | ||||
-rw-r--r-- | src/devices/machine/68340.h | 2 | ||||
-rw-r--r-- | src/devices/machine/mc68328.cpp | 23 | ||||
-rw-r--r-- | src/devices/machine/mc68328.h | 2 | ||||
-rw-r--r-- | src/devices/machine/scc68070.cpp | 24 | ||||
-rw-r--r-- | src/devices/machine/scc68070.h | 7 | ||||
-rw-r--r-- | src/devices/machine/tmp68301.cpp | 2 |
12 files changed, 105 insertions, 88 deletions
diff --git a/src/devices/machine/68307.cpp b/src/devices/machine/68307.cpp index 2a16def71d9..c955af42fcf 100644 --- a/src/devices/machine/68307.cpp +++ b/src/devices/machine/68307.cpp @@ -57,7 +57,7 @@ void m68307_cpu_device::device_add_mconfig(machine_config &config) m68307_cpu_device::m68307_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - m68000_device(mconfig, tag, owner, clock, M68307, 16, 24, address_map_constructor(FUNC(m68307_cpu_device::internal_map), this)), + m68000_device(mconfig, M68307, tag, owner, clock), m_write_irq(*this), m_write_a_tx(*this), m_write_b_tx(*this), @@ -79,6 +79,11 @@ m68307_cpu_device::m68307_cpu_device(const machine_config &mconfig, const char * m_ipl = 0; m_cpu_space_config.m_internal_map = address_map_constructor(FUNC(m68307_cpu_device::cpu_space_map), this); + auto imap = address_map_constructor(FUNC(m68307_cpu_device::internal_map), this); + m_program_config.m_internal_map = imap; + m_opcodes_config.m_internal_map = imap; + m_uprogram_config.m_internal_map = imap; + m_uopcodes_config.m_internal_map = imap; } @@ -101,7 +106,7 @@ void m68307_cpu_device::device_reset() set_ipl(0); } -void m68307_cpu_device::m68k_reset_peripherals() +WRITE_LINE_MEMBER(m68307_cpu_device::reset_peripherals) { m_duart->reset(); @@ -127,23 +132,6 @@ inline int m68307_cpu_device::calc_cs(offs_t address) const return 0; } -void m68307_cpu_device::init16_m68307(address_space &space) -{ - m_space = &space; - space.cache(m_oprogram16); - space.specific(m_program16); - - m_readimm16 = [this](offs_t address) -> u16 { /* m_m68307_currentcs = calc_cs(address); */ return m_oprogram16.read_word(address); }; - m_read8 = [this](offs_t address) -> u8 { /* m_m68307_currentcs = calc_cs(address); */ return m_program16.read_byte(address); }; - m_read16 = [this](offs_t address) -> u16 { /* m_m68307_currentcs = calc_cs(address); */ return m_program16.read_word(address); }; - m_read32 = [this](offs_t address) -> u32 { /* m_m68307_currentcs = calc_cs(address); */ return m_program16.read_dword(address); }; - m_write8 = [this](offs_t address, u8 data) { /* m_m68307_currentcs = calc_cs(address); */ m_program16.write_byte(address, data); }; - m_write16 = [this](offs_t address, u16 data) { /* m_m68307_currentcs = calc_cs(address); */ m_program16.write_word(address, data); }; - m_write32 = [this](offs_t address, u32 data) { /* m_m68307_currentcs = calc_cs(address); */ m_program16.write_dword(address, data); }; -} - - - void m68307_cpu_device::set_port_callbacks( porta_read_delegate &&porta_r, porta_write_delegate &&porta_w, @@ -242,14 +230,14 @@ uint8_t m68307_cpu_device::int_ack(offs_t offset) void m68307_cpu_device::device_start() { - init_cpu_m68000(); + reset_cb().append(FUNC(m68307_cpu_device::reset_peripherals)); + + m68000_device::device_start(); /* basic CS logic, timers, mbus, serial logic set via remappable register */ - init16_m68307(*m_program); - m_m68307SIM = new m68307_sim(); m_m68307MBUS = new m68307_mbus(); m_m68307TIMER = new m68307_timer(); @@ -260,7 +248,6 @@ void m68307_cpu_device::device_start() m_m68307MBUS->reset(); m_m68307TIMER->reset(); - m_internal = &space(AS_PROGRAM); m_m68307_base = 0xbfff; m_m68307_scrhigh = 0x0007; m_m68307_scrlow = 0xf010; @@ -281,7 +268,7 @@ void m68307_cpu_device::device_start() uint16_t m68307_cpu_device::m68307_internal_base_r(offs_t offset, uint16_t mem_mask) { - logerror("%08x m68307_internal_base_r %08x, (%04x)\n", m_ppc, offset*2,mem_mask); + logerror("%08x m68307_internal_base_r %08x, (%04x)\n", m_ipc, offset*2,mem_mask); switch (offset<<1) { @@ -297,7 +284,9 @@ uint16_t m68307_cpu_device::m68307_internal_base_r(offs_t offset, uint16_t mem_m void m68307_cpu_device::m68307_internal_base_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - logerror("%08x m68307_internal_base_w %08x, %04x (%04x)\n", m_ppc, offset*2,data,mem_mask); + // emumem needs some kind of overlay capability... it's probably not the only one + + logerror("%08x m68307_internal_base_w %08x, %04x (%04x)\n", m_ipc, offset*2,data,mem_mask); int base; //int mask = 0; @@ -308,10 +297,10 @@ void m68307_cpu_device::m68307_internal_base_w(offs_t offset, uint16_t data, uin base = (m_m68307_base & 0x0fff) << 12; //mask = (m_m68307_base & 0xe000) >> 13; //if ( m_m68307_base & 0x1000 ) mask |= 7; - m_internal->unmap_readwrite(base+0x000, base+0x04f); - m_internal->unmap_readwrite(base+0x100, base+0x11f); - m_internal->unmap_readwrite(base+0x120, base+0x13f); - m_internal->unmap_readwrite(base+0x140, base+0x149); + m_s_program->unmap_readwrite(base+0x000, base+0x04f); + m_s_program->unmap_readwrite(base+0x100, base+0x11f); + m_s_program->unmap_readwrite(base+0x120, base+0x13f); + m_s_program->unmap_readwrite(base+0x140, base+0x149); /* store new base address */ COMBINE_DATA(&m_m68307_base); @@ -320,10 +309,10 @@ void m68307_cpu_device::m68307_internal_base_w(offs_t offset, uint16_t data, uin base = (m_m68307_base & 0x0fff) << 12; //mask = (m_m68307_base & 0xe000) >> 13; //if ( m_m68307_base & 0x1000 ) mask |= 7; - m_internal->install_readwrite_handler(base + 0x000, base + 0x04f, read16_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_sim_r)), write16_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_sim_w))); - m_internal->install_readwrite_handler(base + 0x100, base + 0x11f, read8sm_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_serial_r)), write8sm_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_serial_w)), 0xffff); - m_internal->install_readwrite_handler(base + 0x120, base + 0x13f, read16s_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_timer_r)), write16s_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_timer_w))); - m_internal->install_readwrite_handler(base + 0x140, base + 0x149, read8sm_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_mbus_r)), write8sm_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_mbus_w)), 0xffff); + m_s_program->install_readwrite_handler(base + 0x000, base + 0x04f, read16_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_sim_r)), write16_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_sim_w))); + m_s_program->install_readwrite_handler(base + 0x100, base + 0x11f, read8sm_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_serial_r)), write8sm_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_serial_w)), 0xffff); + m_s_program->install_readwrite_handler(base + 0x120, base + 0x13f, read16s_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_timer_r)), write16s_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_timer_w))); + m_s_program->install_readwrite_handler(base + 0x140, base + 0x149, read8sm_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_mbus_r)), write8sm_delegate(*this, FUNC(m68307_cpu_device::m68307_internal_mbus_w)), 0xffff); break; diff --git a/src/devices/machine/68307.h b/src/devices/machine/68307.h index cc5638b5efb..9221310d0de 100644 --- a/src/devices/machine/68307.h +++ b/src/devices/machine/68307.h @@ -40,9 +40,9 @@ protected: virtual void device_reset() override; virtual void device_add_mconfig(machine_config &config) override; - virtual void m68k_reset_peripherals() override; - private: + DECLARE_WRITE_LINE_MEMBER(reset_peripherals); + void set_ipl(int level); DECLARE_WRITE_LINE_MEMBER(timer0_interrupt); DECLARE_WRITE_LINE_MEMBER(timer1_interrupt); @@ -56,8 +56,6 @@ private: uint8_t m68307_duart_input_r() { return m_read_inport(); } void m68307_duart_output_w(uint8_t data) { m_write_outport(data); } - void init16_m68307(address_space &space); - int calc_cs(offs_t address) const; uint16_t m68307_internal_base_r(offs_t offset, uint16_t mem_mask = ~0); diff --git a/src/devices/machine/68307bus.cpp b/src/devices/machine/68307bus.cpp index 9b6788865e9..2179b1cb443 100644 --- a/src/devices/machine/68307bus.cpp +++ b/src/devices/machine/68307bus.cpp @@ -22,19 +22,19 @@ uint8_t m68307_cpu_device::m68307_internal_mbus_r(offs_t offset) switch (offset) { case m68307BUS_MADR: - logerror("%08x m68307_internal_mbus_r %08x (MADR - M-Bus Address Register)\n", m_ppc, offset); + logerror("%08x m68307_internal_mbus_r %08x (MADR - M-Bus Address Register)\n", m_ipc, offset); return machine().rand(); case m68307BUS_MFDR: - logerror("%08x m68307_internal_mbus_r %08x (MFDR - M-Bus Frequency Divider Register)\n", m_ppc, offset); + logerror("%08x m68307_internal_mbus_r %08x (MFDR - M-Bus Frequency Divider Register)\n", m_ipc, offset); return machine().rand(); case m68307BUS_MBCR: - logerror("%08x m68307_internal_mbus_r %08x (MFCR - M-Bus Control Register)\n", m_ppc, offset); + logerror("%08x m68307_internal_mbus_r %08x (MFCR - M-Bus Control Register)\n", m_ipc, offset); return mbus.m_MFCR;//machine().rand(); case m68307BUS_MBSR: - logerror("%08x m68307_internal_mbus_r %08x (MBSR - M-Bus Status Register)\n", m_ppc, offset); + logerror("%08x m68307_internal_mbus_r %08x (MBSR - M-Bus Status Register)\n", m_ipc, offset); retval = 0; if (mbus.m_busy) retval |= 0x20; if (mbus.m_intpend) retval |= 0x02; @@ -42,13 +42,13 @@ uint8_t m68307_cpu_device::m68307_internal_mbus_r(offs_t offset) return retval; case m68307BUS_MBDR: - logerror("%08x m68307_internal_mbus_r %08x (MBDR - M-Bus Data I/O Register)\n", m_ppc, offset); + logerror("%08x m68307_internal_mbus_r %08x (MBDR - M-Bus Data I/O Register)\n", m_ipc, offset); mbus.m_intpend = true; mbus_interrupt(1); return 0xff;//machine().rand(); default: - logerror("%08x m68307_internal_mbus_r %08x (UNKNOWN / ILLEGAL)\n", m_ppc, offset); + logerror("%08x m68307_internal_mbus_r %08x (UNKNOWN / ILLEGAL)\n", m_ipc, offset); return 0x00; } @@ -63,15 +63,15 @@ void m68307_cpu_device::m68307_internal_mbus_w(offs_t offset, uint8_t data) switch (offset) { case m68307BUS_MADR: - logerror("%08x m68307_internal_mbus_w %08x, %02x (MADR - M-Bus Address Register)\n", m_ppc, offset,data); + logerror("%08x m68307_internal_mbus_w %08x, %02x (MADR - M-Bus Address Register)\n", m_ipc, offset,data); break; case m68307BUS_MFDR: - logerror("%08x m68307_internal_mbus_w %08x, %02x (MFDR - M-Bus Frequency Divider Register)\n", m_ppc, offset,data); + logerror("%08x m68307_internal_mbus_w %08x, %02x (MFDR - M-Bus Frequency Divider Register)\n", m_ipc, offset,data); break; case m68307BUS_MBCR: - logerror("%08x m68307_internal_mbus_w %08x, %02x (MFCR - M-Bus Control Register)\n", m_ppc, offset,data); + logerror("%08x m68307_internal_mbus_w %08x, %02x (MFCR - M-Bus Control Register)\n", m_ipc, offset,data); mbus.m_MFCR = data; if (data & 0x80) @@ -85,11 +85,11 @@ void m68307_cpu_device::m68307_internal_mbus_w(offs_t offset, uint8_t data) break; case m68307BUS_MBSR: - logerror("%08x m68307_internal_mbus_w %08x, %02x (MBSR - M-Bus Status Register)\n", m_ppc, offset,data); + logerror("%08x m68307_internal_mbus_w %08x, %02x (MBSR - M-Bus Status Register)\n", m_ipc, offset,data); break; case m68307BUS_MBDR: - logerror("%08x m68307_internal_mbus_w %08x, %02x (MBDR - M-Bus Data I/O Register)\n", m_ppc, offset,data); + logerror("%08x m68307_internal_mbus_w %08x, %02x (MBDR - M-Bus Data I/O Register)\n", m_ipc, offset,data); mbus.m_intpend = true; mbus_interrupt(1); @@ -97,7 +97,7 @@ void m68307_cpu_device::m68307_internal_mbus_w(offs_t offset, uint8_t data) break; default: - logerror("%08x m68307_internal_mbus_w %08x, %02x (UNKNOWN / ILLEGAL)\n", m_ppc, offset,data); + logerror("%08x m68307_internal_mbus_w %08x, %02x (UNKNOWN / ILLEGAL)\n", m_ipc, offset,data); break; } } diff --git a/src/devices/machine/68307sim.cpp b/src/devices/machine/68307sim.cpp index a62a2911ab4..0f592662d50 100644 --- a/src/devices/machine/68307sim.cpp +++ b/src/devices/machine/68307sim.cpp @@ -54,7 +54,7 @@ uint16_t m68307_cpu_device::m68307_internal_sim_r(address_space &space, offs_t o case m68307SIM_OR3: return sim.m_or[3]; default: - logerror("%08x m68307_internal_sim_r %08x, (%04x)\n", m_ppc, offset*2, mem_mask); + logerror("%08x m68307_internal_sim_r %08x, (%04x)\n", m_ipc, offset*2, mem_mask); return 0xff; } @@ -70,12 +70,12 @@ void m68307_cpu_device::m68307_internal_sim_w(address_space &space, offs_t offse switch (offset<<1) { case m68307SIM_PACNT: - logerror("%08x m68307_internal_sim_w %08x, %04x (%04x) (Port A (8-bit) Control Register - PACNT)\n", m_ppc, offset*2,data,mem_mask); + logerror("%08x m68307_internal_sim_w %08x, %04x (%04x) (Port A (8-bit) Control Register - PACNT)\n", m_ipc, offset*2,data,mem_mask); sim.write_pacnt(data,mem_mask); break; case m68307SIM_PADDR: - logerror("%08x m68307_internal_sim_w %08x, %04x (%04x) (Port A (8-bit) Direction Register - PADDR)\n", m_ppc, offset*2,data,mem_mask); + logerror("%08x m68307_internal_sim_w %08x, %04x (%04x) (Port A (8-bit) Direction Register - PADDR)\n", m_ipc, offset*2,data,mem_mask); sim.write_paddr(data,mem_mask); break; @@ -84,12 +84,12 @@ void m68307_cpu_device::m68307_internal_sim_w(address_space &space, offs_t offse break; case m68307SIM_PBCNT: - logerror("%08x m68307_internal_sim_w %08x, %04x (%04x) (Port B (16-bit) Control Register - PBCNT)\n", m_ppc, offset*2,data,mem_mask); + logerror("%08x m68307_internal_sim_w %08x, %04x (%04x) (Port B (16-bit) Control Register - PBCNT)\n", m_ipc, offset*2,data,mem_mask); sim.write_pbcnt(data,mem_mask); break; case m68307SIM_PBDDR: - logerror("%08x m68307_internal_sim_w %08x, %04x (%04x) (Port B (16-bit) Direction Register - PBDDR)\n", m_ppc, offset*2,data,mem_mask); + logerror("%08x m68307_internal_sim_w %08x, %04x (%04x) (Port B (16-bit) Direction Register - PBDDR)\n", m_ipc, offset*2,data,mem_mask); sim.write_pbddr(data,mem_mask); break; @@ -99,22 +99,22 @@ void m68307_cpu_device::m68307_internal_sim_w(address_space &space, offs_t offse case m68307SIM_LICR1: - logerror("%08x m68307_internal_sim_w %08x, %04x (%04x) (Latched Interrupt Control Register 1 - LICR1)\n", m_ppc, offset*2,data,mem_mask); + logerror("%08x m68307_internal_sim_w %08x, %04x (%04x) (Latched Interrupt Control Register 1 - LICR1)\n", m_ipc, offset*2,data,mem_mask); sim.write_licr1(this,data,mem_mask); break; case m68307SIM_LICR2: - logerror("%08x m68307_internal_sim_w %08x, %04x (%04x) (Latched Interrupt Control Register 2 - LICR2)\n", m_ppc, offset*2,data,mem_mask); + logerror("%08x m68307_internal_sim_w %08x, %04x (%04x) (Latched Interrupt Control Register 2 - LICR2)\n", m_ipc, offset*2,data,mem_mask); sim.write_licr2(this,data,mem_mask); break; case m68307SIM_PICR: - logerror("%08x m68307_internal_sim_w %08x, %04x (%04x) (Peripheral Interrupt Control Register - PICR)\n", m_ppc, offset*2,data,mem_mask); + logerror("%08x m68307_internal_sim_w %08x, %04x (%04x) (Peripheral Interrupt Control Register - PICR)\n", m_ipc, offset*2,data,mem_mask); sim.write_picr(this,data,mem_mask); break; case m68307SIM_PIVR: - logerror("%08x m68307_internal_sim_w %08x, %04x (%04x) (Peripheral Interrupt Vector Register - PIVR)\n", m_ppc, offset*2,data,mem_mask); + logerror("%08x m68307_internal_sim_w %08x, %04x (%04x) (Peripheral Interrupt Vector Register - PIVR)\n", m_ipc, offset*2,data,mem_mask); sim.write_pivr(this,data,mem_mask); break; @@ -146,7 +146,7 @@ void m68307_cpu_device::m68307_internal_sim_w(address_space &space, offs_t offse default : - logerror("%08x m68307_internal_sim_w %08x, %04x (%04x)\n", m_ppc, offset*2,data,mem_mask); + logerror("%08x m68307_internal_sim_w %08x, %04x (%04x)\n", m_ipc, offset*2,data,mem_mask); break; } } diff --git a/src/devices/machine/68307tmu.cpp b/src/devices/machine/68307tmu.cpp index 8800387be64..12c999c0b40 100644 --- a/src/devices/machine/68307tmu.cpp +++ b/src/devices/machine/68307tmu.cpp @@ -25,11 +25,11 @@ uint16_t m68307_cpu_device::m68307_internal_timer_r(offs_t offset, uint16_t mem_ switch (offset&0x7) { case m68307TIMER_TCN: /* 0x3 (0x126 / 0x136) */ - //if (m_ppc!=0x2182e) logerror("%08x m68307_internal_timer_r %08x (%04x) (TCN - Timer Counter for timer %d)\n", m_ppc, offset*2,mem_mask, which); + //if (m_ipc!=0x2182e) logerror("%08x m68307_internal_timer_r %08x (%04x) (TCN - Timer Counter for timer %d)\n", m_ipc, offset*2,mem_mask, which); return timer.read_tcn(mem_mask, which); default: - logerror("%08x m68307_internal_timer_r %08x, (%04x)\n", m_ppc, offset*2,mem_mask); + logerror("%08x m68307_internal_timer_r %08x, (%04x)\n", m_ipc, offset*2,mem_mask); break; } @@ -46,53 +46,53 @@ void m68307_cpu_device::m68307_internal_timer_w(offs_t offset, uint16_t data, ui switch (offset&0x7) { case m68307TIMER_TMR: /* 0x0 (0x120 / 0x130) */ - logerror("%08x m68307_internal_timer_w %08x, %04x (%04x) (TMR - Timer Mode Register for timer %d)\n", m_ppc, offset*2,data,mem_mask, which); + logerror("%08x m68307_internal_timer_w %08x, %04x (%04x) (TMR - Timer Mode Register for timer %d)\n", m_ipc, offset*2,data,mem_mask, which); timer.write_tmr(data, mem_mask, which); break; case m68307TIMER_TRR: /* 0x1 (0x122 / 0x132) */ - logerror("%08x m68307_internal_timer_w %08x, %04x (%04x) (TRR - Timer Reference Register for timer %d)\n", m_ppc, offset*2,data,mem_mask, which); + logerror("%08x m68307_internal_timer_w %08x, %04x (%04x) (TRR - Timer Reference Register for timer %d)\n", m_ipc, offset*2,data,mem_mask, which); timer.write_trr(data, mem_mask, which); break; case m68307TIMER_TCR: /* 0x2 (0x124 / 0x134) */ - logerror("%08x m68307_internal_timer_w %08x, %04x (%04x) (TCR - Timer Capture Register for timer %d) (illegal, read-only)\n", m_ppc, offset*2,data,mem_mask, which); + logerror("%08x m68307_internal_timer_w %08x, %04x (%04x) (TCR - Timer Capture Register for timer %d) (illegal, read-only)\n", m_ipc, offset*2,data,mem_mask, which); break; case m68307TIMER_TCN: /* 0x3 (0x126 / 0x136) */ - logerror("%08x m68307_internal_timer_w %08x, %04x (%04x) (TCN - Timer Counter for timer %d)\n", m_ppc, offset*2,data,mem_mask, which); + logerror("%08x m68307_internal_timer_w %08x, %04x (%04x) (TCN - Timer Counter for timer %d)\n", m_ipc, offset*2,data,mem_mask, which); break; case m68307TIMER_TER: /* 0x4 (0x128 / 0x138) */ /* 8-bit only!! */ - //logerror("%08x m68307_internal_timer_w %08x, %04x (%04x) (TER - Timer Event Register for timer %d)\n", m_ppc, offset*2,data,mem_mask, which); + //logerror("%08x m68307_internal_timer_w %08x, %04x (%04x) (TER - Timer Event Register for timer %d)\n", m_ipc, offset*2,data,mem_mask, which); timer.write_ter(data, mem_mask, which); break; case m68307TIMER_WRR: /* 0x5 (0x12a / 0x13a) */ if (which==0) { - logerror("%08x m68307_internal_timer_w %08x, %04x (%04x) (WRR - Watchdog Reference Register)\n", m_ppc, offset*2,data,mem_mask); + logerror("%08x m68307_internal_timer_w %08x, %04x (%04x) (WRR - Watchdog Reference Register)\n", m_ipc, offset*2,data,mem_mask); } else { - logerror("%08x m68307_internal_timer_w %08x, %04x (%04x) (illegal)\n", m_ppc, offset*2,data,mem_mask); + logerror("%08x m68307_internal_timer_w %08x, %04x (%04x) (illegal)\n", m_ipc, offset*2,data,mem_mask); } break; case m68307TIMER_WCR: /* 0x6 (0x12c / 0x13c) */ if (which==0) { - logerror("%08x m68307_internal_timer_w %08x, %04x (%04x) (WRR - Watchdog Counter Register)\n", m_ppc, offset*2,data,mem_mask); + logerror("%08x m68307_internal_timer_w %08x, %04x (%04x) (WRR - Watchdog Counter Register)\n", m_ipc, offset*2,data,mem_mask); } else { - logerror("%08x m68307_internal_timer_w %08x, %04x (%04x) (illegal)\n", m_ppc, offset*2,data,mem_mask); + logerror("%08x m68307_internal_timer_w %08x, %04x (%04x) (illegal)\n", m_ipc, offset*2,data,mem_mask); } break; case m68307TIMER_XXX: /* 0x7 (0x12e / 0x13e) */ - logerror("%08x m68307_internal_timer_w %08x, %04x (%04x) (illegal)\n", m_ppc, offset*2,data,mem_mask); + logerror("%08x m68307_internal_timer_w %08x, %04x (%04x) (illegal)\n", m_ipc, offset*2,data,mem_mask); break; } } diff --git a/src/devices/machine/68340.cpp b/src/devices/machine/68340.cpp index 81719f87a1b..6230683be0f 100644 --- a/src/devices/machine/68340.cpp +++ b/src/devices/machine/68340.cpp @@ -256,6 +256,8 @@ WRITE_LINE_MEMBER( m68340_cpu_device::set_modck ) void m68340_cpu_device::device_start() { + reset_cb().append(FUNC(m68340_cpu_device::reset_peripherals)); + fscpu32_device::device_start(); m_m68340SIM = new m68340_sim(); @@ -271,7 +273,7 @@ void m68340_cpu_device::device_start() m_internal = &space(AS_PROGRAM); } -void m68340_cpu_device::m68k_reset_peripherals() +WRITE_LINE_MEMBER(m68340_cpu_device::reset_peripherals) { m_m68340SIM->module_reset(); m_m68340DMA->module_reset(); diff --git a/src/devices/machine/68340.h b/src/devices/machine/68340.h index ef89972a72c..1ee3e8c8f43 100644 --- a/src/devices/machine/68340.h +++ b/src/devices/machine/68340.h @@ -49,7 +49,7 @@ protected: virtual void device_reset() override; virtual void device_add_mconfig(machine_config &config) override; - virtual void m68k_reset_peripherals() override; + DECLARE_WRITE_LINE_MEMBER(reset_peripherals); private: required_device<mc68340_serial_module_device> m_serial; diff --git a/src/devices/machine/mc68328.cpp b/src/devices/machine/mc68328.cpp index 004dab62a89..30937ab7e7a 100644 --- a/src/devices/machine/mc68328.cpp +++ b/src/devices/machine/mc68328.cpp @@ -47,8 +47,8 @@ DEFINE_DEVICE_TYPE(MC68EZ328, mc68ez328_device, "mc68ez328", "MC68EZ328 DragonBa const u32 mc68328_base_device::VCO_DIVISORS[8] = { 2, 4, 8, 16, 1, 1, 1, 1 }; -mc68328_base_device::mc68328_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 addr_bits, address_map_constructor internal_map_ctor) - : m68000_device(mconfig, tag, owner, clock, type, 16, addr_bits, internal_map_ctor) +mc68328_base_device::mc68328_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : m68000_device(mconfig, type, tag, owner, clock) , m_pwm(nullptr) , m_rtc(nullptr) , m_spim(nullptr) @@ -78,7 +78,7 @@ mc68328_base_device::mc68328_base_device(const machine_config &mconfig, device_t } mc68328_device::mc68328_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : mc68328_base_device(mconfig, MC68328, tag, owner, clock, 24, address_map_constructor(FUNC(mc68328_device::internal_map), this)) + : mc68328_base_device(mconfig, MC68328, tag, owner, clock) , m_out_port_j_cb(*this) , m_out_port_k_cb(*this) , m_out_port_m_cb(*this) @@ -87,12 +87,27 @@ mc68328_device::mc68328_device(const machine_config &mconfig, const char *tag, d , m_in_port_m_cb(*this) { m_cpu_space_config.m_internal_map = address_map_constructor(FUNC(mc68328_device::cpu_space_map), this); + auto imap = address_map_constructor(FUNC(mc68328_device::internal_map), this); + m_program_config.m_internal_map = imap; + m_opcodes_config.m_internal_map = imap; + m_uprogram_config.m_internal_map = imap; + m_uopcodes_config.m_internal_map = imap; } mc68ez328_device::mc68ez328_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : mc68328_base_device(mconfig, MC68EZ328, tag, owner, clock, 32, address_map_constructor(FUNC(mc68ez328_device::internal_map), this)) + : mc68328_base_device(mconfig, MC68EZ328, tag, owner, clock) { m_cpu_space_config.m_internal_map = address_map_constructor(FUNC(mc68ez328_device::cpu_space_map), this); + m_cpu_space_config.m_addr_width = 32; + m_program_config.m_addr_width = 32; + m_opcodes_config.m_addr_width = 32; + m_uprogram_config.m_addr_width = 32; + m_uopcodes_config.m_addr_width = 32; + auto imap = address_map_constructor(FUNC(mc68ez328_device::internal_map), this); + m_program_config.m_internal_map = imap; + m_opcodes_config.m_internal_map = imap; + m_uprogram_config.m_internal_map = imap; + m_uopcodes_config.m_internal_map = imap; } void mc68328_base_device::base_internal_map(u32 addr_bits, address_map &map) diff --git a/src/devices/machine/mc68328.h b/src/devices/machine/mc68328.h index 36ac00d963a..b2224f1f8a9 100644 --- a/src/devices/machine/mc68328.h +++ b/src/devices/machine/mc68328.h @@ -131,7 +131,7 @@ public: } protected: - mc68328_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 addr_bits, address_map_constructor internal_map_ctor); + mc68328_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); // device-level overrides virtual void device_resolve_objects() override; diff --git a/src/devices/machine/scc68070.cpp b/src/devices/machine/scc68070.cpp index a732b024ee6..713707575a9 100644 --- a/src/devices/machine/scc68070.cpp +++ b/src/devices/machine/scc68070.cpp @@ -239,7 +239,7 @@ void scc68070_device::cpu_space_map(address_map &map) //------------------------------------------------- scc68070_device::scc68070_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : scc68070_base_device(mconfig, tag, owner, clock, SCC68070, address_map_constructor(FUNC(scc68070_device::internal_map), this)) + : m68000_device(mconfig, SCC68070, tag, owner, clock) , m_iack2_callback(*this) , m_iack4_callback(*this) , m_iack5_callback(*this) @@ -258,6 +258,18 @@ scc68070_device::scc68070_device(const machine_config &mconfig, const char *tag, , m_int2_line(CLEAR_LINE) { m_cpu_space_config.m_internal_map = address_map_constructor(FUNC(scc68070_device::cpu_space_map), this); + + m_cpu_space_config.m_addr_width = 32; + m_program_config.m_addr_width = 32; + m_opcodes_config.m_addr_width = 32; + m_uprogram_config.m_addr_width = 32; + m_uopcodes_config.m_addr_width = 32; + + auto imap = address_map_constructor(FUNC(scc68070_device::internal_map), this); + m_program_config.m_internal_map = imap; + m_opcodes_config.m_internal_map = imap; + m_uprogram_config.m_internal_map = imap; + m_uopcodes_config.m_internal_map = imap; } //------------------------------------------------- @@ -268,7 +280,7 @@ scc68070_device::scc68070_device(const machine_config &mconfig, const char *tag, void scc68070_device::device_resolve_objects() { - scc68070_base_device::device_resolve_objects(); + m68000_device::device_resolve_objects(); m_iack2_callback.resolve_safe(autovector(2)); m_iack4_callback.resolve_safe(autovector(4)); @@ -287,7 +299,9 @@ void scc68070_device::device_resolve_objects() void scc68070_device::device_start() { - scc68070_base_device::device_start(); + reset_cb().append(FUNC(scc68070_device::reset_peripherals)); + + m68000_device::device_start(); save_item(NAME(m_ipl)); @@ -378,7 +392,7 @@ void scc68070_device::device_start() void scc68070_device::device_reset() { - scc68070_base_device::device_reset(); + m68000_device::device_reset(); m_lir = 0; @@ -448,7 +462,7 @@ void scc68070_device::device_reset() set_timer_callback(0); } -void scc68070_device::m68k_reset_peripherals() +WRITE_LINE_MEMBER(scc68070_device::reset_peripherals) { m_lir = 0; diff --git a/src/devices/machine/scc68070.h b/src/devices/machine/scc68070.h index 430ed781c27..b78985f0db2 100644 --- a/src/devices/machine/scc68070.h +++ b/src/devices/machine/scc68070.h @@ -26,7 +26,7 @@ TODO: #pragma once -#include "cpu/m68000/scc68070.h" +#include "cpu/m68000/m68000.h" //************************************************************************** // TYPE DEFINITIONS @@ -43,7 +43,7 @@ enum scc68070_ocr_bits // ======================> scc68070_device -class scc68070_device : public scc68070_base_device +class scc68070_device : public m68000_device { public: scc68070_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); @@ -199,8 +199,7 @@ protected: virtual u64 execute_clocks_to_cycles(u64 clocks) const noexcept override { return (clocks + 2 - 1) / 2; } virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 2); } - // m68000_base_device overrides - virtual void m68k_reset_peripherals() override; + DECLARE_WRITE_LINE_MEMBER(reset_peripherals); private: void internal_map(address_map &map); diff --git a/src/devices/machine/tmp68301.cpp b/src/devices/machine/tmp68301.cpp index bd3d2dc06f1..96f99db344c 100644 --- a/src/devices/machine/tmp68301.cpp +++ b/src/devices/machine/tmp68301.cpp @@ -166,7 +166,7 @@ void tmp68301_device::device_start() m_in_parallel_cb.resolve_safe(0); m_out_parallel_cb.resolve_safe(); - m_program->install_device(0xfffc00, 0xffffff, *this, &tmp68301_device::tmp68301_regs); + m_s_program->install_device(0xfffc00, 0xffffff, *this, &tmp68301_device::tmp68301_regs); save_item(NAME(m_regs)); save_item(NAME(m_icr)); |