summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author mooglyguy <therealmogminer@gmail.com>2018-12-02 19:42:14 +0100
committer mooglyguy <therealmogminer@gmail.com>2018-12-02 19:42:14 +0100
commit9357ab2d5b02cbbc722777ddf8a6302279f56734 (patch)
treeae770de271d84225a1f57936962150a34dc806d1
parent2e343a451bb94b2e526386a68f5e8e16d59593e5 (diff)
tms32031.cpp: A different attempt at fixing the disassembler. Confirmed radikalb still works, and mk4 and drivedge no longer stack-overflow. nw
-rw-r--r--src/devices/cpu/tms32031/tms32031.cpp20
-rw-r--r--src/devices/cpu/tms32031/tms32031.h8
2 files changed, 12 insertions, 16 deletions
diff --git a/src/devices/cpu/tms32031/tms32031.cpp b/src/devices/cpu/tms32031/tms32031.cpp
index e0e071e5518..a1c209c541d 100644
--- a/src/devices/cpu/tms32031/tms32031.cpp
+++ b/src/devices/cpu/tms32031/tms32031.cpp
@@ -96,7 +96,6 @@ DEFINE_DEVICE_TYPE(TMS32032, tms32032_device, "tms32032", "Texas Instruments TMS
// TODO: expand to cover all the standard internal peripherals
void tms3203x_device::common_3203x(address_map &map)
{
- map(0x000000, 0x000fff).r(FUNC(tms3203x_device::bootrom_r));
map(0x808064, 0x808064).rw(FUNC(tms3203x_device::primary_bus_control_r), FUNC(tms3203x_device::primary_bus_control_w));
}
@@ -354,14 +353,6 @@ const tiny_rom_entry *tms3203x_device::device_rom_region() const
}
}
-READ32_MEMBER(tms3203x_device::bootrom_r)
-{
- if (m_mcbl_mode)
- return m_bootrom[offset];
-
- return m_cache->read_dword(offset);
-}
-
//-------------------------------------------------
// ROPCODE - fetch an opcode
//-------------------------------------------------
@@ -409,7 +400,8 @@ void tms3203x_device::device_start()
m_holda_cb.resolve_safe();
// set up the internal boot loader ROM
- m_bootrom = reinterpret_cast<uint32_t*>(memregion(shortname())->base());
+ if (m_mcbl_mode)
+ m_program->install_rom(0x000000, 0x000fff, memregion(shortname())->base());
// save state
save_item(NAME(m_pc));
@@ -747,7 +739,15 @@ void tms3203x_device::execute_set_input(int inputnum, int state)
if (inputnum == TMS3203X_MCBL)
{
// switch between microcomputer/boot loader and microprocessor modes
+ bool old_mode = m_mcbl_mode;
m_mcbl_mode = (state == ASSERT_LINE);
+ if (m_mcbl_mode != old_mode)
+ {
+ if (m_mcbl_mode)
+ m_program->install_rom(0x000000, 0x000fff, memregion(shortname())->base());
+ else
+ m_program->unmap_read(0x000000, 0x000fff);
+ }
return;
}
diff --git a/src/devices/cpu/tms32031/tms32031.h b/src/devices/cpu/tms32031/tms32031.h
index beb312ddf61..3188f8250d7 100644
--- a/src/devices/cpu/tms32031/tms32031.h
+++ b/src/devices/cpu/tms32031/tms32031.h
@@ -190,9 +190,6 @@ protected:
// device_disasm_interface overrides
virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
- // internal memory handlers
- DECLARE_READ32_MEMBER(bootrom_r);
-
// internal peripheral device handlers
DECLARE_READ32_MEMBER(primary_bus_control_r) { return m_primary_bus_control; }
DECLARE_WRITE32_MEMBER(primary_bus_control_w);
@@ -783,16 +780,15 @@ protected:
uint32_t m_primary_bus_control;
// internal stuff
- uint16_t m_irq_state;
+ uint16_t m_irq_state;
bool m_delayed;
bool m_irq_pending;
bool m_is_idling;
int m_icount;
- uint32_t m_iotemp;
+ uint32_t m_iotemp;
address_space * m_program;
memory_access_cache<2, -2, ENDIANNESS_LITTLE> *m_cache;
- uint32_t * m_bootrom;
bool m_mcbl_mode;
bool m_hold_state;