diff options
author | 2014-11-27 17:29:06 +0100 | |
---|---|---|
committer | 2014-11-27 17:28:38 +0100 | |
commit | 5fc6c22db6c68ad9b7751a4d22cce151bdebac4a (patch) | |
tree | 4838408a4429078ff4fe41f0fdcea7baa1885697 | |
parent | 982f36e3282420ab90087ff00123f215f165353f (diff) |
vii/unsp cleanups for cowering (nw)
-rw-r--r-- | src/emu/cpu/unsp/unsp.c | 19 | ||||
-rw-r--r-- | src/emu/cpu/unsp/unspdasm.c | 4 | ||||
-rw-r--r-- | src/mess/drivers/vii.c | 20 |
3 files changed, 19 insertions, 24 deletions
diff --git a/src/emu/cpu/unsp/unsp.c b/src/emu/cpu/unsp/unsp.c index 81ade130518..fd1d8ef89fc 100644 --- a/src/emu/cpu/unsp/unsp.c +++ b/src/emu/cpu/unsp/unsp.c @@ -16,7 +16,7 @@ const device_type UNSP = &device_creator<unsp_device>; unsp_device::unsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : cpu_device(mconfig, UNSP, "u'nSP", tag, owner, clock, "unsp", __FILE__) - , m_program_config("program", ENDIANNESS_BIG, 16, 23, 0) + , m_program_config("program", ENDIANNESS_BIG, 16, 23, -1) { } @@ -100,19 +100,19 @@ offs_t unsp_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opr void unsp_device::unimplemented_opcode(UINT16 op) { - fatalerror("UNSP: unknown opcode %04x at %04x\n", op, UNSP_LPC << 1); + fatalerror("UNSP: unknown opcode %04x at %04x\n", op, UNSP_LPC); } /*****************************************************************************/ UINT16 unsp_device::READ16(UINT32 address) { - return m_program->read_word(address << 1); + return m_program->read_word(address<<1); } void unsp_device::WRITE16(UINT32 address, UINT16 data) { - m_program->write_word(address << 1, data); + m_program->write_word(address<<1, data); } /*****************************************************************************/ @@ -152,11 +152,11 @@ void unsp_device::state_export(const device_state_entry &entry) switch (entry.index()) { case UNSP_PC: - m_debugger_temp = UNSP_LPC << 1; + m_debugger_temp = UNSP_LPC; break; case STATE_GENPC: - m_debugger_temp = UNSP_LPC << 1; + m_debugger_temp = UNSP_LPC; break; } } @@ -166,8 +166,8 @@ void unsp_device::state_import(const device_state_entry &entry) switch (entry.index()) { case UNSP_PC: - UNSP_REG(PC) = (m_debugger_temp & 0x0001fffe) >> 1; - UNSP_REG(SR) = (UNSP_REG(SR) & 0xffc0) | ((m_debugger_temp & 0x007e0000) >> 17); + UNSP_REG(PC) = m_debugger_temp & 0x0000ffff; + UNSP_REG(SR) = (UNSP_REG(SR) & 0xffc0) | ((m_debugger_temp & 0x003f0000) >> 16); break; } } @@ -230,8 +230,7 @@ void unsp_device::execute_run() while (m_icount > 0) { - debugger_instruction_hook(this, UNSP_LPC<<1); - + debugger_instruction_hook(this, UNSP_LPC); op = READ16(UNSP_LPC); UNSP_REG(PC)++; diff --git a/src/emu/cpu/unsp/unspdasm.c b/src/emu/cpu/unsp/unspdasm.c index 023d41061a3..602a98a24ba 100644 --- a/src/emu/cpu/unsp/unspdasm.c +++ b/src/emu/cpu/unsp/unspdasm.c @@ -53,7 +53,7 @@ static const char *alu[] = /*****************************************************************************/ -#define UNSP_DASM_OK ((2 * (OP2X ? 2 : 1)) | DASMFLAG_SUPPORTED) +#define UNSP_DASM_OK ((OP2X ? 2 : 1) | DASMFLAG_SUPPORTED) CPU_DISASSEMBLE( unsp ) { @@ -68,7 +68,7 @@ CPU_DISASSEMBLE( unsp ) if(OP0 < 0xf && OPA == 0x7 && OP1 < 2) { - print("%s %04x", jmp[OP0], OP1 ? (pc - OPIMM*2) : (pc + OPIMM*2)); + print("%s %04x", jmp[OP0], OP1 ? (pc - OPIMM + 1) : (pc + OPIMM + 1)); return UNSP_DASM_OK; } diff --git a/src/mess/drivers/vii.c b/src/mess/drivers/vii.c index de9a14b866c..f51059100a2 100644 --- a/src/mess/drivers/vii.c +++ b/src/mess/drivers/vii.c @@ -663,8 +663,6 @@ READ16_MEMBER( vii_state::io_r ) static const char *const gpioregs[] = { "GPIO Data Port", "GPIO Buffer Port", "GPIO Direction Port", "GPIO Attribute Port", "GPIO IRQ/Latch Port" }; static const char gpioports[] = { 'A', 'B', 'C' }; - offset -= 0x500; - UINT16 val = m_io_regs[offset]; switch(offset) @@ -738,8 +736,6 @@ WRITE16_MEMBER( vii_state::io_w ) UINT16 temp = 0; - offset -= 0x500; - switch(offset) { case 0x00: // GPIO special function select @@ -901,14 +897,14 @@ READ16_MEMBER( vii_state::rom_r ) } static ADDRESS_MAP_START( vii_mem, AS_PROGRAM, 16, vii_state ) - AM_RANGE( 0x000000, 0x004fff ) AM_RAM AM_SHARE("p_ram") - AM_RANGE( 0x005000, 0x0051ff ) AM_READWRITE(video_r, video_w) - AM_RANGE( 0x005200, 0x0055ff ) AM_RAM AM_SHARE("p_rowscroll") - AM_RANGE( 0x005600, 0x0057ff ) AM_RAM AM_SHARE("p_palette") - AM_RANGE( 0x005800, 0x005fff ) AM_RAM AM_SHARE("p_spriteram") - AM_RANGE( 0x006000, 0x006fff ) AM_READWRITE(audio_r, audio_w) - AM_RANGE( 0x007000, 0x007fff ) AM_READWRITE(io_r, io_w) - AM_RANGE( 0x008000, 0x7fffff ) AM_READ(rom_r) + AM_RANGE( 0x000000, 0x0027ff ) AM_RAM AM_SHARE("p_ram") + AM_RANGE( 0x002800, 0x0028ff ) AM_READWRITE(video_r, video_w) + AM_RANGE( 0x002900, 0x002aff ) AM_RAM AM_SHARE("p_rowscroll") + AM_RANGE( 0x002b00, 0x002bff ) AM_RAM AM_SHARE("p_palette") + AM_RANGE( 0x002c00, 0x002fff ) AM_RAM AM_SHARE("p_spriteram") + AM_RANGE( 0x003000, 0x0037ff ) AM_READWRITE(audio_r, audio_w) + AM_RANGE( 0x003d00, 0x003eff ) AM_READWRITE(io_r, io_w) + AM_RANGE( 0x004000, 0x3fffff ) AM_READ(rom_r) ADDRESS_MAP_END static INPUT_PORTS_START( vii ) |