diff options
Diffstat (limited to 'src/devices/cpu/tms32051/tms32051.cpp')
-rw-r--r-- | src/devices/cpu/tms32051/tms32051.cpp | 124 |
1 files changed, 108 insertions, 16 deletions
diff --git a/src/devices/cpu/tms32051/tms32051.cpp b/src/devices/cpu/tms32051/tms32051.cpp index d1a1c566f83..d03493df60f 100644 --- a/src/devices/cpu/tms32051/tms32051.cpp +++ b/src/devices/cpu/tms32051/tms32051.cpp @@ -9,7 +9,6 @@ #include "emu.h" #include "tms32051.h" #include "dis32051.h" -#include "debugger.h" enum { @@ -57,7 +56,7 @@ DEFINE_DEVICE_TYPE(TMS32053, tms32053_device, "tms32053", "Texas Instruments TMS void tms32051_device::tms32051_internal_pgm(address_map &map) { -// AM_RANGE(0x0000, 0x1fff) AM_ROM // ROM TODO: is off-chip if MP/_MC = 0 +// map(0x0000, 0x1fff).rom(); // ROM TODO: is off-chip if MP/_MC = 0 map(0x2000, 0x23ff).ram().share("saram"); // SARAM TODO: is off-chip if RAM bit = 0 map(0xfe00, 0xffff).ram().share("daram_b0"); // DARAM B0 TODO: is off-chip if CNF = 0 } @@ -101,7 +100,7 @@ device_memory_interface::space_config_vector tms32051_device::memory_space_confi void tms32053_device::tms32053_internal_pgm(address_map &map) { -// AM_RANGE(0x0000, 0x3fff) AM_ROM // ROM TODO: is off-chip if MP/_MC = 0 +// map(0x0000, 0x3fff).rom(); // ROM TODO: is off-chip if MP/_MC = 0 map(0x4000, 0x4bff).ram().share("saram"); // SARAM TODO: is off-chip if RAM bit = 0 map(0xfe00, 0xffff).ram().share("daram_b0"); // DARAM B0 TODO: is off-chip if CNF = 0 } @@ -130,7 +129,7 @@ std::unique_ptr<util::disasm_interface> tms32051_device::create_disassembler() #define CYCLES(x) (m_icount -= x) -#define ROPCODE() m_cache->read_word(m_pc++) +#define ROPCODE() m_cache.read_word(m_pc++) void tms32051_device::CHANGE_PC(uint16_t new_pc) { @@ -139,22 +138,22 @@ void tms32051_device::CHANGE_PC(uint16_t new_pc) uint16_t tms32051_device::PM_READ16(uint16_t address) { - return m_program->read_word(address); + return m_program.read_word(address); } void tms32051_device::PM_WRITE16(uint16_t address, uint16_t data) { - m_program->write_word(address, data); + m_program.write_word(address, data); } uint16_t tms32051_device::DM_READ16(uint16_t address) { - return m_data->read_word(address); + return m_data.read_word(address); } void tms32051_device::DM_WRITE16(uint16_t address, uint16_t data) { - m_data->write_word(address, data); + m_data.write_word(address, data); } #include "32051ops.hxx" @@ -186,10 +185,10 @@ void tms32051_device::delay_slot(uint16_t startpc) void tms32051_device::device_start() { - m_program = &space(AS_PROGRAM); - m_cache = m_program->cache<1, -1, ENDIANNESS_LITTLE>(); - m_data = &space(AS_DATA); - m_io = &space(AS_IO); + space(AS_PROGRAM).cache(m_cache); + space(AS_PROGRAM).specific(m_program); + space(AS_DATA).specific(m_data); + space(AS_IO).specific(m_io); m_pcstack_ptr = 0; m_op = 0; @@ -219,6 +218,99 @@ void tms32051_device::device_start() memset(&m_timer, 0, sizeof(m_timer)); memset(&m_serial, 0, sizeof(m_serial)); + save_item(NAME(m_pc)); + save_item(NAME(m_op)); + save_item(NAME(m_acc)); + save_item(NAME(m_accb)); + save_item(NAME(m_preg)); + save_item(NAME(m_treg0)); + save_item(NAME(m_treg1)); + save_item(NAME(m_treg2)); + save_pointer(NAME(&m_ar[0]), std::size(m_ar)); + save_item(NAME(m_rptc)); + save_item(NAME(m_bmar)); + save_item(NAME(m_brcr)); + save_item(NAME(m_paer)); + save_item(NAME(m_pasr)); + save_item(NAME(m_indx)); + save_item(NAME(m_dbmr)); + save_item(NAME(m_arcr)); + + save_item(STRUCT_MEMBER(m_st0, dp)); + save_item(STRUCT_MEMBER(m_st0, intm)); + save_item(STRUCT_MEMBER(m_st0, ovm)); + save_item(STRUCT_MEMBER(m_st0, ov)); + save_item(STRUCT_MEMBER(m_st0, arp)); + + save_item(STRUCT_MEMBER(m_st1, arb)); + save_item(STRUCT_MEMBER(m_st1, cnf)); + save_item(STRUCT_MEMBER(m_st1, tc)); + save_item(STRUCT_MEMBER(m_st1, sxm)); + save_item(STRUCT_MEMBER(m_st1, c)); + save_item(STRUCT_MEMBER(m_st1, hm)); + save_item(STRUCT_MEMBER(m_st1, xf)); + save_item(STRUCT_MEMBER(m_st1, pm)); + + save_item(STRUCT_MEMBER(m_pmst, iptr)); + save_item(STRUCT_MEMBER(m_pmst, avis)); + save_item(STRUCT_MEMBER(m_pmst, ovly)); + save_item(STRUCT_MEMBER(m_pmst, ram)); + save_item(STRUCT_MEMBER(m_pmst, mpmc)); + save_item(STRUCT_MEMBER(m_pmst, ndx)); + save_item(STRUCT_MEMBER(m_pmst, trm)); + save_item(STRUCT_MEMBER(m_pmst, braf)); + + save_item(NAME(m_ifr)); + save_item(NAME(m_imr)); + save_pointer(NAME(&m_pcstack[0]), std::size(m_pcstack)); + save_item(NAME(m_pcstack_ptr)); + save_item(NAME(m_rpt_start)); + save_item(NAME(m_rpt_end)); + save_item(NAME(m_cbcr)); + save_item(NAME(m_cbsr1)); + save_item(NAME(m_cber1)); + save_item(NAME(m_cbsr2)); + save_item(NAME(m_cber2)); + + save_item(STRUCT_MEMBER(m_timer, tddr)); + save_item(STRUCT_MEMBER(m_timer, psc)); + save_item(STRUCT_MEMBER(m_timer, tim)); + save_item(STRUCT_MEMBER(m_timer, prd)); + + save_item(STRUCT_MEMBER(m_serial, drr)); + save_item(STRUCT_MEMBER(m_serial, dxr)); + save_item(STRUCT_MEMBER(m_serial, spc)); + + save_item(STRUCT_MEMBER(m_shadow, acc)); + save_item(STRUCT_MEMBER(m_shadow, accb)); + save_item(STRUCT_MEMBER(m_shadow, arcr)); + save_item(STRUCT_MEMBER(m_shadow, indx)); + save_item(STRUCT_MEMBER(m_shadow.pmst, iptr)); + save_item(STRUCT_MEMBER(m_shadow.pmst, avis)); + save_item(STRUCT_MEMBER(m_shadow.pmst, ovly)); + save_item(STRUCT_MEMBER(m_shadow.pmst, ram)); + save_item(STRUCT_MEMBER(m_shadow.pmst, mpmc)); + save_item(STRUCT_MEMBER(m_shadow.pmst, ndx)); + save_item(STRUCT_MEMBER(m_shadow.pmst, trm)); + save_item(STRUCT_MEMBER(m_shadow.pmst, braf)); + save_item(STRUCT_MEMBER(m_shadow.st0, dp)); + save_item(STRUCT_MEMBER(m_shadow.st0, intm)); + save_item(STRUCT_MEMBER(m_shadow.st0, ovm)); + save_item(STRUCT_MEMBER(m_shadow.st0, ov)); + save_item(STRUCT_MEMBER(m_shadow.st0, arp)); + save_item(STRUCT_MEMBER(m_shadow.st1, arb)); + save_item(STRUCT_MEMBER(m_shadow.st1, cnf)); + save_item(STRUCT_MEMBER(m_shadow.st1, tc)); + save_item(STRUCT_MEMBER(m_shadow.st1, sxm)); + save_item(STRUCT_MEMBER(m_shadow.st1, c)); + save_item(STRUCT_MEMBER(m_shadow.st1, hm)); + save_item(STRUCT_MEMBER(m_shadow.st1, xf)); + save_item(STRUCT_MEMBER(m_shadow.st1, pm)); + save_item(STRUCT_MEMBER(m_shadow, preg)); + save_item(STRUCT_MEMBER(m_shadow, treg0)); + save_item(STRUCT_MEMBER(m_shadow, treg1)); + save_item(STRUCT_MEMBER(m_shadow, treg2)); + state_add( TMS32051_PC, "PC", m_pc).formatstr("%04X"); state_add( TMS32051_ACC, "ACC", m_acc).formatstr("%08X"); state_add( TMS32051_ACCB, "ACCB", m_accb).formatstr("%08X"); @@ -444,7 +536,7 @@ void tms32051_device::execute_run() /*****************************************************************************/ -READ16_MEMBER( tms32051_device::cpuregs_r ) +uint16_t tms32051_device::cpuregs_r(offs_t offset) { switch (offset) { @@ -519,7 +611,7 @@ READ16_MEMBER( tms32051_device::cpuregs_r ) case 0x5d: case 0x5e: case 0x5f: - return m_io->read_word(offset); + return m_io.read_word(offset); default: if (!machine().side_effects_disabled()) @@ -529,7 +621,7 @@ READ16_MEMBER( tms32051_device::cpuregs_r ) return 0; } -WRITE16_MEMBER( tms32051_device::cpuregs_w ) +void tms32051_device::cpuregs_w(offs_t offset, uint16_t data) { switch (offset) { @@ -630,7 +722,7 @@ WRITE16_MEMBER( tms32051_device::cpuregs_w ) case 0x5d: case 0x5e: case 0x5f: - m_io->write_word(offset, data); + m_io.write_word(offset, data); break; default: |