diff options
Diffstat (limited to 'src/devices/cpu/z80/z80.cpp')
-rw-r--r-- | src/devices/cpu/z80/z80.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/src/devices/cpu/z80/z80.cpp b/src/devices/cpu/z80/z80.cpp index 794c7800800..3b2fcd99761 100644 --- a/src/devices/cpu/z80/z80.cpp +++ b/src/devices/cpu/z80/z80.cpp @@ -110,6 +110,7 @@ #include "emu.h" #include "debugger.h" #include "z80.h" +#include "z80dasm.h" #define VERBOSE 0 @@ -208,7 +209,7 @@ static const uint8_t cc_op[0x100] = { 5,10,10,10,10,11, 7,11, 5,10,10, 0,10,17, 7,11, /* cb -> cc_cb */ 5,10,10,11,10,11, 7,11, 5, 4,10,11,10, 0, 7,11, /* dd -> cc_xy */ 5,10,10,19,10,11, 7,11, 5, 4,10, 4,10, 0, 7,11, /* ed -> cc_ed */ - 5,10,10, 4,10,11, 7,11, 5, 6,10, 4,10, 0, 7,11 /* fd -> cc_xy */ + 5,10,10, 4,10,11, 7,11, 5, 6,10, 4,10, 0, 7,11 /* fd -> cc_xy */ }; static const uint8_t cc_cb[0x100] = { @@ -235,14 +236,14 @@ static const uint8_t cc_ed[0x100] = { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, -12,12,15,20, 8,14, 8, 9,12,12,15,20, 8,14, 8, 9, -12,12,15,20, 8,14, 8, 9,12,12,15,20, 8,14, 8, 9, -12,12,15,20, 8,14, 8,18,12,12,15,20, 8,14, 8,18, -12,12,15,20, 8,14, 8, 8,12,12,15,20, 8,14, 8, 8, + 12,12,15,20,8,14, 8, 9,12,12,15,20, 8,14, 8, 9, + 12,12,15,20,8,14, 8, 9,12,12,15,20, 8,14, 8, 9, + 12,12,15,20,8,14, 8,18,12,12,15,20, 8,14, 8,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4, 4+4,19 , 4+4, 4+4, 4+4, 4+4, 4+4, 4+4, 4+4,19 , 4+4, @@ -266,26 +267,26 @@ static const uint8_t cc_xy[0x100] = { 5+4,10+4,10+4,10+4,10+4,11+4, 7+4,11+4, 5+4,10+4,10+4, 0 ,10+4,17+4, 7+4,11+4, /* cb -> cc_xycb */ 5+4,10+4,10+4,11+4,10+4,11+4, 7+4,11+4, 5+4, 4+4,10+4,11+4,10+4, 4 , 7+4,11+4, /* dd -> cc_xy again */ 5+4,10+4,10+4,19+4,10+4,11+4, 7+4,11+4, 5+4, 4+4,10+4, 4+4,10+4, 4 , 7+4,11+4, /* ed -> cc_ed */ - 5+4,10+4,10+4, 4+4,10+4,11+4, 7+4,11+4, 5+4, 6+4,10+4, 4+4,10+4, 4 , 7+4,11+4 /* fd -> cc_xy again */ + 5+4,10+4,10+4, 4+4,10+4,11+4, 7+4,11+4, 5+4, 6+4,10+4, 4+4,10+4, 4 , 7+4,11+4 /* fd -> cc_xy again */ }; static const uint8_t cc_xycb[0x100] = { -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, -20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, -20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, -20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, -23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23 + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, + 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, + 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, + 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, + 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23 }; /* extra cycles if jr/jp/call taken and 'interrupt latency' on rst 0-7 */ @@ -569,8 +570,8 @@ inline void z80_device::jp_cond(bool cond) ***************************************************************/ inline void z80_device::jr() { - int8_t a = (int8_t)arg(); /* arg() also increments PC */ - PC += a; /* so don't do PC += arg() */ + int8_t a = (int8_t)arg(); /* arg() also increments PC */ + PC += a; /* so don't do PC += arg() */ WZ = PC; } @@ -614,7 +615,7 @@ inline void z80_device::call_cond(bool cond, uint8_t opcode) } else { - WZ = arg16(); /* implicit call PC+=2; */ + WZ = arg16(); /* implicit call PC+=2; */ } } @@ -660,7 +661,7 @@ inline void z80_device::reti() inline void z80_device::ld_r_a() { m_r = A; - m_r2 = A & 0x80; /* keep bit 7 of r */ + m_r2 = A & 0x80; /* keep bit 7 of r */ } /*************************************************************** @@ -3406,12 +3407,12 @@ void z80_device::device_start() m_program = &space(AS_PROGRAM); m_decrypted_opcodes = has_space(AS_OPCODES) ? &space(AS_OPCODES) : m_program; - m_direct = &m_program->direct(); - m_decrypted_opcodes_direct = &m_decrypted_opcodes->direct(); + m_direct = m_program->direct<0>(); + m_decrypted_opcodes_direct = m_decrypted_opcodes->direct<0>(); m_io = &space(AS_IO); IX = IY = 0xffff; /* IX and IY are FFFF after a reset! */ - F = ZF; /* Zero flag is set */ + F = ZF; /* Zero flag is set */ /* set up the state table */ state_add(STATE_GENPC, "PC", m_pc.w.l).callimport(); @@ -3667,14 +3668,13 @@ void z80_device::state_string_export(const device_state_entry &entry, std::strin } //------------------------------------------------- -// disasm_disassemble - call the disassembly +// disassemble - call the disassembly // helper function //------------------------------------------------- -offs_t z80_device::disasm_disassemble( std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options ) +util::disasm_interface *z80_device::create_disassembler() { - extern CPU_DISASSEMBLE( z80 ); - return CPU_DISASSEMBLE_NAME(z80)(this, stream, pc, oprom, opram, options); + return new z80_disassembler; } |