diff options
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 |
commit | 621ac620ae1ca743a66bb52aaf5478da01c3bac6 (patch) | |
tree | 2743a87e9077417af7546970d1ea1cc3b8781a63 /src/mame/drivers/neodrvr.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/mame/drivers/neodrvr.c')
-rw-r--r-- | src/mame/drivers/neodrvr.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mame/drivers/neodrvr.c b/src/mame/drivers/neodrvr.c index d7b011bd7fd..92cefd2f0c5 100644 --- a/src/mame/drivers/neodrvr.c +++ b/src/mame/drivers/neodrvr.c @@ -9724,7 +9724,7 @@ DRIVER_INIT_MEMBER(neogeo_state,kf2k3pcb) neo_pcm2_swap(machine(), 5); m_fixed_layer_bank_type = 2; install_pvc_protection(machine()); - machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xc00000, 0xc7ffff, "bios" ); // 512k bios + machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0xc00000, 0xc7ffff, "bios" ); // 512k bios } DRIVER_INIT_MEMBER(neogeo_state,kof2003) @@ -9796,18 +9796,18 @@ DRIVER_INIT_MEMBER(neogeo_state,jockeygp) kof2000_neogeo_gfx_decrypt(machine(), 0xac); /* install some extra RAM */ - machine().device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x200000, 0x201fff); + machine().device("maincpu")->memory().space(AS_PROGRAM).install_ram(0x200000, 0x201fff); -// machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x280000, 0x280001, "IN5"); -// machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2c0000, 0x2c0001, "IN6"); +// machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x280000, 0x280001, "IN5"); +// machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x2c0000, 0x2c0001, "IN6"); } DRIVER_INIT_MEMBER(neogeo_state,vliner) { - machine().device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x200000, 0x201fff); + machine().device("maincpu")->memory().space(AS_PROGRAM).install_ram(0x200000, 0x201fff); - machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x280000, 0x280001, "IN5"); - machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2c0000, 0x2c0001, "IN6"); + machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x280000, 0x280001, "IN5"); + machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x2c0000, 0x2c0001, "IN6"); DRIVER_INIT_CALL(neogeo); } @@ -9815,7 +9815,7 @@ DRIVER_INIT_MEMBER(neogeo_state,vliner) DRIVER_INIT_MEMBER(neogeo_state,kog) { /* overlay cartridge ROM */ - machine().device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x0ffffe, 0x0fffff, "JUMPER"); + machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x0ffffe, 0x0fffff, "JUMPER"); kog_px_decrypt(machine()); neogeo_bootleg_sx_decrypt(machine(), 1); @@ -9875,8 +9875,8 @@ DRIVER_INIT_MEMBER(neogeo_state,sbp) // there are also writes to 0x1080.. // // other stuff going on as well tho, the main overlay is still missing, and p1 inputs don't work - machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00200, 0x001fff, FUNC(sbp_lowerrom_r)); - machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00200, 0x001fff, FUNC(sbp_lowerrom_w)); + machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x00200, 0x001fff, FUNC(sbp_lowerrom_r)); + machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_write_handler(0x00200, 0x001fff, FUNC(sbp_lowerrom_w)); /* the game code clears the text overlay used ingame immediately after writing it.. why? protection? sloppy code that the hw ignores? imperfect emulation? */ { |