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/lviv.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/lviv.c')
-rw-r--r-- | src/mess/machine/lviv.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mess/machine/lviv.c b/src/mess/machine/lviv.c index 24360aa8a61..371505cb78b 100644 --- a/src/mess/machine/lviv.c +++ b/src/mess/machine/lviv.c @@ -172,17 +172,17 @@ READ8_MEMBER(lviv_state::lviv_io_r) WRITE8_MEMBER(lviv_state::lviv_io_w) { - address_space *cpuspace = machine().device("maincpu")->memory().space(AS_PROGRAM); + address_space &cpuspace = machine().device("maincpu")->memory().space(AS_PROGRAM); if (m_startup_mem_map) { UINT8 *ram = machine().device<ram_device>(RAM_TAG)->pointer(); m_startup_mem_map = 0; - cpuspace->install_write_bank(0x0000, 0x3fff, "bank1"); - cpuspace->install_write_bank(0x4000, 0x7fff, "bank2"); - cpuspace->install_write_bank(0x8000, 0xbfff, "bank3"); - cpuspace->unmap_write(0xC000, 0xffff); + cpuspace.install_write_bank(0x0000, 0x3fff, "bank1"); + cpuspace.install_write_bank(0x4000, 0x7fff, "bank2"); + cpuspace.install_write_bank(0x8000, 0xbfff, "bank3"); + cpuspace.unmap_write(0xC000, 0xffff); membank("bank1")->set_base(ram); membank("bank2")->set_base(ram + 0x4000); @@ -232,7 +232,7 @@ I8255A_INTERFACE( lviv_ppi8255_interface_1 ) void lviv_state::machine_reset() { - address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM); + address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); UINT8 *mem; space.set_direct_update_handler(direct_update_delegate(FUNC(lviv_state::lviv_directoverride), this)); |