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/intv.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/intv.c')
-rw-r--r-- | src/mess/machine/intv.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mess/machine/intv.c b/src/mess/machine/intv.c index f92d2fa0995..a355a1fc6b4 100644 --- a/src/mess/machine/intv.c +++ b/src/mess/machine/intv.c @@ -410,7 +410,7 @@ static int intv_load_rom_file(device_image_interface &image) UINT8 *memory = image.device().machine().root_device().memregion("maincpu")->base(); intv_state *state = image.device().machine().driver_data<intv_state>(); - address_space *program = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM); + address_space &program = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM); const char *filetype = image.filetype(); /* if it is in .rom format, we enter here */ @@ -504,7 +504,7 @@ static int intv_load_rom_file(device_image_interface &image) start = (( ram & 0xf0 ) >> 4) * 0x1000; size = ( ram & 0x0f ) * 0x800; - program->install_readwrite_handler(start, start + size, + program.install_readwrite_handler(start, start + size, read16_delegate( FUNC( intv_state::intv_cart_ram8_r ), state), write16_delegate( FUNC( intv_state::intv_cart_ram8_w ), state)); } @@ -556,7 +556,7 @@ DEVICE_IMAGE_LOAD( intv_cart ) const char* region_name[] = {"4800", "5000", "6000", "7000", "9000", "A000", "C000", "D000", "F000"}; UINT8 *memory = image.device().machine().root_device().memregion("maincpu")->base(); intv_state *state = image.device().machine().driver_data<intv_state>(); - address_space *program = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM); + address_space &program = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM); UINT32 size=0; UINT16 address = 0; @@ -593,7 +593,7 @@ DEVICE_IMAGE_LOAD( intv_cart ) size = image.get_software_region_length("D000_RAM8"); if (size) { - program->install_readwrite_handler(0xD000, 0xD000 + size, + program.install_readwrite_handler(0xD000, 0xD000 + size, read16_delegate( FUNC( intv_state::intv_cart_ram8_r ), state), write16_delegate( FUNC( intv_state::intv_cart_ram8_w ), state)); } @@ -601,7 +601,7 @@ DEVICE_IMAGE_LOAD( intv_cart ) size = image.get_software_region_length("8800_RAM8"); if (size) { - program->install_readwrite_handler(0x8800, 0x8800 + size, + program.install_readwrite_handler(0x8800, 0x8800 + size, read16_delegate( FUNC( intv_state::intv_cart_ram8_r ), state), write16_delegate( FUNC( intv_state::intv_cart_ram8_w ), state)); } |