From 496710dd2243d286e38f8abe5a2358995739bc0e Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Wed, 12 Feb 2020 22:11:08 +0100 Subject: [PATCH] xavix2: plug a hole (nw) --- src/devices/cpu/xavix2/xavix2.cpp | 2 +- src/devices/cpu/xavix2/xavix2.h | 1 + src/devices/cpu/xavix2/xavix2d.cpp | 7 ++++++- src/devices/cpu/xavix2/xavix2d.h | 1 + src/mame/drivers/xavix2.cpp | 5 +++-- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/devices/cpu/xavix2/xavix2.cpp b/src/devices/cpu/xavix2/xavix2.cpp index a96d1f09a0e..70d9c6168b3 100644 --- a/src/devices/cpu/xavix2/xavix2.cpp +++ b/src/devices/cpu/xavix2/xavix2.cpp @@ -215,7 +215,7 @@ void xavix2_device::execute_run() switch(opcode >> 24) { case 0x00: case 0x01: m_r[r1(opcode)] = do_add(m_r[r2(opcode)], val19s(opcode)); break; - // 02-03 + case 0x02: case 0x03: m_r[r1(opcode)] = val22h(opcode); break; case 0x04: case 0x05: m_r[r1(opcode)] = do_sub(m_r[r2(opcode)], val19s(opcode)); break; case 0x06: case 0x07: m_r[r1(opcode)] = val22s(opcode); break; case 0x08: npc = val24u(opcode) | (m_pc & 0xff000000); break; diff --git a/src/devices/cpu/xavix2/xavix2.h b/src/devices/cpu/xavix2/xavix2.h index 646ca7ebc69..2524f77b413 100644 --- a/src/devices/cpu/xavix2/xavix2.h +++ b/src/devices/cpu/xavix2/xavix2.h @@ -56,6 +56,7 @@ protected: static inline int r3(u32 opcode) { return (opcode >> 16) & 7; } static inline u32 val24u(u32 opcode) { return opcode & 0x00ffffff; } + static inline u32 val22h(u32 opcode) { return opcode << 10; } static inline u32 val22s(u32 opcode) { return opcode & 0x200000 ? opcode | 0xffc00000 : opcode & 0x3fffff; } static inline u32 val19s(u32 opcode) { return opcode & 0x40000 ? opcode | 0xfff80000 : opcode & 0x7ffff; } static inline u32 val19u(u32 opcode) { return opcode & 0x0007ffff; } diff --git a/src/devices/cpu/xavix2/xavix2d.cpp b/src/devices/cpu/xavix2/xavix2d.cpp index cf9494343e0..b6cdb90f75b 100644 --- a/src/devices/cpu/xavix2/xavix2d.cpp +++ b/src/devices/cpu/xavix2/xavix2d.cpp @@ -30,6 +30,11 @@ const char *xavix2_disassembler::r3() return reg_names[(m_opcode >> 16) & 7]; } +std::string xavix2_disassembler::val22h() +{ + return util::string_format("%08x", u32(m_opcode << 10)); +} + std::string xavix2_disassembler::val22s() { u32 r = m_opcode & 0x3fffff; @@ -182,7 +187,7 @@ offs_t xavix2_disassembler::disassemble(std::ostream &stream, offs_t pc, const d u32 flags = 0; switch(m_opcode >> 24) { case 0x00: case 0x01: util::stream_format(stream, "%s = %s + %s", r1(), r2(), val19s()); break; - // 02-03 + case 0x02: case 0x03: util::stream_format(stream, "%s = %s", r1(), val22h()); break; case 0x04: case 0x05: util::stream_format(stream, "%s = %s - %s", r1(), r2(), val19s()); break; case 0x06: case 0x07: util::stream_format(stream, "%s = %s", r1(), val22s()); break; case 0x08: util::stream_format(stream, "jmp %s", adr24()); break; diff --git a/src/devices/cpu/xavix2/xavix2d.h b/src/devices/cpu/xavix2/xavix2d.h index bd8d077c2b9..c014783b921 100644 --- a/src/devices/cpu/xavix2/xavix2d.h +++ b/src/devices/cpu/xavix2/xavix2d.h @@ -26,6 +26,7 @@ private: const char *r1(); const char *r2(); const char *r3(); + std::string val22h(); std::string val22s(); std::string val19s(); std::string val19u(); diff --git a/src/mame/drivers/xavix2.cpp b/src/mame/drivers/xavix2.cpp index 452df360028..49b2df92e3e 100644 --- a/src/mame/drivers/xavix2.cpp +++ b/src/mame/drivers/xavix2.cpp @@ -115,9 +115,10 @@ void xavix2_state::dma_count_w(offs_t, u16 data, u16 mem_mask) void xavix2_state::dma_control_w(u8 data) { if(data == 3 || data == 7) { - logerror("DMA %s:%08x -> %04x (%04x)\n", + logerror("DMA %s:%08x -> %04x (%04x) %s\n", data == 3 ? "ram" : "rom", - m_dma_src, m_dma_dst, m_dma_count); + m_dma_src, m_dma_dst, m_dma_count, + machine().describe_context()); u32 sadr = m_dma_src | (data == 3 ? 0xc0000000 : 0x40000000); u32 dadr = m_dma_dst | 0xc0000000; auto &prg = m_maincpu->space(AS_PROGRAM);