summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/m6800/m6800.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2012-09-19 19:48:09 +0000
committer Aaron Giles <aaron@aarongiles.com>2012-09-19 19:48:09 +0000
commit621ac620ae1ca743a66bb52aaf5478da01c3bac6 (patch)
tree2743a87e9077417af7546970d1ea1cc3b8781a63 /src/emu/cpu/m6800/m6800.c
parent33c77e65bbd4513957f2ece623cee476cf439248 (diff)
Since nobody checks for NULLs anyway, make
device_memory_interface::space() assert against NULL and return a reference, and pushed references throughout all address space usage in the system. Added a has_space() method to check for those rare case when it is ambiguous. [Aaron Giles] Also reinstated the generic space and added fatal error handlers if anyone tries to actually read/write from it.
Diffstat (limited to 'src/emu/cpu/m6800/m6800.c')
-rw-r--r--src/emu/cpu/m6800/m6800.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/emu/cpu/m6800/m6800.c b/src/emu/cpu/m6800/m6800.c
index 448c5787aa3..2c8b6086482 100644
--- a/src/emu/cpu/m6800/m6800.c
+++ b/src/emu/cpu/m6800/m6800.c
@@ -1046,10 +1046,10 @@ static CPU_INIT( m6800 )
{
m6800_state *cpustate = get_safe_token(device);
- cpustate->program = device->space(AS_PROGRAM);
+ cpustate->program = &device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
- cpustate->data = device->space(AS_DATA);
- cpustate->io = device->space(AS_IO);
+ cpustate->data = &device->space(AS_DATA);
+ cpustate->io = &device->space(AS_IO);
// cpustate->subtype = SUBTYPE_M6800;
cpustate->insn = m6800_insn;
@@ -1199,10 +1199,10 @@ static CPU_INIT( m6801 )
cpustate->irq_callback = irqcallback;
cpustate->device = device;
- cpustate->program = device->space(AS_PROGRAM);
+ cpustate->program = &device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
- cpustate->data = device->space(AS_DATA);
- cpustate->io = device->space(AS_IO);
+ cpustate->data = &device->space(AS_DATA);
+ cpustate->io = &device->space(AS_IO);
cpustate->clock = device->clock() / 4;
cpustate->sci_timer = device->machine().scheduler().timer_alloc(FUNC(sci_tick), cpustate);
@@ -1234,10 +1234,10 @@ static CPU_INIT( m6802 )
cpustate->irq_callback = irqcallback;
cpustate->device = device;
- cpustate->program = device->space(AS_PROGRAM);
+ cpustate->program = &device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
- cpustate->data = device->space(AS_DATA);
- cpustate->io = device->space(AS_IO);
+ cpustate->data = &device->space(AS_DATA);
+ cpustate->io = &device->space(AS_IO);
state_register(cpustate, "m6802");
}
@@ -1254,10 +1254,10 @@ static CPU_INIT( m6803 )
cpustate->irq_callback = irqcallback;
cpustate->device = device;
- cpustate->program = device->space(AS_PROGRAM);
+ cpustate->program = &device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
- cpustate->data = device->space(AS_DATA);
- cpustate->io = device->space(AS_IO);
+ cpustate->data = &device->space(AS_DATA);
+ cpustate->io = &device->space(AS_IO);
cpustate->clock = device->clock() / 4;
cpustate->sci_timer = device->machine().scheduler().timer_alloc(FUNC(sci_tick), cpustate);
@@ -1296,10 +1296,10 @@ static CPU_INIT( m6808 )
cpustate->irq_callback = irqcallback;
cpustate->device = device;
- cpustate->program = device->space(AS_PROGRAM);
+ cpustate->program = &device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
- cpustate->data = device->space(AS_DATA);
- cpustate->io = device->space(AS_IO);
+ cpustate->data = &device->space(AS_DATA);
+ cpustate->io = &device->space(AS_IO);
state_register(cpustate, "m6808");
}
@@ -1317,10 +1317,10 @@ static CPU_INIT( hd6301 )
cpustate->irq_callback = irqcallback;
cpustate->device = device;
- cpustate->program = device->space(AS_PROGRAM);
+ cpustate->program = &device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
- cpustate->data = device->space(AS_DATA);
- cpustate->io = device->space(AS_IO);
+ cpustate->data = &device->space(AS_DATA);
+ cpustate->io = &device->space(AS_IO);
cpustate->clock = device->clock() / 4;
cpustate->sci_timer = device->machine().scheduler().timer_alloc(FUNC(sci_tick), cpustate);
@@ -1342,10 +1342,10 @@ static CPU_INIT( hd63701 )
cpustate->irq_callback = irqcallback;
cpustate->device = device;
- cpustate->program = device->space(AS_PROGRAM);
+ cpustate->program = &device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
- cpustate->data = device->space(AS_DATA);
- cpustate->io = device->space(AS_IO);
+ cpustate->data = &device->space(AS_DATA);
+ cpustate->io = &device->space(AS_IO);
cpustate->clock = device->clock() / 4;
cpustate->sci_timer = device->machine().scheduler().timer_alloc(FUNC(sci_tick), cpustate);
@@ -1377,10 +1377,10 @@ static CPU_INIT( nsc8105 )
// cpustate->subtype = SUBTYPE_NSC8105;
cpustate->device = device;
- cpustate->program = device->space(AS_PROGRAM);
+ cpustate->program = &device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
- cpustate->data = device->space(AS_DATA);
- cpustate->io = device->space(AS_IO);
+ cpustate->data = &device->space(AS_DATA);
+ cpustate->io = &device->space(AS_IO);
cpustate->insn = nsc8105_insn;
cpustate->cycles = cycles_nsc8105;