diff options
Diffstat (limited to 'src/mame/video/fgoal.c')
-rw-r--r-- | src/mame/video/fgoal.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/mame/video/fgoal.c b/src/mame/video/fgoal.c index dc0c1182c5a..d3061eae611 100644 --- a/src/mame/video/fgoal.c +++ b/src/mame/video/fgoal.c @@ -7,43 +7,43 @@ #include "driver.h" #include "includes/fgoal.h" -static bitmap_t *fgbitmap; -static bitmap_t *bgbitmap; - -static UINT8 xpos; -static UINT8 ypos; - -static int current_color; - WRITE8_HANDLER( fgoal_color_w ) { - current_color = data & 3; + fgoal_state *state = (fgoal_state *)space->machine->driver_data; + state->current_color = data & 3; } WRITE8_HANDLER( fgoal_ypos_w ) { - ypos = data; + fgoal_state *state = (fgoal_state *)space->machine->driver_data; + state->ypos = data; } WRITE8_HANDLER( fgoal_xpos_w ) { - xpos = data; + fgoal_state *state = (fgoal_state *)space->machine->driver_data; + state->xpos = data; } VIDEO_START( fgoal ) { - fgbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen); - bgbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen); + fgoal_state *state = (fgoal_state *)machine->driver_data; + state->fgbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen); + state->bgbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen); + + state_save_register_global_bitmap(machine, state->fgbitmap); + state_save_register_global_bitmap(machine, state->bgbitmap); } VIDEO_UPDATE( fgoal ) { - const UINT8* VRAM = fgoal_video_ram; + fgoal_state *state = (fgoal_state *)screen->machine->driver_data; + const UINT8* VRAM = state->video_ram; int x; int y; @@ -51,16 +51,16 @@ VIDEO_UPDATE( fgoal ) /* draw color overlay foreground and background */ - if (fgoal_player == 1 && (input_port_read(screen->machine, "IN1") & 0x40)) + if (state->fgoal_player == 1 && (input_port_read(screen->machine, "IN1") & 0x40)) { - drawgfxzoom_opaque(fgbitmap, cliprect, screen->machine->gfx[0], - 0, (fgoal_player << 2) | current_color, + drawgfxzoom_opaque(state->fgbitmap, cliprect, screen->machine->gfx[0], + 0, (state->fgoal_player << 2) | state->current_color, 1, 1, 0, 16, 0x40000, 0x40000); - drawgfxzoom_opaque(bgbitmap, cliprect, screen->machine->gfx[1], + drawgfxzoom_opaque(state->bgbitmap, cliprect, screen->machine->gfx[1], 0, 0, 1, 1, 0, 16, @@ -69,14 +69,14 @@ VIDEO_UPDATE( fgoal ) } else { - drawgfxzoom_opaque(fgbitmap, cliprect, screen->machine->gfx[0], - 0, (fgoal_player << 2) | current_color, + drawgfxzoom_opaque(state->fgbitmap, cliprect, screen->machine->gfx[0], + 0, (state->fgoal_player << 2) | state->current_color, 0, 0, 0, 0, 0x40000, 0x40000); - drawgfxzoom_opaque(bgbitmap, cliprect, screen->machine->gfx[1], + drawgfxzoom_opaque(state->bgbitmap, cliprect, screen->machine->gfx[1], 0, 0, 0, 0, 0, 0, @@ -86,13 +86,13 @@ VIDEO_UPDATE( fgoal ) /* the ball has a fixed color */ - for (y = ypos; y < ypos + 8; y++) + for (y = state->ypos; y < state->ypos + 8; y++) { - for (x = xpos; x < xpos + 8; x++) + for (x = state->xpos; x < state->xpos + 8; x++) { if (y < 256 && x < 256) { - *BITMAP_ADDR16(fgbitmap, y, x) = 128 + 16; + *BITMAP_ADDR16(state->fgbitmap, y, x) = 128 + 16; } } } @@ -103,8 +103,8 @@ VIDEO_UPDATE( fgoal ) { UINT16* p = BITMAP_ADDR16(bitmap, y, 0); - const UINT16* FG = BITMAP_ADDR16(fgbitmap, y, 0); - const UINT16* BG = BITMAP_ADDR16(bgbitmap, y, 0); + const UINT16* FG = BITMAP_ADDR16(state->fgbitmap, y, 0); + const UINT16* BG = BITMAP_ADDR16(state->bgbitmap, y, 0); for (x = 0; x < 256; x += 8) { |