xavix2: plug a hole (nw)

This commit is contained in:
Olivier Galibert 2020-02-12 22:11:08 +01:00
parent c12bb83e11
commit 496710dd22
5 changed files with 12 additions and 4 deletions

View File

@ -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;

View File

@ -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; }

View File

@ -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;

View File

@ -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();

View File

@ -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);