From 61c775bb74f91ff1d3ec9874c855156f69527506 Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Wed, 11 Mar 2020 21:07:26 +0100 Subject: [PATCH] More dgpix work (nw) --- src/devices/cpu/ks0164/ks0164d.cpp | 39 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/src/devices/cpu/ks0164/ks0164d.cpp b/src/devices/cpu/ks0164/ks0164d.cpp index 55f0a8525cf..fb6a777c57c 100644 --- a/src/devices/cpu/ks0164/ks0164d.cpp +++ b/src/devices/cpu/ks0164/ks0164d.cpp @@ -27,22 +27,22 @@ std::string ks0164_disassembler::off16(s16 dt) #define P std::ostream &stream, u32 opcode, const data_buffer &opcodes, u32 pc const ks0164_disassembler::instruction ks0164_disassembler::instructions[] { - { 0x0000, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bne %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x0400, 0xfc00, [](P) -> u32 { util::stream_format(stream, "beq %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x0800, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bcc %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x0c00, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bcs %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x1000, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bpl %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x1400, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bmi %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x1800, 0xfc00, [](P) -> u32 { util::stream_format(stream, "b?6 %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x1c00, 0xfc00, [](P) -> u32 { util::stream_format(stream, "b?7 %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x2000, 0xfc00, [](P) -> u32 { util::stream_format(stream, "b?8 %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x2400, 0xfc00, [](P) -> u32 { util::stream_format(stream, "b?9 %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x2800, 0xfc00, [](P) -> u32 { util::stream_format(stream, "b?a %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x2c00, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bgt %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x3000, 0xfc00, [](P) -> u32 { util::stream_format(stream, "b?c %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x3400, 0xfc00, [](P) -> u32 { util::stream_format(stream, "b?d %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x3800, 0xfc00, [](P) -> u32 { util::stream_format(stream, "blt %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, - { 0x3c00, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bra %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, + { 0x0000, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bne %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, + { 0x0400, 0xfc00, [](P) -> u32 { util::stream_format(stream, "beq %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, + { 0x0800, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bgeu %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, + { 0x0c00, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bltu %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, + { 0x1000, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bpl %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, + { 0x1400, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bmi %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, + { 0x1800, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bvc %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, + { 0x1c00, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bvs %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, + { 0x2000, 0xfc00, [](P) -> u32 { util::stream_format(stream, "b?8 %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, + { 0x2400, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bgtu %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, + { 0x2800, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bleu %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, + { 0x2c00, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bgts %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, + { 0x3000, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bles %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, + { 0x3400, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bges %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, + { 0x3800, 0xfc00, [](P) -> u32 { util::stream_format(stream, "blts %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, + { 0x3c00, 0xfc00, [](P) -> u32 { util::stream_format(stream, "bra %04x", (pc + 2 + off10(opcode)) & 0xffff); return 2; } }, { 0x4000, 0xf800, [](P) -> u32 { util::stream_format(stream, "%s += %02x", regs[(opcode >> 8) & 7], opcode & 0xff); return 2; } }, { 0x4800, 0xf800, [](P) -> u32 { util::stream_format(stream, "%s -= %02x", regs[(opcode >> 8) & 7], opcode & 0xff); return 2; } }, @@ -171,14 +171,15 @@ const ks0164_disassembler::instruction ks0164_disassembler::instructions[] { { 0xb80f, 0xf88f, [](P) -> u32 { util::stream_format(stream, "%s *= (%s%s).w", regs[(opcode >> 8) & 7], regs[(opcode >> 4) & 7], off16(opcodes.r16(pc+2))); return 4; } }, { 0xc800, 0xf88f, [](P) -> u32 { util::stream_format(stream, "-(%s).w = %s", regs[(opcode >> 8) & 7], regs[(opcode >> 4) & 7]); return 2; } }, - { 0xc001, 0xffff, [](P) -> u32 { util::stream_format(stream, "push?"); return 2; } }, - { 0xc003, 0xffff, [](P) -> u32 { util::stream_format(stream, "pop?"); return 2; } }, + { 0xc001, 0xffff, [](P) -> u32 { util::stream_format(stream, "push r0-r3"); return 2; } }, + { 0xc003, 0xffff, [](P) -> u32 { util::stream_format(stream, "pop r0-r3"); return 2; } }, { 0xc008, 0xf88f, [](P) -> u32 { util::stream_format(stream, "(%s)+.w = %s", regs[(opcode >> 8) & 7], regs[(opcode >> 4) & 7]); return 2; } }, { 0xc00a, 0xf88f, [](P) -> u32 { util::stream_format(stream, "%s = (%s)+.w", regs[(opcode >> 8) & 7], regs[(opcode >> 4) & 7]); return 2; } }, { 0xc00c, 0xf80f, [](P) -> u32 { util::stream_format(stream, "%s <<= %x", regs[(opcode >> 8) & 7], (opcode >> 4) & 0xf); return 2; } }, { 0xc80c, 0xf80f, [](P) -> u32 { util::stream_format(stream, "%s >>= %x", regs[(opcode >> 8) & 7], (opcode >> 4) & 0xf); return 2; } }, { 0xc80d, 0xf80f, [](P) -> u32 { util::stream_format(stream, "%s >>s= %x", regs[(opcode >> 8) & 7], (opcode >> 4) & 0xf); return 2; } }, + { 0xc80f, 0xf80f, [](P) -> u32 { util::stream_format(stream, "%s >>c= %x", regs[(opcode >> 8) & 7], (opcode >> 4) & 0xf); return 2; } }, { 0xd088, 0xf88f, [](P) -> u32 { util::stream_format(stream, "%s = max(%s, %04x)", regs[(opcode >> 8) & 7], regs[(opcode >> 4) & 7], opcodes.r16(pc+2)); return 4; } }, { 0xd888, 0xf88f, [](P) -> u32 { util::stream_format(stream, "%s = min(%s, %04x)", regs[(opcode >> 8) & 7], regs[(opcode >> 4) & 7], opcodes.r16(pc+2)); return 4; } }, @@ -189,7 +190,7 @@ const ks0164_disassembler::instruction ks0164_disassembler::instructions[] { { 0xd004, 0xffff, [](P) -> u32 { util::stream_format(stream, "rti"); return 2; } }, { 0xd085, 0xf8ff, [](P) -> u32 { util::stream_format(stream, "%s = -%s", regs[(opcode >> 8) & 7], regs[(opcode >> 8) & 7]); return 2; } }, - { 0xe000, 0xf80f, [](P) -> u32 { util::stream_format(stream, "btst %s, %x", regs[(opcode >> 8) & 7], (opcode >> 4) & 0xf); return 2; } }, + { 0xe008, 0xf80f, [](P) -> u32 { util::stream_format(stream, "btst %s, %x", regs[(opcode >> 8) & 7], (opcode >> 4) & 0xf); return 2; } }, { 0xe001, 0xf80f, [](P) -> u32 { util::stream_format(stream, "bset %s, %x", regs[(opcode >> 8) & 7], (opcode >> 4) & 0xf); return 2; } }, { 0xe002, 0xf80f, [](P) -> u32 { util::stream_format(stream, "btst (%s).b, %x", regs[(opcode >> 8) & 7], (opcode >> 4) & 0xf); return 2; } }, { 0xe00a, 0xf80f, [](P) -> u32 { util::stream_format(stream, "btst (%s).w, %x", regs[(opcode >> 8) & 7], (opcode >> 4) & 0xf); return 2; } },