summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/system1.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/video/system1.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/video/system1.c')
-rw-r--r--src/mame/video/system1.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mame/video/system1.c b/src/mame/video/system1.c
index c362df8d860..9f1a86e41de 100644
--- a/src/mame/video/system1.c
+++ b/src/mame/video/system1.c
@@ -291,7 +291,7 @@ WRITE8_DEVICE_HANDLER( system1_videoram_bank_w )
WRITE8_MEMBER(system1_state::system1_paletteram_w)
{
- const UINT8 *color_prom = machine().region("palette")->base();
+ const UINT8 *color_prom = memregion("palette")->base();
int val,r,g,b;
/*
@@ -363,8 +363,8 @@ WRITE8_MEMBER(system1_state::system1_paletteram_w)
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffset)
{
system1_state *state = machine.driver_data<system1_state>();
- UINT32 gfxbanks = machine.region("sprites")->bytes() / 0x8000;
- const UINT8 *gfxbase = machine.region("sprites")->base();
+ UINT32 gfxbanks = machine.root_device().memregion("sprites")->bytes() / 0x8000;
+ const UINT8 *gfxbase = state->memregion("sprites")->base();
UINT8 *spriteram = state->m_spriteram;
int flipscreen = state->flip_screen();
int spritenum;
@@ -493,7 +493,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
static void video_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind16 &fgpixmap, bitmap_ind16 **bgpixmaps, const int *bgrowscroll, int bgyscroll, int spritexoffs)
{
system1_state *state = screen.machine().driver_data<system1_state>();
- const UINT8 *lookup = screen.machine().region("proms")->base();
+ const UINT8 *lookup = state->memregion("proms")->base();
int x, y;
/* first clear the sprite bitmap and draw sprites within this area */