diff options
Diffstat (limited to 'src/devices/cpu/upd7725/upd7725.cpp')
-rw-r--r-- | src/devices/cpu/upd7725/upd7725.cpp | 37 |
1 files changed, 8 insertions, 29 deletions
diff --git a/src/devices/cpu/upd7725/upd7725.cpp b/src/devices/cpu/upd7725/upd7725.cpp index 7ef876613db..716fa45ccf9 100644 --- a/src/devices/cpu/upd7725/upd7725.cpp +++ b/src/devices/cpu/upd7725/upd7725.cpp @@ -14,6 +14,7 @@ #include "emu.h" #include "debugger.h" #include "upd7725.h" +#include "dasm7725.h" //************************************************************************** @@ -67,7 +68,7 @@ void necdsp_device::device_start() // get our address spaces m_program = &space(AS_PROGRAM); m_data = &space(AS_DATA); - m_direct = &m_program->direct(); + m_direct = m_program->direct<-2>(); // register our state for the debugger state_add(STATE_GENPC, "GENPC", regs.pc).noshow(); @@ -316,35 +317,13 @@ void necdsp_device::execute_set_input(int inputnum, int state) } //------------------------------------------------- -// disasm_min_opcode_bytes - return the length -// of the shortest instruction, in bytes -//------------------------------------------------- - -uint32_t necdsp_device::disasm_min_opcode_bytes() const -{ - return 4; -} - - -//------------------------------------------------- -// disasm_max_opcode_bytes - return the length -// of the longest instruction, in bytes -//------------------------------------------------- - -uint32_t necdsp_device::disasm_max_opcode_bytes() const -{ - return 4; -} - -//------------------------------------------------- -// disasm_disassemble - call the disassembly +// disassemble - call the disassembly // helper function //------------------------------------------------- -offs_t necdsp_device::disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) +util::disasm_interface *necdsp_device::create_disassembler() { - extern CPU_DISASSEMBLE( upd7725 ); - return CPU_DISASSEMBLE_NAME(upd7725)(this, stream, pc, oprom, opram, options); + return new necdsp_disassembler; } void necdsp_device::execute_run() @@ -361,7 +340,7 @@ void necdsp_device::execute_run() if (m_irq_firing == 0) // normal opcode { - opcode = m_direct->read_dword(regs.pc<<2)>>8; + opcode = m_direct->read_dword(regs.pc) >> 8; regs.pc++; } else if (m_irq_firing == 1) // if we're in an interrupt cycle, execute a op 'nop' first... @@ -413,7 +392,7 @@ void necdsp_device::exec_op(uint32_t opcode) { case 3: regs.idb = regs.tr; break; case 4: regs.idb = regs.dp; break; case 5: regs.idb = regs.rp; break; - case 6: regs.idb = m_data->read_word(regs.rp<<1); break; + case 6: regs.idb = m_data->read_word(regs.rp); break; case 7: regs.idb = 0x8000 - regs.flaga.s1; break; //SGN case 8: regs.idb = regs.dr; regs.sr.rqm = 1; break; case 9: regs.idb = regs.dr; break; @@ -610,7 +589,7 @@ void necdsp_device::exec_ld(uint32_t opcode) { case 8: regs.so = BITSWAP16(id, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); break; //LSB first output, output tapped at bit 15 shifting left case 9: regs.so = id; break; //MSB first output, output tapped at bit 15 shifting left case 10: regs.k = id; break; - case 11: regs.k = id; regs.l = m_data->read_word(regs.rp<<1); break; + case 11: regs.k = id; regs.l = m_data->read_word(regs.rp); break; case 12: regs.l = id; regs.k = dataRAM[regs.dp | 0x40]; break; case 13: regs.l = id; break; case 14: regs.trb = id; break; |