diff options
author | 2012-09-19 19:48:09 +0000 | |
---|---|---|
committer | 2012-09-19 19:48:09 +0000 | |
commit | 621ac620ae1ca743a66bb52aaf5478da01c3bac6 (patch) | |
tree | 2743a87e9077417af7546970d1ea1cc3b8781a63 /src/mess/machine/amstrad.c | |
parent | 33c77e65bbd4513957f2ece623cee476cf439248 (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/mess/machine/amstrad.c')
-rw-r--r-- | src/mess/machine/amstrad.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mess/machine/amstrad.c b/src/mess/machine/amstrad.c index 3e514db1219..22ed66eb021 100644 --- a/src/mess/machine/amstrad.c +++ b/src/mess/machine/amstrad.c @@ -1195,7 +1195,7 @@ static void amstrad_setLowerRom(running_machine &machine) } else // CPC+/GX4000 { - //address_space &space = *state->m_maincpu->space(AS_PROGRAM); + //address_space &space = state->m_maincpu->space(AS_PROGRAM); /* if ( state->m_asic.enabled && ( state->m_asic.rmr2 & 0x18 ) == 0x18 ) { @@ -2174,7 +2174,7 @@ The exception is the case where none of b7-b0 are reset (i.e. port &FBFF), which static void amstrad_handle_snapshot(running_machine &machine, unsigned char *pSnapshot) { amstrad_state *state = machine.driver_data<amstrad_state>(); - address_space &space = *state->m_maincpu->space(AS_PROGRAM); + address_space &space = state->m_maincpu->space(AS_PROGRAM); mc6845_device *mc6845 = state->m_crtc; device_t *ay8910 = state->m_ay; int RegData; @@ -2457,7 +2457,7 @@ BDIR BC1 | static void update_psg(running_machine &machine) { amstrad_state *state = machine.driver_data<amstrad_state>(); - address_space &space = *state->m_maincpu->space(AS_PROGRAM); + address_space &space = state->m_maincpu->space(AS_PROGRAM); device_t *ay8910 = state->m_ay; mc146818_device *rtc = state->m_rtc; @@ -2831,7 +2831,7 @@ static const UINT8 amstrad_cycle_table_ex[256]= static void amstrad_common_init(running_machine &machine) { amstrad_state *state = machine.driver_data<amstrad_state>(); - address_space &space = *state->m_maincpu->space(AS_PROGRAM); + address_space &space = state->m_maincpu->space(AS_PROGRAM); device_t* romexp; rom_image_device* romimage; char str[20]; @@ -2976,7 +2976,7 @@ MACHINE_START_MEMBER(amstrad_state,plus) MACHINE_RESET_MEMBER(amstrad_state,plus) { - address_space &space = *m_maincpu->space(AS_PROGRAM); + address_space &space = m_maincpu->space(AS_PROGRAM); int i; UINT8 *rom = memregion("maincpu")->base(); @@ -3026,7 +3026,7 @@ MACHINE_START_MEMBER(amstrad_state,gx4000) MACHINE_RESET_MEMBER(amstrad_state,gx4000) { - address_space &space = *m_maincpu->space(AS_PROGRAM); + address_space &space = m_maincpu->space(AS_PROGRAM); int i; UINT8 *rom = memregion("maincpu")->base(); |