summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/neodrvr.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2012-04-20 05:54:39 +0000
committer Aaron Giles <aaron@aarongiles.com>2012-04-20 05:54:39 +0000
commit18f33f4eff805592f984a31f55513bce4a219ee5 (patch)
tree9e8dfdf1452e3d97a95936db2e9c740efa258306 /src/mame/drivers/neodrvr.c
parent776d29c90f2a6c3c234597eb950410b95c5addec (diff)
Changed device->subregion to device->memregion. Moved
memory_region management into the memory manager instead of directly in the machine. Hid the global region method; now all regions must be looked up relative to a device. If you're a member function, you can just use memregion("tag") directly. If you're a global function or a device referencing global regions, use machine().root_device().memregion("tag") to look up regions relative to the root. S&R to convert all references: machine([()]*)\.region machine\1\.root_device\(\).subregion Then remove redundant machine().root_device() within src/mame: ([ \t])machine\(\)\.root_device\(\)\. \1 And use state->memregion() if we have a state variable present: (state *= *[^;]+driver_data[^}]+)([^ \t]*)machine[()]*\.root_device\(\)\. \1state-> Finally some cleanup: screen.state-> state-> device->state-> state-> space->state-> state-> And a few hand-tweaks.
Diffstat (limited to 'src/mame/drivers/neodrvr.c')
-rw-r--r--src/mame/drivers/neodrvr.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mame/drivers/neodrvr.c b/src/mame/drivers/neodrvr.c
index 8122e27b2b1..0c83802540d 100644
--- a/src/mame/drivers/neodrvr.c
+++ b/src/mame/drivers/neodrvr.c
@@ -9456,8 +9456,8 @@ static DRIVER_INIT( kof2002b )
kof2002_decrypt_68k(machine);
neo_pcm2_swap(machine, 0);
neogeo_cmc50_m1_decrypt(machine);
- kof2002b_gfx_decrypt(machine, machine.region("sprites")->base(),0x4000000);
- kof2002b_gfx_decrypt(machine, machine.region("fixed")->base(),0x20000);
+ kof2002b_gfx_decrypt(machine, machine.root_device().memregion("sprites")->base(),0x4000000);
+ kof2002b_gfx_decrypt(machine, machine.root_device().memregion("fixed")->base(),0x20000);
}
static DRIVER_INIT( kf2k2pls )
@@ -9560,7 +9560,7 @@ static DRIVER_INIT( mslug5 )
static TIMER_CALLBACK( ms5pcb_bios_timer_callback )
{
int harddip3 = input_port_read(machine, "HARDDIP") & 1;
- machine.root_device().membank(NEOGEO_BANK_BIOS)->set_base(machine.region("mainbios")->base() + 0x20000 + harddip3 * 0x20000);
+ machine.root_device().membank(NEOGEO_BANK_BIOS)->set_base(machine.root_device().memregion("mainbios")->base() + 0x20000 + harddip3 * 0x20000);
}
static DRIVER_INIT( ms5pcb )
@@ -9597,7 +9597,7 @@ static DRIVER_INIT( ms5plus )
static TIMER_CALLBACK( svcpcb_bios_timer_callback )
{
int harddip3 = input_port_read(machine, "HARDDIP") & 1;
- machine.root_device().membank(NEOGEO_BANK_BIOS)->set_base(machine.region("mainbios")->base() + 0x20000 + harddip3 * 0x20000);
+ machine.root_device().membank(NEOGEO_BANK_BIOS)->set_base(machine.root_device().memregion("mainbios")->base() + 0x20000 + harddip3 * 0x20000);
}
static DRIVER_INIT( svcpcb )
@@ -9700,7 +9700,7 @@ static DRIVER_INIT( kf2k3pcb )
incorrect */
{
int i;
- UINT8* rom = machine.region("audiocpu")->base();
+ UINT8* rom = state->memregion("audiocpu")->base();
for (i = 0; i < 0x90000; i++)
{
rom[i] = BITSWAP8(rom[i], 5, 6, 1, 4, 3, 0, 7, 2);
@@ -9835,7 +9835,7 @@ static DRIVER_INIT( mvs )
static READ16_HANDLER( sbp_lowerrom_r )
{
- UINT16* rom = (UINT16*)space->machine().region("maincpu")->base();
+ UINT16* rom = (UINT16*)space->machine().root_device().memregion("maincpu")->base();
UINT16 origdata = rom[(offset+(0x200/2))];
UINT16 data = BITSWAP16(origdata, 11,10,9,8,15,14,13,12,3,2,1,0,7,6,5,4);
int realoffset = 0x200+(offset*2);
@@ -9881,7 +9881,7 @@ static DRIVER_INIT(sbp )
/* the game code clears the text overlay used ingame immediately after writing it.. why? protection? sloppy code that the hw ignores? imperfect emulation? */
{
- UINT16* rom = (UINT16*)machine.region("maincpu")->base();
+ UINT16* rom = (UINT16*)machine.root_device().memregion("maincpu")->base();
rom[0x2a6f8/2] = 0x4e71;
rom[0x2a6fa/2] = 0x4e71;