summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/z80/z80.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/cpu/z80/z80.c')
-rw-r--r--src/emu/cpu/z80/z80.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/emu/cpu/z80/z80.c b/src/emu/cpu/z80/z80.c
index df11378ffac..2b5e2e877f7 100644
--- a/src/emu/cpu/z80/z80.c
+++ b/src/emu/cpu/z80/z80.c
@@ -473,7 +473,7 @@ inline UINT8 z80_device::rop()
{
unsigned pc = PCD;
PC++;
- return m_direct->read_decrypted_byte(pc);
+ return m_decrypted_opcodes_direct->read_byte(pc);
}
/****************************************************************
@@ -486,14 +486,14 @@ inline UINT8 z80_device::arg()
{
unsigned pc = PCD;
PC++;
- return m_direct->read_raw_byte(pc);
+ return m_direct->read_byte(pc);
}
inline UINT16 z80_device::arg16()
{
unsigned pc = PCD;
PC += 2;
- return m_direct->read_raw_byte(pc) | (m_direct->read_raw_byte((pc+1)&0xffff) << 8);
+ return m_direct->read_byte(pc) | (m_direct->read_byte((pc+1)&0xffff) << 8);
}
/***************************************************************
@@ -1945,7 +1945,7 @@ OP(xycb,ff) { A = set(7, rm(m_ea)); wm(m_ea, A); } /* SET 7,A=(XY+o) */
OP(illegal,1) {
logerror("Z80 '%s' ill. opcode $%02x $%02x\n",
- tag(), m_direct->read_decrypted_byte((PCD-1)&0xffff), m_direct->read_decrypted_byte(PCD));
+ tag(), m_decrypted_opcodes_direct->read_byte((PCD-1)&0xffff), m_decrypted_opcodes_direct->read_byte(PCD));
}
/**********************************************************
@@ -2533,7 +2533,7 @@ OP(fd,ff) { illegal_1(); op_ff(); } /* DB FD
OP(illegal,2)
{
logerror("Z80 '%s' ill. opcode $ed $%02x\n",
- tag(), m_direct->read_decrypted_byte((PCD-1)&0xffff));
+ tag(), m_decrypted_opcodes_direct->read_byte((PCD-1)&0xffff));
}
/**********************************************************
@@ -3375,7 +3375,9 @@ void z80_device::device_start()
m_ea = 0;
m_program = &space(AS_PROGRAM);
+ m_decrypted_opcodes = has_space(AS_DECRYPTED_OPCODES) ? &space(AS_DECRYPTED_OPCODES) : m_program;
m_direct = &m_program->direct();
+ m_decrypted_opcodes_direct = &m_decrypted_opcodes->direct();
m_io = &space(AS_IO);
if (static_config() != NULL)
@@ -3702,6 +3704,7 @@ void z80_device::z80_set_cycle_tables(const UINT8 *op, const UINT8 *cb, const UI
z80_device::z80_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
cpu_device(mconfig, Z80, "Z80", tag, owner, clock, "z80", __FILE__),
m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0),
+ m_decrypted_opcodes_config("decrypted_opcodes", ENDIANNESS_LITTLE, 8, 16, 0),
m_io_config("io", ENDIANNESS_LITTLE, 8, 16, 0)
{
}
@@ -3709,10 +3712,22 @@ z80_device::z80_device(const machine_config &mconfig, const char *tag, device_t
z80_device::z80_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
cpu_device(mconfig, type, name, tag, owner, clock, shortname, source),
m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0),
+ m_decrypted_opcodes_config("decrypted_opcodes", ENDIANNESS_LITTLE, 8, 16, 0),
m_io_config("io", ENDIANNESS_LITTLE, 8, 16, 0)
{
}
+const address_space_config *z80_device::memory_space_config(address_spacenum spacenum) const
+{
+ switch(spacenum)
+ {
+ case AS_PROGRAM: return &m_program_config;
+ case AS_IO: return &m_io_config;
+ case AS_DECRYPTED_OPCODES: return has_configured_map(AS_DECRYPTED_OPCODES) ? &m_decrypted_opcodes_config : NULL;
+ default: return NULL;
+ }
+}
+
const device_type Z80 = &device_creator<z80_device>;
nsc800_device::nsc800_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)