diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c index 42f787213d3..b7fde156a1f 100644 --- a/src/emu/cpu/tms34010/tms34010.c +++ b/src/emu/cpu/tms34010/tms34010.c @@ -1080,26 +1080,26 @@ void tms34010_get_display_params(device_t *cpu, tms34010_display_params *params) SCREEN_UPDATE( tms340x0 ) { - pen_t blackpen = get_black_pen(screen->machine()); + pen_t blackpen = get_black_pen(screen.machine()); tms34010_display_params params; tms34010_state *tms = NULL; device_t *cpu; int x; /* find the owning CPU */ - for (cpu = screen->machine().devicelist().first(); cpu != NULL; cpu = cpu->next()) + for (cpu = screen.machine().devicelist().first(); cpu != NULL; cpu = cpu->next()) { device_type type = cpu->type(); if (type == TMS34010 || type == TMS34020) { tms = get_safe_token(cpu); - if (tms->config != NULL && tms->config->scanline_callback != NULL && tms->screen == screen) + if (tms->config != NULL && tms->config->scanline_callback != NULL && tms->screen == &screen) break; tms = NULL; } } if (tms == NULL) - fatalerror("Unable to locate matching CPU for screen '%s'\n", screen->tag()); + fatalerror("Unable to locate matching CPU for screen '%s'\n", screen.tag()); /* get the display parameters for the screen */ tms34010_get_display_params(tms->device, ¶ms); @@ -1109,7 +1109,7 @@ SCREEN_UPDATE( tms340x0 ) { /* call through to the callback */ LOG((" Update: scan=%3d ROW=%04X COL=%04X\n", cliprect->min_y, params.rowaddr, params.coladdr)); - (*tms->config->scanline_callback)(*screen, bitmap, cliprect->min_y, ¶ms); + (*tms->config->scanline_callback)(screen, bitmap, cliprect->min_y, ¶ms); } /* otherwise, just blank the current scanline */ @@ -1270,7 +1270,7 @@ WRITE16_HANDLER( tms34010_io_register_w ) } // if (LOG_CONTROL_REGS) -// logerror("%s: %s = %04X (%d)\n", tms->device->machine().describe_context(), ioreg_name[offset], IOREG(tms, offset), tms->screen->vpos()); +// logerror("%s: %s = %04X (%d)\n", tms->device->machine().describe_context(), ioreg_name[offset], IOREG(tms, offset), tms->screen.vpos()); } @@ -1307,7 +1307,7 @@ WRITE16_HANDLER( tms34020_io_register_w ) IOREG(tms, offset) = data; // if (LOG_CONTROL_REGS) -// logerror("%s: %s = %04X (%d)\n", device->machine().describe_context(), ioreg020_name[offset], IOREG(tms, offset), tms->screen->vpos()); +// logerror("%s: %s = %04X (%d)\n", device->machine().describe_context(), ioreg020_name[offset], IOREG(tms, offset), tms->screen.vpos()); switch (offset) { diff --git a/src/emu/machine.c b/src/emu/machine.c index 4c8ada75b87..35664d805e0 100644 --- a/src/emu/machine.c +++ b/src/emu/machine.c @@ -1121,16 +1121,6 @@ bool driver_device::screen_update(screen_device &screen, bitmap_t &bitmap, const } -//------------------------------------------------- -// video_eof - default implementation which -// calls to the legacy video_eof function -//------------------------------------------------- - -void driver_device::screen_eof() -{ -} - - //------------------------------------------------- // device_rom_region - return a pointer to the // game's ROMs diff --git a/src/emu/machine.h b/src/emu/machine.h index 444374db819..d981ca0a291 100644 --- a/src/emu/machine.h +++ b/src/emu/machine.h @@ -561,7 +561,6 @@ public: // additional video helpers virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect); - virtual void screen_eof(); // generic helpers diff --git a/src/emu/machine/ldcore.c b/src/emu/machine/ldcore.c index 58aade8c076..399b87022d7 100644 --- a/src/emu/machine/ldcore.c +++ b/src/emu/machine/ldcore.c @@ -1192,10 +1192,10 @@ void laserdisc_overlay_enable(device_t *device, int enable) SCREEN_UPDATE( laserdisc ) { - device_t *laserdisc = screen->machine().device("laserdisc"); // TODO: allow more than one laserdisc + device_t *laserdisc = screen.machine().device("laserdisc"); // TODO: allow more than one laserdisc if (laserdisc != NULL) { - const rectangle &visarea = screen->visible_area(); + const rectangle &visarea = screen.visible_area(); laserdisc_state *ld = (laserdisc_state *)downcast(laserdisc)->token(); ldcore_data *ldcore = ld->core; bitmap_t *overbitmap = ldcore->overbitmap[ldcore->overindex]; @@ -1234,11 +1234,11 @@ SCREEN_UPDATE( laserdisc ) ldcore->videotex->set_bitmap(vidbitmap, NULL, TEXFORMAT_YUY16, ldcore->videopalette); /* reset the screen contents */ - screen->container().empty(); + screen.container().empty(); /* add the video texture */ if (ldcore->videoenable) - screen->container().add_quad(0.0f, 0.0f, 1.0f, 1.0f, MAKE_ARGB(0xff,0xff,0xff,0xff), ldcore->videotex, PRIMFLAG_BLENDMODE(BLENDMODE_NONE) | PRIMFLAG_SCREENTEX(1)); + screen.container().add_quad(0.0f, 0.0f, 1.0f, 1.0f, MAKE_ARGB(0xff,0xff,0xff,0xff), ldcore->videotex, PRIMFLAG_BLENDMODE(BLENDMODE_NONE) | PRIMFLAG_SCREENTEX(1)); /* add the overlay */ if (ldcore->overenable && overbitmap != NULL) @@ -1247,7 +1247,7 @@ SCREEN_UPDATE( laserdisc ) float y0 = 0.5f - 0.5f * ldcore->config.overscaley + ldcore->config.overposy; float x1 = x0 + ldcore->config.overscalex; float y1 = y0 + ldcore->config.overscaley; - screen->container().add_quad(x0, y0, x1, y1, MAKE_ARGB(0xff,0xff,0xff,0xff), ldcore->overtex, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_SCREENTEX(1)); + screen.container().add_quad(x0, y0, x1, y1, MAKE_ARGB(0xff,0xff,0xff,0xff), ldcore->overtex, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_SCREENTEX(1)); } /* swap to the next bitmap */ diff --git a/src/emu/machine/s3c2400.c b/src/emu/machine/s3c2400.c index 0b969b191cb..f4278a8b0ea 100644 --- a/src/emu/machine/s3c2400.c +++ b/src/emu/machine/s3c2400.c @@ -39,7 +39,7 @@ VIDEO_START( s3c2400 ) SCREEN_UPDATE( s3c2400 ) { - device_t *device = screen->machine().device( S3C2400_TAG); + device_t *device = screen.machine().device( S3C2400_TAG); return s3c24xx_video_update( device, screen, bitmap, cliprect); } diff --git a/src/emu/machine/s3c2410.c b/src/emu/machine/s3c2410.c index 9dee05b1fbf..ab798825d56 100644 --- a/src/emu/machine/s3c2410.c +++ b/src/emu/machine/s3c2410.c @@ -39,7 +39,7 @@ VIDEO_START( s3c2410 ) SCREEN_UPDATE( s3c2410 ) { - device_t *device = screen->machine().device( S3C2410_TAG); + device_t *device = screen.machine().device( S3C2410_TAG); return s3c24xx_video_update( device, screen, bitmap, cliprect); } diff --git a/src/emu/machine/s3c2440.c b/src/emu/machine/s3c2440.c index 445053926ed..2396ae305c5 100644 --- a/src/emu/machine/s3c2440.c +++ b/src/emu/machine/s3c2440.c @@ -39,7 +39,7 @@ VIDEO_START( s3c2440 ) SCREEN_UPDATE( s3c2440 ) { - device_t *device = screen->machine().device( S3C2440_TAG); + device_t *device = screen.machine().device( S3C2440_TAG); return s3c24xx_video_update( device, screen, bitmap, cliprect); } diff --git a/src/emu/machine/s3c24xx.c b/src/emu/machine/s3c24xx.c index 77218904352..2184150c5a4 100644 --- a/src/emu/machine/s3c24xx.c +++ b/src/emu/machine/s3c24xx.c @@ -758,7 +758,7 @@ static void bitmap_blend( bitmap_t *bitmap_dst, bitmap_t *bitmap_src_1, bitmap_t } } -static UINT32 s3c24xx_video_update( device_t *device, screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect) +static UINT32 s3c24xx_video_update( device_t *device, screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect) { s3c24xx_t *s3c24xx = get_token( device); if (s3c24xx->lcd.framerate >= 1195) diff --git a/src/emu/screen.c b/src/emu/screen.c index b0da4952b51..f974b4d9ab6 100644 --- a/src/emu/screen.c +++ b/src/emu/screen.c @@ -1074,7 +1074,7 @@ void screen_device::load_effect_overlay(const char *filename) bool screen_device::screen_update(bitmap_t &bitmap, const rectangle &cliprect) { if (m_screen_update != NULL) { - return (*m_screen_update)(this, &bitmap, &cliprect); + return (*m_screen_update)(*this, &bitmap, &cliprect); } else { return machine().driver_data()->screen_update(*this, bitmap, cliprect); } @@ -1087,9 +1087,6 @@ bool screen_device::screen_update(bitmap_t &bitmap, const rectangle &cliprect) void screen_device::screen_eof() { - if (m_screen_eof != NULL) { - return (*m_screen_eof)(this, machine()); - } else { - machine().driver_data()->screen_eof(); - } + if (m_screen_eof != NULL) + return (*m_screen_eof)(*this); } diff --git a/src/emu/screen.h b/src/emu/screen.h index 18a202d4269..9d7a8d37ceb 100644 --- a/src/emu/screen.h +++ b/src/emu/screen.h @@ -74,8 +74,8 @@ class screen_device; // callback that is called to notify of a change in the VBLANK state typedef delegate vblank_state_delegate; -typedef UINT32 (*screen_update_func)(screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect); -typedef void (*screen_eof_func)(screen_device *screen, running_machine &machine); +typedef UINT32 (*screen_update_func)(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect); +typedef void (*screen_eof_func)(screen_device &screen); // ======================> screen_device @@ -255,12 +255,12 @@ extern const device_type SCREEN; //************************************************************************** #define SCREEN_UPDATE_NAME(name) screen_update_##name -#define SCREEN_UPDATE(name) UINT32 SCREEN_UPDATE_NAME(name)(screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect) +#define SCREEN_UPDATE(name) UINT32 SCREEN_UPDATE_NAME(name)(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect) #define SCREEN_UPDATE_CALL(name) SCREEN_UPDATE_NAME(name)(screen, bitmap, cliprect) #define SCREEN_EOF_NAME(name) screen_eof_##name -#define SCREEN_EOF(name) void SCREEN_EOF_NAME(name)(screen_device *screen, running_machine &machine) -#define SCREEN_EOF_CALL(name) SCREEN_EOF_NAME(name)(screen, machine) +#define SCREEN_EOF(name) void SCREEN_EOF_NAME(name)(screen_device &screen) +#define SCREEN_EOF_CALL(name) SCREEN_EOF_NAME(name)(screen) #define screen_eof_0 NULL diff --git a/src/emu/video/generic.c b/src/emu/video/generic.c index 6d74df2e0c2..983dc034e11 100644 --- a/src/emu/video/generic.c +++ b/src/emu/video/generic.c @@ -287,7 +287,7 @@ VIDEO_START( generic_bitmapped ) SCREEN_UPDATE( generic_bitmapped ) { - copybitmap(bitmap, screen->machine().generic.tmpbitmap, 0, 0, 0, 0, cliprect); + copybitmap(bitmap, screen.machine().generic.tmpbitmap, 0, 0, 0, 0, cliprect); return 0; } diff --git a/src/emu/video/pc_cga.c b/src/emu/video/pc_cga.c index dfe2a34882a..54d42431446 100644 --- a/src/emu/video/pc_cga.c +++ b/src/emu/video/pc_cga.c @@ -387,8 +387,8 @@ static VIDEO_START( pc_cga32k ) SCREEN_UPDATE( mc6845_cga ) { - UINT8 *gfx = screen->machine().region("gfx1")->base(); - mc6845_device *mc6845 = screen->machine().device(CGA_MC6845_NAME); + UINT8 *gfx = screen.machine().region("gfx1")->base(); + mc6845_device *mc6845 = screen.machine().device(CGA_MC6845_NAME); mc6845->update( bitmap, cliprect); /* Check for changes in font dipsetting */ @@ -413,8 +413,8 @@ static VIDEO_START( cga_poisk2 ) static SCREEN_UPDATE( cga_poisk2 ) { - UINT8 *gfx = screen->machine().region("gfx1")->base(); - mc6845_device *mc6845 = screen->machine().device(CGA_MC6845_NAME); + UINT8 *gfx = screen.machine().region("gfx1")->base(); + mc6845_device *mc6845 = screen.machine().device(CGA_MC6845_NAME); mc6845->update( bitmap, cliprect); /* Check for changes in font dipsetting */ @@ -1619,8 +1619,8 @@ static VIDEO_START( pc1512 ) static SCREEN_UPDATE( mc6845_pc1512 ) { - UINT8 *gfx = screen->machine().region("gfx1")->base(); - mc6845_device *mc6845 = screen->machine().device(CGA_MC6845_NAME); + UINT8 *gfx = screen.machine().region("gfx1")->base(); + mc6845_device *mc6845 = screen.machine().device(CGA_MC6845_NAME); mc6845->update(bitmap, cliprect); /* Check for changes in font dipsetting */ diff --git a/src/emu/video/pc_vga.c b/src/emu/video/pc_vga.c index b8af2772fb2..ed6e55c7fb1 100644 --- a/src/emu/video/pc_vga.c +++ b/src/emu/video/pc_vga.c @@ -83,14 +83,14 @@ SCREEN_UPDATE( pc_video ) { UINT32 rc = 0; int w = 0, h = 0; - pc_video_update_proc video_update = pc_choosevideomode(screen->machine(), &w, &h); + pc_video_update_proc video_update = pc_choosevideomode(screen.machine(), &w, &h); if (video_update) { if ((pc_current_width != w) || (pc_current_height != h)) { - int width = screen->width(); - int height = screen->height(); + int width = screen.width(); + int height = screen.height(); pc_current_width = w; pc_current_height = h; @@ -101,7 +101,7 @@ SCREEN_UPDATE( pc_video ) pc_current_height = height; if ((pc_current_width > 100) && (pc_current_height > 100)) - screen->set_visible_area(0, pc_current_width-1, 0, pc_current_height-1); + screen.set_visible_area(0, pc_current_width-1, 0, pc_current_height-1); bitmap_fill(bitmap, cliprect, 0); } diff --git a/src/emu/video/psx.c b/src/emu/video/psx.c index 981be4855ae..59e591db4ee 100644 --- a/src/emu/video/psx.c +++ b/src/emu/video/psx.c @@ -3690,7 +3690,7 @@ PALETTE_INIT( psx ) SCREEN_UPDATE( psx ) { - psxgpu_device *gpu = downcast(screen->owner()); + psxgpu_device *gpu = downcast(screen.owner()); gpu->update_screen( bitmap, cliprect ); return 0; } diff --git a/src/emu/video/vector.c b/src/emu/video/vector.c index cf92011acbc..f7c35a60c75 100644 --- a/src/emu/video/vector.c +++ b/src/emu/video/vector.c @@ -256,8 +256,8 @@ void vector_clear_list (void) SCREEN_UPDATE( vector ) { - UINT32 flags = PRIMFLAG_ANTIALIAS(screen->machine().options().antialias() ? 1 : 0) | PRIMFLAG_BLENDMODE(BLENDMODE_ADD); - const rectangle &visarea = screen->visible_area(); + UINT32 flags = PRIMFLAG_ANTIALIAS(screen.machine().options().antialias() ? 1 : 0) | PRIMFLAG_BLENDMODE(BLENDMODE_ADD); + const rectangle &visarea = screen.visible_area(); float xscale = 1.0f / (65536 * (visarea.max_x - visarea.min_x)); float yscale = 1.0f / (65536 * (visarea.max_y - visarea.min_y)); float xoffs = (float)visarea.min_x; @@ -269,8 +269,8 @@ SCREEN_UPDATE( vector ) curpoint = vector_list; - screen->container().empty(); - screen->container().add_rect(0.0f, 0.0f, 1.0f, 1.0f, MAKE_ARGB(0xff,0x00,0x00,0x00), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); + screen.container().empty(); + screen.container().add_rect(0.0f, 0.0f, 1.0f, 1.0f, MAKE_ARGB(0xff,0x00,0x00,0x00), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); clip.x0 = clip.y0 = 0.0f; clip.x1 = clip.y1 = 1.0f; @@ -300,7 +300,7 @@ SCREEN_UPDATE( vector ) if (curpoint->intensity != 0) if (!render_clip_line(&coords, &clip)) - screen->container().add_line(coords.x0, coords.y0, coords.x1, coords.y1, + screen.container().add_line(coords.x0, coords.y0, coords.x1, coords.y1, beam_width * (1.0f / (float)VECTOR_WIDTH_DENOM), (curpoint->intensity << 24) | (curpoint->col & 0xffffff), flags); diff --git a/src/mame/drivers/1945kiii.c b/src/mame/drivers/1945kiii.c index 783d7e5add2..285742f4968 100644 --- a/src/mame/drivers/1945kiii.c +++ b/src/mame/drivers/1945kiii.c @@ -118,9 +118,9 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect static SCREEN_UPDATE(k3) { - k3_state *state = screen->machine().driver_data(); + k3_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/39in1.c b/src/mame/drivers/39in1.c index ccc7c4f53ea..f2158318583 100644 --- a/src/mame/drivers/39in1.c +++ b/src/mame/drivers/39in1.c @@ -1514,7 +1514,7 @@ INPUT_PORTS_END static SCREEN_UPDATE( 39in1 ) { - _39in1_state *state = screen->machine().driver_data<_39in1_state>(); + _39in1_state *state = screen.machine().driver_data<_39in1_state>(); int x = 0; int y = 0; diff --git a/src/mame/drivers/5clown.c b/src/mame/drivers/5clown.c index 35cfc004a64..165af4c66f8 100644 --- a/src/mame/drivers/5clown.c +++ b/src/mame/drivers/5clown.c @@ -523,7 +523,7 @@ static VIDEO_START(fclown) static SCREEN_UPDATE( fclown ) { - _5clown_state *state = screen->machine().driver_data<_5clown_state>(); + _5clown_state *state = screen.machine().driver_data<_5clown_state>(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/ace.c b/src/mame/drivers/ace.c index a307c0b5b9f..3fc4f2e98d5 100644 --- a/src/mame/drivers/ace.c +++ b/src/mame/drivers/ace.c @@ -84,25 +84,25 @@ static VIDEO_START( ace ) static SCREEN_UPDATE( ace ) { - ace_state *state = screen->machine().driver_data(); + ace_state *state = screen.machine().driver_data(); int offs; /* first of all, fill the screen with the background color */ bitmap_fill(bitmap, cliprect, 0); - drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[1], + drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[1], 0, 0, 0, 0, state->m_objpos[0], state->m_objpos[1]); - drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[2], + drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[2], 0, 0, 0, 0, state->m_objpos[2], state->m_objpos[3]); - drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[3], + drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[3], 0, 0, 0, 0, @@ -111,7 +111,7 @@ static SCREEN_UPDATE( ace ) for (offs = 0; offs < 8; offs++) { drawgfx_opaque(bitmap,/* ?? */ - cliprect, screen->machine().gfx[4], + cliprect, screen.machine().gfx[4], offs, 0, 0, 0, diff --git a/src/mame/drivers/acefruit.c b/src/mame/drivers/acefruit.c index a5580dee54a..b153ec1ab04 100644 --- a/src/mame/drivers/acefruit.c +++ b/src/mame/drivers/acefruit.c @@ -78,7 +78,7 @@ static INTERRUPT_GEN( acefruit_vblank ) static SCREEN_UPDATE( acefruit ) { - acefruit_state *state = screen->machine().driver_data(); + acefruit_state *state = screen.machine().driver_data(); int startrow = cliprect->min_y / 8; int endrow = cliprect->max_y / 8; int row; @@ -98,7 +98,7 @@ static SCREEN_UPDATE( acefruit ) if( color < 0x4 ) { - drawgfx_opaque( bitmap, cliprect, screen->machine().gfx[ 1 ], code, color, 0, 0, col * 16, row * 8 ); + drawgfx_opaque( bitmap, cliprect, screen.machine().gfx[ 1 ], code, color, 0, 0, col * 16, row * 8 ); } else if( color >= 0x5 && color <= 0x7 ) { @@ -106,7 +106,7 @@ static SCREEN_UPDATE( acefruit ) int x; static const int spriteskip[] = { 1, 2, 4 }; int spritesize = spriteskip[ color - 5 ]; - const gfx_element *gfx = screen->machine().gfx[ 0 ]; + const gfx_element *gfx = screen.machine().gfx[ 0 ]; for( x = 0; x < 16; x++ ) { diff --git a/src/mame/drivers/acommand.c b/src/mame/drivers/acommand.c index 54036a66b4e..449f4f71fb9 100644 --- a/src/mame/drivers/acommand.c +++ b/src/mame/drivers/acommand.c @@ -240,9 +240,9 @@ static void draw_led(bitmap_t *bitmap, int x, int y,UINT8 value) static SCREEN_UPDATE( acommand ) { - acommand_state *state = screen->machine().driver_data(); + acommand_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - draw_sprites(screen->machine(),bitmap,cliprect,0,0); + draw_sprites(screen.machine(),bitmap,cliprect,0,0); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); /*Order might be wrong,but these for sure are the led numbers tested*/ diff --git a/src/mame/drivers/adp.c b/src/mame/drivers/adp.c index 65faa02b32f..6ad7e317661 100644 --- a/src/mame/drivers/adp.c +++ b/src/mame/drivers/adp.c @@ -200,12 +200,12 @@ bool adp_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rec #if 0 static SCREEN_UPDATE( adp ) { - adp_state *state = screen->machine().driver_data(); + adp_state *state = screen.machine().driver_data(); state->m_h63484->update_screen(bitmap, cliprect); #if 0 - adp_state *state = screen->machine().driver_data(); + adp_state *state = screen.machine().driver_data(); int x, y, b, src; b = ((hd63484_regs_r(state->m_hd63484, 0xcc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(state->m_hd63484, 0xce/2, 0xffff); @@ -223,7 +223,7 @@ static SCREEN_UPDATE( adp ) b++; } } -if (!screen->machine().input().code_pressed(KEYCODE_O)) // debug: toggle window +if (!screen.machine().input().code_pressed(KEYCODE_O)) // debug: toggle window if ((hd63484_regs_r(state->m_hd63484, 0x06/2, 0xffff) & 0x0300) == 0x0300) { int sy = (hd63484_regs_r(state->m_hd63484, 0x94/2, 0xffff) & 0x0fff) - (hd63484_regs_r(state->m_hd63484, 0x88/2, 0xffff) >> 8); diff --git a/src/mame/drivers/albazc.c b/src/mame/drivers/albazc.c index 2bb95e1fc5c..dba97cd99da 100644 --- a/src/mame/drivers/albazc.c +++ b/src/mame/drivers/albazc.c @@ -80,7 +80,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect static SCREEN_UPDATE(hanaroku) { bitmap_fill(bitmap, cliprect, 0x1f0); // ??? - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/albazg.c b/src/mame/drivers/albazg.c index 168d3247358..5da8460fac4 100644 --- a/src/mame/drivers/albazg.c +++ b/src/mame/drivers/albazg.c @@ -85,7 +85,7 @@ static VIDEO_START( yumefuda ) static SCREEN_UPDATE( yumefuda ) { - albazg_state *state = screen->machine().driver_data(); + albazg_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/aristmk4.c b/src/mame/drivers/aristmk4.c index 8d5d3c2d0eb..1d535386ed4 100644 --- a/src/mame/drivers/aristmk4.c +++ b/src/mame/drivers/aristmk4.c @@ -333,8 +333,8 @@ INLINE void uBackgroundColour(running_machine &machine) static SCREEN_UPDATE(aristmk4) { - aristmk4_state *state = screen->machine().driver_data(); - const gfx_element *gfx = screen->machine().gfx[0]; + aristmk4_state *state = screen.machine().driver_data(); + const gfx_element *gfx = screen.machine().gfx[0]; int x,y; int count = 0; int color; @@ -350,7 +350,7 @@ static SCREEN_UPDATE(aristmk4) color = ((state->m_mkiv_vram[count]) & 0xe0) >> 5; tile = (state->m_mkiv_vram[count+1]|state->m_mkiv_vram[count]<<8) & 0x3ff; bgtile = (state->m_mkiv_vram[count+1]|state->m_mkiv_vram[count]<<8) & 0xff; // first 256 tiles - uBackgroundColour(screen->machine()); // read sw7 + uBackgroundColour(screen.machine()); // read sw7 gfx_element_decode(gfx, bgtile); // force the machine to update only the first 256 tiles. // as we only update the background, not the entire display. flipx = ((state->m_mkiv_vram[count]) & 0x04); diff --git a/src/mame/drivers/aristmk6.c b/src/mame/drivers/aristmk6.c index 3155b08bdf2..47676185877 100644 --- a/src/mame/drivers/aristmk6.c +++ b/src/mame/drivers/aristmk6.c @@ -29,41 +29,41 @@ VIDEO_START(aristmk6) SCREEN_UPDATE(aristmk6) { - aristmk6_state *state = screen->machine().driver_data(); + aristmk6_state *state = screen.machine().driver_data(); int x,y,count; - const UINT8 *blit_ram = screen->machine().region("maincpu")->base(); + const UINT8 *blit_ram = screen.machine().region("maincpu")->base(); - if(screen->machine().input().code_pressed(KEYCODE_Z)) + if(screen.machine().input().code_pressed(KEYCODE_Z)) state->m_test_x++; - if(screen->machine().input().code_pressed(KEYCODE_X)) + if(screen.machine().input().code_pressed(KEYCODE_X)) state->m_test_x--; - if(screen->machine().input().code_pressed(KEYCODE_A)) + if(screen.machine().input().code_pressed(KEYCODE_A)) state->m_test_y++; - if(screen->machine().input().code_pressed(KEYCODE_S)) + if(screen.machine().input().code_pressed(KEYCODE_S)) state->m_test_y--; - if(screen->machine().input().code_pressed(KEYCODE_Q)) + if(screen.machine().input().code_pressed(KEYCODE_Q)) state->m_start_offs+=0x2000; - if(screen->machine().input().code_pressed(KEYCODE_W)) + if(screen.machine().input().code_pressed(KEYCODE_W)) state->m_start_offs-=0x2000; - if(screen->machine().input().code_pressed(KEYCODE_E)) + if(screen.machine().input().code_pressed(KEYCODE_E)) state->m_start_offs++; - if(screen->machine().input().code_pressed(KEYCODE_R)) + if(screen.machine().input().code_pressed(KEYCODE_R)) state->m_start_offs--; - if(screen->machine().input().code_pressed_once(KEYCODE_L)) + if(screen.machine().input().code_pressed_once(KEYCODE_L)) state->m_type^=1; popmessage("%d %d %04x %d",state->m_test_x,state->m_test_y,state->m_start_offs,state->m_type); - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); count = (state->m_start_offs); @@ -86,7 +86,7 @@ SCREEN_UPDATE(aristmk6) g = (g << 2) | (g & 3); b = (b << 3) | (b & 0x7); - if((x)visible_area().max_x && ((y)+0)visible_area().max_y) + if((x)visible_area().max_x && ((y)+0)visible_area().max_y) - *BITMAP_ADDR32(bitmap, y, x) = screen->machine().pens[color]; + if((x)machine().driver_data(); - const UINT8 *color_prom = screen->machine().region("proms")->base(); + astinvad_state *state = screen.machine().driver_data(); + const UINT8 *color_prom = screen.machine().region("proms")->base(); UINT8 yoffs = state->m_flip_yoffs & state->m_screen_flip; int x, y; @@ -164,7 +164,7 @@ static SCREEN_UPDATE( astinvad ) { UINT8 color = color_prom[((y & 0xf8) << 2) | (x >> 3)] >> (state->m_screen_flip ? 0 : 4); UINT8 data = state->m_videoram[(((y ^ state->m_screen_flip) + yoffs) << 5) | ((x ^ state->m_screen_flip) >> 3)]; - plot_byte(screen->machine(), bitmap, y, x, data, state->m_screen_red ? 1 : color); + plot_byte(screen.machine(), bitmap, y, x, data, state->m_screen_red ? 1 : color); } return 0; @@ -173,8 +173,8 @@ static SCREEN_UPDATE( astinvad ) static SCREEN_UPDATE( spaceint ) { - astinvad_state *state = screen->machine().driver_data(); - const UINT8 *color_prom = screen->machine().region("proms")->base(); + astinvad_state *state = screen.machine().driver_data(); + const UINT8 *color_prom = screen.machine().region("proms")->base(); int offs; for (offs = 0; offs < state->m_videoram_size; offs++) @@ -189,7 +189,7 @@ static SCREEN_UPDATE( spaceint ) offs_t n = ((offs >> 5) & 0xf0) | color; color = color_prom[n] & 0x07; - plot_byte(screen->machine(), bitmap, y, x, data, color); + plot_byte(screen.machine(), bitmap, y, x, data, color); } return 0; diff --git a/src/mame/drivers/astrocorp.c b/src/mame/drivers/astrocorp.c index f1674ef9db6..874b685d9c2 100644 --- a/src/mame/drivers/astrocorp.c +++ b/src/mame/drivers/astrocorp.c @@ -140,12 +140,12 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect static SCREEN_UPDATE(astrocorp) { - astrocorp_state *state = screen->machine().driver_data(); + astrocorp_state *state = screen.machine().driver_data(); if (state->m_screen_enable & 1) copybitmap(bitmap, state->m_bitmap, 0,0,0,0, cliprect); else - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } diff --git a/src/mame/drivers/astrof.c b/src/mame/drivers/astrof.c index 74f2af00e5b..b947501f234 100644 --- a/src/mame/drivers/astrof.c +++ b/src/mame/drivers/astrof.c @@ -425,9 +425,9 @@ static SCREEN_UPDATE( astrof ) { pen_t pens[ASTROF_NUM_PENS]; - astrof_get_pens(screen->machine(), pens); + astrof_get_pens(screen.machine(), pens); - video_update_common(screen->machine(), bitmap, cliprect, pens); + video_update_common(screen.machine(), bitmap, cliprect, pens); return 0; } @@ -437,9 +437,9 @@ static SCREEN_UPDATE( tomahawk ) { pen_t pens[TOMAHAWK_NUM_PENS]; - tomahawk_get_pens(screen->machine(), pens); + tomahawk_get_pens(screen.machine(), pens); - video_update_common(screen->machine(), bitmap, cliprect, pens); + video_update_common(screen.machine(), bitmap, cliprect, pens); return 0; } diff --git a/src/mame/drivers/asuka.c b/src/mame/drivers/asuka.c index 19ae9758173..9855bee3183 100644 --- a/src/mame/drivers/asuka.c +++ b/src/mame/drivers/asuka.c @@ -876,7 +876,7 @@ static MACHINE_RESET( asuka ) static SCREEN_EOF( asuka ) { - asuka_state *state = machine.driver_data(); + asuka_state *state = screen.machine().driver_data(); pc090oj_eof_callback(state->m_pc090oj); } diff --git a/src/mame/drivers/atarisy4.c b/src/mame/drivers/atarisy4.c index 28016f80bd2..feeeef85181 100644 --- a/src/mame/drivers/atarisy4.c +++ b/src/mame/drivers/atarisy4.c @@ -136,7 +136,7 @@ static VIDEO_RESET( atarisy4 ) static SCREEN_UPDATE( atarisy4 ) { - atarisy4_state *state = screen->machine().driver_data(); + atarisy4_state *state = screen.machine().driver_data(); int y; UINT32 offset = 0; @@ -161,8 +161,8 @@ static SCREEN_UPDATE( atarisy4 ) { UINT16 data = *src++; - *dest++ = screen->machine().pens[data & 0xff]; - *dest++ = screen->machine().pens[data >> 8]; + *dest++ = screen.machine().pens[data & 0xff]; + *dest++ = screen.machine().pens[data >> 8]; } } return 0; diff --git a/src/mame/drivers/attckufo.c b/src/mame/drivers/attckufo.c index 10256ada093..73f972a0ef3 100644 --- a/src/mame/drivers/attckufo.c +++ b/src/mame/drivers/attckufo.c @@ -162,7 +162,7 @@ static INTERRUPT_GEN( attckufo_raster_interrupt ) static SCREEN_UPDATE( attckufo ) { - attckufo_state *state = screen->machine().driver_data(); + attckufo_state *state = screen.machine().driver_data(); mos6560_video_update(state->m_mos6560, bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/avalnche.c b/src/mame/drivers/avalnche.c index 74506e7680b..4f534a90764 100644 --- a/src/mame/drivers/avalnche.c +++ b/src/mame/drivers/avalnche.c @@ -46,7 +46,7 @@ static SCREEN_UPDATE( avalnche ) { - avalnche_state *state = screen->machine().driver_data(); + avalnche_state *state = screen.machine().driver_data(); offs_t offs; for (offs = 0; offs < state->m_videoram_size; offs++) diff --git a/src/mame/drivers/avt.c b/src/mame/drivers/avt.c index fb4862b9ce0..58090df626d 100644 --- a/src/mame/drivers/avt.c +++ b/src/mame/drivers/avt.c @@ -503,10 +503,10 @@ static VIDEO_START( avt ) static SCREEN_UPDATE( avt ) { - avt_state *state = screen->machine().driver_data(); + avt_state *state = screen.machine().driver_data(); int x,y; int count; - const gfx_element *gfx = screen->machine().gfx[0]; + const gfx_element *gfx = screen.machine().gfx[0]; count = 0; diff --git a/src/mame/drivers/backfire.c b/src/mame/drivers/backfire.c index 74dabc5c899..8d9f3f8f511 100644 --- a/src/mame/drivers/backfire.c +++ b/src/mame/drivers/backfire.c @@ -82,59 +82,69 @@ static VIDEO_START( backfire ) -static SCREEN_UPDATE( backfire ) +static SCREEN_UPDATE( backfire_left ) { - backfire_state *state = screen->machine().driver_data(); + backfire_state *state = screen.machine().driver_data(); //FIXME: flip_screen_x should not be written! - flip_screen_set_no_update(screen->machine(), 1); + flip_screen_set_no_update(screen.machine(), 1); /* screen 1 uses pf1 as the forground and pf3 as the background */ /* screen 2 uses pf2 as the foreground and pf4 as the background */ deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); - if (screen == state->m_lscreen) + bitmap_fill(screen.machine().priority_bitmap, NULL, 0); + bitmap_fill(bitmap, cliprect, 0x100); + + if (state->m_left_priority[0] == 0) { - - bitmap_fill(screen->machine().priority_bitmap, NULL, 0); - bitmap_fill(bitmap, cliprect, 0x100); - - if (state->m_left_priority[0] == 0) - { - deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 1); - deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram_1, 0x800); - } - else if (state->m_left_priority[0] == 2) - { - deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); - deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 4); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram_1, 0x800); - } - else - popmessage( "unknown left priority %08x", state->m_left_priority[0]); + deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 1); + deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram_1, 0x800); } - else if (screen == state->m_rscreen) + else if (state->m_left_priority[0] == 2) { - bitmap_fill(screen->machine().priority_bitmap, NULL, 0); - bitmap_fill(bitmap, cliprect, 0x500); - - if (state->m_right_priority[0] == 0) - { - deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 1); - deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); - screen->machine().device("spritegen2")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram_2, 0x800); - } - else if (state->m_right_priority[0] == 2) - { - deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); - deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 4); - screen->machine().device("spritegen2")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram_2, 0x800); - } - else - popmessage( "unknown right priority %08x", state->m_right_priority[0]); + deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); + deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 4); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram_1, 0x800); } + else + popmessage( "unknown left priority %08x", state->m_left_priority[0]); + + return 0; +} + +static SCREEN_UPDATE( backfire_right ) +{ + backfire_state *state = screen.machine().driver_data(); + + //FIXME: flip_screen_x should not be written! + flip_screen_set_no_update(screen.machine(), 1); + + /* screen 1 uses pf1 as the forground and pf3 as the background */ + /* screen 2 uses pf2 as the foreground and pf4 as the background */ + deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); + deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); + + bitmap_fill(screen.machine().priority_bitmap, NULL, 0); + bitmap_fill(bitmap, cliprect, 0x500); + + if (state->m_right_priority[0] == 0) + { + deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 1); + deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); + screen.machine().device("spritegen2")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram_2, 0x800); + } + else if (state->m_right_priority[0] == 2) + { + deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); + deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 4); + screen.machine().device("spritegen2")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram_2, 0x800); + } + else + popmessage( "unknown right priority %08x", state->m_right_priority[0]); + return 0; } @@ -486,7 +496,7 @@ static MACHINE_CONFIG_START( backfire, backfire_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(40*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE(backfire) + MCFG_SCREEN_UPDATE(backfire_left) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -494,7 +504,7 @@ static MACHINE_CONFIG_START( backfire, backfire_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(40*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE(backfire) + MCFG_SCREEN_UPDATE(backfire_right) MCFG_VIDEO_START(backfire) diff --git a/src/mame/drivers/badlands.c b/src/mame/drivers/badlands.c index a38cc00a07d..66c5434843a 100644 --- a/src/mame/drivers/badlands.c +++ b/src/mame/drivers/badlands.c @@ -693,9 +693,9 @@ static void scanline_update_bootleg(screen_device &screen, int scanline) { /* sound IRQ is on 32V */ // if (scanline & 32) -// atarigen_6502_irq_ack_r(screen->machine(), 0); +// atarigen_6502_irq_ack_r(screen.machine(), 0); // else if (!(input_port_read(machine, "FE4000") & 0x40)) -// atarigen_6502_irq_gen(screen->machine().device("audiocpu")); +// atarigen_6502_irq_gen(screen.machine().device("audiocpu")); } diff --git a/src/mame/drivers/bbusters.c b/src/mame/drivers/bbusters.c index 80ceec30455..03767750d2d 100644 --- a/src/mame/drivers/bbusters.c +++ b/src/mame/drivers/bbusters.c @@ -666,7 +666,7 @@ static const ym2610_interface ym2610_config = static SCREEN_EOF( bbuster ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram16_w(space,0,0,0xffff); buffer_spriteram16_2_w(space,0,0,0xffff); @@ -674,7 +674,7 @@ static SCREEN_EOF( bbuster ) static SCREEN_EOF( mechatt ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram16_w(space,0,0,0xffff); } diff --git a/src/mame/drivers/beaminv.c b/src/mame/drivers/beaminv.c index a5b9f615cf5..2b9c0d9f3d2 100644 --- a/src/mame/drivers/beaminv.c +++ b/src/mame/drivers/beaminv.c @@ -166,7 +166,7 @@ static MACHINE_RESET( beaminv ) static SCREEN_UPDATE( beaminv ) { - beaminv_state *state = screen->machine().driver_data(); + beaminv_state *state = screen.machine().driver_data(); offs_t offs; for (offs = 0; offs < state->m_videoram_size; offs++) diff --git a/src/mame/drivers/berzerk.c b/src/mame/drivers/berzerk.c index 318bac49b24..0b793c3e64e 100644 --- a/src/mame/drivers/berzerk.c +++ b/src/mame/drivers/berzerk.c @@ -446,11 +446,11 @@ static void get_pens(running_machine &machine, pen_t *pens) static SCREEN_UPDATE( berzerk ) { - berzerk_state *state = screen->machine().driver_data(); + berzerk_state *state = screen.machine().driver_data(); pen_t pens[NUM_PENS]; offs_t offs; - get_pens(screen->machine(), pens); + get_pens(screen.machine(), pens); for (offs = 0; offs < state->m_videoram_size; offs++) { diff --git a/src/mame/drivers/bestleag.c b/src/mame/drivers/bestleag.c index 9c006b98cb2..c7d7ff67c9d 100644 --- a/src/mame/drivers/bestleag.c +++ b/src/mame/drivers/bestleag.c @@ -165,7 +165,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta static SCREEN_UPDATE(bestleag) { - bestleag_state *state = screen->machine().driver_data(); + bestleag_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap,0,(state->m_vregs[0x00/2] & 0xfff) + (state->m_vregs[0x08/2] & 0x7) - 3); tilemap_set_scrolly(state->m_bg_tilemap,0,state->m_vregs[0x02/2]); tilemap_set_scrollx(state->m_tx_tilemap,0,state->m_vregs[0x04/2]); @@ -175,14 +175,14 @@ static SCREEN_UPDATE(bestleag) tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); return 0; } static SCREEN_UPDATE(bestleaw) { - bestleag_state *state = screen->machine().driver_data(); + bestleag_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap,0,state->m_vregs[0x08/2]); tilemap_set_scrolly(state->m_bg_tilemap,0,state->m_vregs[0x0a/2]); tilemap_set_scrollx(state->m_tx_tilemap,0,state->m_vregs[0x00/2]); @@ -192,7 +192,7 @@ static SCREEN_UPDATE(bestleaw) tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); return 0; } diff --git a/src/mame/drivers/bfcobra.c b/src/mame/drivers/bfcobra.c index 889fd5b30de..400ed8975f5 100644 --- a/src/mame/drivers/bfcobra.c +++ b/src/mame/drivers/bfcobra.c @@ -341,7 +341,7 @@ static VIDEO_START( bfcobra ) static SCREEN_UPDATE( bfcobra ) { - bfcobra_state *state = screen->machine().driver_data(); + bfcobra_state *state = screen.machine().driver_data(); int x, y; UINT8 *src; UINT32 *dest; @@ -385,13 +385,13 @@ static SCREEN_UPDATE( bfcobra ) if ( ( state->m_videomode & 0x81 ) == 1 || (state->m_videomode & 0x80 && pen & 0x80) ) { - *dest++ = screen->machine().pens[hirescol[pen & 0x0f]]; - *dest++ = screen->machine().pens[hirescol[(pen >> 4) & 0x0f]]; + *dest++ = screen.machine().pens[hirescol[pen & 0x0f]]; + *dest++ = screen.machine().pens[hirescol[(pen >> 4) & 0x0f]]; } else { - *dest++ = screen->machine().pens[lorescol[pen]]; - *dest++ = screen->machine().pens[lorescol[pen]]; + *dest++ = screen.machine().pens[lorescol[pen]]; + *dest++ = screen.machine().pens[lorescol[pen]]; } } } diff --git a/src/mame/drivers/bfm_sc2.c b/src/mame/drivers/bfm_sc2.c index 3c717bb74ad..6b27d7c3489 100644 --- a/src/mame/drivers/bfm_sc2.c +++ b/src/mame/drivers/bfm_sc2.c @@ -1403,10 +1403,10 @@ static MACHINE_RESET( init ) static SCREEN_UPDATE( addersc2 ) { - bfm_sc2_state *state = screen->machine().driver_data(); + bfm_sc2_state *state = screen.machine().driver_data(); if ( state->m_sc2_show_door ) { - output_set_value("door",( Scorpion2_GetSwitchState(screen->machine(),state->m_sc2_door_state>>4, state->m_sc2_door_state & 0x0F) ) ); + output_set_value("door",( Scorpion2_GetSwitchState(screen.machine(),state->m_sc2_door_state>>4, state->m_sc2_door_state & 0x0F) ) ); } return SCREEN_UPDATE_CALL(adder2); diff --git a/src/mame/drivers/bingor.c b/src/mame/drivers/bingor.c index 7ed629ab245..c6c6e3351e4 100644 --- a/src/mame/drivers/bingor.c +++ b/src/mame/drivers/bingor.c @@ -459,10 +459,10 @@ static VIDEO_START(bingor) static SCREEN_UPDATE(bingor) { - bingor_state *state = screen->machine().driver_data(); + bingor_state *state = screen.machine().driver_data(); int x,y,count; - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); count = (0x2000/2); @@ -474,23 +474,23 @@ static SCREEN_UPDATE(bingor) color = (state->m_blit_ram[count] & 0xf000)>>12; - if((x+3)visible_area().max_x && ((y)+0)visible_area().max_y) - *BITMAP_ADDR32(bitmap, y, x+3) = screen->machine().pens[color]; + if((x+3)m_blit_ram[count] & 0x0f00)>>8; - if((x+2)visible_area().max_x && ((y)+0)visible_area().max_y) - *BITMAP_ADDR32(bitmap, y, x+2) = screen->machine().pens[color]; + if((x+2)m_blit_ram[count] & 0x00f0)>>4; - if((x+1)visible_area().max_x && ((y)+0)visible_area().max_y) - *BITMAP_ADDR32(bitmap, y, x+1) = screen->machine().pens[color]; + if((x+1)m_blit_ram[count] & 0x000f)>>0; - if((x+0)visible_area().max_x && ((y)+0)visible_area().max_y) - *BITMAP_ADDR32(bitmap, y, x+0) = screen->machine().pens[color]; + if((x+0)machine().driver_data(); + blackt96_state *state = screen.machine().driver_data(); int count; int x,y; - const gfx_element *gfx = screen->machine().gfx[2]; + const gfx_element *gfx = screen.machine().gfx[2]; - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); - draw_main(screen->machine(),bitmap,cliprect,1); - draw_main(screen->machine(),bitmap,cliprect,0); + draw_main(screen.machine(),bitmap,cliprect,1); + draw_main(screen.machine(),bitmap,cliprect,0); /* Text Layer */ count = 0; diff --git a/src/mame/drivers/blitz.c b/src/mame/drivers/blitz.c index 1ec73ef96f5..580e871c9f6 100644 --- a/src/mame/drivers/blitz.c +++ b/src/mame/drivers/blitz.c @@ -354,7 +354,7 @@ static VIDEO_START( megadpkr ) static SCREEN_UPDATE( megadpkr ) { - blitz_state *state = screen->machine().driver_data(); + blitz_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/blitz68k.c b/src/mame/drivers/blitz68k.c index c101740628d..17b9eee82c4 100644 --- a/src/mame/drivers/blitz68k.c +++ b/src/mame/drivers/blitz68k.c @@ -92,7 +92,7 @@ static VIDEO_START(blitz68k_addr_factor1) static SCREEN_UPDATE(blitz68k) { - blitz68k_state *state = screen->machine().driver_data(); + blitz68k_state *state = screen.machine().driver_data(); int x,y; UINT8 *src = state->m_blit_buffer; @@ -101,7 +101,7 @@ static SCREEN_UPDATE(blitz68k) { for(x = 0; x < 512; x++) { - *BITMAP_ADDR32(bitmap, y, x) = screen->machine().pens[*src++]; + *BITMAP_ADDR32(bitmap, y, x) = screen.machine().pens[*src++]; } } @@ -113,7 +113,7 @@ static SCREEN_UPDATE(blitz68k) static SCREEN_UPDATE(blitz68k_noblit) { - blitz68k_state *state = screen->machine().driver_data(); + blitz68k_state *state = screen.machine().driver_data(); int x,y; UINT16 *src = state->m_frame_buffer; @@ -123,10 +123,10 @@ static SCREEN_UPDATE(blitz68k_noblit) for(x = 0; x < 512; ) { UINT16 pen = *src++; - *BITMAP_ADDR32(bitmap, y, x++) = screen->machine().pens[(pen >> 8) & 0xf]; - *BITMAP_ADDR32(bitmap, y, x++) = screen->machine().pens[(pen >> 12) & 0xf]; - *BITMAP_ADDR32(bitmap, y, x++) = screen->machine().pens[(pen >> 0) & 0xf]; - *BITMAP_ADDR32(bitmap, y, x++) = screen->machine().pens[(pen >> 4) & 0xf]; + *BITMAP_ADDR32(bitmap, y, x++) = screen.machine().pens[(pen >> 8) & 0xf]; + *BITMAP_ADDR32(bitmap, y, x++) = screen.machine().pens[(pen >> 12) & 0xf]; + *BITMAP_ADDR32(bitmap, y, x++) = screen.machine().pens[(pen >> 0) & 0xf]; + *BITMAP_ADDR32(bitmap, y, x++) = screen.machine().pens[(pen >> 4) & 0xf]; } } diff --git a/src/mame/drivers/bmcbowl.c b/src/mame/drivers/bmcbowl.c index ff195fc859d..146e45dadc8 100644 --- a/src/mame/drivers/bmcbowl.c +++ b/src/mame/drivers/bmcbowl.c @@ -133,14 +133,14 @@ static VIDEO_START( bmcbowl ) static SCREEN_UPDATE( bmcbowl ) { - bmcbowl_state *state = screen->machine().driver_data(); + bmcbowl_state *state = screen.machine().driver_data(); /* 280x230,4 bitmap layers, 8bpp, missing scroll and priorities (maybe fixed ones) */ int x,y,z,pixdat; - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); z=0; for (y=0;y<230;y++) diff --git a/src/mame/drivers/bnstars.c b/src/mame/drivers/bnstars.c index c38f74b1967..373dd7f2621 100644 --- a/src/mame/drivers/bnstars.c +++ b/src/mame/drivers/bnstars.c @@ -511,49 +511,51 @@ static VIDEO_START(bnstars) -static SCREEN_UPDATE(bnstars) +static SCREEN_UPDATE(bnstars_left) { - bnstars_state *state = screen->machine().driver_data(); - device_t *left_screen = screen->machine().device("lscreen"); - device_t *right_screen = screen->machine().device("rscreen"); + bnstars_state *state = screen.machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); - if (screen==left_screen) - { - bitmap_fill(bitmap,cliprect,0); /* bg color */ + bitmap_fill(bitmap,cliprect,0); /* bg color */ - tilemap_set_scrollx(state->m_ms32_bg_tilemap[0], 0, state->m_ms32_bg0_scroll[0x00/4] + state->m_ms32_bg0_scroll[0x08/4] + 0x10 ); - tilemap_set_scrolly(state->m_ms32_bg_tilemap[0], 0, state->m_ms32_bg0_scroll[0x0c/4] + state->m_ms32_bg0_scroll[0x14/4] ); - tilemap_draw(bitmap,cliprect,state->m_ms32_bg_tilemap[0],0,1); + tilemap_set_scrollx(state->m_ms32_bg_tilemap[0], 0, state->m_ms32_bg0_scroll[0x00/4] + state->m_ms32_bg0_scroll[0x08/4] + 0x10 ); + tilemap_set_scrolly(state->m_ms32_bg_tilemap[0], 0, state->m_ms32_bg0_scroll[0x0c/4] + state->m_ms32_bg0_scroll[0x14/4] ); + tilemap_draw(bitmap,cliprect,state->m_ms32_bg_tilemap[0],0,1); - draw_roz(screen->machine(),bitmap,cliprect,2,0); + draw_roz(screen.machine(),bitmap,cliprect,2,0); - tilemap_set_scrollx(state->m_ms32_tx_tilemap[0], 0, state->m_ms32_tx0_scroll[0x00/4] + state->m_ms32_tx0_scroll[0x08/4] + 0x18); - tilemap_set_scrolly(state->m_ms32_tx_tilemap[0], 0, state->m_ms32_tx0_scroll[0x0c/4] + state->m_ms32_tx0_scroll[0x14/4]); - tilemap_draw(bitmap,cliprect,state->m_ms32_tx_tilemap[0],0,4); + tilemap_set_scrollx(state->m_ms32_tx_tilemap[0], 0, state->m_ms32_tx0_scroll[0x00/4] + state->m_ms32_tx0_scroll[0x08/4] + 0x18); + tilemap_set_scrolly(state->m_ms32_tx_tilemap[0], 0, state->m_ms32_tx0_scroll[0x0c/4] + state->m_ms32_tx0_scroll[0x14/4]); + tilemap_draw(bitmap,cliprect,state->m_ms32_tx_tilemap[0],0,4); - draw_sprites(screen->machine(),bitmap,cliprect, state->m_ms32_spram, 0x20000, 0); - } - else if (screen == right_screen) - { - bitmap_fill(bitmap,cliprect,0x8000+0); /* bg color */ + draw_sprites(screen.machine(),bitmap,cliprect, state->m_ms32_spram, 0x20000, 0); + + return 0; +} + +static SCREEN_UPDATE(bnstars_right) +{ + bnstars_state *state = screen.machine().driver_data(); + + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); + + bitmap_fill(bitmap,cliprect,0x8000+0); /* bg color */ - tilemap_set_scrollx(state->m_ms32_bg_tilemap[1], 0, state->m_ms32_bg1_scroll[0x00/4] + state->m_ms32_bg1_scroll[0x08/4] + 0x10 ); - tilemap_set_scrolly(state->m_ms32_bg_tilemap[1], 0, state->m_ms32_bg1_scroll[0x0c/4] + state->m_ms32_bg1_scroll[0x14/4] ); - tilemap_draw(bitmap,cliprect,state->m_ms32_bg_tilemap[1],0,1); + tilemap_set_scrollx(state->m_ms32_bg_tilemap[1], 0, state->m_ms32_bg1_scroll[0x00/4] + state->m_ms32_bg1_scroll[0x08/4] + 0x10 ); + tilemap_set_scrolly(state->m_ms32_bg_tilemap[1], 0, state->m_ms32_bg1_scroll[0x0c/4] + state->m_ms32_bg1_scroll[0x14/4] ); + tilemap_draw(bitmap,cliprect,state->m_ms32_bg_tilemap[1],0,1); - draw_roz(screen->machine(),bitmap,cliprect,2,1); + draw_roz(screen.machine(),bitmap,cliprect,2,1); - tilemap_set_scrollx(state->m_ms32_tx_tilemap[1], 0, state->m_ms32_tx1_scroll[0x00/4] + state->m_ms32_tx1_scroll[0x08/4] + 0x18); - tilemap_set_scrolly(state->m_ms32_tx_tilemap[1], 0, state->m_ms32_tx1_scroll[0x0c/4] + state->m_ms32_tx1_scroll[0x14/4]); - tilemap_draw(bitmap,cliprect,state->m_ms32_tx_tilemap[1],0,4); + tilemap_set_scrollx(state->m_ms32_tx_tilemap[1], 0, state->m_ms32_tx1_scroll[0x00/4] + state->m_ms32_tx1_scroll[0x08/4] + 0x18); + tilemap_set_scrolly(state->m_ms32_tx_tilemap[1], 0, state->m_ms32_tx1_scroll[0x0c/4] + state->m_ms32_tx1_scroll[0x14/4]); + tilemap_draw(bitmap,cliprect,state->m_ms32_tx_tilemap[1],0,4); - draw_sprites(screen->machine(),bitmap,cliprect, state->m_ms32_spram+(0x20000/4), 0x20000, 4); - } + draw_sprites(screen.machine(),bitmap,cliprect, state->m_ms32_spram+(0x20000/4), 0x20000, 4); return 0; } @@ -1379,7 +1381,7 @@ static MACHINE_CONFIG_START( bnstars, bnstars_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(40*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE(bnstars) + MCFG_SCREEN_UPDATE(bnstars_left) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -1387,7 +1389,7 @@ static MACHINE_CONFIG_START( bnstars, bnstars_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(40*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE(bnstars) + MCFG_SCREEN_UPDATE(bnstars_right) MCFG_VIDEO_START(bnstars) diff --git a/src/mame/drivers/boxer.c b/src/mame/drivers/boxer.c index 6bf813964cf..775fe70faaa 100644 --- a/src/mame/drivers/boxer.c +++ b/src/mame/drivers/boxer.c @@ -159,7 +159,7 @@ static void draw_boxer( running_machine &machine, bitmap_t* bitmap, const rectan static SCREEN_UPDATE( boxer ) { - boxer_state *state = screen->machine().driver_data(); + boxer_state *state = screen.machine().driver_data(); int i, j; bitmap_fill(bitmap, cliprect, 1); @@ -171,7 +171,7 @@ static SCREEN_UPDATE( boxer ) UINT8 code = state->m_tile_ram[32 * i + j]; drawgfx_transpen(bitmap, cliprect, - screen->machine().gfx[2], + screen.machine().gfx[2], code, 0, code & 0x40, code & 0x40, @@ -180,7 +180,7 @@ static SCREEN_UPDATE( boxer ) } } - draw_boxer(screen->machine(), bitmap, cliprect); + draw_boxer(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/buster.c b/src/mame/drivers/buster.c index 7f464f36b59..d6b461fe3bc 100644 --- a/src/mame/drivers/buster.c +++ b/src/mame/drivers/buster.c @@ -28,8 +28,8 @@ static VIDEO_START(buster) static SCREEN_UPDATE(buster) { - buster_state *state = screen->machine().driver_data(); - const gfx_element *gfx = screen->machine().gfx[0]; + buster_state *state = screen.machine().driver_data(); + const gfx_element *gfx = screen.machine().gfx[0]; int count = 0x0000; int y,x; diff --git a/src/mame/drivers/cabaret.c b/src/mame/drivers/cabaret.c index a4d6a59224c..23db8577f19 100644 --- a/src/mame/drivers/cabaret.c +++ b/src/mame/drivers/cabaret.c @@ -106,8 +106,8 @@ static VIDEO_START(cabaret) static SCREEN_UPDATE(cabaret) { - cabaret_state *state = screen->machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + cabaret_state *state = screen.machine().driver_data(); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); diff --git a/src/mame/drivers/calchase.c b/src/mame/drivers/calchase.c index dabbf7ca8e3..65fcddddf57 100644 --- a/src/mame/drivers/calchase.c +++ b/src/mame/drivers/calchase.c @@ -164,10 +164,10 @@ static VIDEO_START(calchase) /*GRULL-ADDVGA static SCREEN_UPDATE(calchase) { - calchase_state *state = screen->machine().driver_data(); + calchase_state *state = screen.machine().driver_data(); int x,y,count,i; - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); count = (0); @@ -181,8 +181,8 @@ static SCREEN_UPDATE(calchase) color = (state->m_vga_vram[count])>>(32-i) & 0x1; - if((x+i)visible_area().max_x && ((y)+0)visible_area().max_y) - *BITMAP_ADDR32(bitmap, y, x+(32-i)) = screen->machine().pens[color]; + if((x+i)machine().driver_data(); + calorie_state *state = screen.machine().driver_data(); int x; if (state->m_bg_bank & 0x10) @@ -166,7 +166,7 @@ static SCREEN_UPDATE( calorie ) ypos = 0xff - state->m_sprites[x + 2]; xpos = state->m_sprites[x + 3]; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { if (state->m_sprites[x + 1] & 0x10) ypos = 0xff - ypos + 32; @@ -181,12 +181,12 @@ static SCREEN_UPDATE( calorie ) if (state->m_sprites[x + 1] & 0x10) { /* 32x32 sprites */ - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[3], tileno | 0x40, color, flipx, flipy, xpos, ypos - 31, 0); + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[3], tileno | 0x40, color, flipx, flipy, xpos, ypos - 31, 0); } else { /* 16x16 sprites */ - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[2], tileno, color, flipx, flipy, xpos, ypos - 15, 0); + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[2], tileno, color, flipx, flipy, xpos, ypos - 15, 0); } } return 0; diff --git a/src/mame/drivers/cardline.c b/src/mame/drivers/cardline.c index 80fa9258143..be41b83c3c1 100644 --- a/src/mame/drivers/cardline.c +++ b/src/mame/drivers/cardline.c @@ -46,7 +46,7 @@ public: static SCREEN_UPDATE( cardline ) { - cardline_state *state = screen->machine().driver_data(); + cardline_state *state = screen.machine().driver_data(); int x,y; bitmap_fill(bitmap,cliprect,0); for(y=0;y<32;y++) @@ -56,14 +56,14 @@ static SCREEN_UPDATE( cardline ) int index=y*64+x; if(state->m_video&1) { - DRAW_TILE(screen->machine(),0,0); - DRAW_TILE(screen->machine(),0x800,1); + DRAW_TILE(screen.machine(),0,0); + DRAW_TILE(screen.machine(),0x800,1); } if(state->m_video&2) { - DRAW_TILE(screen->machine(),0x1000,0); - DRAW_TILE(screen->machine(),0x1800,1); + DRAW_TILE(screen.machine(),0x1000,0); + DRAW_TILE(screen.machine(),0x1800,1); } } } diff --git a/src/mame/drivers/carrera.c b/src/mame/drivers/carrera.c index 35cdaadfa36..a4a56c2fea0 100644 --- a/src/mame/drivers/carrera.c +++ b/src/mame/drivers/carrera.c @@ -246,7 +246,7 @@ GFXDECODE_END static SCREEN_UPDATE(carrera) { - carrera_state *state = screen->machine().driver_data(); + carrera_state *state = screen.machine().driver_data(); int x,y; int count = 0; @@ -257,7 +257,7 @@ static SCREEN_UPDATE(carrera) { int tile = state->m_tileram[count&0x7ff] | state->m_tileram[(count&0x7ff)+0x800]<<8; - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tile,0,0,0,x*8,y*8); + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],tile,0,0,0,x*8,y*8); count++; } } diff --git a/src/mame/drivers/caswin.c b/src/mame/drivers/caswin.c index afccbc33e40..158b646de96 100644 --- a/src/mame/drivers/caswin.c +++ b/src/mame/drivers/caswin.c @@ -81,7 +81,7 @@ static VIDEO_START(vvillage) static SCREEN_UPDATE(vvillage) { - caswin_state *state = screen->machine().driver_data(); + caswin_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_sc0_tilemap,0,0); return 0; } diff --git a/src/mame/drivers/cb2001.c b/src/mame/drivers/cb2001.c index c6a1686b88e..61cd9a6b2be 100644 --- a/src/mame/drivers/cb2001.c +++ b/src/mame/drivers/cb2001.c @@ -328,9 +328,9 @@ static const rectangle visible3 = { 0*8, (14+48)*8-1, 17*8, (17+7)*8-1 }; static SCREEN_UPDATE(cb2001) { - cb2001_state *state = screen->machine().driver_data(); + cb2001_state *state = screen.machine().driver_data(); int count,x,y; - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); count = 0x0000; @@ -351,7 +351,7 @@ static SCREEN_UPDATE(cb2001) tile += state->m_videobank*0x2000; - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tile,colour,0,0,x*8,y*8); + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],tile,colour,0,0,x*8,y*8); count++; } @@ -412,7 +412,7 @@ static SCREEN_UPDATE(cb2001) tile += 0x1000; } - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],tile,colour,0,0,x*8,y*8,0); + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],tile,colour,0,0,x*8,y*8,0); count++; } } diff --git a/src/mame/drivers/cball.c b/src/mame/drivers/cball.c index 608bb2e175b..71cf680c644 100644 --- a/src/mame/drivers/cball.c +++ b/src/mame/drivers/cball.c @@ -52,13 +52,13 @@ static VIDEO_START( cball ) static SCREEN_UPDATE( cball ) { - cball_state *state = screen->machine().driver_data(); + cball_state *state = screen.machine().driver_data(); /* draw playfield */ tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); /* draw sprite */ - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], state->m_video_ram[0x399] >> 4, 0, 0, 0, diff --git a/src/mame/drivers/cham24.c b/src/mame/drivers/cham24.c index 31638c77f8c..ee59586bf98 100644 --- a/src/mame/drivers/cham24.c +++ b/src/mame/drivers/cham24.c @@ -288,7 +288,7 @@ static VIDEO_START( cham24 ) static SCREEN_UPDATE( cham24 ) { /* render the ppu */ - ppu2c0x_render(screen->machine().device("ppu"), bitmap, 0, 0, 0, 0); + ppu2c0x_render(screen.machine().device("ppu"), bitmap, 0, 0, 0, 0); return 0; } diff --git a/src/mame/drivers/champbas.c b/src/mame/drivers/champbas.c index 3ad2d62ded2..2a8f17febe4 100644 --- a/src/mame/drivers/champbas.c +++ b/src/mame/drivers/champbas.c @@ -97,11 +97,11 @@ TODO: static SCREEN_EOF( champbas ) { - champbas_state *state = machine.driver_data(); + champbas_state *state = screen.machine().driver_data(); state->m_watchdog_count++; if (state->m_watchdog_count == 0x10) - machine.schedule_soft_reset(); + screen.machine().schedule_soft_reset(); } diff --git a/src/mame/drivers/champbwl.c b/src/mame/drivers/champbwl.c index acf23d71568..c740c12a38f 100644 --- a/src/mame/drivers/champbwl.c +++ b/src/mame/drivers/champbwl.c @@ -453,16 +453,16 @@ SCREEN_UPDATE( champbwl ) { bitmap_fill(bitmap, cliprect, 0x1f0); - screen->machine().device("spritegen")->set_fg_yoffsets( -0x12, 0x0e ); - screen->machine().device("spritegen")->set_bg_yoffsets( 0x1, -0x1 ); + screen.machine().device("spritegen")->set_fg_yoffsets( -0x12, 0x0e ); + screen.machine().device("spritegen")->set_bg_yoffsets( 0x1, -0x1 ); - screen->machine().device("spritegen")->seta001_draw_sprites(screen->machine(), bitmap, cliprect, 0x800, 1 ); + screen.machine().device("spritegen")->seta001_draw_sprites(screen.machine(), bitmap, cliprect, 0x800, 1 ); return 0; } SCREEN_EOF( champbwl ) { - machine.device("spritegen")->tnzs_eof(); + screen.machine().device("spritegen")->tnzs_eof(); } @@ -511,16 +511,16 @@ static SCREEN_UPDATE( doraemon ) { bitmap_fill(bitmap, cliprect, 0x1f0); - screen->machine().device("spritegen")->set_bg_yoffsets( 0x00, 0x01 ); - screen->machine().device("spritegen")->set_fg_yoffsets( 0x00, 0x10 ); + screen.machine().device("spritegen")->set_bg_yoffsets( 0x00, 0x01 ); + screen.machine().device("spritegen")->set_fg_yoffsets( 0x00, 0x10 ); - screen->machine().device("spritegen")->seta001_draw_sprites(screen->machine(), bitmap, cliprect, 0x800, 1 ); + screen.machine().device("spritegen")->seta001_draw_sprites(screen.machine(), bitmap, cliprect, 0x800, 1 ); return 0; } static SCREEN_EOF( doraemon ) { - machine.device("spritegen")->setac_eof(); + screen.machine().device("spritegen")->setac_eof(); } static MACHINE_START( doraemon ) diff --git a/src/mame/drivers/chanbara.c b/src/mame/drivers/chanbara.c index 732cbb3e758..a5e259d3f91 100644 --- a/src/mame/drivers/chanbara.c +++ b/src/mame/drivers/chanbara.c @@ -194,11 +194,11 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect static SCREEN_UPDATE( chanbara ) { - chanbara_state *state = screen->machine().driver_data(); + chanbara_state *state = screen.machine().driver_data(); tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_scroll | (state->m_scrollhi << 8)); tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/chinsan.c b/src/mame/drivers/chinsan.c index eb34d53f448..aaac8b5c86c 100644 --- a/src/mame/drivers/chinsan.c +++ b/src/mame/drivers/chinsan.c @@ -86,7 +86,7 @@ static VIDEO_START( chinsan ) static SCREEN_UPDATE( chinsan ) { - chinsan_state *state = screen->machine().driver_data(); + chinsan_state *state = screen.machine().driver_data(); int y, x, count; count = 0; for (y = 0; y < 32; y++) @@ -96,7 +96,7 @@ static SCREEN_UPDATE( chinsan ) int tileno, colour; tileno = state->m_video[count] | (state->m_video[count + 0x800] << 8); colour = state->m_video[count + 0x1000] >> 3; - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tileno,colour,0,0,x*8,y*8); + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],tileno,colour,0,0,x*8,y*8); count++; } } diff --git a/src/mame/drivers/clayshoo.c b/src/mame/drivers/clayshoo.c index 564dcd700c0..1c38906fefa 100644 --- a/src/mame/drivers/clayshoo.c +++ b/src/mame/drivers/clayshoo.c @@ -185,7 +185,7 @@ static MACHINE_START( clayshoo ) static SCREEN_UPDATE( clayshoo ) { - clayshoo_state *state = screen->machine().driver_data(); + clayshoo_state *state = screen.machine().driver_data(); offs_t offs; for (offs = 0; offs < state->m_videoram_size; offs++) diff --git a/src/mame/drivers/cliffhgr.c b/src/mame/drivers/cliffhgr.c index 6a78f035650..3450855d5e5 100644 --- a/src/mame/drivers/cliffhgr.c +++ b/src/mame/drivers/cliffhgr.c @@ -657,7 +657,7 @@ static TMS9928A_INTERFACE(cliffhgr_tms9928a_interface) static SCREEN_UPDATE( cliffhgr ) { - tms9928a_device *tms9928a = screen->machine().device( "tms9928a" ); + tms9928a_device *tms9928a = screen.machine().device( "tms9928a" ); tms9928a->update( bitmap, cliprect ); return 0; diff --git a/src/mame/drivers/cmmb.c b/src/mame/drivers/cmmb.c index 1ab4d0450aa..1a33bbab2b2 100644 --- a/src/mame/drivers/cmmb.c +++ b/src/mame/drivers/cmmb.c @@ -63,9 +63,9 @@ static VIDEO_START( cmmb ) static SCREEN_UPDATE( cmmb ) { - cmmb_state *state = screen->machine().driver_data(); + cmmb_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; - const gfx_element *gfx = screen->machine().gfx[0]; + const gfx_element *gfx = screen.machine().gfx[0]; int count = 0x00000; int y,x; diff --git a/src/mame/drivers/cntsteer.c b/src/mame/drivers/cntsteer.c index 4e15f911c8d..57f1e5490af 100644 --- a/src/mame/drivers/cntsteer.c +++ b/src/mame/drivers/cntsteer.c @@ -255,10 +255,10 @@ static void cntsteer_draw_sprites( running_machine &machine, bitmap_t *bitmap, c static SCREEN_UPDATE( zerotrgt ) { - cntsteer_state *state = screen->machine().driver_data(); + cntsteer_state *state = screen.machine().driver_data(); if (state->m_disable_roz) - bitmap_fill(bitmap, cliprect, screen->machine().pens[8 * state->m_bg_color_bank]); + bitmap_fill(bitmap, cliprect, screen.machine().pens[8 * state->m_bg_color_bank]); else { int p1, p2, p3, p4; @@ -298,7 +298,7 @@ static SCREEN_UPDATE( zerotrgt ) 0, 0); } - zerotrgt_draw_sprites(screen->machine(), bitmap, cliprect); + zerotrgt_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; @@ -306,10 +306,10 @@ static SCREEN_UPDATE( zerotrgt ) static SCREEN_UPDATE( cntsteer ) { - cntsteer_state *state = screen->machine().driver_data(); + cntsteer_state *state = screen.machine().driver_data(); if (state->m_disable_roz) - bitmap_fill(bitmap, cliprect, screen->machine().pens[8 * state->m_bg_color_bank]); + bitmap_fill(bitmap, cliprect, screen.machine().pens[8 * state->m_bg_color_bank]); else { int p1, p2, p3, p4; @@ -347,7 +347,7 @@ static SCREEN_UPDATE( cntsteer ) 0, 0); } - cntsteer_draw_sprites(screen->machine(), bitmap, cliprect); + cntsteer_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; diff --git a/src/mame/drivers/cobra.c b/src/mame/drivers/cobra.c index 6a587d6057c..ee7f8a69c8f 100644 --- a/src/mame/drivers/cobra.c +++ b/src/mame/drivers/cobra.c @@ -141,7 +141,7 @@ VIDEO_START( cobra ) SCREEN_UPDATE( cobra ) { - cobra_state *cobra = screen->machine().driver_data(); + cobra_state *cobra = screen.machine().driver_data(); if (cobra->polybuffer_ptr > 0) { @@ -149,7 +149,7 @@ SCREEN_UPDATE( cobra ) for (i=0; i < cobra->polybuffer_ptr; i++) { - poly_render_triangle(cobra->poly, cobra->framebuffer, &screen->machine().primary_screen->visible_area(), render_texture_scan, 2, + poly_render_triangle(cobra->poly, cobra->framebuffer, &screen.machine().primary_screen->visible_area(), render_texture_scan, 2, &cobra->polybuffer[i].v[0], &cobra->polybuffer[i].v[1], &cobra->polybuffer[i].v[2]); poly_wait(cobra->poly, "Finished render"); } diff --git a/src/mame/drivers/coinmstr.c b/src/mame/drivers/coinmstr.c index 60f611f1c2e..d0de54c6fef 100644 --- a/src/mame/drivers/coinmstr.c +++ b/src/mame/drivers/coinmstr.c @@ -916,7 +916,7 @@ static VIDEO_START( coinmstr ) static SCREEN_UPDATE( coinmstr ) { - coinmstr_state *state = screen->machine().driver_data(); + coinmstr_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/coinmvga.c b/src/mame/drivers/coinmvga.c index c03bd6ea5d6..bc42e9c2db4 100644 --- a/src/mame/drivers/coinmvga.c +++ b/src/mame/drivers/coinmvga.c @@ -242,8 +242,8 @@ static VIDEO_START( coinmvga ) static SCREEN_UPDATE( coinmvga ) { - coinmvga_state *state = screen->machine().driver_data(); - const gfx_element *gfx = screen->machine().gfx[0]; + coinmvga_state *state = screen.machine().driver_data(); + const gfx_element *gfx = screen.machine().gfx[0]; int count = 0x04000/2; int y,x; diff --git a/src/mame/drivers/coolridr.c b/src/mame/drivers/coolridr.c index 99722933ade..57c55460550 100644 --- a/src/mame/drivers/coolridr.c +++ b/src/mame/drivers/coolridr.c @@ -302,35 +302,35 @@ static VIDEO_START(coolridr) static SCREEN_UPDATE(coolridr) { - coolridr_state *state = screen->machine().driver_data(); + coolridr_state *state = screen.machine().driver_data(); /* planes seems to basically be at 0x8000 and 0x28000... */ - const gfx_element *gfx = screen->machine().gfx[2]; + const gfx_element *gfx = screen.machine().gfx[2]; UINT32 count; int y,x; - if(screen->machine().input().code_pressed(KEYCODE_Z)) + if(screen.machine().input().code_pressed(KEYCODE_Z)) state->m_test_offs+=4; - if(screen->machine().input().code_pressed(KEYCODE_X)) + if(screen.machine().input().code_pressed(KEYCODE_X)) state->m_test_offs-=4; - if(screen->machine().input().code_pressed(KEYCODE_C)) + if(screen.machine().input().code_pressed(KEYCODE_C)) state->m_test_offs+=0x40; - if(screen->machine().input().code_pressed(KEYCODE_V)) + if(screen.machine().input().code_pressed(KEYCODE_V)) state->m_test_offs-=0x40; - if(screen->machine().input().code_pressed(KEYCODE_B)) + if(screen.machine().input().code_pressed(KEYCODE_B)) state->m_test_offs+=0x400; - if(screen->machine().input().code_pressed(KEYCODE_N)) + if(screen.machine().input().code_pressed(KEYCODE_N)) state->m_test_offs-=0x400; - if(screen->machine().input().code_pressed_once(KEYCODE_A)) + if(screen.machine().input().code_pressed_once(KEYCODE_A)) state->m_color++; - if(screen->machine().input().code_pressed_once(KEYCODE_S)) + if(screen.machine().input().code_pressed_once(KEYCODE_S)) state->m_color--; if(state->m_test_offs > 0x100000*4) diff --git a/src/mame/drivers/corona.c b/src/mame/drivers/corona.c index 39170caf2f2..411bda79785 100644 --- a/src/mame/drivers/corona.c +++ b/src/mame/drivers/corona.c @@ -449,7 +449,7 @@ static VIDEO_START(winner) static SCREEN_UPDATE(winner) { - corona_state *state = screen->machine().driver_data(); + corona_state *state = screen.machine().driver_data(); int x, y; for (y = 0; y < 256; y++) @@ -461,7 +461,7 @@ static SCREEN_UPDATE(winner) static SCREEN_UPDATE(luckyrlt) { - corona_state *state = screen->machine().driver_data(); + corona_state *state = screen.machine().driver_data(); int x, y; for (y = 0; y < 256; y++) diff --git a/src/mame/drivers/cps3.c b/src/mame/drivers/cps3.c index 163fd8d7624..4a1c7da8b2d 100644 --- a/src/mame/drivers/cps3.c +++ b/src/mame/drivers/cps3.c @@ -959,10 +959,10 @@ static void cps3_draw_tilemapsprite_line(running_machine &machine, int tmnum, in static SCREEN_UPDATE(cps3) { - cps3_state *state = screen->machine().driver_data(); + cps3_state *state = screen.machine().driver_data(); int y,x, count; - attoseconds_t period = screen->frame_period().attoseconds; - rectangle visarea = screen->visible_area(); + attoseconds_t period = screen.frame_period().attoseconds; + rectangle visarea = screen.visible_area(); int bg_drawn[4] = { 0, 0, 0, 0 }; @@ -982,7 +982,7 @@ static SCREEN_UPDATE(cps3) state->m_screenwidth = 496; visarea.min_x = 0; visarea.max_x = 496-1; visarea.min_y = 0; visarea.max_y = 224-1; - screen->configure(496, 224, visarea, period); + screen.configure(496, 224, visarea, period); } } else @@ -992,7 +992,7 @@ static SCREEN_UPDATE(cps3) state->m_screenwidth = 384; visarea.min_x = 0; visarea.max_x = 384-1; visarea.min_y = 0; visarea.max_y = 224-1; - screen->configure(384, 224, visarea, period); + screen.configure(384, 224, visarea, period); } } @@ -1109,7 +1109,7 @@ static SCREEN_UPDATE(cps3) { for (uu=0;uu<1023;uu++) { - cps3_draw_tilemapsprite_line(screen->machine(), tilemapnum, uu, state->m_renderbuffer_bitmap, &state->m_renderbuffer_clip ); + cps3_draw_tilemapsprite_line(screen.machine(), tilemapnum, uu, state->m_renderbuffer_bitmap, &state->m_renderbuffer_clip ); } } bg_drawn[tilemapnum] = 1; @@ -1182,13 +1182,13 @@ static SCREEN_UPDATE(cps3) /* use the bpp value from the main list or the sublists? */ if (whichbpp) { - if (!global_bpp) screen->machine().gfx[1]->color_granularity=256; - else screen->machine().gfx[1]->color_granularity=64; + if (!global_bpp) screen.machine().gfx[1]->color_granularity=256; + else screen.machine().gfx[1]->color_granularity=64; } else { - if (!bpp) screen->machine().gfx[1]->color_granularity=256; - else screen->machine().gfx[1]->color_granularity=64; + if (!bpp) screen.machine().gfx[1]->color_granularity=256; + else screen.machine().gfx[1]->color_granularity=64; } { @@ -1196,11 +1196,11 @@ static SCREEN_UPDATE(cps3) if (global_alpha || alpha) { - cps3_drawgfxzoom(state->m_renderbuffer_bitmap,&state->m_renderbuffer_clip,screen->machine().gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX_BLEND,0,xinc,yinc, NULL, 0); + cps3_drawgfxzoom(state->m_renderbuffer_bitmap,&state->m_renderbuffer_clip,screen.machine().gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX_BLEND,0,xinc,yinc, NULL, 0); } else { - cps3_drawgfxzoom(state->m_renderbuffer_bitmap,&state->m_renderbuffer_clip,screen->machine().gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX,0,xinc,yinc, NULL, 0); + cps3_drawgfxzoom(state->m_renderbuffer_bitmap,&state->m_renderbuffer_clip,screen.machine().gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX,0,xinc,yinc, NULL, 0); } count++; } @@ -1266,7 +1266,7 @@ static SCREEN_UPDATE(cps3) pal += state->m_ss_pal_base << 5; tile+=0x200; - cps3_drawgfxzoom(bitmap, cliprect, screen->machine().gfx[0],tile,pal,flipx,flipy,x*8,y*8,CPS3_TRANSPARENCY_PEN,0,0x10000,0x10000,NULL,0); + cps3_drawgfxzoom(bitmap, cliprect, screen.machine().gfx[0],tile,pal,flipx,flipy,x*8,y*8,CPS3_TRANSPARENCY_PEN,0,0x10000,0x10000,NULL,0); count++; } } diff --git a/src/mame/drivers/crystal.c b/src/mame/drivers/crystal.c index f617a8a8d12..e89ed162f62 100644 --- a/src/mame/drivers/crystal.c +++ b/src/mame/drivers/crystal.c @@ -635,8 +635,8 @@ static void SetVidReg( address_space *space, UINT16 reg, UINT16 val ) static SCREEN_UPDATE( crystal ) { - crystal_state *state = screen->machine().driver_data(); - address_space *space = screen->machine().device("maincpu")->memory().space(AS_PROGRAM); + crystal_state *state = screen.machine().driver_data(); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); int DoFlip; UINT32 B0 = 0x0; @@ -646,7 +646,7 @@ static SCREEN_UPDATE( crystal ) UINT16 *srcline; int y; UINT16 head, tail; - UINT32 width = screen->width(); + UINT32 width = screen.width(); if (GetVidReg(space, 0x8e) & 1) { @@ -696,8 +696,8 @@ static SCREEN_UPDATE( crystal ) static SCREEN_EOF(crystal) { - crystal_state *state = machine.driver_data(); - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + crystal_state *state = screen.machine().driver_data(); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); UINT16 head, tail; int DoFlip = 0; diff --git a/src/mame/drivers/cshooter.c b/src/mame/drivers/cshooter.c index 1cbd34a547f..fded0916034 100644 --- a/src/mame/drivers/cshooter.c +++ b/src/mame/drivers/cshooter.c @@ -137,8 +137,8 @@ static VIDEO_START(cshooter) static SCREEN_UPDATE(cshooter) { - cshooter_state *state = screen->machine().driver_data(); - bitmap_fill(bitmap, cliprect, 0/*get_black_pen(screen->screen->machine())*/); + cshooter_state *state = screen.machine().driver_data(); + bitmap_fill(bitmap, cliprect, 0/*get_black_pen(screen.screen.machine())*/); tilemap_mark_all_tiles_dirty(state->m_txtilemap); //sprites @@ -151,25 +151,25 @@ static SCREEN_UPDATE(cshooter) { int tile=0x30+((spriteram[i]>>2)&0x1f); - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], tile, spriteram[i+1], 0, 0, spriteram[i+3],spriteram[i+2],3); - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], tile, spriteram[i+1], 0, 0, spriteram[i+3]+8,spriteram[i+2],3); - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], tile, spriteram[i+1], 0, 0, spriteram[i+3]+8,spriteram[i+2]+8,3); - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], tile, spriteram[i+1], 0, 0, diff --git a/src/mame/drivers/csplayh5.c b/src/mame/drivers/csplayh5.c index 877aabac070..b38582fa32e 100644 --- a/src/mame/drivers/csplayh5.c +++ b/src/mame/drivers/csplayh5.c @@ -69,8 +69,8 @@ static VIDEO_START( csplayh5 ) static SCREEN_UPDATE( csplayh5 ) { - csplayh5_state *state = screen->machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + csplayh5_state *state = screen.machine().driver_data(); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); copybitmap(bitmap, state->m_vdp0_bitmap, 0, 0, 0, 0, cliprect); diff --git a/src/mame/drivers/cubeqst.c b/src/mame/drivers/cubeqst.c index 6289bb211d0..a1a8b69f803 100644 --- a/src/mame/drivers/cubeqst.c +++ b/src/mame/drivers/cubeqst.c @@ -97,7 +97,7 @@ static WRITE16_HANDLER( palette_w ) /* TODO: This is a simplified version of what actually happens */ static SCREEN_UPDATE( cubeqst ) { - cubeqst_state *state = screen->machine().driver_data(); + cubeqst_state *state = screen.machine().driver_data(); int y; /* @@ -112,8 +112,8 @@ static SCREEN_UPDATE( cubeqst ) for (y = cliprect->min_y; y <= cliprect->max_y; ++y) { int i; - int num_entries = cubeqcpu_get_ptr_ram_val(screen->machine().device("line_cpu"), y); - UINT32 *stk_ram = cubeqcpu_get_stack_ram(screen->machine().device("line_cpu")); + int num_entries = cubeqcpu_get_ptr_ram_val(screen.machine().device("line_cpu"), y); + UINT32 *stk_ram = cubeqcpu_get_stack_ram(screen.machine().device("line_cpu")); UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0); UINT32 pen; @@ -155,7 +155,7 @@ static SCREEN_UPDATE( cubeqst ) } /* Draw the span, testing for depth */ - pen = state->m_colormap[screen->machine().generic.paletteram.u16[color]]; + pen = state->m_colormap[screen.machine().generic.paletteram.u16[color]]; for (x = h1; x <= h2; ++x) { if (!(state->m_depth_buffer[x] < depth)) diff --git a/src/mame/drivers/cultures.c b/src/mame/drivers/cultures.c index df75815c746..fbcd8715ae0 100644 --- a/src/mame/drivers/cultures.c +++ b/src/mame/drivers/cultures.c @@ -87,7 +87,7 @@ static VIDEO_START( cultures ) static SCREEN_UPDATE( cultures ) { - cultures_state *state = screen->machine().driver_data(); + cultures_state *state = screen.machine().driver_data(); int attr; // tilemaps attributes diff --git a/src/mame/drivers/cyberbal.c b/src/mame/drivers/cyberbal.c index 30983d96caa..c533621ef44 100644 --- a/src/mame/drivers/cyberbal.c +++ b/src/mame/drivers/cyberbal.c @@ -464,14 +464,14 @@ static MACHINE_CONFIG_START( cyberbal, cyberbal_state ) /* note: these parameters are from published specs, not derived */ /* the board uses an SOS-2 chip to generate video signals */ MCFG_SCREEN_RAW_PARAMS(ATARI_CLOCK_14MHz, 456*2, 0, 336*2, 262, 0, 240) - MCFG_SCREEN_UPDATE(cyberbal) + MCFG_SCREEN_UPDATE(cyberbal_left) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) /* note: these parameters are from published specs, not derived */ /* the board uses an SOS-2 chip to generate video signals */ MCFG_SCREEN_RAW_PARAMS(ATARI_CLOCK_14MHz, 456*2, 0, 336*2, 262, 0, 240) - MCFG_SCREEN_UPDATE(cyberbal) + MCFG_SCREEN_UPDATE(cyberbal_right) MCFG_VIDEO_START(cyberbal) @@ -512,7 +512,7 @@ static MACHINE_CONFIG_START( cyberbal2p, cyberbal_state ) /* note: these parameters are from published specs, not derived */ /* the board uses an SOS-2 chip to generate video signals */ MCFG_SCREEN_RAW_PARAMS(ATARI_CLOCK_14MHz, 456*2, 0, 336*2, 262, 0, 240) - MCFG_SCREEN_UPDATE(cyberbal) + MCFG_SCREEN_UPDATE(cyberbal2p) MCFG_VIDEO_START(cyberbal2p) diff --git a/src/mame/drivers/cybertnk.c b/src/mame/drivers/cybertnk.c index 383e48885b8..8de258ad9c0 100644 --- a/src/mame/drivers/cybertnk.c +++ b/src/mame/drivers/cybertnk.c @@ -216,31 +216,18 @@ static void draw_pixel( bitmap_t* bitmap, const rectangle *cliprect, int y, int *BITMAP_ADDR16(bitmap, y, x) = pen; } -static SCREEN_UPDATE( cybertnk ) +static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int screen_shift) { - cybertnk_state *state = screen->machine().driver_data(); - device_t *left_screen = screen->machine().device("lscreen"); - device_t *right_screen = screen->machine().device("rscreen"); - int screen_shift = 0; - - if (screen==left_screen) - { - screen_shift = 0; - - } - else if (screen==right_screen) - { - screen_shift = -256; - } + cybertnk_state *state = screen.machine().driver_data(); tilemap_set_scrolldx(state->m_tx_tilemap, screen_shift, screen_shift); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); { int i; - const gfx_element *gfx = screen->machine().gfx[3]; + const gfx_element *gfx = screen.machine().gfx[3]; for (i=0;i<0x1000/4;i+=4) @@ -258,7 +245,7 @@ static SCREEN_UPDATE( cybertnk ) { int count,x,y; - const gfx_element *gfx = screen->machine().gfx[2]; + const gfx_element *gfx = screen.machine().gfx[2]; count = 0; @@ -279,7 +266,7 @@ static SCREEN_UPDATE( cybertnk ) { int count,x,y; - const gfx_element *gfx = screen->machine().gfx[1]; + const gfx_element *gfx = screen.machine().gfx[1]; count = 0; @@ -301,7 +288,7 @@ static SCREEN_UPDATE( cybertnk ) /* non-tile based spriteram (BARE-BONES, looks pretty complex) */ if(1) { - const UINT8 *blit_ram = screen->machine().region("spr_gfx")->base(); + const UINT8 *blit_ram = screen.machine().region("spr_gfx")->base(); int offs,x,y,z,xsize,ysize,yi,xi,col_bank,fx,zoom; UINT32 spr_offs,spr_offs_helper; int xf,yf,xz,yz; @@ -354,11 +341,11 @@ static SCREEN_UPDATE( cybertnk ) dot|= col_bank<<4; if(fx) { - draw_pixel(bitmap, cliprect, y+yz, x+xsize-(xz)+screen_shift, screen->machine().pens[dot]); + draw_pixel(bitmap, cliprect, y+yz, x+xsize-(xz)+screen_shift, screen.machine().pens[dot]); } else { - draw_pixel(bitmap, cliprect, y+yz, x+xz+screen_shift, screen->machine().pens[dot]); + draw_pixel(bitmap, cliprect, y+yz, x+xz+screen_shift, screen.machine().pens[dot]); } } xf+=zoom; @@ -386,11 +373,11 @@ static SCREEN_UPDATE( cybertnk ) dot|= col_bank<<4; if(fx) { - draw_pixel(bitmap, cliprect, y+yz, x+xsize-(xz)+screen_shift, screen->machine().pens[dot]); + draw_pixel(bitmap, cliprect, y+yz, x+xsize-(xz)+screen_shift, screen.machine().pens[dot]); } else { - draw_pixel(bitmap, cliprect, y+yz, x+xz+screen_shift, screen->machine().pens[dot]); + draw_pixel(bitmap, cliprect, y+yz, x+xz+screen_shift, screen.machine().pens[dot]); } } xf+=zoom; @@ -428,52 +415,52 @@ static SCREEN_UPDATE( cybertnk ) //0x62 0x9a 1c2d0 //0x62 0x9a 1e1e4 //0x20 0x9c 2011c - if (screen==left_screen) + if (screen_shift == 0) { if(0) //sprite gfx debug viewer { int x,y,count; - const UINT8 *blit_ram = screen->machine().region("spr_gfx")->base(); + const UINT8 *blit_ram = screen.machine().region("spr_gfx")->base(); - if(screen->machine().input().code_pressed(KEYCODE_Z)) + if(screen.machine().input().code_pressed(KEYCODE_Z)) state->m_test_x++; - if(screen->machine().input().code_pressed(KEYCODE_X)) + if(screen.machine().input().code_pressed(KEYCODE_X)) state->m_test_x--; - if(screen->machine().input().code_pressed(KEYCODE_A)) + if(screen.machine().input().code_pressed(KEYCODE_A)) state->m_test_y++; - if(screen->machine().input().code_pressed(KEYCODE_S)) + if(screen.machine().input().code_pressed(KEYCODE_S)) state->m_test_y--; - if(screen->machine().input().code_pressed(KEYCODE_Q)) + if(screen.machine().input().code_pressed(KEYCODE_Q)) state->m_start_offs+=0x200; - if(screen->machine().input().code_pressed(KEYCODE_W)) + if(screen.machine().input().code_pressed(KEYCODE_W)) state->m_start_offs-=0x200; - if(screen->machine().input().code_pressed_once(KEYCODE_T)) + if(screen.machine().input().code_pressed_once(KEYCODE_T)) state->m_start_offs+=0x20000; - if(screen->machine().input().code_pressed_once(KEYCODE_Y)) + if(screen.machine().input().code_pressed_once(KEYCODE_Y)) state->m_start_offs-=0x20000; - if(screen->machine().input().code_pressed(KEYCODE_E)) + if(screen.machine().input().code_pressed(KEYCODE_E)) state->m_start_offs+=4; - if(screen->machine().input().code_pressed(KEYCODE_R)) + if(screen.machine().input().code_pressed(KEYCODE_R)) state->m_start_offs-=4; - if(screen->machine().input().code_pressed(KEYCODE_D)) + if(screen.machine().input().code_pressed(KEYCODE_D)) state->m_color_pen++; - if(screen->machine().input().code_pressed(KEYCODE_F)) + if(screen.machine().input().code_pressed(KEYCODE_F)) state->m_color_pen--; popmessage("%02x %02x %04x %02x",state->m_test_x,state->m_test_y,state->m_start_offs,state->m_color_pen); - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); count = (state->m_start_offs); @@ -490,28 +477,28 @@ static SCREEN_UPDATE( cybertnk ) color|= ((blit_ram[count+3] & 0xff) << 0); dot = (color & 0xf0000000) >> 28; - *BITMAP_ADDR16(bitmap, y, x+0) = screen->machine().pens[dot+(state->m_color_pen<<4)]; + *BITMAP_ADDR16(bitmap, y, x+0) = screen.machine().pens[dot+(state->m_color_pen<<4)]; dot = (color & 0x0f000000) >> 24; - *BITMAP_ADDR16(bitmap, y, x+4) = screen->machine().pens[dot+(state->m_color_pen<<4)]; + *BITMAP_ADDR16(bitmap, y, x+4) = screen.machine().pens[dot+(state->m_color_pen<<4)]; dot = (color & 0x00f00000) >> 20; - *BITMAP_ADDR16(bitmap, y, x+1) = screen->machine().pens[dot+(state->m_color_pen<<4)]; + *BITMAP_ADDR16(bitmap, y, x+1) = screen.machine().pens[dot+(state->m_color_pen<<4)]; dot = (color & 0x000f0000) >> 16; - *BITMAP_ADDR16(bitmap, y, x+5) = screen->machine().pens[dot+(state->m_color_pen<<4)]; + *BITMAP_ADDR16(bitmap, y, x+5) = screen.machine().pens[dot+(state->m_color_pen<<4)]; dot = (color & 0x0000f000) >> 12; - *BITMAP_ADDR16(bitmap, y, x+2) = screen->machine().pens[dot+(state->m_color_pen<<4)]; + *BITMAP_ADDR16(bitmap, y, x+2) = screen.machine().pens[dot+(state->m_color_pen<<4)]; dot = (color & 0x00000f00) >> 8; - *BITMAP_ADDR16(bitmap, y, x+6) = screen->machine().pens[dot+(state->m_color_pen<<4)]; + *BITMAP_ADDR16(bitmap, y, x+6) = screen.machine().pens[dot+(state->m_color_pen<<4)]; dot = (color & 0x000000f0) >> 4; - *BITMAP_ADDR16(bitmap, y, x+3) = screen->machine().pens[dot+(state->m_color_pen<<4)]; + *BITMAP_ADDR16(bitmap, y, x+3) = screen.machine().pens[dot+(state->m_color_pen<<4)]; dot = (color & 0x0000000f) >> 0; - *BITMAP_ADDR16(bitmap, y, x+7) = screen->machine().pens[dot+(state->m_color_pen<<4)]; + *BITMAP_ADDR16(bitmap, y, x+7) = screen.machine().pens[dot+(state->m_color_pen<<4)]; count+=4; } @@ -523,6 +510,9 @@ static SCREEN_UPDATE( cybertnk ) return 0; } +static SCREEN_UPDATE( cybertnk_left ) { return update_screen(screen, bitmap, cliprect, 0); } +static SCREEN_UPDATE( cybertnk_right ) { return update_screen(screen, bitmap, cliprect, -256); } + static WRITE16_HANDLER( tx_vram_w ) { @@ -890,7 +880,7 @@ static MACHINE_CONFIG_START( cybertnk, cybertnk_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE(cybertnk) + MCFG_SCREEN_UPDATE(cybertnk_left) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -898,7 +888,7 @@ static MACHINE_CONFIG_START( cybertnk, cybertnk_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE(cybertnk) + MCFG_SCREEN_UPDATE(cybertnk_right) MCFG_GFXDECODE(cybertnk) MCFG_PALETTE_LENGTH(0x4000) diff --git a/src/mame/drivers/cyclemb.c b/src/mame/drivers/cyclemb.c index f181dd3d574..80bf985aff8 100644 --- a/src/mame/drivers/cyclemb.c +++ b/src/mame/drivers/cyclemb.c @@ -123,10 +123,10 @@ static VIDEO_START( cyclemb ) static SCREEN_UPDATE( cyclemb ) { - cyclemb_state *state = screen->machine().driver_data(); + cyclemb_state *state = screen.machine().driver_data(); int x,y,count; - const gfx_element *gfx = screen->machine().gfx[0]; - UINT8 flip_screen = flip_screen_get(screen->machine()); + const gfx_element *gfx = screen.machine().gfx[0]; + UINT8 flip_screen = flip_screen_get(screen.machine()); count = 0; @@ -208,7 +208,7 @@ static SCREEN_UPDATE( cyclemb ) fx = !fx; fy = !fy; } - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[region],spr_offs,col,fx,fy,x,y,0); + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[region],spr_offs,col,fx,fy,x,y,0); } } diff --git a/src/mame/drivers/d9final.c b/src/mame/drivers/d9final.c index 0db84abc201..a725836e995 100644 --- a/src/mame/drivers/d9final.c +++ b/src/mame/drivers/d9final.c @@ -59,7 +59,7 @@ static VIDEO_START(d9final) static SCREEN_UPDATE(d9final) { - d9final_state *state = screen->machine().driver_data(); + d9final_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_sc0_tilemap,0,0); return 0; } diff --git a/src/mame/drivers/dacholer.c b/src/mame/drivers/dacholer.c index 25051d6e34e..fbfcea1c2a0 100644 --- a/src/mame/drivers/dacholer.c +++ b/src/mame/drivers/dacholer.c @@ -138,9 +138,9 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect static SCREEN_UPDATE(dacholer) { - dacholer_state *state = screen->machine().driver_data(); + dacholer_state *state = screen.machine().driver_data(); - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { tilemap_set_scrollx(state->m_bg_tilemap, 0, 256 - state->m_scroll_x); tilemap_set_scrolly(state->m_bg_tilemap, 0, 256 - state->m_scroll_y); @@ -152,7 +152,7 @@ static SCREEN_UPDATE(dacholer) } tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/dai3wksi.c b/src/mame/drivers/dai3wksi.c index 0725fafc407..5ac7e5590bd 100644 --- a/src/mame/drivers/dai3wksi.c +++ b/src/mame/drivers/dai3wksi.c @@ -125,7 +125,7 @@ static void dai3wksi_get_pens(pen_t *pens) static SCREEN_UPDATE( dai3wksi ) { - dai3wksi_state *state = screen->machine().driver_data(); + dai3wksi_state *state = screen.machine().driver_data(); offs_t offs; pen_t pens[8]; @@ -147,7 +147,7 @@ static SCREEN_UPDATE( dai3wksi ) } else { - if (input_port_read(screen->machine(), "IN2") & 0x03) + if (input_port_read(screen.machine(), "IN2") & 0x03) color = vr_prom2[value]; else color = vr_prom1[value]; diff --git a/src/mame/drivers/darius.c b/src/mame/drivers/darius.c index 1a2b9b892ef..805012c6ef7 100644 --- a/src/mame/drivers/darius.c +++ b/src/mame/drivers/darius.c @@ -964,7 +964,7 @@ static MACHINE_CONFIG_START( darius, darius_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(36*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 1*8, 29*8-1) - MCFG_SCREEN_UPDATE(darius) + MCFG_SCREEN_UPDATE(darius_left) MCFG_SCREEN_ADD("mscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -972,7 +972,7 @@ static MACHINE_CONFIG_START( darius, darius_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(36*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 1*8, 29*8-1) - MCFG_SCREEN_UPDATE(darius) + MCFG_SCREEN_UPDATE(darius_middle) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -980,7 +980,7 @@ static MACHINE_CONFIG_START( darius, darius_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(36*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 1*8, 29*8-1) - MCFG_SCREEN_UPDATE(darius) + MCFG_SCREEN_UPDATE(darius_right) MCFG_VIDEO_START(darius) diff --git a/src/mame/drivers/darkhors.c b/src/mame/drivers/darkhors.c index b33777d1232..d4c81abc8a8 100644 --- a/src/mame/drivers/darkhors.c +++ b/src/mame/drivers/darkhors.c @@ -181,21 +181,21 @@ static VIDEO_START( darkhors ) static SCREEN_UPDATE( darkhors ) { - darkhors_state *state = screen->machine().driver_data(); + darkhors_state *state = screen.machine().driver_data(); int layers_ctrl = -1; #if DARKHORS_DEBUG - if (screen->machine().input().code_pressed(KEYCODE_Z)) + if (screen.machine().input().code_pressed(KEYCODE_Z)) { int mask = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) mask |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) mask |= 2; - if (screen->machine().input().code_pressed(KEYCODE_A)) mask |= 4; + if (screen.machine().input().code_pressed(KEYCODE_Q)) mask |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) mask |= 2; + if (screen.machine().input().code_pressed(KEYCODE_A)) mask |= 4; if (mask != 0) layers_ctrl &= mask; } #endif - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); tilemap_set_scrollx(state->m_tmap,0, (state->m_tmapscroll[0] >> 16) - 5); tilemap_set_scrolly(state->m_tmap,0, (state->m_tmapscroll[0] & 0xffff) - 0xff ); @@ -205,7 +205,7 @@ static SCREEN_UPDATE( darkhors ) tilemap_set_scrolly(state->m_tmap2,0, (state->m_tmapscroll2[0] & 0xffff) - 0xff ); if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect, state->m_tmap2, 0, 0); - if (layers_ctrl & 4) draw_sprites(screen->machine(),bitmap,cliprect); + if (layers_ctrl & 4) draw_sprites(screen.machine(),bitmap,cliprect); #if DARKHORS_DEBUG #if 0 diff --git a/src/mame/drivers/dblewing.c b/src/mame/drivers/dblewing.c index 6af5dbc2eec..d1a59b3c88e 100644 --- a/src/mame/drivers/dblewing.c +++ b/src/mame/drivers/dblewing.c @@ -95,18 +95,18 @@ UINT16 dblwings_pri_callback(UINT16 x) static SCREEN_UPDATE(dblewing) { - dblewing_state *state = screen->machine().driver_data(); + dblewing_state *state = screen.machine().driver_data(); UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); - flip_screen_set(screen->machine(), BIT(flip, 7)); + flip_screen_set(screen.machine(), BIT(flip, 7)); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); bitmap_fill(bitmap, cliprect, 0); /* not Confirmed */ - bitmap_fill(screen->machine().priority_bitmap, NULL, 0); + bitmap_fill(screen.machine().priority_bitmap, NULL, 0); deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 4); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram, 0x400); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0x400); return 0; } diff --git a/src/mame/drivers/ddayjlc.c b/src/mame/drivers/ddayjlc.c index 27e76c3e44d..ba65d2d4479 100644 --- a/src/mame/drivers/ddayjlc.c +++ b/src/mame/drivers/ddayjlc.c @@ -382,7 +382,7 @@ static VIDEO_START( ddayjlc ) static SCREEN_UPDATE( ddayjlc ) { - ddayjlc_state *state = screen->machine().driver_data(); + ddayjlc_state *state = screen.machine().driver_data(); UINT32 i; tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); @@ -398,7 +398,7 @@ static SCREEN_UPDATE( ddayjlc ) code = (code & 0x7f) | ((flags & 0x30) << 3); - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], code, color, xflip, yflip, x, y, 0); + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], code, color, xflip, yflip, x, y, 0); } { @@ -409,9 +409,9 @@ static SCREEN_UPDATE( ddayjlc ) { c = state->m_videoram[y * 32 + x]; if (x > 1 && x < 30) - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], c + state->m_char_bank * 0x100, 2, 0, 0, x*8, y*8, 0); + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], c + state->m_char_bank * 0x100, 2, 0, 0, x*8, y*8, 0); else - drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[1], c + state->m_char_bank * 0x100, 2, 0, 0, x*8, y*8); + drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[1], c + state->m_char_bank * 0x100, 2, 0, 0, x*8, y*8); } } return 0; diff --git a/src/mame/drivers/ddealer.c b/src/mame/drivers/ddealer.c index 3e81e0225a3..c28d188ab59 100644 --- a/src/mame/drivers/ddealer.c +++ b/src/mame/drivers/ddealer.c @@ -251,7 +251,7 @@ static void ddealer_draw_video_layer( running_machine &machine, UINT16* vreg_bas static SCREEN_UPDATE( ddealer ) { - ddealer_state *state = screen->machine().driver_data(); + ddealer_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_back_tilemap, 0, state->m_flipscreen ? -192 : -64); tilemap_set_flip(state->m_back_tilemap, state->m_flipscreen ? TILEMAP_FLIPY | TILEMAP_FLIPX : 0); tilemap_draw(bitmap, cliprect, state->m_back_tilemap, 0, 0); @@ -266,24 +266,24 @@ static SCREEN_UPDATE( ddealer ) { if (state->m_vregs[0xcc / 2] & 0x80) { - ddealer_draw_video_layer(screen->machine(), &state->m_vregs[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); - ddealer_draw_video_layer(screen->machine(), &state->m_vregs[0xcc / 2], state->m_right_fg_vram_top, state->m_right_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); + ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); + ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0xcc / 2], state->m_right_fg_vram_top, state->m_right_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); } else { - ddealer_draw_video_layer(screen->machine(), &state->m_vregs[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); + ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); } } else { if (state->m_vregs[0xcc / 2] & 0x80) { - ddealer_draw_video_layer(screen->machine(), &state->m_vregs[0xcc / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); - ddealer_draw_video_layer(screen->machine(), &state->m_vregs[0x1e0 / 2], state->m_right_fg_vram_top, state->m_right_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); + ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0xcc / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); + ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0x1e0 / 2], state->m_right_fg_vram_top, state->m_right_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); } else { - ddealer_draw_video_layer(screen->machine(), &state->m_vregs[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); + ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); } } diff --git a/src/mame/drivers/ddenlovr.c b/src/mame/drivers/ddenlovr.c index 3b8425fe46b..abb77552aba 100644 --- a/src/mame/drivers/ddenlovr.c +++ b/src/mame/drivers/ddenlovr.c @@ -1303,7 +1303,7 @@ static void copylayer(running_machine &machine, bitmap_t *bitmap, const rectangl SCREEN_UPDATE(ddenlovr) { - dynax_state *state = screen->machine().driver_data(); + dynax_state *state = screen.machine().driver_data(); static const int order[24][4] = { @@ -1320,7 +1320,7 @@ SCREEN_UPDATE(ddenlovr) #if 0 static int base = 0x0; - const UINT8 *gfx = screen->machine().region("blitter")->base(); + const UINT8 *gfx = screen.machine().region("blitter")->base(); int next; memset(state->m_ddenlovr_pixmap[0], 0, 512 * 512); memset(state->m_ddenlovr_pixmap[1], 0, 512 * 512); @@ -1331,38 +1331,38 @@ SCREEN_UPDATE(ddenlovr) state->m_ddenlovr_blit_pen_mode = 0; state->m_ddenlovr_blit_y = 5; state->m_ddenlovr_clip_ctrl = 0x0f; - next = blit_draw(screen->machine(), base, 0); + next = blit_draw(screen.machine(), base, 0); popmessage("GFX %06x", base); - if (screen->machine().input().code_pressed(KEYCODE_S)) base = next; - if (screen->machine().input().code_pressed_once(KEYCODE_X)) base = next; - if (screen->machine().input().code_pressed(KEYCODE_C)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; } - if (screen->machine().input().code_pressed(KEYCODE_V)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; } - if (screen->machine().input().code_pressed_once(KEYCODE_D)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; } - if (screen->machine().input().code_pressed_once(KEYCODE_F)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; } + if (screen.machine().input().code_pressed(KEYCODE_S)) base = next; + if (screen.machine().input().code_pressed_once(KEYCODE_X)) base = next; + if (screen.machine().input().code_pressed(KEYCODE_C)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; } + if (screen.machine().input().code_pressed(KEYCODE_V)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; } + if (screen.machine().input().code_pressed_once(KEYCODE_D)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; } + if (screen.machine().input().code_pressed_once(KEYCODE_F)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; } #endif bitmap_fill(bitmap, cliprect, state->m_ddenlovr_bgcolor); #ifdef MAME_DEBUG - if (screen->machine().input().code_pressed(KEYCODE_Z)) + if (screen.machine().input().code_pressed(KEYCODE_Z)) { int mask, mask2; mask = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) mask |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) mask |= 2; - if (screen->machine().input().code_pressed(KEYCODE_E)) mask |= 4; - if (screen->machine().input().code_pressed(KEYCODE_R)) mask |= 8; + if (screen.machine().input().code_pressed(KEYCODE_Q)) mask |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) mask |= 2; + if (screen.machine().input().code_pressed(KEYCODE_E)) mask |= 4; + if (screen.machine().input().code_pressed(KEYCODE_R)) mask |= 8; mask2 = 0; if (state->m_extra_layers) { - if (screen->machine().input().code_pressed(KEYCODE_A)) mask2 |= 1; - if (screen->machine().input().code_pressed(KEYCODE_S)) mask2 |= 2; - if (screen->machine().input().code_pressed(KEYCODE_D)) mask2 |= 4; - if (screen->machine().input().code_pressed(KEYCODE_F)) mask2 |= 8; + if (screen.machine().input().code_pressed(KEYCODE_A)) mask2 |= 1; + if (screen.machine().input().code_pressed(KEYCODE_S)) mask2 |= 2; + if (screen.machine().input().code_pressed(KEYCODE_D)) mask2 |= 4; + if (screen.machine().input().code_pressed(KEYCODE_F)) mask2 |= 8; } if (mask || mask2) @@ -1381,10 +1381,10 @@ SCREEN_UPDATE(ddenlovr) pri = 0; } - copylayer(screen->machine(), bitmap, cliprect, order[pri][0]); - copylayer(screen->machine(), bitmap, cliprect, order[pri][1]); - copylayer(screen->machine(), bitmap, cliprect, order[pri][2]); - copylayer(screen->machine(), bitmap, cliprect, order[pri][3]); + copylayer(screen.machine(), bitmap, cliprect, order[pri][0]); + copylayer(screen.machine(), bitmap, cliprect, order[pri][1]); + copylayer(screen.machine(), bitmap, cliprect, order[pri][2]); + copylayer(screen.machine(), bitmap, cliprect, order[pri][3]); if (state->m_extra_layers) { @@ -1396,10 +1396,10 @@ SCREEN_UPDATE(ddenlovr) pri = 0; } - copylayer(screen->machine(), bitmap, cliprect, order[pri][0] + 4); - copylayer(screen->machine(), bitmap, cliprect, order[pri][1] + 4); - copylayer(screen->machine(), bitmap, cliprect, order[pri][2] + 4); - copylayer(screen->machine(), bitmap, cliprect, order[pri][3] + 4); + copylayer(screen.machine(), bitmap, cliprect, order[pri][0] + 4); + copylayer(screen.machine(), bitmap, cliprect, order[pri][1] + 4); + copylayer(screen.machine(), bitmap, cliprect, order[pri][2] + 4); + copylayer(screen.machine(), bitmap, cliprect, order[pri][3] + 4); } state->m_ddenlovr_layer_enable = enab; diff --git a/src/mame/drivers/dec8.c b/src/mame/drivers/dec8.c index 34107e51c98..8c074631cad 100644 --- a/src/mame/drivers/dec8.c +++ b/src/mame/drivers/dec8.c @@ -67,7 +67,7 @@ static WRITE8_HANDLER( dec8_mxc06_karn_buffer_spriteram_w) /* Only used by ghostb, gondo, garyoret, other games can control buffering */ static SCREEN_EOF( dec8 ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); dec8_mxc06_karn_buffer_spriteram_w(space, 0, 0); } diff --git a/src/mame/drivers/deco156.c b/src/mame/drivers/deco156.c index fee4c5ea120..55d0c5f37ad 100644 --- a/src/mame/drivers/deco156.c +++ b/src/mame/drivers/deco156.c @@ -59,17 +59,17 @@ static VIDEO_START( wcvol95 ) static SCREEN_UPDATE( wcvol95 ) { //FIXME: flip_screen_x should not be written! - flip_screen_set_no_update(screen->machine(), 1); + flip_screen_set_no_update(screen.machine(), 1); - deco156_state *state = screen->machine().driver_data(); + deco156_state *state = screen.machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap, NULL, 0); + bitmap_fill(screen.machine().priority_bitmap, NULL, 0); bitmap_fill(bitmap, NULL, 0); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram, 0x800); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0x800); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; } diff --git a/src/mame/drivers/deco_ld.c b/src/mame/drivers/deco_ld.c index b9caf2d412b..347905b9cc8 100644 --- a/src/mame/drivers/deco_ld.c +++ b/src/mame/drivers/deco_ld.c @@ -124,9 +124,9 @@ public: static SCREEN_UPDATE( rblaster ) { - deco_ld_state *state = screen->machine().driver_data(); + deco_ld_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; - const gfx_element *gfx = screen->machine().gfx[0]; + const gfx_element *gfx = screen.machine().gfx[0]; int count = 0x0000; int y,x; diff --git a/src/mame/drivers/deshoros.c b/src/mame/drivers/deshoros.c index c9fb4eee0a6..2ee9db19111 100644 --- a/src/mame/drivers/deshoros.c +++ b/src/mame/drivers/deshoros.c @@ -41,7 +41,7 @@ static VIDEO_START( deshoros ) static SCREEN_UPDATE( deshoros ) { - deshoros_state *state = screen->machine().driver_data(); + deshoros_state *state = screen.machine().driver_data(); popmessage("%s",state->m_led_array); return 0; } diff --git a/src/mame/drivers/destroyr.c b/src/mame/drivers/destroyr.c index cf0eda53682..26a2b7f7625 100644 --- a/src/mame/drivers/destroyr.c +++ b/src/mame/drivers/destroyr.c @@ -44,7 +44,7 @@ public: static SCREEN_UPDATE( destroyr ) { - destroyr_state *state = screen->machine().driver_data(); + destroyr_state *state = screen.machine().driver_data(); int i, j; bitmap_fill(bitmap, cliprect, 0); @@ -70,7 +70,7 @@ static SCREEN_UPDATE( destroyr ) continue; } - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[2], num, 0, flipx, 0, horz, 16 * i, 0); + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[2], num, 0, flipx, 0, horz, 16 * i, 0); } /* draw alpha numerics */ @@ -80,7 +80,7 @@ static SCREEN_UPDATE( destroyr ) { int num = state->m_alpha_num_ram[32 * i + j]; - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], num, 0, 0, 0, 8 * j, 8 * i, 0); + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], num, 0, 0, 0, 8 * j, 8 * i, 0); } } @@ -91,13 +91,13 @@ static SCREEN_UPDATE( destroyr ) int horz = 256 - state->m_minor_obj_ram[i + 2]; int vert = 256 - state->m_minor_obj_ram[i + 4]; - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], num, 0, 0, 0, horz, vert, 0); + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], num, 0, 0, 0, horz, vert, 0); } /* draw waves */ for (i = 0; i < 4; i++) { - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[3], state->m_wavemod ? 1 : 0, 0, 0, 0, 64 * i, 0x4e, 0); + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[3], state->m_wavemod ? 1 : 0, 0, 0, 0, 64 * i, 0x4e, 0); } /* draw cursor */ diff --git a/src/mame/drivers/dgpix.c b/src/mame/drivers/dgpix.c index a62ac083e26..7d184030443 100644 --- a/src/mame/drivers/dgpix.c +++ b/src/mame/drivers/dgpix.c @@ -287,7 +287,7 @@ static VIDEO_START( dgpix ) static SCREEN_UPDATE( dgpix ) { - dgpix_state *state = screen->machine().driver_data(); + dgpix_state *state = screen.machine().driver_data(); int y; for (y = 0; y < 240; y++) diff --git a/src/mame/drivers/discoboy.c b/src/mame/drivers/discoboy.c index 0cccb2bfc1a..5e55886e211 100644 --- a/src/mame/drivers/discoboy.c +++ b/src/mame/drivers/discoboy.c @@ -126,7 +126,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect static SCREEN_UPDATE( discoboy ) { - discoboy_state *state = screen->machine().driver_data(); + discoboy_state *state = screen.machine().driver_data(); UINT16 x, y; int i; int count = 0; @@ -141,7 +141,7 @@ static SCREEN_UPDATE( discoboy ) g = ((pal >> 4) & 0xf) << 4; r = ((pal >> 8) & 0xf) << 4; - palette_set_color(screen->machine(), i / 2, MAKE_RGB(r, g, b)); + palette_set_color(screen.machine(), i / 2, MAKE_RGB(r, g, b)); } for (i = 0; i < 0x800; i += 2) @@ -154,7 +154,7 @@ static SCREEN_UPDATE( discoboy ) g = ((pal >> 4) & 0xf) << 4; r = ((pal >> 8) & 0xf) << 4; - palette_set_color(screen->machine(), (i / 2) + 0x400, MAKE_RGB(r, g, b)); + palette_set_color(screen.machine(), (i / 2) + 0x400, MAKE_RGB(r, g, b)); } bitmap_fill(bitmap, cliprect, 0x3ff); @@ -173,12 +173,12 @@ static SCREEN_UPDATE( discoboy ) tileno = 0x2000 + (tileno & 0x1fff) + 0x0000; } - drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[1], tileno, state->m_ram_att[count / 2], 0, 0, x*8, y*8); + drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[1], tileno, state->m_ram_att[count / 2], 0, 0, x*8, y*8); count += 2; } } - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/diverboy.c b/src/mame/drivers/diverboy.c index b63c02c6da0..1bae24b62f0 100644 --- a/src/mame/drivers/diverboy.c +++ b/src/mame/drivers/diverboy.c @@ -111,8 +111,8 @@ static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rect static SCREEN_UPDATE(diverboy) { -// bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); - draw_sprites(screen->machine(), bitmap, cliprect); +// bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/dlair.c b/src/mame/drivers/dlair.c index 2808ccaf78d..13506051f42 100644 --- a/src/mame/drivers/dlair.c +++ b/src/mame/drivers/dlair.c @@ -174,7 +174,7 @@ static PALETTE_INIT( dleuro ) static SCREEN_UPDATE( dleuro ) { - dlair_state *state = screen->machine().driver_data(); + dlair_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; int x, y; @@ -183,7 +183,7 @@ static SCREEN_UPDATE( dleuro ) for (x = 0; x < 32; x++) { UINT8 *base = &videoram[y * 64 + x * 2 + 1]; - drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[0], base[0], base[1], 0, 0, 10 * x, 16 * y); + drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], base[0], base[1], 0, 0, 10 * x, 16 * y); } return 0; diff --git a/src/mame/drivers/dmndrby.c b/src/mame/drivers/dmndrby.c index 098c927f6bb..c30aa07d004 100644 --- a/src/mame/drivers/dmndrby.c +++ b/src/mame/drivers/dmndrby.c @@ -340,14 +340,14 @@ static VIDEO_START(dderby) static SCREEN_UPDATE(dderby) { - dmndrby_state *state = screen->machine().driver_data(); + dmndrby_state *state = screen.machine().driver_data(); int x,y,count; int off,scrolly; - const gfx_element *gfx = screen->machine().gfx[0]; - const gfx_element *sprites = screen->machine().gfx[1]; - const gfx_element *track = screen->machine().gfx[2]; + const gfx_element *gfx = screen.machine().gfx[0]; + const gfx_element *sprites = screen.machine().gfx[1]; + const gfx_element *track = screen.machine().gfx[2]; - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); /* Draw racetrack diff --git a/src/mame/drivers/dominob.c b/src/mame/drivers/dominob.c index 51c4bd9067e..7984af275c3 100644 --- a/src/mame/drivers/dominob.c +++ b/src/mame/drivers/dominob.c @@ -119,7 +119,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect static SCREEN_UPDATE( dominob ) { - dominob_state *state = screen->machine().driver_data(); + dominob_state *state = screen.machine().driver_data(); int x,y; int index = 0; @@ -130,7 +130,7 @@ static SCREEN_UPDATE( dominob ) { drawgfx_opaque(bitmap, cliprect, - screen->machine().gfx[1], + screen.machine().gfx[1], state->m_bgram[index] + 256 * (state->m_bgram[index + 1] & 0xf), state->m_bgram[index + 1] >> 4, 0, 0, @@ -145,7 +145,7 @@ static SCREEN_UPDATE( dominob ) { drawgfx_transpen( bitmap, cliprect, - screen->machine().gfx[0], + screen.machine().gfx[0], state->m_videoram[(y * 32 + x) * 2 + 1] + (state->m_videoram[(y * 32 + x) * 2] & 7) * 256, (state->m_videoram[(y * 32 + x) * 2] >> 3), 0, 0, @@ -153,7 +153,7 @@ static SCREEN_UPDATE( dominob ) } } - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/dorachan.c b/src/mame/drivers/dorachan.c index 83ad6ba7801..d298a3b3f0b 100644 --- a/src/mame/drivers/dorachan.c +++ b/src/mame/drivers/dorachan.c @@ -79,14 +79,14 @@ static void get_pens(pen_t *pens) static SCREEN_UPDATE( dorachan ) { - dorachan_state *state = screen->machine().driver_data(); + dorachan_state *state = screen.machine().driver_data(); pen_t pens[NUM_PENS]; offs_t offs; const UINT8 *color_map_base; get_pens(pens); - color_map_base = screen->machine().region("proms")->base(); + color_map_base = screen.machine().region("proms")->base(); for (offs = 0; offs < state->m_videoram_size; offs++) { diff --git a/src/mame/drivers/dotrikun.c b/src/mame/drivers/dotrikun.c index e6fe476c01b..b292c2572aa 100644 --- a/src/mame/drivers/dotrikun.c +++ b/src/mame/drivers/dotrikun.c @@ -61,7 +61,7 @@ static WRITE8_HANDLER( dotrikun_color_w ) static SCREEN_UPDATE( dotrikun ) { - dotrikun_state *state = screen->machine().driver_data(); + dotrikun_state *state = screen.machine().driver_data(); int x,y,i; pen_t back_pen = MAKE_RGB(pal1bit(state->m_color >> 3), pal1bit(state->m_color >> 4), pal1bit(state->m_color >> 5)); diff --git a/src/mame/drivers/dreamwld.c b/src/mame/drivers/dreamwld.c index 0386c8a0be0..5baa43e9df1 100644 --- a/src/mame/drivers/dreamwld.c +++ b/src/mame/drivers/dreamwld.c @@ -274,7 +274,7 @@ static VIDEO_START( dreamwld ) SCREEN_EOF( dreamwld ) { - dreamwld_state *state = machine.driver_data(); + dreamwld_state *state = screen.machine().driver_data(); memcpy(state->m_spritebuf2, state->m_spritebuf1, 0x2000); memcpy(state->m_spritebuf1, state->m_spriteram, 0x2000); } @@ -282,7 +282,7 @@ SCREEN_EOF( dreamwld ) static SCREEN_UPDATE( dreamwld ) { - dreamwld_state *state = screen->machine().driver_data(); + dreamwld_state *state = screen.machine().driver_data(); // int tm0size, tm1size; tilemap_t *tmptilemap0, *tmptilemap1; @@ -378,7 +378,7 @@ static SCREEN_UPDATE( dreamwld ) tilemap_draw(bitmap, cliprect, tmptilemap0, 0, 0); tilemap_draw(bitmap, cliprect, tmptilemap1, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/drtomy.c b/src/mame/drivers/drtomy.c index 74e2a0475f2..6caae62323c 100644 --- a/src/mame/drivers/drtomy.c +++ b/src/mame/drivers/drtomy.c @@ -125,11 +125,11 @@ static VIDEO_START( drtomy ) static SCREEN_UPDATE( drtomy ) { - drtomy_state *state = screen->machine().driver_data(); + drtomy_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_tilemap_bg, 0, 0); tilemap_draw(bitmap, cliprect, state->m_tilemap_fg, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/drw80pkr.c b/src/mame/drivers/drw80pkr.c index 9804a811be4..2968f688f46 100644 --- a/src/mame/drivers/drw80pkr.c +++ b/src/mame/drivers/drw80pkr.c @@ -339,7 +339,7 @@ static VIDEO_START( drw80pkr ) static SCREEN_UPDATE( drw80pkr ) { - drw80pkr_state *state = screen->machine().driver_data(); + drw80pkr_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; diff --git a/src/mame/drivers/dunhuang.c b/src/mame/drivers/dunhuang.c index c913dba451f..f315e182bf2 100644 --- a/src/mame/drivers/dunhuang.c +++ b/src/mame/drivers/dunhuang.c @@ -134,20 +134,20 @@ static VIDEO_START(dunhuang) static SCREEN_UPDATE( dunhuang ) { - dunhuang_state *state = screen->machine().driver_data(); + dunhuang_state *state = screen.machine().driver_data(); int layers_ctrl = -1; #if DUNHUANG_DEBUG -if (screen->machine().input().code_pressed(KEYCODE_Z)) +if (screen.machine().input().code_pressed(KEYCODE_Z)) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 2; if (msk != 0) layers_ctrl &= msk; } #endif - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); switch (state->m_layers) { diff --git a/src/mame/drivers/dwarfd.c b/src/mame/drivers/dwarfd.c index 618ed30a9ee..ad951ba698b 100644 --- a/src/mame/drivers/dwarfd.c +++ b/src/mame/drivers/dwarfd.c @@ -837,8 +837,8 @@ static void drawCrt( running_machine &machine, bitmap_t *bitmap,const rectangle static SCREEN_UPDATE( dwarfd ) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); - drawCrt(screen->machine(), bitmap, cliprect); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); + drawCrt(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/dynadice.c b/src/mame/drivers/dynadice.c index 499b81d2602..80104ff918d 100644 --- a/src/mame/drivers/dynadice.c +++ b/src/mame/drivers/dynadice.c @@ -208,7 +208,7 @@ static VIDEO_START( dynadice ) static SCREEN_UPDATE( dynadice ) { - dynadice_state *state = screen->machine().driver_data(); + dynadice_state *state = screen.machine().driver_data(); rectangle myclip = *cliprect; myclip.max_x = 15; tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c index a0a69c80462..7b80ba4ce92 100644 --- a/src/mame/drivers/dynax.c +++ b/src/mame/drivers/dynax.c @@ -4739,7 +4739,7 @@ static MACHINE_CONFIG_START( jantouki, dynax_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(512, 256) MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 16, 256-1) - MCFG_SCREEN_UPDATE(jantouki) + MCFG_SCREEN_UPDATE(jantouki_top) MCFG_SCREEN_ADD("bottom", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -4747,7 +4747,7 @@ static MACHINE_CONFIG_START( jantouki, dynax_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(512, 256) MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 16, 256-1) - MCFG_SCREEN_UPDATE(jantouki) + MCFG_SCREEN_UPDATE(jantouki_bottom) MCFG_PALETTE_INIT(sprtmtch) // static palette MCFG_VIDEO_START(jantouki) diff --git a/src/mame/drivers/egghunt.c b/src/mame/drivers/egghunt.c index 42d9c3a2115..bfc6111bf0b 100644 --- a/src/mame/drivers/egghunt.c +++ b/src/mame/drivers/egghunt.c @@ -174,9 +174,9 @@ static VIDEO_START(egghunt) static SCREEN_UPDATE(egghunt) { - egghunt_state *state = screen->machine().driver_data(); + egghunt_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/embargo.c b/src/mame/drivers/embargo.c index a75eb6e759f..39848d14d3a 100644 --- a/src/mame/drivers/embargo.c +++ b/src/mame/drivers/embargo.c @@ -33,7 +33,7 @@ public: static SCREEN_UPDATE( embargo ) { - embargo_state *state = screen->machine().driver_data(); + embargo_state *state = screen.machine().driver_data(); offs_t offs; for (offs = 0; offs < state->m_videoram_size; offs++) diff --git a/src/mame/drivers/enigma2.c b/src/mame/drivers/enigma2.c index 8a767fc72e1..5885bffe2e3 100644 --- a/src/mame/drivers/enigma2.c +++ b/src/mame/drivers/enigma2.c @@ -198,11 +198,11 @@ static void get_pens(pen_t *pens) static SCREEN_UPDATE( enigma2 ) { - enigma2_state *state = screen->machine().driver_data(); + enigma2_state *state = screen.machine().driver_data(); pen_t pens[NUM_PENS]; - const rectangle &visarea = screen->visible_area(); - UINT8 *prom = screen->machine().region("proms")->base(); + const rectangle &visarea = screen.visible_area(); + UINT8 *prom = screen.machine().region("proms")->base(); UINT8 *color_map_base = state->m_flip_screen ? &prom[0x0400] : &prom[0x0000]; UINT8 *star_map_base = (state->m_blink_count & 0x08) ? &prom[0x0c00] : &prom[0x0800]; @@ -226,7 +226,7 @@ static SCREEN_UPDATE( enigma2 ) offs_t color_map_address = (y >> 3 << 5) | (x >> 3); /* the schematics shows it like this, but it doesn't work as this would produce no stars, due to the contents of the PROM -- maybe there is - a star disabled bit somewhere that's connected here instead of flip_screen_get(screen->machine()) */ + a star disabled bit somewhere that's connected here instead of flip_screen_get(screen.machine()) */ /* star_map_address = (y >> 4 << 6) | (engima2_flip_screen_get() << 5) | (x >> 3); */ offs_t star_map_address = (y >> 4 << 6) | 0x20 | (x >> 3); @@ -286,9 +286,9 @@ static SCREEN_UPDATE( enigma2 ) static SCREEN_UPDATE( enigma2a ) { - enigma2_state *state = screen->machine().driver_data(); + enigma2_state *state = screen.machine().driver_data(); UINT8 x = 0; - const rectangle &visarea = screen->visible_area(); + const rectangle &visarea = screen.visible_area(); UINT16 bitmap_y = visarea.min_y; UINT8 y = (UINT8)vpos_to_vysnc_chain_counter(bitmap_y); UINT8 video_data = 0; diff --git a/src/mame/drivers/eolith16.c b/src/mame/drivers/eolith16.c index 075173bcbb4..4186e8d0743 100644 --- a/src/mame/drivers/eolith16.c +++ b/src/mame/drivers/eolith16.c @@ -123,7 +123,7 @@ static VIDEO_START( eolith16 ) static SCREEN_UPDATE( eolith16 ) { - eolith16_state *state = screen->machine().driver_data(); + eolith16_state *state = screen.machine().driver_data(); int x,y,count; int color; diff --git a/src/mame/drivers/esh.c b/src/mame/drivers/esh.c index 39142cf3e7b..bba25128b1f 100644 --- a/src/mame/drivers/esh.c +++ b/src/mame/drivers/esh.c @@ -48,7 +48,7 @@ public: /* VIDEO GOODS */ static SCREEN_UPDATE( esh ) { - esh_state *state = screen->machine().driver_data(); + esh_state *state = screen.machine().driver_data(); int charx, chary; /* clear */ @@ -66,7 +66,7 @@ static SCREEN_UPDATE( esh ) //int blinkLine = (state->m_tile_control_ram[current_screen_character] & 0x40) >> 6; //int blinkChar = (state->m_tile_control_ram[current_screen_character] & 0x80) >> 7; - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], state->m_tile_ram[current_screen_character] + (0x100 * tileOffs), palIndex, 0, 0, charx*8, chary*8, 0); diff --git a/src/mame/drivers/ettrivia.c b/src/mame/drivers/ettrivia.c index bb089257e23..c44a3d3b9ea 100644 --- a/src/mame/drivers/ettrivia.c +++ b/src/mame/drivers/ettrivia.c @@ -258,7 +258,7 @@ static VIDEO_START( ettrivia ) static SCREEN_UPDATE( ettrivia ) { - ettrivia_state *state = screen->machine().driver_data(); + ettrivia_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); return 0; diff --git a/src/mame/drivers/f-32.c b/src/mame/drivers/f-32.c index 41b5d0541c8..f783990a7b9 100644 --- a/src/mame/drivers/f-32.c +++ b/src/mame/drivers/f-32.c @@ -32,7 +32,7 @@ public: static SCREEN_UPDATE( mosaicf2 ) { - mosaicf2_state *state = screen->machine().driver_data(); + mosaicf2_state *state = screen.machine().driver_data(); offs_t offs; for (offs = 0; offs < 0x10000; offs++) diff --git a/src/mame/drivers/famibox.c b/src/mame/drivers/famibox.c index e0d07265c39..d7b793db4c8 100644 --- a/src/mame/drivers/famibox.c +++ b/src/mame/drivers/famibox.c @@ -526,7 +526,7 @@ static VIDEO_START( famibox ) static SCREEN_UPDATE( famibox ) { /* render the ppu */ - ppu2c0x_render(screen->machine().device("ppu"), bitmap, 0, 0, 0, 0); + ppu2c0x_render(screen.machine().device("ppu"), bitmap, 0, 0, 0, 0); return 0; } diff --git a/src/mame/drivers/fcrash.c b/src/mame/drivers/fcrash.c index 9542dc0d5d2..691288fe4b4 100644 --- a/src/mame/drivers/fcrash.c +++ b/src/mame/drivers/fcrash.c @@ -218,22 +218,22 @@ static void fcrash_build_palette( running_machine &machine ) static SCREEN_UPDATE( fcrash ) { - cps_state *state = screen->machine().driver_data(); + cps_state *state = screen.machine().driver_data(); int layercontrol, l0, l1, l2, l3; int videocontrol = state->m_cps_a_regs[0x22 / 2]; - flip_screen_set(screen->machine(), videocontrol & 0x8000); + flip_screen_set(screen.machine(), videocontrol & 0x8000); layercontrol = state->m_cps_b_regs[0x20 / 2]; /* Get video memory base registers */ - cps1_get_video_base(screen->machine()); + cps1_get_video_base(screen.machine()); /* Build palette */ - fcrash_build_palette(screen->machine()); + fcrash_build_palette(screen.machine()); - fcrash_update_transmasks(screen->machine()); + fcrash_update_transmasks(screen.machine()); tilemap_set_scrollx(state->m_bg_tilemap[0], 0, state->m_scroll1x - 62); tilemap_set_scrolly(state->m_bg_tilemap[0], 0, state->m_scroll1y); @@ -270,28 +270,28 @@ static SCREEN_UPDATE( fcrash ) /* Blank screen */ bitmap_fill(bitmap, cliprect, 0xbff); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); l0 = (layercontrol >> 0x06) & 03; l1 = (layercontrol >> 0x08) & 03; l2 = (layercontrol >> 0x0a) & 03; l3 = (layercontrol >> 0x0c) & 03; - fcrash_render_layer(screen->machine(), bitmap, cliprect, l0, 0); + fcrash_render_layer(screen.machine(), bitmap, cliprect, l0, 0); if (l1 == 0) - fcrash_render_high_layer(screen->machine(), bitmap, cliprect, l0); + fcrash_render_high_layer(screen.machine(), bitmap, cliprect, l0); - fcrash_render_layer(screen->machine(), bitmap, cliprect, l1, 0); + fcrash_render_layer(screen.machine(), bitmap, cliprect, l1, 0); if (l2 == 0) - fcrash_render_high_layer(screen->machine(), bitmap, cliprect, l1); + fcrash_render_high_layer(screen.machine(), bitmap, cliprect, l1); - fcrash_render_layer(screen->machine(), bitmap, cliprect, l2, 0); + fcrash_render_layer(screen.machine(), bitmap, cliprect, l2, 0); if (l3 == 0) - fcrash_render_high_layer(screen->machine(), bitmap, cliprect, l2); + fcrash_render_high_layer(screen.machine(), bitmap, cliprect, l2); - fcrash_render_layer(screen->machine(), bitmap, cliprect, l3, 0); + fcrash_render_layer(screen.machine(), bitmap, cliprect, l3, 0); return 0; } @@ -299,21 +299,21 @@ static SCREEN_UPDATE( fcrash ) // doesn't have the scroll offsets like fcrash static SCREEN_UPDATE( kodb ) { - cps_state *state = screen->machine().driver_data(); + cps_state *state = screen.machine().driver_data(); int layercontrol, l0, l1, l2, l3; int videocontrol = state->m_cps_a_regs[0x22 / 2]; - flip_screen_set(screen->machine(), videocontrol & 0x8000); + flip_screen_set(screen.machine(), videocontrol & 0x8000); layercontrol = state->m_cps_b_regs[0x20 / 2]; /* Get video memory base registers */ - cps1_get_video_base(screen->machine()); + cps1_get_video_base(screen.machine()); /* Build palette */ - fcrash_build_palette(screen->machine()); + fcrash_build_palette(screen.machine()); - fcrash_update_transmasks(screen->machine()); + fcrash_update_transmasks(screen.machine()); tilemap_set_scrollx(state->m_bg_tilemap[0], 0, state->m_scroll1x); tilemap_set_scrolly(state->m_bg_tilemap[0], 0, state->m_scroll1y); @@ -351,28 +351,28 @@ static SCREEN_UPDATE( kodb ) /* Blank screen */ bitmap_fill(bitmap, cliprect, 0xbff); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); l0 = (layercontrol >> 0x06) & 03; l1 = (layercontrol >> 0x08) & 03; l2 = (layercontrol >> 0x0a) & 03; l3 = (layercontrol >> 0x0c) & 03; - fcrash_render_layer(screen->machine(), bitmap, cliprect, l0, 0); + fcrash_render_layer(screen.machine(), bitmap, cliprect, l0, 0); if (l1 == 0) - fcrash_render_high_layer(screen->machine(), bitmap, cliprect, l0); + fcrash_render_high_layer(screen.machine(), bitmap, cliprect, l0); - fcrash_render_layer(screen->machine(), bitmap, cliprect, l1, 0); + fcrash_render_layer(screen.machine(), bitmap, cliprect, l1, 0); if (l2 == 0) - fcrash_render_high_layer(screen->machine(), bitmap, cliprect, l1); + fcrash_render_high_layer(screen.machine(), bitmap, cliprect, l1); - fcrash_render_layer(screen->machine(), bitmap, cliprect, l2, 0); + fcrash_render_layer(screen.machine(), bitmap, cliprect, l2, 0); if (l3 == 0) - fcrash_render_high_layer(screen->machine(), bitmap, cliprect, l2); + fcrash_render_high_layer(screen.machine(), bitmap, cliprect, l2); - fcrash_render_layer(screen->machine(), bitmap, cliprect, l3, 0); + fcrash_render_layer(screen.machine(), bitmap, cliprect, l3, 0); return 0; } diff --git a/src/mame/drivers/feversoc.c b/src/mame/drivers/feversoc.c index 27121bc5841..03d76e9501e 100644 --- a/src/mame/drivers/feversoc.c +++ b/src/mame/drivers/feversoc.c @@ -84,11 +84,11 @@ static VIDEO_START( feversoc ) static SCREEN_UPDATE( feversoc ) { - feversoc_state *state = screen->machine().driver_data(); + feversoc_state *state = screen.machine().driver_data(); UINT32 *spriteram32 = state->m_spriteram; int offs,spr_offs,colour,sx,sy,h,w,dx,dy; - bitmap_fill(bitmap, cliprect, screen->machine().pens[0]); //black pen + bitmap_fill(bitmap, cliprect, screen.machine().pens[0]); //black pen for(offs=(0x2000/4)-2;offs>-1;offs-=2) { @@ -106,7 +106,7 @@ static SCREEN_UPDATE( feversoc ) for(dx=0;dxmachine().gfx[0],spr_offs++,colour,0,0,(sx+dx*16),(sy+dy*16),0x3f); + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],spr_offs++,colour,0,0,(sx+dx*16),(sy+dy*16),0x3f); } return 0; diff --git a/src/mame/drivers/firebeat.c b/src/mame/drivers/firebeat.c index dfeb0f945cc..b1a731fb513 100644 --- a/src/mame/drivers/firebeat.c +++ b/src/mame/drivers/firebeat.c @@ -513,41 +513,35 @@ static void gcu_exec_display_list(running_machine &machine, bitmap_t *bitmap, co }; } -static SCREEN_UPDATE(firebeat) +static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int chip) { - firebeat_state *state = screen->machine().driver_data(); - int chip; - - if (screen == screen->machine().devicelist().find(SCREEN, 0)) - chip = 0; - else - chip = 1; + firebeat_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, 0); - if (mame_stricmp(screen->machine().system().name, "popn7") == 0) + if (mame_stricmp(screen.machine().system().name, "popn7") == 0) { - gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x1f80000); + gcu_exec_display_list(screen.machine(), bitmap, cliprect, chip, 0x1f80000); } else { if (state->m_layer >= 2) { - gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x8000); - gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x0000); - gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x10000); + gcu_exec_display_list(screen.machine(), bitmap, cliprect, chip, 0x8000); + gcu_exec_display_list(screen.machine(), bitmap, cliprect, chip, 0x0000); + gcu_exec_display_list(screen.machine(), bitmap, cliprect, chip, 0x10000); } else if (state->m_layer == 0) { - gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x200000); + gcu_exec_display_list(screen.machine(), bitmap, cliprect, chip, 0x200000); - //gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x186040); + //gcu_exec_display_list(screen.machine(), bitmap, cliprect, chip, 0x186040); } else if (state->m_layer == 1) { - gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x1d0800); + gcu_exec_display_list(screen.machine(), bitmap, cliprect, chip, 0x1d0800); - gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x1a9440); + gcu_exec_display_list(screen.machine(), bitmap, cliprect, chip, 0x1a9440); } } @@ -555,7 +549,7 @@ static SCREEN_UPDATE(firebeat) if (state->m_tick >= 5) { state->m_tick = 0; - if (screen->machine().input().code_pressed(KEYCODE_0)) + if (screen.machine().input().code_pressed(KEYCODE_0)) { state->m_layer++; if (state->m_layer > 2) @@ -565,7 +559,7 @@ static SCREEN_UPDATE(firebeat) } /* - if (screen->machine().input().code_pressed_once(KEYCODE_9)) + if (screen.machine().input().code_pressed_once(KEYCODE_9)) { FILE *file = fopen("vram0.bin", "wb"); int i; @@ -597,6 +591,9 @@ static SCREEN_UPDATE(firebeat) return 0; } +static SCREEN_UPDATE( firebeat_0 ) { return update_screen(screen, bitmap, cliprect, 0); } +static SCREEN_UPDATE( firebeat_1 ) { return update_screen(screen, bitmap, cliprect, 1); } + static UINT32 GCU_r(running_machine &machine, int chip, UINT32 offset, UINT32 mem_mask) { firebeat_state *state = machine.driver_data(); @@ -1992,7 +1989,7 @@ static MACHINE_CONFIG_START( firebeat, firebeat_state ) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) MCFG_SCREEN_SIZE(640, 480) MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 479) - MCFG_SCREEN_UPDATE(firebeat) + MCFG_SCREEN_UPDATE(firebeat_0) MCFG_PALETTE_LENGTH(32768) @@ -2039,7 +2036,7 @@ static MACHINE_CONFIG_START( firebeat2, firebeat_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(640, 480) MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 479) - MCFG_SCREEN_UPDATE(firebeat) + MCFG_SCREEN_UPDATE(firebeat_0) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -2047,7 +2044,7 @@ static MACHINE_CONFIG_START( firebeat2, firebeat_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(640, 480) MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 479) - MCFG_SCREEN_UPDATE(firebeat) + MCFG_SCREEN_UPDATE(firebeat_1) MCFG_VIDEO_START(firebeat) diff --git a/src/mame/drivers/firefox.c b/src/mame/drivers/firefox.c index bda74ebc784..cb5136c26df 100644 --- a/src/mame/drivers/firefox.c +++ b/src/mame/drivers/firefox.c @@ -184,11 +184,11 @@ static VIDEO_START( firefox ) static SCREEN_UPDATE( firefox ) { - firefox_state *state = screen->machine().driver_data(); + firefox_state *state = screen.machine().driver_data(); int sprite; - int gfxtop = screen->visible_area().min_y; + int gfxtop = screen.visible_area().min_y; - bitmap_fill( bitmap, cliprect, palette_get_color(screen->machine(), 256) ); + bitmap_fill( bitmap, cliprect, palette_get_color(screen.machine(), 256) ); for( sprite = 0; sprite < 32; sprite++ ) { @@ -208,7 +208,7 @@ static SCREEN_UPDATE( firefox ) int flipx = flags & 0x20; int code = sprite_data[ 15 - row ] + ( 256 * ( ( flags >> 6 ) & 3 ) ); - drawgfx_transpen( bitmap, cliprect, screen->machine().gfx[ 1 ], code, color, flipx, flipy, x + 8, gfxtop + 500 - y - ( row * 16 ), 0 ); + drawgfx_transpen( bitmap, cliprect, screen.machine().gfx[ 1 ], code, color, flipx, flipy, x + 8, gfxtop + 500 - y - ( row * 16 ), 0 ); } } } diff --git a/src/mame/drivers/flyball.c b/src/mame/drivers/flyball.c index a5f28776829..4fa4ceea3d0 100644 --- a/src/mame/drivers/flyball.c +++ b/src/mame/drivers/flyball.c @@ -85,7 +85,7 @@ static VIDEO_START( flyball ) static SCREEN_UPDATE( flyball ) { - flyball_state *state = screen->machine().driver_data(); + flyball_state *state = screen.machine().driver_data(); int pitcherx = state->m_pitcher_horz; int pitchery = state->m_pitcher_vert - 31; @@ -101,7 +101,7 @@ static SCREEN_UPDATE( flyball ) tilemap_draw(bitmap, cliprect, state->m_tmap, 0, 0); /* draw pitcher */ - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], state->m_pitcher_pic ^ 0xf, 0, 1, 0, pitcherx, pitchery, 1); + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], state->m_pitcher_pic ^ 0xf, 0, 1, 0, pitcherx, pitchery, 1); /* draw ball */ diff --git a/src/mame/drivers/forte2.c b/src/mame/drivers/forte2.c index 7f81f953e70..9f75a9642bf 100644 --- a/src/mame/drivers/forte2.c +++ b/src/mame/drivers/forte2.c @@ -107,7 +107,7 @@ static TMS9928A_INTERFACE(forte2_tms9928a_interface) static SCREEN_UPDATE( forte2 ) { - tms9928a_device *tms9928a = screen->machine().device( "tms9928a" ); + tms9928a_device *tms9928a = screen.machine().device( "tms9928a" ); tms9928a->update( bitmap, cliprect ); return 0; diff --git a/src/mame/drivers/fortecar.c b/src/mame/drivers/fortecar.c index 19c7f7b19a0..a4d5fef2f0e 100644 --- a/src/mame/drivers/fortecar.c +++ b/src/mame/drivers/fortecar.c @@ -346,7 +346,7 @@ static VIDEO_START(fortecar) static SCREEN_UPDATE(fortecar) { - fortecar_state *state = screen->machine().driver_data(); + fortecar_state *state = screen.machine().driver_data(); int x,y,count; count = 0; @@ -363,7 +363,7 @@ static SCREEN_UPDATE(fortecar) if(bpp) color&=0x3; - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[bpp],tile,color,0,0,x*8,y*8); + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[bpp],tile,color,0,0,x*8,y*8); count++; } diff --git a/src/mame/drivers/fromanc2.c b/src/mame/drivers/fromanc2.c index a2c12898ae0..1c5fb5d1254 100644 --- a/src/mame/drivers/fromanc2.c +++ b/src/mame/drivers/fromanc2.c @@ -589,7 +589,7 @@ static MACHINE_CONFIG_START( fromanc2, fromanc2_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(512, 512) MCFG_SCREEN_VISIBLE_AREA(0, 352-1, 0, 240-1) - MCFG_SCREEN_UPDATE(fromanc2) + MCFG_SCREEN_UPDATE(fromanc2_left) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -597,7 +597,7 @@ static MACHINE_CONFIG_START( fromanc2, fromanc2_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(512, 512) MCFG_SCREEN_VISIBLE_AREA(0, 352-1, 0, 240-1) - MCFG_SCREEN_UPDATE(fromanc2) + MCFG_SCREEN_UPDATE(fromanc2_right) MCFG_VIDEO_START(fromanc2) @@ -642,7 +642,7 @@ static MACHINE_CONFIG_START( fromancr, fromanc2_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(512, 512) MCFG_SCREEN_VISIBLE_AREA(0, 352-1, 0, 240-1) - MCFG_SCREEN_UPDATE(fromanc2) + MCFG_SCREEN_UPDATE(fromanc2_left) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -650,7 +650,7 @@ static MACHINE_CONFIG_START( fromancr, fromanc2_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(512, 512) MCFG_SCREEN_VISIBLE_AREA(0, 352-1, 0, 240-1) - MCFG_SCREEN_UPDATE(fromanc2) + MCFG_SCREEN_UPDATE(fromanc2_right) MCFG_VIDEO_START(fromancr) @@ -692,7 +692,7 @@ static MACHINE_CONFIG_START( fromanc4, fromanc2_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(2048, 256) MCFG_SCREEN_VISIBLE_AREA(0, 352-1, 0, 240-1) - MCFG_SCREEN_UPDATE(fromanc2) + MCFG_SCREEN_UPDATE(fromanc2_left) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -700,7 +700,7 @@ static MACHINE_CONFIG_START( fromanc4, fromanc2_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(512, 512) MCFG_SCREEN_VISIBLE_AREA(0, 352-1, 0, 240-1) - MCFG_SCREEN_UPDATE(fromanc2) + MCFG_SCREEN_UPDATE(fromanc2_right) MCFG_VIDEO_START(fromanc4) diff --git a/src/mame/drivers/gaelco2.c b/src/mame/drivers/gaelco2.c index f2ee5cadafb..2efe60e7f9b 100644 --- a/src/mame/drivers/gaelco2.c +++ b/src/mame/drivers/gaelco2.c @@ -791,7 +791,7 @@ static MACHINE_CONFIG_START( touchgo, gaelco2_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(64*16, 32*16) MCFG_SCREEN_VISIBLE_AREA(0, 480-1, 16, 256-1) - MCFG_SCREEN_UPDATE(gaelco2_dual) + MCFG_SCREEN_UPDATE(gaelco2_left) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -799,7 +799,7 @@ static MACHINE_CONFIG_START( touchgo, gaelco2_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(64*16, 32*16) MCFG_SCREEN_VISIBLE_AREA(0, 480-1, 16, 256-1) - MCFG_SCREEN_UPDATE(gaelco2_dual) + MCFG_SCREEN_UPDATE(gaelco2_right) MCFG_SCREEN_EOF(gaelco2) MCFG_VIDEO_START(gaelco2_dual) @@ -1229,7 +1229,7 @@ static MACHINE_CONFIG_START( wrally2, gaelco2_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(384, 32*16) MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 16, 256-1) - MCFG_SCREEN_UPDATE(gaelco2_dual) + MCFG_SCREEN_UPDATE(gaelco2_left) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -1237,7 +1237,7 @@ static MACHINE_CONFIG_START( wrally2, gaelco2_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(384, 32*16) MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 16, 256-1) - MCFG_SCREEN_UPDATE(gaelco2_dual) + MCFG_SCREEN_UPDATE(gaelco2_right) MCFG_SCREEN_EOF(gaelco2) diff --git a/src/mame/drivers/gal3.c b/src/mame/drivers/gal3.c index 5163916a289..17da08e8676 100644 --- a/src/mame/drivers/gal3.c +++ b/src/mame/drivers/gal3.c @@ -180,27 +180,27 @@ static void update_palette( running_machine &machine ) static SCREEN_UPDATE(gal3) { - gal3_state *state = screen->machine().driver_data(); + gal3_state *state = screen.machine().driver_data(); int i; char mst[18], slv[18]; static int pivot = 15; int pri; - update_palette(screen->machine()); + update_palette(screen.machine()); - if( screen->machine().input().code_pressed_once(KEYCODE_H)&&(pivot<15) ) pivot+=1; - if( screen->machine().input().code_pressed_once(KEYCODE_J)&&(pivot>0) ) pivot-=1; + if( screen.machine().input().code_pressed_once(KEYCODE_H)&&(pivot<15) ) pivot+=1; + if( screen.machine().input().code_pressed_once(KEYCODE_J)&&(pivot>0) ) pivot-=1; for( pri=0; primachine(), bitmap, cliprect, pri ); + namco_obj_draw(screen.machine(), bitmap, cliprect, pri ); } /* CopyVisiblePolyFrameBuffer( bitmap, cliprect,0,0x7fbf ); for( pri=pivot; pri<15; pri++ ) { - namco_obj_draw(screen->machine(), bitmap, cliprect, pri ); + namco_obj_draw(screen.machine(), bitmap, cliprect, pri ); }*/ // CPU Diag LEDs diff --git a/src/mame/drivers/galaxi.c b/src/mame/drivers/galaxi.c index 8d565ff2542..8b82257a944 100644 --- a/src/mame/drivers/galaxi.c +++ b/src/mame/drivers/galaxi.c @@ -171,24 +171,24 @@ static VIDEO_START(galaxi) static SCREEN_UPDATE(galaxi) { - galaxi_state *state = screen->machine().driver_data(); + galaxi_state *state = screen.machine().driver_data(); int layers_ctrl = -1; #ifdef MAME_DEBUG - if (screen->machine().input().code_pressed(KEYCODE_R)) // remapped due to inputs changes. + if (screen.machine().input().code_pressed(KEYCODE_R)) // remapped due to inputs changes. { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_T)) msk |= 1; - if (screen->machine().input().code_pressed(KEYCODE_Y)) msk |= 2; - if (screen->machine().input().code_pressed(KEYCODE_U)) msk |= 4; - if (screen->machine().input().code_pressed(KEYCODE_I)) msk |= 8; - if (screen->machine().input().code_pressed(KEYCODE_O)) msk |= 16; + if (screen.machine().input().code_pressed(KEYCODE_T)) msk |= 1; + if (screen.machine().input().code_pressed(KEYCODE_Y)) msk |= 2; + if (screen.machine().input().code_pressed(KEYCODE_U)) msk |= 4; + if (screen.machine().input().code_pressed(KEYCODE_I)) msk |= 8; + if (screen.machine().input().code_pressed(KEYCODE_O)) msk |= 16; if (msk != 0) layers_ctrl &= msk; } #endif if (layers_ctrl & 1) tilemap_draw(bitmap, cliprect, state->m_bg1_tmap, TILEMAP_DRAW_OPAQUE, 0); - else bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + else bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); if (layers_ctrl & 2) tilemap_draw(bitmap, cliprect, state->m_bg2_tmap, 0, 0); if (layers_ctrl & 4) tilemap_draw(bitmap, cliprect, state->m_bg3_tmap, 0, 0); if (layers_ctrl & 8) tilemap_draw(bitmap, cliprect, state->m_bg4_tmap, 0, 0); diff --git a/src/mame/drivers/galaxia.c b/src/mame/drivers/galaxia.c index 18f0ff98025..b44e9a63cec 100644 --- a/src/mame/drivers/galaxia.c +++ b/src/mame/drivers/galaxia.c @@ -43,16 +43,16 @@ public: static SCREEN_UPDATE( galaxia ) { - galaxia_state *state = screen->machine().driver_data(); + galaxia_state *state = screen.machine().driver_data(); int x,y, count; bitmap_t *s2636_0_bitmap; bitmap_t *s2636_1_bitmap; bitmap_t *s2636_2_bitmap; - device_t *s2636_0 = screen->machine().device("s2636_0"); - device_t *s2636_1 = screen->machine().device("s2636_1"); - device_t *s2636_2 = screen->machine().device("s2636_2"); + device_t *s2636_0 = screen.machine().device("s2636_0"); + device_t *s2636_1 = screen.machine().device("s2636_1"); + device_t *s2636_2 = screen.machine().device("s2636_2"); count = 0; @@ -61,7 +61,7 @@ static SCREEN_UPDATE( galaxia ) for (x=0;x<256/8;x++) { int tile = state->m_video[count]; - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tile,0,0,0,x*8,y*8); + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],tile,0,0,0,x*8,y*8); count++; } } diff --git a/src/mame/drivers/galgame.c b/src/mame/drivers/galgame.c index d8319d0746a..f94cf9c53d8 100644 --- a/src/mame/drivers/galgame.c +++ b/src/mame/drivers/galgame.c @@ -162,8 +162,8 @@ static WRITE16_HANDLER(ke_w) static SCREEN_UPDATE( galaxygame ) { - galaxygame_state *state = screen->machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + galaxygame_state *state = screen.machine().driver_data(); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); for (int i = 0; i < state->m_point_display_list_index; i++ ) { *BITMAP_ADDR16(bitmap, state->m_point_display_list[i].x >> 7, state->m_point_display_list[i].y >> 7) = 1; diff --git a/src/mame/drivers/galpani3.c b/src/mame/drivers/galpani3.c index b6ef69bdf4f..046409af90f 100644 --- a/src/mame/drivers/galpani3.c +++ b/src/mame/drivers/galpani3.c @@ -203,12 +203,12 @@ static int gp3_is_alpha_pen(running_machine &machine, int pen) static SCREEN_UPDATE(galpani3) { - galpani3_state *state = screen->machine().driver_data(); + galpani3_state *state = screen.machine().driver_data(); int x,y; UINT16* src1; UINT32* dst; UINT16 pixdata1; - const pen_t *paldata = screen->machine().pens; + const pen_t *paldata = screen.machine().pens; bitmap_fill(bitmap, cliprect, 0x0000); @@ -268,7 +268,7 @@ static SCREEN_UPDATE(galpani3) UINT16 pen = dat1+0x4000; UINT32 pal = paldata[pen]; - if (gp3_is_alpha_pen(screen->machine(), pen)) + if (gp3_is_alpha_pen(screen.machine(), pen)) { int r,g,b; r = (pal & 0x00ff0000)>>16; @@ -296,7 +296,7 @@ static SCREEN_UPDATE(galpani3) UINT16 pen = dat2+0x4100; UINT32 pal = paldata[pen]; - if (gp3_is_alpha_pen(screen->machine(), pen)) + if (gp3_is_alpha_pen(screen.machine(), pen)) { int r,g,b; r = (pal & 0x00ff0000)>>16; @@ -328,20 +328,20 @@ static SCREEN_UPDATE(galpani3) /* else if (pridat==0x2f) // area outside of the girl { - //dst[0] = screen->machine().rand()&0x3fff; + //dst[0] = screen.machine().rand()&0x3fff; } else if (pridat==0x00) // the initial line / box that gets drawn { - //dst[0] = screen->machine().rand()&0x3fff; + //dst[0] = screen.machine().rand()&0x3fff; } else if (pridat==0x30) // during the 'gals boxes' on the intro { - //dst[0] = screen->machine().rand()&0x3fff; + //dst[0] = screen.machine().rand()&0x3fff; } else if (pridat==0x0c) // 'nice' at end of level { - //dst[0] = screen->machine().rand()&0x3fff; + //dst[0] = screen.machine().rand()&0x3fff; } else { @@ -354,7 +354,7 @@ static SCREEN_UPDATE(galpani3) bitmap_fill(state->m_sprite_bitmap_1, cliprect, 0x0000); - state->m_spritegen->skns_draw_sprites(screen->machine(), state->m_sprite_bitmap_1, cliprect, state->m_spriteram32, screen->machine().generic.spriteram_size, screen->machine().region("gfx1")->base(), screen->machine().region ("gfx1")->bytes(), state->m_spc_regs ); + state->m_spritegen->skns_draw_sprites(screen.machine(), state->m_sprite_bitmap_1, cliprect, state->m_spriteram32, screen.machine().generic.spriteram_size, screen.machine().region("gfx1")->base(), screen.machine().region ("gfx1")->bytes(), state->m_spc_regs ); // ignoring priority bits for now.. for (y=0;y<240;y++) diff --git a/src/mame/drivers/galpanic.c b/src/mame/drivers/galpanic.c index 4c2cd727e0e..72487258905 100644 --- a/src/mame/drivers/galpanic.c +++ b/src/mame/drivers/galpanic.c @@ -127,7 +127,7 @@ The current set of Super Model is an example of type C static SCREEN_EOF( galpanic ) { - device_t *pandora = machine.device("pandora"); + device_t *pandora = screen.machine().device("pandora"); pandora_eof(pandora); } diff --git a/src/mame/drivers/gamecstl.c b/src/mame/drivers/gamecstl.c index 6f42746b8dd..a284efb4438 100644 --- a/src/mame/drivers/gamecstl.c +++ b/src/mame/drivers/gamecstl.c @@ -138,9 +138,9 @@ static void draw_char(bitmap_t *bitmap, const rectangle *cliprect, const gfx_ele static SCREEN_UPDATE(gamecstl) { - gamecstl_state *state = screen->machine().driver_data(); + gamecstl_state *state = screen.machine().driver_data(); int i, j; - const gfx_element *gfx = screen->machine().gfx[0]; + const gfx_element *gfx = screen.machine().gfx[0]; UINT32 *cga = state->m_cga_ram; int index = 0; diff --git a/src/mame/drivers/gamtor.c b/src/mame/drivers/gamtor.c index d7caf3ed850..d51d80f5b8d 100644 --- a/src/mame/drivers/gamtor.c +++ b/src/mame/drivers/gamtor.c @@ -116,17 +116,17 @@ VIDEO_START( gamtor ) SCREEN_UPDATE(gamtor) { - gaminator_state *state = screen->machine().driver_data(); + gaminator_state *state = screen.machine().driver_data(); int tile_base = 0x00000; // where does the base address come from? - if (!strcmp(screen->machine().system().name,"g4u5")) tile_base = 0x31BE4 - 2; - if (!strcmp(screen->machine().system().name,"llcharm")) tile_base = 0x2f58d - 2; + if (!strcmp(screen.machine().system().name,"g4u5")) tile_base = 0x31BE4 - 2; + if (!strcmp(screen.machine().system().name,"llcharm")) tile_base = 0x2f58d - 2; - const gfx_element *gfx = screen->machine().gfx[0]; + const gfx_element *gfx = screen.machine().gfx[0]; int count = 0; for (int y=0;y<32;y++) { diff --git a/src/mame/drivers/go2000.c b/src/mame/drivers/go2000.c index d729e4db146..f6dcaa52c07 100644 --- a/src/mame/drivers/go2000.c +++ b/src/mame/drivers/go2000.c @@ -171,7 +171,7 @@ static VIDEO_START(go2000) static SCREEN_UPDATE(go2000) { - go2000_state *state = screen->machine().driver_data(); + go2000_state *state = screen.machine().driver_data(); int x,y; int count = 0; @@ -182,7 +182,7 @@ static SCREEN_UPDATE(go2000) { int tile = state->m_videoram[count]; int attr = state->m_videoram2[count]; - drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[0], tile, attr, 0, 0, x * 8, y * 8); + drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], tile, attr, 0, 0, x * 8, y * 8); count++; } } @@ -194,7 +194,7 @@ static SCREEN_UPDATE(go2000) { int tile = state->m_videoram[count]; int attr = state->m_videoram2[count]; - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], tile, attr, 0, 0, x * 8, y * 8, 0xf); + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], tile, attr, 0, 0, x * 8, y * 8, 0xf); count++; } } @@ -203,8 +203,8 @@ static SCREEN_UPDATE(go2000) { int offs; - int max_x = screen->machine().primary_screen->width() - 8; - int max_y = screen->machine().primary_screen->height() - 8; + int max_x = screen.machine().primary_screen->width() - 8; + int max_y = screen.machine().primary_screen->height() - 8; for (offs = 0xf800 / 2; offs < 0x10000 / 2 ; offs += 4/2) { @@ -277,7 +277,7 @@ static SCREEN_UPDATE(go2000) if (flipx) tile_flipx = !tile_flipx; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { sx = max_x - sx; sy = max_y - sy; @@ -285,7 +285,7 @@ static SCREEN_UPDATE(go2000) tile_flipy = !tile_flipy; } - drawgfx_transpen( bitmap, cliprect,screen->machine().gfx[0], + drawgfx_transpen( bitmap, cliprect,screen.machine().gfx[0], (tile & 0x1fff) + bank*0x4000, attr, tile_flipx, tile_flipy, diff --git a/src/mame/drivers/goldngam.c b/src/mame/drivers/goldngam.c index e1401e19586..15dff6b4906 100644 --- a/src/mame/drivers/goldngam.c +++ b/src/mame/drivers/goldngam.c @@ -258,7 +258,7 @@ static VIDEO_START( goldngam ) static SCREEN_UPDATE( goldngam ) { - goldngam_state *state = screen->machine().driver_data(); + goldngam_state *state = screen.machine().driver_data(); int x, y; diff --git a/src/mame/drivers/goldnpkr.c b/src/mame/drivers/goldnpkr.c index 781d48abd59..463eb402265 100644 --- a/src/mame/drivers/goldnpkr.c +++ b/src/mame/drivers/goldnpkr.c @@ -802,7 +802,7 @@ static VIDEO_START( wcrdxtnd ) static SCREEN_UPDATE( goldnpkr ) { - goldnpkr_state *state = screen->machine().driver_data(); + goldnpkr_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/good.c b/src/mame/drivers/good.c index 8f273c147f3..e0402a86fa2 100644 --- a/src/mame/drivers/good.c +++ b/src/mame/drivers/good.c @@ -95,7 +95,7 @@ static VIDEO_START( good ) static SCREEN_UPDATE( good ) { - good_state *state = screen->machine().driver_data(); + good_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; diff --git a/src/mame/drivers/gpworld.c b/src/mame/drivers/gpworld.c index 7bf254f4804..2ab9e7ffcbe 100644 --- a/src/mame/drivers/gpworld.c +++ b/src/mame/drivers/gpworld.c @@ -220,8 +220,8 @@ static SCREEN_UPDATE( gpworld ) { bitmap_fill(bitmap, cliprect, 0); - gpworld_draw_tiles(screen->machine(), bitmap, cliprect); - gpworld_draw_sprites(screen->machine(), bitmap, cliprect); + gpworld_draw_tiles(screen.machine(), bitmap, cliprect); + gpworld_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/gstream.c b/src/mame/drivers/gstream.c index a57253fc046..cd2b1e18211 100644 --- a/src/mame/drivers/gstream.c +++ b/src/mame/drivers/gstream.c @@ -489,7 +489,7 @@ static SCREEN_UPDATE(gstream) are being set ?! */ - gstream_state *state = screen->machine().driver_data(); + gstream_state *state = screen.machine().driver_data(); int i; //popmessage("(1) %08x %08x (2) %08x %08x (3) %08x %08x", state->m_tmap1_scrollx, state->m_tmap1_scrolly, state->m_tmap2_scrollx, state->m_tmap2_scrolly, state->m_tmap3_scrollx, state->m_tmap3_scrolly ); @@ -519,7 +519,7 @@ static SCREEN_UPDATE(gstream) if (x & 0x8000) x -= 0x10000; if (y & 0x8000) y -= 0x10000; - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],code,col,0,0,x-2,y,0); + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],code,col,0,0,x-2,y,0); } return 0; diff --git a/src/mame/drivers/guab.c b/src/mame/drivers/guab.c index 44580af2e06..a7014883226 100644 --- a/src/mame/drivers/guab.c +++ b/src/mame/drivers/guab.c @@ -253,7 +253,7 @@ static SCREEN_UPDATE( guab ) /* If blanked, fill with black */ if (state.blanked) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } @@ -267,8 +267,8 @@ static SCREEN_UPDATE( guab ) UINT8 pen = src[x >> 1]; /* Draw two 4-bit pixels */ - *dest++ = screen->machine().pens[pen >> 4]; - *dest++ = screen->machine().pens[pen & 0x0f]; + *dest++ = screen.machine().pens[pen >> 4]; + *dest++ = screen.machine().pens[pen & 0x0f]; } } diff --git a/src/mame/drivers/gunpey.c b/src/mame/drivers/gunpey.c index 6d00f41a4fc..fa5357429c4 100644 --- a/src/mame/drivers/gunpey.c +++ b/src/mame/drivers/gunpey.c @@ -70,7 +70,7 @@ static VIDEO_START( gunpey ) static SCREEN_UPDATE( gunpey ) { - gunpey_state *state = screen->machine().driver_data(); + gunpey_state *state = screen.machine().driver_data(); UINT16 *blit_buffer = state->m_blit_buffer; int x,y; int count; @@ -89,7 +89,7 @@ static SCREEN_UPDATE( gunpey ) g = (color & 0x03e0) >> 2; r = (color & 0x7c00) >> 7; - if(xvisible_area().max_x && yvisible_area().max_y) + if(xmachine().driver_data(); + halleys_state *state = screen.machine().driver_data(); int i, j; if (state->m_stars_enabled) @@ -1479,7 +1479,7 @@ static SCREEN_UPDATE( halleys ) bitmap_fill(bitmap, cliprect, state->m_bgcolor); #ifdef MAME_DEBUG - if (input_port_read(screen->machine(), "DEBUG")) copy_scroll_xp(bitmap, state->m_render_layer[3], *state->m_scrollx0, *state->m_scrolly0); // not used??? + if (input_port_read(screen.machine(), "DEBUG")) copy_scroll_xp(bitmap, state->m_render_layer[3], *state->m_scrollx0, *state->m_scrolly0); // not used??? #endif copy_scroll_xp(bitmap, state->m_render_layer[2], *state->m_scrollx1, *state->m_scrolly1); @@ -1489,14 +1489,14 @@ static SCREEN_UPDATE( halleys ) // HALF-HACK: apply RGB filter when the following conditions are met i = state->m_io_ram[0xa0]; j = state->m_io_ram[0xa1]; - if (state->m_io_ram[0x2b] && (i>0xc6 && i<0xfe) && (j==0xc0 || j==0xed)) filter_bitmap(screen->machine(), bitmap, i); + if (state->m_io_ram[0x2b] && (i>0xc6 && i<0xfe) && (j==0xc0 || j==0xed)) filter_bitmap(screen.machine(), bitmap, i); return 0; } static SCREEN_UPDATE( benberob ) { - halleys_state *state = screen->machine().driver_data(); + halleys_state *state = screen.machine().driver_data(); if (state->m_io_ram[0xa0] & 0x80) copy_scroll_op(bitmap, state->m_render_layer[2], *state->m_scrollx1, *state->m_scrolly1); else diff --git a/src/mame/drivers/highvdeo.c b/src/mame/drivers/highvdeo.c index a7e06d49196..d41fa564d43 100644 --- a/src/mame/drivers/highvdeo.c +++ b/src/mame/drivers/highvdeo.c @@ -112,26 +112,26 @@ static VIDEO_START(tourvisn) static SCREEN_UPDATE(tourvisn) { - highvdeo_state *state = screen->machine().driver_data(); + highvdeo_state *state = screen.machine().driver_data(); int x,y,count; count = (0/2); - for(y=0;y<(screen->visible_area().max_y+1);y++) + for(y=0;y<(screen.visible_area().max_y+1);y++) { - for(x=0;x<(screen->visible_area().max_x+1)/2;x++) + for(x=0;x<(screen.visible_area().max_x+1)/2;x++) { UINT32 color; color = ((state->m_blit_ram[count]) & 0x00ff)>>0; - if((x*2)visible_area().max_x && ((y)+0)visible_area().max_y) - *BITMAP_ADDR32(bitmap, y, (x*2)+0) = screen->machine().pens[color]; + if((x*2)m_blit_ram[count]) & 0xff00)>>8; - if(((x*2)+1)visible_area().max_x && ((y)+0)visible_area().max_y) - *BITMAP_ADDR32(bitmap, y, (x*2)+1) = screen->machine().pens[color]; + if(((x*2)+1)machine().driver_data(); + highvdeo_state *state = screen.machine().driver_data(); int x,y,count; count = (0/2); @@ -162,7 +162,7 @@ static SCREEN_UPDATE(brasil) b = (color & 0x001f) << 3; g = (color & 0x07e0) >> 3; r = (color & 0xf800) >> 8; - if(xvisible_area().max_x && yvisible_area().max_y) + if(xmachine().driver_data(); + hitme_state *state = screen.machine().driver_data(); /* the card width resistor comes from an input port, scaled to the range 0-25 kOhms */ - double width_resist = input_port_read(screen->machine(), "WIDTH") * 25000 / 100; + double width_resist = input_port_read(screen.machine(), "WIDTH") * 25000 / 100; /* this triggers a oneshot for the following length of time */ double width_duration = 0.45 * 1000e-12 * width_resist; /* the dot clock runs at the standard horizontal frequency * 320+16 clocks per scanline */ @@ -119,7 +119,7 @@ static SCREEN_UPDATE( hitme ) static SCREEN_UPDATE( barricad ) { - hitme_state *state = screen->machine().driver_data(); + hitme_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/hitpoker.c b/src/mame/drivers/hitpoker.c index 4688b1d3bb3..b9aad0ef900 100644 --- a/src/mame/drivers/hitpoker.c +++ b/src/mame/drivers/hitpoker.c @@ -77,7 +77,7 @@ static VIDEO_START(hitpoker) static SCREEN_UPDATE(hitpoker) { - hitpoker_state *state = screen->machine().driver_data(); + hitpoker_state *state = screen.machine().driver_data(); int count = 0; int y,x; @@ -93,7 +93,7 @@ static SCREEN_UPDATE(hitpoker) gfx_bpp = (state->m_colorram[count] & 0x80)>>7; //flag between 4 and 8 bpp color = gfx_bpp ? ((state->m_colorram[count] & 0x70)>>4) : (state->m_colorram[count] & 0xf); - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[gfx_bpp],tile,color,0,0,x*8,y*8); + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[gfx_bpp],tile,color,0,0,x*8,y*8); count+=2; } diff --git a/src/mame/drivers/hornet.c b/src/mame/drivers/hornet.c index 3441e13e43a..63859bc48c1 100644 --- a/src/mame/drivers/hornet.c +++ b/src/mame/drivers/hornet.c @@ -393,9 +393,9 @@ static void voodoo_vblank_1(device_t *device, int param) static SCREEN_UPDATE( hornet ) { - hornet_state *state = screen->machine().driver_data(); - device_t *voodoo = screen->machine().device("voodoo0"); - device_t *k037122 = screen->machine().device("k037122_1"); + hornet_state *state = screen.machine().driver_data(); + device_t *voodoo = screen.machine().device("voodoo0"); + device_t *k037122 = screen.machine().device("k037122_1"); voodoo_update(voodoo, bitmap, cliprect); @@ -408,20 +408,20 @@ static SCREEN_UPDATE( hornet ) static SCREEN_UPDATE( hornet_2board ) { - hornet_state *state = screen->machine().driver_data(); - if (strcmp(screen->tag(), "lscreen") == 0) + hornet_state *state = screen.machine().driver_data(); + if (strcmp(screen.tag(), "lscreen") == 0) { - device_t *k037122 = screen->machine().device("k037122_1"); - device_t *voodoo = screen->machine().device("voodoo0"); + device_t *k037122 = screen.machine().device("k037122_1"); + device_t *voodoo = screen.machine().device("voodoo0"); voodoo_update(voodoo, bitmap, cliprect); /* TODO: tilemaps per screen */ k037122_tile_draw(k037122, bitmap, cliprect); } - else if (strcmp(screen->tag(), "rscreen") == 0) + else if (strcmp(screen.tag(), "rscreen") == 0) { - device_t *k037122 = screen->machine().device("k037122_2"); - device_t *voodoo = screen->machine().device("voodoo1"); + device_t *k037122 = screen.machine().device("k037122_2"); + device_t *voodoo = screen.machine().device("voodoo1"); voodoo_update(voodoo, bitmap, cliprect); /* TODO: tilemaps per screen */ diff --git a/src/mame/drivers/hotblock.c b/src/mame/drivers/hotblock.c index 3ca8165d8ff..63036cc2e32 100644 --- a/src/mame/drivers/hotblock.c +++ b/src/mame/drivers/hotblock.c @@ -140,17 +140,17 @@ static VIDEO_START(hotblock) static SCREEN_UPDATE(hotblock) { - hotblock_state *state = screen->machine().driver_data(); + hotblock_state *state = screen.machine().driver_data(); int y, x, count; int i; static const int xxx = 320, yyy = 204; - bitmap_fill(bitmap, 0, get_black_pen(screen->machine())); + bitmap_fill(bitmap, 0, get_black_pen(screen.machine())); for (i = 0; i < 256; i++) { int dat = (state->m_pal[i * 2 + 1] << 8) | state->m_pal[i * 2]; - palette_set_color_rgb(screen->machine(), i, pal5bit(dat >> 0), pal5bit(dat >> 5), pal5bit(dat >> 10)); + palette_set_color_rgb(screen.machine(), i, pal5bit(dat >> 0), pal5bit(dat >> 5), pal5bit(dat >> 10)); } count = 0; diff --git a/src/mame/drivers/hotstuff.c b/src/mame/drivers/hotstuff.c index 17ddf65cafc..7f794401671 100644 --- a/src/mame/drivers/hotstuff.c +++ b/src/mame/drivers/hotstuff.c @@ -22,7 +22,7 @@ VIDEO_START( hotstuff ) SCREEN_UPDATE( hotstuff ) { - hotstuff_state *state = screen->machine().driver_data(); + hotstuff_state *state = screen.machine().driver_data(); int count, y,yyy,x,xxx; UINT16 row_palette_data[0x10]; rgb_t row_palette_data_as_rgb32_pen_data[0x10]; diff --git a/src/mame/drivers/hvyunit.c b/src/mame/drivers/hvyunit.c index da72c1e54d3..dd7dcecc3f6 100644 --- a/src/mame/drivers/hvyunit.c +++ b/src/mame/drivers/hvyunit.c @@ -158,11 +158,11 @@ static SCREEN_UPDATE( hvyunit ) { #define SX_POS 96 #define SY_POS 0 - hvyunit_state *state = screen->machine().driver_data(); + hvyunit_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, ((state->m_port0_data & 0x40) << 2) + state->m_scrollx + SX_POS); // TODO tilemap_set_scrolly(state->m_bg_tilemap, 0, ((state->m_port0_data & 0x80) << 1) + state->m_scrolly + SY_POS); // TODO - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); pandora_update(state->m_pandora, bitmap, cliprect); @@ -171,7 +171,7 @@ static SCREEN_UPDATE( hvyunit ) static SCREEN_EOF( hvyunit ) { - hvyunit_state *state = machine.driver_data(); + hvyunit_state *state = screen.machine().driver_data(); pandora_eof(state->m_pandora); } diff --git a/src/mame/drivers/igs009.c b/src/mame/drivers/igs009.c index 70a575e61ed..0c1a02a0ddd 100644 --- a/src/mame/drivers/igs009.c +++ b/src/mame/drivers/igs009.c @@ -260,16 +260,16 @@ static VIDEO_START(gp98) static SCREEN_UPDATE(jingbell) { - igs009_state *state = screen->machine().driver_data(); + igs009_state *state = screen.machine().driver_data(); int layers_ctrl = state->m_video_enable ? -1 : 0; #ifdef MAME_DEBUG - if (screen->machine().input().code_pressed(KEYCODE_Z)) + if (screen.machine().input().code_pressed(KEYCODE_Z)) { int mask = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) mask |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) mask |= 2; - if (screen->machine().input().code_pressed(KEYCODE_A)) mask |= 4; + if (screen.machine().input().code_pressed(KEYCODE_Q)) mask |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) mask |= 2; + if (screen.machine().input().code_pressed(KEYCODE_A)) mask |= 4; if (mask != 0) layers_ctrl &= mask; } #endif @@ -278,7 +278,7 @@ static SCREEN_UPDATE(jingbell) { int zz,i; int startclipmin = 0; - const rectangle &visarea = screen->visible_area(); + const rectangle &visarea = screen.visible_area(); for (i= 0;i < 0x80;i++) @@ -303,7 +303,7 @@ static SCREEN_UPDATE(jingbell) clip.min_y = startclipmin; clip.max_y = startclipmin+2; - bitmap_fill(bitmap,&clip,screen->machine().pens[rowenable]); + bitmap_fill(bitmap,&clip,screen.machine().pens[rowenable]); if (rowenable==0) { // 0 and 1 are the same? or is there a global switchoff? @@ -327,7 +327,7 @@ static SCREEN_UPDATE(jingbell) } } - else bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + else bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); if (layers_ctrl & 2) tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); diff --git a/src/mame/drivers/igs011.c b/src/mame/drivers/igs011.c index 23140f67801..1230822f165 100644 --- a/src/mame/drivers/igs011.c +++ b/src/mame/drivers/igs011.c @@ -159,7 +159,7 @@ static VIDEO_START( igs011 ) static SCREEN_UPDATE( igs011 ) { - igs011_state *state = screen->machine().driver_data(); + igs011_state *state = screen.machine().driver_data(); #ifdef MAME_DEBUG int layer_enable = -1; #endif @@ -168,17 +168,17 @@ static SCREEN_UPDATE( igs011 ) UINT16 *pri_ram; #ifdef MAME_DEBUG - if (screen->machine().input().code_pressed(KEYCODE_Z)) + if (screen.machine().input().code_pressed(KEYCODE_Z)) { int mask = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) mask |= 0x01; - if (screen->machine().input().code_pressed(KEYCODE_W)) mask |= 0x02; - if (screen->machine().input().code_pressed(KEYCODE_E)) mask |= 0x04; - if (screen->machine().input().code_pressed(KEYCODE_R)) mask |= 0x08; - if (screen->machine().input().code_pressed(KEYCODE_A)) mask |= 0x10; - if (screen->machine().input().code_pressed(KEYCODE_S)) mask |= 0x20; - if (screen->machine().input().code_pressed(KEYCODE_D)) mask |= 0x40; - if (screen->machine().input().code_pressed(KEYCODE_F)) mask |= 0x80; + if (screen.machine().input().code_pressed(KEYCODE_Q)) mask |= 0x01; + if (screen.machine().input().code_pressed(KEYCODE_W)) mask |= 0x02; + if (screen.machine().input().code_pressed(KEYCODE_E)) mask |= 0x04; + if (screen.machine().input().code_pressed(KEYCODE_R)) mask |= 0x08; + if (screen.machine().input().code_pressed(KEYCODE_A)) mask |= 0x10; + if (screen.machine().input().code_pressed(KEYCODE_S)) mask |= 0x20; + if (screen.machine().input().code_pressed(KEYCODE_D)) mask |= 0x40; + if (screen.machine().input().code_pressed(KEYCODE_F)) mask |= 0x80; if (mask) layer_enable &= mask; } #endif @@ -207,7 +207,7 @@ static SCREEN_UPDATE( igs011 ) #ifdef MAME_DEBUG if ((layer_enable != -1) && (pri_addr == 0xff)) - *BITMAP_ADDR16(bitmap, y, x) = get_black_pen(screen->machine()); + *BITMAP_ADDR16(bitmap, y, x) = get_black_pen(screen.machine()); else #endif *BITMAP_ADDR16(bitmap, y, x) = state->m_layer[l][scr_addr] | (l << 8); @@ -2390,9 +2390,9 @@ static READ16_HANDLER( vbowl_unk_r ) static SCREEN_EOF( vbowl ) { - igs011_state *state = machine.driver_data(); + igs011_state *state = screen.machine().driver_data(); state->m_vbowl_trackball[0] = state->m_vbowl_trackball[1]; - state->m_vbowl_trackball[1] = (input_port_read(machine, "AN1") << 8) | input_port_read(machine, "AN0"); + state->m_vbowl_trackball[1] = (input_port_read(screen.machine(), "AN1") << 8) | input_port_read(screen.machine(), "AN0"); } static WRITE16_HANDLER( vbowl_pen_hi_w ) diff --git a/src/mame/drivers/igs017.c b/src/mame/drivers/igs017.c index 02052f7fd1d..00fc26e3a18 100644 --- a/src/mame/drivers/igs017.c +++ b/src/mame/drivers/igs017.c @@ -346,31 +346,31 @@ static int debug_viewer(running_machine &machine, bitmap_t *bitmap,const rectang static SCREEN_UPDATE( igs017 ) { - igs017_state *state = screen->machine().driver_data(); + igs017_state *state = screen.machine().driver_data(); int layers_ctrl = -1; #ifdef MAME_DEBUG - if (screen->machine().input().code_pressed(KEYCODE_Z)) + if (screen.machine().input().code_pressed(KEYCODE_Z)) { int mask = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) mask |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) mask |= 2; - if (screen->machine().input().code_pressed(KEYCODE_A)) mask |= 4; + if (screen.machine().input().code_pressed(KEYCODE_Q)) mask |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) mask |= 2; + if (screen.machine().input().code_pressed(KEYCODE_A)) mask |= 4; if (mask != 0) layers_ctrl &= mask; } #endif - if (debug_viewer(screen->machine(), bitmap,cliprect)) + if (debug_viewer(screen.machine(), bitmap,cliprect)) return 0; - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); if (state->m_video_disable) return 0; if (layers_ctrl & 1) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_OPAQUE, 0); - if (layers_ctrl & 4) draw_sprites(screen->machine(), bitmap, cliprect); + if (layers_ctrl & 4) draw_sprites(screen.machine(), bitmap, cliprect); if (layers_ctrl & 2) tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); diff --git a/src/mame/drivers/igs_m027.c b/src/mame/drivers/igs_m027.c index 8076770e61a..fa04ac7ebdf 100644 --- a/src/mame/drivers/igs_m027.c +++ b/src/mame/drivers/igs_m027.c @@ -165,9 +165,9 @@ static VIDEO_START(igs_majhong) static SCREEN_UPDATE(igs_majhong) { - igs_m027_state *state = screen->machine().driver_data(); + igs_m027_state *state = screen.machine().driver_data(); //?????????? - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); //?????? tilemap_draw(bitmap,cliprect,state->m_igs_bg_tilemap,0,0); diff --git a/src/mame/drivers/igspoker.c b/src/mame/drivers/igspoker.c index f515cf8ecf9..6d88a107270 100644 --- a/src/mame/drivers/igspoker.c +++ b/src/mame/drivers/igspoker.c @@ -179,8 +179,8 @@ static VIDEO_START(igs_video) static SCREEN_UPDATE(igs_video) { - igspoker_state *state = screen->machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + igspoker_state *state = screen.machine().driver_data(); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); // FIX: CSK227IT must have some way to disable background, or wrong gfx? if (state->m_bg_enable) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); @@ -198,7 +198,7 @@ static VIDEO_START(cpokerpk) static SCREEN_UPDATE(cpokerpk) { - igspoker_state *state = screen->machine().driver_data(); + igspoker_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; diff --git a/src/mame/drivers/imolagp.c b/src/mame/drivers/imolagp.c index 25d058459dd..3ae80e99c48 100644 --- a/src/mame/drivers/imolagp.c +++ b/src/mame/drivers/imolagp.c @@ -200,7 +200,7 @@ static VIDEO_START( imolagp ) static SCREEN_UPDATE( imolagp ) { - imolagp_state *state = screen->machine().driver_data(); + imolagp_state *state = screen.machine().driver_data(); int scroll2 = state->m_scroll ^ 0x03; int pass; for (pass = 0; pass < 2; pass++) diff --git a/src/mame/drivers/intrscti.c b/src/mame/drivers/intrscti.c index 8b3f540ed45..033e97de1dc 100644 --- a/src/mame/drivers/intrscti.c +++ b/src/mame/drivers/intrscti.c @@ -68,11 +68,11 @@ static VIDEO_START(intrscti) static SCREEN_UPDATE(intrscti) { - intrscti_state *state = screen->machine().driver_data(); + intrscti_state *state = screen.machine().driver_data(); int y,x; int count; - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); count = 0; for (y=0;y<64;y++) @@ -81,7 +81,7 @@ static SCREEN_UPDATE(intrscti) { int dat; dat = state->m_ram[count]; - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],dat/*+0x100*/,0,0,0,x*8,y*8,0); + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],dat/*+0x100*/,0,0,0,x*8,y*8,0); count++; } } diff --git a/src/mame/drivers/istellar.c b/src/mame/drivers/istellar.c index aa9b8d8ad2a..a359f8fba82 100644 --- a/src/mame/drivers/istellar.c +++ b/src/mame/drivers/istellar.c @@ -48,7 +48,7 @@ public: /* VIDEO GOODS */ static SCREEN_UPDATE( istellar ) { - istellar_state *state = screen->machine().driver_data(); + istellar_state *state = screen.machine().driver_data(); int charx, chary; /* clear */ @@ -70,7 +70,7 @@ static SCREEN_UPDATE( istellar ) { int current_screen_character = (chary*32) + charx; - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], state->m_tile_ram[current_screen_character], (state->m_tile_control_ram[current_screen_character] & 0x0f), 0, 0, charx*8, chary*8, 0); diff --git a/src/mame/drivers/itgambl2.c b/src/mame/drivers/itgambl2.c index 1127ecf37bd..5b877ab2fc8 100644 --- a/src/mame/drivers/itgambl2.c +++ b/src/mame/drivers/itgambl2.c @@ -84,37 +84,37 @@ static VIDEO_START( itgambl2 ) /* (dirty) debug code for looking 8bpps blitter-based gfxs */ static SCREEN_UPDATE( itgambl2 ) { - itgambl2_state *state = screen->machine().driver_data(); + itgambl2_state *state = screen.machine().driver_data(); int x,y,count; - const UINT8 *blit_ram = screen->machine().region("gfx1")->base(); + const UINT8 *blit_ram = screen.machine().region("gfx1")->base(); - if(screen->machine().input().code_pressed(KEYCODE_Z)) + if(screen.machine().input().code_pressed(KEYCODE_Z)) state->m_test_x++; - if(screen->machine().input().code_pressed(KEYCODE_X)) + if(screen.machine().input().code_pressed(KEYCODE_X)) state->m_test_x--; - if(screen->machine().input().code_pressed(KEYCODE_A)) + if(screen.machine().input().code_pressed(KEYCODE_A)) state->m_test_y++; - if(screen->machine().input().code_pressed(KEYCODE_S)) + if(screen.machine().input().code_pressed(KEYCODE_S)) state->m_test_y--; - if(screen->machine().input().code_pressed(KEYCODE_Q)) + if(screen.machine().input().code_pressed(KEYCODE_Q)) state->m_start_offs+=0x200; - if(screen->machine().input().code_pressed(KEYCODE_W)) + if(screen.machine().input().code_pressed(KEYCODE_W)) state->m_start_offs-=0x200; - if(screen->machine().input().code_pressed(KEYCODE_E)) + if(screen.machine().input().code_pressed(KEYCODE_E)) state->m_start_offs++; - if(screen->machine().input().code_pressed(KEYCODE_R)) + if(screen.machine().input().code_pressed(KEYCODE_R)) state->m_start_offs--; popmessage("%d %d %04x",state->m_test_x,state->m_test_y,state->m_start_offs); - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); count = (state->m_start_offs); @@ -126,8 +126,8 @@ static SCREEN_UPDATE( itgambl2 ) color = (blit_ram[count] & 0xff)>>0; - if((x)visible_area().max_x && ((y)+0)visible_area().max_y) - *BITMAP_ADDR32(bitmap, y, x) = screen->machine().pens[color]; + if((x)machine().driver_data(); + itgambl3_state *state = screen.machine().driver_data(); int x,y,count; - const UINT8 *blit_ram = screen->machine().region("gfx1")->base(); + const UINT8 *blit_ram = screen.machine().region("gfx1")->base(); - if(screen->machine().input().code_pressed(KEYCODE_Z)) + if(screen.machine().input().code_pressed(KEYCODE_Z)) state->m_test_x++; - if(screen->machine().input().code_pressed(KEYCODE_X)) + if(screen.machine().input().code_pressed(KEYCODE_X)) state->m_test_x--; - if(screen->machine().input().code_pressed(KEYCODE_A)) + if(screen.machine().input().code_pressed(KEYCODE_A)) state->m_test_y++; - if(screen->machine().input().code_pressed(KEYCODE_S)) + if(screen.machine().input().code_pressed(KEYCODE_S)) state->m_test_y--; - if(screen->machine().input().code_pressed(KEYCODE_Q)) + if(screen.machine().input().code_pressed(KEYCODE_Q)) state->m_start_offs+=0x200; - if(screen->machine().input().code_pressed(KEYCODE_W)) + if(screen.machine().input().code_pressed(KEYCODE_W)) state->m_start_offs-=0x200; - if(screen->machine().input().code_pressed(KEYCODE_E)) + if(screen.machine().input().code_pressed(KEYCODE_E)) state->m_start_offs++; - if(screen->machine().input().code_pressed(KEYCODE_R)) + if(screen.machine().input().code_pressed(KEYCODE_R)) state->m_start_offs--; popmessage("%d %d %04x",state->m_test_x,state->m_test_y,state->m_start_offs); - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); count = (state->m_start_offs); @@ -114,8 +114,8 @@ static SCREEN_UPDATE( itgambl3 ) color = (blit_ram[count] & 0xff)>>0; - if((x)visible_area().max_x && ((y)+0)visible_area().max_y) - *BITMAP_ADDR32(bitmap, y, x) = screen->machine().pens[color]; + if((x)machine().driver_data(); + jackie_state *state = screen.machine().driver_data(); int i,j; int startclipmin = 0; - const rectangle &visarea = screen->visible_area(); + const rectangle &visarea = screen.visible_area(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); for (i=0;i < 0x40;i++) { diff --git a/src/mame/drivers/jackpool.c b/src/mame/drivers/jackpool.c index 633110ee45c..543a40f04de 100644 --- a/src/mame/drivers/jackpool.c +++ b/src/mame/drivers/jackpool.c @@ -39,8 +39,8 @@ static VIDEO_START(jackpool) static SCREEN_UPDATE(jackpool) { - jackpool_state *state = screen->machine().driver_data(); - const gfx_element *gfx = screen->machine().gfx[0]; + jackpool_state *state = screen.machine().driver_data(); + const gfx_element *gfx = screen.machine().gfx[0]; int count;// = 0x00000/2; int y,x; diff --git a/src/mame/drivers/jalmah.c b/src/mame/drivers/jalmah.c index 5d8695aa38d..406c8784762 100644 --- a/src/mame/drivers/jalmah.c +++ b/src/mame/drivers/jalmah.c @@ -397,10 +397,10 @@ static void draw_sc3_layer(running_machine &machine, bitmap_t *bitmap, const rec static SCREEN_UPDATE( jalmah ) { - jalmah_state *state = screen->machine().driver_data(); + jalmah_state *state = screen.machine().driver_data(); UINT16 *jm_scrollram = state->m_jm_scrollram; UINT8 cur_prin; - jalmah_priority_system(screen->machine()); + jalmah_priority_system(screen.machine()); tilemap_set_scrollx(state->m_sc0_tilemap_0, 0, jm_scrollram[0] & 0xfff); tilemap_set_scrollx(state->m_sc0_tilemap_1, 0, jm_scrollram[0] & 0x7ff); @@ -443,14 +443,14 @@ static SCREEN_UPDATE( jalmah ) tilemap_set_scrolly(state->m_sc3_tilemap_2, 0, jm_scrollram[7] & 0x1ff); tilemap_set_scrolly(state->m_sc3_tilemap_3, 0, jm_scrollram[7] & 0x3ff); - bitmap_fill(bitmap, cliprect, screen->machine().pens[0xff]); //selectable by a ram address? + bitmap_fill(bitmap, cliprect, screen.machine().pens[0xff]); //selectable by a ram address? for(cur_prin=1;cur_prin<=0x8;cur_prin<<=1) { - if(cur_prin==state->m_sc0_prin) { draw_sc0_layer(screen->machine(),bitmap,cliprect); } - if(cur_prin==state->m_sc1_prin) { draw_sc1_layer(screen->machine(),bitmap,cliprect); } - if(cur_prin==state->m_sc2_prin) { draw_sc2_layer(screen->machine(),bitmap,cliprect); } - if(cur_prin==state->m_sc3_prin) { draw_sc3_layer(screen->machine(),bitmap,cliprect); } + if(cur_prin==state->m_sc0_prin) { draw_sc0_layer(screen.machine(),bitmap,cliprect); } + if(cur_prin==state->m_sc1_prin) { draw_sc1_layer(screen.machine(),bitmap,cliprect); } + if(cur_prin==state->m_sc2_prin) { draw_sc2_layer(screen.machine(),bitmap,cliprect); } + if(cur_prin==state->m_sc3_prin) { draw_sc3_layer(screen.machine(),bitmap,cliprect); } } return 0; @@ -458,7 +458,7 @@ static SCREEN_UPDATE( jalmah ) static SCREEN_UPDATE( urashima ) { - jalmah_state *state = screen->machine().driver_data(); + jalmah_state *state = screen.machine().driver_data(); UINT16 *jm_scrollram = state->m_jm_scrollram; /*this game doesn't use the RANGE register at all.*/ tilemap_set_scrollx(state->m_sc0_tilemap_0, 0, jm_scrollram[0]); @@ -466,7 +466,7 @@ static SCREEN_UPDATE( urashima ) tilemap_set_scrolly(state->m_sc0_tilemap_0, 0, jm_scrollram[4]); tilemap_set_scrolly(state->m_sc3_tilemap_0, 0, jm_scrollram[7]); - bitmap_fill(bitmap, cliprect, screen->machine().pens[0x1ff]);//selectable by a ram address? + bitmap_fill(bitmap, cliprect, screen.machine().pens[0x1ff]);//selectable by a ram address? if(state->m_jm_vregs[0] & 1) { tilemap_draw(bitmap,cliprect,state->m_sc0_tilemap_0,0,0); } if(state->m_jm_vregs[3] & 1) { tilemap_draw(bitmap,cliprect,state->m_sc3_tilemap_0,0,0); } return 0; diff --git a/src/mame/drivers/jangou.c b/src/mame/drivers/jangou.c index ddc4cd22d2f..7c6873baf09 100644 --- a/src/mame/drivers/jangou.c +++ b/src/mame/drivers/jangou.c @@ -122,7 +122,7 @@ static VIDEO_START( jangou ) static SCREEN_UPDATE( jangou ) { - jangou_state *state = screen->machine().driver_data(); + jangou_state *state = screen.machine().driver_data(); int x, y; for (y = cliprect->min_y; y <= cliprect->max_y; ++y) @@ -133,8 +133,8 @@ static SCREEN_UPDATE( jangou ) for (x = cliprect->min_x; x <= cliprect->max_x; x += 2) { UINT32 srcpix = *src++; - *dst++ = screen->machine().pens[srcpix & 0xf]; - *dst++ = screen->machine().pens[(srcpix >> 4) & 0xf]; + *dst++ = screen.machine().pens[srcpix & 0xf]; + *dst++ = screen.machine().pens[(srcpix >> 4) & 0xf]; } } diff --git a/src/mame/drivers/jantotsu.c b/src/mame/drivers/jantotsu.c index 094ffe316ea..a3b8046387c 100644 --- a/src/mame/drivers/jantotsu.c +++ b/src/mame/drivers/jantotsu.c @@ -137,7 +137,7 @@ static VIDEO_START(jantotsu) static SCREEN_UPDATE(jantotsu) { - jantotsu_state *state = screen->machine().driver_data(); + jantotsu_state *state = screen.machine().driver_data(); int x, y, i; int count = 0; UINT8 pen_i; @@ -158,8 +158,8 @@ static SCREEN_UPDATE(jantotsu) for(pen_i = 0;pen_i<4;pen_i++) color |= (((state->m_bitmap[count + pen_i*0x2000]) >> (7 - i)) & 1) << pen_i; - if ((x + i) <= screen->visible_area().max_x && (y + 0) < screen->visible_area().max_y) - *BITMAP_ADDR32(bitmap, y, x + i) = screen->machine().pens[color]; + if ((x + i) <= screen.visible_area().max_x && (y + 0) < screen.visible_area().max_y) + *BITMAP_ADDR32(bitmap, y, x + i) = screen.machine().pens[color]; } count++; diff --git a/src/mame/drivers/jchan.c b/src/mame/drivers/jchan.c index 3d56c96785c..d057c7ac338 100644 --- a/src/mame/drivers/jchan.c +++ b/src/mame/drivers/jchan.c @@ -360,7 +360,7 @@ static VIDEO_START(jchan) static SCREEN_UPDATE(jchan) { - jchan_state *state = screen->machine().driver_data(); + jchan_state *state = screen.machine().driver_data(); int x,y; UINT16* src1; UINT16* src2; @@ -368,15 +368,15 @@ static SCREEN_UPDATE(jchan) UINT16 pixdata1; UINT16 pixdata2; - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); SCREEN_UPDATE_CALL(jchan_view2); bitmap_fill(state->m_sprite_bitmap_1, cliprect, 0x0000); bitmap_fill(state->m_sprite_bitmap_2, cliprect, 0x0000); - state->m_spritegen1->skns_draw_sprites(screen->machine(), state->m_sprite_bitmap_1, cliprect, state->m_sprite_ram32_1, 0x4000, screen->machine().region("gfx1")->base(), screen->machine().region ("gfx1")->bytes(), state->m_sprite_regs32_1 ); - state->m_spritegen2->skns_draw_sprites(screen->machine(), state->m_sprite_bitmap_2, cliprect, state->m_sprite_ram32_2, 0x4000, screen->machine().region("gfx2")->base(), screen->machine().region ("gfx2")->bytes(), state->m_sprite_regs32_2 ); + state->m_spritegen1->skns_draw_sprites(screen.machine(), state->m_sprite_bitmap_1, cliprect, state->m_sprite_ram32_1, 0x4000, screen.machine().region("gfx1")->base(), screen.machine().region ("gfx1")->bytes(), state->m_sprite_regs32_1 ); + state->m_spritegen2->skns_draw_sprites(screen.machine(), state->m_sprite_bitmap_2, cliprect, state->m_sprite_ram32_2, 0x4000, screen.machine().region("gfx2")->base(), screen.machine().region ("gfx2")->bytes(), state->m_sprite_regs32_2 ); // ignoring priority bits for now - might use alpha too, check 0x8000 of palette writes for (y=0;y<240;y++) diff --git a/src/mame/drivers/jokrwild.c b/src/mame/drivers/jokrwild.c index 9faa2ed480d..b6bbf0df6a9 100644 --- a/src/mame/drivers/jokrwild.c +++ b/src/mame/drivers/jokrwild.c @@ -155,7 +155,7 @@ static VIDEO_START( jokrwild ) static SCREEN_UPDATE( jokrwild ) { - jokrwild_state *state = screen->machine().driver_data(); + jokrwild_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/jollyjgr.c b/src/mame/drivers/jollyjgr.c index c07c3ef4b50..0d8f17af47d 100644 --- a/src/mame/drivers/jollyjgr.c +++ b/src/mame/drivers/jollyjgr.c @@ -484,7 +484,7 @@ static void draw_bitmap( running_machine &machine, bitmap_t *bitmap ) static SCREEN_UPDATE( jollyjgr ) { - jollyjgr_state *state = screen->machine().driver_data(); + jollyjgr_state *state = screen.machine().driver_data(); UINT8 *spriteram = state->m_spriteram; int offs; @@ -493,7 +493,7 @@ static SCREEN_UPDATE( jollyjgr ) if(state->m_pri) //used in Frog & Spiders level 3 { if(!(state->m_bitmap_disable)) - draw_bitmap(screen->machine(), bitmap); + draw_bitmap(screen.machine(), bitmap); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); } @@ -502,7 +502,7 @@ static SCREEN_UPDATE( jollyjgr ) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); if(!(state->m_bitmap_disable)) - draw_bitmap(screen->machine(), bitmap); + draw_bitmap(screen.machine(), bitmap); } /* Sprites are the same as in Galaxian */ @@ -529,7 +529,7 @@ static SCREEN_UPDATE( jollyjgr ) if (offs < 3 * 4) sy++; - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1], code,color, flipx,flipy, sx,sy,0); @@ -540,7 +540,7 @@ static SCREEN_UPDATE( jollyjgr ) static SCREEN_UPDATE( fspider ) { - jollyjgr_state *state = screen->machine().driver_data(); + jollyjgr_state *state = screen.machine().driver_data(); // Draw bg and sprites SCREEN_UPDATE_CALL(jollyjgr); diff --git a/src/mame/drivers/jongkyo.c b/src/mame/drivers/jongkyo.c index 4339acdd5ec..b2c42584cc5 100644 --- a/src/mame/drivers/jongkyo.c +++ b/src/mame/drivers/jongkyo.c @@ -61,7 +61,7 @@ static VIDEO_START( jongkyo ) static SCREEN_UPDATE( jongkyo ) { - jongkyo_state *state = screen->machine().driver_data(); + jongkyo_state *state = screen.machine().driver_data(); int y; for (y = 0; y < 256; ++y) diff --git a/src/mame/drivers/jpmsys5.c b/src/mame/drivers/jpmsys5.c index c60ad63509e..7f0e0aa9afa 100644 --- a/src/mame/drivers/jpmsys5.c +++ b/src/mame/drivers/jpmsys5.c @@ -199,7 +199,7 @@ static SCREEN_UPDATE( jpmsys5v ) if (state.blanked) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } @@ -213,8 +213,8 @@ static SCREEN_UPDATE( jpmsys5v ) UINT8 pen = src[(x-cliprect->min_x)>>1]; /* Draw two 4-bit pixels */ - *dest++ = screen->machine().pens[(pen >> 4) & 0xf]; - *dest++ = screen->machine().pens[pen & 0xf]; + *dest++ = screen.machine().pens[(pen >> 4) & 0xf]; + *dest++ = screen.machine().pens[pen & 0xf]; } } diff --git a/src/mame/drivers/jubilee.c b/src/mame/drivers/jubilee.c index d43158bf0b3..926a13fbea7 100644 --- a/src/mame/drivers/jubilee.c +++ b/src/mame/drivers/jubilee.c @@ -133,7 +133,7 @@ static VIDEO_START( jubileep ) static SCREEN_UPDATE( jubileep ) { - jubilee_state *state = screen->machine().driver_data(); + jubilee_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/kingdrby.c b/src/mame/drivers/kingdrby.c index 7413338d80f..10788795ccd 100644 --- a/src/mame/drivers/kingdrby.c +++ b/src/mame/drivers/kingdrby.c @@ -212,8 +212,8 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta static SCREEN_UPDATE(kingdrby) { - kingdrby_state *state = screen->machine().driver_data(); - const rectangle &visarea = screen->visible_area(); + kingdrby_state *state = screen.machine().driver_data(); + const rectangle &visarea = screen.visible_area(); rectangle clip; tilemap_set_scrollx( state->m_sc0_tilemap,0, state->m_vram[0x342]); tilemap_set_scrolly( state->m_sc0_tilemap,0, state->m_vram[0x341]); @@ -229,7 +229,7 @@ static SCREEN_UPDATE(kingdrby) /*TILEMAP_DRAW_CATEGORY + TILEMAP_DRAW_OPAQUE doesn't suit well?*/ tilemap_draw(bitmap,cliprect,state->m_sc0_tilemap,0,0); - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_sc1_tilemap,TILEMAP_DRAW_CATEGORY(1),0); tilemap_draw(bitmap,&clip,state->m_sc0w_tilemap,0,0); diff --git a/src/mame/drivers/kingpin.c b/src/mame/drivers/kingpin.c index fefdd75c67e..a23874c41a6 100644 --- a/src/mame/drivers/kingpin.c +++ b/src/mame/drivers/kingpin.c @@ -146,7 +146,7 @@ static TMS9928A_INTERFACE(kingpin_tms9928a_interface) static SCREEN_UPDATE( kingpin ) { - tms9928a_device *tms9928a = screen->machine().device( "tms9928a" ); + tms9928a_device *tms9928a = screen.machine().device( "tms9928a" ); tms9928a->update( bitmap, cliprect ); return 0; diff --git a/src/mame/drivers/kinst.c b/src/mame/drivers/kinst.c index 501aa8fa60b..b0295f5c12e 100644 --- a/src/mame/drivers/kinst.c +++ b/src/mame/drivers/kinst.c @@ -232,7 +232,7 @@ static MACHINE_RESET( kinst ) static SCREEN_UPDATE( kinst ) { - kinst_state *state = screen->machine().driver_data(); + kinst_state *state = screen.machine().driver_data(); int y; /* loop over rows and copy to the destination */ diff --git a/src/mame/drivers/koftball.c b/src/mame/drivers/koftball.c index c3dc3f626e1..5ff8e1d8c35 100644 --- a/src/mame/drivers/koftball.c +++ b/src/mame/drivers/koftball.c @@ -87,7 +87,7 @@ static VIDEO_START( koftball ) static SCREEN_UPDATE( koftball ) { - koftball_state *state = screen->machine().driver_data(); + koftball_state *state = screen.machine().driver_data(); tilemap_draw( bitmap, cliprect, state->m_tilemap_2, 0, 0); tilemap_draw( bitmap, cliprect, state->m_tilemap_1, 0, 0); return 0; diff --git a/src/mame/drivers/koikoi.c b/src/mame/drivers/koikoi.c index 0ea9eab3b41..81c87533b3d 100644 --- a/src/mame/drivers/koikoi.c +++ b/src/mame/drivers/koikoi.c @@ -134,7 +134,7 @@ static VIDEO_START(koikoi) static SCREEN_UPDATE(koikoi) { - koikoi_state *state = screen->machine().driver_data(); + koikoi_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_tmap, 0, 0); return 0; } diff --git a/src/mame/drivers/konamigx.c b/src/mame/drivers/konamigx.c index 80aacd0bdf7..b1b8f84a252 100644 --- a/src/mame/drivers/konamigx.c +++ b/src/mame/drivers/konamigx.c @@ -1895,13 +1895,14 @@ static MACHINE_CONFIG_DERIVED( gxtype3, konamigx ) MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_SIZE(576, 264) MCFG_SCREEN_VISIBLE_AREA(0, 576-1, 16, 32*8-1-16) + MCFG_SCREEN_UPDATE(konamigx_left) MCFG_SCREEN_ADD("screen2", RASTER) MCFG_SCREEN_RAW_PARAMS(6000000, 288+16+32+48, 0, 287, 224+16+8+16, 0, 223) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) MCFG_SCREEN_SIZE(576, 264) MCFG_SCREEN_VISIBLE_AREA(0, 576-1, 16, 32*8-1-16) - MCFG_SCREEN_UPDATE(konamigx) + MCFG_SCREEN_UPDATE(konamigx_right) MCFG_GFXDECODE(type34) MACHINE_CONFIG_END @@ -1920,13 +1921,14 @@ static MACHINE_CONFIG_DERIVED( gxtype4, konamigx ) MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_SIZE(128*8, 264) MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 16, 32*8-1-16) + MCFG_SCREEN_UPDATE(konamigx_left) MCFG_SCREEN_ADD("screen2", RASTER) MCFG_SCREEN_RAW_PARAMS(6000000, 288+16+32+48, 0, 287, 224+16+8+16, 0, 223) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) MCFG_SCREEN_SIZE(128*8, 264) MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 16, 32*8-1-16) - MCFG_SCREEN_UPDATE(konamigx) + MCFG_SCREEN_UPDATE(konamigx_right) MCFG_PALETTE_LENGTH(8192) MCFG_GFXDECODE(type4) diff --git a/src/mame/drivers/konamim2.c b/src/mame/drivers/konamim2.c index e25b2f9f24a..539f54d64a9 100644 --- a/src/mame/drivers/konamim2.c +++ b/src/mame/drivers/konamim2.c @@ -235,7 +235,7 @@ static VIDEO_START( m2 ) static SCREEN_UPDATE( m2 ) { - konamim2_state *state = screen->machine().driver_data(); + konamim2_state *state = screen.machine().driver_data(); int i, j; UINT32 fb_start = 0xffffffff; diff --git a/src/mame/drivers/kongambl.c b/src/mame/drivers/kongambl.c index f604e9a7b25..fe58c364f7e 100644 --- a/src/mame/drivers/kongambl.c +++ b/src/mame/drivers/kongambl.c @@ -41,10 +41,10 @@ static VIDEO_START(kongambl) static SCREEN_UPDATE(kongambl) { - device_t *k056832 = screen->machine().device("k056832"); + device_t *k056832 = screen.machine().device("k056832"); bitmap_fill(bitmap, cliprect, 0); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); // k056832_tilemap_draw(k056832, bitmap, cliprect, 3, 0, 0); // k056832_tilemap_draw(k056832, bitmap, cliprect, 2, 0, 0); diff --git a/src/mame/drivers/kungfur.c b/src/mame/drivers/kungfur.c index e9168c6473e..18449598bd6 100644 --- a/src/mame/drivers/kungfur.c +++ b/src/mame/drivers/kungfur.c @@ -120,7 +120,7 @@ static void draw_led(bitmap_t *bitmap, int x, int y,UINT8 value) /* actually debugging purpose, it will be converted to the artwork system at some point. */ static SCREEN_UPDATE( kungfur ) { - kungfur_state *state = screen->machine().driver_data(); + kungfur_state *state = screen.machine().driver_data(); // popmessage("%02x %02x %02x %02x %02x %02x",io_data[0],io_data[1],io_data[2],io_data[3],io_data[4],io_data[5]); int i; diff --git a/src/mame/drivers/laserbas.c b/src/mame/drivers/laserbas.c index b43479b92c0..9b58271dce4 100644 --- a/src/mame/drivers/laserbas.c +++ b/src/mame/drivers/laserbas.c @@ -62,7 +62,7 @@ static VIDEO_START(laserbas) static SCREEN_UPDATE(laserbas) { - laserbas_state *state = screen->machine().driver_data(); + laserbas_state *state = screen.machine().driver_data(); int x, y; for (y = 0; y < 256; y++) diff --git a/src/mame/drivers/laserbat.c b/src/mame/drivers/laserbat.c index 0ac93f546ae..9e9ca48408a 100644 --- a/src/mame/drivers/laserbat.c +++ b/src/mame/drivers/laserbat.c @@ -505,7 +505,7 @@ static VIDEO_START( laserbat ) static SCREEN_UPDATE( laserbat ) { - laserbat_state *state = screen->machine().driver_data(); + laserbat_state *state = screen.machine().driver_data(); int y; bitmap_t *s2636_1_bitmap; bitmap_t *s2636_2_bitmap; @@ -541,7 +541,7 @@ static SCREEN_UPDATE( laserbat ) } if (state->m_sprite_enable) - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1], state->m_sprite_code, state->m_sprite_color, 0,0, diff --git a/src/mame/drivers/lastfght.c b/src/mame/drivers/lastfght.c index b44990c3a07..b4be67c2d87 100644 --- a/src/mame/drivers/lastfght.c +++ b/src/mame/drivers/lastfght.c @@ -124,30 +124,30 @@ static VIDEO_START( lastfght ) static SCREEN_UPDATE( lastfght ) { - lastfght_state *state = screen->machine().driver_data(); + lastfght_state *state = screen.machine().driver_data(); #ifdef MAME_DEBUG #if 1 // gfx roms viewer (toggle with enter, use pgup/down to browse) int x, y, count = 0; - UINT8 *gfxdata = screen->machine().region("gfx1")->base(); + UINT8 *gfxdata = screen.machine().region("gfx1")->base(); UINT8 data; - if (screen->machine().input().code_pressed_once(KEYCODE_ENTER)) state->m_view_roms ^= 1; + if (screen.machine().input().code_pressed_once(KEYCODE_ENTER)) state->m_view_roms ^= 1; if (state->m_view_roms) { - if (screen->machine().input().code_pressed_once(KEYCODE_PGDN)) state->m_base += 512 * 256; - if (screen->machine().input().code_pressed_once(KEYCODE_PGUP)) state->m_base -= 512 * 256; - state->m_base %= screen->machine().region("gfx1")->bytes(); + if (screen.machine().input().code_pressed_once(KEYCODE_PGDN)) state->m_base += 512 * 256; + if (screen.machine().input().code_pressed_once(KEYCODE_PGUP)) state->m_base -= 512 * 256; + state->m_base %= screen.machine().region("gfx1")->bytes(); count = state->m_base; - bitmap_fill(bitmap, cliprect , get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect , get_black_pen(screen.machine())); for (y = 0 ; y < 256; y++) { for (x = 0; x < 512; x++) { - data = (((count & 0xf) == 0) && ((count & 0x1e00) == 0)) ? get_white_pen(screen->machine()) : gfxdata[count]; // white grid or data + data = (((count & 0xf) == 0) && ((count & 0x1e00) == 0)) ? get_white_pen(screen.machine()) : gfxdata[count]; // white grid or data *BITMAP_ADDR16(bitmap, y, x) = data; count++; } diff --git a/src/mame/drivers/lgp.c b/src/mame/drivers/lgp.c index ed0bc74ff98..55d41586c47 100644 --- a/src/mame/drivers/lgp.c +++ b/src/mame/drivers/lgp.c @@ -90,11 +90,11 @@ public: /* VIDEO GOODS */ static SCREEN_UPDATE( lgp ) { - lgp_state *state = screen->machine().driver_data(); + lgp_state *state = screen.machine().driver_data(); int charx, chary; /* make color 0 transparent */ - palette_set_color(screen->machine(), 0, MAKE_ARGB(0,0,0,0)); + palette_set_color(screen.machine(), 0, MAKE_ARGB(0,0,0,0)); /* clear */ bitmap_fill(bitmap, cliprect, 0); @@ -108,7 +108,7 @@ static SCREEN_UPDATE( lgp ) /* Somewhere there's a flag that offsets the tilemap by 0x100*x */ /* Palette is likely set somewhere as well (tile_control_ram?) */ - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], state->m_tile_ram[current_screen_character], 0, 0, 0, charx*8, chary*8, 0); diff --git a/src/mame/drivers/limenko.c b/src/mame/drivers/limenko.c index 234daabbcf7..0f5cfcf4845 100644 --- a/src/mame/drivers/limenko.c +++ b/src/mame/drivers/limenko.c @@ -457,10 +457,10 @@ static VIDEO_START( limenko ) static SCREEN_UPDATE( limenko ) { - limenko_state *state = screen->machine().driver_data(); + limenko_state *state = screen.machine().driver_data(); // state->m_videoreg[4] ???? It always has this value: 0xffeffff8 (2 signed bytes? values: -17 and -8 ?) - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); tilemap_set_enable(state->m_bg_tilemap, state->m_videoreg[0] & 4); tilemap_set_enable(state->m_md_tilemap, state->m_videoreg[0] & 2); @@ -479,7 +479,7 @@ static SCREEN_UPDATE( limenko ) tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,1); if(state->m_videoreg[0] & 8) - copy_sprites(screen->machine(), bitmap, state->m_sprites_bitmap, screen->machine().priority_bitmap, cliprect); + copy_sprites(screen.machine(), bitmap, state->m_sprites_bitmap, screen.machine().priority_bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/littlerb.c b/src/mame/drivers/littlerb.c index 5963abdb5c8..f2b117e6d6c 100644 --- a/src/mame/drivers/littlerb.c +++ b/src/mame/drivers/littlerb.c @@ -444,12 +444,12 @@ static void draw_sprite(running_machine &machine, bitmap_t *bitmap, int xsize,in /* sprite format / offset could be completely wrong, this is just based on our (currently incorrect) vram access */ static SCREEN_UPDATE(littlerb) { - littlerb_state *state = screen->machine().driver_data(); + littlerb_state *state = screen.machine().driver_data(); int x,y,offs, code; int xsize,ysize; int pal; UINT16* spriteregion = &state->m_region4[0x400]; - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); //printf("frame\n"); /* the spriteram format is something like this .. */ for (offs=0x26/2;offs<0xc00;offs+=6) // start at 00x26? @@ -468,7 +468,7 @@ static SCREEN_UPDATE(littlerb) //if (code!=0) printf("%04x %04x %04x %04x %04x %04x\n", spriteregion[offs+0], spriteregion[offs+1], spriteregion[offs+2], spriteregion[offs+3], spriteregion[offs+4], spriteregion[offs+5]); - draw_sprite(screen->machine(),bitmap,xsize,ysize,code,x-8,y-16, pal); + draw_sprite(screen.machine(),bitmap,xsize,ysize,code,x-8,y-16, pal); } return 0; diff --git a/src/mame/drivers/looping.c b/src/mame/drivers/looping.c index dea7279ccbf..6532cba10ed 100644 --- a/src/mame/drivers/looping.c +++ b/src/mame/drivers/looping.c @@ -281,10 +281,10 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta static SCREEN_UPDATE( looping ) { - looping_state *state = screen->machine().driver_data(); + looping_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/ltcasino.c b/src/mame/drivers/ltcasino.c index 5173ac4c76a..d1026995e06 100644 --- a/src/mame/drivers/ltcasino.c +++ b/src/mame/drivers/ltcasino.c @@ -634,7 +634,7 @@ GFXDECODE_END static SCREEN_UPDATE(ltcasino) { - ltcasino_state *state = screen->machine().driver_data(); + ltcasino_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_tilemap,0,0); return 0; } diff --git a/src/mame/drivers/luckgrln.c b/src/mame/drivers/luckgrln.c index 2c7b381d628..1c86afa6f44 100644 --- a/src/mame/drivers/luckgrln.c +++ b/src/mame/drivers/luckgrln.c @@ -263,10 +263,10 @@ static VIDEO_START(luckgrln) static SCREEN_UPDATE(luckgrln) { - luckgrln_state *state = screen->machine().driver_data(); + luckgrln_state *state = screen.machine().driver_data(); int y,x; int count = 0; - const rectangle &visarea = screen->visible_area(); + const rectangle &visarea = screen.visible_area(); int i; rectangle clip; @@ -341,10 +341,10 @@ static SCREEN_UPDATE(luckgrln) if (bgenable==3) tilemap_draw(bitmap, &clip, state->m_reel4_tilemap, 0, 0); } - if (tileattr&0x08) drawgfx_transpen(bitmap,clip,screen->machine().gfx[region],tile,col,0,0,x*8,y*8, 0); + if (tileattr&0x08) drawgfx_transpen(bitmap,clip,screen.machine().gfx[region],tile,col,0,0,x*8,y*8, 0); #else // treat it as priority flag instead (looks better in non-adult title screen - needs verifying) - if (!(tileattr&0x08)) drawgfx_transpen(bitmap,&clip,screen->machine().gfx[region],tile,col,0,0,x*8,y*8, 0); + if (!(tileattr&0x08)) drawgfx_transpen(bitmap,&clip,screen.machine().gfx[region],tile,col,0,0,x*8,y*8, 0); if (tileattr&0x04) { @@ -354,7 +354,7 @@ static SCREEN_UPDATE(luckgrln) if (bgenable==3) tilemap_draw(bitmap, &clip, state->m_reel4_tilemap, 0, 0); } - if ((tileattr&0x08)) drawgfx_transpen(bitmap,&clip,screen->machine().gfx[region],tile,col,0,0,x*8,y*8, 0); + if ((tileattr&0x08)) drawgfx_transpen(bitmap,&clip,screen.machine().gfx[region],tile,col,0,0,x*8,y*8, 0); #endif count++; diff --git a/src/mame/drivers/m14.c b/src/mame/drivers/m14.c index b8f052a54ff..872f3de7e5f 100644 --- a/src/mame/drivers/m14.c +++ b/src/mame/drivers/m14.c @@ -122,7 +122,7 @@ static VIDEO_START( m14 ) static SCREEN_UPDATE( m14 ) { - m14_state *state = screen->machine().driver_data(); + m14_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_m14_tilemap, 0, 0); return 0; diff --git a/src/mame/drivers/m63.c b/src/mame/drivers/m63.c index ea85d27b15d..46afd00aff3 100644 --- a/src/mame/drivers/m63.c +++ b/src/mame/drivers/m63.c @@ -340,7 +340,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect static SCREEN_UPDATE( m63 ) { - m63_state *state = screen->machine().driver_data(); + m63_state *state = screen.machine().driver_data(); int col; @@ -348,7 +348,7 @@ static SCREEN_UPDATE( m63 ) tilemap_set_scrolly(state->m_bg_tilemap, col, state->m_scrollram[col * 8]); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/m79amb.c b/src/mame/drivers/m79amb.c index ddec2c4e645..596437d5c86 100644 --- a/src/mame/drivers/m79amb.c +++ b/src/mame/drivers/m79amb.c @@ -82,7 +82,7 @@ static WRITE8_HANDLER( ramtek_videoram_w ) static SCREEN_UPDATE( ramtek ) { - m79amb_state *state = screen->machine().driver_data(); + m79amb_state *state = screen.machine().driver_data(); offs_t offs; for (offs = 0; offs < 0x2000; offs++) diff --git a/src/mame/drivers/magic10.c b/src/mame/drivers/magic10.c index 751f4c6a27f..67fde5bf315 100644 --- a/src/mame/drivers/magic10.c +++ b/src/mame/drivers/magic10.c @@ -185,7 +185,7 @@ static VIDEO_START( magic10 ) static SCREEN_UPDATE( magic10 ) { - magic10_state *state = screen->machine().driver_data(); + magic10_state *state = screen.machine().driver_data(); /*TODO: understand where this comes from. */ tilemap_set_scrollx(state->m_layer2_tilemap, 0, state->m_layer2_offset[0]); tilemap_set_scrolly(state->m_layer2_tilemap, 0, state->m_layer2_offset[1]); diff --git a/src/mame/drivers/magicard.c b/src/mame/drivers/magicard.c index c9415ba484b..2ff38f7a47d 100644 --- a/src/mame/drivers/magicard.c +++ b/src/mame/drivers/magicard.c @@ -381,11 +381,11 @@ static VIDEO_START(magicard) static SCREEN_UPDATE(magicard) { - magicard_state *state = screen->machine().driver_data(); + magicard_state *state = screen.machine().driver_data(); int x,y; UINT32 count; - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); //TODO + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); //TODO if(!(SCC_DE_VREG)) //display enable return 0; @@ -402,23 +402,23 @@ static SCREEN_UPDATE(magicard) color = ((state->m_magicram[count]) & 0x000f)>>0; - if(((x*4)+3)visible_area().max_x && ((y)+0)visible_area().max_y) - *BITMAP_ADDR32(bitmap, y, (x*4)+3) = screen->machine().pens[color]; + if(((x*4)+3)m_magicram[count]) & 0x00f0)>>4; - if(((x*4)+2)visible_area().max_x && ((y)+0)visible_area().max_y) - *BITMAP_ADDR32(bitmap, y, (x*4)+2) = screen->machine().pens[color]; + if(((x*4)+2)m_magicram[count]) & 0x0f00)>>8; - if(((x*4)+1)visible_area().max_x && ((y)+0)visible_area().max_y) - *BITMAP_ADDR32(bitmap, y, (x*4)+1) = screen->machine().pens[color]; + if(((x*4)+1)m_magicram[count]) & 0xf000)>>12; - if(((x*4)+0)visible_area().max_x && ((y)+0)visible_area().max_y) - *BITMAP_ADDR32(bitmap, y, (x*4)+0) = screen->machine().pens[color]; + if(((x*4)+0)m_magicram[count]) & 0x00ff)>>0; - if(((x*2)+1)visible_area().max_x && ((y)+0)visible_area().max_y) - *BITMAP_ADDR32(bitmap, y, (x*2)+1) = screen->machine().pens[color]; + if(((x*2)+1)m_magicram[count]) & 0xff00)>>8; - if(((x*2)+0)visible_area().max_x && ((y)+0)visible_area().max_y) - *BITMAP_ADDR32(bitmap, y, (x*2)+0) = screen->machine().pens[color]; + if(((x*2)+0)machine().driver_data(); + magicfly_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/magictg.c b/src/mame/drivers/magictg.c index 883954719ff..9b9681cfb2e 100644 --- a/src/mame/drivers/magictg.c +++ b/src/mame/drivers/magictg.c @@ -260,7 +260,7 @@ static VIDEO_START( magictg ) static SCREEN_UPDATE( magictg ) { - magictg_state* state = screen->machine().driver_data(); + magictg_state* state = screen.machine().driver_data(); return voodoo_update(state->m_voodoo[0], bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED; } diff --git a/src/mame/drivers/majorpkr.c b/src/mame/drivers/majorpkr.c index 16457624c56..e6fce89efbf 100644 --- a/src/mame/drivers/majorpkr.c +++ b/src/mame/drivers/majorpkr.c @@ -523,9 +523,9 @@ static VIDEO_START(majorpkr) static SCREEN_UPDATE(majorpkr) { - majorpkr_state *state = screen->machine().driver_data(); + majorpkr_state *state = screen.machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); rectangle custom_clip; diff --git a/src/mame/drivers/marinedt.c b/src/mame/drivers/marinedt.c index 98de198df7e..cb532cefd88 100644 --- a/src/mame/drivers/marinedt.c +++ b/src/mame/drivers/marinedt.c @@ -508,21 +508,21 @@ static VIDEO_START( marinedt ) static SCREEN_UPDATE( marinedt ) { - marinedt_state *state = screen->machine().driver_data(); + marinedt_state *state = screen.machine().driver_data(); int sx, sy; bitmap_fill(state->m_tile, NULL, 0); tilemap_draw(state->m_tile, cliprect, state->m_tx_tilemap, 0, 0); bitmap_fill(state->m_obj1, NULL, 0); - drawgfx_transpen(state->m_obj1, NULL, screen->machine().gfx[1], + drawgfx_transpen(state->m_obj1, NULL, screen.machine().gfx[1], OBJ_CODE(state->m_obj1_a), OBJ_COLOR(state->m_obj1_a), OBJ_FLIPX(state->m_obj1_a), OBJ_FLIPY(state->m_obj1_a), 0, 0, 0); bitmap_fill(state->m_obj2, NULL, 0); - drawgfx_transpen(state->m_obj2, NULL, screen->machine().gfx[2], + drawgfx_transpen(state->m_obj2, NULL, screen.machine().gfx[2], OBJ_CODE(state->m_obj2_a), OBJ_COLOR(state->m_obj2_a), OBJ_FLIPX(state->m_obj2_a), OBJ_FLIPY(state->m_obj2_a), diff --git a/src/mame/drivers/mastboy.c b/src/mame/drivers/mastboy.c index f942fbd78cb..3d40827c36f 100644 --- a/src/mame/drivers/mastboy.c +++ b/src/mame/drivers/mastboy.c @@ -472,7 +472,7 @@ static VIDEO_START(mastboy) static SCREEN_UPDATE(mastboy) { - mastboy_state *state = screen->machine().driver_data(); + mastboy_state *state = screen.machine().driver_data(); int y,x,i; int count = 0x000; @@ -480,7 +480,7 @@ static SCREEN_UPDATE(mastboy) { int coldat = state->m_colram[i+1] | (state->m_colram[i+0]<<8); - palette_set_color_rgb(screen->machine(),i/2,pal4bit(coldat>>8),pal4bit(coldat>>12),pal4bit(coldat>>4)); + palette_set_color_rgb(screen.machine(),i/2,pal4bit(coldat>>8),pal4bit(coldat>>12),pal4bit(coldat>>4)); } for (y=0;y<32;y++) @@ -494,12 +494,12 @@ static SCREEN_UPDATE(mastboy) if (tileno&0x800) { - gfx = screen->machine().gfx[1]; + gfx = screen.machine().gfx[1]; tileno &=0x7ff; } else { - gfx = screen->machine().gfx[0]; + gfx = screen.machine().gfx[0]; } diff --git a/src/mame/drivers/maygayv1.c b/src/mame/drivers/maygayv1.c index c5ad979b014..15719bdc601 100644 --- a/src/mame/drivers/maygayv1.c +++ b/src/mame/drivers/maygayv1.c @@ -282,7 +282,7 @@ static VIDEO_START( maygayv1 ) static SCREEN_UPDATE( maygayv1 ) { - maygayv1_state *state = screen->machine().driver_data(); + maygayv1_state *state = screen.machine().driver_data(); i82716_t &i82716 = state->m_i82716; UINT16 *atable = &i82716.dram[VREG(ATBA)]; UINT16 *otable = &i82716.dram[VREG(ODTBA) & 0xfc00]; // both must be bank 0 @@ -297,7 +297,7 @@ static SCREEN_UPDATE( maygayv1 ) /* If screen output is disabled, fill with black */ if (!(VREG(VCR0) & VCR0_DEN)) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } @@ -413,7 +413,7 @@ static SCREEN_UPDATE( maygayv1 ) static SCREEN_EOF( maygayv1 ) { - maygayv1_state *state = machine.driver_data(); + maygayv1_state *state = screen.machine().driver_data(); i82716_t &i82716 = state->m_i82716; // UCF if (VREG(VCR0) & VCR0_UCF) @@ -437,7 +437,7 @@ static SCREEN_EOF( maygayv1 ) for (i = 0; i < 16; ++i) { UINT16 entry = *palbase++; - palette_set_color_rgb(machine, entry & 0xf, pal4bit(entry >> 12), pal4bit(entry >> 8), pal4bit(entry >> 4)); + palette_set_color_rgb(screen.machine(), entry & 0xf, pal4bit(entry >> 12), pal4bit(entry >> 8), pal4bit(entry >> 4)); } } } diff --git a/src/mame/drivers/mayumi.c b/src/mame/drivers/mayumi.c index f1081e152a8..26ba85b7187 100644 --- a/src/mame/drivers/mayumi.c +++ b/src/mame/drivers/mayumi.c @@ -63,7 +63,7 @@ static WRITE8_HANDLER( mayumi_videoram_w ) static SCREEN_UPDATE( mayumi ) { - mayumi_state *state = screen->machine().driver_data(); + mayumi_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/mazerbla.c b/src/mame/drivers/mazerbla.c index 59008ba6ced..352de1801ba 100644 --- a/src/mame/drivers/mazerbla.c +++ b/src/mame/drivers/mazerbla.c @@ -173,7 +173,7 @@ static VIDEO_START( mazerbla ) SCREEN_UPDATE( test_vcu ) { - mazerbla_state *state = screen->machine().driver_data(); + mazerbla_state *state = screen.machine().driver_data(); int *planes_enabled = state->m_planes_enabled; char buf[128]; @@ -206,38 +206,38 @@ SCREEN_UPDATE( test_vcu ) bitmap_fill(state->m_tmpbitmaps[0], NULL, color_base); - if (screen->machine().input().code_pressed_once(KEYCODE_1)) /* plane 1 */ + if (screen.machine().input().code_pressed_once(KEYCODE_1)) /* plane 1 */ planes_enabled[0] ^= 1; - if (screen->machine().input().code_pressed_once(KEYCODE_2)) /* plane 2 */ + if (screen.machine().input().code_pressed_once(KEYCODE_2)) /* plane 2 */ planes_enabled[1] ^= 1; - if (screen->machine().input().code_pressed_once(KEYCODE_3)) /* plane 3 */ + if (screen.machine().input().code_pressed_once(KEYCODE_3)) /* plane 3 */ planes_enabled[2] ^= 1; - if (screen->machine().input().code_pressed_once(KEYCODE_4)) /* plane 4 */ + if (screen.machine().input().code_pressed_once(KEYCODE_4)) /* plane 4 */ planes_enabled[3] ^= 1; - if (screen->machine().input().code_pressed_once(KEYCODE_I)) /* show/hide debug info */ + if (screen.machine().input().code_pressed_once(KEYCODE_I)) /* show/hide debug info */ state->m_dbg_info = !state->m_dbg_info; - if (screen->machine().input().code_pressed_once(KEYCODE_G)) /* enable gfx area handling */ + if (screen.machine().input().code_pressed_once(KEYCODE_G)) /* enable gfx area handling */ state->m_dbg_gfx_e = !state->m_dbg_gfx_e; - if (screen->machine().input().code_pressed_once(KEYCODE_C)) /* enable color area handling */ + if (screen.machine().input().code_pressed_once(KEYCODE_C)) /* enable color area handling */ state->m_dbg_clr_e = !state->m_dbg_clr_e; - if (screen->machine().input().code_pressed_once(KEYCODE_V)) /* draw only when vbank==dbg_vbank */ + if (screen.machine().input().code_pressed_once(KEYCODE_V)) /* draw only when vbank==dbg_vbank */ state->m_dbg_vbank ^= 1; - if (screen->machine().input().code_pressed_once(KEYCODE_L)) /* showlookup ram */ + if (screen.machine().input().code_pressed_once(KEYCODE_L)) /* showlookup ram */ state->m_dbg_lookup = (state->m_dbg_lookup + 1) % 5; //0,1,2,3, 4-off if (state->m_dbg_info) { sprintf(buf,"I-info, G-gfx, C-color, V-vbank, 1-4 enable planes"); - ui_draw_text(buf, 10, 0 * ui_get_line_height(screen->machine())); + ui_draw_text(buf, 10, 0 * ui_get_line_height(screen.machine())); sprintf(buf,"g:%1i c:%1i v:%1i vbk=%1i planes=%1i%1i%1i%1i ", state->m_dbg_gfx_e&1, state->m_dbg_clr_e&1, state->m_dbg_vbank, vbank&1, planes_enabled[0], @@ -245,7 +245,7 @@ SCREEN_UPDATE( test_vcu ) planes_enabled[2], planes_enabled[3] ); - ui_draw_text(buf, 10, 1 * ui_get_line_height(screen->machine())); + ui_draw_text(buf, 10, 1 * ui_get_line_height(screen.machine())); if (state->m_dbg_lookup!=4) { @@ -260,7 +260,7 @@ SCREEN_UPDATE( test_vcu ) { sprintf(buf + strlen(buf), "%02x ", lookup_ram[lookup_offs + x + y * 16]); } - ui_draw_text(buf, 0, (2 + y) * ui_get_line_height(screen->machine())); + ui_draw_text(buf, 0, (2 + y) * ui_get_line_height(screen.machine())); } } } @@ -272,7 +272,7 @@ SCREEN_UPDATE( test_vcu ) static SCREEN_UPDATE( mazerbla ) { - mazerbla_state *state = screen->machine().driver_data(); + mazerbla_state *state = screen.machine().driver_data(); // UINT32 color_base = 0; if (state->m_game_id == MAZERBLA) diff --git a/src/mame/drivers/mediagx.c b/src/mame/drivers/mediagx.c index 90db84ada19..830b480404a 100644 --- a/src/mame/drivers/mediagx.c +++ b/src/mame/drivers/mediagx.c @@ -346,14 +346,14 @@ static void draw_cga(running_machine &machine, bitmap_t *bitmap, const rectangle static SCREEN_UPDATE(mediagx) { - mediagx_state *state = screen->machine().driver_data(); + mediagx_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, 0); - draw_framebuffer(screen->machine(), bitmap, cliprect); + draw_framebuffer(screen.machine(), bitmap, cliprect); if (state->m_disp_ctrl_reg[DC_OUTPUT_CFG] & 0x1) // don't show MDA text screen on 16-bit mode. this is basically a hack { - draw_cga(screen->machine(), bitmap, cliprect); + draw_cga(screen.machine(), bitmap, cliprect); } return 0; } diff --git a/src/mame/drivers/megatech.c b/src/mame/drivers/megatech.c index f95aa448a81..d7c4368c4d5 100644 --- a/src/mame/drivers/megatech.c +++ b/src/mame/drivers/megatech.c @@ -444,32 +444,23 @@ static VIDEO_START(mtnew) //attotime::never static SCREEN_UPDATE(mtnew) { - mtech_state *state = screen->machine().driver_data(); - device_t *megadriv_screen = screen->machine().device("megadriv"); - device_t *menu_screen = screen->machine().device("menu"); + mtech_state *state = screen.machine().driver_data(); - if (screen == megadriv_screen) - { - /* if we're running an sms game then use the SMS update.. maybe this should be moved to the megadrive emulation core as compatibility mode is a feature of the chip */ - if (!state->m_current_game_is_sms) - SCREEN_UPDATE_CALL(megadriv); - else - SCREEN_UPDATE_CALL(megatech_md_sms); - } - else if (screen == menu_screen) - SCREEN_UPDATE_CALL(megatech_bios); + /* if we're running an sms game then use the SMS update.. maybe this should be moved to the megadrive emulation core as compatibility mode is a feature of the chip */ + if (!state->m_current_game_is_sms) + SCREEN_UPDATE_CALL(megadriv); + else + SCREEN_UPDATE_CALL(megatech_md_sms); return 0; } static SCREEN_EOF(mtnew) { - mtech_state *state = machine.driver_data(); + mtech_state *state = screen.machine().driver_data(); if (!state->m_current_game_is_sms) SCREEN_EOF_CALL(megadriv); else SCREEN_EOF_CALL(megatech_md_sms); - - SCREEN_EOF_CALL(megatech_bios); } static MACHINE_RESET(mtnew) @@ -503,7 +494,8 @@ static MACHINE_CONFIG_START( megatech, mtech_state ) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_SIZE(342,262) MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 224-1) - MCFG_SCREEN_UPDATE(mtnew) + MCFG_SCREEN_UPDATE(megatech_bios) + MCFG_SCREEN_EOF(megatech_bios) MCFG_SCREEN_MODIFY("megadriv") MCFG_SCREEN_UPDATE(mtnew) diff --git a/src/mame/drivers/meijinsn.c b/src/mame/drivers/meijinsn.c index 800f8a86f64..f1366fce5e9 100644 --- a/src/mame/drivers/meijinsn.c +++ b/src/mame/drivers/meijinsn.c @@ -285,7 +285,7 @@ static PALETTE_INIT( meijinsn ) static SCREEN_UPDATE(meijinsn) { - meijinsn_state *state = screen->machine().driver_data(); + meijinsn_state *state = screen.machine().driver_data(); int offs; for (offs = 0; offs < 0x4000; offs++) diff --git a/src/mame/drivers/merit.c b/src/mame/drivers/merit.c index 9f58a6cba2f..3cd59babdc4 100644 --- a/src/mame/drivers/merit.c +++ b/src/mame/drivers/merit.c @@ -1155,7 +1155,7 @@ INPUT_PORTS_END static SCREEN_UPDATE( merit ) { - mc6845_device *mc6845 = screen->machine().device("crtc"); + mc6845_device *mc6845 = screen.machine().device("crtc"); mc6845->update(bitmap, cliprect); return 0; diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c index 76b8a89ac5c..8b75c6c2abe 100644 --- a/src/mame/drivers/meritm.c +++ b/src/mame/drivers/meritm.c @@ -370,19 +370,19 @@ static VIDEO_START( meritm ) static SCREEN_UPDATE( meritm ) { - meritm_state *state = screen->machine().driver_data(); - if(screen->machine().input().code_pressed_once(KEYCODE_Q)) + meritm_state *state = screen.machine().driver_data(); + if(screen.machine().input().code_pressed_once(KEYCODE_Q)) { state->m_layer0_enabled^=1; popmessage("Layer 0 %sabled",state->m_layer0_enabled ? "en" : "dis"); } - if(screen->machine().input().code_pressed_once(KEYCODE_W)) + if(screen.machine().input().code_pressed_once(KEYCODE_W)) { state->m_layer1_enabled^=1; popmessage("Layer 1 %sabled",state->m_layer1_enabled ? "en" : "dis"); } - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); if ( state->m_layer0_enabled ) { diff --git a/src/mame/drivers/metalmx.c b/src/mame/drivers/metalmx.c index b235d567a3d..77512380fd8 100644 --- a/src/mame/drivers/metalmx.c +++ b/src/mame/drivers/metalmx.c @@ -281,7 +281,7 @@ static VIDEO_START( metalmx ) static SCREEN_UPDATE( metalmx ) { /* TODO: TMS34020 should take care of this */ - metalmx_state *state = screen->machine().driver_data(); + metalmx_state *state = screen.machine().driver_data(); // UINT32 *src_base = &gsp_vram[(vreg_base[0x40/4] & 0x40) ? 0x20000 : 0]; UINT16 *src_base = state->m_gsp_vram; diff --git a/src/mame/drivers/mgolf.c b/src/mame/drivers/mgolf.c index 5067749920d..98904a8814c 100644 --- a/src/mame/drivers/mgolf.c +++ b/src/mame/drivers/mgolf.c @@ -56,7 +56,7 @@ static VIDEO_START( mgolf ) static SCREEN_UPDATE( mgolf ) { - mgolf_state *state = screen->machine().driver_data(); + mgolf_state *state = screen.machine().driver_data(); int i; /* draw playfield */ @@ -65,14 +65,14 @@ static SCREEN_UPDATE( mgolf ) /* draw sprites */ for (i = 0; i < 2; i++) { - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], state->m_video_ram[0x399 + 4 * i], i, 0, 0, state->m_video_ram[0x390 + 2 * i] - 7, state->m_video_ram[0x398 + 4 * i] - 16, 0); - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], state->m_video_ram[0x39b + 4 * i], i, 0, 0, diff --git a/src/mame/drivers/midas.c b/src/mame/drivers/midas.c index 6812ee9493b..974a3232012 100644 --- a/src/mame/drivers/midas.c +++ b/src/mame/drivers/midas.c @@ -177,22 +177,22 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta static SCREEN_UPDATE( midas ) { - midas_state *state = screen->machine().driver_data(); + midas_state *state = screen.machine().driver_data(); int layers_ctrl = -1; #ifdef MAME_DEBUG - if ( screen->machine().input().code_pressed(KEYCODE_Z) ) + if ( screen.machine().input().code_pressed(KEYCODE_Z) ) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 1 << 0; // for state->m_tmap - if (screen->machine().input().code_pressed(KEYCODE_A)) msk |= 1 << 1; // for sprites + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1 << 0; // for state->m_tmap + if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= 1 << 1; // for sprites if (msk != 0) layers_ctrl &= msk; } #endif bitmap_fill(bitmap,cliprect,4095); - if (layers_ctrl & 2) draw_sprites(screen->machine(), bitmap,cliprect); + if (layers_ctrl & 2) draw_sprites(screen.machine(), bitmap,cliprect); if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect, state->m_tmap, 0, 0); return 0; diff --git a/src/mame/drivers/mil4000.c b/src/mame/drivers/mil4000.c index e7aee773d8b..b4e43376605 100644 --- a/src/mame/drivers/mil4000.c +++ b/src/mame/drivers/mil4000.c @@ -181,7 +181,7 @@ static VIDEO_START(mil4000) static SCREEN_UPDATE(mil4000) { - mil4000_state *state = screen->machine().driver_data(); + mil4000_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_sc0_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_sc1_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_sc2_tilemap,0,0); diff --git a/src/mame/drivers/miniboy7.c b/src/mame/drivers/miniboy7.c index 685e5fd992b..3786369419b 100644 --- a/src/mame/drivers/miniboy7.c +++ b/src/mame/drivers/miniboy7.c @@ -210,7 +210,7 @@ static VIDEO_START( miniboy7 ) static SCREEN_UPDATE( miniboy7 ) { - miniboy7_state *state = screen->machine().driver_data(); + miniboy7_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/minivadr.c b/src/mame/drivers/minivadr.c index cff7c62d4e2..40567e88d93 100644 --- a/src/mame/drivers/minivadr.c +++ b/src/mame/drivers/minivadr.c @@ -33,7 +33,7 @@ public: static SCREEN_UPDATE( minivadr ) { - minivadr_state *state = screen->machine().driver_data(); + minivadr_state *state = screen.machine().driver_data(); offs_t offs; for (offs = 0; offs < state->m_videoram_size; offs++) diff --git a/src/mame/drivers/mirage.c b/src/mame/drivers/mirage.c index 55dcb38d987..812170359a2 100644 --- a/src/mame/drivers/mirage.c +++ b/src/mame/drivers/mirage.c @@ -74,28 +74,28 @@ static VIDEO_START( mirage ) static SCREEN_UPDATE( mirage ) { - mirage_state *state = screen->machine().driver_data(); + mirage_state *state = screen.machine().driver_data(); UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); - flip_screen_set(screen->machine(), BIT(flip, 7)); + flip_screen_set(screen.machine(), BIT(flip, 7)); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0x400); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u16, 0x400); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); bitmap_fill(bitmap, cliprect, 256); /* not verified */ deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); - screen->machine().device("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0800, 0x0800, 0x200, 0x1ff); + screen.machine().device("spritegen")->inefficient_copy_sprite_bitmap(screen.machine(), bitmap, cliprect, 0x0800, 0x0800, 0x200, 0x1ff); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); - screen->machine().device("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0000, 0x0800, 0x200, 0x1ff); + screen.machine().device("spritegen")->inefficient_copy_sprite_bitmap(screen.machine(), bitmap, cliprect, 0x0000, 0x0800, 0x200, 0x1ff); return 0; } static SCREEN_EOF( mirage ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram16_w(space,0,0,0xffff); } diff --git a/src/mame/drivers/mirax.c b/src/mame/drivers/mirax.c index 6f0b8b454e3..5c6fd46506e 100644 --- a/src/mame/drivers/mirax.c +++ b/src/mame/drivers/mirax.c @@ -120,8 +120,8 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta static SCREEN_UPDATE(mirax) { - mirax_state *state = screen->machine().driver_data(); - const gfx_element *gfx = screen->machine().gfx[0]; + mirax_state *state = screen.machine().driver_data(); + const gfx_element *gfx = screen.machine().gfx[0]; int count = 0x00000; int y,x; @@ -142,7 +142,7 @@ static SCREEN_UPDATE(mirax) } } - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); count = 0x00000; diff --git a/src/mame/drivers/missb2.c b/src/mame/drivers/missb2.c index f2682232214..ee43dc738a9 100644 --- a/src/mame/drivers/missb2.c +++ b/src/mame/drivers/missb2.c @@ -37,7 +37,7 @@ public: static SCREEN_UPDATE( missb2 ) { - missb2_state *state = screen->machine().driver_data(); + missb2_state *state = screen.machine().driver_data(); int offs; int sx, sy, xc, yc; int gfx_num, gfx_attr, gfx_offs; @@ -58,7 +58,7 @@ static SCREEN_UPDATE( missb2 ) //popmessage("%02x",(*state->m_bgvram) & 0x1f); for (bg_offs = ((*state->m_bgvram) << 4); bg_offs < (((*state->m_bgvram) << 4) | 0xf); bg_offs++) { - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[1], + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[1], bg_offs, 1, 0,0, @@ -68,7 +68,7 @@ static SCREEN_UPDATE( missb2 ) sx = 0; - prom = screen->machine().region("proms")->base(); + prom = screen.machine().region("proms")->base(); for (offs = 0; offs < state->m_objectram_size; offs += 4) { /* skip empty sprites */ @@ -110,7 +110,7 @@ static SCREEN_UPDATE( missb2 ) x = sx + xc * 8; y = (sy + yc * 8) & 0xff; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { x = 248 - x; y = 248 - y; @@ -118,7 +118,7 @@ static SCREEN_UPDATE( missb2 ) flipy = !flipy; } - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], code, 0, flipx,flipy, diff --git a/src/mame/drivers/missile.c b/src/mame/drivers/missile.c index d616901f976..01cb1721e5e 100644 --- a/src/mame/drivers/missile.c +++ b/src/mame/drivers/missile.c @@ -666,7 +666,7 @@ static UINT8 read_vram(address_space *space, offs_t address) static SCREEN_UPDATE( missile ) { - missile_state *state = screen->machine().driver_data(); + missile_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; int x, y; diff --git a/src/mame/drivers/mjsister.c b/src/mame/drivers/mjsister.c index 7cf9ac00b63..54085f7b640 100644 --- a/src/mame/drivers/mjsister.c +++ b/src/mame/drivers/mjsister.c @@ -120,7 +120,7 @@ static WRITE8_HANDLER( mjsister_videoram_w ) static SCREEN_UPDATE( mjsister ) { - mjsister_state *state = screen->machine().driver_data(); + mjsister_state *state = screen.machine().driver_data(); int flip = state->m_flip_screen; int i, j; @@ -130,8 +130,8 @@ static SCREEN_UPDATE( mjsister ) for (offs = 0; offs < 0x8000; offs++) { - mjsister_plot0(screen->machine(), offs, state->m_videoram0[offs]); - mjsister_plot1(screen->machine(), offs, state->m_videoram1[offs]); + mjsister_plot0(screen.machine(), offs, state->m_videoram0[offs]); + mjsister_plot1(screen.machine(), offs, state->m_videoram1[offs]); } state->m_screen_redraw = 0; } @@ -146,7 +146,7 @@ static SCREEN_UPDATE( mjsister ) copybitmap_trans(bitmap, state->m_tmpbitmap1, flip, flip, 2, 0, cliprect, 0); } else - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } diff --git a/src/mame/drivers/mlanding.c b/src/mame/drivers/mlanding.c index 529813c03fc..ccf18843331 100644 --- a/src/mame/drivers/mlanding.c +++ b/src/mame/drivers/mlanding.c @@ -60,7 +60,7 @@ static VIDEO_START(mlanding) // 768: plane landing sequence static SCREEN_UPDATE(mlanding) { - mlanding_state *state = screen->machine().driver_data(); + mlanding_state *state = screen.machine().driver_data(); int x, y; for (y = cliprect->min_y; y <= cliprect->max_y; ++y) @@ -72,8 +72,8 @@ static SCREEN_UPDATE(mlanding) { UINT16 srcpix = *src++; - *dst++ = screen->machine().pens[256+(srcpix & 0xff) + (state->m_pal_fg_bank & 1 ? 0x100 : 0x000)]; - *dst++ = screen->machine().pens[256+(srcpix >> 8) + (state->m_pal_fg_bank & 1 ? 0x100 : 0x000)]; + *dst++ = screen.machine().pens[256+(srcpix & 0xff) + (state->m_pal_fg_bank & 1 ? 0x100 : 0x000)]; + *dst++ = screen.machine().pens[256+(srcpix >> 8) + (state->m_pal_fg_bank & 1 ? 0x100 : 0x000)]; } } diff --git a/src/mame/drivers/mogura.c b/src/mame/drivers/mogura.c index e269b3cc55c..be0449ecb31 100644 --- a/src/mame/drivers/mogura.c +++ b/src/mame/drivers/mogura.c @@ -80,8 +80,8 @@ static VIDEO_START( mogura ) static SCREEN_UPDATE( mogura ) { - mogura_state *state = screen->machine().driver_data(); - const rectangle &visarea = screen->visible_area(); + mogura_state *state = screen.machine().driver_data(); + const rectangle &visarea = screen.visible_area(); /* tilemap layout is a bit strange ... */ rectangle clip; diff --git a/src/mame/drivers/mole.c b/src/mame/drivers/mole.c index 0abd317755e..0fd8b9fe6d9 100644 --- a/src/mame/drivers/mole.c +++ b/src/mame/drivers/mole.c @@ -122,7 +122,7 @@ static WRITE8_HANDLER( mole_flipscreen_w ) static SCREEN_UPDATE( mole ) { - mole_state *state = screen->machine().driver_data(); + mole_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; diff --git a/src/mame/drivers/monzagp.c b/src/mame/drivers/monzagp.c index 22c06feb350..172811bc725 100644 --- a/src/mame/drivers/monzagp.c +++ b/src/mame/drivers/monzagp.c @@ -64,28 +64,28 @@ static VIDEO_START(monzagp) static SCREEN_UPDATE(monzagp) { - monzagp_state *state = screen->machine().driver_data(); + monzagp_state *state = screen.machine().driver_data(); int x,y; - if(screen->machine().input().code_pressed_once(KEYCODE_Z)) + if(screen.machine().input().code_pressed_once(KEYCODE_Z)) state->m_bank--; - if(screen->machine().input().code_pressed_once(KEYCODE_X)) + if(screen.machine().input().code_pressed_once(KEYCODE_X)) state->m_bank++; - if(screen->machine().input().code_pressed_once(KEYCODE_Q)) + if(screen.machine().input().code_pressed_once(KEYCODE_Q)) { state->m_screenw--; printf("%x\n",state->m_screenw); } - if(screen->machine().input().code_pressed_once(KEYCODE_W)) + if(screen.machine().input().code_pressed_once(KEYCODE_W)) { state->m_screenw++; printf("%x\n",state->m_screenw); } - if(screen->machine().input().code_pressed_once(KEYCODE_A)) + if(screen.machine().input().code_pressed_once(KEYCODE_A)) { FILE * p=fopen("vram.bin","wb"); fwrite(&state->m_vram[0],1,0x10000,p); @@ -97,7 +97,7 @@ static SCREEN_UPDATE(monzagp) { for(x=0;x<256;x++) { - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[state->m_bank&1], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[state->m_bank&1], state->m_vram[y*state->m_screenw+x], //(state->m_vram[y*state->m_screenw+x]&0x3f)+(state->m_bank>>1)*64, 0, diff --git a/src/mame/drivers/mpoker.c b/src/mame/drivers/mpoker.c index b6a4ae79bcc..a8ce66228d5 100644 --- a/src/mame/drivers/mpoker.c +++ b/src/mame/drivers/mpoker.c @@ -193,10 +193,10 @@ static VIDEO_START(mpoker) static SCREEN_UPDATE(mpoker) { - mpoker_state *state = screen->machine().driver_data(); + mpoker_state *state = screen.machine().driver_data(); int y,x; int count; - const gfx_element *gfx = screen->machine().gfx[0]; + const gfx_element *gfx = screen.machine().gfx[0]; count = 0; for (y=0;y<32;y++) diff --git a/src/mame/drivers/mpu4vid.c b/src/mame/drivers/mpu4vid.c index c6d58f17977..73749d1052d 100644 --- a/src/mame/drivers/mpu4vid.c +++ b/src/mame/drivers/mpu4vid.c @@ -449,7 +449,7 @@ static const gfx_layout mpu4_vid_char_16x16_layout = static SCREEN_UPDATE(mpu4_vid) { - mpu4_state *state = screen->machine().driver_data(); + mpu4_state *state = screen.machine().driver_data(); int x, y/*, count = 0*/; bitmap_fill(bitmap,cliprect,0); @@ -482,7 +482,7 @@ static SCREEN_UPDATE(mpu4_vid) attr = tiledat >>12; if (attr) - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[gfxregion],tiledat,0,0,0,(x*8),(y*8)); + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[gfxregion],tiledat,0,0,0,(x*8),(y*8)); } if (dbl_size&2) @@ -2150,7 +2150,7 @@ static PALETTE_INIT( dealem ) static SCREEN_UPDATE(dealem) { - mpu4_state *state = screen->machine().driver_data(); + mpu4_state *state = screen.machine().driver_data(); int x,y; int count = 0; @@ -2160,7 +2160,7 @@ static SCREEN_UPDATE(dealem) { int tile = state->m_dealem_videoram[count + 0x1000] | (state->m_dealem_videoram[count] << 8); count++; - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tile,0,0,0,x * 8,y * 8); + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],tile,0,0,0,x * 8,y * 8); } } diff --git a/src/mame/drivers/multfish.c b/src/mame/drivers/multfish.c index 0d6c9cea719..eeced491b34 100644 --- a/src/mame/drivers/multfish.c +++ b/src/mame/drivers/multfish.c @@ -243,10 +243,10 @@ static VIDEO_START(multfish) static SCREEN_UPDATE(multfish) { - multfish_state *state = screen->machine().driver_data(); + multfish_state *state = screen.machine().driver_data(); int i; - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); if (!state->m_disp_enable) return 0; diff --git a/src/mame/drivers/multigam.c b/src/mame/drivers/multigam.c index 1995b3ff4b5..0ea2181b31d 100644 --- a/src/mame/drivers/multigam.c +++ b/src/mame/drivers/multigam.c @@ -1093,7 +1093,7 @@ static VIDEO_START( multigam ) static SCREEN_UPDATE( multigam ) { /* render the ppu */ - ppu2c0x_render(screen->machine().device("ppu"), bitmap, 0, 0, 0, 0); + ppu2c0x_render(screen.machine().device("ppu"), bitmap, 0, 0, 0, 0); return 0; } diff --git a/src/mame/drivers/murogem.c b/src/mame/drivers/murogem.c index 1311b8c71ac..9df5a898c85 100644 --- a/src/mame/drivers/murogem.c +++ b/src/mame/drivers/murogem.c @@ -201,7 +201,7 @@ static PALETTE_INIT(murogem) static SCREEN_UPDATE(murogem) { - murogem_state *state = screen->machine().driver_data(); + murogem_state *state = screen.machine().driver_data(); int xx,yy,count; count = 0x000; @@ -214,7 +214,7 @@ static SCREEN_UPDATE(murogem) int tileno = state->m_videoram[count]&0x3f; int attr = state->m_videoram[count+0x400]&0x0f; - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],tileno,attr,0,0,xx*8,yy*8,0); + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],tileno,attr,0,0,xx*8,yy*8,0); count++; diff --git a/src/mame/drivers/murogmbl.c b/src/mame/drivers/murogmbl.c index e7bb3f50589..ef734903497 100644 --- a/src/mame/drivers/murogmbl.c +++ b/src/mame/drivers/murogmbl.c @@ -92,8 +92,8 @@ static VIDEO_START(murogmbl) static SCREEN_UPDATE(murogmbl) { - murogmbl_state *state = screen->machine().driver_data(); - const gfx_element *gfx = screen->machine().gfx[0]; + murogmbl_state *state = screen.machine().driver_data(); + const gfx_element *gfx = screen.machine().gfx[0]; int count = 0; int y, x; diff --git a/src/mame/drivers/mwarr.c b/src/mame/drivers/mwarr.c index 618b5b1f93b..b90e61278cd 100644 --- a/src/mame/drivers/mwarr.c +++ b/src/mame/drivers/mwarr.c @@ -468,10 +468,10 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect static SCREEN_UPDATE( mwarr ) { - mwarr_state *state = screen->machine().driver_data(); + mwarr_state *state = screen.machine().driver_data(); int i; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); if (BIT(state->m_vidattrram[6], 0)) { @@ -517,7 +517,7 @@ static SCREEN_UPDATE( mwarr ) tilemap_draw(bitmap, cliprect, state->m_mlow_tilemap, 0, 0x02); tilemap_draw(bitmap, cliprect, state->m_mhigh_tilemap, 0, 0x04); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0x10); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/namcos23.c b/src/mame/drivers/namcos23.c index a3b815c644c..dc4b9233cbd 100644 --- a/src/mame/drivers/namcos23.c +++ b/src/mame/drivers/namcos23.c @@ -2135,12 +2135,12 @@ static VIDEO_START( ss23 ) static SCREEN_UPDATE( ss23 ) { - namcos23_state *state = screen->machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + namcos23_state *state = screen.machine().driver_data(); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); - render_run( screen->machine(), bitmap ); + render_run( screen.machine(), bitmap ); - gfx_element *gfx = screen->machine().gfx[0]; + gfx_element *gfx = screen.machine().gfx[0]; memset(gfx->dirty, 1, gfx->total_elements); tilemap_draw( bitmap, cliprect, state->m_bgtilemap, 0/*flags*/, 0/*priority*/ ); /* opaque */ diff --git a/src/mame/drivers/neoprint.c b/src/mame/drivers/neoprint.c index b8cd9567baa..ebeffb96c76 100644 --- a/src/mame/drivers/neoprint.c +++ b/src/mame/drivers/neoprint.c @@ -95,8 +95,8 @@ SCREEN_UPDATE(neoprint) { bitmap_fill(bitmap, cliprect, 0); - draw_layer(screen->machine(),bitmap,cliprect,1,2); - draw_layer(screen->machine(),bitmap,cliprect,0,2); + draw_layer(screen.machine(),bitmap,cliprect,1,2); + draw_layer(screen.machine(),bitmap,cliprect,0,2); return 0; } @@ -105,9 +105,9 @@ SCREEN_UPDATE(nprsp) { bitmap_fill(bitmap, cliprect, 0); - draw_layer(screen->machine(),bitmap,cliprect,1,0); - draw_layer(screen->machine(),bitmap,cliprect,2,0); - draw_layer(screen->machine(),bitmap,cliprect,0,0); + draw_layer(screen.machine(),bitmap,cliprect,1,0); + draw_layer(screen.machine(),bitmap,cliprect,2,0); + draw_layer(screen.machine(),bitmap,cliprect,0,0); return 0; } diff --git a/src/mame/drivers/nightgal.c b/src/mame/drivers/nightgal.c index 8472c2c2ab6..4117e61503d 100644 --- a/src/mame/drivers/nightgal.c +++ b/src/mame/drivers/nightgal.c @@ -70,7 +70,7 @@ static VIDEO_START( nightgal ) static SCREEN_UPDATE( nightgal ) { - nightgal_state *state = screen->machine().driver_data(); + nightgal_state *state = screen.machine().driver_data(); int x, y; for (y = cliprect->min_y; y <= cliprect->max_y; ++y) @@ -81,8 +81,8 @@ static SCREEN_UPDATE( nightgal ) for (x = cliprect->min_x; x <= cliprect->max_x; x += 2) { UINT32 srcpix = *src++; - *dst++ = screen->machine().pens[srcpix & 0xf]; - *dst++ = screen->machine().pens[(srcpix >> 4) & 0xf]; + *dst++ = screen.machine().pens[srcpix & 0xf]; + *dst++ = screen.machine().pens[(srcpix >> 4) & 0xf]; } } diff --git a/src/mame/drivers/ninjaw.c b/src/mame/drivers/ninjaw.c index c0734feaace..0ad7bfe58d1 100644 --- a/src/mame/drivers/ninjaw.c +++ b/src/mame/drivers/ninjaw.c @@ -831,7 +831,7 @@ static MACHINE_CONFIG_START( ninjaw, ninjaw_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(36*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 3*8, 31*8-1) - MCFG_SCREEN_UPDATE(ninjaw) + MCFG_SCREEN_UPDATE(ninjaw_left) MCFG_SCREEN_ADD("mscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -839,7 +839,7 @@ static MACHINE_CONFIG_START( ninjaw, ninjaw_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(36*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 3*8, 31*8-1) - MCFG_SCREEN_UPDATE(ninjaw) + MCFG_SCREEN_UPDATE(ninjaw_middle) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -847,7 +847,7 @@ static MACHINE_CONFIG_START( ninjaw, ninjaw_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(36*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 3*8, 31*8-1) - MCFG_SCREEN_UPDATE(ninjaw) + MCFG_SCREEN_UPDATE(ninjaw_right) MCFG_VIDEO_START(ninjaw) @@ -917,7 +917,7 @@ static MACHINE_CONFIG_START( darius2, ninjaw_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(36*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 3*8, 31*8-1) - MCFG_SCREEN_UPDATE(ninjaw) + MCFG_SCREEN_UPDATE(ninjaw_left) MCFG_SCREEN_ADD("mscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -925,7 +925,7 @@ static MACHINE_CONFIG_START( darius2, ninjaw_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(36*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 3*8, 31*8-1) - MCFG_SCREEN_UPDATE(ninjaw) + MCFG_SCREEN_UPDATE(ninjaw_middle) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -933,7 +933,7 @@ static MACHINE_CONFIG_START( darius2, ninjaw_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(36*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 3*8, 31*8-1) - MCFG_SCREEN_UPDATE(ninjaw) + MCFG_SCREEN_UPDATE(ninjaw_right) MCFG_VIDEO_START(ninjaw) diff --git a/src/mame/drivers/nmg5.c b/src/mame/drivers/nmg5.c index 5ae6554b466..405c48dfe8f 100644 --- a/src/mame/drivers/nmg5.c +++ b/src/mame/drivers/nmg5.c @@ -913,7 +913,7 @@ static void draw_bitmap( running_machine &machine, bitmap_t *bitmap ) static SCREEN_UPDATE( nmg5 ) { - nmg5_state *state = screen->machine().driver_data(); + nmg5_state *state = screen.machine().driver_data(); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_scroll_ram[3] + 9); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_scroll_ram[2] + 3); @@ -924,33 +924,33 @@ static SCREEN_UPDATE( nmg5 ) if (state->m_priority_reg == 0) { - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - draw_bitmap(screen->machine(), bitmap); + draw_bitmap(screen.machine(), bitmap); } else if (state->m_priority_reg == 1) { - draw_bitmap(screen->machine(), bitmap); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_bitmap(screen.machine(), bitmap); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); } else if (state->m_priority_reg == 2) { - draw_sprites(screen->machine(), bitmap, cliprect); - draw_bitmap(screen->machine(), bitmap); + draw_sprites(screen.machine(), bitmap, cliprect); + draw_bitmap(screen.machine(), bitmap); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); } else if (state->m_priority_reg == 3) { tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); - draw_bitmap(screen->machine(), bitmap); + draw_sprites(screen.machine(), bitmap, cliprect); + draw_bitmap(screen.machine(), bitmap); } else if (state->m_priority_reg == 7) { tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - draw_bitmap(screen->machine(), bitmap); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_bitmap(screen.machine(), bitmap); + draw_sprites(screen.machine(), bitmap, cliprect); } return 0; } diff --git a/src/mame/drivers/norautp.c b/src/mame/drivers/norautp.c index 53002e0d221..b9e0378c0cc 100644 --- a/src/mame/drivers/norautp.c +++ b/src/mame/drivers/norautp.c @@ -566,12 +566,12 @@ static VIDEO_START( norautp ) static SCREEN_UPDATE( norautp ) { - norautp_state *state = screen->machine().driver_data(); + norautp_state *state = screen.machine().driver_data(); int x, y, count; count = 0; - bitmap_fill(bitmap, cliprect, screen->machine().pens[0]); //black pen + bitmap_fill(bitmap, cliprect, screen.machine().pens[0]); //black pen for(y = 0; y < 8; y++) { @@ -583,7 +583,7 @@ static SCREEN_UPDATE( norautp ) int tile = state->m_np_vram[count] & 0x3f; int colour = (state->m_np_vram[count] & 0xc0) >> 6; - drawgfx_opaque(bitmap,cliprect, screen->machine().gfx[1], tile, colour, 0, 0, (x * 32) + 8, y * 32); + drawgfx_opaque(bitmap,cliprect, screen.machine().gfx[1], tile, colour, 0, 0, (x * 32) + 8, y * 32); count+=2; } @@ -595,7 +595,7 @@ static SCREEN_UPDATE( norautp ) int tile = state->m_np_vram[count] & 0x3f; int colour = (state->m_np_vram[count] & 0xc0) >> 6; - drawgfx_opaque(bitmap,cliprect, screen->machine().gfx[0], tile, colour, 0, 0, x * 16, y * 32); + drawgfx_opaque(bitmap,cliprect, screen.machine().gfx[0], tile, colour, 0, 0, x * 16, y * 32); count++; } diff --git a/src/mame/drivers/nsmpoker.c b/src/mame/drivers/nsmpoker.c index c1220d242cc..92c92eabcef 100644 --- a/src/mame/drivers/nsmpoker.c +++ b/src/mame/drivers/nsmpoker.c @@ -124,7 +124,7 @@ static VIDEO_START( nsmpoker ) static SCREEN_UPDATE( nsmpoker ) { - nsmpoker_state *state = screen->machine().driver_data(); + nsmpoker_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/nwk-tr.c b/src/mame/drivers/nwk-tr.c index dfd87e3ccee..f7c03c3d202 100644 --- a/src/mame/drivers/nwk-tr.c +++ b/src/mame/drivers/nwk-tr.c @@ -261,11 +261,11 @@ static void voodoo_vblank_0(device_t *device, int param) static SCREEN_UPDATE( nwktr ) { - nwktr_state *state = screen->machine().driver_data(); - device_t *voodoo = screen->machine().device("voodoo"); - device_t *k001604 = screen->machine().device("k001604"); + nwktr_state *state = screen.machine().driver_data(); + device_t *voodoo = screen.machine().device("voodoo"); + device_t *k001604 = screen.machine().device("k001604"); - bitmap_fill(bitmap, cliprect, screen->machine().pens[0]); + bitmap_fill(bitmap, cliprect, screen.machine().pens[0]); voodoo_update(voodoo, bitmap, cliprect); diff --git a/src/mame/drivers/nyny.c b/src/mame/drivers/nyny.c index d9318c9b58c..1e2710aac7b 100644 --- a/src/mame/drivers/nyny.c +++ b/src/mame/drivers/nyny.c @@ -429,7 +429,7 @@ static const mc6845_interface mc6845_intf = static SCREEN_UPDATE( nyny ) { - nyny_state *state = screen->machine().driver_data(); + nyny_state *state = screen.machine().driver_data(); state->m_mc6845->update(bitmap, cliprect); diff --git a/src/mame/drivers/olibochu.c b/src/mame/drivers/olibochu.c index 3bc850cf33b..74e3c50476d 100644 --- a/src/mame/drivers/olibochu.c +++ b/src/mame/drivers/olibochu.c @@ -220,9 +220,9 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect static SCREEN_UPDATE( olibochu ) { - olibochu_state *state = screen->machine().driver_data(); + olibochu_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/onetwo.c b/src/mame/drivers/onetwo.c index 805291e125e..a2aa53dec97 100644 --- a/src/mame/drivers/onetwo.c +++ b/src/mame/drivers/onetwo.c @@ -92,7 +92,7 @@ static VIDEO_START( onetwo ) static SCREEN_UPDATE( onetwo ) { - onetwo_state *state = screen->machine().driver_data(); + onetwo_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/othello.c b/src/mame/drivers/othello.c index 66011665cf3..2cf4e10ae45 100644 --- a/src/mame/drivers/othello.c +++ b/src/mame/drivers/othello.c @@ -118,7 +118,7 @@ static PALETTE_INIT( othello ) static SCREEN_UPDATE( othello ) { - othello_state *state = screen->machine().driver_data(); + othello_state *state = screen.machine().driver_data(); state->m_mc6845->update(bitmap, cliprect); return 0; diff --git a/src/mame/drivers/pachifev.c b/src/mame/drivers/pachifev.c index a26b55f983e..1e367ec8666 100644 --- a/src/mame/drivers/pachifev.c +++ b/src/mame/drivers/pachifev.c @@ -339,7 +339,7 @@ static TMS9928A_INTERFACE(pachifev_tms9928a_interface) static SCREEN_UPDATE( pachifev ) { - tms9928a_device *tms9928a = screen->machine().device( "tms9928a" ); + tms9928a_device *tms9928a = screen.machine().device( "tms9928a" ); tms9928a->update( bitmap, cliprect ); return 0; diff --git a/src/mame/drivers/panicr.c b/src/mame/drivers/panicr.c index d10390ab4a5..b3b5b14e298 100644 --- a/src/mame/drivers/panicr.c +++ b/src/mame/drivers/panicr.c @@ -241,12 +241,12 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan static SCREEN_UPDATE( panicr) { - panicr_state *state = screen->machine().driver_data(); - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + panicr_state *state = screen.machine().driver_data(); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); tilemap_mark_all_tiles_dirty( state->m_txttilemap ); tilemap_set_scrollx( state->m_bgtilemap,0, ((state->m_scrollram[0x02]&0x0f)<<12)+((state->m_scrollram[0x02]&0xf0)<<4)+((state->m_scrollram[0x04]&0x7f)<<1)+((state->m_scrollram[0x04]&0x80)>>7) ); tilemap_draw(bitmap,cliprect,state->m_bgtilemap,0,0); - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_txttilemap,0,0); return 0; diff --git a/src/mame/drivers/pasha2.c b/src/mame/drivers/pasha2.c index 07b3ec073d9..89e3fed1f5a 100644 --- a/src/mame/drivers/pasha2.c +++ b/src/mame/drivers/pasha2.c @@ -334,7 +334,7 @@ static VIDEO_START( pasha2 ) static SCREEN_UPDATE( pasha2 ) { - pasha2_state *state = screen->machine().driver_data(); + pasha2_state *state = screen.machine().driver_data(); int x, y, count; int color; diff --git a/src/mame/drivers/pcxt.c b/src/mame/drivers/pcxt.c index b0f86d8a46d..92a3526831d 100644 --- a/src/mame/drivers/pcxt.c +++ b/src/mame/drivers/pcxt.c @@ -95,14 +95,14 @@ public: static SCREEN_UPDATE( tetriskr ) { - pcxt_state *state = screen->machine().driver_data(); + pcxt_state *state = screen.machine().driver_data(); int x,y; int yi; - const UINT8 *bg_rom = screen->machine().region("gfx2")->base(); + const UINT8 *bg_rom = screen.machine().region("gfx2")->base(); //popmessage("%04x",m_start_offs); - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); for(y=0;y<200/8;y++) { @@ -120,8 +120,8 @@ static SCREEN_UPDATE( tetriskr ) for(pen_i = 0;pen_i<4;pen_i++) color |= ((bg_rom[y*320/8+x+(pen_i*0x20000)+yi*0x400+state->m_bg_bank*0x2000+1] >> (7-xi)) & 1) << pen_i; - if((x+xi)visible_area().max_x && ((y)+yi)visible_area().max_y) - *BITMAP_ADDR16(bitmap, y*8+yi, x*8+xi) = screen->machine().pens[color]; + if((x+xi)machine().device( "tms9928a" ); + tms9928a_device *tms9928a = screen.machine().device( "tms9928a" ); tms9928a->update( bitmap, cliprect ); return 0; diff --git a/src/mame/drivers/peplus.c b/src/mame/drivers/peplus.c index 1ced3ee032c..5a0d6ecda4e 100644 --- a/src/mame/drivers/peplus.c +++ b/src/mame/drivers/peplus.c @@ -674,7 +674,7 @@ static VIDEO_START( peplus ) static SCREEN_UPDATE( peplus ) { - peplus_state *state = screen->machine().driver_data(); + peplus_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; diff --git a/src/mame/drivers/photon.c b/src/mame/drivers/photon.c index 0ae7410b26f..3e659a075c6 100644 --- a/src/mame/drivers/photon.c +++ b/src/mame/drivers/photon.c @@ -199,7 +199,7 @@ static VIDEO_START( photon ) static SCREEN_UPDATE( photon ) { - return pk8000_video_update(screen, bitmap, cliprect, screen->machine().region("maincpu")->base()); + return pk8000_video_update(screen, bitmap, cliprect, screen.machine().region("maincpu")->base()); } static MACHINE_CONFIG_START( photon, photon_state ) diff --git a/src/mame/drivers/photon2.c b/src/mame/drivers/photon2.c index 09a903a4fe9..4bfefc0532a 100644 --- a/src/mame/drivers/photon2.c +++ b/src/mame/drivers/photon2.c @@ -102,7 +102,7 @@ INLINE unsigned char get_display_color (unsigned char color, int invert) independent of frame skip etc. */ static SCREEN_EOF( spectrum ) { - photon2_state *state = machine.driver_data(); + photon2_state *state = screen.machine().driver_data(); state->m_spectrum_frame_number++; if (state->m_spectrum_frame_number >= 25) { @@ -118,7 +118,7 @@ INLINE void spectrum_plot_pixel(bitmap_t *bitmap, int x, int y, UINT32 color) static SCREEN_UPDATE( spectrum ) { - photon2_state *state = screen->machine().driver_data(); + photon2_state *state = screen.machine().driver_data(); /* for now do a full-refresh */ int x, y, b, scrx, scry; unsigned short ink, pap; diff --git a/src/mame/drivers/pinkiri8.c b/src/mame/drivers/pinkiri8.c index ba5ab987fd1..29859e1f235 100644 --- a/src/mame/drivers/pinkiri8.c +++ b/src/mame/drivers/pinkiri8.c @@ -175,15 +175,15 @@ ronjan static SCREEN_UPDATE( pinkiri8 ) { - pinkiri8_state *state = screen->machine().driver_data(); + pinkiri8_state *state = screen.machine().driver_data(); int col_bank; - const gfx_element *gfx = screen->machine().gfx[0]; + const gfx_element *gfx = screen.machine().gfx[0]; int game_type_hack = 0; - if (!strcmp(screen->machine().system().name,"janshi")) game_type_hack = 1; + if (!strcmp(screen.machine().system().name,"janshi")) game_type_hack = 1; - if ( screen->machine().input().code_pressed_once(KEYCODE_W) ) + if ( screen.machine().input().code_pressed_once(KEYCODE_W) ) { int i; int count2; @@ -213,7 +213,7 @@ static SCREEN_UPDATE( pinkiri8 ) //popmessage("%02x",state->m_janshi_crtc_regs[0x0a]); col_bank = (state->m_janshi_crtc_regs[0x0a] & 0x40) >> 6; - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); /* FIXME: color is a bit of a mystery */ { @@ -287,7 +287,7 @@ static SCREEN_UPDATE( pinkiri8 ) if (bit) { - //col = screen->machine().rand(); + //col = screen.machine().rand(); width = 2; } else diff --git a/src/mame/drivers/pipeline.c b/src/mame/drivers/pipeline.c index 2586c24e859..c6c28a3f1b5 100644 --- a/src/mame/drivers/pipeline.c +++ b/src/mame/drivers/pipeline.c @@ -126,7 +126,7 @@ static VIDEO_START ( pipeline ) static SCREEN_UPDATE( pipeline ) { - pipeline_state *state = screen->machine().driver_data(); + pipeline_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_tilemap1, 0,0); tilemap_draw(bitmap,cliprect,state->m_tilemap2, 0,0); return 0; diff --git a/src/mame/drivers/pkscram.c b/src/mame/drivers/pkscram.c index 37682ea54b7..16fd8e5177f 100644 --- a/src/mame/drivers/pkscram.c +++ b/src/mame/drivers/pkscram.c @@ -240,7 +240,7 @@ static VIDEO_START( pkscramble ) static SCREEN_UPDATE( pkscramble ) { - pkscram_state *state = screen->machine().driver_data(); + pkscram_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_md_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); diff --git a/src/mame/drivers/playch10.c b/src/mame/drivers/playch10.c index 30697407c28..ab5ce34d0d7 100644 --- a/src/mame/drivers/playch10.c +++ b/src/mame/drivers/playch10.c @@ -697,14 +697,14 @@ static MACHINE_CONFIG_START( playch10, playch10_state ) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_SIZE(32*8, 262) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) - MCFG_SCREEN_UPDATE(playch10) + MCFG_SCREEN_UPDATE(playch10_top) MCFG_SCREEN_ADD("bottom", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_SIZE(32*8, 262) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) - MCFG_SCREEN_UPDATE(playch10) + MCFG_SCREEN_UPDATE(playch10_bottom) MCFG_PALETTE_INIT(playch10) MCFG_VIDEO_START(playch10) diff --git a/src/mame/drivers/poker72.c b/src/mame/drivers/poker72.c index 7458bba9429..de40572d77f 100644 --- a/src/mame/drivers/poker72.c +++ b/src/mame/drivers/poker72.c @@ -33,7 +33,7 @@ static VIDEO_START(poker72) static SCREEN_UPDATE(poker72) { - poker72_state *state = screen->machine().driver_data(); + poker72_state *state = screen.machine().driver_data(); int x,y,count; count = 0; @@ -49,7 +49,7 @@ static SCREEN_UPDATE(poker72) tile|= state->m_tile_bank << 12; - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tile,color,fx,fy,x*8,y*8); + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],tile,color,fx,fy,x*8,y*8); count+=2; } diff --git a/src/mame/drivers/poo.c b/src/mame/drivers/poo.c index 1a90003f504..a9b7f199b4b 100644 --- a/src/mame/drivers/poo.c +++ b/src/mame/drivers/poo.c @@ -65,10 +65,10 @@ static VIDEO_START(unclepoo) static SCREEN_UPDATE(unclepoo) { - poo_state *state = screen->machine().driver_data(); + poo_state *state = screen.machine().driver_data(); int y,x; int count; - const gfx_element *gfx = screen->machine().gfx[0]; + const gfx_element *gfx = screen.machine().gfx[0]; count = 0; diff --git a/src/mame/drivers/powerbal.c b/src/mame/drivers/powerbal.c index 7d7ab883567..ba2895a8809 100644 --- a/src/mame/drivers/powerbal.c +++ b/src/mame/drivers/powerbal.c @@ -430,10 +430,10 @@ static VIDEO_START( powerbal ) static SCREEN_UPDATE( powerbal ) { - playmark_state *state = screen->machine().driver_data(); + playmark_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/ppmast93.c b/src/mame/drivers/ppmast93.c index 0f5c06216e7..9b75b7f1ebf 100644 --- a/src/mame/drivers/ppmast93.c +++ b/src/mame/drivers/ppmast93.c @@ -351,7 +351,7 @@ static VIDEO_START( ppmast93 ) static SCREEN_UPDATE( ppmast93 ) { - ppmast93_state *state = screen->machine().driver_data(); + ppmast93_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); return 0; diff --git a/src/mame/drivers/progolf.c b/src/mame/drivers/progolf.c index bd83cf3ef4d..07308f8410f 100644 --- a/src/mame/drivers/progolf.c +++ b/src/mame/drivers/progolf.c @@ -89,7 +89,7 @@ static VIDEO_START( progolf ) static SCREEN_UPDATE( progolf ) { - progolf_state *state = screen->machine().driver_data(); + progolf_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; int count,color,x,y,xi,yi; @@ -104,9 +104,9 @@ static SCREEN_UPDATE( progolf ) { int tile = videoram[count]; - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tile,1,0,0,(256-x*8)+scroll,y*8); + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],tile,1,0,0,(256-x*8)+scroll,y*8); /* wrap-around */ - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tile,1,0,0,(256-x*8)+scroll-1024,y*8); + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],tile,1,0,0,(256-x*8)+scroll-1024,y*8); count++; } @@ -128,7 +128,7 @@ static SCREEN_UPDATE( progolf ) color = state->m_fg_fb[(xi+yi*8)+count*0x40]; if((x+yi) <= cliprect->max_x && (256-y+xi) <= cliprect->max_y && color != 0) - *BITMAP_ADDR16(bitmap, x+yi, 256-y+xi) = screen->machine().pens[(color & 0x7)]; + *BITMAP_ADDR16(bitmap, x+yi, 256-y+xi) = screen.machine().pens[(color & 0x7)]; } } diff --git a/src/mame/drivers/psikyo4.c b/src/mame/drivers/psikyo4.c index 7a950f047b3..91d978ed05c 100644 --- a/src/mame/drivers/psikyo4.c +++ b/src/mame/drivers/psikyo4.c @@ -709,7 +709,7 @@ static MACHINE_CONFIG_START( ps4big, psikyo4_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(40*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE(psikyo4) + MCFG_SCREEN_UPDATE(psikyo4_left) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -717,7 +717,7 @@ static MACHINE_CONFIG_START( ps4big, psikyo4_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(40*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE(psikyo4) + MCFG_SCREEN_UPDATE(psikyo4_right) MCFG_VIDEO_START(psikyo4) diff --git a/src/mame/drivers/pturn.c b/src/mame/drivers/pturn.c index a0dfd925d68..de25184ef6c 100644 --- a/src/mame/drivers/pturn.c +++ b/src/mame/drivers/pturn.c @@ -148,7 +148,7 @@ static VIDEO_START(pturn) static SCREEN_UPDATE(pturn) { - pturn_state *state = screen->machine().driver_data(); + pturn_state *state = screen.machine().driver_data(); UINT8 *spriteram = state->m_spriteram; int offs; int sx, sy; @@ -165,13 +165,13 @@ static SCREEN_UPDATE(pturn) flipy=spriteram[offs+1]&0x80; - if (flip_screen_x_get(screen->machine())) + if (flip_screen_x_get(screen.machine())) { sx = 224 - sx; flipx ^= 0x40; } - if (flip_screen_y_get(screen->machine())) + if (flip_screen_y_get(screen.machine())) { flipy ^= 0x80; sy = 224 - sy; @@ -179,7 +179,7 @@ static SCREEN_UPDATE(pturn) if(sx|sy) { - drawgfx_transpen(bitmap, cliprect,screen->machine().gfx[2], + drawgfx_transpen(bitmap, cliprect,screen.machine().gfx[2], spriteram[offs+1] & 0x3f , (spriteram[offs+2] & 0x1f), flipx, flipy, diff --git a/src/mame/drivers/punchout.c b/src/mame/drivers/punchout.c index ae67a413e4e..661a459419e 100644 --- a/src/mame/drivers/punchout.c +++ b/src/mame/drivers/punchout.c @@ -965,7 +965,7 @@ static MACHINE_CONFIG_START( punchout, punchout_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE(punchout) + MCFG_SCREEN_UPDATE(punchout_top) MCFG_SCREEN_ADD("bottom", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -973,7 +973,7 @@ static MACHINE_CONFIG_START( punchout, punchout_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE(punchout) + MCFG_SCREEN_UPDATE(punchout_bottom) MCFG_VIDEO_START(punchout) @@ -1001,9 +1001,9 @@ static MACHINE_CONFIG_DERIVED( armwrest, punchout ) MCFG_VIDEO_START(armwrest) MCFG_SCREEN_MODIFY("top") - MCFG_SCREEN_UPDATE(armwrest) + MCFG_SCREEN_UPDATE(armwrest_top) MCFG_SCREEN_MODIFY("bottom") - MCFG_SCREEN_UPDATE(armwrest) + MCFG_SCREEN_UPDATE(armwrest_bottom) MACHINE_CONFIG_END diff --git a/src/mame/drivers/pzletime.c b/src/mame/drivers/pzletime.c index 5ec769dc64c..0d109bd4113 100644 --- a/src/mame/drivers/pzletime.c +++ b/src/mame/drivers/pzletime.c @@ -77,11 +77,11 @@ static VIDEO_START( pzletime ) static SCREEN_UPDATE( pzletime ) { - pzletime_state *state = screen->machine().driver_data(); + pzletime_state *state = screen.machine().driver_data(); int count; int y, x; - bitmap_fill(bitmap, cliprect, screen->machine().pens[0]); //bg pen + bitmap_fill(bitmap, cliprect, screen.machine().pens[0]); //bg pen tilemap_set_scrolly(state->m_txt_tilemap, 0, state->m_tilemap_regs[0] - 3); tilemap_set_scrollx(state->m_txt_tilemap, 0, state->m_tilemap_regs[1]); @@ -123,12 +123,12 @@ static SCREEN_UPDATE( pzletime ) // is spriteram[offs + 0] & 0x200 flipy? it's always set - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], spr_offs, colour, 0, 1, sx, sy, 0); + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], spr_offs, colour, 0, 1, sx, sy, 0); } } tilemap_draw(bitmap, cliprect, state->m_txt_tilemap, 0, 0); - if ((screen->frame_number() % 16) != 0) + if ((screen.frame_number() % 16) != 0) tilemap_draw(bitmap, cliprect, state->m_txt_tilemap, 1, 0); return 0; diff --git a/src/mame/drivers/quizo.c b/src/mame/drivers/quizo.c index e6c1f8c9580..2e309608d5c 100644 --- a/src/mame/drivers/quizo.c +++ b/src/mame/drivers/quizo.c @@ -75,7 +75,7 @@ static PALETTE_INIT(quizo) static SCREEN_UPDATE( quizo ) { - quizo_state *state = screen->machine().driver_data(); + quizo_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; int x,y; for(y=0;y<200;y++) diff --git a/src/mame/drivers/quizpun2.c b/src/mame/drivers/quizpun2.c index 7c099faaa0c..de3cdd13a34 100644 --- a/src/mame/drivers/quizpun2.c +++ b/src/mame/drivers/quizpun2.c @@ -149,23 +149,23 @@ static VIDEO_START(quizpun2) static SCREEN_UPDATE(quizpun2) { - quizpun2_state *state = screen->machine().driver_data(); + quizpun2_state *state = screen.machine().driver_data(); int layers_ctrl = -1; #ifdef MAME_DEBUG - if (screen->machine().input().code_pressed(KEYCODE_Z)) + if (screen.machine().input().code_pressed(KEYCODE_Z)) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 2; if (msk != 0) layers_ctrl &= msk; } #endif if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect, state->m_bg_tmap, TILEMAP_DRAW_OPAQUE, 0); - else bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + else bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); -bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); +bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect, state->m_fg_tmap, 0, 0); return 0; diff --git a/src/mame/drivers/r2dtank.c b/src/mame/drivers/r2dtank.c index 5f3fb81f89e..bce26e4b8fa 100644 --- a/src/mame/drivers/r2dtank.c +++ b/src/mame/drivers/r2dtank.c @@ -399,7 +399,7 @@ static const mc6845_interface mc6845_intf = static SCREEN_UPDATE( r2dtank ) { - mc6845_device *mc6845 = screen->machine().device("crtc"); + mc6845_device *mc6845 = screen.machine().device("crtc"); mc6845->update(bitmap, cliprect); return 0; diff --git a/src/mame/drivers/r2dx_v33.c b/src/mame/drivers/r2dx_v33.c index 28569b6a2bc..ed738f0e1cf 100644 --- a/src/mame/drivers/r2dx_v33.c +++ b/src/mame/drivers/r2dx_v33.c @@ -181,13 +181,13 @@ static VIDEO_START( rdx_v33 ) static SCREEN_UPDATE( rdx_v33 ) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, md_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); - draw_sprites(screen->machine(),bitmap,cliprect,0); + draw_sprites(screen.machine(),bitmap,cliprect,0); tilemap_draw(bitmap, cliprect, tx_tilemap, 0, 0); @@ -196,19 +196,19 @@ static SCREEN_UPDATE( rdx_v33 ) { static UINT32 src_addr = 0x100000; static int frame; - address_space *space = screen->machine().device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); - //if(screen->machine().input().code_pressed_once(KEYCODE_A)) + //if(screen.machine().input().code_pressed_once(KEYCODE_A)) // src_addr+=0x800; - //if(screen->machine().input().code_pressed_once(KEYCODE_S)) + //if(screen.machine().input().code_pressed_once(KEYCODE_S)) // src_addr-=0x800; frame++; popmessage("%08x 0",src_addr); - //if(screen->machine().input().code_pressed_once(KEYCODE_Z)) + //if(screen.machine().input().code_pressed_once(KEYCODE_Z)) if(frame == 5) { int i,data; diff --git a/src/mame/drivers/rabbit.c b/src/mame/drivers/rabbit.c index 4829b482f8f..2d4c5c2cf12 100644 --- a/src/mame/drivers/rabbit.c +++ b/src/mame/drivers/rabbit.c @@ -431,10 +431,10 @@ static void rabbit_drawtilemap( running_machine &machine, bitmap_t *bitmap, cons static SCREEN_UPDATE(rabbit) { - rabbit_state *state = screen->machine().driver_data(); + rabbit_state *state = screen.machine().driver_data(); int prilevel; - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); // popmessage("%08x %08x", state->m_viewregs0[0], state->m_viewregs0[1]); // popmessage("%08x %08x %08x %08x %08x %08x", state->m_tilemap_regs[0][0],state->m_tilemap_regs[0][1],state->m_tilemap_regs[0][2],state->m_tilemap_regs[0][3],state->m_tilemap_regs[0][4],state->m_tilemap_regs[0][5]); @@ -452,16 +452,16 @@ static SCREEN_UPDATE(rabbit) /* prio isnt certain but seems to work.. */ for (prilevel = 0xf; prilevel >0; prilevel--) { - if (prilevel == ((state->m_tilemap_regs[3][0]&0x0f000000)>>24)) rabbit_drawtilemap(screen->machine(),bitmap,cliprect, 3); - if (prilevel == ((state->m_tilemap_regs[2][0]&0x0f000000)>>24)) rabbit_drawtilemap(screen->machine(),bitmap,cliprect, 2); - if (prilevel == ((state->m_tilemap_regs[1][0]&0x0f000000)>>24)) rabbit_drawtilemap(screen->machine(),bitmap,cliprect, 1); - if (prilevel == ((state->m_tilemap_regs[0][0]&0x0f000000)>>24)) rabbit_drawtilemap(screen->machine(),bitmap,cliprect, 0); + if (prilevel == ((state->m_tilemap_regs[3][0]&0x0f000000)>>24)) rabbit_drawtilemap(screen.machine(),bitmap,cliprect, 3); + if (prilevel == ((state->m_tilemap_regs[2][0]&0x0f000000)>>24)) rabbit_drawtilemap(screen.machine(),bitmap,cliprect, 2); + if (prilevel == ((state->m_tilemap_regs[1][0]&0x0f000000)>>24)) rabbit_drawtilemap(screen.machine(),bitmap,cliprect, 1); + if (prilevel == ((state->m_tilemap_regs[0][0]&0x0f000000)>>24)) rabbit_drawtilemap(screen.machine(),bitmap,cliprect, 0); if (prilevel == 0x09) // should it be selectable? { - rabbit_clearspritebitmap(screen->machine(),bitmap,cliprect); - draw_sprites(screen->machine(),bitmap,cliprect); // render to bitmap - draw_sprite_bitmap(screen->machine(),bitmap,cliprect); // copy bitmap to screen + rabbit_clearspritebitmap(screen.machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); // render to bitmap + draw_sprite_bitmap(screen.machine(),bitmap,cliprect); // copy bitmap to screen } } return 0; diff --git a/src/mame/drivers/raiden.c b/src/mame/drivers/raiden.c index 299e393fe4f..43a3359993a 100644 --- a/src/mame/drivers/raiden.c +++ b/src/mame/drivers/raiden.c @@ -244,7 +244,7 @@ static INTERRUPT_GEN( raiden_interrupt ) static SCREEN_EOF( raiden ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram16_w(space,0,0,0xffff); /* Could be a memory location instead */ } diff --git a/src/mame/drivers/raiden2.c b/src/mame/drivers/raiden2.c index 57b3ec15ca3..112eaa7856c 100644 --- a/src/mame/drivers/raiden2.c +++ b/src/mame/drivers/raiden2.c @@ -888,34 +888,34 @@ static VIDEO_START( raiden2 ) static SCREEN_UPDATE( raiden2 ) { - raiden2_state *state = screen->machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + raiden2_state *state = screen.machine().driver_data(); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); - //if (!screen->machine().input().code_pressed(KEYCODE_Q)) + //if (!screen.machine().input().code_pressed(KEYCODE_Q)) { if (!(state->raiden2_tilemap_enable & 1)) tilemap_draw(bitmap, cliprect, state->background_layer, 0, 0); } - //if (!screen->machine().input().code_pressed(KEYCODE_W)) + //if (!screen.machine().input().code_pressed(KEYCODE_W)) { if (!(state->raiden2_tilemap_enable & 2)) tilemap_draw(bitmap, cliprect, state->midground_layer, 0, 0); } - //if (!screen->machine().input().code_pressed(KEYCODE_E)) + //if (!screen.machine().input().code_pressed(KEYCODE_E)) { if (!(state->raiden2_tilemap_enable & 4)) tilemap_draw(bitmap, cliprect, state->foreground_layer, 0, 0); } - //if (!screen->machine().input().code_pressed(KEYCODE_S)) + //if (!screen.machine().input().code_pressed(KEYCODE_S)) { //if (!(raiden2_tilemap_enable & 0x10)) - state->draw_sprites(screen->machine(), bitmap, cliprect, 0); + state->draw_sprites(screen.machine(), bitmap, cliprect, 0); } - //if (!screen->machine().input().code_pressed(KEYCODE_A)) + //if (!screen.machine().input().code_pressed(KEYCODE_A)) { if (!(state->raiden2_tilemap_enable & 8)) tilemap_draw(bitmap, cliprect, state->text_layer, 0, 0); diff --git a/src/mame/drivers/rbmk.c b/src/mame/drivers/rbmk.c index 7dfecd075f4..9d89d99bd17 100644 --- a/src/mame/drivers/rbmk.c +++ b/src/mame/drivers/rbmk.c @@ -493,7 +493,7 @@ static VIDEO_START(rbmk) static SCREEN_UPDATE(rbmk) { - rbmk_state *state = screen->machine().driver_data(); + rbmk_state *state = screen.machine().driver_data(); int x,y; int count = 0; @@ -502,7 +502,7 @@ static SCREEN_UPDATE(rbmk) for (x=0;x<64;x++) { int tile = state->m_gms_vidram2[count+0x600]; - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],(tile&0xfff)+((state->m_tilebank&0x10)>>4)*0x1000,tile>>12,0,0,x*8,y*32); + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],(tile&0xfff)+((state->m_tilebank&0x10)>>4)*0x1000,tile>>12,0,0,x*8,y*32); count++; } } @@ -514,7 +514,7 @@ static SCREEN_UPDATE(rbmk) for (x=0;x<64;x++) { int tile = state->m_gms_vidram[count]; - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],(tile&0xfff)+((state->m_tilebank>>1)&3)*0x1000,tile>>12,0,0,x*8,y*8,0); + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],(tile&0xfff)+((state->m_tilebank>>1)&3)*0x1000,tile>>12,0,0,x*8,y*8,0); count++; } } diff --git a/src/mame/drivers/re900.c b/src/mame/drivers/re900.c index f6dbda7b0ed..6e9eaca9863 100644 --- a/src/mame/drivers/re900.c +++ b/src/mame/drivers/re900.c @@ -372,7 +372,7 @@ static TMS9928A_INTERFACE(re900_tms9928a_interface) static SCREEN_UPDATE( re900 ) { - tms9928a_device *tms9928a = screen->machine().device( "tms9128" ); + tms9928a_device *tms9928a = screen.machine().device( "tms9128" ); tms9928a->update( bitmap, cliprect ); return 0; diff --git a/src/mame/drivers/rgum.c b/src/mame/drivers/rgum.c index bbd74b2a8a1..e20c9e9cdf8 100644 --- a/src/mame/drivers/rgum.c +++ b/src/mame/drivers/rgum.c @@ -37,9 +37,9 @@ static VIDEO_START(royalgum) static SCREEN_UPDATE(royalgum) { - rgum_state *state = screen->machine().driver_data(); + rgum_state *state = screen.machine().driver_data(); int x,y,count; - const gfx_element *gfx = screen->machine().gfx[0]; + const gfx_element *gfx = screen.machine().gfx[0]; count = 0; diff --git a/src/mame/drivers/rmhaihai.c b/src/mame/drivers/rmhaihai.c index 6da9da02ef7..25d0c009a89 100644 --- a/src/mame/drivers/rmhaihai.c +++ b/src/mame/drivers/rmhaihai.c @@ -82,7 +82,7 @@ static VIDEO_START( rmhaihai ) static SCREEN_UPDATE( rmhaihai ) { - rmhaihai_state *state = screen->machine().driver_data(); + rmhaihai_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/rotaryf.c b/src/mame/drivers/rotaryf.c index 753e97fb01f..2ac4709689b 100644 --- a/src/mame/drivers/rotaryf.c +++ b/src/mame/drivers/rotaryf.c @@ -65,7 +65,7 @@ static TIMER_DEVICE_CALLBACK( rotaryf_interrupt ) static SCREEN_UPDATE( rotaryf ) { - rotaryf_state *state = screen->machine().driver_data(); + rotaryf_state *state = screen.machine().driver_data(); offs_t offs; for (offs = 0; offs < state->m_videoram_size; offs++) diff --git a/src/mame/drivers/roul.c b/src/mame/drivers/roul.c index 18252a94140..b96e197ab39 100644 --- a/src/mame/drivers/roul.c +++ b/src/mame/drivers/roul.c @@ -212,7 +212,7 @@ static VIDEO_START(roul) static SCREEN_UPDATE(roul) { - roul_state *state = screen->machine().driver_data(); + roul_state *state = screen.machine().driver_data(); int i,j; for (i = 0; i < 256; i++) for (j = 0; j < 256; j++) diff --git a/src/mame/drivers/royalmah.c b/src/mame/drivers/royalmah.c index 006e82f677c..028a9bdd0bc 100644 --- a/src/mame/drivers/royalmah.c +++ b/src/mame/drivers/royalmah.c @@ -214,7 +214,7 @@ static WRITE8_HANDLER( mjderngr_palbank_w ) static SCREEN_UPDATE( royalmah ) { - royalmah_state *state = screen->machine().driver_data(); + royalmah_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; offs_t offs; diff --git a/src/mame/drivers/safarir.c b/src/mame/drivers/safarir.c index 049cfc8bf99..31f7edabfff 100644 --- a/src/mame/drivers/safarir.c +++ b/src/mame/drivers/safarir.c @@ -196,7 +196,7 @@ static VIDEO_START( safarir ) static SCREEN_UPDATE( safarir ) { - safarir_state *state = screen->machine().driver_data(); + safarir_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, *state->m_bg_scroll); diff --git a/src/mame/drivers/sandscrp.c b/src/mame/drivers/sandscrp.c index f0a66038762..5cc87d518ea 100644 --- a/src/mame/drivers/sandscrp.c +++ b/src/mame/drivers/sandscrp.c @@ -136,10 +136,10 @@ static INTERRUPT_GEN( sandscrp_interrupt ) static SCREEN_EOF( sandscrp ) { - sandscrp_state *state = machine.driver_data(); - device_t *pandora = machine.device("pandora"); + sandscrp_state *state = screen.machine().driver_data(); + device_t *pandora = screen.machine().device("pandora"); state->m_sprite_irq = 1; - update_irq_state(machine); + update_irq_state(screen.machine()); pandora_eof(pandora); } diff --git a/src/mame/drivers/sbowling.c b/src/mame/drivers/sbowling.c index 27c19710aa7..536b8ed27de 100644 --- a/src/mame/drivers/sbowling.c +++ b/src/mame/drivers/sbowling.c @@ -110,7 +110,7 @@ static WRITE8_HANDLER( sbw_videoram_w ) static SCREEN_UPDATE(sbowling) { - sbowling_state *state = screen->machine().driver_data(); + sbowling_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, 0x18); tilemap_draw(bitmap, cliprect,state->m_sb_tilemap, 0, 0); diff --git a/src/mame/drivers/sbrkout.c b/src/mame/drivers/sbrkout.c index 9d8bd9e35ab..6902f68740d 100644 --- a/src/mame/drivers/sbrkout.c +++ b/src/mame/drivers/sbrkout.c @@ -323,7 +323,7 @@ static WRITE8_HANDLER( sbrkout_videoram_w ) static SCREEN_UPDATE( sbrkout ) { - sbrkout_state *state = screen->machine().driver_data(); + sbrkout_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; int ball; @@ -335,7 +335,7 @@ static SCREEN_UPDATE( sbrkout ) int sx = 31 * 8 - videoram[0x380 + 0x10 + ball * 2]; int sy = 30 * 8 - videoram[0x380 + 0x18 + ball * 2]; - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], code, 0, 0, 0, sx, sy, 0); + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], code, 0, 0, 0, sx, sy, 0); } return 0; } diff --git a/src/mame/drivers/seattle.c b/src/mame/drivers/seattle.c index 1badd31bac9..05545d51329 100644 --- a/src/mame/drivers/seattle.c +++ b/src/mame/drivers/seattle.c @@ -479,7 +479,7 @@ static void update_widget_irq(running_machine &machine); static SCREEN_UPDATE( seattle ) { - seattle_state *state = screen->machine().driver_data(); + seattle_state *state = screen.machine().driver_data(); return voodoo_update(state->m_voodoo, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED; } diff --git a/src/mame/drivers/segac2.c b/src/mame/drivers/segac2.c index 1d22ae309b0..cd0ccc0147a 100644 --- a/src/mame/drivers/segac2.c +++ b/src/mame/drivers/segac2.c @@ -1264,10 +1264,10 @@ static VIDEO_START(segac2_new) static SCREEN_UPDATE(segac2_new) { - segac2_state *state = screen->machine().driver_data(); + segac2_state *state = screen.machine().driver_data(); if (!state->m_segac2_enable_display) { - bitmap_fill(bitmap, NULL, get_black_pen(screen->machine())); + bitmap_fill(bitmap, NULL, get_black_pen(screen.machine())); return 0; } diff --git a/src/mame/drivers/segald.c b/src/mame/drivers/segald.c index f27da9690d5..9ecaccc031e 100644 --- a/src/mame/drivers/segald.c +++ b/src/mame/drivers/segald.c @@ -93,8 +93,8 @@ static SCREEN_UPDATE( astron ) { bitmap_fill(bitmap, cliprect, 0); - astron_draw_characters(screen->machine(), bitmap, cliprect); - astron_draw_sprites(screen->machine(), bitmap, cliprect); + astron_draw_characters(screen.machine(), bitmap, cliprect); + astron_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/segas32.c b/src/mame/drivers/segas32.c index 3cf0a784569..d1dd2b70d47 100644 --- a/src/mame/drivers/segas32.c +++ b/src/mame/drivers/segas32.c @@ -2257,14 +2257,14 @@ static MACHINE_CONFIG_START( multi32, segas32_state ) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_SIZE(52*8, 262) MCFG_SCREEN_VISIBLE_AREA(0*8, 52*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE(multi32) + MCFG_SCREEN_UPDATE(multi32_left) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_SIZE(52*8, 262) MCFG_SCREEN_VISIBLE_AREA(0*8, 52*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE(multi32) + MCFG_SCREEN_UPDATE(multi32_right) MCFG_VIDEO_START(multi32) diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c index aef913cd6e3..ea70d89545c 100644 --- a/src/mame/drivers/seta.c +++ b/src/mame/drivers/seta.c @@ -1548,7 +1548,7 @@ static READ8_DEVICE_HANDLER( dsw2_r ) static SCREEN_EOF( seta_buffer_sprites ) { //seta_state *state = machine.driver_data(); - machine.device("spritegen")->setac_eof(); + screen.machine().device("spritegen")->setac_eof(); } diff --git a/src/mame/drivers/sfbonus.c b/src/mame/drivers/sfbonus.c index 6d68b941e3c..a54a836c846 100644 --- a/src/mame/drivers/sfbonus.c +++ b/src/mame/drivers/sfbonus.c @@ -781,13 +781,13 @@ static VIDEO_START(sfbonus) } -static void sfbonus_draw_reel_layer(screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int catagory) +static void sfbonus_draw_reel_layer(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int catagory) { - sfbonus_state *state = screen->machine().driver_data(); + sfbonus_state *state = screen.machine().driver_data(); int zz; int i; int startclipmin; - const rectangle &visarea = screen->visible_area(); + const rectangle &visarea = screen.visible_area(); UINT8* selectbase = &state->m_videoram[0x600]; UINT8* bg_scroll = &state->m_videoram[0x000]; UINT8* reels_rowscroll = &state->m_videoram[0x400]; @@ -922,7 +922,7 @@ static void sfbonus_draw_reel_layer(screen_device *screen, bitmap_t *bitmap, con static SCREEN_UPDATE(sfbonus) { - sfbonus_state *state = screen->machine().driver_data(); + sfbonus_state *state = screen.machine().driver_data(); int globalyscroll = (state->m_vregs[2] | state->m_vregs[3]<<8); int globalxscroll = (state->m_vregs[0] | state->m_vregs[1]<<8); @@ -934,8 +934,8 @@ static SCREEN_UPDATE(sfbonus) globalyscroll += 8; globalxscroll += 8; - bitmap_fill(bitmap,cliprect,screen->machine().pens[0]); - bitmap_fill(state->m_temp_reel_bitmap,cliprect,screen->machine().pens[0]); + bitmap_fill(bitmap,cliprect,screen.machine().pens[0]); + bitmap_fill(state->m_temp_reel_bitmap,cliprect,screen.machine().pens[0]); /* render reels to bitmap */ sfbonus_draw_reel_layer(screen,state->m_temp_reel_bitmap,cliprect,0); @@ -1031,7 +1031,7 @@ static SCREEN_UPDATE(sfbonus) state->m_1800_regs[7]); #endif - ipt = screen->machine().system().ipt; + ipt = screen.machine().system().ipt; if ((ipt == INPUT_PORTS_NAME(amcoe2_reels3)) || (ipt == INPUT_PORTS_NAME(amcoe2_reels4)) || (ipt == INPUT_PORTS_NAME(amcoe2_poker))) { diff --git a/src/mame/drivers/sg1000a.c b/src/mame/drivers/sg1000a.c index e9f224df3c5..41c2810d224 100644 --- a/src/mame/drivers/sg1000a.c +++ b/src/mame/drivers/sg1000a.c @@ -263,7 +263,7 @@ static I8255_INTERFACE( ppi8255_intf ) static SCREEN_UPDATE( sg1000a ) { - tms9928a_device *tms9928a = screen->machine().device( "tms9928a" ); + tms9928a_device *tms9928a = screen.machine().device( "tms9928a" ); tms9928a->update( bitmap, cliprect ); return 0; diff --git a/src/mame/drivers/shanghai.c b/src/mame/drivers/shanghai.c index 5be3ba23057..c389f16adaf 100644 --- a/src/mame/drivers/shanghai.c +++ b/src/mame/drivers/shanghai.c @@ -73,7 +73,7 @@ static VIDEO_START( shanghai ) static SCREEN_UPDATE( shanghai ) { - device_t *hd63484 = screen->machine().device("hd63484"); + device_t *hd63484 = screen.machine().device("hd63484"); int x, y, b, src; b = ((hd63484_regs_r(hd63484, 0xcc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(hd63484, 0xce/2, 0xffff); diff --git a/src/mame/drivers/shougi.c b/src/mame/drivers/shougi.c index 700280c68c0..843e87ea8e9 100644 --- a/src/mame/drivers/shougi.c +++ b/src/mame/drivers/shougi.c @@ -162,7 +162,7 @@ static PALETTE_INIT( shougi ) static SCREEN_UPDATE( shougi ) { - shougi_state *state = screen->machine().driver_data(); + shougi_state *state = screen.machine().driver_data(); int offs; for (offs = 0;offs <0x4000; offs++) diff --git a/src/mame/drivers/sigmab52.c b/src/mame/drivers/sigmab52.c index 9f41e140d3b..0f51f213e01 100644 --- a/src/mame/drivers/sigmab52.c +++ b/src/mame/drivers/sigmab52.c @@ -158,7 +158,7 @@ static VIDEO_START( jwildb52 ) static SCREEN_UPDATE( jwildb52 ) { - device_t *hd63484 = screen->machine().device("hd63484"); + device_t *hd63484 = screen.machine().device("hd63484"); int x, y, b, src; @@ -166,7 +166,7 @@ static SCREEN_UPDATE( jwildb52 ) //save vram to file #if 0 - if (screen->machine().input().code_pressed_once(KEYCODE_Q)) + if (screen.machine().input().code_pressed_once(KEYCODE_Q)) { FILE *p = fopen("vram.bin", "wb"); fwrite(&HD63484_ram[0], 1, 0x40000 * 4, p); @@ -190,7 +190,7 @@ static SCREEN_UPDATE( jwildb52 ) } } -if (!screen->machine().input().code_pressed(KEYCODE_O)) +if (!screen.machine().input().code_pressed(KEYCODE_O)) if ((hd63484_regs_r(hd63484, 0x06/2, 0xffff) & 0x0300) == 0x0300) { int sy = (hd63484_regs_r(hd63484, 0x94/2, 0xffff) & 0x0fff) - (hd63484_regs_r(hd63484, 0x88/2, 0xffff) >> 8); diff --git a/src/mame/drivers/sigmab98.c b/src/mame/drivers/sigmab98.c index 92f9d9099ea..170de8f6b85 100644 --- a/src/mame/drivers/sigmab98.c +++ b/src/mame/drivers/sigmab98.c @@ -254,24 +254,24 @@ static SCREEN_UPDATE(sigmab98) int layers_ctrl = -1; #ifdef MAME_DEBUG - if (screen->machine().input().code_pressed(KEYCODE_Z)) + if (screen.machine().input().code_pressed(KEYCODE_Z)) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= 2; - if (screen->machine().input().code_pressed(KEYCODE_E)) msk |= 4; - if (screen->machine().input().code_pressed(KEYCODE_R)) msk |= 8; + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (screen.machine().input().code_pressed(KEYCODE_E)) msk |= 4; + if (screen.machine().input().code_pressed(KEYCODE_R)) msk |= 8; if (msk != 0) layers_ctrl &= msk; } #endif - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); // Draw from priority 3 (bottom, converted to a bitmask) to priority 0 (top) - draw_sprites(screen->machine(), bitmap, cliprect, layers_ctrl & 8); - draw_sprites(screen->machine(), bitmap, cliprect, layers_ctrl & 4); - draw_sprites(screen->machine(), bitmap, cliprect, layers_ctrl & 2); - draw_sprites(screen->machine(), bitmap, cliprect, layers_ctrl & 1); + draw_sprites(screen.machine(), bitmap, cliprect, layers_ctrl & 8); + draw_sprites(screen.machine(), bitmap, cliprect, layers_ctrl & 4); + draw_sprites(screen.machine(), bitmap, cliprect, layers_ctrl & 2); + draw_sprites(screen.machine(), bitmap, cliprect, layers_ctrl & 1); return 0; } @@ -640,7 +640,7 @@ static WRITE8_HANDLER( vblank_w ) static SCREEN_EOF( sammymdl ) { - sigmab98_state *state = machine.driver_data(); + sigmab98_state *state = screen.machine().driver_data(); state->m_vblank &= ~0x01; } diff --git a/src/mame/drivers/skimaxx.c b/src/mame/drivers/skimaxx.c index 21ccc737000..3e7815f03dd 100644 --- a/src/mame/drivers/skimaxx.c +++ b/src/mame/drivers/skimaxx.c @@ -139,7 +139,7 @@ static VIDEO_START( skimaxx ) static SCREEN_UPDATE( skimaxx ) { -// popmessage("%02x %02x", input_port_read(screen->machine(), "X"), input_port_read(screen->machine(), "Y") ); +// popmessage("%02x %02x", input_port_read(screen.machine(), "X"), input_port_read(screen.machine(), "Y") ); SCREEN_UPDATE_CALL(tms340x0); diff --git a/src/mame/drivers/skyarmy.c b/src/mame/drivers/skyarmy.c index df706aa6785..990bd3f2c97 100644 --- a/src/mame/drivers/skyarmy.c +++ b/src/mame/drivers/skyarmy.c @@ -117,7 +117,7 @@ static VIDEO_START( skyarmy ) static SCREEN_UPDATE( skyarmy ) { - skyarmy_state *state = screen->machine().driver_data(); + skyarmy_state *state = screen.machine().driver_data(); UINT8 *spriteram = state->m_spriteram; int sx, sy, flipx, flipy, offs,pal; int i; @@ -136,7 +136,7 @@ static SCREEN_UPDATE( skyarmy ) flipy = (spriteram[offs+1]&0x80)>>7; flipx = (spriteram[offs+1]&0x40)>>6; - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1], spriteram[offs+1]&0x3f, pal, flipx,flipy, diff --git a/src/mame/drivers/skylncr.c b/src/mame/drivers/skylncr.c index 8937a77169e..dc879792055 100644 --- a/src/mame/drivers/skylncr.c +++ b/src/mame/drivers/skylncr.c @@ -156,7 +156,7 @@ static const rectangle visible3 = { 0*8, (20+48)*8-1, 20*8, (20+7)*8-1 }; static SCREEN_UPDATE( skylncr ) { - skylncr_state *state = screen->machine().driver_data(); + skylncr_state *state = screen.machine().driver_data(); int i; bitmap_fill(bitmap,cliprect,0); diff --git a/src/mame/drivers/slapfght.c b/src/mame/drivers/slapfght.c index 0ab83210ecf..71af6582954 100644 --- a/src/mame/drivers/slapfght.c +++ b/src/mame/drivers/slapfght.c @@ -736,7 +736,7 @@ static const ay8910_interface ay8910_interface_2 = static SCREEN_EOF( perfrman ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram_w(space, 0, 0); } diff --git a/src/mame/drivers/sliver.c b/src/mame/drivers/sliver.c index 06fe76e1c7d..8ced54f29e9 100644 --- a/src/mame/drivers/sliver.c +++ b/src/mame/drivers/sliver.c @@ -472,7 +472,7 @@ static VIDEO_START(sliver) static SCREEN_UPDATE(sliver) { - sliver_state *state = screen->machine().driver_data(); + sliver_state *state = screen.machine().driver_data(); copybitmap (bitmap, state->m_bitmap_bg, 0, 0, 0, 0, cliprect); copybitmap_trans(bitmap, state->m_bitmap_fg, 0, 0, 0, 0, cliprect, 0); diff --git a/src/mame/drivers/slotcarn.c b/src/mame/drivers/slotcarn.c index 276d39f99b5..2023b52408b 100644 --- a/src/mame/drivers/slotcarn.c +++ b/src/mame/drivers/slotcarn.c @@ -537,7 +537,7 @@ GFXDECODE_END static SCREEN_UPDATE( slotcarn ) { - mc6845_device *mc6845 = screen->machine().device("crtc"); + mc6845_device *mc6845 = screen.machine().device("crtc"); mc6845->update(bitmap, cliprect); return 0; diff --git a/src/mame/drivers/sms.c b/src/mame/drivers/sms.c index 0666231867e..04929b418c1 100644 --- a/src/mame/drivers/sms.c +++ b/src/mame/drivers/sms.c @@ -473,7 +473,7 @@ static VIDEO_START( sms ) static SCREEN_UPDATE( sms ) { - sms_state *state = screen->machine().driver_data(); + sms_state *state = screen.machine().driver_data(); copybitmap(bitmap, state->m_bitmap, 0, 0, 0, 0, cliprect); return 0; } diff --git a/src/mame/drivers/snowbros.c b/src/mame/drivers/snowbros.c index 0a948aa9987..6f0d268e9fa 100644 --- a/src/mame/drivers/snowbros.c +++ b/src/mame/drivers/snowbros.c @@ -83,7 +83,7 @@ static WRITE16_HANDLER( snowbros_flipscreen_w ) static SCREEN_UPDATE( snowbros ) { - device_t *pandora = screen->machine().device("pandora"); + device_t *pandora = screen.machine().device("pandora"); /* This clears & redraws the entire screen each pass */ bitmap_fill(bitmap,cliprect,0xf0); @@ -94,7 +94,7 @@ static SCREEN_UPDATE( snowbros ) static SCREEN_EOF( snowbros ) { - device_t *pandora = machine.device("pandora"); + device_t *pandora = screen.machine().device("pandora"); pandora_eof(pandora); } diff --git a/src/mame/drivers/spaceg.c b/src/mame/drivers/spaceg.c index 17a5b46c3dc..d997b3ba1e3 100644 --- a/src/mame/drivers/spaceg.c +++ b/src/mame/drivers/spaceg.c @@ -294,7 +294,7 @@ static READ8_HANDLER(spaceg_colorram_r) static SCREEN_UPDATE( spaceg ) { - spaceg_state *state = screen->machine().driver_data(); + spaceg_state *state = screen.machine().driver_data(); offs_t offs; for (offs = 0; offs < 0x2000; offs++) diff --git a/src/mame/drivers/speglsht.c b/src/mame/drivers/speglsht.c index 1e5ec8b082d..9117b4f8f8a 100644 --- a/src/mame/drivers/speglsht.c +++ b/src/mame/drivers/speglsht.c @@ -345,7 +345,7 @@ static VIDEO_START(speglsht) static SCREEN_UPDATE(speglsht) { - speglsht_state *state = screen->machine().driver_data(); + speglsht_state *state = screen.machine().driver_data(); int x,y,dy; dy=(state->m_videoreg&0x20)?(256*512):0; //visible frame @@ -371,7 +371,7 @@ static SCREEN_UPDATE(speglsht) { if(srcline[x]) { - rgb_t color=palette_get_color(screen->machine(), srcline[x]); + rgb_t color=palette_get_color(screen.machine(), srcline[x]); PLOT_PIXEL_RGB(x,y,RGB_RED(color),RGB_GREEN(color),RGB_BLUE(color)); } } diff --git a/src/mame/drivers/spiders.c b/src/mame/drivers/spiders.c index 55072b2ae2c..74a6ca6633b 100644 --- a/src/mame/drivers/spiders.c +++ b/src/mame/drivers/spiders.c @@ -523,7 +523,7 @@ static const mc6845_interface mc6845_intf = static SCREEN_UPDATE( spiders ) { - mc6845_device *mc6845 = screen->machine().device("crtc"); + mc6845_device *mc6845 = screen.machine().device("crtc"); mc6845->update(bitmap, cliprect); return 0; diff --git a/src/mame/drivers/spoker.c b/src/mame/drivers/spoker.c index 97fbcabaa19..73d157e9c47 100644 --- a/src/mame/drivers/spoker.c +++ b/src/mame/drivers/spoker.c @@ -91,9 +91,9 @@ static VIDEO_START(spoker) static SCREEN_UPDATE(spoker) { - spoker_state *state = screen->machine().driver_data(); + spoker_state *state = screen.machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; diff --git a/src/mame/drivers/spool99.c b/src/mame/drivers/spool99.c index ccd80f8dbab..1727c2b494e 100644 --- a/src/mame/drivers/spool99.c +++ b/src/mame/drivers/spool99.c @@ -128,7 +128,7 @@ static VIDEO_START(spool99) static SCREEN_UPDATE(spool99) { - spool99_state *state = screen->machine().driver_data(); + spool99_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_sc0_tilemap,0,0); return 0; diff --git a/src/mame/drivers/srmp5.c b/src/mame/drivers/srmp5.c index 96d8120af45..c6d2d52e461 100644 --- a/src/mame/drivers/srmp5.c +++ b/src/mame/drivers/srmp5.c @@ -87,12 +87,12 @@ public: static SCREEN_UPDATE( srmp5 ) { - srmp5_state *state = screen->machine().driver_data(); + srmp5_state *state = screen.machine().driver_data(); int x,y,address,xs,xs2,ys,ys2,height,width,xw,yw,xb,yb,sizex,sizey; UINT16 *sprite_list=state->m_sprram; UINT16 *sprite_list_end=&state->m_sprram[0x4000]; //guess UINT8 *pixels=(UINT8 *)state->m_tileram; - const rectangle &visarea = screen->visible_area(); + const rectangle &visarea = screen.visible_area(); //Table surface seems to be tiles, but display corrupts when switching the scene if always ON. //Currently the tiles are OFF. @@ -193,7 +193,7 @@ static SCREEN_UPDATE( srmp5 ) { if (state->m_tileduty[i] == 1) { - gfx_element_decode(screen->machine().gfx[0], i); + gfx_element_decode(screen.machine().gfx[0], i); state->m_tileduty[i] = 0; } } diff --git a/src/mame/drivers/srmp6.c b/src/mame/drivers/srmp6.c index 49210e0ace6..6d5cd3acb00 100644 --- a/src/mame/drivers/srmp6.c +++ b/src/mame/drivers/srmp6.c @@ -160,7 +160,7 @@ static int xixi=0; static SCREEN_UPDATE(srmp6) { - srmp6_state *state = screen->machine().driver_data(); + srmp6_state *state = screen.machine().driver_data(); int alpha; int x,y,tileno,height,width,xw,yw,sprite,xb,yb; UINT16 *sprite_list = state->m_sprram_old; @@ -176,13 +176,13 @@ static SCREEN_UPDATE(srmp6) #if 0 /* debug */ - if(screen->machine().input().code_pressed_once(KEYCODE_Q)) + if(screen.machine().input().code_pressed_once(KEYCODE_Q)) { ++xixi; printf("%x\n",xixi); } - if(screen->machine().input().code_pressed_once(KEYCODE_W)) + if(screen.machine().input().code_pressed_once(KEYCODE_W)) { --xixi; printf("%x\n",xixi); @@ -259,7 +259,7 @@ static SCREEN_UPDATE(srmp6) else yb=y+(height-yw-1)*8+global_y; - drawgfx_alpha(bitmap,cliprect,screen->machine().gfx[0],tileno,global_pal,flip_x,flip_y,xb,yb,0,alpha); + drawgfx_alpha(bitmap,cliprect,screen.machine().gfx[0],tileno,global_pal,flip_x,flip_y,xb,yb,0,alpha); tileno++; } } @@ -273,7 +273,7 @@ static SCREEN_UPDATE(srmp6) memcpy(state->m_sprram_old, state->m_sprram, 0x80000); - if(screen->machine().input().code_pressed_once(KEYCODE_Q)) + if(screen.machine().input().code_pressed_once(KEYCODE_Q)) { FILE *p=fopen("tileram.bin","wb"); fwrite(state->m_tileram, 1, 0x100000*16, p); diff --git a/src/mame/drivers/ssfindo.c b/src/mame/drivers/ssfindo.c index 35c1b8e931e..e5a4fbedfd6 100644 --- a/src/mame/drivers/ssfindo.c +++ b/src/mame/drivers/ssfindo.c @@ -238,7 +238,7 @@ static void PS7500_startTimer1(running_machine &machine); static SCREEN_UPDATE(ssfindo) { - ssfindo_state *state = screen->machine().driver_data(); + ssfindo_state *state = screen.machine().driver_data(); int s,x,y; if( state->m_PS7500_IO[VIDCR]&0x20) //video DMA enabled diff --git a/src/mame/drivers/sshot.c b/src/mame/drivers/sshot.c index eeed347c9ad..691a3054a4c 100644 --- a/src/mame/drivers/sshot.c +++ b/src/mame/drivers/sshot.c @@ -191,7 +191,7 @@ static VIDEO_START( supershot ) static SCREEN_UPDATE( supershot ) { - supershot_state *state = screen->machine().driver_data(); + supershot_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/ssingles.c b/src/mame/drivers/ssingles.c index 0c378bdd6dd..6125df33dbc 100644 --- a/src/mame/drivers/ssingles.c +++ b/src/mame/drivers/ssingles.c @@ -316,7 +316,7 @@ static VIDEO_START(ssingles) static SCREEN_UPDATE( ssingles ) { - mc6845_device *mc6845 = screen->machine().device("crtc"); + mc6845_device *mc6845 = screen.machine().device("crtc"); mc6845->update(bitmap, cliprect); return 0; diff --git a/src/mame/drivers/sstrangr.c b/src/mame/drivers/sstrangr.c index fa3d1ea43c6..46aaf3c12d5 100644 --- a/src/mame/drivers/sstrangr.c +++ b/src/mame/drivers/sstrangr.c @@ -34,7 +34,7 @@ public: static SCREEN_UPDATE( sstrangr ) { - sstrangr_state *state = screen->machine().driver_data(); + sstrangr_state *state = screen.machine().driver_data(); offs_t offs; for (offs = 0; offs < 0x2000; offs++) @@ -83,14 +83,14 @@ static void get_pens(pen_t *pens) static SCREEN_UPDATE( sstrngr2 ) { - sstrangr_state *state = screen->machine().driver_data(); + sstrangr_state *state = screen.machine().driver_data(); pen_t pens[NUM_PENS]; offs_t offs; UINT8 *color_map_base; get_pens(pens); - color_map_base = &screen->machine().region("proms")->base()[state->m_flip_screen ? 0x0000 : 0x0200]; + color_map_base = &screen.machine().region("proms")->base()[state->m_flip_screen ? 0x0000 : 0x0200]; for (offs = 0; offs < 0x2000; offs++) { diff --git a/src/mame/drivers/statriv2.c b/src/mame/drivers/statriv2.c index 776e6b9478a..23d980a7137 100644 --- a/src/mame/drivers/statriv2.c +++ b/src/mame/drivers/statriv2.c @@ -179,9 +179,9 @@ static WRITE8_HANDLER( statriv2_videoram_w ) static SCREEN_UPDATE( statriv2 ) { - statriv2_state *state = screen->machine().driver_data(); - if (tms9927_screen_reset(screen->machine().device("tms"))) - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + statriv2_state *state = screen.machine().driver_data(); + if (tms9927_screen_reset(screen.machine().device("tms"))) + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); else tilemap_draw(bitmap, cliprect, state->m_tilemap, 0, 0); return 0; diff --git a/src/mame/drivers/sub.c b/src/mame/drivers/sub.c index b53998db40c..dc4b9945f9a 100644 --- a/src/mame/drivers/sub.c +++ b/src/mame/drivers/sub.c @@ -132,9 +132,9 @@ static VIDEO_START(sub) static SCREEN_UPDATE(sub) { - sub_state *state = screen->machine().driver_data(); - const gfx_element *gfx = screen->machine().gfx[0]; - const gfx_element *gfx_1 = screen->machine().gfx[1]; + sub_state *state = screen.machine().driver_data(); + const gfx_element *gfx = screen.machine().gfx[0]; + const gfx_element *gfx_1 = screen.machine().gfx[1]; int y,x; int count = 0; diff --git a/src/mame/drivers/subs.c b/src/mame/drivers/subs.c index c914cd64349..da35cb86113 100644 --- a/src/mame/drivers/subs.c +++ b/src/mame/drivers/subs.c @@ -194,7 +194,7 @@ static MACHINE_CONFIG_START( subs, subs_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE(subs) + MCFG_SCREEN_UPDATE(subs_left) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -202,7 +202,7 @@ static MACHINE_CONFIG_START( subs, subs_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1) - MCFG_SCREEN_UPDATE(subs) + MCFG_SCREEN_UPDATE(subs_right) MCFG_PALETTE_INIT(subs) diff --git a/src/mame/drivers/subsino.c b/src/mame/drivers/subsino.c index e47a0155b58..7da06905474 100644 --- a/src/mame/drivers/subsino.c +++ b/src/mame/drivers/subsino.c @@ -453,7 +453,7 @@ static VIDEO_START( stisub ) static SCREEN_UPDATE( subsino ) { - subsino_state *state = screen->machine().driver_data(); + subsino_state *state = screen.machine().driver_data(); bitmap_fill(bitmap,cliprect,0); tilemap_draw(bitmap,cliprect, state->m_tmap, 0, 0); return 0; @@ -466,7 +466,7 @@ static const rectangle visible3 = { 0*8, (14+48)*8-1, 18*8, (18+7)*8-1 }; static SCREEN_UPDATE( subsino_reels ) { - subsino_state *state = screen->machine().driver_data(); + subsino_state *state = screen.machine().driver_data(); int i; bitmap_fill(bitmap,cliprect,0); @@ -496,7 +496,7 @@ static const rectangle stisub_visible3 = { 0, 511, 144, 223 }; static SCREEN_UPDATE( stisub_reels ) { - subsino_state *state = screen->machine().driver_data(); + subsino_state *state = screen.machine().driver_data(); int i; bitmap_fill(bitmap,cliprect,0); diff --git a/src/mame/drivers/subsino2.c b/src/mame/drivers/subsino2.c index a4cc253f781..331be539754 100644 --- a/src/mame/drivers/subsino2.c +++ b/src/mame/drivers/subsino2.c @@ -605,16 +605,16 @@ static VIDEO_START( xtrain ) static SCREEN_UPDATE( subsino2 ) { - subsino2_state *state = screen->machine().driver_data(); + subsino2_state *state = screen.machine().driver_data(); int layers_ctrl = ~state->m_ss9601_disable; int y; #ifdef MAME_DEBUG - if (screen->machine().input().code_pressed(KEYCODE_Z)) + if (screen.machine().input().code_pressed(KEYCODE_Z)) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 2; if (msk != 0) layers_ctrl &= msk; } #endif @@ -659,7 +659,7 @@ static SCREEN_UPDATE( subsino2 ) } } - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); if (layers_ctrl & 1) { diff --git a/src/mame/drivers/summit.c b/src/mame/drivers/summit.c index d8b4216c4b4..6cc86c14675 100644 --- a/src/mame/drivers/summit.c +++ b/src/mame/drivers/summit.c @@ -36,8 +36,8 @@ static VIDEO_START(summit) static SCREEN_UPDATE(summit) { - summit_state *state = screen->machine().driver_data(); - const gfx_element *gfx = screen->machine().gfx[0]; + summit_state *state = screen.machine().driver_data(); + const gfx_element *gfx = screen.machine().gfx[0]; int count = 0x0000; int y,x; diff --git a/src/mame/drivers/supdrapo.c b/src/mame/drivers/supdrapo.c index 9d6e7084193..cc2e20086f1 100644 --- a/src/mame/drivers/supdrapo.c +++ b/src/mame/drivers/supdrapo.c @@ -89,7 +89,7 @@ static VIDEO_START( supdrapo ) static SCREEN_UPDATE( supdrapo ) { - supdrapo_state *state = screen->machine().driver_data(); + supdrapo_state *state = screen.machine().driver_data(); int x, y; int count; int color; @@ -104,7 +104,7 @@ static SCREEN_UPDATE( supdrapo ) /* Global Column Coloring, GUESS! */ color = state->m_col_line[(x*2) + 1] ? (state->m_col_line[(x*2) + 1] - 1) & 7 : 0; - drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[0], tile,color, 0, 0, x*8, y*8); + drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], tile,color, 0, 0, x*8, y*8); count++; } diff --git a/src/mame/drivers/superdq.c b/src/mame/drivers/superdq.c index e10528ae782..202ff7a12d4 100644 --- a/src/mame/drivers/superdq.c +++ b/src/mame/drivers/superdq.c @@ -59,7 +59,7 @@ static VIDEO_START( superdq ) static SCREEN_UPDATE( superdq ) { - superdq_state *state = screen->machine().driver_data(); + superdq_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_tilemap, 0, 0); diff --git a/src/mame/drivers/supertnk.c b/src/mame/drivers/supertnk.c index fdff8c34cd5..14e243a2b17 100644 --- a/src/mame/drivers/supertnk.c +++ b/src/mame/drivers/supertnk.c @@ -244,7 +244,7 @@ static WRITE8_HANDLER( supertnk_bitplane_select_1_w ) static SCREEN_UPDATE( supertnk ) { - supertnk_state *state = screen->machine().driver_data(); + supertnk_state *state = screen.machine().driver_data(); offs_t offs; for (offs = 0; offs < 0x2000; offs++) diff --git a/src/mame/drivers/superwng.c b/src/mame/drivers/superwng.c index 7075d47dc02..14e551b0ba3 100644 --- a/src/mame/drivers/superwng.c +++ b/src/mame/drivers/superwng.c @@ -104,8 +104,8 @@ static VIDEO_START( superwng ) static SCREEN_UPDATE( superwng ) { - superwng_state *state = screen->machine().driver_data(); - int flip=flip_screen_get(screen->machine()); + superwng_state *state = screen.machine().driver_data(); + int flip=flip_screen_get(screen.machine()); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); rectangle tmp=*cliprect; @@ -140,7 +140,7 @@ static SCREEN_UPDATE( superwng ) if(state->m_videoram_bg[i+1] | state->m_colorram_bg[i]) { - drawgfx_transpen(bitmap, cliprect,screen->machine().gfx[1], + drawgfx_transpen(bitmap, cliprect,screen.machine().gfx[1], code, attr, flip, flip, diff --git a/src/mame/drivers/suprgolf.c b/src/mame/drivers/suprgolf.c index d33dfb34cc6..971a14b155d 100644 --- a/src/mame/drivers/suprgolf.c +++ b/src/mame/drivers/suprgolf.c @@ -77,9 +77,9 @@ static VIDEO_START( suprgolf ) static SCREEN_UPDATE( suprgolf ) { - suprgolf_state *state = screen->machine().driver_data(); + suprgolf_state *state = screen.machine().driver_data(); int x,y,count,color; - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); { count = 0; @@ -91,7 +91,7 @@ static SCREEN_UPDATE( suprgolf ) color = state->m_bg_fb[count]; if(x <= cliprect->max_x && y <= cliprect->max_y) - *BITMAP_ADDR16(bitmap, y, x) = screen->machine().pens[(color & 0x7ff)]; + *BITMAP_ADDR16(bitmap, y, x) = screen.machine().pens[(color & 0x7ff)]; count++; } @@ -108,7 +108,7 @@ static SCREEN_UPDATE( suprgolf ) color = state->m_fg_fb[count]; if(((state->m_fg_fb[count] & 0x0f) != 0x0f) && (x <= cliprect->max_x && y <= cliprect->max_y)) - *BITMAP_ADDR16(bitmap, y, x) = screen->machine().pens[(color & 0x7ff)]; + *BITMAP_ADDR16(bitmap, y, x) = screen.machine().pens[(color & 0x7ff)]; count++; } diff --git a/src/mame/drivers/taitotz.c b/src/mame/drivers/taitotz.c index b6b0466b73f..aa089f2c850 100644 --- a/src/mame/drivers/taitotz.c +++ b/src/mame/drivers/taitotz.c @@ -156,7 +156,7 @@ static SCREEN_UPDATE( taitotz ) } */ - taitotz_state *state = screen->machine().driver_data(); + taitotz_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, 0); copybitmap_trans(bitmap, state->framebuffer, 0, 0, 0, 0, cliprect, 0); diff --git a/src/mame/drivers/taitowlf.c b/src/mame/drivers/taitowlf.c index 576bd60bc84..18ca2376e80 100644 --- a/src/mame/drivers/taitowlf.c +++ b/src/mame/drivers/taitowlf.c @@ -66,9 +66,9 @@ public: static SCREEN_UPDATE( taitowlf ) { int x,y,count; - const UINT8 *blit_ram = screen->machine().region("user5")->base(); + const UINT8 *blit_ram = screen.machine().region("user5")->base(); - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); count = (0); @@ -80,8 +80,8 @@ static SCREEN_UPDATE( taitowlf ) color = (blit_ram[count] & 0xff); - if((x)+0visible_area().max_x && ((y)+0)visible_area().max_y) - *BITMAP_ADDR32(bitmap, y, x+0) = screen->machine().pens[color]; + if((x)+0machine().device("crtc"); + mc6845_device *mc6845 = screen.machine().device("crtc"); mc6845->update(bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/tattack.c b/src/mame/drivers/tattack.c index 3d1509639e4..c7de04157c3 100644 --- a/src/mame/drivers/tattack.c +++ b/src/mame/drivers/tattack.c @@ -55,7 +55,7 @@ static TILE_GET_INFO( get_tile_info ) static SCREEN_UPDATE( tattack ) { - tattack_state *state = screen->machine().driver_data(); + tattack_state *state = screen.machine().driver_data(); tilemap_mark_all_tiles_dirty(state->m_tmap); tilemap_draw(bitmap,cliprect,state->m_tmap, 0,0); return 0; diff --git a/src/mame/drivers/tbowl.c b/src/mame/drivers/tbowl.c index a5e46008945..6514c43286b 100644 --- a/src/mame/drivers/tbowl.c +++ b/src/mame/drivers/tbowl.c @@ -488,7 +488,7 @@ static MACHINE_CONFIG_START( tbowl, tbowl_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE(tbowl) + MCFG_SCREEN_UPDATE(tbowl_left) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -496,7 +496,7 @@ static MACHINE_CONFIG_START( tbowl, tbowl_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE(tbowl) + MCFG_SCREEN_UPDATE(tbowl_right) MCFG_VIDEO_START(tbowl) diff --git a/src/mame/drivers/tceptor.c b/src/mame/drivers/tceptor.c index 04bd564a290..d53ee7b39ec 100644 --- a/src/mame/drivers/tceptor.c +++ b/src/mame/drivers/tceptor.c @@ -407,7 +407,7 @@ static MACHINE_CONFIG_START( tceptor, tceptor_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(38*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(2*8, 34*8-1 + 2*8, 0*8, 28*8-1 + 0) - MCFG_SCREEN_UPDATE(tceptor) + MCFG_SCREEN_UPDATE(tceptor_2d) MCFG_SCREEN_ADD("3dleft", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -415,7 +415,7 @@ static MACHINE_CONFIG_START( tceptor, tceptor_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(38*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(2*8, 34*8-1 + 2*8, 0*8, 28*8-1 + 0) - MCFG_SCREEN_UPDATE(tceptor) + MCFG_SCREEN_UPDATE(tceptor_3d_left) MCFG_SCREEN_ADD("3dright", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -423,7 +423,7 @@ static MACHINE_CONFIG_START( tceptor, tceptor_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(38*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(2*8, 34*8-1 + 2*8, 0*8, 28*8-1 + 0) - MCFG_SCREEN_UPDATE(tceptor) + MCFG_SCREEN_UPDATE(tceptor_3d_right) MCFG_SCREEN_EOF(tceptor) MCFG_PALETTE_INIT(tceptor) diff --git a/src/mame/drivers/tetrisp2.c b/src/mame/drivers/tetrisp2.c index b3e14aa01bc..eba6a1c21ec 100644 --- a/src/mame/drivers/tetrisp2.c +++ b/src/mame/drivers/tetrisp2.c @@ -1253,7 +1253,7 @@ static MACHINE_CONFIG_START( rocknms, tetrisp2_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(0x140, 0xe0) MCFG_SCREEN_VISIBLE_AREA(0, 0x140-1, 0, 0xe0-1) - MCFG_SCREEN_UPDATE(rocknms) + MCFG_SCREEN_UPDATE(rocknms_left) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) @@ -1261,7 +1261,7 @@ static MACHINE_CONFIG_START( rocknms, tetrisp2_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(0x140, 0xe0) MCFG_SCREEN_VISIBLE_AREA(0, 0x140-1, 0, 0xe0-1) - MCFG_SCREEN_UPDATE(rocknms) + MCFG_SCREEN_UPDATE(rocknms_right) MCFG_VIDEO_START(rocknms) diff --git a/src/mame/drivers/tgtpanic.c b/src/mame/drivers/tgtpanic.c index dbd3f8478d1..569064f15da 100644 --- a/src/mame/drivers/tgtpanic.c +++ b/src/mame/drivers/tgtpanic.c @@ -32,7 +32,7 @@ public: static SCREEN_UPDATE( tgtpanic ) { - tgtpanic_state *state = screen->machine().driver_data(); + tgtpanic_state *state = screen.machine().driver_data(); UINT32 colors[4]; UINT32 offs; UINT32 x, y; diff --git a/src/mame/drivers/timetrv.c b/src/mame/drivers/timetrv.c index ca95d78d74b..068adb0c1ea 100644 --- a/src/mame/drivers/timetrv.c +++ b/src/mame/drivers/timetrv.c @@ -46,7 +46,7 @@ static VIDEO_START( timetrv ) static SCREEN_UPDATE( timetrv ) { - timetrv_state *state = screen->machine().driver_data(); + timetrv_state *state = screen.machine().driver_data(); popmessage("%s%s",state->m_led_vram_lo,state->m_led_vram_hi); return 0; } diff --git a/src/mame/drivers/tmaster.c b/src/mame/drivers/tmaster.c index 73be3614a2e..ae9b2b11781 100644 --- a/src/mame/drivers/tmaster.c +++ b/src/mame/drivers/tmaster.c @@ -316,21 +316,21 @@ static VIDEO_START( galgames ) static SCREEN_UPDATE( tmaster ) { - tmaster_state *state = screen->machine().driver_data(); + tmaster_state *state = screen.machine().driver_data(); int layers_ctrl = -1; #ifdef MAME_DEBUG - if (screen->machine().input().code_pressed(KEYCODE_Z)) + if (screen.machine().input().code_pressed(KEYCODE_Z)) { int mask = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) mask |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) mask |= 2; + if (screen.machine().input().code_pressed(KEYCODE_Q)) mask |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) mask |= 2; if (mask != 0) layers_ctrl &= mask; } #endif - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); if (layers_ctrl & 1) copybitmap_trans(bitmap, state->m_bitmap[0][(state->m_regs[0x02/2]>>8)&1], 0,0,0,0, cliprect, 0xff); if (layers_ctrl & 2) copybitmap_trans(bitmap, state->m_bitmap[1][(state->m_regs[0x02/2]>>9)&1], 0,0,0,0, cliprect, 0xff); diff --git a/src/mame/drivers/tmmjprd.c b/src/mame/drivers/tmmjprd.c index e737c5d1fb0..46fd5fe9908 100644 --- a/src/mame/drivers/tmmjprd.c +++ b/src/mame/drivers/tmmjprd.c @@ -275,27 +275,16 @@ static void ttmjprd_draw_tilemap(running_machine &machine, bitmap_t *bitmap, con } -static SCREEN_UPDATE( tmmjprd ) +static SCREEN_UPDATE( tmmjprd_left ) { - tmmjprd_state *state = screen->machine().driver_data(); - UINT8* gfxroms = screen->machine().region("gfx2")->base(); - device_t *left_screen = screen->machine().device("lscreen"); - device_t *right_screen = screen->machine().device("rscreen"); + tmmjprd_state *state = screen.machine().driver_data(); + UINT8* gfxroms = screen.machine().region("gfx2")->base(); - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); - if (screen == left_screen) - { - ttmjprd_draw_tilemap( screen->machine(), bitmap, cliprect, state->m_tilemap_ram[3], state->m_tilemap_regs[3], gfxroms ); - draw_sprites(screen->machine(),bitmap,cliprect, 1); - ttmjprd_draw_tilemap( screen->machine(), bitmap, cliprect, state->m_tilemap_ram[2], state->m_tilemap_regs[2], gfxroms ); - } - if (screen == right_screen) - { - ttmjprd_draw_tilemap( screen->machine(), bitmap, cliprect, state->m_tilemap_ram[1], state->m_tilemap_regs[1], gfxroms ); - draw_sprites(screen->machine(),bitmap,cliprect, 0); - ttmjprd_draw_tilemap( screen->machine(), bitmap, cliprect, state->m_tilemap_ram[0], state->m_tilemap_regs[0], gfxroms ); - } + ttmjprd_draw_tilemap( screen.machine(), bitmap, cliprect, state->m_tilemap_ram[3], state->m_tilemap_regs[3], gfxroms ); + draw_sprites(screen.machine(),bitmap,cliprect, 1); + ttmjprd_draw_tilemap( screen.machine(), bitmap, cliprect, state->m_tilemap_ram[2], state->m_tilemap_regs[2], gfxroms ); /* popmessage("%08x %08x %08x %08x %08x %08x", @@ -321,6 +310,20 @@ static SCREEN_UPDATE( tmmjprd ) return 0; } +static SCREEN_UPDATE( tmmjprd_right ) +{ + tmmjprd_state *state = screen.machine().driver_data(); + UINT8* gfxroms = screen.machine().region("gfx2")->base(); + + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); + + ttmjprd_draw_tilemap( screen.machine(), bitmap, cliprect, state->m_tilemap_ram[1], state->m_tilemap_regs[1], gfxroms ); + draw_sprites(screen.machine(),bitmap,cliprect, 0); + ttmjprd_draw_tilemap( screen.machine(), bitmap, cliprect, state->m_tilemap_ram[0], state->m_tilemap_regs[0], gfxroms ); + + return 0; +} + static VIDEO_START(tmmjprd) { tmmjprd_state *state = machine.driver_data(); @@ -764,7 +767,7 @@ static MACHINE_CONFIG_START( tmmjprd, tmmjprd_state ) MCFG_SCREEN_SIZE(64*16, 64*16) MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1) //MCFG_SCREEN_VISIBLE_AREA(0*8, 64*16-1, 0*8, 64*16-1) - MCFG_SCREEN_UPDATE(tmmjprd) + MCFG_SCREEN_UPDATE(tmmjprd_left) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -773,7 +776,7 @@ static MACHINE_CONFIG_START( tmmjprd, tmmjprd_state ) MCFG_SCREEN_SIZE(64*16, 64*16) MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1) //MCFG_SCREEN_VISIBLE_AREA(0*8, 64*16-1, 0*8, 64*16-1) - MCFG_SCREEN_UPDATE(tmmjprd) + MCFG_SCREEN_UPDATE(tmmjprd_right) MCFG_VIDEO_START(tmmjprd) MACHINE_CONFIG_END diff --git a/src/mame/drivers/tmspoker.c b/src/mame/drivers/tmspoker.c index f8d4df206e1..41ccbf22d7c 100644 --- a/src/mame/drivers/tmspoker.c +++ b/src/mame/drivers/tmspoker.c @@ -259,7 +259,7 @@ static VIDEO_START( tmspoker ) static SCREEN_UPDATE( tmspoker ) { - tmspoker_state *state = screen->machine().driver_data(); + tmspoker_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/tonton.c b/src/mame/drivers/tonton.c index 9fa41dc5247..32d9ff060cb 100644 --- a/src/mame/drivers/tonton.c +++ b/src/mame/drivers/tonton.c @@ -70,8 +70,8 @@ static VIDEO_START( tonton ) static SCREEN_UPDATE( tonton ) { - tonton_state *state = screen->machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + tonton_state *state = screen.machine().driver_data(); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); copybitmap(bitmap, state->m_vdp0_bitmap, 0, 0, 0, 0, cliprect); diff --git a/src/mame/drivers/toratora.c b/src/mame/drivers/toratora.c index d42956ed36e..03dfe611525 100644 --- a/src/mame/drivers/toratora.c +++ b/src/mame/drivers/toratora.c @@ -67,7 +67,7 @@ static WRITE_LINE_DEVICE_HANDLER( cb2_u3_w ) static SCREEN_UPDATE( toratora ) { - toratora_state *state = screen->machine().driver_data(); + toratora_state *state = screen.machine().driver_data(); offs_t offs; for (offs = 0; offs < state->m_videoram_size; offs++) diff --git a/src/mame/drivers/trvmadns.c b/src/mame/drivers/trvmadns.c index 2dfc27a3f5e..311ac21483f 100644 --- a/src/mame/drivers/trvmadns.c +++ b/src/mame/drivers/trvmadns.c @@ -287,9 +287,9 @@ static VIDEO_START( trvmadns ) static SCREEN_UPDATE( trvmadns ) { - trvmadns_state *state = screen->machine().driver_data(); + trvmadns_state *state = screen.machine().driver_data(); int x,y,count; - const gfx_element *gfx = screen->machine().gfx[0]; + const gfx_element *gfx = screen.machine().gfx[0]; bitmap_fill(bitmap,cliprect,0xd); diff --git a/src/mame/drivers/ttchamp.c b/src/mame/drivers/ttchamp.c index 2f9b87f491f..ea6084b1772 100644 --- a/src/mame/drivers/ttchamp.c +++ b/src/mame/drivers/ttchamp.c @@ -62,12 +62,12 @@ static VIDEO_START(ttchamp) static SCREEN_UPDATE(ttchamp) { - ttchamp_state *state = screen->machine().driver_data(); + ttchamp_state *state = screen.machine().driver_data(); int y,x,count; // int i; static const int xxx=320,yyy=204; - bitmap_fill(bitmap, 0, get_black_pen(screen->machine())); + bitmap_fill(bitmap, 0, get_black_pen(screen.machine())); // for (i=0;i<256;i++) // { diff --git a/src/mame/drivers/tugboat.c b/src/mame/drivers/tugboat.c index 78ee0c3ce42..f5cfaef6da7 100644 --- a/src/mame/drivers/tugboat.c +++ b/src/mame/drivers/tugboat.c @@ -127,13 +127,13 @@ static void draw_tilemap(running_machine &machine, bitmap_t *bitmap,const rectan static SCREEN_UPDATE( tugboat ) { - tugboat_state *state = screen->machine().driver_data(); + tugboat_state *state = screen.machine().driver_data(); int startaddr0 = state->m_hd46505_0_reg[0x0c]*256 + state->m_hd46505_0_reg[0x0d]; int startaddr1 = state->m_hd46505_1_reg[0x0c]*256 + state->m_hd46505_1_reg[0x0d]; - draw_tilemap(screen->machine(), bitmap,cliprect,startaddr0,0,1,FALSE); - draw_tilemap(screen->machine(), bitmap,cliprect,startaddr1,2,3,TRUE); + draw_tilemap(screen.machine(), bitmap,cliprect,startaddr0,0,1,FALSE); + draw_tilemap(screen.machine(), bitmap,cliprect,startaddr1,2,3,TRUE); return 0; } diff --git a/src/mame/drivers/twins.c b/src/mame/drivers/twins.c index 30e1d68fb5b..f2ba4adc95a 100644 --- a/src/mame/drivers/twins.c +++ b/src/mame/drivers/twins.c @@ -112,12 +112,12 @@ static VIDEO_START(twins) static SCREEN_UPDATE(twins) { - twins_state *state = screen->machine().driver_data(); + twins_state *state = screen.machine().driver_data(); int y,x,count; int i; static const int xxx=320,yyy=204; - bitmap_fill(bitmap, 0, get_black_pen(screen->machine())); + bitmap_fill(bitmap, 0, get_black_pen(screen.machine())); for (i=0;i<0x100;i++) { @@ -133,7 +133,7 @@ static SCREEN_UPDATE(twins) b = (dat>>10) & 0x1f; b = BITSWAP8(b,7,6,5,0,1,2,3,4); - palette_set_color_rgb(screen->machine(),i, pal5bit(r),pal5bit(g),pal5bit(b)); + palette_set_color_rgb(screen.machine(),i, pal5bit(r),pal5bit(g),pal5bit(b)); } count=0; @@ -219,12 +219,12 @@ static VIDEO_START(twinsa) static SCREEN_UPDATE(twinsa) { - twins_state *state = screen->machine().driver_data(); + twins_state *state = screen.machine().driver_data(); int y,x,count; int i; static const int xxx=320,yyy=204; - bitmap_fill(bitmap, 0, get_black_pen(screen->machine())); + bitmap_fill(bitmap, 0, get_black_pen(screen.machine())); for (i=0;i<0x1000-3;i+=3) { @@ -233,7 +233,7 @@ static SCREEN_UPDATE(twinsa) g = state->m_pal[i+1]; b = state->m_pal[i+2]; - palette_set_color_rgb(screen->machine(),i/3, pal6bit(r), pal6bit(g), pal6bit(b)); + palette_set_color_rgb(screen.machine(),i/3, pal6bit(r), pal6bit(g), pal6bit(b)); } count=0; diff --git a/src/mame/drivers/tx1.c b/src/mame/drivers/tx1.c index 1597d055496..e200161f8a3 100644 --- a/src/mame/drivers/tx1.c +++ b/src/mame/drivers/tx1.c @@ -720,17 +720,17 @@ static MACHINE_CONFIG_START( tx1, tx1_state ) MCFG_SCREEN_ADD("lscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) MCFG_SCREEN_RAW_PARAMS(TX1_PIXEL_CLOCK, TX1_HTOTAL, TX1_HBEND, TX1_HBSTART, TX1_VTOTAL, TX1_VBEND, TX1_VBSTART) - MCFG_SCREEN_UPDATE(tx1) + MCFG_SCREEN_UPDATE(tx1_left) MCFG_SCREEN_ADD("cscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) MCFG_SCREEN_RAW_PARAMS(TX1_PIXEL_CLOCK, TX1_HTOTAL, TX1_HBEND, TX1_HBSTART, TX1_VTOTAL, TX1_VBEND, TX1_VBSTART) - MCFG_SCREEN_UPDATE(tx1) + MCFG_SCREEN_UPDATE(tx1_middle) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) MCFG_SCREEN_RAW_PARAMS(TX1_PIXEL_CLOCK, TX1_HTOTAL, TX1_HBEND, TX1_HBSTART, TX1_VTOTAL, TX1_VBEND, TX1_VBSTART) - MCFG_SCREEN_UPDATE(tx1) + MCFG_SCREEN_UPDATE(tx1_right) MCFG_SCREEN_EOF(tx1) MCFG_VIDEO_START(tx1) @@ -772,17 +772,17 @@ static MACHINE_CONFIG_START( buggyboy, tx1_state ) MCFG_SCREEN_ADD("lscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) MCFG_SCREEN_RAW_PARAMS(BB_PIXEL_CLOCK, BB_HTOTAL, BB_HBEND, BB_HBSTART, BB_VTOTAL, BB_VBEND, BB_VBSTART) - MCFG_SCREEN_UPDATE(buggyboy) + MCFG_SCREEN_UPDATE(buggyboy_left) MCFG_SCREEN_ADD("cscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) MCFG_SCREEN_RAW_PARAMS(BB_PIXEL_CLOCK, BB_HTOTAL, BB_HBEND, BB_HBSTART, BB_VTOTAL, BB_VBEND, BB_VBSTART) - MCFG_SCREEN_UPDATE(buggyboy) + MCFG_SCREEN_UPDATE(buggyboy_middle) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) MCFG_SCREEN_RAW_PARAMS(BB_PIXEL_CLOCK, BB_HTOTAL, BB_HBEND, BB_HBSTART, BB_VTOTAL, BB_VBEND, BB_VBSTART) - MCFG_SCREEN_UPDATE(buggyboy) + MCFG_SCREEN_UPDATE(buggyboy_right) MCFG_SCREEN_EOF(buggyboy) MCFG_PALETTE_LENGTH(256) diff --git a/src/mame/drivers/ultrsprt.c b/src/mame/drivers/ultrsprt.c index b04d4c7c89e..2d0e09c1993 100644 --- a/src/mame/drivers/ultrsprt.c +++ b/src/mame/drivers/ultrsprt.c @@ -32,7 +32,7 @@ public: static SCREEN_UPDATE( ultrsprt ) { - ultrsprt_state *state = screen->machine().driver_data(); + ultrsprt_state *state = screen.machine().driver_data(); int i, j; UINT8 *ram = (UINT8 *)state->m_vram; diff --git a/src/mame/drivers/umipoker.c b/src/mame/drivers/umipoker.c index 8be38d13c06..dcbd4079721 100644 --- a/src/mame/drivers/umipoker.c +++ b/src/mame/drivers/umipoker.c @@ -110,14 +110,14 @@ static VIDEO_START( umipoker ) static SCREEN_UPDATE( umipoker ) { - umipoker_state *state = screen->machine().driver_data(); + umipoker_state *state = screen.machine().driver_data(); tilemap_set_scrolly(state->m_tilemap_0, 0, state->m_umipoker_scrolly[0]); tilemap_set_scrolly(state->m_tilemap_1, 0, state->m_umipoker_scrolly[1]); tilemap_set_scrolly(state->m_tilemap_2, 0, state->m_umipoker_scrolly[2]); tilemap_set_scrolly(state->m_tilemap_3, 0, state->m_umipoker_scrolly[3]); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); tilemap_draw(bitmap,cliprect,state->m_tilemap_0,0,0); tilemap_draw(bitmap,cliprect,state->m_tilemap_1,0,0); diff --git a/src/mame/drivers/vamphalf.c b/src/mame/drivers/vamphalf.c index df5d7e017ee..dc9308740d7 100644 --- a/src/mame/drivers/vamphalf.c +++ b/src/mame/drivers/vamphalf.c @@ -400,17 +400,17 @@ or Offset+3 -------x xxxxxxxx X offs */ -static void draw_sprites(screen_device *screen, bitmap_t *bitmap) +static void draw_sprites(screen_device &screen, bitmap_t *bitmap) { - vamphalf_state *state = screen->machine().driver_data(); - const gfx_element *gfx = screen->machine().gfx[0]; + vamphalf_state *state = screen.machine().driver_data(); + const gfx_element *gfx = screen.machine().gfx[0]; UINT32 cnt; int block, offs; int code,color,x,y,fx,fy; rectangle clip; - clip.min_x = screen->visible_area().min_x; - clip.max_x = screen->visible_area().max_x; + clip.min_x = screen.visible_area().min_x; + clip.max_x = screen.visible_area().max_x; for (block=0; block<0x8000; block+=0x800) { @@ -474,17 +474,17 @@ static void draw_sprites(screen_device *screen, bitmap_t *bitmap) } } -static void draw_sprites_aoh(screen_device *screen, bitmap_t *bitmap) +static void draw_sprites_aoh(screen_device &screen, bitmap_t *bitmap) { - vamphalf_state *state = screen->machine().driver_data(); - const gfx_element *gfx = screen->machine().gfx[0]; + vamphalf_state *state = screen.machine().driver_data(); + const gfx_element *gfx = screen.machine().gfx[0]; UINT32 cnt; int block, offs; int code,color,x,y,fx,fy; rectangle clip; - clip.min_x = screen->visible_area().min_x; - clip.max_x = screen->visible_area().max_x; + clip.min_x = screen.visible_area().min_x; + clip.max_x = screen.visible_area().max_x; for (block=0; block<0x8000; block+=0x800) { diff --git a/src/mame/drivers/vcombat.c b/src/mame/drivers/vcombat.c index bd1bf520c5c..92c95028a6a 100644 --- a/src/mame/drivers/vcombat.c +++ b/src/mame/drivers/vcombat.c @@ -104,16 +104,14 @@ public: int m_crtc_select; }; - -static SCREEN_UPDATE( vcombat ) +static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int index) { - vcombat_state *state = screen->machine().driver_data(); + vcombat_state *state = screen.machine().driver_data(); int y; - const rgb_t *const pens = tlc34076_get_pens(screen->machine().device("tlc34076")); - device_t *aux = screen->machine().device("aux"); + const rgb_t *const pens = tlc34076_get_pens(screen.machine().device("tlc34076")); UINT16 *m68k_buf = state->m_m68k_framebuffer[(*state->m_framebuffer_ctrl & 0x20) ? 1 : 0]; - UINT16 *i860_buf = state->m_i860_framebuffer[(screen == aux) ? 1 : 0][0]; + UINT16 *i860_buf = state->m_i860_framebuffer[index][0]; /* TODO: It looks like the leftmost chunk of the ground should really be on the right side? */ /* But the i860 draws the background correctly, so it may be an original game issue. */ @@ -155,6 +153,9 @@ static SCREEN_UPDATE( vcombat ) return 0; } +static SCREEN_UPDATE( vcombat_main ) { return update_screen(screen, bitmap, cliprect, 0); } +static SCREEN_UPDATE( vcombat_aux ) { return update_screen(screen, bitmap, cliprect, 1); } + static WRITE16_HANDLER( main_video_write ) { @@ -599,12 +600,12 @@ static MACHINE_CONFIG_START( vcombat, vcombat_state ) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) MCFG_SCREEN_RAW_PARAMS(XTAL_12MHz / 2, 400, 0, 256, 291, 0, 208) - MCFG_SCREEN_UPDATE(vcombat) + MCFG_SCREEN_UPDATE(vcombat_main) MCFG_SCREEN_ADD("aux", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) MCFG_SCREEN_RAW_PARAMS(XTAL_12MHz / 2, 400, 0, 256, 291, 0, 208) - MCFG_SCREEN_UPDATE(vcombat) + MCFG_SCREEN_UPDATE(vcombat_aux) MCFG_SPEAKER_STANDARD_MONO("mono") @@ -636,7 +637,7 @@ static MACHINE_CONFIG_START( shadfgtr, vcombat_state ) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) MCFG_SCREEN_RAW_PARAMS(XTAL_20MHz / 4, 320, 0, 256, 277, 0, 224) - MCFG_SCREEN_UPDATE(vcombat) + MCFG_SCREEN_UPDATE(vcombat_main) MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mame/drivers/vegaeo.c b/src/mame/drivers/vegaeo.c index d1b09892ac7..6860119539f 100644 --- a/src/mame/drivers/vegaeo.c +++ b/src/mame/drivers/vegaeo.c @@ -148,7 +148,7 @@ static VIDEO_START( vega ) static SCREEN_UPDATE( vega ) { - vegaeo_state *state = screen->machine().driver_data(); + vegaeo_state *state = screen.machine().driver_data(); int x,y,count; int color; diff --git a/src/mame/drivers/vegas.c b/src/mame/drivers/vegas.c index 2f497779396..4b37d977dc1 100644 --- a/src/mame/drivers/vegas.c +++ b/src/mame/drivers/vegas.c @@ -510,7 +510,7 @@ static void remap_dynamic_addresses(running_machine &machine); static SCREEN_UPDATE( vegas ) { - vegas_state *state = screen->machine().driver_data(); + vegas_state *state = screen.machine().driver_data(); return voodoo_update(state->m_voodoo, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED; } diff --git a/src/mame/drivers/videopkr.c b/src/mame/drivers/videopkr.c index 98adc086348..0522152f760 100644 --- a/src/mame/drivers/videopkr.c +++ b/src/mame/drivers/videopkr.c @@ -495,7 +495,7 @@ static VIDEO_START( vidadcba ) static SCREEN_UPDATE( videopkr ) { - videopkr_state *state = screen->machine().driver_data(); + videopkr_state *state = screen.machine().driver_data(); tilemap_mark_all_tiles_dirty(state->m_bg_tilemap); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; diff --git a/src/mame/drivers/viper.c b/src/mame/drivers/viper.c index 62e4f21d9c6..db378712173 100644 --- a/src/mame/drivers/viper.c +++ b/src/mame/drivers/viper.c @@ -373,7 +373,7 @@ static timer_device *ds2430_bit_timer; static SCREEN_UPDATE(viper) { - device_t *device = screen->machine().device("voodoo"); + device_t *device = screen.machine().device("voodoo"); return voodoo_update(device, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED; } diff --git a/src/mame/drivers/vmetal.c b/src/mame/drivers/vmetal.c index def1ec7b173..a1448ee26f8 100644 --- a/src/mame/drivers/vmetal.c +++ b/src/mame/drivers/vmetal.c @@ -418,10 +418,10 @@ static VIDEO_START(varia) static SCREEN_UPDATE(varia) { - vmetal_state *state = screen->machine().driver_data(); + vmetal_state *state = screen.machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_set_scrollx(state->m_mid2tilemap, 0, state->m_vmetal_videoregs[0x06a/2]-64 /*+ state->m_vmetal_videoregs[0x066/2]*/); tilemap_set_scrollx(state->m_mid1tilemap, 0, state->m_vmetal_videoregs[0x07a/2]-64 /*+ state->m_vmetal_videoregs[0x076/2]*/); @@ -433,7 +433,7 @@ static SCREEN_UPDATE(varia) tilemap_draw(bitmap, cliprect, state->m_mid1tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_mid2tilemap, 0, 0); - metro_draw_sprites(screen->machine(), bitmap, cliprect); + metro_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_texttilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/vpoker.c b/src/mame/drivers/vpoker.c index eb36f489b9c..c56434f8db8 100644 --- a/src/mame/drivers/vpoker.c +++ b/src/mame/drivers/vpoker.c @@ -131,9 +131,9 @@ static VIDEO_START( vpoker ) static SCREEN_UPDATE( vpoker ) { - vpoker_state *state = screen->machine().driver_data(); + vpoker_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; - const gfx_element *gfx = screen->machine().gfx[0]; + const gfx_element *gfx = screen.machine().gfx[0]; int count = 0x0000; int y,x; diff --git a/src/mame/drivers/vroulet.c b/src/mame/drivers/vroulet.c index 645ade85b82..baf962a0a27 100644 --- a/src/mame/drivers/vroulet.c +++ b/src/mame/drivers/vroulet.c @@ -110,9 +110,9 @@ static VIDEO_START(vroulet) static SCREEN_UPDATE(vroulet) { - vroulet_state *state = screen->machine().driver_data(); + vroulet_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], 0x320, 1, 0, 0, + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], 0x320, 1, 0, 0, state->m_ball[1], state->m_ball[0] - 12, 0); return 0; } diff --git a/src/mame/drivers/wallc.c b/src/mame/drivers/wallc.c index af710c03822..f557c332299 100644 --- a/src/mame/drivers/wallc.c +++ b/src/mame/drivers/wallc.c @@ -149,7 +149,7 @@ static VIDEO_START( wallc ) static SCREEN_UPDATE( wallc ) { - wallc_state *state = screen->machine().driver_data(); + wallc_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/warpsped.c b/src/mame/drivers/warpsped.c index 61b6851813d..54eb1c87b9d 100644 --- a/src/mame/drivers/warpsped.c +++ b/src/mame/drivers/warpsped.c @@ -205,7 +205,7 @@ static void warpspeed_draw_circles(bitmap_t *bitmap, warpspeed_state *state) static SCREEN_UPDATE( warpspeed ) { - warpspeed_state *state = screen->machine().driver_data(); + warpspeed_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_starfield_tilemap, 0, 0); warpspeed_draw_circles(bitmap, state); diff --git a/src/mame/drivers/warriorb.c b/src/mame/drivers/warriorb.c index d8a4d8d22ac..5cffd661490 100644 --- a/src/mame/drivers/warriorb.c +++ b/src/mame/drivers/warriorb.c @@ -604,7 +604,7 @@ static MACHINE_CONFIG_START( darius2d, warriorb_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(40*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 3*8, 32*8-1) - MCFG_SCREEN_UPDATE(warriorb) + MCFG_SCREEN_UPDATE(warriorb_left) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -612,7 +612,7 @@ static MACHINE_CONFIG_START( darius2d, warriorb_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(40*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 3*8, 32*8-1) - MCFG_SCREEN_UPDATE(warriorb) + MCFG_SCREEN_UPDATE(warriorb_right) MCFG_VIDEO_START(warriorb) @@ -672,7 +672,7 @@ static MACHINE_CONFIG_START( warriorb, warriorb_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(40*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1) - MCFG_SCREEN_UPDATE(warriorb) + MCFG_SCREEN_UPDATE(warriorb_left) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -680,7 +680,7 @@ static MACHINE_CONFIG_START( warriorb, warriorb_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(40*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1) - MCFG_SCREEN_UPDATE(warriorb) + MCFG_SCREEN_UPDATE(warriorb_right) MCFG_VIDEO_START(warriorb) diff --git a/src/mame/drivers/wheelfir.c b/src/mame/drivers/wheelfir.c index f2a46fdd95c..bf35544bdac 100644 --- a/src/mame/drivers/wheelfir.c +++ b/src/mame/drivers/wheelfir.c @@ -566,7 +566,7 @@ static VIDEO_START(wheelfir) static SCREEN_UPDATE(wheelfir) { - wheelfir_state *state = screen->machine().driver_data(); + wheelfir_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect,0); @@ -587,7 +587,7 @@ static SCREEN_UPDATE(wheelfir) /* { - bitmap_fill(state->m_tmp_bitmap[LAYER_BG], &screen->visible_area(),0); + bitmap_fill(state->m_tmp_bitmap[LAYER_BG], &screen.visible_area(),0); } */ @@ -597,8 +597,8 @@ static SCREEN_UPDATE(wheelfir) static SCREEN_EOF( wheelfir ) { - wheelfir_state *state = machine.driver_data(); - bitmap_fill(state->m_tmp_bitmap[LAYER_FG], &machine.primary_screen->visible_area(),0); + wheelfir_state *state = screen.machine().driver_data(); + bitmap_fill(state->m_tmp_bitmap[LAYER_FG], &screen.visible_area(),0); } diff --git a/src/mame/drivers/wink.c b/src/mame/drivers/wink.c index 0a3343c7621..e9cfabe32a4 100644 --- a/src/mame/drivers/wink.c +++ b/src/mame/drivers/wink.c @@ -54,7 +54,7 @@ static VIDEO_START( wink ) static SCREEN_UPDATE( wink ) { - wink_state *state = screen->machine().driver_data(); + wink_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/drivers/witch.c b/src/mame/drivers/witch.c index a3e12b4306c..3dd6ef29930 100644 --- a/src/mame/drivers/witch.c +++ b/src/mame/drivers/witch.c @@ -758,7 +758,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta static SCREEN_UPDATE(witch) { - witch_state *state = screen->machine().driver_data(); + witch_state *state = screen.machine().driver_data(); tilemap_set_scrollx( state->m_gfx1_tilemap, 0, state->m_scrollx-7 ); //offset to have it aligned with the sprites tilemap_set_scrolly( state->m_gfx1_tilemap, 0, state->m_scrolly+8 ); @@ -766,7 +766,7 @@ static SCREEN_UPDATE(witch) tilemap_draw(bitmap,cliprect,state->m_gfx1_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_gfx0a_tilemap,0,0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap,cliprect,state->m_gfx0b_tilemap,0,0); return 0; } diff --git a/src/mame/drivers/wldarrow.c b/src/mame/drivers/wldarrow.c index 6d89e92f70b..14cae479875 100644 --- a/src/mame/drivers/wldarrow.c +++ b/src/mame/drivers/wldarrow.c @@ -60,7 +60,7 @@ static void get_pens(pen_t *pens) static SCREEN_UPDATE( wldarrow ) { - wldarrow_state *state = screen->machine().driver_data(); + wldarrow_state *state = screen.machine().driver_data(); pen_t pens[NUM_PENS]; offs_t offs; diff --git a/src/mame/drivers/wwfwfest.c b/src/mame/drivers/wwfwfest.c index fd5f9fc0d8f..5341fd23118 100644 --- a/src/mame/drivers/wwfwfest.c +++ b/src/mame/drivers/wwfwfest.c @@ -383,7 +383,7 @@ static const ym2151_interface ym2151_config = static SCREEN_EOF( wwfwfest ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram16_w(space,0,0,0xffff); } diff --git a/src/mame/drivers/xmen.c b/src/mame/drivers/xmen.c index d34431b9352..4a11ce84ea9 100644 --- a/src/mame/drivers/xmen.c +++ b/src/mame/drivers/xmen.c @@ -449,7 +449,7 @@ static MACHINE_CONFIG_START( xmen6p, xmen_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(64*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(12*8, 48*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE(xmen6p) + MCFG_SCREEN_UPDATE(xmen6p_left) MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) @@ -457,7 +457,7 @@ static MACHINE_CONFIG_START( xmen6p, xmen_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(64*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(16*8, 52*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE(xmen6p) + MCFG_SCREEN_UPDATE(xmen6p_right) MCFG_SCREEN_EOF(xmen6p) MCFG_VIDEO_START(xmen6p) diff --git a/src/mame/drivers/zr107.c b/src/mame/drivers/zr107.c index 50c6403b813..bbb81ada41a 100644 --- a/src/mame/drivers/zr107.c +++ b/src/mame/drivers/zr107.c @@ -204,10 +204,10 @@ static VIDEO_START( jetwave ) static SCREEN_UPDATE( jetwave ) { - zr107_state *state = screen->machine().driver_data(); - device_t *k001604 = screen->machine().device("k001604"); + zr107_state *state = screen.machine().driver_data(); + device_t *k001604 = screen.machine().device("k001604"); - bitmap_fill(bitmap, cliprect, screen->machine().pens[0]); + bitmap_fill(bitmap, cliprect, screen.machine().pens[0]); K001005_draw(bitmap, cliprect); @@ -216,7 +216,7 @@ static SCREEN_UPDATE( jetwave ) draw_7segment_led(bitmap, 3, 3, state->m_led_reg0); draw_7segment_led(bitmap, 9, 3, state->m_led_reg1); - sharc_set_flag_input(screen->machine().device("dsp"), 1, ASSERT_LINE); + sharc_set_flag_input(screen.machine().device("dsp"), 1, ASSERT_LINE); return 0; } @@ -257,9 +257,9 @@ static VIDEO_START( zr107 ) static SCREEN_UPDATE( zr107 ) { - zr107_state *state = screen->machine().driver_data(); - device_t *k056832 = screen->machine().device("k056832"); - bitmap_fill(bitmap, cliprect, screen->machine().pens[0]); + zr107_state *state = screen.machine().driver_data(); + device_t *k056832 = screen.machine().device("k056832"); + bitmap_fill(bitmap, cliprect, screen.machine().pens[0]); k056832_tilemap_draw(k056832, bitmap, cliprect, 1, 0, 0); K001005_draw(bitmap, cliprect); @@ -268,7 +268,7 @@ static SCREEN_UPDATE( zr107 ) draw_7segment_led(bitmap, 3, 3, state->m_led_reg0); draw_7segment_led(bitmap, 9, 3, state->m_led_reg1); - sharc_set_flag_input(screen->machine().device("dsp"), 1, ASSERT_LINE); + sharc_set_flag_input(screen.machine().device("dsp"), 1, ASSERT_LINE); return 0; } diff --git a/src/mame/includes/cyberbal.h b/src/mame/includes/cyberbal.h index 20b10c9c5d1..7cc0f6f1c37 100644 --- a/src/mame/includes/cyberbal.h +++ b/src/mame/includes/cyberbal.h @@ -57,6 +57,8 @@ WRITE16_HANDLER( cyberbal_paletteram_1_w ); VIDEO_START( cyberbal ); VIDEO_START( cyberbal2p ); -SCREEN_UPDATE( cyberbal ); +SCREEN_UPDATE( cyberbal_left ); +SCREEN_UPDATE( cyberbal_right ); +SCREEN_UPDATE( cyberbal2p ); void cyberbal_scanline_update(screen_device &screen, int scanline); diff --git a/src/mame/includes/darius.h b/src/mame/includes/darius.h index 20c2a31093e..c4c62eb0ade 100644 --- a/src/mame/includes/darius.h +++ b/src/mame/includes/darius.h @@ -69,4 +69,6 @@ public: WRITE16_HANDLER( darius_fg_layer_w ); VIDEO_START( darius ); -SCREEN_UPDATE( darius ); +SCREEN_UPDATE( darius_left ); +SCREEN_UPDATE( darius_middle ); +SCREEN_UPDATE( darius_right ); diff --git a/src/mame/includes/dynax.h b/src/mame/includes/dynax.h index 151a91587d7..5623c823699 100644 --- a/src/mame/includes/dynax.h +++ b/src/mame/includes/dynax.h @@ -221,7 +221,8 @@ SCREEN_UPDATE( hanamai ); SCREEN_UPDATE( hnoridur ); SCREEN_UPDATE( sprtmtch ); SCREEN_UPDATE( mjdialq2 ); -SCREEN_UPDATE( jantouki ); +SCREEN_UPDATE( jantouki_top ); +SCREEN_UPDATE( jantouki_bottom ); SCREEN_UPDATE( htengoku ); PALETTE_INIT( sprtmtch ); diff --git a/src/mame/includes/fromanc2.h b/src/mame/includes/fromanc2.h index 25bb7e4dabe..fc123174070 100644 --- a/src/mame/includes/fromanc2.h +++ b/src/mame/includes/fromanc2.h @@ -37,7 +37,8 @@ public: /*----------- defined in video/fromanc2.c -----------*/ -SCREEN_UPDATE( fromanc2 ); +SCREEN_UPDATE( fromanc2_left ); +SCREEN_UPDATE( fromanc2_right ); VIDEO_START( fromanc2 ); VIDEO_START( fromancr ); VIDEO_START( fromanc4 ); diff --git a/src/mame/includes/gaelco2.h b/src/mame/includes/gaelco2.h index dbbdbd25410..e01f63d174e 100644 --- a/src/mame/includes/gaelco2.h +++ b/src/mame/includes/gaelco2.h @@ -46,5 +46,6 @@ WRITE16_HANDLER( gaelco2_palette_w ); SCREEN_UPDATE( gaelco2 ); SCREEN_EOF( gaelco2 ); VIDEO_START( gaelco2 ); -SCREEN_UPDATE( gaelco2_dual ); +SCREEN_UPDATE( gaelco2_left ); +SCREEN_UPDATE( gaelco2_right ); VIDEO_START( gaelco2_dual ); diff --git a/src/mame/includes/konamigx.h b/src/mame/includes/konamigx.h index 62f9ac540c3..819f076e8f5 100644 --- a/src/mame/includes/konamigx.h +++ b/src/mame/includes/konamigx.h @@ -98,6 +98,8 @@ VIDEO_START(winspike); VIDEO_START(opengolf); VIDEO_START(racinfrc); SCREEN_UPDATE(konamigx); +SCREEN_UPDATE(konamigx_left); +SCREEN_UPDATE(konamigx_right); WRITE32_HANDLER( konamigx_palette_w ); #ifdef UNUSED_FUNCTION diff --git a/src/mame/includes/ninjaw.h b/src/mame/includes/ninjaw.h index 3e0f9a3ef64..f72a0e0af8f 100644 --- a/src/mame/includes/ninjaw.h +++ b/src/mame/includes/ninjaw.h @@ -40,4 +40,6 @@ public: /*----------- defined in video/ninjaw.c -----------*/ VIDEO_START( ninjaw ); -SCREEN_UPDATE( ninjaw ); +SCREEN_UPDATE( ninjaw_left ); +SCREEN_UPDATE( ninjaw_middle ); +SCREEN_UPDATE( ninjaw_right ); diff --git a/src/mame/includes/pk8000.h b/src/mame/includes/pk8000.h index a4f7beb6694..69cc32b8d65 100644 --- a/src/mame/includes/pk8000.h +++ b/src/mame/includes/pk8000.h @@ -18,4 +18,4 @@ extern UINT8 pk8000_video_enable; PALETTE_INIT( pk8000 ); -UINT32 pk8000_video_update(device_t *screen, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *videomem); +UINT32 pk8000_video_update(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *videomem); diff --git a/src/mame/includes/playch10.h b/src/mame/includes/playch10.h index dbffe910a83..e49bd883f04 100644 --- a/src/mame/includes/playch10.h +++ b/src/mame/includes/playch10.h @@ -98,4 +98,5 @@ WRITE8_HANDLER( playch10_videoram_w ); PALETTE_INIT( playch10 ); VIDEO_START( playch10 ); VIDEO_START( playch10_hboard ); -SCREEN_UPDATE( playch10 ); +SCREEN_UPDATE( playch10_top ); +SCREEN_UPDATE( playch10_bottom ); diff --git a/src/mame/includes/psikyo4.h b/src/mame/includes/psikyo4.h index 12db5213160..3990a97e927 100644 --- a/src/mame/includes/psikyo4.h +++ b/src/mame/includes/psikyo4.h @@ -35,4 +35,5 @@ public: /*----------- defined in video/psikyo4.c -----------*/ VIDEO_START( psikyo4 ); -SCREEN_UPDATE( psikyo4 ); +SCREEN_UPDATE( psikyo4_left ); +SCREEN_UPDATE( psikyo4_right ); diff --git a/src/mame/includes/punchout.h b/src/mame/includes/punchout.h index f83f10d7027..117b5d8b669 100644 --- a/src/mame/includes/punchout.h +++ b/src/mame/includes/punchout.h @@ -37,8 +37,10 @@ WRITE8_HANDLER( punchout_spr2_videoram_w ); VIDEO_START( punchout ); VIDEO_START( armwrest ); -SCREEN_UPDATE( punchout ); -SCREEN_UPDATE( armwrest ); +SCREEN_UPDATE( punchout_top ); +SCREEN_UPDATE( punchout_bottom ); +SCREEN_UPDATE( armwrest_top ); +SCREEN_UPDATE( armwrest_bottom ); DRIVER_INIT( punchout ); DRIVER_INIT( spnchout ); diff --git a/src/mame/includes/segas32.h b/src/mame/includes/segas32.h index 6a6c00cafc0..ee336204f9e 100644 --- a/src/mame/includes/segas32.h +++ b/src/mame/includes/segas32.h @@ -93,7 +93,8 @@ WRITE16_HANDLER( arescue_dsp_w ); VIDEO_START(system32); VIDEO_START(multi32); SCREEN_UPDATE(system32); -SCREEN_UPDATE(multi32); +SCREEN_UPDATE(multi32_left); +SCREEN_UPDATE(multi32_right); void system32_set_vblank(running_machine &machine, int state); READ16_HANDLER( system32_videoram_r ); diff --git a/src/mame/includes/st0016.h b/src/mame/includes/st0016.h index f9d654a86ec..82b8ca9cc42 100644 --- a/src/mame/includes/st0016.h +++ b/src/mame/includes/st0016.h @@ -57,6 +57,6 @@ WRITE8_HANDLER (st0016_character_ram_w); READ8_HANDLER (st0016_vregs_r); WRITE8_HANDLER (st0016_vregs_w); -void st0016_draw_screen(screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect); +void st0016_draw_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect); VIDEO_START(st0016); SCREEN_UPDATE(st0016); diff --git a/src/mame/includes/subs.h b/src/mame/includes/subs.h index 9f360e79e4a..a15cd3056f2 100644 --- a/src/mame/includes/subs.h +++ b/src/mame/includes/subs.h @@ -58,7 +58,8 @@ DISCRETE_SOUND_EXTERN( subs ); /*----------- defined in video/subs.c -----------*/ -SCREEN_UPDATE( subs ); +SCREEN_UPDATE( subs_left ); +SCREEN_UPDATE( subs_right ); WRITE8_HANDLER( subs_invert1_w ); WRITE8_HANDLER( subs_invert2_w ); diff --git a/src/mame/includes/tbowl.h b/src/mame/includes/tbowl.h index 73f26ad0e3b..dc53fbec913 100644 --- a/src/mame/includes/tbowl.h +++ b/src/mame/includes/tbowl.h @@ -38,4 +38,6 @@ WRITE8_HANDLER( tbowl_bgyscroll_lo ); WRITE8_HANDLER( tbowl_bgyscroll_hi ); VIDEO_START( tbowl ); -SCREEN_UPDATE( tbowl ); +SCREEN_UPDATE( tbowl_left ); +SCREEN_UPDATE( tbowl_right ); + diff --git a/src/mame/includes/tceptor.h b/src/mame/includes/tceptor.h index 7162223ec3c..1157cfbb9e0 100644 --- a/src/mame/includes/tceptor.h +++ b/src/mame/includes/tceptor.h @@ -32,7 +32,9 @@ public: PALETTE_INIT( tceptor ); VIDEO_START( tceptor ); -SCREEN_UPDATE( tceptor ); +SCREEN_UPDATE( tceptor_2d ); +SCREEN_UPDATE( tceptor_3d_left ); +SCREEN_UPDATE( tceptor_3d_right ); SCREEN_EOF( tceptor ); WRITE8_HANDLER( tceptor_tile_ram_w ); diff --git a/src/mame/includes/tetrisp2.h b/src/mame/includes/tetrisp2.h index a2353254199..b2b08500416 100644 --- a/src/mame/includes/tetrisp2.h +++ b/src/mame/includes/tetrisp2.h @@ -68,6 +68,7 @@ VIDEO_START( rockntread ); SCREEN_UPDATE( rockntread ); VIDEO_START( rocknms ); -SCREEN_UPDATE( rocknms ); +SCREEN_UPDATE( rocknms_left ); +SCREEN_UPDATE( rocknms_right ); VIDEO_START( nndmseal ); diff --git a/src/mame/includes/tx1.h b/src/mame/includes/tx1.h index a9a18a26885..85e60718517 100644 --- a/src/mame/includes/tx1.h +++ b/src/mame/includes/tx1.h @@ -161,7 +161,9 @@ WRITE16_HANDLER( tx1_crtc_w ); PALETTE_INIT( tx1 ); VIDEO_START( tx1 ); -SCREEN_UPDATE( tx1 ); +SCREEN_UPDATE( tx1_left ); +SCREEN_UPDATE( tx1_middle ); +SCREEN_UPDATE( tx1_right ); SCREEN_EOF( tx1 ); WRITE16_HANDLER( tx1_slincs_w ); WRITE16_HANDLER( tx1_slock_w ); @@ -171,7 +173,9 @@ WRITE16_HANDLER( tx1_flgcs_w ); PALETTE_INIT( buggyboy ); VIDEO_START( buggyboy ); -SCREEN_UPDATE( buggyboy ); +SCREEN_UPDATE( buggyboy_left ); +SCREEN_UPDATE( buggyboy_middle ); +SCREEN_UPDATE( buggyboy_right ); SCREEN_EOF( buggyboy ); VIDEO_START( buggybjr ); diff --git a/src/mame/includes/warriorb.h b/src/mame/includes/warriorb.h index a2cbcb10588..5afc2ddbf98 100644 --- a/src/mame/includes/warriorb.h +++ b/src/mame/includes/warriorb.h @@ -36,4 +36,5 @@ public: /*----------- defined in video/warriorb.c -----------*/ VIDEO_START( warriorb ); -SCREEN_UPDATE( warriorb ); +SCREEN_UPDATE( warriorb_left ); +SCREEN_UPDATE( warriorb_right ); diff --git a/src/mame/includes/xmen.h b/src/mame/includes/xmen.h index 0d4beecd5b5..9da4132dae1 100644 --- a/src/mame/includes/xmen.h +++ b/src/mame/includes/xmen.h @@ -44,5 +44,6 @@ void xmen_sprite_callback(running_machine &machine, int *code,int *color,int *pr VIDEO_START( xmen6p ); SCREEN_UPDATE( xmen ); -SCREEN_UPDATE( xmen6p ); +SCREEN_UPDATE( xmen6p_left ); +SCREEN_UPDATE( xmen6p_right ); SCREEN_EOF( xmen6p ); diff --git a/src/mame/machine/3do.c b/src/mame/machine/3do.c index 66452d60603..30403593cea 100644 --- a/src/mame/machine/3do.c +++ b/src/mame/machine/3do.c @@ -987,7 +987,7 @@ VIDEO_START( _3do ) /* This is incorrect! Just testing stuff */ SCREEN_UPDATE( _3do ) { - _3do_state *state = screen->machine().driver_data<_3do_state>(); + _3do_state *state = screen.machine().driver_data<_3do_state>(); UINT32 *source_p = state->m_vram + 0x1c0000 / 4; for ( int i = 0; i < 120; i++ ) diff --git a/src/mame/machine/megadriv.c b/src/mame/machine/megadriv.c index a423f7862b5..bdceff1bffd 100644 --- a/src/mame/machine/megadriv.c +++ b/src/mame/machine/megadriv.c @@ -9406,8 +9406,8 @@ SCREEN_EOF(megadriv) megadrive_imode_odd_frame^=1; // cputag_set_input_line(machine, "genesis_snd_z80", 0, CLEAR_LINE); // if the z80 interrupt hasn't happened by now, clear it.. - if (input_port_read_safe(machine, "RESET", 0x00) & 0x01) - cputag_set_input_line(machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE); + if (input_port_read_safe(screen.machine(), "RESET", 0x00) & 0x01) + cputag_set_input_line(screen.machine(), "maincpu", INPUT_LINE_RESET, PULSE_LINE); /* int megadrive_total_scanlines = 262; @@ -9480,7 +9480,7 @@ int megadrive_z80irq_hpos = 320; visarea.min_y = 0; visarea.max_y = megadrive_visible_scanlines-1; - machine.primary_screen->configure(scr_width, megadrive_visible_scanlines, visarea, HZ_TO_ATTOSECONDS(megadriv_framerate)); + screen.machine().primary_screen->configure(scr_width, megadrive_visible_scanlines, visarea, HZ_TO_ATTOSECONDS(megadriv_framerate)); if (0) { @@ -9491,7 +9491,7 @@ int megadrive_z80irq_hpos = 320; // frametime = ATTOSECONDS_PER_SECOND/megadriv_framerate; //time_elapsed_since_crap = frame_timer->time_elapsed(); - //xxx = machine.device("maincpu")->attotime_to_cycles(time_elapsed_since_crap); + //xxx = screen.machine().device("maincpu")->attotime_to_cycles(time_elapsed_since_crap); //mame_printf_debug("---------- cycles %d, %08x %08x\n",xxx, (UINT32)(time_elapsed_since_crap.attoseconds>>32),(UINT32)(time_elapsed_since_crap.attoseconds&0xffffffff)); //mame_printf_debug("---------- framet %d, %08x %08x\n",xxx, (UINT32)(frametime>>32),(UINT32)(frametime&0xffffffff)); frame_timer->adjust(attotime::zero); diff --git a/src/mame/machine/segamsys.c b/src/mame/machine/segamsys.c index cb5f3b01ad9..a4335e456ce 100644 --- a/src/mame/machine/segamsys.c +++ b/src/mame/machine/segamsys.c @@ -1181,11 +1181,11 @@ static void end_of_frame(running_machine &machine, struct sms_vdp *chip) SCREEN_EOF(sms) { - end_of_frame(machine, md_sms_vdp); + end_of_frame(screen.machine(), md_sms_vdp); // the SMS has a 'RESET' button on the machine, it generates an NMI - if (input_port_read_safe(machine,"PAUSE",0x00)) - cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE); + if (input_port_read_safe(screen.machine(),"PAUSE",0x00)) + cputag_set_input_line(screen.machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE); } @@ -1250,19 +1250,19 @@ MACHINE_RESET(megatech_bios) SCREEN_EOF(systeme) { - end_of_frame(machine, vdp1); - end_of_frame(machine, vdp2); + end_of_frame(screen.machine(), vdp1); + end_of_frame(screen.machine(), vdp2); } SCREEN_EOF(megatech_md_sms) { - end_of_frame(machine, md_sms_vdp); + end_of_frame(screen.machine(), md_sms_vdp); } SCREEN_EOF(megatech_bios) { - end_of_frame(machine, vdp1); + end_of_frame(screen.machine(), vdp1); } SCREEN_UPDATE(megatech_md_sms) diff --git a/src/mame/machine/slikshot.c b/src/mame/machine/slikshot.c index 602d21686f1..777ee3d9d08 100644 --- a/src/mame/machine/slikshot.c +++ b/src/mame/machine/slikshot.c @@ -551,7 +551,7 @@ VIDEO_START( slikshot ) SCREEN_UPDATE( slikshot ) { - itech8_state *state = screen->machine().driver_data(); + itech8_state *state = screen.machine().driver_data(); int totaldy, totaldx; int temp, i; @@ -559,8 +559,8 @@ SCREEN_UPDATE( slikshot ) SCREEN_UPDATE_CALL(itech8_2page); /* add the current X,Y positions to the list */ - state->m_xbuffer[state->m_ybuffer_next % YBUFFER_COUNT] = input_port_read_safe(screen->machine(), "FAKEX", 0); - state->m_ybuffer[state->m_ybuffer_next % YBUFFER_COUNT] = input_port_read_safe(screen->machine(), "FAKEY", 0); + state->m_xbuffer[state->m_ybuffer_next % YBUFFER_COUNT] = input_port_read_safe(screen.machine(), "FAKEX", 0); + state->m_ybuffer[state->m_ybuffer_next % YBUFFER_COUNT] = input_port_read_safe(screen.machine(), "FAKEY", 0); state->m_ybuffer_next++; /* determine where to draw the starting point */ @@ -595,7 +595,7 @@ SCREEN_UPDATE( slikshot ) if (temp >= 0x90) temp = 0x90; state->m_curx = temp; - compute_sensors(screen->machine()); + compute_sensors(screen.machine()); // popmessage("V=%02x,%02x X=%02x", state->m_curvx, state->m_curvy, state->m_curx); state->m_crosshair_vis = 0; } diff --git a/src/mame/video/1942.c b/src/mame/video/1942.c index 274d853f05c..a8c1f01cf3c 100644 --- a/src/mame/video/1942.c +++ b/src/mame/video/1942.c @@ -242,10 +242,10 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( 1942 ) { - _1942_state *state = screen->machine().driver_data<_1942_state>(); + _1942_state *state = screen.machine().driver_data<_1942_state>(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/1943.c b/src/mame/video/1943.c index 8dcb9bcb665..4eab4700409 100644 --- a/src/mame/video/1943.c +++ b/src/mame/video/1943.c @@ -256,7 +256,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( 1943 ) { - _1943_state *state = screen->machine().driver_data<_1943_state>(); + _1943_state *state = screen.machine().driver_data<_1943_state>(); tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bgscrollx[0] + 256 * state->m_bgscrollx[1]); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_scrollx[0] + 256 * state->m_scrollx[1]); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_scrolly[0]); @@ -264,16 +264,16 @@ SCREEN_UPDATE( 1943 ) if (state->m_bg2_on) tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 0); else - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); if (state->m_obj_on) - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0); if (state->m_bg1_on) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); if (state->m_obj_on) - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); if (state->m_char_on) tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); diff --git a/src/mame/video/20pacgal.c b/src/mame/video/20pacgal.c index 131b82ba79b..9218a1e7dad 100644 --- a/src/mame/video/20pacgal.c +++ b/src/mame/video/20pacgal.c @@ -408,13 +408,13 @@ static void draw_stars(_20pacgal_state *state, bitmap_t *bitmap, const rectangle static SCREEN_UPDATE( 20pacgal ) { - _20pacgal_state *state = screen->machine().driver_data<_20pacgal_state>(); + _20pacgal_state *state = screen.machine().driver_data<_20pacgal_state>(); bitmap_fill(bitmap,cliprect,0); draw_stars(state, bitmap,cliprect); draw_chars(state, bitmap); - draw_sprites(screen->machine(),state, bitmap); - do_pen_lookup(screen->machine(), state, bitmap, cliprect); + draw_sprites(screen.machine(),state, bitmap); + do_pen_lookup(screen.machine(), state, bitmap, cliprect); return 0; } diff --git a/src/mame/video/40love.c b/src/mame/video/40love.c index 28cc28a2954..23493233489 100644 --- a/src/mame/video/40love.c +++ b/src/mame/video/40love.c @@ -360,12 +360,12 @@ static void draw_pixram( running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( fortyl ) { - fortyl_state *state = screen->machine().driver_data(); - draw_pixram(screen->machine(), bitmap, cliprect); + fortyl_state *state = screen.machine().driver_data(); + draw_pixram(screen.machine(), bitmap, cliprect); tilemap_set_scrolldy(state->m_bg_tilemap, - state->m_video_ctrl[1] + 1, - state->m_video_ctrl[1] - 1 ); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/4enraya.c b/src/mame/video/4enraya.c index cf29f70fc0b..208c1866234 100644 --- a/src/mame/video/4enraya.c +++ b/src/mame/video/4enraya.c @@ -39,7 +39,7 @@ VIDEO_START( 4enraya ) SCREEN_UPDATE( 4enraya ) { - _4enraya_state *state = screen->machine().driver_data<_4enraya_state>(); + _4enraya_state *state = screen.machine().driver_data<_4enraya_state>(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; diff --git a/src/mame/video/8080bw.c b/src/mame/video/8080bw.c index 875909c2bff..9a9f69d0f59 100644 --- a/src/mame/video/8080bw.c +++ b/src/mame/video/8080bw.c @@ -114,7 +114,7 @@ static void clear_extra_columns( running_machine &machine, bitmap_t *bitmap, pen SCREEN_UPDATE( invadpt2 ) { - _8080bw_state *state = screen->machine().driver_data<_8080bw_state>(); + _8080bw_state *state = screen.machine().driver_data<_8080bw_state>(); pen_t pens[NUM_PENS]; offs_t offs; UINT8 *prom; @@ -122,7 +122,7 @@ SCREEN_UPDATE( invadpt2 ) invadpt2_get_pens(pens); - prom = screen->machine().region("proms")->base(); + prom = screen.machine().region("proms")->base(); color_map_base = state->m_color_map ? &prom[0x0400] : &prom[0x0000]; for (offs = 0; offs < state->m_main_ram_size; offs++) @@ -135,10 +135,10 @@ SCREEN_UPDATE( invadpt2 ) UINT8 data = state->m_main_ram[offs]; UINT8 fore_color = state->m_screen_red ? 1 : color_map_base[color_address] & 0x07; - set_8_pixels(screen->machine(), bitmap, y, x, data, pens, fore_color, 0); + set_8_pixels(screen.machine(), bitmap, y, x, data, pens, fore_color, 0); } - clear_extra_columns(screen->machine(), bitmap, pens, 0); + clear_extra_columns(screen.machine(), bitmap, pens, 0); return 0; } @@ -146,7 +146,7 @@ SCREEN_UPDATE( invadpt2 ) SCREEN_UPDATE( ballbomb ) { - _8080bw_state *state = screen->machine().driver_data<_8080bw_state>(); + _8080bw_state *state = screen.machine().driver_data<_8080bw_state>(); pen_t pens[NUM_PENS]; offs_t offs; UINT8 *color_map_base; @@ -154,7 +154,7 @@ SCREEN_UPDATE( ballbomb ) invadpt2_get_pens(pens); - prom = screen->machine().region("proms")->base(); + prom = screen.machine().region("proms")->base(); color_map_base = state->m_color_map ? &prom[0x0400] : &prom[0x0000]; for (offs = 0; offs < state->m_main_ram_size; offs++) @@ -168,10 +168,10 @@ SCREEN_UPDATE( ballbomb ) UINT8 fore_color = state->m_screen_red ? 1 : color_map_base[color_address] & 0x07; /* blue background */ - set_8_pixels(screen->machine(), bitmap, y, x, data, pens, fore_color, 2); + set_8_pixels(screen.machine(), bitmap, y, x, data, pens, fore_color, 2); } - clear_extra_columns(screen->machine(), bitmap, pens, 2); + clear_extra_columns(screen.machine(), bitmap, pens, 2); return 0; } @@ -179,14 +179,14 @@ SCREEN_UPDATE( ballbomb ) SCREEN_UPDATE( schaser ) { - _8080bw_state *state = screen->machine().driver_data<_8080bw_state>(); + _8080bw_state *state = screen.machine().driver_data<_8080bw_state>(); pen_t pens[NUM_PENS]; offs_t offs; UINT8 *background_map_base; invadpt2_get_pens(pens); - background_map_base = screen->machine().region("proms")->base(); + background_map_base = screen.machine().region("proms")->base(); for (offs = 0; offs < state->m_main_ram_size; offs++) { @@ -209,10 +209,10 @@ SCREEN_UPDATE( schaser ) back_color = (((back_data & 0x0c) == 0x0c) && state->m_schaser_background_select) ? 4 : 2; } - set_8_pixels(screen->machine(), bitmap, y, x, data, pens, fore_color, back_color); + set_8_pixels(screen.machine(), bitmap, y, x, data, pens, fore_color, back_color); } - clear_extra_columns(screen->machine(), bitmap, pens, state->m_schaser_background_disable ? 0 : 2); + clear_extra_columns(screen.machine(), bitmap, pens, state->m_schaser_background_disable ? 0 : 2); return 0; } @@ -220,7 +220,7 @@ SCREEN_UPDATE( schaser ) SCREEN_UPDATE( schasercv ) { - _8080bw_state *state = screen->machine().driver_data<_8080bw_state>(); + _8080bw_state *state = screen.machine().driver_data<_8080bw_state>(); pen_t pens[NUM_PENS]; offs_t offs; @@ -235,10 +235,10 @@ SCREEN_UPDATE( schasercv ) UINT8 fore_color = state->m_colorram[offs & 0x1f9f] & 0x07; /* blue background */ - set_8_pixels(screen->machine(), bitmap, y, x, data, pens, fore_color, 2); + set_8_pixels(screen.machine(), bitmap, y, x, data, pens, fore_color, 2); } - clear_extra_columns(screen->machine(), bitmap, pens, 2); + clear_extra_columns(screen.machine(), bitmap, pens, 2); return 0; } @@ -246,7 +246,7 @@ SCREEN_UPDATE( schasercv ) SCREEN_UPDATE( rollingc ) { - _8080bw_state *state = screen->machine().driver_data<_8080bw_state>(); + _8080bw_state *state = screen.machine().driver_data<_8080bw_state>(); pen_t pens[NUM_PENS]; offs_t offs; @@ -260,10 +260,10 @@ SCREEN_UPDATE( rollingc ) UINT8 data = state->m_main_ram[offs]; UINT8 fore_color = state->m_colorram[offs & 0x1f1f] & 0x07; - set_8_pixels(screen->machine(), bitmap, y, x, data, pens, fore_color, 0); + set_8_pixels(screen.machine(), bitmap, y, x, data, pens, fore_color, 0); } - clear_extra_columns(screen->machine(), bitmap, pens, 0); + clear_extra_columns(screen.machine(), bitmap, pens, 0); return 0; } @@ -271,7 +271,7 @@ SCREEN_UPDATE( rollingc ) SCREEN_UPDATE( polaris ) { - _8080bw_state *state = screen->machine().driver_data<_8080bw_state>(); + _8080bw_state *state = screen.machine().driver_data<_8080bw_state>(); pen_t pens[NUM_PENS]; offs_t offs; UINT8 *color_map_base; @@ -279,8 +279,8 @@ SCREEN_UPDATE( polaris ) invadpt2_get_pens(pens); - color_map_base = screen->machine().region("proms")->base(); - cloud_gfx = screen->machine().region("user1")->base(); + color_map_base = screen.machine().region("proms")->base(); + cloud_gfx = screen.machine().region("user1")->base(); for (offs = 0; offs < state->m_main_ram_size; offs++) { @@ -304,7 +304,7 @@ SCREEN_UPDATE( polaris ) if ((color_map_base[color_address] & 0x08) || (cloud_y >= 64)) { - set_8_pixels(screen->machine(), bitmap, y, x, data, pens, fore_color, back_color); + set_8_pixels(screen.machine(), bitmap, y, x, data, pens, fore_color, back_color); } else { @@ -327,7 +327,7 @@ SCREEN_UPDATE( polaris ) color = (cloud_gfx[cloud_gfx_offs] & bit) ? 7 : back_color; } - set_pixel(screen->machine(), bitmap, y, x, pens, color); + set_pixel(screen.machine(), bitmap, y, x, pens, color); x = x + 1; data = data >> 1; @@ -335,7 +335,7 @@ SCREEN_UPDATE( polaris ) } } - clear_extra_columns(screen->machine(), bitmap, pens, 6); + clear_extra_columns(screen.machine(), bitmap, pens, 6); return 0; } @@ -343,7 +343,7 @@ SCREEN_UPDATE( polaris ) SCREEN_UPDATE( lupin3 ) { - _8080bw_state *state = screen->machine().driver_data<_8080bw_state>(); + _8080bw_state *state = screen.machine().driver_data<_8080bw_state>(); pen_t pens[NUM_PENS]; offs_t offs; @@ -357,10 +357,10 @@ SCREEN_UPDATE( lupin3 ) UINT8 data = state->m_main_ram[offs]; UINT8 fore_color = ~state->m_colorram[offs & 0x1f9f] & 0x07; - set_8_pixels(screen->machine(), bitmap, y, x, data, pens, fore_color, 0); + set_8_pixels(screen.machine(), bitmap, y, x, data, pens, fore_color, 0); } - clear_extra_columns(screen->machine(), bitmap, pens, 0); + clear_extra_columns(screen.machine(), bitmap, pens, 0); return 0; } @@ -368,7 +368,7 @@ SCREEN_UPDATE( lupin3 ) SCREEN_UPDATE( cosmo ) { - _8080bw_state *state = screen->machine().driver_data<_8080bw_state>(); + _8080bw_state *state = screen.machine().driver_data<_8080bw_state>(); pen_t pens[NUM_PENS]; offs_t offs; @@ -384,10 +384,10 @@ SCREEN_UPDATE( cosmo ) UINT8 data = state->m_main_ram[offs]; UINT8 fore_color = state->m_colorram[color_address] & 0x07; - set_8_pixels(screen->machine(), bitmap, y, x, data, pens, fore_color, 0); + set_8_pixels(screen.machine(), bitmap, y, x, data, pens, fore_color, 0); } - clear_extra_columns(screen->machine(), bitmap, pens, 0); + clear_extra_columns(screen.machine(), bitmap, pens, 0); return 0; } @@ -395,7 +395,7 @@ SCREEN_UPDATE( cosmo ) SCREEN_UPDATE( indianbt ) { - _8080bw_state *state = screen->machine().driver_data<_8080bw_state>(); + _8080bw_state *state = screen.machine().driver_data<_8080bw_state>(); pen_t pens[NUM_PENS]; offs_t offs; UINT8 *color_map_base; @@ -403,7 +403,7 @@ SCREEN_UPDATE( indianbt ) cosmo_get_pens(pens); - prom = screen->machine().region("proms")->base(); + prom = screen.machine().region("proms")->base(); color_map_base = state->m_color_map ? &prom[0x0400] : &prom[0x0000]; for (offs = 0; offs < state->m_main_ram_size; offs++) @@ -416,10 +416,10 @@ SCREEN_UPDATE( indianbt ) UINT8 data = state->m_main_ram[offs]; UINT8 fore_color = color_map_base[color_address] & 0x07; - set_8_pixels(screen->machine(), bitmap, y, x, data, pens, fore_color, 0); + set_8_pixels(screen.machine(), bitmap, y, x, data, pens, fore_color, 0); } - clear_extra_columns(screen->machine(), bitmap, pens, 0); + clear_extra_columns(screen.machine(), bitmap, pens, 0); return 0; } @@ -427,7 +427,7 @@ SCREEN_UPDATE( indianbt ) SCREEN_UPDATE( shuttlei ) { - _8080bw_state *state = screen->machine().driver_data<_8080bw_state>(); + _8080bw_state *state = screen.machine().driver_data<_8080bw_state>(); pen_t pens[2] = { RGB_BLACK, RGB_WHITE }; offs_t offs; @@ -450,7 +450,7 @@ SCREEN_UPDATE( shuttlei ) } } - clear_extra_columns(screen->machine(), bitmap, pens, 0); + clear_extra_columns(screen.machine(), bitmap, pens, 0); return 0; } @@ -458,7 +458,7 @@ SCREEN_UPDATE( shuttlei ) SCREEN_UPDATE( sflush ) { - _8080bw_state *state = screen->machine().driver_data<_8080bw_state>(); + _8080bw_state *state = screen.machine().driver_data<_8080bw_state>(); pen_t pens[NUM_PENS]; offs_t offs; @@ -472,10 +472,10 @@ SCREEN_UPDATE( sflush ) UINT8 data = state->m_main_ram[offs]; UINT8 fore_color = state->m_colorram[offs & 0x1f9f] & 0x07; - set_8_pixels(screen->machine(), bitmap, y, x, data, pens, fore_color, 0); + set_8_pixels(screen.machine(), bitmap, y, x, data, pens, fore_color, 0); } - clear_extra_columns(screen->machine(), bitmap, pens, 0); + clear_extra_columns(screen.machine(), bitmap, pens, 0); return 0; } diff --git a/src/mame/video/88games.c b/src/mame/video/88games.c index 04c9f93507e..45973b80686 100644 --- a/src/mame/video/88games.c +++ b/src/mame/video/88games.c @@ -56,7 +56,7 @@ void _88games_zoom_callback( running_machine &machine, int *code, int *color, in SCREEN_UPDATE( 88games ) { - _88games_state *state = screen->machine().driver_data<_88games_state>(); + _88games_state *state = screen.machine().driver_data<_88games_state>(); k052109_tilemap_update(state->m_k052109); diff --git a/src/mame/video/actfancr.c b/src/mame/video/actfancr.c index 19509eff357..f92d41f25e6 100644 --- a/src/mame/video/actfancr.c +++ b/src/mame/video/actfancr.c @@ -26,15 +26,15 @@ VIDEO_START( actfancr ) SCREEN_UPDATE( actfancr ) { - actfancr_state *state = screen->machine().driver_data(); + actfancr_state *state = screen.machine().driver_data(); /* Draw playfield */ //state->m_flipscreen = state->m_control_2[0] & 0x80; - //tilemap_set_flip_all(screen->machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + //tilemap_set_flip_all(screen.machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); - screen->machine().device("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram16, 0x00, 0x00, 0x0f); - screen->machine().device("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram16, 0x00, 0x00, 0x0f); + screen.machine().device("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); return 0; } diff --git a/src/mame/video/aeroboto.c b/src/mame/video/aeroboto.c index 333e3c05c8d..aa5ed4ca44f 100644 --- a/src/mame/video/aeroboto.c +++ b/src/mame/video/aeroboto.c @@ -156,7 +156,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( aeroboto ) { - aeroboto_state *state = screen->machine().driver_data(); + aeroboto_state *state = screen.machine().driver_data(); static const rectangle splitrect1 = { 0, 255, 0, 39 }; static const rectangle splitrect2 = { 0, 255, 40, 255 }; @@ -220,7 +220,7 @@ SCREEN_UPDATE( aeroboto ) tilemap_set_scrolly(state->m_bg_tilemap, 0, *state->m_vscroll); tilemap_draw(bitmap, &splitrect2, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); // the status display behaves more closely to a 40-line splitscreen than an overlay tilemap_set_scrolly(state->m_bg_tilemap, 0, 0); diff --git a/src/mame/video/aerofgt.c b/src/mame/video/aerofgt.c index 05679ed45e9..8dfd8209456 100644 --- a/src/mame/video/aerofgt.c +++ b/src/mame/video/aerofgt.c @@ -840,7 +840,7 @@ static void wbbc97_draw_bitmap( running_machine &machine, bitmap_t *bitmap ) SCREEN_UPDATE( pspikes ) { - aerofgt_state *state = screen->machine().driver_data(); + aerofgt_state *state = screen.machine().driver_data(); int i, scrolly; tilemap_set_scroll_rows(state->m_bg1_tilemap, 256); @@ -849,17 +849,17 @@ SCREEN_UPDATE( pspikes ) tilemap_set_scrollx(state->m_bg1_tilemap, (i + scrolly) & 0xff, state->m_rasterram[i]); tilemap_set_scrolly(state->m_bg1_tilemap, 0, scrolly); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); - turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 0, -1); - turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 0, 0); + turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 0, -1); + turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 0, 0); return 0; } SCREEN_UPDATE( pspikesb ) { - aerofgt_state *state = screen->machine().driver_data(); + aerofgt_state *state = screen.machine().driver_data(); int i, scrolly; tilemap_set_scroll_rows(state->m_bg1_tilemap, 256); @@ -869,17 +869,17 @@ SCREEN_UPDATE( pspikesb ) tilemap_set_scrolly(state->m_bg1_tilemap, 0, scrolly); tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); - pspikesb_draw_sprites(screen->machine(), bitmap, cliprect); + pspikesb_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( spikes91 ) { - aerofgt_state *state = screen->machine().driver_data(); + aerofgt_state *state = screen.machine().driver_data(); int i, scrolly; int y, x; int count; - const gfx_element *gfx = screen->machine().gfx[0]; + const gfx_element *gfx = screen.machine().gfx[0]; tilemap_set_scroll_rows(state->m_bg1_tilemap, 256); scrolly = state->m_bg1scrolly; @@ -889,7 +889,7 @@ SCREEN_UPDATE( spikes91 ) tilemap_set_scrolly(state->m_bg1_tilemap, 0, scrolly); tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); - spikes91_draw_sprites(screen->machine(), bitmap, cliprect); + spikes91_draw_sprites(screen.machine(), bitmap, cliprect); /* we could use a tilemap, but it's easier to just do it here */ count = 0; @@ -916,28 +916,28 @@ SCREEN_UPDATE( spikes91 ) SCREEN_UPDATE( karatblz ) { - aerofgt_state *state = screen->machine().driver_data(); + aerofgt_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg1_tilemap, 0, state->m_bg1scrollx - 8); tilemap_set_scrolly(state->m_bg1_tilemap, 0, state->m_bg1scrolly); tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2scrollx - 4); tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2scrolly); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 0); /* we use the priority buffer so sprites are drawn front to back */ - turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 1, -1); - turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 1, 0); - turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 0, -1); - turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 0, 0); + turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 1, -1); + turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 1, 0); + turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 0, -1); + turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 0, 0); return 0; } SCREEN_UPDATE( spinlbrk ) { - aerofgt_state *state = screen->machine().driver_data(); + aerofgt_state *state = screen.machine().driver_data(); int i, scrolly; tilemap_set_scroll_rows(state->m_bg1_tilemap, 512); @@ -948,22 +948,22 @@ SCREEN_UPDATE( spinlbrk ) tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2scrollx - 4); // tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2scrolly); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 1); /* we use the priority buffer so sprites are drawn front to back */ - spinlbrk_draw_sprites(screen->machine(), bitmap, cliprect, 0, 0); - spinlbrk_draw_sprites(screen->machine(), bitmap, cliprect, 0, -1); - spinlbrk_draw_sprites(screen->machine(), bitmap, cliprect, 1, 0); - spinlbrk_draw_sprites(screen->machine(), bitmap, cliprect, 1, -1); + spinlbrk_draw_sprites(screen.machine(), bitmap, cliprect, 0, 0); + spinlbrk_draw_sprites(screen.machine(), bitmap, cliprect, 0, -1); + spinlbrk_draw_sprites(screen.machine(), bitmap, cliprect, 1, 0); + spinlbrk_draw_sprites(screen.machine(), bitmap, cliprect, 1, -1); return 0; } SCREEN_UPDATE( turbofrc ) { - aerofgt_state *state = screen->machine().driver_data(); + aerofgt_state *state = screen.machine().driver_data(); int i, scrolly; tilemap_set_scroll_rows(state->m_bg1_tilemap, 512); @@ -975,45 +975,45 @@ SCREEN_UPDATE( turbofrc ) tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2scrollx - 7); tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2scrolly + 2); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 1); /* we use the priority buffer so sprites are drawn front to back */ - turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 1, -1); //ship - turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 1, 0); //intro - turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 0, -1); //enemy - turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 0, 0); //enemy + turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 1, -1); //ship + turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 1, 0); //intro + turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 0, -1); //enemy + turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 0, 0); //enemy return 0; } SCREEN_UPDATE( aerofgt ) { - aerofgt_state *state = screen->machine().driver_data(); + aerofgt_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg1_tilemap, 0, state->m_rasterram[0x0000] - 18); tilemap_set_scrolly(state->m_bg1_tilemap, 0, state->m_bg1scrolly); tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_rasterram[0x0200] - 20); tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2scrolly); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); - aerofgt_draw_sprites(screen->machine(), bitmap, cliprect, 0); - aerofgt_draw_sprites(screen->machine(), bitmap, cliprect, 1); + aerofgt_draw_sprites(screen.machine(), bitmap, cliprect, 0); + aerofgt_draw_sprites(screen.machine(), bitmap, cliprect, 1); tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 0); - aerofgt_draw_sprites(screen->machine(), bitmap, cliprect, 2); - aerofgt_draw_sprites(screen->machine(), bitmap, cliprect, 3); + aerofgt_draw_sprites(screen.machine(), bitmap, cliprect, 2); + aerofgt_draw_sprites(screen.machine(), bitmap, cliprect, 3); return 0; } SCREEN_UPDATE( aerfboot ) { - aerofgt_state *state = screen->machine().driver_data(); + aerofgt_state *state = screen.machine().driver_data(); int i, scrolly; tilemap_set_scroll_rows(state->m_bg1_tilemap, 512); @@ -1024,19 +1024,19 @@ SCREEN_UPDATE( aerfboot ) tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2scrollx + 172); tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2scrolly + 2); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 1); /* we use the priority buffer so sprites are drawn front to back */ - aerfboot_draw_sprites(screen->machine(), bitmap, cliprect); + aerfboot_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( aerfboo2 ) { - aerofgt_state *state = screen->machine().driver_data(); + aerofgt_state *state = screen.machine().driver_data(); int i, scrolly; tilemap_set_scroll_rows(state->m_bg1_tilemap, 512); @@ -1048,22 +1048,22 @@ SCREEN_UPDATE( aerfboo2 ) tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2scrollx - 7); tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2scrolly + 2); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 1); /* we use the priority buffer so sprites are drawn front to back */ - aerfboo2_draw_sprites(screen->machine(), bitmap, cliprect, 1, -1); //ship - aerfboo2_draw_sprites(screen->machine(), bitmap, cliprect, 1, 0); //intro - aerfboo2_draw_sprites(screen->machine(), bitmap, cliprect, 0, -1); //enemy - aerfboo2_draw_sprites(screen->machine(), bitmap, cliprect, 0, 0); //enemy + aerfboo2_draw_sprites(screen.machine(), bitmap, cliprect, 1, -1); //ship + aerfboo2_draw_sprites(screen.machine(), bitmap, cliprect, 1, 0); //intro + aerfboo2_draw_sprites(screen.machine(), bitmap, cliprect, 0, -1); //enemy + aerfboo2_draw_sprites(screen.machine(), bitmap, cliprect, 0, 0); //enemy return 0; } SCREEN_UPDATE( wbbc97 ) { - aerofgt_state *state = screen->machine().driver_data(); + aerofgt_state *state = screen.machine().driver_data(); int i, scrolly; tilemap_set_scroll_rows(state->m_bg1_tilemap, 256); @@ -1072,11 +1072,11 @@ SCREEN_UPDATE( wbbc97 ) tilemap_set_scrollx(state->m_bg1_tilemap, (i + scrolly) & 0xff, state->m_rasterram[i]); tilemap_set_scrolly(state->m_bg1_tilemap, 0, scrolly); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); if (state->m_wbbc97_bitmap_enable) { - wbbc97_draw_bitmap(screen->machine(), bitmap); + wbbc97_draw_bitmap(screen.machine(), bitmap); tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); } else @@ -1084,7 +1084,7 @@ SCREEN_UPDATE( wbbc97 ) tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, TILEMAP_DRAW_OPAQUE, 0); } - turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 0, -1); - turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 0, 0); + turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 0, -1); + turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 0, 0); return 0; } diff --git a/src/mame/video/airbustr.c b/src/mame/video/airbustr.c index 83eef3e940b..f89feb985be 100644 --- a/src/mame/video/airbustr.c +++ b/src/mame/video/airbustr.c @@ -135,7 +135,7 @@ VIDEO_START( airbustr ) SCREEN_UPDATE( airbustr ) { - airbustr_state *state = screen->machine().driver_data(); + airbustr_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); @@ -148,7 +148,7 @@ SCREEN_UPDATE( airbustr ) SCREEN_EOF( airbustr ) { - airbustr_state *state = machine.driver_data(); + airbustr_state *state = screen.machine().driver_data(); // update the sprite bitmap pandora_eof(state->m_pandora); diff --git a/src/mame/video/ajax.c b/src/mame/video/ajax.c index 2cd212d5da7..e2d25b709fc 100644 --- a/src/mame/video/ajax.c +++ b/src/mame/video/ajax.c @@ -89,13 +89,13 @@ VIDEO_START( ajax ) SCREEN_UPDATE( ajax ) { - ajax_state *state = screen->machine().driver_data(); + ajax_state *state = screen.machine().driver_data(); k052109_tilemap_update(state->m_k052109); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 2, 0, 1); if (state->m_priority) { diff --git a/src/mame/video/aliens.c b/src/mame/video/aliens.c index ee55bf358c1..ed2804ff9e2 100644 --- a/src/mame/video/aliens.c +++ b/src/mame/video/aliens.c @@ -77,11 +77,11 @@ VIDEO_START( aliens ) SCREEN_UPDATE( aliens ) { - aliens_state *state = screen->machine().driver_data(); + aliens_state *state = screen.machine().driver_data(); k052109_tilemap_update(state->m_k052109); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, state->m_layer_colorbase[1] * 16); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 1, 0, 1); diff --git a/src/mame/video/alpha68k.c b/src/mame/video/alpha68k.c index 8dc5306d539..3d5b8a1d799 100644 --- a/src/mame/video/alpha68k.c +++ b/src/mame/video/alpha68k.c @@ -130,20 +130,20 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( alpha68k_II ) { - alpha68k_state *state = screen->machine().driver_data(); + alpha68k_state *state = screen.machine().driver_data(); if (state->m_last_bank != state->m_bank_base) - tilemap_mark_all_tiles_dirty_all(screen->machine()); + tilemap_mark_all_tiles_dirty_all(screen.machine()); state->m_last_bank = state->m_bank_base; - tilemap_set_flip_all(screen->machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + tilemap_set_flip_all(screen.machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); bitmap_fill(bitmap, cliprect, 2047); //AT - draw_sprites(screen->machine(), bitmap, cliprect, 0, 0x07c0, 0x0800); - draw_sprites(screen->machine(), bitmap, cliprect, 1, 0x0000, 0x0800); - draw_sprites(screen->machine(), bitmap, cliprect, 2, 0x0000, 0x0800); - draw_sprites(screen->machine(), bitmap, cliprect, 0, 0x0000, 0x07c0); + draw_sprites(screen.machine(), bitmap, cliprect, 0, 0x07c0, 0x0800); + draw_sprites(screen.machine(), bitmap, cliprect, 1, 0x0000, 0x0800); + draw_sprites(screen.machine(), bitmap, cliprect, 2, 0x0000, 0x0800); + draw_sprites(screen.machine(), bitmap, cliprect, 0, 0x0000, 0x07c0); //ZT tilemap_draw(bitmap, cliprect, state->m_fix_tilemap, 0, 0); return 0; @@ -277,39 +277,39 @@ static void draw_sprites_V( running_machine &machine, bitmap_t *bitmap, const re SCREEN_UPDATE( alpha68k_V ) { - alpha68k_state *state = screen->machine().driver_data(); + alpha68k_state *state = screen.machine().driver_data(); UINT16 *spriteram = state->m_spriteram; if (state->m_last_bank != state->m_bank_base) - tilemap_mark_all_tiles_dirty_all(screen->machine()); + tilemap_mark_all_tiles_dirty_all(screen.machine()); state->m_last_bank = state->m_bank_base; - tilemap_set_flip_all(screen->machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + tilemap_set_flip_all(screen.machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); bitmap_fill(bitmap, cliprect, 4095); /* This appears to be correct priority */ if (state->m_microcontroller_id == 0x8814) /* Sky Adventure */ { - draw_sprites_V(screen->machine(), bitmap, cliprect, 0, 0x07c0, 0x0800, 0, 0x8000, 0x7fff); - draw_sprites_V(screen->machine(), bitmap, cliprect, 1, 0x0000, 0x0800, 0, 0x8000, 0x7fff); + draw_sprites_V(screen.machine(), bitmap, cliprect, 0, 0x07c0, 0x0800, 0, 0x8000, 0x7fff); + draw_sprites_V(screen.machine(), bitmap, cliprect, 1, 0x0000, 0x0800, 0, 0x8000, 0x7fff); //AT: *KLUDGE* fixes priest priority in level 1(could be a game bug) if (spriteram[0x1bde] == 0x24 && (spriteram[0x1bdf] >> 8) == 0x3b) { - draw_sprites_V(screen->machine(), bitmap, cliprect, 2, 0x03c0, 0x0800, 0, 0x8000, 0x7fff); - draw_sprites_V(screen->machine(), bitmap, cliprect, 2, 0x0000, 0x03c0, 0, 0x8000, 0x7fff); + draw_sprites_V(screen.machine(), bitmap, cliprect, 2, 0x03c0, 0x0800, 0, 0x8000, 0x7fff); + draw_sprites_V(screen.machine(), bitmap, cliprect, 2, 0x0000, 0x03c0, 0, 0x8000, 0x7fff); } else - draw_sprites_V(screen->machine(), bitmap, cliprect, 2, 0x0000, 0x0800, 0, 0x8000, 0x7fff); + draw_sprites_V(screen.machine(), bitmap, cliprect, 2, 0x0000, 0x0800, 0, 0x8000, 0x7fff); - draw_sprites_V(screen->machine(), bitmap, cliprect, 0, 0x0000, 0x07c0, 0, 0x8000, 0x7fff); + draw_sprites_V(screen.machine(), bitmap, cliprect, 0, 0x0000, 0x07c0, 0, 0x8000, 0x7fff); } else /* gangwars */ { - draw_sprites_V(screen->machine(), bitmap, cliprect, 0, 0x07c0, 0x0800, 0x8000, 0, 0x7fff); - draw_sprites_V(screen->machine(), bitmap, cliprect, 1, 0x0000, 0x0800, 0x8000, 0, 0x7fff); - draw_sprites_V(screen->machine(), bitmap, cliprect, 2, 0x0000, 0x0800, 0x8000, 0, 0x7fff); - draw_sprites_V(screen->machine(), bitmap, cliprect, 0, 0x0000, 0x07c0, 0x8000, 0, 0x7fff); + draw_sprites_V(screen.machine(), bitmap, cliprect, 0, 0x07c0, 0x0800, 0x8000, 0, 0x7fff); + draw_sprites_V(screen.machine(), bitmap, cliprect, 1, 0x0000, 0x0800, 0x8000, 0, 0x7fff); + draw_sprites_V(screen.machine(), bitmap, cliprect, 2, 0x0000, 0x0800, 0x8000, 0, 0x7fff); + draw_sprites_V(screen.machine(), bitmap, cliprect, 0, 0x0000, 0x07c0, 0x8000, 0, 0x7fff); } tilemap_draw(bitmap, cliprect, state->m_fix_tilemap, 0, 0); @@ -318,21 +318,21 @@ SCREEN_UPDATE( alpha68k_V ) SCREEN_UPDATE( alpha68k_V_sb ) { - alpha68k_state *state = screen->machine().driver_data(); + alpha68k_state *state = screen.machine().driver_data(); if (state->m_last_bank != state->m_bank_base) - tilemap_mark_all_tiles_dirty_all(screen->machine()); + tilemap_mark_all_tiles_dirty_all(screen.machine()); state->m_last_bank = state->m_bank_base; - tilemap_set_flip_all(screen->machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + tilemap_set_flip_all(screen.machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); bitmap_fill(bitmap, cliprect, 4095); /* This appears to be correct priority */ - draw_sprites_V(screen->machine(), bitmap, cliprect, 0, 0x07c0, 0x0800, 0x4000, 0x8000, 0x3fff); - draw_sprites_V(screen->machine(), bitmap, cliprect, 1, 0x0000, 0x0800, 0x4000, 0x8000, 0x3fff); - draw_sprites_V(screen->machine(), bitmap, cliprect, 2, 0x0000, 0x0800, 0x4000, 0x8000, 0x3fff); - draw_sprites_V(screen->machine(), bitmap, cliprect, 0, 0x0000, 0x07c0, 0x4000, 0x8000, 0x3fff); + draw_sprites_V(screen.machine(), bitmap, cliprect, 0, 0x07c0, 0x0800, 0x4000, 0x8000, 0x3fff); + draw_sprites_V(screen.machine(), bitmap, cliprect, 1, 0x0000, 0x0800, 0x4000, 0x8000, 0x3fff); + draw_sprites_V(screen.machine(), bitmap, cliprect, 2, 0x0000, 0x0800, 0x4000, 0x8000, 0x3fff); + draw_sprites_V(screen.machine(), bitmap, cliprect, 0, 0x0000, 0x07c0, 0x4000, 0x8000, 0x3fff); tilemap_draw(bitmap, cliprect, state->m_fix_tilemap, 0, 0); return 0; @@ -370,15 +370,15 @@ static void draw_sprites_I( running_machine &machine, bitmap_t *bitmap, const re SCREEN_UPDATE( alpha68k_I ) { - alpha68k_state *state = screen->machine().driver_data(); + alpha68k_state *state = screen.machine().driver_data(); int yshift = (state->m_microcontroller_id == 0x890a) ? 1 : 0; // The Next Space is 1 pixel off - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); /* This appears to be correct priority */ - draw_sprites_I(screen->machine(), bitmap, cliprect, 2, 0x0800, yshift); - draw_sprites_I(screen->machine(), bitmap, cliprect, 3, 0x0c00, yshift); - draw_sprites_I(screen->machine(), bitmap, cliprect, 1, 0x0400, yshift); + draw_sprites_I(screen.machine(), bitmap, cliprect, 2, 0x0800, yshift); + draw_sprites_I(screen.machine(), bitmap, cliprect, 3, 0x0c00, yshift); + draw_sprites_I(screen.machine(), bitmap, cliprect, 1, 0x0400, yshift); return 0; } //ZT @@ -503,13 +503,13 @@ static void kyros_draw_sprites( running_machine &machine, bitmap_t *bitmap, cons SCREEN_UPDATE( kyros ) { - alpha68k_state *state = screen->machine().driver_data(); - colortable_entry_set_value(screen->machine().colortable, 0x100, *state->m_videoram & 0xff); + alpha68k_state *state = screen.machine().driver_data(); + colortable_entry_set_value(screen.machine().colortable, 0x100, *state->m_videoram & 0xff); bitmap_fill(bitmap, cliprect, 0x100); //AT - kyros_draw_sprites(screen->machine(), bitmap, cliprect, 2, 0x0800); - kyros_draw_sprites(screen->machine(), bitmap, cliprect, 3, 0x0c00); - kyros_draw_sprites(screen->machine(), bitmap, cliprect, 1, 0x0400); + kyros_draw_sprites(screen.machine(), bitmap, cliprect, 2, 0x0800); + kyros_draw_sprites(screen.machine(), bitmap, cliprect, 3, 0x0c00); + kyros_draw_sprites(screen.machine(), bitmap, cliprect, 1, 0x0400); return 0; } @@ -563,12 +563,12 @@ static void sstingry_draw_sprites( running_machine &machine, bitmap_t *bitmap, c SCREEN_UPDATE( sstingry ) { - alpha68k_state *state = screen->machine().driver_data(); - colortable_entry_set_value(screen->machine().colortable, 0x100, *state->m_videoram & 0xff); + alpha68k_state *state = screen.machine().driver_data(); + colortable_entry_set_value(screen.machine().colortable, 0x100, *state->m_videoram & 0xff); bitmap_fill(bitmap, cliprect, 0x100); //AT - sstingry_draw_sprites(screen->machine(), bitmap, cliprect, 2, 0x0800); - sstingry_draw_sprites(screen->machine(), bitmap, cliprect, 3, 0x0c00); - sstingry_draw_sprites(screen->machine(), bitmap, cliprect, 1, 0x0400); + sstingry_draw_sprites(screen.machine(), bitmap, cliprect, 2, 0x0800); + sstingry_draw_sprites(screen.machine(), bitmap, cliprect, 3, 0x0c00); + sstingry_draw_sprites(screen.machine(), bitmap, cliprect, 1, 0x0400); return 0; } diff --git a/src/mame/video/ambush.c b/src/mame/video/ambush.c index 512c0e0e756..d233a6a4ebd 100644 --- a/src/mame/video/ambush.c +++ b/src/mame/video/ambush.c @@ -89,13 +89,13 @@ static void draw_chars( running_machine &machine, bitmap_t *bitmap, const rectan SCREEN_UPDATE( ambush ) { - ambush_state *state = screen->machine().driver_data(); + ambush_state *state = screen.machine().driver_data(); int offs; bitmap_fill(bitmap, cliprect, 0); /* Draw the characters */ - draw_chars(screen->machine(), bitmap, cliprect, 0x00); + draw_chars(screen.machine(), bitmap, cliprect, 0x00); /* Draw the sprites. */ for (offs = state->m_spriteram_size - 4; offs >= 0; offs -= 4) @@ -119,7 +119,7 @@ SCREEN_UPDATE( ambush ) /* 16x16 sprites */ gfx = 1; - if (!flip_screen_get(screen->machine())) + if (!flip_screen_get(screen.machine())) sy = 240 - sy; else sx = 240 - sx; @@ -130,7 +130,7 @@ SCREEN_UPDATE( ambush ) gfx = 0; code <<= 2; - if (!flip_screen_get(screen->machine())) + if (!flip_screen_get(screen.machine())) sy = 248 - sy; else sx = 248 - sx; @@ -140,19 +140,19 @@ SCREEN_UPDATE( ambush ) flipx = state->m_spriteram[offs + 1] & 0x40; flipy = state->m_spriteram[offs + 1] & 0x80; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { flipx = !flipx; flipy = !flipy; } - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[gfx], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[gfx], code, col | ((*state->m_colorbank & 0x03) << 4), flipx, flipy, sx,sy,0); } /* Draw the foreground priority characters over the sprites */ - draw_chars(screen->machine(), bitmap, cliprect, 0x10); + draw_chars(screen.machine(), bitmap, cliprect, 0x10); return 0; } diff --git a/src/mame/video/amiga.c b/src/mame/video/amiga.c index edf021eaa49..f0b738d7102 100644 --- a/src/mame/video/amiga.c +++ b/src/mame/video/amiga.c @@ -1005,7 +1005,7 @@ SCREEN_UPDATE( amiga ) /* render each scanline in the visible region */ for (y = cliprect->min_y; y <= cliprect->max_y; y++) - amiga_render_scanline(screen->machine(), bitmap, y); + amiga_render_scanline(screen.machine(), bitmap, y); return 0; } diff --git a/src/mame/video/amigaaga.c b/src/mame/video/amigaaga.c index 62d7cd90055..b8870f05e89 100644 --- a/src/mame/video/amigaaga.c +++ b/src/mame/video/amigaaga.c @@ -866,7 +866,7 @@ SCREEN_UPDATE( amiga_aga ) /* render each scanline in the visible region */ for (y = cliprect->min_y; y <= cliprect->max_y; y++) - amiga_aga_render_scanline(screen->machine(), bitmap, y); + amiga_aga_render_scanline(screen.machine(), bitmap, y); return 0; } diff --git a/src/mame/video/ampoker2.c b/src/mame/video/ampoker2.c index f5848e27aef..ef17d8f442e 100644 --- a/src/mame/video/ampoker2.c +++ b/src/mame/video/ampoker2.c @@ -163,7 +163,7 @@ VIDEO_START(sigma2k) SCREEN_UPDATE(ampoker2) { - ampoker2_state *state = screen->machine().driver_data(); + ampoker2_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/amspdwy.c b/src/mame/video/amspdwy.c index a6e7eeeec29..b6ba74a8e2b 100644 --- a/src/mame/video/amspdwy.c +++ b/src/mame/video/amspdwy.c @@ -148,8 +148,8 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( amspdwy ) { - amspdwy_state *state = screen->machine().driver_data(); + amspdwy_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/angelkds.c b/src/mame/video/angelkds.c index 70117df4da3..c1b898d898e 100644 --- a/src/mame/video/angelkds.c +++ b/src/mame/video/angelkds.c @@ -274,8 +274,8 @@ VIDEO_START( angelkds ) SCREEN_UPDATE( angelkds ) { - angelkds_state *state = screen->machine().driver_data(); - const rectangle &visarea = screen->visible_area(); + angelkds_state *state = screen.machine().driver_data(); + const rectangle &visarea = screen.visible_area(); rectangle clip; bitmap_fill(bitmap, cliprect, 0x3f); /* is there a register controling the colour?, we currently use the last colour of the tx palette */ @@ -289,7 +289,7 @@ SCREEN_UPDATE( angelkds ) if ((state->m_layer_ctrl & 0x80) == 0x00) tilemap_draw(bitmap, &clip, state->m_bgtop_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, &clip, 0x80); + draw_sprites(screen.machine(), bitmap, &clip, 0x80); if ((state->m_layer_ctrl & 0x20) == 0x00) tilemap_draw(bitmap, &clip, state->m_tx_tilemap, 0, 0); @@ -303,7 +303,7 @@ SCREEN_UPDATE( angelkds ) if ((state->m_layer_ctrl & 0x40) == 0x00) tilemap_draw(bitmap, &clip, state->m_bgbot_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, &clip, 0x40); + draw_sprites(screen.machine(), bitmap, &clip, 0x40); if ((state->m_layer_ctrl & 0x20) == 0x00) tilemap_draw(bitmap, &clip, state->m_tx_tilemap, 0, 0); diff --git a/src/mame/video/appoooh.c b/src/mame/video/appoooh.c index 8021149f3f4..24011bd872b 100644 --- a/src/mame/video/appoooh.c +++ b/src/mame/video/appoooh.c @@ -272,7 +272,7 @@ static void robowres_draw_sprites( bitmap_t *dest_bmp, const rectangle *cliprect SCREEN_UPDATE( appoooh ) { - appoooh_state *state = screen->machine().driver_data(); + appoooh_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); if (state->m_priority == 0) /* fg behind sprites */ @@ -282,16 +282,16 @@ SCREEN_UPDATE( appoooh ) if (state->m_priority == 1) { /* sprite set #1 */ - appoooh_draw_sprites(bitmap, cliprect, screen->machine().gfx[2], state->m_spriteram); + appoooh_draw_sprites(bitmap, cliprect, screen.machine().gfx[2], state->m_spriteram); /* sprite set #2 */ - appoooh_draw_sprites(bitmap, cliprect, screen->machine().gfx[3], state->m_spriteram_2); + appoooh_draw_sprites(bitmap, cliprect, screen.machine().gfx[3], state->m_spriteram_2); } else { /* sprite set #2 */ - appoooh_draw_sprites(bitmap, cliprect, screen->machine().gfx[3], state->m_spriteram_2); + appoooh_draw_sprites(bitmap, cliprect, screen.machine().gfx[3], state->m_spriteram_2); /* sprite set #1 */ - appoooh_draw_sprites(bitmap, cliprect, screen->machine().gfx[2], state->m_spriteram); + appoooh_draw_sprites(bitmap, cliprect, screen.machine().gfx[2], state->m_spriteram); } if (state->m_priority != 0) /* fg in front of sprites */ @@ -302,7 +302,7 @@ SCREEN_UPDATE( appoooh ) SCREEN_UPDATE( robowres ) { - appoooh_state *state = screen->machine().driver_data(); + appoooh_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); if (state->m_priority == 0) /* fg behind sprites */ @@ -312,16 +312,16 @@ SCREEN_UPDATE( robowres ) if (state->m_priority == 1) { /* sprite set #1 */ - robowres_draw_sprites(bitmap, cliprect, screen->machine().gfx[2], state->m_spriteram); + robowres_draw_sprites(bitmap, cliprect, screen.machine().gfx[2], state->m_spriteram); /* sprite set #2 */ - robowres_draw_sprites(bitmap, cliprect, screen->machine().gfx[3], state->m_spriteram_2); + robowres_draw_sprites(bitmap, cliprect, screen.machine().gfx[3], state->m_spriteram_2); } else { /* sprite set #2 */ - robowres_draw_sprites(bitmap, cliprect, screen->machine().gfx[3], state->m_spriteram_2); + robowres_draw_sprites(bitmap, cliprect, screen.machine().gfx[3], state->m_spriteram_2); /* sprite set #1 */ - robowres_draw_sprites(bitmap, cliprect, screen->machine().gfx[2], state->m_spriteram); + robowres_draw_sprites(bitmap, cliprect, screen.machine().gfx[2], state->m_spriteram); } if (state->m_priority != 0) /* fg in front of sprites */ diff --git a/src/mame/video/aquarium.c b/src/mame/video/aquarium.c index 5aa891ab1a3..ca6c49d874d 100644 --- a/src/mame/video/aquarium.c +++ b/src/mame/video/aquarium.c @@ -160,7 +160,7 @@ VIDEO_START(aquarium) SCREEN_UPDATE(aquarium) { - aquarium_state *state = screen->machine().driver_data(); + aquarium_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_mid_tilemap, 0, state->m_scroll[0]); tilemap_set_scrolly(state->m_mid_tilemap, 0, state->m_scroll[1]); tilemap_set_scrollx(state->m_bak_tilemap, 0, state->m_scroll[2]); @@ -171,7 +171,7 @@ SCREEN_UPDATE(aquarium) tilemap_draw(bitmap, cliprect, state->m_bak_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_mid_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 16); + draw_sprites(screen.machine(), bitmap, cliprect, 16); tilemap_draw(bitmap, cliprect, state->m_bak_tilemap, 1, 0); tilemap_draw(bitmap, cliprect, state->m_mid_tilemap, 1, 0); diff --git a/src/mame/video/arabian.c b/src/mame/video/arabian.c index f593fccc1a7..e9f3bade118 100644 --- a/src/mame/video/arabian.c +++ b/src/mame/video/arabian.c @@ -370,8 +370,8 @@ WRITE8_HANDLER( arabian_videoram_w ) SCREEN_UPDATE( arabian ) { - arabian_state *state = screen->machine().driver_data(); - const pen_t *pens = &screen->machine().pens[(state->m_video_control >> 3) << 8]; + arabian_state *state = screen.machine().driver_data(); + const pen_t *pens = &screen.machine().pens[(state->m_video_control >> 3) << 8]; int y; /* render the screen from the bitmap */ diff --git a/src/mame/video/arcadecl.c b/src/mame/video/arcadecl.c index 8fdf04f07bb..c927946e53e 100644 --- a/src/mame/video/arcadecl.c +++ b/src/mame/video/arcadecl.c @@ -80,10 +80,10 @@ VIDEO_START( arcadecl ) SCREEN_UPDATE( arcadecl ) { - arcadecl_state *state = screen->machine().driver_data(); + arcadecl_state *state = screen.machine().driver_data(); /* draw the playfield */ - arcadecl_bitmap_render(screen->machine(), bitmap, cliprect); + arcadecl_bitmap_render(screen.machine(), bitmap, cliprect); /* draw and merge the MO */ if (state->m_has_mo) diff --git a/src/mame/video/archimds.c b/src/mame/video/archimds.c index d94b754b83a..25dfd01ec09 100644 --- a/src/mame/video/archimds.c +++ b/src/mame/video/archimds.c @@ -20,7 +20,7 @@ SCREEN_UPDATE( archimds_vidc ) const UINT8 x_step[4] = { 5, 7, 11, 19 }; /* border color */ - bitmap_fill(bitmap, cliprect, screen->machine().pens[0x10]); + bitmap_fill(bitmap, cliprect, screen.machine().pens[0x10]); /* define X display area through BPP mode register */ calc_dxs = (vidc_regs[VIDC_HDSR]*2)+x_step[vidc_bpp_mode & 3]; @@ -43,7 +43,7 @@ SCREEN_UPDATE( archimds_vidc ) int count; int x,y,xi; UINT8 pen; - static UINT8 *vram = screen->machine().region("vram")->base(); + static UINT8 *vram = screen.machine().region("vram")->base(); count = (0); @@ -66,19 +66,19 @@ SCREEN_UPDATE( archimds_vidc ) { if ((res_x) >= 0 && (res_y) >= 0 && - (res_x) <= screen->visible_area().max_x && (res_y) <= screen->visible_area().max_y && (res_x) <= xend && (res_y) <= yend) - *BITMAP_ADDR32(bitmap, res_y, res_x) = screen->machine().pens[(pen>>(xi))&0x1]; + (res_x) <= screen.visible_area().max_x && (res_y) <= screen.visible_area().max_y && (res_x) <= xend && (res_y) <= yend) + *BITMAP_ADDR32(bitmap, res_y, res_x) = screen.machine().pens[(pen>>(xi))&0x1]; if ((res_x) >= 0 && (res_y) >= 0 && - (res_x) <= screen->visible_area().max_x && (res_y+1) <= screen->visible_area().max_y && (res_x) <= xend && (res_y+1) <= yend) - *BITMAP_ADDR32(bitmap, res_y+1, res_x) = screen->machine().pens[(pen>>(xi))&0x1]; + (res_x) <= screen.visible_area().max_x && (res_y+1) <= screen.visible_area().max_y && (res_x) <= xend && (res_y+1) <= yend) + *BITMAP_ADDR32(bitmap, res_y+1, res_x) = screen.machine().pens[(pen>>(xi))&0x1]; } else { if ((res_x) >= 0 && (res_y) >= 0 && - (res_x) <= screen->visible_area().max_x && (res_y) <= screen->visible_area().max_y && (res_x) <= xend && (res_y) <= yend) - *BITMAP_ADDR32(bitmap, res_y, res_x) = screen->machine().pens[(pen>>(xi))&0x1]; + (res_x) <= screen.visible_area().max_x && (res_y) <= screen.visible_area().max_y && (res_x) <= xend && (res_y) <= yend) + *BITMAP_ADDR32(bitmap, res_y, res_x) = screen.machine().pens[(pen>>(xi))&0x1]; } } @@ -102,19 +102,19 @@ SCREEN_UPDATE( archimds_vidc ) { if ((res_x) >= 0 && (res_y) >= 0 && - (res_x) <= screen->visible_area().max_x && (res_y) <= screen->visible_area().max_y && (res_x) <= xend && (res_y) <= yend) - *BITMAP_ADDR32(bitmap, res_y, res_x) = screen->machine().pens[(pen&0xff)+0x100]; + (res_x) <= screen.visible_area().max_x && (res_y) <= screen.visible_area().max_y && (res_x) <= xend && (res_y) <= yend) + *BITMAP_ADDR32(bitmap, res_y, res_x) = screen.machine().pens[(pen&0xff)+0x100]; if ((res_x) >= 0 && (res_y) >= 0 && - (res_x) <= screen->visible_area().max_x && (res_y+1) <= screen->visible_area().max_y && (res_x) <= xend && (res_y+1) <= yend) - *BITMAP_ADDR32(bitmap, res_y+1, res_x) = screen->machine().pens[(pen&0xff)+0x100]; + (res_x) <= screen.visible_area().max_x && (res_y+1) <= screen.visible_area().max_y && (res_x) <= xend && (res_y+1) <= yend) + *BITMAP_ADDR32(bitmap, res_y+1, res_x) = screen.machine().pens[(pen&0xff)+0x100]; } else { if ((res_x) >= 0 && (res_y) >= 0 && - (res_x) <= screen->visible_area().max_x && (res_y) <= screen->visible_area().max_y && (res_x) <= xend && (res_y) <= yend) - *BITMAP_ADDR32(bitmap, res_y, res_x) = screen->machine().pens[(pen&0xff)+0x100]; + (res_x) <= screen.visible_area().max_x && (res_y) <= screen.visible_area().max_y && (res_x) <= xend && (res_y) <= yend) + *BITMAP_ADDR32(bitmap, res_y, res_x) = screen.machine().pens[(pen&0xff)+0x100]; } count++; diff --git a/src/mame/video/argus.c b/src/mame/video/argus.c index ef9495ca53c..39086e7c073 100644 --- a/src/mame/video/argus.c +++ b/src/mame/video/argus.c @@ -1191,48 +1191,48 @@ static void butasan_log_vram(running_machine &machine) SCREEN_UPDATE( argus ) { - argus_state *state = screen->machine().driver_data(); - bg_setting(screen->machine()); + argus_state *state = screen.machine().driver_data(); + bg_setting(screen.machine()); /* scroll BG0 and render tile at proper position */ - argus_bg0_scroll_handle(screen->machine()); + argus_bg0_scroll_handle(screen.machine()); tilemap_draw(bitmap, cliprect, state->m_bg0_tilemap, 0, 0); - argus_draw_sprites(screen->machine(), bitmap, cliprect, 0); + argus_draw_sprites(screen.machine(), bitmap, cliprect, 0); if (state->m_bg_status & 1) /* Backgound enable */ tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); - argus_draw_sprites(screen->machine(), bitmap, cliprect, 1); + argus_draw_sprites(screen.machine(), bitmap, cliprect, 1); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); return 0; } SCREEN_UPDATE( valtric ) { - argus_state *state = screen->machine().driver_data(); - bg_setting(screen->machine()); + argus_state *state = screen.machine().driver_data(); + bg_setting(screen.machine()); if (state->m_bg_status & 1) /* Backgound enable */ - valtric_draw_mosaic(*screen, bitmap, cliprect); + valtric_draw_mosaic(screen, bitmap, cliprect); else - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); - valtric_draw_sprites(screen->machine(), bitmap, cliprect); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); + valtric_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); return 0; } SCREEN_UPDATE( butasan ) { - argus_state *state = screen->machine().driver_data(); - bg_setting(screen->machine()); + argus_state *state = screen.machine().driver_data(); + bg_setting(screen.machine()); if (state->m_bg_status & 1) /* Backgound enable */ tilemap_draw(bitmap, cliprect, state->m_bg0_tilemap, 0, 0); else - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); if (state->m_butasan_bg1_status & 1) tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); - butasan_draw_sprites(screen->machine(), bitmap, cliprect); + butasan_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); - butasan_log_vram(screen->machine()); + butasan_log_vram(screen.machine()); return 0; } diff --git a/src/mame/video/arkanoid.c b/src/mame/video/arkanoid.c index 3e1a9250fe3..c77c0aeb2ab 100644 --- a/src/mame/video/arkanoid.c +++ b/src/mame/video/arkanoid.c @@ -204,16 +204,16 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( arkanoid ) { - arkanoid_state *state = screen->machine().driver_data(); + arkanoid_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( hexa ) { - arkanoid_state *state = screen->machine().driver_data(); + arkanoid_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; diff --git a/src/mame/video/armedf.c b/src/mame/video/armedf.c index 20882612a12..bccb0aea517 100644 --- a/src/mame/video/armedf.c +++ b/src/mame/video/armedf.c @@ -388,7 +388,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( armedf ) { - armedf_state *state = screen->machine().driver_data(); + armedf_state *state = screen.machine().driver_data(); int sprite_enable = state->m_vreg & 0x200; tilemap_set_enable(state->m_bg_tilemap, state->m_vreg & 0x800); @@ -418,15 +418,15 @@ SCREEN_UPDATE( armedf ) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); if (sprite_enable) - draw_sprites(screen->machine(), bitmap, cliprect, 2); + draw_sprites(screen.machine(), bitmap, cliprect, 2); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); if (sprite_enable) - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); if (sprite_enable) - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, TILEMAP_DRAW_CATEGORY(0), 0); @@ -436,7 +436,7 @@ SCREEN_UPDATE( armedf ) SCREEN_EOF( armedf ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram16_w(space, 0, 0, 0xffff); } diff --git a/src/mame/video/ashnojoe.c b/src/mame/video/ashnojoe.c index 6f9cffb40fe..82721dbd863 100644 --- a/src/mame/video/ashnojoe.c +++ b/src/mame/video/ashnojoe.c @@ -226,11 +226,11 @@ VIDEO_START( ashnojoe ) SCREEN_UPDATE( ashnojoe ) { - ashnojoe_state *state = screen->machine().driver_data(); + ashnojoe_state *state = screen.machine().driver_data(); //state->m_tilemap_reg[0] & 0x10 // ?? on coin insertion - flip_screen_set(screen->machine(), state->m_tilemap_reg[0] & 1); + flip_screen_set(screen.machine(), state->m_tilemap_reg[0] & 1); if(state->m_tilemap_reg[0] & 0x02) tilemap_draw(bitmap, cliprect, state->m_joetilemap7, 0, 0); diff --git a/src/mame/video/asterix.c b/src/mame/video/asterix.c index 3ad87b9f2f0..6517b0181fa 100644 --- a/src/mame/video/asterix.c +++ b/src/mame/video/asterix.c @@ -48,7 +48,7 @@ void asterix_tile_callback( running_machine &machine, int layer, int *code, int SCREEN_UPDATE( asterix ) { - asterix_state *state = screen->machine().driver_data(); + asterix_state *state = screen.machine().driver_data(); static const int K053251_CI[4] = { K053251_CI0, K053251_CI2, K053251_CI3, K053251_CI4 }; int layer[3], plane, new_colorbase; @@ -96,7 +96,7 @@ SCREEN_UPDATE( asterix ) konami_sortlayers3(layer, state->m_layerpri); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, layer[0], K056832_DRAW_FLAG_MIRROR, 1); diff --git a/src/mame/video/astrocde.c b/src/mame/video/astrocde.c index 745adcb00d7..d127c6b658e 100644 --- a/src/mame/video/astrocde.c +++ b/src/mame/video/astrocde.c @@ -246,7 +246,7 @@ static void init_savestate(running_machine &machine) SCREEN_UPDATE( astrocde ) { - astrocde_state *state = screen->machine().driver_data(); + astrocde_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; UINT32 sparklebase = 0; const int colormask = (state->m_video_config & AC_MONITOR_BW) ? 0 : 0x1f0; @@ -254,11 +254,11 @@ SCREEN_UPDATE( astrocde ) int y; /* compute the starting point of sparkle for the current frame */ - int width = screen->width(); - int height = screen->height(); + int width = screen.width(); + int height = screen.height(); if (state->m_video_config & AC_STARS) - sparklebase = (screen->frame_number() * (UINT64)(width * height)) % RNG_PERIOD; + sparklebase = (screen.frame_number() * (UINT64)(width * height)) % RNG_PERIOD; /* iterate over scanlines */ for (y = cliprect->min_y; y <= cliprect->max_y; y++) @@ -332,7 +332,7 @@ SCREEN_UPDATE( astrocde ) SCREEN_UPDATE( profpac ) { - astrocde_state *state = screen->machine().driver_data(); + astrocde_state *state = screen.machine().driver_data(); int y; /* iterate over scanlines */ diff --git a/src/mame/video/asuka.c b/src/mame/video/asuka.c index 22bb1fa1a3a..efd30e26004 100644 --- a/src/mame/video/asuka.c +++ b/src/mame/video/asuka.c @@ -21,7 +21,7 @@ WRITE16_HANDLER( asuka_spritectrl_w ) SCREEN_UPDATE( asuka ) { - asuka_state *state = screen->machine().driver_data(); + asuka_state *state = screen.machine().driver_data(); UINT8 layer[3]; tc0100scn_tilemap_update(state->m_tc0100scn); @@ -30,7 +30,7 @@ SCREEN_UPDATE( asuka ) layer[1] = layer[0] ^ 1; layer[2] = 2; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ bitmap_fill(bitmap, cliprect, 0); @@ -47,7 +47,7 @@ SCREEN_UPDATE( asuka ) SCREEN_UPDATE( bonzeadv ) { - asuka_state *state = screen->machine().driver_data(); + asuka_state *state = screen.machine().driver_data(); UINT8 layer[3]; tc0100scn_tilemap_update(state->m_tc0100scn); @@ -56,7 +56,7 @@ SCREEN_UPDATE( bonzeadv ) layer[1] = layer[0] ^ 1; layer[2] = 2; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ bitmap_fill(bitmap, cliprect, 0); diff --git a/src/mame/video/atari.c b/src/mame/video/atari.c index b255086d103..4e701ee2576 100644 --- a/src/mame/video/atari.c +++ b/src/mame/video/atari.c @@ -774,7 +774,7 @@ SCREEN_UPDATE( atari ) SCREEN_UPDATE_CALL(generic_bitmapped); - new_tv_artifacts = input_port_read_safe(screen->machine(), "artifacts", 0); + new_tv_artifacts = input_port_read_safe(screen.machine(), "artifacts", 0); if( tv_artifacts != new_tv_artifacts ) { tv_artifacts = new_tv_artifacts; diff --git a/src/mame/video/atarifb.c b/src/mame/video/atarifb.c index 821d79dcdae..f50a3d45ea6 100644 --- a/src/mame/video/atarifb.c +++ b/src/mame/video/atarifb.c @@ -182,9 +182,9 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( atarifb ) { - draw_playfield_and_alpha(screen->machine(), bitmap, cliprect, 0, 0); + draw_playfield_and_alpha(screen.machine(), bitmap, cliprect, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 1, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 1, 0); return 0; } @@ -192,9 +192,9 @@ SCREEN_UPDATE( atarifb ) SCREEN_UPDATE( abaseb ) { - draw_playfield_and_alpha(screen->machine(), bitmap, cliprect, -8, 0); + draw_playfield_and_alpha(screen.machine(), bitmap, cliprect, -8, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 1, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 1, 0); return 0; } @@ -202,9 +202,9 @@ SCREEN_UPDATE( abaseb ) SCREEN_UPDATE( soccer ) { - draw_playfield_and_alpha(screen->machine(), bitmap, cliprect, 0, 8); + draw_playfield_and_alpha(screen.machine(), bitmap, cliprect, 0, 8); - draw_sprites(screen->machine(), bitmap, cliprect, 2, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 2, 1); return 0; } diff --git a/src/mame/video/atarig1.c b/src/mame/video/atarig1.c index 234bb19e98f..05a74e53d92 100644 --- a/src/mame/video/atarig1.c +++ b/src/mame/video/atarig1.c @@ -153,7 +153,7 @@ void atarig1_scanline_update(screen_device &screen, int scanline) SCREEN_UPDATE( atarig1 ) { - atarig1_state *state = screen->machine().driver_data(); + atarig1_state *state = screen.machine().driver_data(); /* draw the playfield */ tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 0, 0); @@ -168,7 +168,7 @@ SCREEN_UPDATE( atarig1 ) SCREEN_EOF( atarig1 ) { - atarig1_state *state = machine.driver_data(); + atarig1_state *state = screen.machine().driver_data(); atarirle_eof(state->m_rle); } diff --git a/src/mame/video/atarig42.c b/src/mame/video/atarig42.c index 6d5e9611de1..34971d44be1 100644 --- a/src/mame/video/atarig42.c +++ b/src/mame/video/atarig42.c @@ -182,8 +182,8 @@ void atarig42_scanline_update(screen_device &screen, int scanline) SCREEN_UPDATE( atarig42 ) { - atarig42_state *state = screen->machine().driver_data(); - bitmap_t *priority_bitmap = screen->machine().priority_bitmap; + atarig42_state *state = screen.machine().driver_data(); + bitmap_t *priority_bitmap = screen.machine().priority_bitmap; /* draw the playfield */ bitmap_fill(priority_bitmap, cliprect, 0); @@ -229,7 +229,7 @@ SCREEN_UPDATE( atarig42 ) SCREEN_EOF( atarig42 ) { - atarig42_state *state = machine.driver_data(); + atarig42_state *state = screen.machine().driver_data(); atarirle_eof(state->m_rle); } diff --git a/src/mame/video/atarigt.c b/src/mame/video/atarigt.c index df9a7262680..8010d6ac010 100644 --- a/src/mame/video/atarigt.c +++ b/src/mame/video/atarigt.c @@ -508,7 +508,7 @@ PrimRage GALs: SCREEN_UPDATE( atarigt ) { - atarigt_state *state = screen->machine().driver_data(); + atarigt_state *state = screen.machine().driver_data(); bitmap_t *mo_bitmap = atarirle_get_vram(state->m_rle, 0); bitmap_t *tm_bitmap = atarirle_get_vram(state->m_rle, 1); UINT16 *cram, *tram; @@ -634,7 +634,7 @@ SCREEN_UPDATE( atarigt ) SCREEN_EOF( atarigt ) { - atarigt_state *state = machine.driver_data(); + atarigt_state *state = screen.machine().driver_data(); atarirle_eof(state->m_rle); } diff --git a/src/mame/video/atarigx2.c b/src/mame/video/atarigx2.c index b576119138d..6dc517901b6 100644 --- a/src/mame/video/atarigx2.c +++ b/src/mame/video/atarigx2.c @@ -180,8 +180,8 @@ void atarigx2_scanline_update(screen_device &screen, int scanline) SCREEN_UPDATE( atarigx2 ) { - atarigx2_state *state = screen->machine().driver_data(); - bitmap_t *priority_bitmap = screen->machine().priority_bitmap; + atarigx2_state *state = screen.machine().driver_data(); + bitmap_t *priority_bitmap = screen.machine().priority_bitmap; /* draw the playfield */ bitmap_fill(priority_bitmap, cliprect, 0); @@ -222,7 +222,7 @@ SCREEN_UPDATE( atarigx2 ) SCREEN_EOF( atarigx2 ) { - atarigx2_state *state = machine.driver_data(); + atarigx2_state *state = screen.machine().driver_data(); atarirle_eof(state->m_rle); } diff --git a/src/mame/video/atarisy1.c b/src/mame/video/atarisy1.c index 59b67d1309e..687d3472a7c 100644 --- a/src/mame/video/atarisy1.c +++ b/src/mame/video/atarisy1.c @@ -502,7 +502,7 @@ static void update_timers(running_machine &machine, int scanline) SCREEN_UPDATE( atarisy1 ) { - atarisy1_state *state = screen->machine().driver_data(); + atarisy1_state *state = screen.machine().driver_data(); atarimo_rect_list rectlist; bitmap_t *mobitmap; int x, y, r; diff --git a/src/mame/video/atarisy2.c b/src/mame/video/atarisy2.c index 68df66ec9bf..ed69604d4df 100644 --- a/src/mame/video/atarisy2.c +++ b/src/mame/video/atarisy2.c @@ -320,8 +320,8 @@ WRITE16_HANDLER( atarisy2_videoram_w ) SCREEN_UPDATE( atarisy2 ) { - atarisy2_state *state = screen->machine().driver_data(); - bitmap_t *priority_bitmap = screen->machine().priority_bitmap; + atarisy2_state *state = screen.machine().driver_data(); + bitmap_t *priority_bitmap = screen.machine().priority_bitmap; atarimo_rect_list rectlist; bitmap_t *mobitmap; int x, y, r; diff --git a/src/mame/video/atetris.c b/src/mame/video/atetris.c index 8d2acb4c3f3..1813755ee67 100644 --- a/src/mame/video/atetris.c +++ b/src/mame/video/atetris.c @@ -66,7 +66,7 @@ VIDEO_START( atetris ) SCREEN_UPDATE( atetris ) { - atetris_state *state = screen->machine().driver_data(); + atetris_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0,0); return 0; diff --git a/src/mame/video/badlands.c b/src/mame/video/badlands.c index 732c0af40d0..a16365a8799 100644 --- a/src/mame/video/badlands.c +++ b/src/mame/video/badlands.c @@ -113,7 +113,7 @@ WRITE16_HANDLER( badlands_pf_bank_w ) SCREEN_UPDATE( badlands ) { - badlands_state *state = screen->machine().driver_data(); + badlands_state *state = screen.machine().driver_data(); atarimo_rect_list rectlist; bitmap_t *mobitmap; int x, y, r; diff --git a/src/mame/video/bagman.c b/src/mame/video/bagman.c index 6e68bae15ae..222ab4c9d63 100644 --- a/src/mame/video/bagman.c +++ b/src/mame/video/bagman.c @@ -148,12 +148,12 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( bagman ) { - bagman_state *state = screen->machine().driver_data(); + bagman_state *state = screen.machine().driver_data(); bitmap_fill(bitmap,cliprect,0); if (*state->m_video_enable == 0) return 0; tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/balsente.c b/src/mame/video/balsente.c index 7dd8e418151..bc55f074d08 100644 --- a/src/mame/video/balsente.c +++ b/src/mame/video/balsente.c @@ -212,8 +212,8 @@ static void draw_one_sprite(running_machine &machine, bitmap_t *bitmap, const re SCREEN_UPDATE( balsente ) { - balsente_state *state = screen->machine().driver_data(); - const pen_t *pens = &screen->machine().pens[state->m_palettebank_vis * 256]; + balsente_state *state = screen.machine().driver_data(); + const pen_t *pens = &screen.machine().pens[state->m_palettebank_vis * 256]; int y, i; /* draw scanlines from the VRAM directly */ @@ -222,7 +222,7 @@ SCREEN_UPDATE( balsente ) /* draw the sprite images */ for (i = 0; i < 40; i++) - draw_one_sprite(screen->machine(), bitmap, cliprect, &state->m_spriteram[(0xe0 + i * 4) & 0xff]); + draw_one_sprite(screen.machine(), bitmap, cliprect, &state->m_spriteram[(0xe0 + i * 4) & 0xff]); return 0; } diff --git a/src/mame/video/bankp.c b/src/mame/video/bankp.c index d30db7515cd..926441298db 100644 --- a/src/mame/video/bankp.c +++ b/src/mame/video/bankp.c @@ -175,9 +175,9 @@ VIDEO_START( bankp ) SCREEN_UPDATE( bankp ) { - bankp_state *state = screen->machine().driver_data(); + bankp_state *state = screen.machine().driver_data(); - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { tilemap_set_scrollx(state->m_fg_tilemap, 0, -state->m_scroll_x); tilemap_set_scrollx(state->m_bg_tilemap, 0, 0); diff --git a/src/mame/video/baraduke.c b/src/mame/video/baraduke.c index 0ad0a7d84ef..d8114c6470b 100644 --- a/src/mame/video/baraduke.c +++ b/src/mame/video/baraduke.c @@ -314,16 +314,16 @@ static void set_scroll(running_machine &machine, int layer) SCREEN_UPDATE( baraduke ) { - baraduke_state *state = screen->machine().driver_data(); + baraduke_state *state = screen.machine().driver_data(); UINT8 *spriteram = state->m_spriteram + 0x1800; int back; /* flip screen is embedded in the sprite control registers */ - /* can't use flip_screen_set(screen->machine(), ) because the visible area is asymmetrical */ - flip_screen_set_no_update(screen->machine(), spriteram[0x07f6] & 0x01); - tilemap_set_flip_all(screen->machine(),flip_screen_get(screen->machine()) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); - set_scroll(screen->machine(), 0); - set_scroll(screen->machine(), 1); + /* can't use flip_screen_set(screen.machine(), ) because the visible area is asymmetrical */ + flip_screen_set_no_update(screen.machine(), spriteram[0x07f6] & 0x01); + tilemap_set_flip_all(screen.machine(),flip_screen_get(screen.machine()) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); + set_scroll(screen.machine(), 0); + set_scroll(screen.machine(), 1); if (((state->m_xscroll[0] & 0x0e00) >> 9) == 6) back = 1; @@ -331,9 +331,9 @@ SCREEN_UPDATE( baraduke ) back = 0; tilemap_draw(bitmap,cliprect,state->m_bg_tilemap[back],TILEMAP_DRAW_OPAQUE,0); - draw_sprites(screen->machine(), bitmap,cliprect,0); + draw_sprites(screen.machine(), bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap[back ^ 1],0,0); - draw_sprites(screen->machine(), bitmap,cliprect,1); + draw_sprites(screen.machine(), bitmap,cliprect,1); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); return 0; @@ -342,7 +342,7 @@ SCREEN_UPDATE( baraduke ) SCREEN_EOF( baraduke ) { - baraduke_state *state = machine.driver_data(); + baraduke_state *state = screen.machine().driver_data(); if (state->m_copy_sprites) { UINT8 *spriteram = state->m_spriteram + 0x1800; diff --git a/src/mame/video/batman.c b/src/mame/video/batman.c index cda4284be47..d7a5e702d28 100644 --- a/src/mame/video/batman.c +++ b/src/mame/video/batman.c @@ -196,8 +196,8 @@ void batman_scanline_update(screen_device &screen, int scanline) SCREEN_UPDATE( batman ) { - batman_state *state = screen->machine().driver_data(); - bitmap_t *priority_bitmap = screen->machine().priority_bitmap; + batman_state *state = screen.machine().driver_data(); + bitmap_t *priority_bitmap = screen.machine().priority_bitmap; atarimo_rect_list rectlist; bitmap_t *mobitmap; int x, y, r; diff --git a/src/mame/video/battlane.c b/src/mame/video/battlane.c index f929f4898c0..0a88ae337d8 100644 --- a/src/mame/video/battlane.c +++ b/src/mame/video/battlane.c @@ -236,12 +236,12 @@ static void draw_fg_bitmap( running_machine &machine, bitmap_t *bitmap ) SCREEN_UPDATE( battlane ) { - battlane_state *state = screen->machine().driver_data(); + battlane_state *state = screen.machine().driver_data(); tilemap_mark_all_tiles_dirty(state->m_bg_tilemap); // HACK tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); - draw_fg_bitmap(screen->machine(), bitmap); + draw_sprites(screen.machine(), bitmap, cliprect); + draw_fg_bitmap(screen.machine(), bitmap); return 0; } diff --git a/src/mame/video/battlera.c b/src/mame/video/battlera.c index 5fee862f5b3..add85aa0b3b 100644 --- a/src/mame/video/battlera.c +++ b/src/mame/video/battlera.c @@ -308,13 +308,13 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( battlera ) { - battlera_state *state = screen->machine().driver_data(); + battlera_state *state = screen.machine().driver_data(); int offs,code,scrollx,scrolly,mx,my; /* if any tiles changed, redraw the VRAM */ - if (screen->machine().gfx[0]->dirtyseq != state->m_tile_dirtyseq) + if (screen.machine().gfx[0]->dirtyseq != state->m_tile_dirtyseq) { - state->m_tile_dirtyseq = screen->machine().gfx[0]->dirtyseq; + state->m_tile_dirtyseq = screen.machine().gfx[0]->dirtyseq; memset(state->m_vram_dirty, 1, 0x1000); } @@ -329,17 +329,17 @@ SCREEN_UPDATE( battlera ) /* If this tile was changed OR tilemap was changed, redraw */ if (state->m_vram_dirty[offs/2]) { state->m_vram_dirty[offs/2]=0; - drawgfx_opaque(state->m_tile_bitmap,0,screen->machine().gfx[0], + drawgfx_opaque(state->m_tile_bitmap,0,screen.machine().gfx[0], code, state->m_HuC6270_vram[offs] >> 4, 0,0, 8*mx,8*my); - drawgfx_opaque(state->m_front_bitmap,0,screen->machine().gfx[2], + drawgfx_opaque(state->m_front_bitmap,0,screen.machine().gfx[2], 0, 0, /* fill the spot with pen 256 */ 0,0, 8*mx,8*my); - drawgfx_transmask(state->m_front_bitmap,0,screen->machine().gfx[0], + drawgfx_transmask(state->m_front_bitmap,0,screen.machine().gfx[0], code, state->m_HuC6270_vram[offs] >> 4, 0,0, @@ -356,13 +356,13 @@ SCREEN_UPDATE( battlera ) /* Todo: Background enable (not used anyway) */ /* Render low priority sprites, if enabled */ - if (state->m_sb_enable) draw_sprites(screen->machine(),bitmap,cliprect,0); + if (state->m_sb_enable) draw_sprites(screen.machine(),bitmap,cliprect,0); /* Render background over sprites */ copyscrollbitmap_trans(bitmap,state->m_front_bitmap,1,&scrollx,1,&scrolly,cliprect,256); /* Render high priority sprites, if enabled */ - if (state->m_sb_enable) draw_sprites(screen->machine(),bitmap,cliprect,1); + if (state->m_sb_enable) draw_sprites(screen.machine(),bitmap,cliprect,1); return 0; } diff --git a/src/mame/video/battlex.c b/src/mame/video/battlex.c index f118de498e1..07bcaa3365f 100644 --- a/src/mame/video/battlex.c +++ b/src/mame/video/battlex.c @@ -97,11 +97,11 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE(battlex) { - battlex_state *state = screen->machine().driver_data(); + battlex_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_scroll_lsb | (state->m_scroll_msb << 8)); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/battlnts.c b/src/mame/video/battlnts.c index 43d57f21b8d..a934b28e057 100644 --- a/src/mame/video/battlnts.c +++ b/src/mame/video/battlnts.c @@ -45,12 +45,12 @@ WRITE8_HANDLER( battlnts_spritebank_w ) SCREEN_UPDATE( battlnts ) { - battlnts_state *state = screen->machine().driver_data(); + battlnts_state *state = screen.machine().driver_data(); k007342_tilemap_update(state->m_k007342); k007342_tilemap_draw(state->m_k007342, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE ,0); - k007420_sprites_draw(state->m_k007420, bitmap, cliprect, screen->machine().gfx[1]); + k007420_sprites_draw(state->m_k007420, bitmap, cliprect, screen.machine().gfx[1]); k007342_tilemap_draw(state->m_k007342, bitmap, cliprect, 0, 1 | TILEMAP_DRAW_OPAQUE ,0); return 0; } diff --git a/src/mame/video/bbusters.c b/src/mame/video/bbusters.c index 9206c13b5f9..3078bc336a4 100644 --- a/src/mame/video/bbusters.c +++ b/src/mame/video/bbusters.c @@ -281,7 +281,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const UINT1 SCREEN_UPDATE( bbuster ) { - bbusters_state *state = screen->machine().driver_data(); + bbusters_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_pf1_tilemap, 0, state->m_pf1_scroll_data[0]); tilemap_set_scrolly(state->m_pf1_tilemap, 0, state->m_pf1_scroll_data[1]); @@ -289,17 +289,17 @@ SCREEN_UPDATE( bbuster ) tilemap_set_scrolly(state->m_pf2_tilemap, 0, state->m_pf2_scroll_data[1]); tilemap_draw(bitmap, cliprect, state->m_pf2_tilemap, 0, 0); - //draw_sprites(screen->machine(), bitmap, screen->machine().generic.buffered_spriteram2.u16, 2, 0x8, 0x8); + //draw_sprites(screen.machine(), bitmap, screen.machine().generic.buffered_spriteram2.u16, 2, 0x8, 0x8); tilemap_draw(bitmap, cliprect, state->m_pf1_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, screen->machine().generic.buffered_spriteram2.u16, 2, 0, 0); - draw_sprites(screen->machine(), bitmap, screen->machine().generic.buffered_spriteram.u16, 1, 0, 0); + draw_sprites(screen.machine(), bitmap, screen.machine().generic.buffered_spriteram2.u16, 2, 0, 0); + draw_sprites(screen.machine(), bitmap, screen.machine().generic.buffered_spriteram.u16, 1, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fix_tilemap, 0, 0); return 0; } SCREEN_UPDATE( mechatt ) { - bbusters_state *state = screen->machine().driver_data(); + bbusters_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_pf1_tilemap, 0, state->m_pf1_scroll_data[0]); tilemap_set_scrolly(state->m_pf1_tilemap, 0, state->m_pf1_scroll_data[1]); @@ -308,7 +308,7 @@ SCREEN_UPDATE( mechatt ) tilemap_draw(bitmap, cliprect, state->m_pf2_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_pf1_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, screen->machine().generic.buffered_spriteram.u16, 1, 0, 0); + draw_sprites(screen.machine(), bitmap, screen.machine().generic.buffered_spriteram.u16, 1, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fix_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/beezer.c b/src/mame/video/beezer.c index b30fcf3ffc0..ecf3b6459fd 100644 --- a/src/mame/video/beezer.c +++ b/src/mame/video/beezer.c @@ -21,7 +21,7 @@ TIMER_DEVICE_CALLBACK( beezer_interrupt ) SCREEN_UPDATE( beezer ) { - beezer_state *state = screen->machine().driver_data(); + beezer_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; int x,y; diff --git a/src/mame/video/bigevglf.c b/src/mame/video/bigevglf.c index b1e6cf338a6..93475715d34 100644 --- a/src/mame/video/bigevglf.c +++ b/src/mame/video/bigevglf.c @@ -93,9 +93,9 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( bigevglf ) { - bigevglf_state *state = screen->machine().driver_data(); + bigevglf_state *state = screen.machine().driver_data(); copybitmap(bitmap, state->m_tmp_bitmap[state->m_plane_visible], 0, 0, 0, 0, cliprect); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/bigstrkb.c b/src/mame/video/bigstrkb.c index 212c2ed88cc..29c83fdef7d 100644 --- a/src/mame/video/bigstrkb.c +++ b/src/mame/video/bigstrkb.c @@ -130,9 +130,9 @@ VIDEO_START(bigstrkb) SCREEN_UPDATE(bigstrkb) { - bigstrkb_state *state = screen->machine().driver_data(); + bigstrkb_state *state = screen.machine().driver_data(); -// bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); +// bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); tilemap_set_scrollx(state->m_tilemap2,0, state->m_vidreg1[0]+(256-14)); tilemap_set_scrolly(state->m_tilemap2,0, state->m_vidreg2[0]); @@ -143,7 +143,7 @@ SCREEN_UPDATE(bigstrkb) tilemap_draw(bitmap,cliprect,state->m_tilemap2,0,0); tilemap_draw(bitmap,cliprect,state->m_tilemap3,0,0); - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_tilemap,0,0); // popmessage ("Regs %08x %08x %08x %08x",bsb_vidreg2[0],bsb_vidreg2[1],bsb_vidreg2[2],bsb_vidreg2[3]); diff --git a/src/mame/video/bionicc.c b/src/mame/video/bionicc.c index 78725bd16a5..58ee3a472a8 100644 --- a/src/mame/video/bionicc.c +++ b/src/mame/video/bionicc.c @@ -248,13 +248,13 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( bionicc ) { - bionicc_state *state = screen->machine().driver_data(); + bionicc_state *state = screen.machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 1 | TILEMAP_DRAW_LAYER1, 0); /* nothing in FRONT */ tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0 | TILEMAP_DRAW_LAYER1, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0 | TILEMAP_DRAW_LAYER0, 0); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); return 0; @@ -262,7 +262,7 @@ SCREEN_UPDATE( bionicc ) SCREEN_EOF( bionicc ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram16_w(space, 0, 0, 0xffff); } diff --git a/src/mame/video/bishi.c b/src/mame/video/bishi.c index 1b25045ffca..9f0a3fec500 100644 --- a/src/mame/video/bishi.c +++ b/src/mame/video/bishi.c @@ -46,7 +46,7 @@ VIDEO_START( bishi ) SCREEN_UPDATE(bishi) { - bishi_state *state = screen->machine().driver_data(); + bishi_state *state = screen.machine().driver_data(); int layers[4], layerpri[4], i;/*, old;*/ /* int bg_colorbase, new_colorbase, plane, dirty; */ static const int pris[4] = { K55_PRIINP_0, K55_PRIINP_3, K55_PRIINP_6, K55_PRIINP_7 }; @@ -63,7 +63,7 @@ SCREEN_UPDATE(bishi) konami_sortlayers4(layers, layerpri); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); for (i = 0; i < 4; i++) { diff --git a/src/mame/video/bking.c b/src/mame/video/bking.c index 78468537411..16766ecc807 100644 --- a/src/mame/video/bking.c +++ b/src/mame/video/bking.c @@ -251,25 +251,25 @@ VIDEO_START( bking ) SCREEN_UPDATE( bking ) { - bking_state *state = screen->machine().driver_data(); + bking_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); /* draw the balls */ - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[2], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[2], state->m_ball1_pic, state->m_palette_bank, 0, 0, state->m_xld1, state->m_yld1, 0); - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[3], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[3], state->m_ball2_pic, state->m_palette_bank, 0, 0, state->m_xld2, state->m_yld2, 0); /* draw the crow */ - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], state->m_crow_pic, state->m_palette_bank, state->m_crow_flip, state->m_crow_flip, @@ -280,7 +280,7 @@ SCREEN_UPDATE( bking ) SCREEN_EOF( bking ) { - bking_state *state = machine.driver_data(); + bking_state *state = screen.machine().driver_data(); static const rectangle rect = { 0, 7, 0, 15 }; int xld = 0; @@ -293,7 +293,7 @@ SCREEN_EOF( bking ) xld = state->m_xld1; yld = state->m_yld1; - drawgfx_opaque(state->m_tmp_bitmap2, &rect, machine.gfx[2], + drawgfx_opaque(state->m_tmp_bitmap2, &rect, screen.machine().gfx[2], state->m_ball1_pic, 0, 0, 0, @@ -307,7 +307,7 @@ SCREEN_EOF( bking ) xld = state->m_xld2; yld = state->m_yld2; - drawgfx_opaque(state->m_tmp_bitmap2, &rect, machine.gfx[3], + drawgfx_opaque(state->m_tmp_bitmap2, &rect, screen.machine().gfx[3], state->m_ball2_pic, 0, 0, 0, @@ -316,8 +316,8 @@ SCREEN_EOF( bking ) latch = 0x0400; } - tilemap_set_scrollx(state->m_bg_tilemap, 0, flip_screen_get(machine) ? -xld : xld); - tilemap_set_scrolly(state->m_bg_tilemap, 0, flip_screen_get(machine) ? -yld : yld); + tilemap_set_scrollx(state->m_bg_tilemap, 0, flip_screen_get(screen.machine()) ? -xld : xld); + tilemap_set_scrolly(state->m_bg_tilemap, 0, flip_screen_get(screen.machine()) ? -yld : yld); tilemap_draw(state->m_tmp_bitmap1, &rect, state->m_bg_tilemap, 0, 0); @@ -326,7 +326,7 @@ SCREEN_EOF( bking ) if (latch != 0) { - const UINT8* MASK = machine.region("user1")->base() + 8 * state->m_hit; + const UINT8* MASK = screen.machine().region("user1")->base() + 8 * state->m_hit; int x; int y; @@ -343,8 +343,8 @@ SCREEN_EOF( bking ) int col = (xld + x) / 8 + 1; int row = (yld + y) / 8 + 0; - latch |= (flip_screen_get(machine) ? 31 - col : col) << 0; - latch |= (flip_screen_get(machine) ? 31 - row : row) << 5; + latch |= (flip_screen_get(screen.machine()) ? 31 - col : col) << 0; + latch |= (flip_screen_get(screen.machine()) ? 31 - row : row) << 5; state->m_pc3259_output[0] = (latch >> 0x0) & 0xf; state->m_pc3259_output[1] = (latch >> 0x4) & 0xf; diff --git a/src/mame/video/bladestl.c b/src/mame/video/bladestl.c index 0eb7558b861..b77206e271f 100644 --- a/src/mame/video/bladestl.c +++ b/src/mame/video/bladestl.c @@ -78,13 +78,13 @@ void bladestl_sprite_callback( running_machine &machine, int *code,int *color ) SCREEN_UPDATE( bladestl ) { - bladestl_state *state = screen->machine().driver_data(); - set_pens(screen->machine()); + bladestl_state *state = screen.machine().driver_data(); + set_pens(screen.machine()); k007342_tilemap_update(state->m_k007342); k007342_tilemap_draw(state->m_k007342, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE ,0); - k007420_sprites_draw(state->m_k007420, bitmap, cliprect, screen->machine().gfx[1]); + k007420_sprites_draw(state->m_k007420, bitmap, cliprect, screen.machine().gfx[1]); k007342_tilemap_draw(state->m_k007342, bitmap, cliprect, 1, 1 | TILEMAP_DRAW_OPAQUE ,0); k007342_tilemap_draw(state->m_k007342, bitmap, cliprect, 0, 0 ,0); k007342_tilemap_draw(state->m_k007342, bitmap, cliprect, 0, 1 ,0); diff --git a/src/mame/video/blktiger.c b/src/mame/video/blktiger.c index e318c0deac5..8a3384c9183 100644 --- a/src/mame/video/blktiger.c +++ b/src/mame/video/blktiger.c @@ -232,7 +232,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( blktiger ) { - blktiger_state *state = screen->machine().driver_data(); + blktiger_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, 1023); @@ -240,7 +240,7 @@ SCREEN_UPDATE( blktiger ) tilemap_draw(bitmap, cliprect, state->m_screen_layout ? state->m_bg_tilemap8x4 : state->m_bg_tilemap4x8, TILEMAP_DRAW_LAYER1, 0); if (state->m_objon) - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); if (state->m_bgon) tilemap_draw(bitmap, cliprect, state->m_screen_layout ? state->m_bg_tilemap8x4 : state->m_bg_tilemap4x8, TILEMAP_DRAW_LAYER0, 0); @@ -253,7 +253,7 @@ SCREEN_UPDATE( blktiger ) SCREEN_EOF( blktiger ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram_w(space, 0, 0); } diff --git a/src/mame/video/blmbycar.c b/src/mame/video/blmbycar.c index a9aa5817430..b119f7bb9bf 100644 --- a/src/mame/video/blmbycar.c +++ b/src/mame/video/blmbycar.c @@ -221,7 +221,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( blmbycar ) { - blmbycar_state *state = screen->machine().driver_data(); + blmbycar_state *state = screen.machine().driver_data(); int i, layers_ctrl = -1; tilemap_set_scrolly(state->m_tilemap_0, 0, state->m_scroll_0[0]); @@ -231,19 +231,19 @@ SCREEN_UPDATE( blmbycar ) tilemap_set_scrollx(state->m_tilemap_1, 0, state->m_scroll_1[1] + 5); #ifdef MAME_DEBUG -if (screen->machine().input().code_pressed(KEYCODE_Z)) +if (screen.machine().input().code_pressed(KEYCODE_Z)) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= 2; -// if (screen->machine().input().code_pressed(KEYCODE_E)) msk |= 4; - if (screen->machine().input().code_pressed(KEYCODE_A)) msk |= 8; + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 2; +// if (screen.machine().input().code_pressed(KEYCODE_E)) msk |= 4; + if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= 8; if (msk != 0) layers_ctrl &= msk; } #endif - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); if (layers_ctrl & 1) for (i = 0; i <= 1; i++) @@ -256,7 +256,7 @@ if (screen->machine().input().code_pressed(KEYCODE_Z)) tilemap_draw(bitmap, cliprect, state->m_tilemap_1, i, i); if (layers_ctrl & 8) - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/blockade.c b/src/mame/video/blockade.c index c59ac8bc884..3cfd6d73558 100644 --- a/src/mame/video/blockade.c +++ b/src/mame/video/blockade.c @@ -30,7 +30,7 @@ VIDEO_START( blockade ) SCREEN_UPDATE( blockade ) { - blockade_state *state = screen->machine().driver_data(); + blockade_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; diff --git a/src/mame/video/blockhl.c b/src/mame/video/blockhl.c index b88f3c995c2..883b296d06b 100644 --- a/src/mame/video/blockhl.c +++ b/src/mame/video/blockhl.c @@ -57,9 +57,9 @@ VIDEO_START( blockhl ) SCREEN_UPDATE( blockhl ) { - blockhl_state *state = screen->machine().driver_data(); + blockhl_state *state = screen.machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); k052109_tilemap_update(state->m_k052109); diff --git a/src/mame/video/blockout.c b/src/mame/video/blockout.c index 3b580738005..1f33796b6fc 100644 --- a/src/mame/video/blockout.c +++ b/src/mame/video/blockout.c @@ -112,7 +112,7 @@ WRITE16_HANDLER( blockout_videoram_w ) SCREEN_UPDATE( blockout ) { - blockout_state *state = screen->machine().driver_data(); + blockout_state *state = screen.machine().driver_data(); int x, y; pen_t color = 512; diff --git a/src/mame/video/bloodbro.c b/src/mame/video/bloodbro.c index df66bf55111..d584112e865 100644 --- a/src/mame/video/bloodbro.c +++ b/src/mame/video/bloodbro.c @@ -234,34 +234,34 @@ static void weststry_draw_sprites(running_machine &machine, bitmap_t *bitmap, co SCREEN_UPDATE( bloodbro ) { - bloodbro_state *state = screen->machine().driver_data(); + bloodbro_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap,0,state->m_scroll[0x10]); /* ? */ tilemap_set_scrolly(state->m_bg_tilemap,0,state->m_scroll[0x11]); /* ? */ tilemap_set_scrollx(state->m_fg_tilemap,0,state->m_scroll[0x12]); tilemap_set_scrolly(state->m_fg_tilemap,0,state->m_scroll[0x13]); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,1); - bloodbro_draw_sprites(screen->machine(),bitmap,cliprect); + bloodbro_draw_sprites(screen.machine(),bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); return 0; } SCREEN_UPDATE( weststry ) { - bloodbro_state *state = screen->machine().driver_data(); + bloodbro_state *state = screen.machine().driver_data(); // tilemap_set_scrollx(state->m_bg_tilemap,0,state->m_scroll[0x10]); /* ? */ // tilemap_set_scrolly(state->m_bg_tilemap,0,state->m_scroll[0x11]); /* ? */ // tilemap_set_scrollx(state->m_fg_tilemap,0,state->m_scroll[0x12]); // tilemap_set_scrolly(state->m_fg_tilemap,0,state->m_scroll[0x13]); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,1); - weststry_draw_sprites(screen->machine(),bitmap,cliprect); + weststry_draw_sprites(screen.machine(),bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); return 0; } @@ -269,17 +269,17 @@ SCREEN_UPDATE( weststry ) SCREEN_UPDATE( skysmash ) { - bloodbro_state *state = screen->machine().driver_data(); + bloodbro_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap,0,state->m_scroll[0x08]); tilemap_set_scrolly(state->m_bg_tilemap,0,state->m_scroll[0x09]); /* ? */ tilemap_set_scrollx(state->m_fg_tilemap,0,state->m_scroll[0x0a]); tilemap_set_scrolly(state->m_fg_tilemap,0,state->m_scroll[0x0b]); /* ? */ - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,1); - bloodbro_draw_sprites(screen->machine(),bitmap,cliprect); + bloodbro_draw_sprites(screen.machine(),bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); return 0; } diff --git a/src/mame/video/blstroid.c b/src/mame/video/blstroid.c index c5726aad563..a7eb3cbf5ff 100644 --- a/src/mame/video/blstroid.c +++ b/src/mame/video/blstroid.c @@ -146,7 +146,7 @@ void blstroid_scanline_update(screen_device &screen, int scanline) SCREEN_UPDATE( blstroid ) { - blstroid_state *state = screen->machine().driver_data(); + blstroid_state *state = screen.machine().driver_data(); atarimo_rect_list rectlist; bitmap_t *mobitmap; int x, y, r; diff --git a/src/mame/video/blueprnt.c b/src/mame/video/blueprnt.c index 3c8b77d8c2c..361a715255c 100644 --- a/src/mame/video/blueprnt.c +++ b/src/mame/video/blueprnt.c @@ -126,19 +126,19 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( blueprnt ) { - blueprnt_state *state = screen->machine().driver_data(); + blueprnt_state *state = screen.machine().driver_data(); int i; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) for (i = 0; i < 32; i++) tilemap_set_scrolly(state->m_bg_tilemap, i, state->m_scrollram[32 - i]); else for (i = 0; i < 32; i++) tilemap_set_scrolly(state->m_bg_tilemap, i, state->m_scrollram[30 - i]); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 1, 0); return 0; } diff --git a/src/mame/video/bogeyman.c b/src/mame/video/bogeyman.c index 3653cc7d88d..87d3e798064 100644 --- a/src/mame/video/bogeyman.c +++ b/src/mame/video/bogeyman.c @@ -153,10 +153,10 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( bogeyman ) { - bogeyman_state *state = screen->machine().driver_data(); + bogeyman_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/bombjack.c b/src/mame/video/bombjack.c index 7916d209f6b..82e1dedc607 100644 --- a/src/mame/video/bombjack.c +++ b/src/mame/video/bombjack.c @@ -135,9 +135,9 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( bombjack ) { - bombjack_state *state = screen->machine().driver_data(); + bombjack_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/boogwing.c b/src/mame/video/boogwing.c index 48974adda3b..c3d534818c9 100644 --- a/src/mame/video/boogwing.c +++ b/src/mame/video/boogwing.c @@ -140,18 +140,18 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( boogwing ) { - boogwing_state *state = screen->machine().driver_data(); + boogwing_state *state = screen.machine().driver_data(); UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); UINT16 priority = decocomn_priority_r(state->m_decocomn, 0, 0xffff); - flip_screen_set(screen->machine(), BIT(flip, 7)); + flip_screen_set(screen.machine(), BIT(flip, 7)); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); /* Draw playfields */ decocomn_clear_sprite_priority_bitmap(state->m_decocomn); - bitmap_fill(bitmap, cliprect, screen->machine().pens[0x400]); /* pen not confirmed */ - bitmap_fill(screen->machine().priority_bitmap, NULL, 0); + bitmap_fill(bitmap, cliprect, screen.machine().pens[0x400]); /* pen not confirmed */ + bitmap_fill(screen.machine().priority_bitmap, NULL, 0); // bit&0x8 is definitely some kind of palette effect // bit&0x4 combines playfields @@ -182,8 +182,8 @@ SCREEN_UPDATE( boogwing ) deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 32); } - draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 3); - draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram2.u16, 4); + draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u16, 3); + draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram2.u16, 4); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/video/bosco.c b/src/mame/video/bosco.c index 14c1bcb74c3..6875c7d374c 100644 --- a/src/mame/video/bosco.c +++ b/src/mame/video/bosco.c @@ -282,13 +282,13 @@ static void draw_stars(running_machine &machine, bitmap_t *bitmap, const rectang SCREEN_UPDATE( bosco ) { - bosco_state *state = screen->machine().driver_data(); + bosco_state *state = screen.machine().driver_data(); /* the radar tilemap is just 8x32. We rely on the tilemap code to repeat it across the screen, and clip it to only the position where it is supposed to be shown */ rectangle fg_clip = *cliprect; rectangle bg_clip = *cliprect; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { bg_clip.min_x = 20*8; fg_clip.max_x = 20*8-1; @@ -299,19 +299,19 @@ SCREEN_UPDATE( bosco ) fg_clip.min_x = 28*8; } - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); - draw_stars(screen->machine(),bitmap,cliprect,flip_screen_get(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); + draw_stars(screen.machine(),bitmap,cliprect,flip_screen_get(screen.machine())); tilemap_draw(bitmap,&bg_clip,state->m_bg_tilemap,0,0); tilemap_draw(bitmap,&fg_clip,state->m_fg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); /* draw the high priority characters */ tilemap_draw(bitmap,&bg_clip,state->m_bg_tilemap,1,0); tilemap_draw(bitmap,&fg_clip,state->m_fg_tilemap,1,0); - draw_bullets(screen->machine(), bitmap,cliprect); + draw_bullets(screen.machine(), bitmap,cliprect); return 0; } @@ -319,7 +319,7 @@ SCREEN_UPDATE( bosco ) SCREEN_EOF( bosco ) { - bosco_state *state = machine.driver_data(); + bosco_state *state = screen.machine().driver_data(); static const int speedsx[8] = { -1, -2, -3, 0, 3, 2, 1, 0 }; static const int speedsy[8] = { 0, -1, -2, -3, 0, 3, 2, 1 }; diff --git a/src/mame/video/bottom9.c b/src/mame/video/bottom9.c index 96ee5bc84a2..a9ab1f7f941 100644 --- a/src/mame/video/bottom9.c +++ b/src/mame/video/bottom9.c @@ -75,7 +75,7 @@ VIDEO_START( bottom9 ) SCREEN_UPDATE( bottom9 ) { - bottom9_state *state = screen->machine().driver_data(); + bottom9_state *state = screen.machine().driver_data(); k052109_tilemap_update(state->m_k052109); diff --git a/src/mame/video/brkthru.c b/src/mame/video/brkthru.c index db0954d4190..f6c291acb54 100644 --- a/src/mame/video/brkthru.c +++ b/src/mame/video/brkthru.c @@ -252,19 +252,19 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( brkthru ) { - brkthru_state *state = screen->machine().driver_data(); + brkthru_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_bgscroll); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_OPAQUE, 0); /* low priority sprites */ - draw_sprites(screen->machine(), bitmap, cliprect, 0x01); + draw_sprites(screen.machine(), bitmap, cliprect, 0x01); /* draw background over low priority sprites */ tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); /* high priority sprites */ - draw_sprites(screen->machine(), bitmap, cliprect, 0x09); + draw_sprites(screen.machine(), bitmap, cliprect, 0x09); /* fg layer */ tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); diff --git a/src/mame/video/bsktball.c b/src/mame/video/bsktball.c index 1c302e4d0a3..205cb12b87f 100644 --- a/src/mame/video/bsktball.c +++ b/src/mame/video/bsktball.c @@ -55,9 +55,9 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rec SCREEN_UPDATE( bsktball ) { - bsktball_state *state = screen->machine().driver_data(); + bsktball_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/btime.c b/src/mame/video/btime.c index eab2c240005..8993fca8ebf 100644 --- a/src/mame/video/btime.c +++ b/src/mame/video/btime.c @@ -424,13 +424,13 @@ static void draw_background( running_machine &machine, bitmap_t *bitmap, const r SCREEN_UPDATE( btime ) { - btime_state *state = screen->machine().driver_data(); + btime_state *state = screen.machine().driver_data(); if (state->m_bnj_scroll1 & 0x10) { int i, start; // Generate tile map - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) start = 0; else start = 1; @@ -441,13 +441,13 @@ SCREEN_UPDATE( btime ) start = (start + 1) & 0x03; } - draw_background(screen->machine(), bitmap, cliprect, state->m_btime_tilemap, 0); - draw_chars(screen->machine(), bitmap, cliprect, TRUE, 0, -1); + draw_background(screen.machine(), bitmap, cliprect, state->m_btime_tilemap, 0); + draw_chars(screen.machine(), bitmap, cliprect, TRUE, 0, -1); } else - draw_chars(screen->machine(), bitmap, cliprect, FALSE, 0, -1); + draw_chars(screen.machine(), bitmap, cliprect, FALSE, 0, -1); - draw_sprites(screen->machine(), bitmap, cliprect, 0, 1, 0, state->m_videoram, 0x20); + draw_sprites(screen.machine(), bitmap, cliprect, 0, 1, 0, state->m_videoram, 0x20); return 0; } @@ -455,9 +455,9 @@ SCREEN_UPDATE( btime ) SCREEN_UPDATE( eggs ) { - btime_state *state = screen->machine().driver_data(); - draw_chars(screen->machine(), bitmap, cliprect, FALSE, 0, -1); - draw_sprites(screen->machine(), bitmap, cliprect, 0, 0, 0, state->m_videoram, 0x20); + btime_state *state = screen.machine().driver_data(); + draw_chars(screen.machine(), bitmap, cliprect, FALSE, 0, -1); + draw_sprites(screen.machine(), bitmap, cliprect, 0, 0, 0, state->m_videoram, 0x20); return 0; } @@ -465,9 +465,9 @@ SCREEN_UPDATE( eggs ) SCREEN_UPDATE( lnc ) { - btime_state *state = screen->machine().driver_data(); - draw_chars(screen->machine(), bitmap, cliprect, FALSE, 0, -1); - draw_sprites(screen->machine(), bitmap, cliprect, 0, 1, 2, state->m_videoram, 0x20); + btime_state *state = screen.machine().driver_data(); + draw_chars(screen.machine(), bitmap, cliprect, FALSE, 0, -1); + draw_sprites(screen.machine(), bitmap, cliprect, 0, 1, 2, state->m_videoram, 0x20); return 0; } @@ -475,18 +475,18 @@ SCREEN_UPDATE( lnc ) SCREEN_UPDATE( zoar ) { - btime_state *state = screen->machine().driver_data(); + btime_state *state = screen.machine().driver_data(); if (state->m_bnj_scroll1 & 0x04) { - draw_background(screen->machine(), bitmap, cliprect, state->m_zoar_scrollram, state->m_btime_palette); - draw_chars(screen->machine(), bitmap, cliprect, TRUE, state->m_btime_palette + 1, -1); + draw_background(screen.machine(), bitmap, cliprect, state->m_zoar_scrollram, state->m_btime_palette); + draw_chars(screen.machine(), bitmap, cliprect, TRUE, state->m_btime_palette + 1, -1); } else - draw_chars(screen->machine(), bitmap, cliprect, FALSE, state->m_btime_palette + 1, -1); + draw_chars(screen.machine(), bitmap, cliprect, FALSE, state->m_btime_palette + 1, -1); /* The order is important for correct priorities */ - draw_sprites(screen->machine(), bitmap, cliprect, state->m_btime_palette + 1, 1, 2, state->m_videoram + 0x1f, 0x20); - draw_sprites(screen->machine(), bitmap, cliprect, state->m_btime_palette + 1, 1, 2, state->m_videoram, 0x20); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_btime_palette + 1, 1, 2, state->m_videoram + 0x1f, 0x20); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_btime_palette + 1, 1, 2, state->m_videoram, 0x20); return 0; } @@ -494,7 +494,7 @@ SCREEN_UPDATE( zoar ) SCREEN_UPDATE( bnj ) { - btime_state *state = screen->machine().driver_data(); + btime_state *state = screen.machine().driver_data(); if (state->m_bnj_scroll1) { int scroll, offs; @@ -507,35 +507,35 @@ SCREEN_UPDATE( bnj ) sy = 16 * (((offs % 0x100) < 0x80) ? offs % 8 : (offs % 8) + 8); sx = 496 - sx; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { sx = 496 - sx; sy = 256 - sy; } - drawgfx_opaque(state->m_background_bitmap, 0, screen->machine().gfx[2], + drawgfx_opaque(state->m_background_bitmap, 0, screen.machine().gfx[2], (state->m_bnj_backgroundram[offs] >> 4) + ((offs & 0x80) >> 3) + 32, 0, - flip_screen_get(screen->machine()), flip_screen_get(screen->machine()), + flip_screen_get(screen.machine()), flip_screen_get(screen.machine()), sx, sy); } /* copy the background bitmap to the screen */ scroll = (state->m_bnj_scroll1 & 0x02) * 128 + 511 - state->m_bnj_scroll2; - if (!flip_screen_get(screen->machine())) + if (!flip_screen_get(screen.machine())) scroll = 767 - scroll; copyscrollbitmap(bitmap, state->m_background_bitmap, 1, &scroll, 0, 0, cliprect); /* copy the low priority characters followed by the sprites then the high priority characters */ - draw_chars(screen->machine(), bitmap, cliprect, TRUE, 0, 1); - draw_sprites(screen->machine(), bitmap, cliprect, 0, 0, 0, state->m_videoram, 0x20); - draw_chars(screen->machine(), bitmap, cliprect, TRUE, 0, 0); + draw_chars(screen.machine(), bitmap, cliprect, TRUE, 0, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 0, 0, 0, state->m_videoram, 0x20); + draw_chars(screen.machine(), bitmap, cliprect, TRUE, 0, 0); } else { - draw_chars(screen->machine(), bitmap, cliprect, FALSE, 0, -1); - draw_sprites(screen->machine(), bitmap, cliprect, 0, 0, 0, state->m_videoram, 0x20); + draw_chars(screen.machine(), bitmap, cliprect, FALSE, 0, -1); + draw_sprites(screen.machine(), bitmap, cliprect, 0, 0, 0, state->m_videoram, 0x20); } return 0; @@ -544,7 +544,7 @@ SCREEN_UPDATE( bnj ) SCREEN_UPDATE( cookrace ) { - btime_state *state = screen->machine().driver_data(); + btime_state *state = screen.machine().driver_data(); int offs; for (offs = state->m_bnj_backgroundram_size - 1; offs >=0; offs--) @@ -554,21 +554,21 @@ SCREEN_UPDATE( cookrace ) sx = 31 - (offs / 32); sy = offs % 32; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { sx = 31 - sx; sy = 33 - sy; } - drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[2], + drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[2], state->m_bnj_backgroundram[offs], 0, - flip_screen_get(screen->machine()), flip_screen_get(screen->machine()), + flip_screen_get(screen.machine()), flip_screen_get(screen.machine()), 8*sx,8*sy); } - draw_chars(screen->machine(), bitmap, cliprect, TRUE, 0, -1); - draw_sprites(screen->machine(), bitmap, cliprect, 0, 1, 0, state->m_videoram, 0x20); + draw_chars(screen.machine(), bitmap, cliprect, TRUE, 0, -1); + draw_sprites(screen.machine(), bitmap, cliprect, 0, 1, 0, state->m_videoram, 0x20); return 0; } @@ -576,9 +576,9 @@ SCREEN_UPDATE( cookrace ) SCREEN_UPDATE( disco ) { - btime_state *state = screen->machine().driver_data(); - draw_chars(screen->machine(), bitmap, cliprect, FALSE, state->m_btime_palette, -1); - draw_sprites(screen->machine(), bitmap, cliprect, state->m_btime_palette, 0, 0, state->m_spriteram, 1); + btime_state *state = screen.machine().driver_data(); + draw_chars(screen.machine(), bitmap, cliprect, FALSE, state->m_btime_palette, -1); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_btime_palette, 0, 0, state->m_spriteram, 1); return 0; } diff --git a/src/mame/video/bublbobl.c b/src/mame/video/bublbobl.c index ae60910ea08..b5c350cdab2 100644 --- a/src/mame/video/bublbobl.c +++ b/src/mame/video/bublbobl.c @@ -12,7 +12,7 @@ SCREEN_UPDATE( bublbobl ) { - bublbobl_state *state = screen->machine().driver_data(); + bublbobl_state *state = screen.machine().driver_data(); int offs; int sx, sy, xc, yc; int gfx_num, gfx_attr, gfx_offs; @@ -32,7 +32,7 @@ SCREEN_UPDATE( bublbobl ) sx = 0; - prom = screen->machine().region("proms")->base(); + prom = screen.machine().region("proms")->base(); for (offs = 0; offs < state->m_objectram_size; offs += 4) { /* skip empty sprites */ @@ -73,7 +73,7 @@ SCREEN_UPDATE( bublbobl ) x = sx + xc * 8; y = (sy + yc * 8) & 0xff; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { x = 248 - x; y = 248 - y; @@ -81,7 +81,7 @@ SCREEN_UPDATE( bublbobl ) flipy = !flipy; } - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], code, color, flipx,flipy, diff --git a/src/mame/video/buggychl.c b/src/mame/video/buggychl.c index 5c7ce049097..9143f140209 100644 --- a/src/mame/video/buggychl.c +++ b/src/mame/video/buggychl.c @@ -238,7 +238,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( buggychl ) { - buggychl_state *state = screen->machine().driver_data(); + buggychl_state *state = screen.machine().driver_data(); if (state->m_sky_on) draw_sky(bitmap, cliprect); @@ -246,11 +246,11 @@ SCREEN_UPDATE( buggychl ) bitmap_fill(bitmap, cliprect, 0); if (state->m_bg_on) - draw_bg(screen->machine(), bitmap, cliprect); + draw_bg(screen.machine(), bitmap, cliprect); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); - draw_fg(screen->machine(), bitmap, cliprect); + draw_fg(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/bwing.c b/src/mame/video/bwing.c index ee577abc1c7..a3ce81c5616 100644 --- a/src/mame/video/bwing.c +++ b/src/mame/video/bwing.c @@ -291,7 +291,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bmp, const rectang SCREEN_UPDATE( bwing ) { - bwing_state *state = screen->machine().driver_data(); + bwing_state *state = screen.machine().driver_data(); unsigned x, y, shiftx; if (state->m_mapmask & 0x20) @@ -316,10 +316,10 @@ SCREEN_UPDATE( bwing ) tilemap_draw(bitmap, cliprect, state->m_bgmap, 0, 0); } else - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); // draw low priority sprites - draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram, 0); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0); // draw foreground if (!(state->m_mapmask & 2)) @@ -333,7 +333,7 @@ SCREEN_UPDATE( bwing ) } // draw high priority sprites - draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram, 1); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 1); // draw text layer // if (state->m_mapmask & 4) diff --git a/src/mame/video/cabal.c b/src/mame/video/cabal.c index c95a61ba0da..29457ab1e15 100644 --- a/src/mame/video/cabal.c +++ b/src/mame/video/cabal.c @@ -148,9 +148,9 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( cabal ) { - cabal_state *state = screen->machine().driver_data(); + cabal_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_background_layer,TILEMAP_DRAW_OPAQUE,0); - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_text_layer,0,0); return 0; } diff --git a/src/mame/video/calomega.c b/src/mame/video/calomega.c index 4bc6f8078a0..e9792ba6196 100644 --- a/src/mame/video/calomega.c +++ b/src/mame/video/calomega.c @@ -65,7 +65,7 @@ VIDEO_START( calomega ) SCREEN_UPDATE( calomega ) { - calomega_state *state = screen->machine().driver_data(); + calomega_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/canyon.c b/src/mame/video/canyon.c index c013e77bc6c..29ad6345ec7 100644 --- a/src/mame/video/canyon.c +++ b/src/mame/video/canyon.c @@ -84,16 +84,16 @@ static void draw_bombs( running_machine &machine, bitmap_t *bitmap, const rectan SCREEN_UPDATE( canyon ) { - canyon_state *state = screen->machine().driver_data(); + canyon_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); - draw_bombs(screen->machine(), bitmap, cliprect); + draw_bombs(screen.machine(), bitmap, cliprect); /* watchdog is disabled during service mode */ - watchdog_enable(screen->machine(), !(input_port_read(screen->machine(), "IN2") & 0x10)); + watchdog_enable(screen.machine(), !(input_port_read(screen.machine(), "IN2") & 0x10)); return 0; } diff --git a/src/mame/video/capbowl.c b/src/mame/video/capbowl.c index c31c875a0d9..a52f7a4fbd3 100644 --- a/src/mame/video/capbowl.c +++ b/src/mame/video/capbowl.c @@ -176,7 +176,7 @@ SCREEN_UPDATE( capbowl ) /* if we're blanked, just fill with black */ if (state.blanked) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } diff --git a/src/mame/video/carjmbre.c b/src/mame/video/carjmbre.c index 595d38e0d7b..9174138396f 100644 --- a/src/mame/video/carjmbre.c +++ b/src/mame/video/carjmbre.c @@ -110,7 +110,7 @@ VIDEO_START( carjmbre ) SCREEN_UPDATE( carjmbre ) { - carjmbre_state *state = screen->machine().driver_data(); + carjmbre_state *state = screen.machine().driver_data(); int offs, troffs, sx, sy, flipx, flipy; //colorram @@ -153,7 +153,7 @@ SCREEN_UPDATE( carjmbre ) flipy = !flipy; } - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], state->m_spriteram[troffs + 1], state->m_spriteram[troffs + 2] & 0xf, flipx,flipy, diff --git a/src/mame/video/carpolo.c b/src/mame/video/carpolo.c index 6f1c05a4b4f..0ea39e5be5f 100644 --- a/src/mame/video/carpolo.c +++ b/src/mame/video/carpolo.c @@ -223,7 +223,7 @@ static void draw_sprite(running_machine &machine, bitmap_t *bitmap, const rectan SCREEN_UPDATE( carpolo ) { - carpolo_state *state = screen->machine().driver_data(); + carpolo_state *state = screen.machine().driver_data(); /* draw the playfield elements in the correct priority order */ /* score area - position determined by bit 4 of the vertical timing PROM */ @@ -233,7 +233,7 @@ SCREEN_UPDATE( carpolo ) plot_box(bitmap,0,TOP_BORDER,RIGHT_BORDER+1,BOTTOM_BORDER-TOP_BORDER+1,FIELD_PEN); /* car 1 */ - draw_sprite(screen->machine(), bitmap, cliprect, + draw_sprite(screen.machine(), bitmap, cliprect, state->m_spriteram[0x00], state->m_spriteram[0x01], 0, state->m_spriteram[0x0c] & 0x0f, CAR1_COLOR); @@ -244,35 +244,35 @@ SCREEN_UPDATE( carpolo ) plot_box(bitmap,RIGHT_BORDER,TOP_BORDER,1,BOTTOM_BORDER-TOP_BORDER+1,LINE_PEN); /* car 4 */ - draw_sprite(screen->machine(), bitmap, cliprect, + draw_sprite(screen.machine(), bitmap, cliprect, state->m_spriteram[0x06], state->m_spriteram[0x07], 0, state->m_spriteram[0x0d] >> 4, CAR4_COLOR); /* car 3 */ - draw_sprite(screen->machine(), bitmap, cliprect, + draw_sprite(screen.machine(), bitmap, cliprect, state->m_spriteram[0x04], state->m_spriteram[0x05], 0, state->m_spriteram[0x0d] & 0x0f, CAR3_COLOR); /* car 2 */ - draw_sprite(screen->machine(), bitmap, cliprect, + draw_sprite(screen.machine(), bitmap, cliprect, state->m_spriteram[0x02], state->m_spriteram[0x03], 0, state->m_spriteram[0x0c] >> 4, CAR2_COLOR); /* ball */ - draw_sprite(screen->machine(), bitmap, cliprect, + draw_sprite(screen.machine(), bitmap, cliprect, state->m_spriteram[0x08], state->m_spriteram[0x09], 1, state->m_spriteram[0x0e] & 0x0f, BALL_COLOR); /* left goal - position determined by bit 6 of the horizontal and vertical timing PROMs */ - drawgfxzoom_transpen(bitmap,cliprect,screen->machine().gfx[1], + drawgfxzoom_transpen(bitmap,cliprect,screen.machine().gfx[1], 0,0, 0,0, LEFT_GOAL_X,GOAL_Y, 0x20000,0x20000,0); /* right goal */ - drawgfxzoom_transpen(bitmap,cliprect,screen->machine().gfx[1], + drawgfxzoom_transpen(bitmap,cliprect,screen.machine().gfx[1], 0,1, 1,0, RIGHT_GOAL_X,GOAL_Y, @@ -284,7 +284,7 @@ SCREEN_UPDATE( carpolo ) popmessage("WIDE!\n"); if (state->m_spriteram[0x0f] & 0x01) - draw_sprite(screen->machine(), bitmap, cliprect, + draw_sprite(screen.machine(), bitmap, cliprect, state->m_spriteram[0x0a], state->m_spriteram[0x0b], 1, state->m_spriteram[0x0e] >> 4, SPECIAL_CHAR_COLOR); @@ -295,14 +295,14 @@ SCREEN_UPDATE( carpolo ) and bit 3 of the vertical timing PROM controls in which quadrant the line will actually appear */ - draw_alpha_line(screen->machine(), bitmap, cliprect, 0, (0*4+0)*2 ); - draw_alpha_line(screen->machine(), bitmap, cliprect, 1, (0*4+0)*2+1); - draw_alpha_line(screen->machine(), bitmap, cliprect, 2, (3*4+1)*2 ); - draw_alpha_line(screen->machine(), bitmap, cliprect, 3, (3*4+1)*2+1); - draw_alpha_line(screen->machine(), bitmap, cliprect, 4, (1*4+2)*2 ); - draw_alpha_line(screen->machine(), bitmap, cliprect, 5, (1*4+2)*2+1); - draw_alpha_line(screen->machine(), bitmap, cliprect, 6, (0*4+3)*2 ); - draw_alpha_line(screen->machine(), bitmap, cliprect, 7, (0*4+3)*2+1); + draw_alpha_line(screen.machine(), bitmap, cliprect, 0, (0*4+0)*2 ); + draw_alpha_line(screen.machine(), bitmap, cliprect, 1, (0*4+0)*2+1); + draw_alpha_line(screen.machine(), bitmap, cliprect, 2, (3*4+1)*2 ); + draw_alpha_line(screen.machine(), bitmap, cliprect, 3, (3*4+1)*2+1); + draw_alpha_line(screen.machine(), bitmap, cliprect, 4, (1*4+2)*2 ); + draw_alpha_line(screen.machine(), bitmap, cliprect, 5, (1*4+2)*2+1); + draw_alpha_line(screen.machine(), bitmap, cliprect, 6, (0*4+3)*2 ); + draw_alpha_line(screen.machine(), bitmap, cliprect, 7, (0*4+3)*2+1); return 0; } @@ -551,7 +551,7 @@ static int check_sprite_border_collision(running_machine &machine, UINT8 x1, UIN SCREEN_EOF( carpolo ) { - carpolo_state *state = machine.driver_data(); + carpolo_state *state = screen.machine().driver_data(); int col_x, col_y; int car1_x, car2_x, car3_x, car4_x, ball_x; int car1_y, car2_y, car3_y, car4_y, ball_y; @@ -563,139 +563,139 @@ SCREEN_EOF( carpolo ) car1_x = state->m_spriteram[0x00]; car1_y = state->m_spriteram[0x01]; - remap_sprite_code(machine, 0, state->m_spriteram[0x0c] & 0x0f, &car1_code, &car1_flipy); + remap_sprite_code(screen.machine(), 0, state->m_spriteram[0x0c] & 0x0f, &car1_code, &car1_flipy); car2_x = state->m_spriteram[0x02]; car2_y = state->m_spriteram[0x03]; - remap_sprite_code(machine, 0, state->m_spriteram[0x0c] >> 4, &car2_code, &car2_flipy); + remap_sprite_code(screen.machine(), 0, state->m_spriteram[0x0c] >> 4, &car2_code, &car2_flipy); car3_x = state->m_spriteram[0x04]; car3_y = state->m_spriteram[0x05]; - remap_sprite_code(machine, 0, state->m_spriteram[0x0d] & 0x0f, &car3_code, &car3_flipy); + remap_sprite_code(screen.machine(), 0, state->m_spriteram[0x0d] & 0x0f, &car3_code, &car3_flipy); car4_x = state->m_spriteram[0x06]; car4_y = state->m_spriteram[0x07]; - remap_sprite_code(machine, 0, state->m_spriteram[0x0d] >> 4, &car4_code, &car4_flipy); + remap_sprite_code(screen.machine(), 0, state->m_spriteram[0x0d] >> 4, &car4_code, &car4_flipy); ball_x = state->m_spriteram[0x08]; ball_y = state->m_spriteram[0x09]; - remap_sprite_code(machine, 1, state->m_spriteram[0x0e] & 0x0f, &ball_code, &ball_flipy); + remap_sprite_code(screen.machine(), 1, state->m_spriteram[0x0e] & 0x0f, &ball_code, &ball_flipy); /* cars 1 and 2 */ - if (check_sprite_sprite_collision(machine, + if (check_sprite_sprite_collision(screen.machine(), car1_x, car1_y, car1_code, car1_flipy, car2_x, car2_y, car2_code, car2_flipy, &col_x, &col_y)) - carpolo_generate_car_car_interrupt(machine, 0, 1); + carpolo_generate_car_car_interrupt(screen.machine(), 0, 1); /* cars 1 and 3 */ - else if (check_sprite_sprite_collision(machine, + else if (check_sprite_sprite_collision(screen.machine(), car1_x, car1_y, car1_code, car1_flipy, car3_x, car3_y, car3_code, car3_flipy, &col_x, &col_y)) - carpolo_generate_car_car_interrupt(machine, 0, 2); + carpolo_generate_car_car_interrupt(screen.machine(), 0, 2); /* cars 1 and 4 */ - else if (check_sprite_sprite_collision(machine, + else if (check_sprite_sprite_collision(screen.machine(), car1_x, car1_y, car1_code, car1_flipy, car4_x, car4_y, car4_code, car4_flipy, &col_x, &col_y)) - carpolo_generate_car_car_interrupt(machine, 0, 3); + carpolo_generate_car_car_interrupt(screen.machine(), 0, 3); /* cars 2 and 3 */ - else if (check_sprite_sprite_collision(machine, + else if (check_sprite_sprite_collision(screen.machine(), car2_x, car2_y, car2_code, car2_flipy, car3_x, car3_y, car3_code, car3_flipy, &col_x, &col_y)) - carpolo_generate_car_car_interrupt(machine, 1, 2); + carpolo_generate_car_car_interrupt(screen.machine(), 1, 2); /* cars 2 and 4 */ - else if (check_sprite_sprite_collision(machine, + else if (check_sprite_sprite_collision(screen.machine(), car2_x, car2_y, car2_code, car2_flipy, car4_x, car4_y, car4_code, car4_flipy, &col_x, &col_y)) - carpolo_generate_car_car_interrupt(machine, 1, 3); + carpolo_generate_car_car_interrupt(screen.machine(), 1, 3); /* cars 3 and 4 */ - else if (check_sprite_sprite_collision(machine, + else if (check_sprite_sprite_collision(screen.machine(), car3_x, car3_y, car3_code, car3_flipy, car4_x, car4_y, car4_code, car4_flipy, &col_x, &col_y)) - carpolo_generate_car_car_interrupt(machine, 2, 3); + carpolo_generate_car_car_interrupt(screen.machine(), 2, 3); /* check car-ball collision */ - if (check_sprite_sprite_collision(machine, + if (check_sprite_sprite_collision(screen.machine(), car1_x, car1_y, car1_code, car1_flipy, ball_x, ball_y, ball_code, ball_flipy, &col_x, &col_y)) - carpolo_generate_car_ball_interrupt(machine, 0, col_x, col_y); + carpolo_generate_car_ball_interrupt(screen.machine(), 0, col_x, col_y); - else if (check_sprite_sprite_collision(machine, + else if (check_sprite_sprite_collision(screen.machine(), car2_x, car2_y, car2_code, car2_flipy, ball_x, ball_y, ball_code, ball_flipy, &col_x, &col_y)) - carpolo_generate_car_ball_interrupt(machine, 1, col_x, col_y); + carpolo_generate_car_ball_interrupt(screen.machine(), 1, col_x, col_y); - else if (check_sprite_sprite_collision(machine, + else if (check_sprite_sprite_collision(screen.machine(), car3_x, car3_y, car3_code, car3_flipy, ball_x, ball_y, ball_code, ball_flipy, &col_x, &col_y)) - carpolo_generate_car_ball_interrupt(machine, 2, col_x, col_y); + carpolo_generate_car_ball_interrupt(screen.machine(), 2, col_x, col_y); - else if (check_sprite_sprite_collision(machine, + else if (check_sprite_sprite_collision(screen.machine(), car4_x, car4_y, car4_code, car4_flipy, ball_x, ball_y, ball_code, ball_flipy, &col_x, &col_y)) - carpolo_generate_car_ball_interrupt(machine, 3, col_x, col_y); + carpolo_generate_car_ball_interrupt(screen.machine(), 3, col_x, col_y); /* check car-goal collision */ - if (check_sprite_left_goal_collision(machine, car1_x, car1_y, car1_code, car1_flipy, 1)) - carpolo_generate_car_goal_interrupt(machine, 0, 0); + if (check_sprite_left_goal_collision(screen.machine(), car1_x, car1_y, car1_code, car1_flipy, 1)) + carpolo_generate_car_goal_interrupt(screen.machine(), 0, 0); - else if (check_sprite_right_goal_collision(machine, car1_x, car1_y, car1_code, car1_flipy, 1)) - carpolo_generate_car_goal_interrupt(machine, 0, 1); + else if (check_sprite_right_goal_collision(screen.machine(), car1_x, car1_y, car1_code, car1_flipy, 1)) + carpolo_generate_car_goal_interrupt(screen.machine(), 0, 1); - else if (check_sprite_left_goal_collision(machine, car2_x, car2_y, car2_code, car2_flipy, 1)) - carpolo_generate_car_goal_interrupt(machine, 1, 0); + else if (check_sprite_left_goal_collision(screen.machine(), car2_x, car2_y, car2_code, car2_flipy, 1)) + carpolo_generate_car_goal_interrupt(screen.machine(), 1, 0); - else if (check_sprite_right_goal_collision(machine, car2_x, car2_y, car2_code, car2_flipy, 1)) - carpolo_generate_car_goal_interrupt(machine, 1, 1); + else if (check_sprite_right_goal_collision(screen.machine(), car2_x, car2_y, car2_code, car2_flipy, 1)) + carpolo_generate_car_goal_interrupt(screen.machine(), 1, 1); - else if (check_sprite_left_goal_collision(machine, car3_x, car3_y, car3_code, car3_flipy, 1)) - carpolo_generate_car_goal_interrupt(machine, 2, 0); + else if (check_sprite_left_goal_collision(screen.machine(), car3_x, car3_y, car3_code, car3_flipy, 1)) + carpolo_generate_car_goal_interrupt(screen.machine(), 2, 0); - else if (check_sprite_right_goal_collision(machine, car3_x, car3_y, car3_code, car3_flipy, 1)) - carpolo_generate_car_goal_interrupt(machine, 2, 1); + else if (check_sprite_right_goal_collision(screen.machine(), car3_x, car3_y, car3_code, car3_flipy, 1)) + carpolo_generate_car_goal_interrupt(screen.machine(), 2, 1); - else if (check_sprite_left_goal_collision(machine, car4_x, car4_y, car4_code, car4_flipy, 1)) - carpolo_generate_car_goal_interrupt(machine, 3, 0); + else if (check_sprite_left_goal_collision(screen.machine(), car4_x, car4_y, car4_code, car4_flipy, 1)) + carpolo_generate_car_goal_interrupt(screen.machine(), 3, 0); - else if (check_sprite_right_goal_collision(machine, car4_x, car4_y, car4_code, car4_flipy, 1)) - carpolo_generate_car_goal_interrupt(machine, 3, 1); + else if (check_sprite_right_goal_collision(screen.machine(), car4_x, car4_y, car4_code, car4_flipy, 1)) + carpolo_generate_car_goal_interrupt(screen.machine(), 3, 1); /* check ball collision with static screen elements */ { int col; - col = check_sprite_left_goal_collision(machine, ball_x, ball_y, ball_code, ball_flipy, 0); + col = check_sprite_left_goal_collision(screen.machine(), ball_x, ball_y, ball_code, ball_flipy, 0); - if (col == 1) carpolo_generate_ball_screen_interrupt(machine, 0x05); - if (col == 2) carpolo_generate_ball_screen_interrupt(machine, 0x03); + if (col == 1) carpolo_generate_ball_screen_interrupt(screen.machine(), 0x05); + if (col == 2) carpolo_generate_ball_screen_interrupt(screen.machine(), 0x03); - col = check_sprite_right_goal_collision(machine, ball_x, ball_y, ball_code, ball_flipy, 0); + col = check_sprite_right_goal_collision(screen.machine(), ball_x, ball_y, ball_code, ball_flipy, 0); - if (col == 1) carpolo_generate_ball_screen_interrupt(machine, 0x05 | 0x08); - if (col == 2) carpolo_generate_ball_screen_interrupt(machine, 0x03 | 0x08); + if (col == 1) carpolo_generate_ball_screen_interrupt(screen.machine(), 0x05 | 0x08); + if (col == 2) carpolo_generate_ball_screen_interrupt(screen.machine(), 0x03 | 0x08); - if (check_sprite_border_collision(machine, ball_x, ball_y, ball_code, ball_flipy)) - carpolo_generate_ball_screen_interrupt(machine, 0x06); + if (check_sprite_border_collision(screen.machine(), ball_x, ball_y, ball_code, ball_flipy)) + carpolo_generate_ball_screen_interrupt(screen.machine(), 0x06); } @@ -703,28 +703,28 @@ SCREEN_EOF( carpolo ) { int col; - col = check_sprite_border_collision(machine, car1_x, car1_y, car1_code, car1_flipy); + col = check_sprite_border_collision(screen.machine(), car1_x, car1_y, car1_code, car1_flipy); if (col) - carpolo_generate_car_border_interrupt(machine, 0, (col == 2)); + carpolo_generate_car_border_interrupt(screen.machine(), 0, (col == 2)); else { - col = check_sprite_border_collision(machine, car2_x, car2_y, car2_code, car2_flipy); + col = check_sprite_border_collision(screen.machine(), car2_x, car2_y, car2_code, car2_flipy); if (col) - carpolo_generate_car_border_interrupt(machine, 1, (col == 2)); + carpolo_generate_car_border_interrupt(screen.machine(), 1, (col == 2)); else { - col = check_sprite_border_collision(machine, car3_x, car3_y, car3_code, car3_flipy); + col = check_sprite_border_collision(screen.machine(), car3_x, car3_y, car3_code, car3_flipy); if (col) - carpolo_generate_car_border_interrupt(machine, 2, (col == 2)); + carpolo_generate_car_border_interrupt(screen.machine(), 2, (col == 2)); else { - col = check_sprite_border_collision(machine, car4_x, car4_y, car4_code, car4_flipy); + col = check_sprite_border_collision(screen.machine(), car4_x, car4_y, car4_code, car4_flipy); if (col) - carpolo_generate_car_border_interrupt(machine, 3, (col == 2)); + carpolo_generate_car_border_interrupt(screen.machine(), 3, (col == 2)); } } } diff --git a/src/mame/video/cave.c b/src/mame/video/cave.c index 1c9edcd400c..6a0b4a3383d 100644 --- a/src/mame/video/cave.c +++ b/src/mame/video/cave.c @@ -1542,11 +1542,11 @@ INLINE void cave_tilemap_draw( SCREEN_UPDATE( cave ) { - cave_state *state = screen->machine().driver_data(); + cave_state *state = screen.machine().driver_data(); int pri, pri2, GFX; int layers_ctrl = -1; - set_pens(screen->machine()); + set_pens(screen.machine()); state->m_blit.baseaddr = (UINT8 *)bitmap->base; state->m_blit.line_offset = bitmap->rowpixels * bitmap->bpp / 8; @@ -1565,22 +1565,22 @@ SCREEN_UPDATE( cave ) #ifdef MAME_DEBUG { - if ( screen->machine().input().code_pressed(KEYCODE_Z) || screen->machine().input().code_pressed(KEYCODE_X) || screen->machine().input().code_pressed(KEYCODE_C) || - screen->machine().input().code_pressed(KEYCODE_V) || screen->machine().input().code_pressed(KEYCODE_B) ) + if ( screen.machine().input().code_pressed(KEYCODE_Z) || screen.machine().input().code_pressed(KEYCODE_X) || screen.machine().input().code_pressed(KEYCODE_C) || + screen.machine().input().code_pressed(KEYCODE_V) || screen.machine().input().code_pressed(KEYCODE_B) ) { int msk = 0, val = 0; - if (screen->machine().input().code_pressed(KEYCODE_X)) val = 1; // priority 0 only - if (screen->machine().input().code_pressed(KEYCODE_C)) val = 2; // "" 1 - if (screen->machine().input().code_pressed(KEYCODE_V)) val = 4; // "" 2 - if (screen->machine().input().code_pressed(KEYCODE_B)) val = 8; // "" 3 - if (screen->machine().input().code_pressed(KEYCODE_Z)) val = 1|2|4|8; // All of the above priorities + if (screen.machine().input().code_pressed(KEYCODE_X)) val = 1; // priority 0 only + if (screen.machine().input().code_pressed(KEYCODE_C)) val = 2; // "" 1 + if (screen.machine().input().code_pressed(KEYCODE_V)) val = 4; // "" 2 + if (screen.machine().input().code_pressed(KEYCODE_B)) val = 8; // "" 3 + if (screen.machine().input().code_pressed(KEYCODE_Z)) val = 1|2|4|8; // All of the above priorities - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= val << 0; // for layer 0 - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= val << 4; // for layer 1 - if (screen->machine().input().code_pressed(KEYCODE_E)) msk |= val << 8; // for layer 2 - if (screen->machine().input().code_pressed(KEYCODE_R)) msk |= val << 12; // for layer 3 - if (screen->machine().input().code_pressed(KEYCODE_A)) msk |= val << 16; // for sprites + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= val << 0; // for layer 0 + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= val << 4; // for layer 1 + if (screen.machine().input().code_pressed(KEYCODE_E)) msk |= val << 8; // for layer 2 + if (screen.machine().input().code_pressed(KEYCODE_R)) msk |= val << 12; // for layer 3 + if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= val << 16; // for sprites if (msk != 0) layers_ctrl &= msk; #if 1 @@ -1619,7 +1619,7 @@ SCREEN_UPDATE( cave ) } #endif - cave_sprite_check(*screen, cliprect); + cave_sprite_check(screen, cliprect); bitmap_fill(bitmap, cliprect, state->m_background_color); @@ -1637,14 +1637,14 @@ SCREEN_UPDATE( cave ) */ for (pri = 0; pri <= 3; pri++) // tile / sprite priority { - if (layers_ctrl & (1 << (pri + 16))) (*state->m_sprite_draw)(screen->machine(), pri); + if (layers_ctrl & (1 << (pri + 16))) (*state->m_sprite_draw)(screen.machine(), pri); for (pri2 = 0; pri2 <= 3; pri2++) // priority of the whole layer { - if (layers_ctrl & (1 << (pri + 0))) cave_tilemap_draw(screen->machine(), bitmap, cliprect, pri, 0, pri2, 0); - if (layers_ctrl & (1 << (pri + 4))) cave_tilemap_draw(screen->machine(), bitmap, cliprect, pri, 0, pri2, 1); - if (layers_ctrl & (1 << (pri + 8))) cave_tilemap_draw(screen->machine(), bitmap, cliprect, pri, 0, pri2, 2); - if (layers_ctrl & (1 << (pri + 12))) cave_tilemap_draw(screen->machine(), bitmap, cliprect, pri, 0, pri2, 3); + if (layers_ctrl & (1 << (pri + 0))) cave_tilemap_draw(screen.machine(), bitmap, cliprect, pri, 0, pri2, 0); + if (layers_ctrl & (1 << (pri + 4))) cave_tilemap_draw(screen.machine(), bitmap, cliprect, pri, 0, pri2, 1); + if (layers_ctrl & (1 << (pri + 8))) cave_tilemap_draw(screen.machine(), bitmap, cliprect, pri, 0, pri2, 2); + if (layers_ctrl & (1 << (pri + 12))) cave_tilemap_draw(screen.machine(), bitmap, cliprect, pri, 0, pri2, 3); } } return 0; diff --git a/src/mame/video/cbasebal.c b/src/mame/video/cbasebal.c index 779c0750120..66fb6269253 100644 --- a/src/mame/video/cbasebal.c +++ b/src/mame/video/cbasebal.c @@ -180,7 +180,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( cbasebal ) { - cbasebal_state *state = screen->machine().driver_data(); + cbasebal_state *state = screen.machine().driver_data(); if (state->m_bg_on) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); @@ -188,7 +188,7 @@ SCREEN_UPDATE( cbasebal ) bitmap_fill(bitmap, cliprect, 768); if (state->m_obj_on) - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); if (state->m_text_on) tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); diff --git a/src/mame/video/cbuster.c b/src/mame/video/cbuster.c index fa2abd468cd..0cf4cea85b5 100644 --- a/src/mame/video/cbuster.c +++ b/src/mame/video/cbuster.c @@ -49,12 +49,12 @@ VIDEO_START( twocrude ) SCREEN_UPDATE( twocrude ) { - cbuster_state *state = screen->machine().driver_data(); + cbuster_state *state = screen.machine().driver_data(); UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); - flip_screen_set(screen->machine(), !BIT(flip, 7)); + flip_screen_set(screen.machine(), !BIT(flip, 7)); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram16_buffer, 0x400); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram16_buffer, 0x400); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); @@ -62,8 +62,8 @@ SCREEN_UPDATE( twocrude ) /* Draw playfields & sprites */ deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); - screen->machine().device("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0800, 0x0900, 0x100, 0x0ff); - screen->machine().device("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0900, 0x0900, 0x500, 0x0ff); + screen.machine().device("spritegen")->inefficient_copy_sprite_bitmap(screen.machine(), bitmap, cliprect, 0x0800, 0x0900, 0x100, 0x0ff); + screen.machine().device("spritegen")->inefficient_copy_sprite_bitmap(screen.machine(), bitmap, cliprect, 0x0900, 0x0900, 0x500, 0x0ff); if (state->m_pri) { @@ -76,8 +76,8 @@ SCREEN_UPDATE( twocrude ) deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); } - screen->machine().device("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0000, 0x0900, 0x100, 0x0ff); - screen->machine().device("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0100, 0x0900, 0x500, 0x0ff); + screen.machine().device("spritegen")->inefficient_copy_sprite_bitmap(screen.machine(), bitmap, cliprect, 0x0000, 0x0900, 0x100, 0x0ff); + screen.machine().device("spritegen")->inefficient_copy_sprite_bitmap(screen.machine(), bitmap, cliprect, 0x0100, 0x0900, 0x500, 0x0ff); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; } diff --git a/src/mame/video/ccastles.c b/src/mame/video/ccastles.c index 8c7a77e9b74..6614351cc17 100644 --- a/src/mame/video/ccastles.c +++ b/src/mame/video/ccastles.c @@ -267,10 +267,10 @@ WRITE8_HANDLER( ccastles_bitmode_addr_w ) SCREEN_UPDATE( ccastles ) { - ccastles_state *state = screen->machine().driver_data(); + ccastles_state *state = screen.machine().driver_data(); UINT8 *spriteaddr = &state->m_spriteram[state->m_video_control[7] * 0x100]; /* BUF1/BUF2 */ int flip = state->m_video_control[4] ? 0xff : 0x00; /* PLAYER2 */ - pen_t black = get_black_pen(screen->machine()); + pen_t black = get_black_pen(screen.machine()); int x, y, offs; /* draw the sprites */ @@ -282,7 +282,7 @@ SCREEN_UPDATE( ccastles ) int which = spriteaddr[offs]; int color = spriteaddr[offs + 2] >> 7; - drawgfx_transpen(state->m_spritebitmap, cliprect, screen->machine().gfx[0], which, color, flip, flip, x, y, 7); + drawgfx_transpen(state->m_spritebitmap, cliprect, screen.machine().gfx[0], which, color, flip, flip, x, y, 7); } /* draw the bitmap to the screen, looping over Y */ diff --git a/src/mame/video/cclimber.c b/src/mame/video/cclimber.c index e0421ca0db9..b7aa45201c3 100644 --- a/src/mame/video/cclimber.c +++ b/src/mame/video/cclimber.c @@ -664,22 +664,22 @@ static void swimmer_draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, co SCREEN_UPDATE( cclimber ) { - cclimber_state *state = screen->machine().driver_data(); + cclimber_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, CCLIMBER_BG_PEN); - draw_playfield(screen->machine(), bitmap, cliprect); + draw_playfield(screen.machine(), bitmap, cliprect); /* draw the "big sprite" under the regular sprites */ if ((state->m_bigsprite_control[0] & 0x01)) { - cclimber_draw_bigsprite(screen->machine(), bitmap, cliprect); - cclimber_draw_sprites(bitmap, cliprect, screen->machine().gfx[1]); + cclimber_draw_bigsprite(screen.machine(), bitmap, cliprect); + cclimber_draw_sprites(bitmap, cliprect, screen.machine().gfx[1]); } /* draw the "big sprite" over the regular sprites */ else { - cclimber_draw_sprites(bitmap, cliprect, screen->machine().gfx[1]); - cclimber_draw_bigsprite(screen->machine(), bitmap, cliprect); + cclimber_draw_sprites(bitmap, cliprect, screen.machine().gfx[1]); + cclimber_draw_bigsprite(screen.machine(), bitmap, cliprect); } return 0; @@ -688,9 +688,9 @@ SCREEN_UPDATE( cclimber ) SCREEN_UPDATE( yamato ) { - cclimber_state *state = screen->machine().driver_data(); + cclimber_state *state = screen.machine().driver_data(); int i; - UINT8 *sky_rom = screen->machine().region("user1")->base() + 0x1200; + UINT8 *sky_rom = screen.machine().region("user1")->base() + 0x1200; for (i = 0; i < 0x100; i++) { @@ -701,20 +701,20 @@ SCREEN_UPDATE( yamato ) *BITMAP_ADDR16(bitmap, j, (i - 8) & 0xff) = pen; } - draw_playfield(screen->machine(), bitmap, cliprect); + draw_playfield(screen.machine(), bitmap, cliprect); /* draw the "big sprite" under the regular sprites */ if ((state->m_bigsprite_control[0] & 0x01)) { - cclimber_draw_bigsprite(screen->machine(), bitmap, cliprect); - toprollr_draw_sprites(bitmap, cliprect, screen->machine().gfx[1]); + cclimber_draw_bigsprite(screen.machine(), bitmap, cliprect); + toprollr_draw_sprites(bitmap, cliprect, screen.machine().gfx[1]); } /* draw the "big sprite" over the regular sprites */ else { - toprollr_draw_sprites(bitmap, cliprect, screen->machine().gfx[1]); - cclimber_draw_bigsprite(screen->machine(), bitmap, cliprect); + toprollr_draw_sprites(bitmap, cliprect, screen.machine().gfx[1]); + cclimber_draw_bigsprite(screen.machine(), bitmap, cliprect); } return 0; @@ -723,8 +723,8 @@ SCREEN_UPDATE( yamato ) SCREEN_UPDATE( swimmer ) { - cclimber_state *state = screen->machine().driver_data(); - swimmer_set_background_pen(screen->machine()); + cclimber_state *state = screen.machine().driver_data(); + swimmer_set_background_pen(screen.machine()); if (*state->m_swimmer_side_background_enabled & 0x01) { @@ -754,20 +754,20 @@ SCREEN_UPDATE( swimmer ) else bitmap_fill(bitmap, cliprect, CCLIMBER_BG_PEN); - draw_playfield(screen->machine(), bitmap, cliprect); + draw_playfield(screen.machine(), bitmap, cliprect); /* draw the "big sprite" under the regular sprites */ if ((state->m_bigsprite_control[0] & 0x01)) { - cclimber_draw_bigsprite(screen->machine(), bitmap, cliprect); - swimmer_draw_sprites(bitmap, cliprect, screen->machine().gfx[1]); + cclimber_draw_bigsprite(screen.machine(), bitmap, cliprect); + swimmer_draw_sprites(bitmap, cliprect, screen.machine().gfx[1]); } /* draw the "big sprite" over the regular sprites */ else { - swimmer_draw_sprites(bitmap, cliprect, screen->machine().gfx[1]); - cclimber_draw_bigsprite(screen->machine(), bitmap, cliprect); + swimmer_draw_sprites(bitmap, cliprect, screen.machine().gfx[1]); + cclimber_draw_bigsprite(screen.machine(), bitmap, cliprect); } return 0; @@ -776,7 +776,7 @@ SCREEN_UPDATE( swimmer ) SCREEN_UPDATE( toprollr ) { - cclimber_state *state = screen->machine().driver_data(); + cclimber_state *state = screen.machine().driver_data(); rectangle scroll_area_clip = *cliprect; scroll_area_clip.min_x = 4*8; scroll_area_clip.max_x = 29*8-1; @@ -792,15 +792,15 @@ SCREEN_UPDATE( toprollr ) /* draw the "big sprite" over the regular sprites */ if ((state->m_bigsprite_control[1] & 0x20)) { - toprollr_draw_sprites(bitmap, &scroll_area_clip, screen->machine().gfx[1]); - toprollr_draw_bigsprite(screen->machine(), bitmap, &scroll_area_clip); + toprollr_draw_sprites(bitmap, &scroll_area_clip, screen.machine().gfx[1]); + toprollr_draw_bigsprite(screen.machine(), bitmap, &scroll_area_clip); } /* draw the "big sprite" under the regular sprites */ else { - toprollr_draw_bigsprite(screen->machine(), bitmap, &scroll_area_clip); - toprollr_draw_sprites(bitmap, &scroll_area_clip, screen->machine().gfx[1]); + toprollr_draw_bigsprite(screen.machine(), bitmap, &scroll_area_clip); + toprollr_draw_sprites(bitmap, &scroll_area_clip, screen.machine().gfx[1]); } tilemap_mark_all_tiles_dirty(state->m_pf_tilemap); diff --git a/src/mame/video/centiped.c b/src/mame/video/centiped.c index 658d2cc3b3a..d62b9101b61 100644 --- a/src/mame/video/centiped.c +++ b/src/mame/video/centiped.c @@ -431,7 +431,7 @@ WRITE8_HANDLER( mazeinv_paletteram_w ) SCREEN_UPDATE( centiped ) { - centiped_state *state = screen->machine().driver_data(); + centiped_state *state = screen.machine().driver_data(); UINT8 *spriteram = state->m_spriteram; rectangle spriteclip = *cliprect; int offs; @@ -455,7 +455,7 @@ SCREEN_UPDATE( centiped ) int x = spriteram[offs + 0x20]; int y = 240 - spriteram[offs + 0x10]; - drawgfx_transmask(bitmap, &spriteclip, screen->machine().gfx[1], code, color, flipx, flipy, x, y, state->m_penmask[color & 0x3f]); + drawgfx_transmask(bitmap, &spriteclip, screen.machine().gfx[1], code, color, flipx, flipy, x, y, state->m_penmask[color & 0x3f]); } return 0; } @@ -463,9 +463,9 @@ SCREEN_UPDATE( centiped ) SCREEN_UPDATE( warlords ) { - centiped_state *state = screen->machine().driver_data(); + centiped_state *state = screen.machine().driver_data(); UINT8 *spriteram = state->m_spriteram; - int upright_mode = input_port_read(screen->machine(), "IN0") & 0x80; + int upright_mode = input_port_read(screen.machine(), "IN0") & 0x80; int offs; /* if the cocktail/upright switch flipped, force refresh */ @@ -501,7 +501,7 @@ SCREEN_UPDATE( warlords ) flipx = !flipx; } - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], code, color, flipx, flipy, x, y, 0); + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], code, color, flipx, flipy, x, y, 0); } return 0; } @@ -509,7 +509,7 @@ SCREEN_UPDATE( warlords ) SCREEN_UPDATE( bullsdrt ) { - centiped_state *state = screen->machine().driver_data(); + centiped_state *state = screen.machine().driver_data(); UINT8 *spriteram = state->m_spriteram; rectangle spriteclip = *cliprect; @@ -533,7 +533,7 @@ SCREEN_UPDATE( bullsdrt ) int x = spriteram[offs + 0x20]; int y = 240 - spriteram[offs + 0x10]; - drawgfx_transpen(bitmap, &spriteclip, screen->machine().gfx[1], code, color & 0x3f, 1, flipy, x, y, 0); + drawgfx_transpen(bitmap, &spriteclip, screen.machine().gfx[1], code, color & 0x3f, 1, flipy, x, y, 0); } return 0; } @@ -544,7 +544,7 @@ SCREEN_UPDATE( bullsdrt ) */ SCREEN_UPDATE( milliped ) { - centiped_state *state = screen->machine().driver_data(); + centiped_state *state = screen.machine().driver_data(); UINT8 *spriteram = state->m_spriteram; rectangle spriteclip = *cliprect; int offs; @@ -571,7 +571,7 @@ SCREEN_UPDATE( milliped ) flipy = !flipy; } - drawgfx_transmask(bitmap, &spriteclip, screen->machine().gfx[1], code, color, flipx, flipy, x, y, state->m_penmask[color & 0x3f]); + drawgfx_transmask(bitmap, &spriteclip, screen.machine().gfx[1], code, color, flipx, flipy, x, y, state->m_penmask[color & 0x3f]); } return 0; } diff --git a/src/mame/video/chaknpop.c b/src/mame/video/chaknpop.c index d044980096c..e86705d9a83 100644 --- a/src/mame/video/chaknpop.c +++ b/src/mame/video/chaknpop.c @@ -260,10 +260,10 @@ static void draw_bitmap( running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( chaknpop ) { - chaknpop_state *state = screen->machine().driver_data(); + chaknpop_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); - draw_bitmap(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); + draw_bitmap(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/champbas.c b/src/mame/video/champbas.c index 291cb3b0382..a8558a4d123 100644 --- a/src/mame/video/champbas.c +++ b/src/mame/video/champbas.c @@ -284,16 +284,16 @@ static void exctsccr_draw_sprites( running_machine &machine, bitmap_t *bitmap, c SCREEN_UPDATE( champbas ) { - champbas_state *state = screen->machine().driver_data(); + champbas_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - champbas_draw_sprites(screen->machine(), bitmap, cliprect); + champbas_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( exctsccr ) { - champbas_state *state = screen->machine().driver_data(); + champbas_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - exctsccr_draw_sprites(screen->machine(), bitmap, cliprect); + exctsccr_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/changela.c b/src/mame/video/changela.c index b037df8e04d..b729a151b6d 100644 --- a/src/mame/video/changela.c +++ b/src/mame/video/changela.c @@ -724,12 +724,12 @@ static TIMER_CALLBACK( changela_scanline_callback ) SCREEN_UPDATE( changela ) { - changela_state *state = screen->machine().driver_data(); + changela_state *state = screen.machine().driver_data(); copybitmap(bitmap, state->m_river_bitmap, 0, 0, 0, 0, cliprect); copybitmap_trans(bitmap, state->m_obj0_bitmap, 0, 0, 0, 0, cliprect, 0); copybitmap_trans(bitmap, state->m_tree0_bitmap, 0, 0, 0, 0, cliprect, 0); copybitmap_trans(bitmap, state->m_tree1_bitmap, 0, 0, 0, 0, cliprect, 0); - draw_obj1(screen->machine(), bitmap); + draw_obj1(screen.machine(), bitmap); return 0; } diff --git a/src/mame/video/cheekyms.c b/src/mame/video/cheekyms.c index d0fb626178a..8bbc01e1514 100644 --- a/src/mame/video/cheekyms.c +++ b/src/mame/video/cheekyms.c @@ -150,19 +150,19 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( cheekyms ) { - cheekyms_state *state = screen->machine().driver_data(); + cheekyms_state *state = screen.machine().driver_data(); int y, x; int scrolly = ((*state->m_port_80 >> 3) & 0x07); int flip = *state->m_port_80 & 0x80; - tilemap_mark_all_tiles_dirty_all(screen->machine()); - tilemap_set_flip_all(screen->machine(), flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); + tilemap_mark_all_tiles_dirty_all(screen.machine()); + tilemap_set_flip_all(screen.machine(), flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); bitmap_fill(bitmap, cliprect, 0); bitmap_fill(state->m_bitmap_buffer, cliprect, 0); /* sprites go under the playfield */ - draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().gfx[1], flip); + draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().gfx[1], flip); /* draw the tilemap to a temp bitmap */ tilemap_draw(state->m_bitmap_buffer, cliprect, state->m_cm_tilemap, 0, 0); diff --git a/src/mame/video/chqflag.c b/src/mame/video/chqflag.c index 9400c309c58..68c59f540fb 100644 --- a/src/mame/video/chqflag.c +++ b/src/mame/video/chqflag.c @@ -73,7 +73,7 @@ VIDEO_START( chqflag ) SCREEN_UPDATE( chqflag ) { - chqflag_state *state = screen->machine().driver_data(); + chqflag_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, 0); diff --git a/src/mame/video/cinemat.c b/src/mame/video/cinemat.c index dc6471607d0..87b965e9395 100644 --- a/src/mame/video/cinemat.c +++ b/src/mame/video/cinemat.c @@ -218,7 +218,7 @@ SCREEN_UPDATE( cinemat ) SCREEN_UPDATE_CALL(vector); vector_clear_list(); - ccpu_wdt_timer_trigger(screen->machine().device("maincpu")); + ccpu_wdt_timer_trigger(screen.machine().device("maincpu")); return 0; } @@ -233,7 +233,7 @@ SCREEN_UPDATE( cinemat ) SCREEN_UPDATE( spacewar ) { - int sw_option = input_port_read(screen->machine(), "INPUTS"); + int sw_option = input_port_read(screen.machine(), "INPUTS"); SCREEN_UPDATE_CALL(cinemat); diff --git a/src/mame/video/circus.c b/src/mame/video/circus.c index b0b9b3cd246..4aa906ee764 100644 --- a/src/mame/video/circus.c +++ b/src/mame/video/circus.c @@ -115,10 +115,10 @@ static void circus_draw_fg( running_machine &machine, bitmap_t *bitmap, const re SCREEN_UPDATE( circus ) { - circus_state *state = screen->machine().driver_data(); + circus_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - circus_draw_fg(screen->machine(), bitmap, cliprect); - draw_sprite_collision(screen->machine(), bitmap, cliprect); + circus_draw_fg(screen.machine(), bitmap, cliprect); + draw_sprite_collision(screen.machine(), bitmap, cliprect); return 0; } @@ -186,11 +186,11 @@ static void robotbwl_draw_ball( running_machine &machine, bitmap_t *bitmap, cons SCREEN_UPDATE( robotbwl ) { - circus_state *state = screen->machine().driver_data(); + circus_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); robotbwl_draw_scoreboard(bitmap, cliprect); robotbwl_draw_bowling_alley(bitmap, cliprect); - robotbwl_draw_ball(screen->machine(), bitmap, cliprect); + robotbwl_draw_ball(screen.machine(), bitmap, cliprect); return 0; } @@ -207,16 +207,16 @@ static void crash_draw_car( running_machine &machine, bitmap_t *bitmap, const re SCREEN_UPDATE( crash ) { - circus_state *state = screen->machine().driver_data(); + circus_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - crash_draw_car(screen->machine(), bitmap, cliprect); + crash_draw_car(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( ripcord ) { - circus_state *state = screen->machine().driver_data(); + circus_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprite_collision(screen->machine(), bitmap, cliprect); + draw_sprite_collision(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/circusc.c b/src/mame/video/circusc.c index 590523182b2..82ff8ee2942 100644 --- a/src/mame/video/circusc.c +++ b/src/mame/video/circusc.c @@ -200,7 +200,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( circusc ) { - circusc_state *state = screen->machine().driver_data(); + circusc_state *state = screen.machine().driver_data(); int i; for (i = 0; i < 10; i++) @@ -210,7 +210,7 @@ SCREEN_UPDATE( circusc ) bitmap_fill(bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 1, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/cischeat.c b/src/mame/video/cischeat.c index be409cb43b0..5a0492c2438 100644 --- a/src/mame/video/cischeat.c +++ b/src/mame/video/cischeat.c @@ -1210,24 +1210,24 @@ if (machine.input().code_pressed(KEYCODE_X)) #ifdef MAME_DEBUG #define CISCHEAT_LAYERSCTRL \ state->m_debugsprites = 0; \ -if ( screen->machine().input().code_pressed(KEYCODE_Z) || screen->machine().input().code_pressed(KEYCODE_X) ) \ +if ( screen.machine().input().code_pressed(KEYCODE_Z) || screen.machine().input().code_pressed(KEYCODE_X) ) \ { \ int msk = 0; \ - if (screen->machine().input().code_pressed(KEYCODE_Q)) { msk |= 0x01;} \ - if (screen->machine().input().code_pressed(KEYCODE_W)) { msk |= 0x02;} \ - if (screen->machine().input().code_pressed(KEYCODE_E)) { msk |= 0x04;} \ - if (screen->machine().input().code_pressed(KEYCODE_A)) { msk |= 0x08; state->m_debugsprites = 1;} \ - if (screen->machine().input().code_pressed(KEYCODE_S)) { msk |= 0x08; state->m_debugsprites = 2;} \ - if (screen->machine().input().code_pressed(KEYCODE_D)) { msk |= 0x08; state->m_debugsprites = 3;} \ - if (screen->machine().input().code_pressed(KEYCODE_F)) { msk |= 0x08; state->m_debugsprites = 4;} \ - if (screen->machine().input().code_pressed(KEYCODE_R)) { msk |= 0x10;} \ - if (screen->machine().input().code_pressed(KEYCODE_T)) { msk |= 0x20;} \ + if (screen.machine().input().code_pressed(KEYCODE_Q)) { msk |= 0x01;} \ + if (screen.machine().input().code_pressed(KEYCODE_W)) { msk |= 0x02;} \ + if (screen.machine().input().code_pressed(KEYCODE_E)) { msk |= 0x04;} \ + if (screen.machine().input().code_pressed(KEYCODE_A)) { msk |= 0x08; state->m_debugsprites = 1;} \ + if (screen.machine().input().code_pressed(KEYCODE_S)) { msk |= 0x08; state->m_debugsprites = 2;} \ + if (screen.machine().input().code_pressed(KEYCODE_D)) { msk |= 0x08; state->m_debugsprites = 3;} \ + if (screen.machine().input().code_pressed(KEYCODE_F)) { msk |= 0x08; state->m_debugsprites = 4;} \ + if (screen.machine().input().code_pressed(KEYCODE_R)) { msk |= 0x10;} \ + if (screen.machine().input().code_pressed(KEYCODE_T)) { msk |= 0x20;} \ \ if (msk != 0) state->m_active_layers &= msk; \ } \ \ { \ - if ( screen->machine().input().code_pressed(KEYCODE_Z) && screen->machine().input().code_pressed_once(KEYCODE_U) ) \ + if ( screen.machine().input().code_pressed(KEYCODE_Z) && screen.machine().input().code_pressed_once(KEYCODE_U) ) \ state->m_show_unknown ^= 1; \ if (state->m_show_unknown) \ popmessage("0:%04X 2:%04X 4:%04X 6:%04X c:%04X", \ @@ -1243,7 +1243,7 @@ if ( screen->machine().input().code_pressed(KEYCODE_Z) || screen->machine().inpu SCREEN_UPDATE( bigrun ) { - cischeat_state *state = screen->machine().driver_data(); + cischeat_state *state = screen.machine().driver_data(); int i; int active_layers1, flag; @@ -1269,8 +1269,8 @@ SCREEN_UPDATE( bigrun ) for (i = 7; i >= 4; i--) { /* bitmap, road, min_priority, max_priority, transparency */ - if (state->m_active_layers & 0x10) cischeat_draw_road(screen->machine(),bitmap,cliprect,0,i,i,FALSE); - if (state->m_active_layers & 0x20) cischeat_draw_road(screen->machine(),bitmap,cliprect,1,i,i,TRUE); + if (state->m_active_layers & 0x10) cischeat_draw_road(screen.machine(),bitmap,cliprect,0,i,i,FALSE); + if (state->m_active_layers & 0x20) cischeat_draw_road(screen.machine(),bitmap,cliprect,1,i,i,TRUE); } flag = 0; @@ -1279,11 +1279,11 @@ SCREEN_UPDATE( bigrun ) for (i = 3; i >= 0; i--) { /* bitmap, road, min_priority, max_priority, transparency */ - if (state->m_active_layers & 0x10) cischeat_draw_road(screen->machine(),bitmap,cliprect,0,i,i,TRUE); - if (state->m_active_layers & 0x20) cischeat_draw_road(screen->machine(),bitmap,cliprect,1,i,i,TRUE); + if (state->m_active_layers & 0x10) cischeat_draw_road(screen.machine(),bitmap,cliprect,0,i,i,TRUE); + if (state->m_active_layers & 0x20) cischeat_draw_road(screen.machine(),bitmap,cliprect,1,i,i,TRUE); } - if (state->m_active_layers & 0x08) bigrun_draw_sprites(screen->machine(),bitmap,cliprect,15,0); + if (state->m_active_layers & 0x08) bigrun_draw_sprites(screen.machine(),bitmap,cliprect,15,0); cischeat_tmap_DRAW(2) @@ -1298,7 +1298,7 @@ SCREEN_UPDATE( bigrun ) SCREEN_UPDATE( cischeat ) { - cischeat_state *state = screen->machine().driver_data(); + cischeat_state *state = screen.machine().driver_data(); int active_layers1, flag; #ifdef MAME_DEBUG @@ -1322,25 +1322,25 @@ SCREEN_UPDATE( cischeat ) bitmap_fill(bitmap,cliprect,0); /* bitmap, road, priority, transparency */ - if (state->m_active_layers & 0x10) cischeat_draw_road(screen->machine(),bitmap,cliprect,0,7,5,FALSE); - if (state->m_active_layers & 0x20) cischeat_draw_road(screen->machine(),bitmap,cliprect,1,7,5,TRUE); + if (state->m_active_layers & 0x10) cischeat_draw_road(screen.machine(),bitmap,cliprect,0,7,5,FALSE); + if (state->m_active_layers & 0x20) cischeat_draw_road(screen.machine(),bitmap,cliprect,1,7,5,TRUE); flag = 0; cischeat_tmap_DRAW(0) // else bitmap_fill(bitmap,cliprect,0); cischeat_tmap_DRAW(1) - if (state->m_active_layers & 0x08) cischeat_draw_sprites(screen->machine(),bitmap,cliprect,15,3); - if (state->m_active_layers & 0x10) cischeat_draw_road(screen->machine(),bitmap,cliprect,0,4,1,TRUE); - if (state->m_active_layers & 0x20) cischeat_draw_road(screen->machine(),bitmap,cliprect,1,4,1,TRUE); - if (state->m_active_layers & 0x08) cischeat_draw_sprites(screen->machine(),bitmap,cliprect,2,2); - if (state->m_active_layers & 0x10) cischeat_draw_road(screen->machine(),bitmap,cliprect,0,0,0,TRUE); - if (state->m_active_layers & 0x20) cischeat_draw_road(screen->machine(),bitmap,cliprect,1,0,0,TRUE); - if (state->m_active_layers & 0x08) cischeat_draw_sprites(screen->machine(),bitmap,cliprect,1,0); + if (state->m_active_layers & 0x08) cischeat_draw_sprites(screen.machine(),bitmap,cliprect,15,3); + if (state->m_active_layers & 0x10) cischeat_draw_road(screen.machine(),bitmap,cliprect,0,4,1,TRUE); + if (state->m_active_layers & 0x20) cischeat_draw_road(screen.machine(),bitmap,cliprect,1,4,1,TRUE); + if (state->m_active_layers & 0x08) cischeat_draw_sprites(screen.machine(),bitmap,cliprect,2,2); + if (state->m_active_layers & 0x10) cischeat_draw_road(screen.machine(),bitmap,cliprect,0,0,0,TRUE); + if (state->m_active_layers & 0x20) cischeat_draw_road(screen.machine(),bitmap,cliprect,1,0,0,TRUE); + if (state->m_active_layers & 0x08) cischeat_draw_sprites(screen.machine(),bitmap,cliprect,1,0); cischeat_tmap_DRAW(2) /* for the map screen */ - if (state->m_active_layers & 0x08) cischeat_draw_sprites(screen->machine(),bitmap,cliprect,0+16,0+16); + if (state->m_active_layers & 0x08) cischeat_draw_sprites(screen.machine(),bitmap,cliprect,0+16,0+16); state->m_active_layers = active_layers1; @@ -1355,7 +1355,7 @@ SCREEN_UPDATE( cischeat ) SCREEN_UPDATE( f1gpstar ) { - cischeat_state *state = screen->machine().driver_data(); + cischeat_state *state = screen.machine().driver_data(); int active_layers1, flag; #ifdef MAME_DEBUG @@ -1381,8 +1381,8 @@ SCREEN_UPDATE( f1gpstar ) /* 1: clouds 5, grad 7, road 0 2: clouds 5, grad 7, road 0, tunnel roof 0 */ /* road 1!! 0!! */ /* bitmap, road, min_priority, max_priority, transparency */ - if (state->m_active_layers & 0x20) f1gpstar_draw_road(screen->machine(),bitmap,cliprect,1,6,7,TRUE); - if (state->m_active_layers & 0x10) f1gpstar_draw_road(screen->machine(),bitmap,cliprect,0,6,7,TRUE); + if (state->m_active_layers & 0x20) f1gpstar_draw_road(screen.machine(),bitmap,cliprect,1,6,7,TRUE); + if (state->m_active_layers & 0x10) f1gpstar_draw_road(screen.machine(),bitmap,cliprect,0,6,7,TRUE); flag = 0; cischeat_tmap_DRAW(0) @@ -1390,18 +1390,18 @@ SCREEN_UPDATE( f1gpstar ) cischeat_tmap_DRAW(1) /* road 1!! 0!! */ /* bitmap, road, min_priority, max_priority, transparency */ - if (state->m_active_layers & 0x20) f1gpstar_draw_road(screen->machine(),bitmap,cliprect,1,1,5,TRUE); - if (state->m_active_layers & 0x10) f1gpstar_draw_road(screen->machine(),bitmap,cliprect,0,1,5,TRUE); + if (state->m_active_layers & 0x20) f1gpstar_draw_road(screen.machine(),bitmap,cliprect,1,1,5,TRUE); + if (state->m_active_layers & 0x10) f1gpstar_draw_road(screen.machine(),bitmap,cliprect,0,1,5,TRUE); - if (state->m_active_layers & 0x08) cischeat_draw_sprites(screen->machine(),bitmap,cliprect,15,2); + if (state->m_active_layers & 0x08) cischeat_draw_sprites(screen.machine(),bitmap,cliprect,15,2); /* road 1!! 0!! */ /* bitmap, road, min_priority, max_priority, transparency */ - if (state->m_active_layers & 0x20) f1gpstar_draw_road(screen->machine(),bitmap,cliprect,1,0,0,TRUE); - if (state->m_active_layers & 0x10) f1gpstar_draw_road(screen->machine(),bitmap,cliprect,0,0,0,TRUE); + if (state->m_active_layers & 0x20) f1gpstar_draw_road(screen.machine(),bitmap,cliprect,1,0,0,TRUE); + if (state->m_active_layers & 0x10) f1gpstar_draw_road(screen.machine(),bitmap,cliprect,0,0,0,TRUE); - if (state->m_active_layers & 0x08) cischeat_draw_sprites(screen->machine(),bitmap,cliprect,1,1); + if (state->m_active_layers & 0x08) cischeat_draw_sprites(screen.machine(),bitmap,cliprect,1,1); cischeat_tmap_DRAW(2) - if (state->m_active_layers & 0x08) cischeat_draw_sprites(screen->machine(),bitmap,cliprect,0,0); + if (state->m_active_layers & 0x08) cischeat_draw_sprites(screen.machine(),bitmap,cliprect,0,0); state->m_active_layers = active_layers1; @@ -1416,28 +1416,28 @@ SCREEN_UPDATE( f1gpstar ) SCREEN_UPDATE( scudhamm ) { - cischeat_state *state = screen->machine().driver_data(); + cischeat_state *state = screen.machine().driver_data(); int active_layers1, flag; active_layers1 = state->m_active_layers; state->m_active_layers = 0x0d; #ifdef MAME_DEBUG state->m_debugsprites = 0; -if ( screen->machine().input().code_pressed(KEYCODE_Z) || screen->machine().input().code_pressed(KEYCODE_X) ) +if ( screen.machine().input().code_pressed(KEYCODE_Z) || screen.machine().input().code_pressed(KEYCODE_X) ) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) { msk |= 0x1;} - if (screen->machine().input().code_pressed(KEYCODE_W)) { msk |= 0x2;} - if (screen->machine().input().code_pressed(KEYCODE_E)) { msk |= 0x4;} - if (screen->machine().input().code_pressed(KEYCODE_A)) { msk |= 0x8; state->m_debugsprites = 1;} - if (screen->machine().input().code_pressed(KEYCODE_S)) { msk |= 0x8; state->m_debugsprites = 2;} - if (screen->machine().input().code_pressed(KEYCODE_D)) { msk |= 0x8; state->m_debugsprites = 3;} - if (screen->machine().input().code_pressed(KEYCODE_F)) { msk |= 0x8; state->m_debugsprites = 4;} + if (screen.machine().input().code_pressed(KEYCODE_Q)) { msk |= 0x1;} + if (screen.machine().input().code_pressed(KEYCODE_W)) { msk |= 0x2;} + if (screen.machine().input().code_pressed(KEYCODE_E)) { msk |= 0x4;} + if (screen.machine().input().code_pressed(KEYCODE_A)) { msk |= 0x8; state->m_debugsprites = 1;} + if (screen.machine().input().code_pressed(KEYCODE_S)) { msk |= 0x8; state->m_debugsprites = 2;} + if (screen.machine().input().code_pressed(KEYCODE_D)) { msk |= 0x8; state->m_debugsprites = 3;} + if (screen.machine().input().code_pressed(KEYCODE_F)) { msk |= 0x8; state->m_debugsprites = 4;} if (msk != 0) state->m_active_layers &= msk; #if 1 { - address_space *space = screen->machine().device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); popmessage("Cmd: %04X Pos:%04X Lim:%04X Inp:%04X", state->m_scudhamm_motor_command, @@ -1458,7 +1458,7 @@ if ( screen->machine().input().code_pressed(KEYCODE_Z) || screen->machine().inpu flag = 0; cischeat_tmap_DRAW(0) // no layer 1 - if (state->m_active_layers & 0x08) cischeat_draw_sprites(screen->machine(),bitmap,cliprect,0,15); + if (state->m_active_layers & 0x08) cischeat_draw_sprites(screen.machine(),bitmap,cliprect,0,15); cischeat_tmap_DRAW(2) state->m_active_layers = active_layers1; diff --git a/src/mame/video/citycon.c b/src/mame/video/citycon.c index 784258fa457..ea39462eb29 100644 --- a/src/mame/video/citycon.c +++ b/src/mame/video/citycon.c @@ -142,7 +142,7 @@ INLINE void changecolor_RRRRGGGGBBBBxxxx( running_machine &machine, int color, i SCREEN_UPDATE( citycon ) { - citycon_state *state = screen->machine().driver_data(); + citycon_state *state = screen.machine().driver_data(); int offs, scroll; /* Update the virtual palette to support text color code changing on every scanline. */ @@ -152,7 +152,7 @@ SCREEN_UPDATE( citycon ) int i; for (i = 0; i < 4; i++) - changecolor_RRRRGGGGBBBBxxxx(screen->machine(), 640 + 4 * offs + i, 512 + 4 * indx + i); + changecolor_RRRRGGGGBBBBxxxx(screen.machine(), 640 + 4 * offs + i, 512 + 4 * indx + i); } @@ -163,6 +163,6 @@ SCREEN_UPDATE( citycon ) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/cloak.c b/src/mame/video/cloak.c index 0c4d1421c7f..1fbb4fdde09 100644 --- a/src/mame/video/cloak.c +++ b/src/mame/video/cloak.c @@ -231,10 +231,10 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( cloak ) { - cloak_state *state = screen->machine().driver_data(); - set_pens(screen->machine()); + cloak_state *state = screen.machine().driver_data(); + set_pens(screen.machine()); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_bitmap(screen->machine(), bitmap, cliprect); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_bitmap(screen.machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/cloud9.c b/src/mame/video/cloud9.c index abd5198b2fc..10be7455ad2 100644 --- a/src/mame/video/cloud9.c +++ b/src/mame/video/cloud9.c @@ -249,10 +249,10 @@ WRITE8_HANDLER( cloud9_bitmode_addr_w ) SCREEN_UPDATE( cloud9 ) { - cloud9_state *state = screen->machine().driver_data(); + cloud9_state *state = screen.machine().driver_data(); UINT8 *spriteaddr = state->m_spriteram; int flip = state->m_video_control[5] ? 0xff : 0x00; /* PLAYER2 */ - pen_t black = get_black_pen(screen->machine()); + pen_t black = get_black_pen(screen.machine()); int x, y, offs; /* draw the sprites */ @@ -267,9 +267,9 @@ SCREEN_UPDATE( cloud9 ) int which = spriteaddr[offs + 0x20]; int color = 0; - drawgfx_transpen(state->m_spritebitmap, cliprect, screen->machine().gfx[0], which, color, xflip, yflip, x, y, 0); + drawgfx_transpen(state->m_spritebitmap, cliprect, screen.machine().gfx[0], which, color, xflip, yflip, x, y, 0); if (x >= 256 - 16) - drawgfx_transpen(state->m_spritebitmap, cliprect, screen->machine().gfx[0], which, color, xflip, yflip, x - 256, y, 0); + drawgfx_transpen(state->m_spritebitmap, cliprect, screen.machine().gfx[0], which, color, xflip, yflip, x - 256, y, 0); } /* draw the bitmap to the screen, looping over Y */ diff --git a/src/mame/video/clshroad.c b/src/mame/video/clshroad.c index 697768b5404..0f946d50c45 100644 --- a/src/mame/video/clshroad.c +++ b/src/mame/video/clshroad.c @@ -329,7 +329,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( clshroad ) { - clshroad_state *state = screen->machine().driver_data(); + clshroad_state *state = screen.machine().driver_data(); int scrollx = state->m_vregs[ 0 ] + (state->m_vregs[ 1 ] << 8); // int priority = state->m_vregs[ 2 ]; @@ -339,7 +339,7 @@ SCREEN_UPDATE( clshroad ) tilemap_draw(bitmap,cliprect,state->m_tilemap_0a,0,0); // Opaque tilemap_draw(bitmap,cliprect,state->m_tilemap_0b,0,0); - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_tilemap_1,0,0); return 0; } diff --git a/src/mame/video/cninja.c b/src/mame/video/cninja.c index 7864ade634d..57813bf4514 100644 --- a/src/mame/video/cninja.c +++ b/src/mame/video/cninja.c @@ -126,72 +126,72 @@ static void cninjabl_draw_sprites( running_machine &machine, bitmap_t *bitmap, c SCREEN_UPDATE( cninja ) { - cninja_state *state = screen->machine().driver_data(); + cninja_state *state = screen.machine().driver_data(); UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); - flip_screen_set(screen->machine(), BIT(flip, 7)); + flip_screen_set(screen.machine(), BIT(flip, 7)); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); /* Draw playfields */ - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 512); deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 2); deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 2); deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 4); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0x400); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u16, 0x400); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; } SCREEN_UPDATE( cninjabl ) { - cninja_state *state = screen->machine().driver_data(); + cninja_state *state = screen.machine().driver_data(); UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); /* force layers to be enabled */ deco16ic_set_enable(state->m_deco_tilegen2, 0, 1 ); deco16ic_set_enable(state->m_deco_tilegen2, 1, 1 ); - flip_screen_set(screen->machine(), BIT(flip, 7)); + flip_screen_set(screen.machine(), BIT(flip, 7)); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); /* Draw playfields */ - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 512); deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 2); deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 2); deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 4); - cninjabl_draw_sprites(screen->machine(), bitmap, cliprect); + cninjabl_draw_sprites(screen.machine(), bitmap, cliprect); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; } SCREEN_UPDATE( edrandy ) { - cninja_state *state = screen->machine().driver_data(); + cninja_state *state = screen.machine().driver_data(); UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); - flip_screen_set(screen->machine(), BIT(flip, 7)); + flip_screen_set(screen.machine(), BIT(flip, 7)); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 2); deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 4); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0x400); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u16, 0x400); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; } SCREEN_UPDATE( robocop2 ) { - cninja_state *state = screen->machine().driver_data(); + cninja_state *state = screen.machine().driver_data(); UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); UINT16 priority = decocomn_priority_r(state->m_decocomn, 0, 0xffff); @@ -210,12 +210,12 @@ SCREEN_UPDATE( robocop2 ) } /* Update playfields */ - flip_screen_set(screen->machine(), BIT(flip, 7)); + flip_screen_set(screen.machine(), BIT(flip, 7)); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); /* Draw playfields */ - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0x200); if ((priority & 4) == 0) @@ -235,7 +235,7 @@ SCREEN_UPDATE( robocop2 ) break; } - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0x400); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u16, 0x400); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; } @@ -248,22 +248,22 @@ VIDEO_START( mutantf ) SCREEN_UPDATE( mutantf ) { - cninja_state *state = screen->machine().driver_data(); + cninja_state *state = screen.machine().driver_data(); UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); UINT16 priority = decocomn_priority_r(state->m_decocomn, 0, 0xffff); - flip_screen_set(screen->machine(), BIT(flip, 7)); + flip_screen_set(screen.machine(), BIT(flip, 7)); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); /* Draw playfields */ bitmap_fill(bitmap, cliprect, 0x400); /* Confirmed */ - screen->machine().device("spritegen1")->set_alt_format(true); - screen->machine().device("spritegen2")->set_alt_format(true); - screen->machine().device("spritegen2")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram2.u16, 0x400, true); - screen->machine().device("spritegen1")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0x400, true); + screen.machine().device("spritegen1")->set_alt_format(true); + screen.machine().device("spritegen2")->set_alt_format(true); + screen.machine().device("spritegen2")->draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram2.u16, 0x400, true); + screen.machine().device("spritegen1")->draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u16, 0x400, true); /* There is no priority prom on this board, but there is a @@ -284,13 +284,13 @@ SCREEN_UPDATE( mutantf ) if (priority & 1) { - screen->machine().device("spritegen1")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0000, 0x0000, 0x100, 0x1ff); - screen->machine().device("spritegen2")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0000, 0x0000, 1024+768, 0x0ff, 0x80); // fixed alpha of 0x80 for this layer? + screen.machine().device("spritegen1")->inefficient_copy_sprite_bitmap(screen.machine(), bitmap, cliprect, 0x0000, 0x0000, 0x100, 0x1ff); + screen.machine().device("spritegen2")->inefficient_copy_sprite_bitmap(screen.machine(), bitmap, cliprect, 0x0000, 0x0000, 1024+768, 0x0ff, 0x80); // fixed alpha of 0x80 for this layer? } else { - screen->machine().device("spritegen2")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0000, 0x0000, 1024+768, 0x0ff, 0x80); // fixed alpha of 0x80 for this layer? - screen->machine().device("spritegen1")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0000, 0x0000, 0x100, 0x1ff); + screen.machine().device("spritegen2")->inefficient_copy_sprite_bitmap(screen.machine(), bitmap, cliprect, 0x0000, 0x0000, 1024+768, 0x0ff, 0x80); // fixed alpha of 0x80 for this layer? + screen.machine().device("spritegen1")->inefficient_copy_sprite_bitmap(screen.machine(), bitmap, cliprect, 0x0000, 0x0000, 0x100, 0x1ff); } deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/video/combatsc.c b/src/mame/video/combatsc.c index 4d23c2aeca5..15876aa1ce3 100644 --- a/src/mame/video/combatsc.c +++ b/src/mame/video/combatsc.c @@ -405,10 +405,10 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( combatsc ) { - combatsc_state *state = screen->machine().driver_data(); + combatsc_state *state = screen.machine().driver_data(); int i; - set_pens(screen->machine()); + set_pens(screen.machine()); if (k007121_ctrlram_r(state->m_k007121_1, 1) & 0x02) { @@ -437,7 +437,7 @@ SCREEN_UPDATE( combatsc ) tilemap_set_scrolly(state->m_bg_tilemap[0], 0, k007121_ctrlram_r(state->m_k007121_1, 2)); tilemap_set_scrolly(state->m_bg_tilemap[1], 0, k007121_ctrlram_r(state->m_k007121_2, 2)); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); if (state->m_priority == 0) { @@ -447,8 +447,8 @@ SCREEN_UPDATE( combatsc ) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[0], 1, 2); /* we use the priority buffer so sprites are drawn front to back */ - draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram[1], 1, 0x0f00); - draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram[0], 0, 0x4444); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram[1], 1, 0x0f00); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram[0], 0, 0x4444); } else { @@ -458,8 +458,8 @@ SCREEN_UPDATE( combatsc ) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[1], 0, 8); /* we use the priority buffer so sprites are drawn front to back */ - draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram[1], 1, 0x0f00); - draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram[0], 0, 0x4444); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram[1], 1, 0x0f00); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram[0], 0, 0x4444); } if (k007121_ctrlram_r(state->m_k007121_1, 1) & 0x08) @@ -563,10 +563,10 @@ static void bootleg_draw_sprites( running_machine &machine, bitmap_t *bitmap, co SCREEN_UPDATE( combatscb ) { - combatsc_state *state = screen->machine().driver_data(); + combatsc_state *state = screen.machine().driver_data(); int i; - set_pens(screen->machine()); + set_pens(screen.machine()); for (i = 0; i < 32; i++) { @@ -579,16 +579,16 @@ SCREEN_UPDATE( combatscb ) if (state->m_priority == 0) { tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[1], TILEMAP_DRAW_OPAQUE, 0); - bootleg_draw_sprites(screen->machine(), bitmap,cliprect, state->m_page[0], 0); + bootleg_draw_sprites(screen.machine(), bitmap,cliprect, state->m_page[0], 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[0], 0 ,0); - bootleg_draw_sprites(screen->machine(), bitmap,cliprect, state->m_page[1], 1); + bootleg_draw_sprites(screen.machine(), bitmap,cliprect, state->m_page[1], 1); } else { tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[0], TILEMAP_DRAW_OPAQUE, 0); - bootleg_draw_sprites(screen->machine(), bitmap,cliprect, state->m_page[0], 0); + bootleg_draw_sprites(screen.machine(), bitmap,cliprect, state->m_page[0], 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[1], 0, 0); - bootleg_draw_sprites(screen->machine(), bitmap,cliprect, state->m_page[1], 1); + bootleg_draw_sprites(screen.machine(), bitmap,cliprect, state->m_page[1], 1); } tilemap_draw(bitmap, cliprect, state->m_textlayer, 0, 0); diff --git a/src/mame/video/commando.c b/src/mame/video/commando.c index 1ee57ce31d8..69013ce6508 100644 --- a/src/mame/video/commando.c +++ b/src/mame/video/commando.c @@ -137,17 +137,17 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( commando ) { - commando_state *state = screen->machine().driver_data(); + commando_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } SCREEN_EOF( commando ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram_w(space, 0, 0); } diff --git a/src/mame/video/compgolf.c b/src/mame/video/compgolf.c index c904890d0e9..e3c821231b5 100644 --- a/src/mame/video/compgolf.c +++ b/src/mame/video/compgolf.c @@ -120,7 +120,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( compgolf ) { - compgolf_state *state = screen->machine().driver_data(); + compgolf_state *state = screen.machine().driver_data(); int scrollx = state->m_scrollx_hi + state->m_scrollx_lo; int scrolly = state->m_scrolly_hi + state->m_scrolly_lo; @@ -129,6 +129,6 @@ SCREEN_UPDATE( compgolf ) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_text_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/contra.c b/src/mame/video/contra.c index 4311ab7d6c1..6d68646186a 100644 --- a/src/mame/video/contra.c +++ b/src/mame/video/contra.c @@ -318,7 +318,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( contra ) { - contra_state *state = screen->machine().driver_data(); + contra_state *state = screen.machine().driver_data(); UINT8 ctrl_1_0 = k007121_ctrlram_r(state->m_k007121_1, 0); UINT8 ctrl_1_2 = k007121_ctrlram_r(state->m_k007121_1, 2); UINT8 ctrl_2_0 = k007121_ctrlram_r(state->m_k007121_2, 0); @@ -331,7 +331,7 @@ SCREEN_UPDATE( contra ) sect_rect(&fg_finalclip, cliprect); sect_rect(&tx_finalclip, cliprect); - set_pens(screen->machine()); + set_pens(screen.machine()); tilemap_set_scrollx(state->m_fg_tilemap, 0, ctrl_1_0 - 40); tilemap_set_scrolly(state->m_fg_tilemap, 0, ctrl_1_2); @@ -340,8 +340,8 @@ SCREEN_UPDATE( contra ) tilemap_draw(bitmap, &bg_finalclip, state->m_bg_tilemap, 0 ,0); tilemap_draw(bitmap, &fg_finalclip, state->m_fg_tilemap, 0 ,0); - draw_sprites(screen->machine(),bitmap,cliprect, 0); - draw_sprites(screen->machine(),bitmap,cliprect, 1); + draw_sprites(screen.machine(),bitmap,cliprect, 0); + draw_sprites(screen.machine(),bitmap,cliprect, 1); tilemap_draw(bitmap, &tx_finalclip, state->m_tx_tilemap, 0 ,0); return 0; } diff --git a/src/mame/video/cop01.c b/src/mame/video/cop01.c index 5d94d85be5b..98cb6f8cc60 100644 --- a/src/mame/video/cop01.c +++ b/src/mame/video/cop01.c @@ -208,12 +208,12 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( cop01 ) { - cop01_state *state = screen->machine().driver_data(); + cop01_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_vreg[1] + 256 * (state->m_vreg[2] & 1)); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_vreg[3]); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0 ); return 0; diff --git a/src/mame/video/copsnrob.c b/src/mame/video/copsnrob.c index 73eaac6104c..111fd6b0ed5 100644 --- a/src/mame/video/copsnrob.c +++ b/src/mame/video/copsnrob.c @@ -10,7 +10,7 @@ SCREEN_UPDATE( copsnrob ) { - copsnrob_state *state = screen->machine().driver_data(); + copsnrob_state *state = screen.machine().driver_data(); int offs, x, y; /* redrawing the entire display is faster in this case */ @@ -22,7 +22,7 @@ SCREEN_UPDATE( copsnrob ) sx = 31 - (offs % 32); sy = offs / 32; - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0], state->m_videoram[offs] & 0x3f,0, 0,0, 8*sx,8*sy); @@ -31,25 +31,25 @@ SCREEN_UPDATE( copsnrob ) /* Draw the cars. Positioning was based on a screen shot */ if (state->m_cary[0]) - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1], state->m_carimage[0],0, 1,0, 0xe4,256 - state->m_cary[0],0); if (state->m_cary[1]) - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1], state->m_carimage[1],0, 1,0, 0xc4,256 - state->m_cary[1],0); if (state->m_cary[2]) - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1], state->m_carimage[2],0, 0,0, 0x24,256 - state->m_cary[2],0); if (state->m_cary[3]) - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1], state->m_carimage[3],0, 0,0, 0x04,256 - state->m_cary[3],0); @@ -78,7 +78,7 @@ SCREEN_UPDATE( copsnrob ) { /* We've hit a truck's back end, so draw the truck. The front end may be off the top of the screen, but we don't care. */ - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[2], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[2], 0,0, 0,0, 0x80,256 - (y + 31),0); @@ -90,7 +90,7 @@ SCREEN_UPDATE( copsnrob ) { /* We missed a truck's back end (it was off the bottom of the screen) but have hit its front end, so draw the truck. */ - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[2], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[2], 0,0, 0,0, 0x80,256 - y,0); diff --git a/src/mame/video/cosmic.c b/src/mame/video/cosmic.c index 1f24e9a14b3..7062ebe9862 100644 --- a/src/mame/video/cosmic.c +++ b/src/mame/video/cosmic.c @@ -317,11 +317,11 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect } -static void cosmica_draw_starfield( screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect ) +static void cosmica_draw_starfield( screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect ) { UINT8 y = 0; UINT8 map = 0; - UINT8 *PROM = screen->machine().region("user2")->base(); + UINT8 *PROM = screen.machine().region("user2")->base(); while (1) { @@ -335,10 +335,10 @@ static void cosmica_draw_starfield( screen_device *screen, bitmap_t *bitmap, con UINT8 x1; int hc, hb_; - if (flip_screen_get(screen->machine())) - x1 = x - screen->frame_number(); + if (flip_screen_get(screen.machine())) + x1 = x - screen.frame_number(); else - x1 = x + screen->frame_number(); + x1 = x + screen.frame_number(); hc = (x1 >> 2) & 0x01; hb_ = (x >> 5) & 0x01; /* not a bug, this one is the real x */ @@ -424,11 +424,11 @@ static void devzone_draw_grid( running_machine &machine, bitmap_t *bitmap, const } -static void nomnlnd_draw_background( screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect ) +static void nomnlnd_draw_background( screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect ) { UINT8 y = 0; - UINT8 water = screen->frame_number(); - UINT8 *PROM = screen->machine().region("user2")->base(); + UINT8 water = screen.frame_number(); + UINT8 *PROM = screen.machine().region("user2")->base(); /* all positioning is via logic gates: @@ -491,7 +491,7 @@ static void nomnlnd_draw_background( screen_device *screen, bitmap_t *bitmap, co if ((!hd_) & hc_ & (!hb_)) { offs_t offs = ((x >> 3) & 0x03) | ((y & 0x1f) << 2) | - (flip_screen_get(screen->machine()) ? 0x80 : 0); + (flip_screen_get(screen.machine()) ? 0x80 : 0); UINT8 plane1 = PROM[offs ] << (x & 0x07); UINT8 plane2 = PROM[offs | 0x0400] << (x & 0x07); @@ -525,7 +525,7 @@ static void nomnlnd_draw_background( screen_device *screen, bitmap_t *bitmap, co if (color != 0) { - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) *BITMAP_ADDR16(bitmap, 255-y, 255-x) = color; else *BITMAP_ADDR16(bitmap, y, x) = color; @@ -549,7 +549,7 @@ static void nomnlnd_draw_background( screen_device *screen, bitmap_t *bitmap, co SCREEN_UPDATE( cosmicg ) { bitmap_fill(bitmap, cliprect, 0); - draw_bitmap(screen->machine(), bitmap, cliprect); + draw_bitmap(screen.machine(), bitmap, cliprect); return 0; } @@ -557,8 +557,8 @@ SCREEN_UPDATE( cosmicg ) SCREEN_UPDATE( panic ) { bitmap_fill(bitmap, cliprect, 0); - draw_bitmap(screen->machine(), bitmap, cliprect); - draw_sprites(screen->machine(), bitmap, cliprect, 0x07, 1); + draw_bitmap(screen.machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect, 0x07, 1); return 0; } @@ -567,8 +567,8 @@ SCREEN_UPDATE( cosmica ) { bitmap_fill(bitmap, cliprect, 0); cosmica_draw_starfield(screen, bitmap, cliprect); - draw_bitmap(screen->machine(), bitmap, cliprect); - draw_sprites(screen->machine(), bitmap, cliprect, 0x0f, 0); + draw_bitmap(screen.machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect, 0x0f, 0); return 0; } @@ -576,37 +576,37 @@ SCREEN_UPDATE( cosmica ) SCREEN_UPDATE( magspot ) { bitmap_fill(bitmap, cliprect, 0); - draw_bitmap(screen->machine(), bitmap, cliprect); - draw_sprites(screen->machine(), bitmap, cliprect, 0x07, 0); + draw_bitmap(screen.machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect, 0x07, 0); return 0; } SCREEN_UPDATE( devzone ) { - cosmic_state *state = screen->machine().driver_data(); + cosmic_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, 0); if (state->m_background_enable) - devzone_draw_grid(screen->machine(), bitmap, cliprect); + devzone_draw_grid(screen.machine(), bitmap, cliprect); - draw_bitmap(screen->machine(), bitmap, cliprect); - draw_sprites(screen->machine(), bitmap, cliprect, 0x07, 0); + draw_bitmap(screen.machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect, 0x07, 0); return 0; } SCREEN_UPDATE( nomnlnd ) { - cosmic_state *state = screen->machine().driver_data(); + cosmic_state *state = screen.machine().driver_data(); /* according to the video summation logic on pg4, the trees and river have the highest priority */ bitmap_fill(bitmap, cliprect, 0); - draw_bitmap(screen->machine(), bitmap, cliprect); - draw_sprites(screen->machine(), bitmap, cliprect, 0x07, 0); + draw_bitmap(screen.machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect, 0x07, 0); if (state->m_background_enable) nomnlnd_draw_background(screen, bitmap, cliprect); diff --git a/src/mame/video/cps1.c b/src/mame/video/cps1.c index e2baa7917f9..8d45f979207 100644 --- a/src/mame/video/cps1.c +++ b/src/mame/video/cps1.c @@ -2690,11 +2690,11 @@ static void cps2_render_sprites( running_machine &machine, bitmap_t *bitmap, con -static void cps1_render_stars( screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect ) +static void cps1_render_stars( screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect ) { - cps_state *state = screen->machine().driver_data(); + cps_state *state = screen.machine().driver_data(); int offs; - UINT8 *stars_rom = screen->machine().region("stars")->base(); + UINT8 *stars_rom = screen.machine().region("stars")->base(); if (!stars_rom && (state->m_stars_enabled[0] || state->m_stars_enabled[1])) { @@ -2715,13 +2715,13 @@ static void cps1_render_stars( screen_device *screen, bitmap_t *bitmap, const re int sy = (offs % 256); sx = (sx - state->m_stars2x + (col & 0x1f)) & 0x1ff; sy = (sy - state->m_stars2y) & 0xff; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { sx = 511 - sx; sy = 255 - sy; } - col = ((col & 0xe0) >> 1) + (screen->frame_number() / 16 & 0x0f); + col = ((col & 0xe0) >> 1) + (screen.frame_number() / 16 & 0x0f); if (sx >= cliprect->min_x && sx <= cliprect->max_x && sy >= cliprect->min_y && sy <= cliprect->max_y) @@ -2741,13 +2741,13 @@ static void cps1_render_stars( screen_device *screen, bitmap_t *bitmap, const re int sy = (offs % 256); sx = (sx - state->m_stars1x + (col & 0x1f)) & 0x1ff; sy = (sy - state->m_stars1y) & 0xff; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { sx = 511 - sx; sy = 255 - sy; } - col = ((col & 0xe0) >> 1) + (screen->frame_number() / 16 & 0x0f); + col = ((col & 0xe0) >> 1) + (screen.frame_number() / 16 & 0x0f); if (sx >= cliprect->min_x && sx <= cliprect->max_x && sy >= cliprect->min_y && sy <= cliprect->max_y) @@ -2799,26 +2799,26 @@ static void cps1_render_high_layer( running_machine &machine, bitmap_t *bitmap, SCREEN_UPDATE( cps1 ) { - cps_state *state = screen->machine().driver_data(); + cps_state *state = screen.machine().driver_data(); int layercontrol, l0, l1, l2, l3; int videocontrol = state->m_cps_a_regs[CPS1_VIDEOCONTROL]; - flip_screen_set(screen->machine(), videocontrol & 0x8000); + flip_screen_set(screen.machine(), videocontrol & 0x8000); layercontrol = state->m_cps_b_regs[state->m_game_config->layer_control / 2]; /* Get video memory base registers */ - cps1_get_video_base(screen->machine()); + cps1_get_video_base(screen.machine()); /* Find the offset of the last sprite in the sprite table */ - cps1_find_last_sprite(screen->machine()); + cps1_find_last_sprite(screen.machine()); if (state->m_cps_version == 2) { - cps2_find_last_sprite(screen->machine()); + cps2_find_last_sprite(screen.machine()); } - cps1_update_transmasks(screen->machine()); + cps1_update_transmasks(screen.machine()); tilemap_set_scrollx(state->m_bg_tilemap[0], 0, state->m_scroll1x); tilemap_set_scrolly(state->m_bg_tilemap[0], 0, state->m_scroll1y); @@ -2860,7 +2860,7 @@ SCREEN_UPDATE( cps1 ) // Maybe Capcom changed the background handling due to the problems that // it caused on several monitors (because the background extended into the // blanking area instead of going black, causing the monitor to clip). - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); } cps1_render_stars(screen, bitmap, cliprect); @@ -2870,26 +2870,26 @@ SCREEN_UPDATE( cps1 ) l1 = (layercontrol >> 0x08) & 03; l2 = (layercontrol >> 0x0a) & 03; l3 = (layercontrol >> 0x0c) & 03; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); if (state->m_cps_version == 1) { - cps1_render_layer(screen->machine(), bitmap, cliprect, l0, 0); + cps1_render_layer(screen.machine(), bitmap, cliprect, l0, 0); if (l1 == 0) - cps1_render_high_layer(screen->machine(), bitmap, cliprect, l0); /* prepare mask for sprites */ + cps1_render_high_layer(screen.machine(), bitmap, cliprect, l0); /* prepare mask for sprites */ - cps1_render_layer(screen->machine(), bitmap, cliprect, l1, 0); + cps1_render_layer(screen.machine(), bitmap, cliprect, l1, 0); if (l2 == 0) - cps1_render_high_layer(screen->machine(), bitmap, cliprect, l1); /* prepare mask for sprites */ + cps1_render_high_layer(screen.machine(), bitmap, cliprect, l1); /* prepare mask for sprites */ - cps1_render_layer(screen->machine(), bitmap, cliprect, l2, 0); + cps1_render_layer(screen.machine(), bitmap, cliprect, l2, 0); if (l3 == 0) - cps1_render_high_layer(screen->machine(), bitmap, cliprect, l2); /* prepare mask for sprites */ + cps1_render_high_layer(screen.machine(), bitmap, cliprect, l2); /* prepare mask for sprites */ - cps1_render_layer(screen->machine(), bitmap, cliprect, l3, 0); + cps1_render_layer(screen.machine(), bitmap, cliprect, l3, 0); } else { @@ -2901,15 +2901,15 @@ SCREEN_UPDATE( cps1 ) l3pri = (state->m_pri_ctrl >> 4 * l3) & 0x0f; #if 0 -if ( (cps2_port(screen->machine(), CPS2_OBJ_BASE) != 0x7080 && cps2_port(screen->machine(), CPS2_OBJ_BASE) != 0x7000) || - cps2_port(screen->machine(), CPS2_OBJ_UK1) != 0x807d || - (cps2_port(screen->machine(), CPS2_OBJ_UK2) != 0x0000 && cps2_port(screen->machine(), CPS2_OBJ_UK2) != 0x1101 && cps2_port(screen->machine(), CPS2_OBJ_UK2) != 0x0001)) +if ( (cps2_port(screen.machine(), CPS2_OBJ_BASE) != 0x7080 && cps2_port(screen.machine(), CPS2_OBJ_BASE) != 0x7000) || + cps2_port(screen.machine(), CPS2_OBJ_UK1) != 0x807d || + (cps2_port(screen.machine(), CPS2_OBJ_UK2) != 0x0000 && cps2_port(screen.machine(), CPS2_OBJ_UK2) != 0x1101 && cps2_port(screen.machine(), CPS2_OBJ_UK2) != 0x0001)) popmessage("base %04x uk1 %04x uk2 %04x", - cps2_port(screen->machine(), CPS2_OBJ_BASE), - cps2_port(screen->machine(), CPS2_OBJ_UK1), - cps2_port(screen->machine(), CPS2_OBJ_UK2)); + cps2_port(screen.machine(), CPS2_OBJ_BASE), + cps2_port(screen.machine(), CPS2_OBJ_UK1), + cps2_port(screen.machine(), CPS2_OBJ_UK2)); -if (0 && screen->machine().input().code_pressed(KEYCODE_Z)) +if (0 && screen.machine().input().code_pressed(KEYCODE_Z)) popmessage("order: %d (%d) %d (%d) %d (%d) %d (%d)",l0,l0pri,l1,l1pri,l2,l2pri,l3,l3pri); #endif @@ -2940,10 +2940,10 @@ if (0 && screen->machine().input().code_pressed(KEYCODE_Z)) } } - cps1_render_layer(screen->machine(), bitmap, cliprect, l0, 1); - cps1_render_layer(screen->machine(), bitmap, cliprect, l1, 2); - cps1_render_layer(screen->machine(), bitmap, cliprect, l2, 4); - cps2_render_sprites(screen->machine(), bitmap, cliprect, primasks); + cps1_render_layer(screen.machine(), bitmap, cliprect, l0, 1); + cps1_render_layer(screen.machine(), bitmap, cliprect, l1, 2); + cps1_render_layer(screen.machine(), bitmap, cliprect, l2, 4); + cps2_render_sprites(screen.machine(), bitmap, cliprect, primasks); } return 0; @@ -2951,10 +2951,10 @@ if (0 && screen->machine().input().code_pressed(KEYCODE_Z)) SCREEN_EOF( cps1 ) { - cps_state *state = machine.driver_data(); + cps_state *state = screen.machine().driver_data(); /* Get video memory base registers */ - cps1_get_video_base(machine); + cps1_get_video_base(screen.machine()); if (state->m_cps_version == 1) { diff --git a/src/mame/video/crbaloon.c b/src/mame/video/crbaloon.c index 661c29aca51..5c53208be46 100644 --- a/src/mame/video/crbaloon.c +++ b/src/mame/video/crbaloon.c @@ -150,10 +150,10 @@ static void draw_sprite_and_check_collision(running_machine &machine, bitmap_t * SCREEN_UPDATE( crbaloon ) { - crbaloon_state *state = screen->machine().driver_data(); + crbaloon_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprite_and_check_collision(screen->machine(), bitmap); + draw_sprite_and_check_collision(screen.machine(), bitmap); return 0; } diff --git a/src/mame/video/crgolf.c b/src/mame/video/crgolf.c index 97c9968de47..7d0f0f11d1a 100644 --- a/src/mame/video/crgolf.c +++ b/src/mame/video/crgolf.c @@ -113,13 +113,13 @@ static VIDEO_START( crgolf ) static SCREEN_UPDATE( crgolf ) { - crgolf_state *state = screen->machine().driver_data(); + crgolf_state *state = screen.machine().driver_data(); int flip = *state->m_screen_flip & 1; offs_t offs; pen_t pens[NUM_PENS]; - get_pens(screen->machine(), pens); + get_pens(screen.machine(), pens); /* for each byte in the video RAM */ for (offs = 0; offs < VIDEORAM_SIZE / 3; offs++) diff --git a/src/mame/video/crimfght.c b/src/mame/video/crimfght.c index 1763fa504d8..1aedd4a7847 100644 --- a/src/mame/video/crimfght.c +++ b/src/mame/video/crimfght.c @@ -79,7 +79,7 @@ VIDEO_START( crimfght ) SCREEN_UPDATE( crimfght ) { - crimfght_state *state = screen->machine().driver_data(); + crimfght_state *state = screen.machine().driver_data(); k052109_tilemap_update(state->m_k052109); diff --git a/src/mame/video/crospang.c b/src/mame/video/crospang.c index e7972eedbff..9f263dc3e38 100644 --- a/src/mame/video/crospang.c +++ b/src/mame/video/crospang.c @@ -217,9 +217,9 @@ VIDEO_START( crospang ) SCREEN_UPDATE( crospang ) { - crospang_state *state = screen->machine().driver_data(); + crospang_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_layer, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_layer, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/crshrace.c b/src/mame/video/crshrace.c index 87408b264a7..c299a83d461 100644 --- a/src/mame/video/crshrace.c +++ b/src/mame/video/crshrace.c @@ -187,11 +187,11 @@ static void draw_fg(running_machine &machine, bitmap_t *bitmap, const rectangle SCREEN_UPDATE( crshrace ) { - crshrace_state *state = screen->machine().driver_data(); + crshrace_state *state = screen.machine().driver_data(); if (state->m_gfxctrl & 0x04) /* display disable? */ { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } @@ -200,15 +200,15 @@ SCREEN_UPDATE( crshrace ) switch (state->m_gfxctrl & 0xfb) { case 0x00: /* high score screen */ - draw_sprites(screen->machine(), bitmap, cliprect); - draw_bg(screen->machine(), bitmap, cliprect); - draw_fg(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); + draw_bg(screen.machine(), bitmap, cliprect); + draw_fg(screen.machine(), bitmap, cliprect); break; case 0x01: case 0x02: - draw_bg(screen->machine(), bitmap, cliprect); - draw_fg(screen->machine(), bitmap, cliprect); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_bg(screen.machine(), bitmap, cliprect); + draw_fg(screen.machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); break; default: popmessage("gfxctrl = %02x", state->m_gfxctrl); @@ -219,7 +219,7 @@ SCREEN_UPDATE( crshrace ) SCREEN_EOF( crshrace ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram16_w(space, 0, 0, 0xffff); buffer_spriteram16_2_w(space, 0, 0, 0xffff); diff --git a/src/mame/video/cvs.c b/src/mame/video/cvs.c index adcacaa9904..198769d8931 100644 --- a/src/mame/video/cvs.c +++ b/src/mame/video/cvs.c @@ -189,13 +189,13 @@ void cvs_scroll_stars( running_machine &machine ) SCREEN_UPDATE( cvs ) { - cvs_state *state = screen->machine().driver_data(); + cvs_state *state = screen.machine().driver_data(); static const int ram_based_char_start_indices[] = { 0xe0, 0xc0, 0x100, 0x80 }; offs_t offs; int scroll[8]; bitmap_t *s2636_0_bitmap, *s2636_1_bitmap, *s2636_2_bitmap; - set_pens(screen->machine()); + set_pens(screen.machine()); /* draw the background */ for (offs = 0; offs < 0x0400; offs++) @@ -209,7 +209,7 @@ SCREEN_UPDATE( cvs ) int gfxnum = (code < ram_based_char_start_indices[state->m_character_banking_mode]) ? 0 : 1; - drawgfx_opaque(state->m_background_bitmap, 0, screen->machine().gfx[gfxnum], + drawgfx_opaque(state->m_background_bitmap, 0, screen.machine().gfx[gfxnum], code, color, 0, 0, x, y); @@ -225,7 +225,7 @@ SCREEN_UPDATE( cvs ) collision_color = 0x102; } - drawgfx_opaque(state->m_collision_background, 0, screen->machine().gfx[gfxnum], + drawgfx_opaque(state->m_collision_background, 0, screen.machine().gfx[gfxnum], code, collision_color, 0, 0, x, y); @@ -267,7 +267,7 @@ SCREEN_UPDATE( cvs ) state->m_collision_register |= 0x08; /* Bullet/Background Collision */ - if (colortable_entry_get_value(screen->machine().colortable, *BITMAP_ADDR16(state->m_scrolled_collision_background, offs, bx))) + if (colortable_entry_get_value(screen.machine().colortable, *BITMAP_ADDR16(state->m_scrolled_collision_background, offs, bx))) state->m_collision_register |= 0x80; *BITMAP_ADDR16(bitmap, offs, bx) = BULLET_STAR_PEN; @@ -302,7 +302,7 @@ SCREEN_UPDATE( cvs ) if (S2636_IS_PIXEL_DRAWN(pixel0) && S2636_IS_PIXEL_DRAWN(pixel2)) state->m_collision_register |= 0x04; /* S2636 vs. background collision detection */ - if (colortable_entry_get_value(screen->machine().colortable, *BITMAP_ADDR16(state->m_scrolled_collision_background, y, x))) + if (colortable_entry_get_value(screen.machine().colortable, *BITMAP_ADDR16(state->m_scrolled_collision_background, y, x))) { if (S2636_IS_PIXEL_DRAWN(pixel0)) state->m_collision_register |= 0x10; if (S2636_IS_PIXEL_DRAWN(pixel1)) state->m_collision_register |= 0x20; @@ -323,14 +323,14 @@ SCREEN_UPDATE( cvs ) if ((y & 1) ^ ((x >> 4) & 1)) { - if (flip_screen_x_get(screen->machine())) + if (flip_screen_x_get(screen.machine())) x = ~x; - if (flip_screen_y_get(screen->machine())) + if (flip_screen_y_get(screen.machine())) y = ~y; if ((y >= cliprect->min_y) && (y <= cliprect->max_y) && - (colortable_entry_get_value(screen->machine().colortable, *BITMAP_ADDR16(bitmap, y, x)) == 0)) + (colortable_entry_get_value(screen.machine().colortable, *BITMAP_ADDR16(bitmap, y, x)) == 0)) *BITMAP_ADDR16(bitmap, y, x) = BULLET_STAR_PEN; } } diff --git a/src/mame/video/cyberbal.c b/src/mame/video/cyberbal.c index d4f90de9135..06f341f19b9 100644 --- a/src/mame/video/cyberbal.c +++ b/src/mame/video/cyberbal.c @@ -332,7 +332,7 @@ void cyberbal_scanline_update(screen_device &screen, int scanline) * *************************************/ -static void update_one_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect) +static UINT32 update_one_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int index) { cyberbal_state *state = screen.machine().driver_data(); atarimo_rect_list rectlist; @@ -341,13 +341,8 @@ static void update_one_screen(screen_device &screen, bitmap_t *bitmap, const rec int x, y, r, mooffset, temp; rectangle visarea = screen.visible_area(); - /* for 2p games, the left screen is the main screen */ - device_t *left_screen = screen.machine().device("lscreen"); - if (left_screen == NULL) - left_screen = screen.machine().device("screen"); - /* draw the playfield */ - tilemap_draw(bitmap, cliprect, (&screen == left_screen) ? state->m_playfield_tilemap : state->m_playfield2_tilemap, 0, 0); + tilemap_draw(bitmap, cliprect, (index == 0) ? state->m_playfield_tilemap : state->m_playfield2_tilemap, 0, 0); /* draw the MOs -- note some kludging to get this to work correctly for 2 screens */ mooffset = 0; @@ -356,7 +351,7 @@ static void update_one_screen(screen_device &screen, bitmap_t *bitmap, const rec temp = visarea.max_x; if (temp > SCREEN_WIDTH) visarea.max_x /= 2; - mobitmap = atarimo_render((&screen == left_screen) ? 0 : 1, cliprect, &rectlist); + mobitmap = atarimo_render((index == 0) ? 0 : 1, cliprect, &rectlist); tempclip.min_x += mooffset; tempclip.max_x += mooffset; visarea.max_x = temp; @@ -380,12 +375,22 @@ static void update_one_screen(screen_device &screen, bitmap_t *bitmap, const rec } /* add the alpha on top */ - tilemap_draw(bitmap, cliprect, (&screen == left_screen) ? state->m_alpha_tilemap : state->m_alpha2_tilemap, 0, 0); -} - - -SCREEN_UPDATE( cyberbal ) -{ - update_one_screen(*screen, bitmap, cliprect); + tilemap_draw(bitmap, cliprect, (index == 0) ? state->m_alpha_tilemap : state->m_alpha2_tilemap, 0, 0); return 0; } + + +SCREEN_UPDATE( cyberbal_left ) +{ + return update_one_screen(screen, bitmap, cliprect, 0); +} + +SCREEN_UPDATE( cyberbal_right ) +{ + return update_one_screen(screen, bitmap, cliprect, 1); +} + +SCREEN_UPDATE( cyberbal2p ) +{ + return update_one_screen(screen, bitmap, cliprect, 0); +} diff --git a/src/mame/video/darius.c b/src/mame/video/darius.c index 6c25379d9f0..15974a5d9b4 100644 --- a/src/mame/video/darius.c +++ b/src/mame/video/darius.c @@ -92,17 +92,9 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect -SCREEN_UPDATE( darius ) +static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int xoffs) { - darius_state *state = screen->machine().driver_data(); - int xoffs = 0; - - if (screen == state->m_lscreen) - xoffs = 36 * 8 * 0; - else if (screen == state->m_mscreen) - xoffs = 36 * 8 * 1; - else if (screen == state->m_rscreen) - xoffs = 36 * 8 * 2; + darius_state *state = screen.machine().driver_data(); pc080sn_tilemap_update(state->m_pc080sn); @@ -110,12 +102,12 @@ SCREEN_UPDATE( darius ) pc080sn_tilemap_draw_offset(state->m_pc080sn, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0, -xoffs, 0); /* Sprites can be under/over the layer below text layer */ - draw_sprites(screen->machine(), bitmap, cliprect, 0, xoffs, -8); // draw sprites with priority 0 which are under the mid layer + draw_sprites(screen.machine(), bitmap, cliprect, 0, xoffs, -8); // draw sprites with priority 0 which are under the mid layer // draw middle layer pc080sn_tilemap_draw_offset(state->m_pc080sn, bitmap, cliprect, 1, 0, 0, -xoffs, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 1, xoffs, -8); // draw sprites with priority 1 which are over the mid layer + draw_sprites(screen.machine(), bitmap, cliprect, 1, xoffs, -8); // draw sprites with priority 1 which are over the mid layer /* top(text) layer is in fixed position */ tilemap_set_scrollx(state->m_fg_tilemap, 0, 0 + xoffs); @@ -123,3 +115,8 @@ SCREEN_UPDATE( darius ) tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } + +SCREEN_UPDATE( darius_left ) { return update_screen(screen, bitmap, cliprect, 36 * 8 * 0); } +SCREEN_UPDATE( darius_middle ) { return update_screen(screen, bitmap, cliprect, 36 * 8 * 1); } +SCREEN_UPDATE( darius_right ) { return update_screen(screen, bitmap, cliprect, 36 * 8 * 2); } + diff --git a/src/mame/video/darkmist.c b/src/mame/video/darkmist.c index f9db3bca25b..488dacb9ab9 100644 --- a/src/mame/video/darkmist.c +++ b/src/mame/video/darkmist.c @@ -129,19 +129,19 @@ VIDEO_START(darkmist) SCREEN_UPDATE( darkmist) { - darkmist_state *state = screen->machine().driver_data(); + darkmist_state *state = screen.machine().driver_data(); UINT8 *spriteram = state->m_spriteram; #define DM_GETSCROLL(n) (((state->m_scroll[(n)]<<1)&0xff) + ((state->m_scroll[(n)]&0x80)?1:0) +( ((state->m_scroll[(n)-1]<<4) | (state->m_scroll[(n)-1]<<12) )&0xff00)) - set_pens(screen->machine()); + set_pens(screen.machine()); tilemap_set_scrollx(state->m_bgtilemap, 0, DM_GETSCROLL(0x2)); tilemap_set_scrolly(state->m_bgtilemap, 0, DM_GETSCROLL(0x6)); tilemap_set_scrollx(state->m_fgtilemap, 0, DM_GETSCROLL(0xa)); tilemap_set_scrolly(state->m_fgtilemap, 0, DM_GETSCROLL(0xe)); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); if(state->m_hw & DISPLAY_BG) tilemap_draw(bitmap,cliprect,state->m_bgtilemap, 0,0); @@ -176,13 +176,13 @@ SCREEN_UPDATE( darkmist) palette=((spriteram[i+1])>>1)&0xf; if(spriteram[i+1]&0x1) - palette=screen->machine().rand()&15; + palette=screen.machine().rand()&15; palette+=32; drawgfx_transpen( bitmap,cliprect, - screen->machine().gfx[2], + screen.machine().gfx[2], tile, palette, fx,fy, diff --git a/src/mame/video/darkseal.c b/src/mame/video/darkseal.c index 17b317d2ab1..6e7255363a0 100644 --- a/src/mame/video/darkseal.c +++ b/src/mame/video/darkseal.c @@ -61,10 +61,10 @@ VIDEO_START( darkseal ) SCREEN_UPDATE( darkseal ) { - darkseal_state *state = screen->machine().driver_data(); - tilemap_set_flip_all(screen->machine(),state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + darkseal_state *state = screen.machine().driver_data(); + tilemap_set_flip_all(screen.machine(),state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf1_rowscroll); deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf3_rowscroll); @@ -73,7 +73,7 @@ SCREEN_UPDATE( darkseal ) deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 0); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0x400); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u16, 0x400); deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/video/dassault.c b/src/mame/video/dassault.c index c6eb12b3230..6f26a4f653f 100644 --- a/src/mame/video/dassault.c +++ b/src/mame/video/dassault.c @@ -175,19 +175,19 @@ static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( dassault ) { - dassault_state *state = screen->machine().driver_data(); + dassault_state *state = screen.machine().driver_data(); UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); UINT16 priority = decocomn_priority_r(state->m_decocomn, 0, 0xffff); /* Update tilemaps */ - flip_screen_set(screen->machine(), BIT(flip, 7)); + flip_screen_set(screen.machine(), BIT(flip, 7)); deco16ic_pf_update(state->m_deco_tilegen1, 0, state->m_pf2_rowscroll); deco16ic_pf_update(state->m_deco_tilegen2, 0, state->m_pf4_rowscroll); /* Draw playfields/update priority bitmap */ decocomn_clear_sprite_priority_bitmap(state->m_decocomn); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); - bitmap_fill(bitmap, cliprect, screen->machine().pens[3072]); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); + bitmap_fill(bitmap, cliprect, screen.machine().pens[3072]); deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); /* The middle playfields can be swapped priority-wise */ @@ -212,7 +212,7 @@ SCREEN_UPDATE( dassault ) } /* Draw sprites - two sprite generators, with selectable priority */ - draw_sprites(screen->machine(), bitmap, cliprect, priority); + draw_sprites(screen.machine(), bitmap, cliprect, priority); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; } diff --git a/src/mame/video/dbz.c b/src/mame/video/dbz.c index aa854f9143e..06df3743bb2 100644 --- a/src/mame/video/dbz.c +++ b/src/mame/video/dbz.c @@ -99,7 +99,7 @@ VIDEO_START( dbz ) SCREEN_UPDATE( dbz ) { - dbz_state *state = screen->machine().driver_data(); + dbz_state *state = screen.machine().driver_data(); static const int K053251_CI[6] = { K053251_CI3, K053251_CI4, K053251_CI4, K053251_CI4, K053251_CI2, K053251_CI1 }; int layer[5], plane, new_colorbase; @@ -135,7 +135,7 @@ SCREEN_UPDATE( dbz ) konami_sortlayers5(layer, state->m_layerpri); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); for (plane = 0; plane < 5; plane++) { diff --git a/src/mame/video/dc.c b/src/mame/video/dc.c index ae5de739a39..35685b95ac6 100644 --- a/src/mame/video/dc.c +++ b/src/mame/video/dc.c @@ -2643,7 +2643,7 @@ VIDEO_START(dc) SCREEN_UPDATE(dc) { - dc_state *state = screen->machine().driver_data(); + dc_state *state = screen.machine().driver_data(); /****************** MAME note @@ -2659,11 +2659,11 @@ SCREEN_UPDATE(dc) ******************/ // static int useframebuffer=1; -// const rectangle &visarea = screen->visible_area(); +// const rectangle &visarea = screen.visible_area(); // int y,x; #if DEBUG_PALRAM - debug_paletteram(screen->machine()); + debug_paletteram(screen.machine()); #endif // copy our fake framebuffer bitmap (where things have been rendered) to the screen @@ -2682,10 +2682,10 @@ SCREEN_UPDATE(dc) bitmap_fill(bitmap,cliprect,MAKE_ARGB(0xff,vo_border_R,vo_border_G,vo_border_B)); //FIXME: Chroma bit? if(!spg_blank_video) - pvr_drawframebuffer(screen->machine(),bitmap,cliprect); + pvr_drawframebuffer(screen.machine(),bitmap,cliprect); // update this here so we only do string lookup once per frame - state->debug_dip_status = input_port_read(screen->machine(), "MAMEDEBUG"); + state->debug_dip_status = input_port_read(screen.machine(), "MAMEDEBUG"); return 0; } diff --git a/src/mame/video/dcheese.c b/src/mame/video/dcheese.c index 79433a5f106..9339f5a39b5 100644 --- a/src/mame/video/dcheese.c +++ b/src/mame/video/dcheese.c @@ -118,7 +118,7 @@ VIDEO_START( dcheese ) SCREEN_UPDATE( dcheese ) { - dcheese_state *state = screen->machine().driver_data(); + dcheese_state *state = screen.machine().driver_data(); int x, y; /* update the pixels */ diff --git a/src/mame/video/dcon.c b/src/mame/video/dcon.c index c3dd29d7012..b7ebe7bc54c 100644 --- a/src/mame/video/dcon.c +++ b/src/mame/video/dcon.c @@ -279,8 +279,8 @@ static void draw_sprites(running_machine& machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( dcon ) { - dcon_state *state = screen->machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + dcon_state *state = screen.machine().driver_data(); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); /* Setup the tilemaps */ tilemap_set_scrollx( state->m_background_layer,0, state->m_scroll_ram[0] ); @@ -299,15 +299,15 @@ SCREEN_UPDATE( dcon ) tilemap_draw(bitmap,cliprect,state->m_foreground_layer,0,2); tilemap_draw(bitmap,cliprect,state->m_text_layer,0,4); - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); return 0; } SCREEN_UPDATE( sdgndmps ) { - dcon_state *state = screen->machine().driver_data(); + dcon_state *state = screen.machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); /* Gfx banking */ if (state->m_last_gfx_bank!=state->m_gfx_bank_select) @@ -335,6 +335,6 @@ SCREEN_UPDATE( sdgndmps ) tilemap_draw(bitmap,cliprect,state->m_foreground_layer,0,2); tilemap_draw(bitmap,cliprect,state->m_text_layer,0,4); - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); return 0; } diff --git a/src/mame/video/dday.c b/src/mame/video/dday.c index 2c52491289c..a828afa31f1 100644 --- a/src/mame/video/dday.c +++ b/src/mame/video/dday.c @@ -317,7 +317,7 @@ WRITE8_HANDLER( dday_control_w ) SCREEN_UPDATE( dday ) { - dday_state *state = screen->machine().driver_data(); + dday_state *state = screen.machine().driver_data(); tilemap_draw(state->m_main_bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1, 0); tilemap_draw(state->m_main_bitmap, cliprect, state->m_fg_tilemap, 0, 0); @@ -337,7 +337,7 @@ SCREEN_UPDATE( dday ) UINT16 src_pixel = *BITMAP_ADDR16(state->m_main_bitmap, y, x); if (*BITMAP_ADDR16(sl_bitmap, y, x) == 0xff) - src_pixel += screen->machine().total_colors(); + src_pixel += screen.machine().total_colors(); *BITMAP_ADDR16(bitmap, y, x) = src_pixel; } diff --git a/src/mame/video/ddragon.c b/src/mame/video/ddragon.c index e3d8b11cc72..0fc5116ee14 100644 --- a/src/mame/video/ddragon.c +++ b/src/mame/video/ddragon.c @@ -242,7 +242,7 @@ static void draw_sprites( running_machine& machine, bitmap_t *bitmap,const recta SCREEN_UPDATE( ddragon ) { - ddragon_state *state = screen->machine().driver_data(); + ddragon_state *state = screen.machine().driver_data(); int scrollx = (state->m_scrollx_hi << 8) | *state->m_scrollx_lo; int scrolly = (state->m_scrolly_hi << 8) | *state->m_scrolly_lo; @@ -251,7 +251,7 @@ SCREEN_UPDATE( ddragon ) tilemap_set_scrolly(state->m_bg_tilemap, 0, scrolly); tilemap_draw(bitmap,cliprect, state->m_bg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/ddragon3.c b/src/mame/video/ddragon3.c index c1ecdaa751e..45be7e61eae 100644 --- a/src/mame/video/ddragon3.c +++ b/src/mame/video/ddragon3.c @@ -164,7 +164,7 @@ static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( ddragon3 ) { - ddragon3_state *state = screen->machine().driver_data(); + ddragon3_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_bg_scrollx); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_bg_scrolly); @@ -175,18 +175,18 @@ SCREEN_UPDATE( ddragon3 ) { tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_OPAQUE, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); } else if ((state->m_vreg & 0x60) == 0x60) { tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, TILEMAP_DRAW_OPAQUE, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); } else { tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_OPAQUE, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); } return 0; @@ -194,7 +194,7 @@ SCREEN_UPDATE( ddragon3 ) SCREEN_UPDATE( ctribe ) { - ddragon3_state *state = screen->machine().driver_data(); + ddragon3_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_bg_scrollx); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_bg_scrolly); @@ -204,14 +204,14 @@ SCREEN_UPDATE( ctribe ) if(state->m_vreg & 8) { tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, TILEMAP_DRAW_OPAQUE, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); } else { tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_OPAQUE, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); } return 0; } diff --git a/src/mame/video/ddribble.c b/src/mame/video/ddribble.c index 9357ca1315e..f0313e369dd 100644 --- a/src/mame/video/ddribble.c +++ b/src/mame/video/ddribble.c @@ -252,8 +252,8 @@ static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( ddribble ) { - ddribble_state *state = screen->machine().driver_data(); - set_pens(screen->machine()); + ddribble_state *state = screen.machine().driver_data(); + set_pens(screen.machine()); tilemap_set_flip(state->m_fg_tilemap, (state->m_vregs[0][4] & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); tilemap_set_flip(state->m_bg_tilemap, (state->m_vregs[1][4] & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); @@ -265,8 +265,8 @@ SCREEN_UPDATE( ddribble ) tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_vregs[1][0]); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram_1, 0x07d, 2, state->m_vregs[0][4] & 0x08); - draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram_2, 0x140, 3, state->m_vregs[1][4] & 0x08); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram_1, 0x07d, 2, state->m_vregs[0][4] & 0x08); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram_2, 0x140, 3, state->m_vregs[1][4] & 0x08); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/deadang.c b/src/mame/video/deadang.c index 100f15a956f..ad91efd57b8 100644 --- a/src/mame/video/deadang.c +++ b/src/mame/video/deadang.c @@ -132,7 +132,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( deadang ) { - deadang_state *state = screen->machine().driver_data(); + deadang_state *state = screen.machine().driver_data(); /* Setup the tilemaps */ tilemap_set_scrolly( state->m_pf3_layer,0, ((state->m_scroll_ram[0x01]&0xf0)<<4)+((state->m_scroll_ram[0x02]&0x7f)<<1)+((state->m_scroll_ram[0x02]&0x80)>>7) ); tilemap_set_scrollx( state->m_pf3_layer,0, ((state->m_scroll_ram[0x09]&0xf0)<<4)+((state->m_scroll_ram[0x0a]&0x7f)<<1)+((state->m_scroll_ram[0x0a]&0x80)>>7) ); @@ -154,14 +154,14 @@ SCREEN_UPDATE( deadang ) tilemap_set_enable(state->m_pf3_layer,!(state->m_scroll_ram[0x34]&1)); tilemap_set_enable(state->m_pf1_layer,!(state->m_scroll_ram[0x34]&2)); tilemap_set_enable(state->m_pf2_layer,!(state->m_scroll_ram[0x34]&4)); - flip_screen_set(screen->machine(), state->m_scroll_ram[0x34]&0x40 ); + flip_screen_set(screen.machine(), state->m_scroll_ram[0x34]&0x40 ); - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_pf3_layer,0,1); tilemap_draw(bitmap,cliprect,state->m_pf1_layer,0,2); tilemap_draw(bitmap,cliprect,state->m_pf2_layer,0,4); - if (!(state->m_scroll_ram[0x34]&0x10)) draw_sprites(screen->machine(),bitmap,cliprect); + if (!(state->m_scroll_ram[0x34]&0x10)) draw_sprites(screen.machine(),bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_text_layer,0,0); return 0; } diff --git a/src/mame/video/dec0.c b/src/mame/video/dec0.c index 128f4bc8fce..53a641d7743 100644 --- a/src/mame/video/dec0.c +++ b/src/mame/video/dec0.c @@ -47,18 +47,18 @@ WRITE16_HANDLER( dec0_paletteram_b_w ) SCREEN_UPDATE( hbarrel ) { - dec0_state *state = screen->machine().driver_data(); + dec0_state *state = screen.machine().driver_data(); - flip_screen_set(screen->machine(), screen->machine().device("tilegen1")->get_flip_state()); + flip_screen_set(screen.machine(), screen.machine().device("tilegen1")->get_flip_state()); - screen->machine().device("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, 0x08, 0x0f); - screen->machine().device("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, 0x08, 0x0f); + screen.machine().device("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); /* HB always keeps pf2 on top of pf3, no need explicitly support priority register */ - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, 0x00, 0x0f); - screen->machine().device("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, 0x00, 0x0f); + screen.machine().device("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); return 0; } @@ -66,38 +66,38 @@ SCREEN_UPDATE( hbarrel ) SCREEN_UPDATE( baddudes ) { - dec0_state *state = screen->machine().driver_data(); - flip_screen_set(screen->machine(), screen->machine().device("tilegen1")->get_flip_state()); + dec0_state *state = screen.machine().driver_data(); + flip_screen_set(screen.machine(), screen.machine().device("tilegen1")->get_flip_state()); /* WARNING: inverted wrt Midnight Resistance */ if ((state->m_pri & 0x01) == 0) { - screen->machine().device("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); - screen->machine().device("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); if (state->m_pri & 2) - screen->machine().device("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */ + screen.machine().device("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */ - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); if (state->m_pri & 4) - screen->machine().device("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */ + screen.machine().device("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */ } else { - screen->machine().device("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); - screen->machine().device("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); if (state->m_pri & 2) - screen->machine().device("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */ + screen.machine().device("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */ - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); if (state->m_pri & 4) - screen->machine().device("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */ + screen.machine().device("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */ } - screen->machine().device("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); return 0; } @@ -105,10 +105,10 @@ SCREEN_UPDATE( baddudes ) SCREEN_UPDATE( robocop ) { - dec0_state *state = screen->machine().driver_data(); + dec0_state *state = screen.machine().driver_data(); int trans; - flip_screen_set(screen->machine(), screen->machine().device("tilegen1")->get_flip_state()); + flip_screen_set(screen.machine(), screen.machine().device("tilegen1")->get_flip_state()); if (state->m_pri & 0x04) trans = 0x08; @@ -121,29 +121,29 @@ SCREEN_UPDATE( robocop ) /* Robocop uses it only for the title screen, so this might be just */ /* completely wrong. The top 8 bits of the register might mean */ /* something (they are 0x80 in midres, 0x00 here) */ - screen->machine().device("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); if (state->m_pri & 0x02) - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f); - screen->machine().device("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); } else { - screen->machine().device("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); if (state->m_pri & 0x02) - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f); - screen->machine().device("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); } if (state->m_pri & 0x02) - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans^0x08, 0x0f); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans^0x08, 0x0f); else - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); - screen->machine().device("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); return 0; } @@ -151,16 +151,16 @@ SCREEN_UPDATE( robocop ) SCREEN_UPDATE( birdtry ) { - dec0_state *state = screen->machine().driver_data(); + dec0_state *state = screen.machine().driver_data(); - flip_screen_set(screen->machine(), screen->machine().device("tilegen1")->get_flip_state()); + flip_screen_set(screen.machine(), screen.machine().device("tilegen1")->get_flip_state()); /* This game doesn't have the extra playfield chip on the game board, but the palette does show through. */ - bitmap_fill(bitmap,cliprect,screen->machine().pens[768]); - screen->machine().device("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); - screen->machine().device("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + bitmap_fill(bitmap,cliprect,screen.machine().pens[768]); + screen.machine().device("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); + screen.machine().device("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); return 0; } @@ -168,22 +168,22 @@ SCREEN_UPDATE( birdtry ) SCREEN_UPDATE( hippodrm ) { - dec0_state *state = screen->machine().driver_data(); - flip_screen_set(screen->machine(), screen->machine().device("tilegen1")->get_flip_state()); + dec0_state *state = screen.machine().driver_data(); + flip_screen_set(screen.machine(), screen.machine().device("tilegen1")->get_flip_state()); if (state->m_pri & 0x01) { - screen->machine().device("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); - screen->machine().device("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); } else { - screen->machine().device("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); - screen->machine().device("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); } - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); - screen->machine().device("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); + screen.machine().device("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); return 0; } @@ -191,19 +191,19 @@ SCREEN_UPDATE( hippodrm ) SCREEN_UPDATE( slyspy ) { - dec0_state *state = screen->machine().driver_data(); - flip_screen_set(screen->machine(), screen->machine().device("tilegen1")->get_flip_state()); + dec0_state *state = screen.machine().driver_data(); + flip_screen_set(screen.machine(), screen.machine().device("tilegen1")->get_flip_state()); - screen->machine().device("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); - screen->machine().device("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); /* Redraw top 8 pens of top 8 palettes over sprites */ if (state->m_pri&0x80) - screen->machine().device("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles + screen.machine().device("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles - screen->machine().device("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); return 0; } @@ -211,10 +211,10 @@ SCREEN_UPDATE( slyspy ) SCREEN_UPDATE( midres ) { - dec0_state *state = screen->machine().driver_data(); + dec0_state *state = screen.machine().driver_data(); int trans; - flip_screen_set(screen->machine(), screen->machine().device("tilegen1")->get_flip_state()); + flip_screen_set(screen.machine(), screen.machine().device("tilegen1")->get_flip_state()); if (state->m_pri & 0x04) trans = 0x00; @@ -222,29 +222,29 @@ SCREEN_UPDATE( midres ) if (state->m_pri & 0x01) { - screen->machine().device("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); if (state->m_pri & 0x02) - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f); - screen->machine().device("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); } else { - screen->machine().device("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); if (state->m_pri & 0x02) - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f); - screen->machine().device("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); } if (state->m_pri & 0x02) - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans ^ 0x08, 0x0f); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans ^ 0x08, 0x0f); else - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); - screen->machine().device("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); return 0; } diff --git a/src/mame/video/dec8.c b/src/mame/video/dec8.c index 5967ea23442..e946ebfdb0e 100644 --- a/src/mame/video/dec8.c +++ b/src/mame/video/dec8.c @@ -274,14 +274,14 @@ static void srdarwin_draw_sprites( running_machine& machine, bitmap_t *bitmap, c SCREEN_UPDATE( cobracom ) { - dec8_state *state = screen->machine().driver_data(); + dec8_state *state = screen.machine().driver_data(); - flip_screen_set(screen->machine(), state->m_bg_control[0] >> 7); + flip_screen_set(screen.machine(), state->m_bg_control[0] >> 7); - screen->machine().device("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram16, 0x04, 0x00, 0x03); - screen->machine().device("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram16, 0x04, 0x04, 0x03); + screen.machine().device("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram16, 0x04, 0x00, 0x03); + screen.machine().device("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram16, 0x04, 0x04, 0x03); tilemap_draw(bitmap, cliprect, state->m_fix_tilemap, 0, 0); return 0; } @@ -320,9 +320,9 @@ VIDEO_START( cobracom ) SCREEN_UPDATE( ghostb ) { - dec8_state *state = screen->machine().driver_data(); - screen->machine().device("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram16, 0x400, 0); + dec8_state *state = screen.machine().driver_data(); + screen.machine().device("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram16, 0x400, 0); tilemap_draw(bitmap, cliprect, state->m_fix_tilemap, 0, 0); return 0; } @@ -355,13 +355,13 @@ VIDEO_START( ghostb ) SCREEN_UPDATE( oscar ) { - dec8_state *state = screen->machine().driver_data(); - flip_screen_set(screen->machine(), state->m_bg_control[1] >> 7); + dec8_state *state = screen.machine().driver_data(); + flip_screen_set(screen.machine(), state->m_bg_control[1] >> 7); // we mimic the priority scheme in dec0.c, this was originally a bit different, so this could be wrong - screen->machine().device("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram16, 0x00, 0x00, 0x0f); - screen->machine().device("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x08,0x08,0x08,0x08); + screen.machine().device("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram16, 0x00, 0x00, 0x0f); + screen.machine().device("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x08,0x08,0x08,0x08); tilemap_draw(bitmap,cliprect, state->m_fix_tilemap, 0, 0); return 0; } @@ -396,26 +396,26 @@ VIDEO_START( oscar ) SCREEN_UPDATE( lastmisn ) { - dec8_state *state = screen->machine().driver_data(); + dec8_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, ((state->m_scroll2[0] << 8)+ state->m_scroll2[1])); tilemap_set_scrolly(state->m_bg_tilemap, 0, ((state->m_scroll2[2] << 8)+ state->m_scroll2[3])); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram16, 0x400, 0); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram16, 0x400, 0); tilemap_draw(bitmap, cliprect, state->m_fix_tilemap, 0, 0); return 0; } SCREEN_UPDATE( shackled ) { - dec8_state *state = screen->machine().driver_data(); + dec8_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, ((state->m_scroll2[0] << 8) + state->m_scroll2[1])); tilemap_set_scrolly(state->m_bg_tilemap, 0, ((state->m_scroll2[2] << 8) + state->m_scroll2[3])); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1 | 0, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1 | 1, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0 | 0, 0); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram16, 0x400, 0); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram16, 0x400, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0 | 1, 0); tilemap_draw(bitmap, cliprect, state->m_fix_tilemap, 0, 0); return 0; @@ -485,13 +485,13 @@ VIDEO_START( shackled ) SCREEN_UPDATE( srdarwin ) { - dec8_state *state = screen->machine().driver_data(); + dec8_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, (state->m_scroll2[0] << 8) + state->m_scroll2[1]); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1, 0); - srdarwin_draw_sprites(screen->machine(), bitmap, cliprect, 0); //* (srdarwin37b5gre) + srdarwin_draw_sprites(screen.machine(), bitmap, cliprect, 0); //* (srdarwin37b5gre) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0, 0); - srdarwin_draw_sprites(screen->machine(), bitmap, cliprect, 1); + srdarwin_draw_sprites(screen.machine(), bitmap, cliprect, 1); tilemap_draw(bitmap, cliprect, state->m_fix_tilemap, 0, 0); return 0; } @@ -550,26 +550,26 @@ VIDEO_START( srdarwin ) SCREEN_UPDATE( gondo ) { - dec8_state *state = screen->machine().driver_data(); + dec8_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, ((state->m_scroll2[0] << 8) + state->m_scroll2[1])); tilemap_set_scrolly(state->m_bg_tilemap, 0, ((state->m_scroll2[2] << 8) + state->m_scroll2[3])); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1, 0); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram16, 0x400, 2); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram16, 0x400, 2); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0, 0); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram16, 0x400, 1); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram16, 0x400, 1); tilemap_draw(bitmap, cliprect, state->m_fix_tilemap, 0, 0); return 0; } SCREEN_UPDATE( garyoret ) { - dec8_state *state = screen->machine().driver_data(); + dec8_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, ((state->m_scroll2[0] << 8) + state->m_scroll2[1])); tilemap_set_scrolly(state->m_bg_tilemap, 0, ((state->m_scroll2[2] << 8) + state->m_scroll2[3])); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_buffered_spriteram16, 0x400, 0); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram16, 0x400, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 1, 0); tilemap_draw(bitmap, cliprect, state->m_fix_tilemap, 0, 0); return 0; diff --git a/src/mame/video/deco32.c b/src/mame/video/deco32.c index 381e8b87686..163caa09d5b 100644 --- a/src/mame/video/deco32.c +++ b/src/mame/video/deco32.c @@ -598,14 +598,14 @@ SCREEN_EOF( dragngun ) SCREEN_UPDATE( captaven ) { - deco32_state *state = screen->machine().driver_data(); - state->m_deco_tilegen1 = screen->machine().device("tilegen1"); - state->m_deco_tilegen2 = screen->machine().device("tilegen2"); + deco32_state *state = screen.machine().driver_data(); + state->m_deco_tilegen1 = screen.machine().device("tilegen1"); + state->m_deco_tilegen2 = screen.machine().device("tilegen2"); - tilemap_set_flip_all(screen->machine(),flip_screen_get(screen->machine()) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + tilemap_set_flip_all(screen.machine(),flip_screen_get(screen.machine()) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); - bitmap_fill(bitmap,cliprect,screen->machine().pens[0x000]); // Palette index not confirmed + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); + bitmap_fill(bitmap,cliprect,screen.machine().pens[0x000]); // Palette index not confirmed deco16ic_set_pf1_8bpp_mode(state->m_deco_tilegen2, 1); @@ -627,19 +627,19 @@ SCREEN_UPDATE( captaven ) deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 4); - screen->machine().device("spritegen")->set_alt_format(true); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram16_buffered, 0x400); + screen.machine().device("spritegen")->set_alt_format(true); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram16_buffered, 0x400); return 0; } SCREEN_UPDATE( dragngun ) { - deco32_state *state = screen->machine().driver_data(); - state->m_deco_tilegen1 = screen->machine().device("tilegen1"); - state->m_deco_tilegen2 = screen->machine().device("tilegen2"); + deco32_state *state = screen.machine().driver_data(); + state->m_deco_tilegen1 = screen.machine().device("tilegen1"); + state->m_deco_tilegen2 = screen.machine().device("tilegen2"); - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); @@ -668,7 +668,7 @@ SCREEN_UPDATE( dragngun ) clip.min_y = 8; clip.max_y = 247; - dragngun_draw_sprites(screen->machine(),bitmap,&clip,screen->machine().generic.buffered_spriteram.u32); + dragngun_draw_sprites(screen.machine(),bitmap,&clip,screen.machine().generic.buffered_spriteram.u32); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, &clip, 0, 0); } @@ -679,17 +679,17 @@ SCREEN_UPDATE( dragngun ) SCREEN_UPDATE( fghthist ) { - deco32_state *state = screen->machine().driver_data(); - state->m_deco_tilegen1 = screen->machine().device("tilegen1"); - state->m_deco_tilegen2 = screen->machine().device("tilegen2"); + deco32_state *state = screen.machine().driver_data(); + state->m_deco_tilegen1 = screen.machine().device("tilegen1"); + state->m_deco_tilegen2 = screen.machine().device("tilegen2"); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); - bitmap_fill(bitmap,cliprect,screen->machine().pens[0x000]); // Palette index not confirmed + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); + bitmap_fill(bitmap,cliprect,screen.machine().pens[0x000]); // Palette index not confirmed deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram16_buffered, 0x800, true); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram16_buffered, 0x800, true); /* Draw screen */ deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 1); @@ -697,17 +697,17 @@ SCREEN_UPDATE( fghthist ) if(state->m_pri&1) { deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); - screen->machine().device("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff); + screen.machine().device("spritegen")->inefficient_copy_sprite_bitmap(screen.machine(), bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff); deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 4); } else { deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 2); - screen->machine().device("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff); + screen.machine().device("spritegen")->inefficient_copy_sprite_bitmap(screen.machine(), bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff); deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 4); } - screen->machine().device("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0000, 0x0800, 1024, 0x1ff); + screen.machine().device("spritegen")->inefficient_copy_sprite_bitmap(screen.machine(), bitmap, cliprect, 0x0000, 0x0800, 1024, 0x1ff); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; @@ -856,10 +856,10 @@ static void mixDualAlphaSprites(bitmap_t *bitmap, const rectangle *cliprect, con SCREEN_UPDATE( nslasher ) { - deco32_state *state = screen->machine().driver_data(); + deco32_state *state = screen.machine().driver_data(); int alphaTilemap=0; - state->m_deco_tilegen1 = screen->machine().device("tilegen1"); - state->m_deco_tilegen2 = screen->machine().device("tilegen2"); + state->m_deco_tilegen1 = screen.machine().device("tilegen1"); + state->m_deco_tilegen2 = screen.machine().device("tilegen2"); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); @@ -869,18 +869,18 @@ SCREEN_UPDATE( nslasher ) alphaTilemap=1; if (state->m_ace_ram_dirty) - updateAceRam(screen->machine()); + updateAceRam(screen.machine()); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); - bitmap_fill(bitmap,cliprect,screen->machine().pens[0x200]); + bitmap_fill(bitmap,cliprect,screen.machine().pens[0x200]); /* Draw sprites to temporary bitmaps, saving alpha & priority info for later mixing */ - screen->machine().device("spritegen1")->set_pix_raw_shift(8); - screen->machine().device("spritegen2")->set_pix_raw_shift(8); + screen.machine().device("spritegen1")->set_pix_raw_shift(8); + screen.machine().device("spritegen2")->set_pix_raw_shift(8); - screen->machine().device("spritegen1")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram16_buffered, 0x800, true); - screen->machine().device("spritegen2")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram16_2_buffered, 0x800, true); + screen.machine().device("spritegen1")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram16_buffered, 0x800, true); + screen.machine().device("spritegen2")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram16_2_buffered, 0x800, true); /* Render alpha-blended tilemap to separate buffer for proper mixing */ @@ -913,7 +913,7 @@ SCREEN_UPDATE( nslasher ) } } - mixDualAlphaSprites(bitmap, cliprect, screen->machine().gfx[3], screen->machine().gfx[4], alphaTilemap); + mixDualAlphaSprites(bitmap, cliprect, screen.machine().gfx[3], screen.machine().gfx[4], alphaTilemap); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/video/deco_mlc.c b/src/mame/video/deco_mlc.c index a3f450db85b..1cf8511061f 100644 --- a/src/mame/video/deco_mlc.c +++ b/src/mame/video/deco_mlc.c @@ -511,7 +511,7 @@ static void draw_sprites(running_machine& machine, bitmap_t *bitmap,const rectan SCREEN_EOF( mlc ) { - deco_mlc_state *state = machine.driver_data(); + deco_mlc_state *state = screen.machine().driver_data(); /* Spriteram is definitely double buffered, as the vram lookup tables are often updated a frame after spriteram is setup to point to a new lookup table. Without buffering incorrect one frame glitches are seen @@ -523,7 +523,7 @@ SCREEN_EOF( mlc ) SCREEN_UPDATE( mlc ) { // bitmap_fill(temp_bitmap,cliprect,0); - bitmap_fill(bitmap,cliprect,screen->machine().pens[0]); /* Pen 0 fill colour confirmed from Skull Fang level 2 */ - draw_sprites(screen->machine(),bitmap,cliprect); + bitmap_fill(bitmap,cliprect,screen.machine().pens[0]); /* Pen 0 fill colour confirmed from Skull Fang level 2 */ + draw_sprites(screen.machine(),bitmap,cliprect); return 0; } diff --git a/src/mame/video/decocass.c b/src/mame/video/decocass.c index b58a8a17280..0e9ff3973c9 100644 --- a/src/mame/video/decocass.c +++ b/src/mame/video/decocass.c @@ -521,21 +521,21 @@ VIDEO_START( decocass ) SCREEN_UPDATE( decocass ) { - decocass_state *state = screen->machine().driver_data(); + decocass_state *state = screen.machine().driver_data(); int scrollx, scrolly_l, scrolly_r; rectangle clip; - if (0xc0 != (input_port_read(screen->machine(), "IN2") & 0xc0)) /* coin slots assert an NMI */ + if (0xc0 != (input_port_read(screen.machine(), "IN2") & 0xc0)) /* coin slots assert an NMI */ device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, ASSERT_LINE); if (0 == (state->m_watchdog_flip & 0x04)) - watchdog_reset(screen->machine()); + watchdog_reset(screen.machine()); else if (state->m_watchdog_count-- > 0) - watchdog_reset(screen->machine()); + watchdog_reset(screen.machine()); #ifdef MAME_DEBUG { - if (screen->machine().input().code_pressed_once(KEYCODE_I)) + if (screen.machine().input().code_pressed_once(KEYCODE_I)) state->m_showmsg ^= 1; if (state->m_showmsg) popmessage("mode:$%02x cm:$%02x ccb:$%02x h:$%02x vl:$%02x vr:$%02x ph:$%02x pv:$%02x ch:$%02x cv:$%02x", @@ -591,13 +591,13 @@ SCREEN_UPDATE( decocass ) if (state->m_mode_set & 0x20) { - draw_object(screen->machine(), bitmap, cliprect); - draw_center(screen->machine(), bitmap, cliprect); + draw_object(screen.machine(), bitmap, cliprect); + draw_center(screen.machine(), bitmap, cliprect); } else { - draw_object(screen->machine(), bitmap, cliprect); - draw_center(screen->machine(), bitmap, cliprect); + draw_object(screen.machine(), bitmap, cliprect); + draw_center(screen.machine(), bitmap, cliprect); if (state->m_mode_set & 0x08) /* bkg_ena on ? */ { clip = state->m_bg_tilemap_l_clip; @@ -610,7 +610,7 @@ SCREEN_UPDATE( decocass ) } } tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, (state->m_color_center_bot >> 1) & 1, 0, 0, state->m_fgvideoram, 0x20); - draw_missiles(screen->machine(), bitmap, cliprect, 1, 0, state->m_colorram, 0x20); + draw_sprites(screen.machine(), bitmap, cliprect, (state->m_color_center_bot >> 1) & 1, 0, 0, state->m_fgvideoram, 0x20); + draw_missiles(screen.machine(), bitmap, cliprect, 1, 0, state->m_colorram, 0x20); return 0; } diff --git a/src/mame/video/deniam.c b/src/mame/video/deniam.c index 3cba2a910b2..d30fdbe30fb 100644 --- a/src/mame/video/deniam.c +++ b/src/mame/video/deniam.c @@ -379,7 +379,7 @@ static void set_fg_page( running_machine &machine, int page, int value ) SCREEN_UPDATE( deniam ) { - deniam_state *state = screen->machine().driver_data(); + deniam_state *state = screen.machine().driver_data(); int bg_scrollx, bg_scrolly, fg_scrollx, fg_scrolly; int page; @@ -389,30 +389,30 @@ SCREEN_UPDATE( deniam ) bg_scrollx = state->m_textram[state->m_bg_scrollx_reg] - state->m_bg_scrollx_offs; bg_scrolly = (state->m_textram[state->m_bg_scrolly_reg] & 0xff) - state->m_bg_scrolly_offs; page = state->m_textram[state->m_bg_page_reg]; - set_bg_page(screen->machine(), 3, (page >>12) & 0x0f); - set_bg_page(screen->machine(), 2, (page >> 8) & 0x0f); - set_bg_page(screen->machine(), 1, (page >> 4) & 0x0f); - set_bg_page(screen->machine(), 0, (page >> 0) & 0x0f); + set_bg_page(screen.machine(), 3, (page >>12) & 0x0f); + set_bg_page(screen.machine(), 2, (page >> 8) & 0x0f); + set_bg_page(screen.machine(), 1, (page >> 4) & 0x0f); + set_bg_page(screen.machine(), 0, (page >> 0) & 0x0f); fg_scrollx = state->m_textram[state->m_fg_scrollx_reg] - state->m_fg_scrollx_offs; fg_scrolly = (state->m_textram[state->m_fg_scrolly_reg] & 0xff) - state->m_fg_scrolly_offs; page = state->m_textram[state->m_fg_page_reg]; - set_fg_page(screen->machine(), 3, (page >>12) & 0x0f); - set_fg_page(screen->machine(), 2, (page >> 8) & 0x0f); - set_fg_page(screen->machine(), 1, (page >> 4) & 0x0f); - set_fg_page(screen->machine(), 0, (page >> 0) & 0x0f); + set_fg_page(screen.machine(), 3, (page >>12) & 0x0f); + set_fg_page(screen.machine(), 2, (page >> 8) & 0x0f); + set_fg_page(screen.machine(), 1, (page >> 4) & 0x0f); + set_fg_page(screen.machine(), 0, (page >> 0) & 0x0f); tilemap_set_scrollx(state->m_bg_tilemap, 0, bg_scrollx & 0x1ff); tilemap_set_scrolly(state->m_bg_tilemap, 0, bg_scrolly & 0x0ff); tilemap_set_scrollx(state->m_fg_tilemap, 0, fg_scrollx & 0x1ff); tilemap_set_scrolly(state->m_fg_tilemap, 0, fg_scrolly & 0x0ff); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 4); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/dietgo.c b/src/mame/video/dietgo.c index e6f03c2d14e..071e141fdf9 100644 --- a/src/mame/video/dietgo.c +++ b/src/mame/video/dietgo.c @@ -5,10 +5,10 @@ SCREEN_UPDATE( dietgo ) { - dietgo_state *state = screen->machine().driver_data(); + dietgo_state *state = screen.machine().driver_data(); UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); - flip_screen_set(screen->machine(), BIT(flip, 7)); + flip_screen_set(screen.machine(), BIT(flip, 7)); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); bitmap_fill(bitmap, cliprect, 256); /* not verified */ @@ -16,6 +16,6 @@ SCREEN_UPDATE( dietgo ) deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram, 0x400); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0x400); return 0; } diff --git a/src/mame/video/digdug.c b/src/mame/video/digdug.c index 14059f5d547..a8d8e48c3be 100644 --- a/src/mame/video/digdug.c +++ b/src/mame/video/digdug.c @@ -312,10 +312,10 @@ static void draw_sprites(running_machine& machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( digdug ) { - digdug_state *state = screen->machine().driver_data(); + digdug_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); return 0; } diff --git a/src/mame/video/djboy.c b/src/mame/video/djboy.c index ab34f6d037d..b3676ad3d89 100644 --- a/src/mame/video/djboy.c +++ b/src/mame/video/djboy.c @@ -66,7 +66,7 @@ SCREEN_UPDATE( djboy ) * ---x---- flipscreen? * ----xxxx ROM bank */ - djboy_state *state = screen->machine().driver_data(); + djboy_state *state = screen.machine().driver_data(); int scroll; scroll = state->m_scrollx | ((state->m_videoreg & 0xc0) << 2); @@ -83,6 +83,6 @@ SCREEN_UPDATE( djboy ) SCREEN_EOF( djboy ) { - djboy_state *state = machine.driver_data(); + djboy_state *state = screen.machine().driver_data(); pandora_eof(state->m_pandora); } diff --git a/src/mame/video/djmain.c b/src/mame/video/djmain.c index 502cb846744..38d655fc902 100644 --- a/src/mame/video/djmain.c +++ b/src/mame/video/djmain.c @@ -145,8 +145,8 @@ VIDEO_START( djmain ) SCREEN_UPDATE( djmain ) { - device_t *k056832 = screen->machine().device("k056832"); - device_t *k055555 = screen->machine().device("k055555"); + device_t *k056832 = screen.machine().device("k056832"); + device_t *k055555 = screen.machine().device("k055555"); int enables = k055555_read_register(k055555, K55_INPUT_ENABLES); int pri[NUM_LAYERS + 1]; int order[NUM_LAYERS + 1]; @@ -169,7 +169,7 @@ SCREEN_UPDATE( djmain ) order[j] = temp; } - bitmap_fill(bitmap, cliprect, screen->machine().pens[0]); + bitmap_fill(bitmap, cliprect, screen.machine().pens[0]); for (i = 0; i < NUM_LAYERS + 1; i++) { @@ -178,7 +178,7 @@ SCREEN_UPDATE( djmain ) if (layer == NUM_LAYERS) { if (enables & K55_INP_SUB2) - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); } else { diff --git a/src/mame/video/dkong.c b/src/mame/video/dkong.c index 786bc72274a..de3efff49c0 100644 --- a/src/mame/video/dkong.c +++ b/src/mame/video/dkong.c @@ -973,9 +973,9 @@ VIDEO_START( dkong ) SCREEN_UPDATE( dkong ) { - dkong_state *state = screen->machine().driver_data(); + dkong_state *state = screen.machine().driver_data(); - tilemap_set_flip_all(screen->machine(), state->m_flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); + tilemap_set_flip_all(screen.machine(), state->m_flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_flip ? 0 : 0); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_flip ? -8 : 0); @@ -983,15 +983,15 @@ SCREEN_UPDATE( dkong ) { case HARDWARE_TKG02: case HARDWARE_TKG04: - check_palette(screen->machine()); + check_palette(screen.machine()); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0x40, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 0x40, 1); break; case HARDWARE_TRS01: case HARDWARE_TRS02: tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0x40, 1); - radarscp_draw_background(screen->machine(), state, bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect, 0x40, 1); + radarscp_draw_background(screen.machine(), state, bitmap, cliprect); break; default: fatalerror("Invalid hardware type in dkong_video_update"); @@ -1001,7 +1001,7 @@ SCREEN_UPDATE( dkong ) SCREEN_UPDATE( pestplce ) { - dkong_state *state = screen->machine().driver_data(); + dkong_state *state = screen.machine().driver_data(); int offs; tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); @@ -1011,7 +1011,7 @@ SCREEN_UPDATE( pestplce ) { if (state->m_sprite_ram[offs]) { - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1], state->m_sprite_ram[offs + 2], (state->m_sprite_ram[offs + 1] & 0x0f) + 16 * state->m_palette_bank, state->m_sprite_ram[offs + 1] & 0x80,state->m_sprite_ram[offs + 1] & 0x40, @@ -1023,11 +1023,11 @@ SCREEN_UPDATE( pestplce ) SCREEN_UPDATE( spclforc ) { - dkong_state *state = screen->machine().driver_data(); + dkong_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); /* it uses sprite_ram[offs + 2] & 0x10 for sprite bank */ - draw_sprites(screen->machine(), bitmap, cliprect, 0x10, 3); + draw_sprites(screen.machine(), bitmap, cliprect, 0x10, 3); return 0; } diff --git a/src/mame/video/docastle.c b/src/mame/video/docastle.c index 6cfb1f64291..beceb74b195 100644 --- a/src/mame/video/docastle.c +++ b/src/mame/video/docastle.c @@ -226,10 +226,10 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( docastle ) { - docastle_state *state = screen->machine().driver_data(); + docastle_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_do_tilemap, TILEMAP_DRAW_OPAQUE, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_do_tilemap, TILEMAP_DRAW_LAYER0, 0); return 0; } diff --git a/src/mame/video/dogfgt.c b/src/mame/video/dogfgt.c index 87477d90a40..b7747d9d7cc 100644 --- a/src/mame/video/dogfgt.c +++ b/src/mame/video/dogfgt.c @@ -219,14 +219,14 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const recta SCREEN_UPDATE( dogfgt ) { - dogfgt_state *state = screen->machine().driver_data(); + dogfgt_state *state = screen.machine().driver_data(); int offs; - if (state->m_lastflip != flip_screen_get(screen->machine()) || state->m_lastpixcolor != state->m_pixcolor) + if (state->m_lastflip != flip_screen_get(screen.machine()) || state->m_lastpixcolor != state->m_pixcolor) { - address_space *space = screen->machine().device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); - state->m_lastflip = flip_screen_get(screen->machine()); + state->m_lastflip = flip_screen_get(screen.machine()); state->m_lastpixcolor = state->m_pixcolor; for (offs = 0; offs < BITMAPRAM_SIZE; offs++) @@ -236,7 +236,7 @@ SCREEN_UPDATE( dogfgt ) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); copybitmap_trans(bitmap, state->m_pixbitmap, 0, 0, 0, 0, cliprect, PIXMAP_COLOR_BASE + 8 * state->m_pixcolor); return 0; diff --git a/src/mame/video/dooyong.c b/src/mame/video/dooyong.c index 08ebc74b66d..d5c4d63b924 100644 --- a/src/mame/video/dooyong.c +++ b/src/mame/video/dooyong.c @@ -514,52 +514,52 @@ static void rshark_draw_sprites(running_machine &machine, bitmap_t *bitmap, cons SCREEN_UPDATE( lastday ) { - dooyong_state *state = screen->machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + dooyong_state *state = screen.machine().driver_data(); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 4); if (!state->m_sprites_disabled) - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0); return 0; } SCREEN_UPDATE( gulfstrm ) { - dooyong_state *state = screen->machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + dooyong_state *state = screen.machine().driver_data(); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 4); - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); return 0; } SCREEN_UPDATE( pollux ) { - dooyong_state *state = screen->machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + dooyong_state *state = screen.machine().driver_data(); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 4); - draw_sprites(screen->machine(), bitmap, cliprect, 2); + draw_sprites(screen.machine(), bitmap, cliprect, 2); return 0; } SCREEN_UPDATE( flytiger ) { - dooyong_state *state = screen->machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + dooyong_state *state = screen.machine().driver_data(); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); if (state->m_flytiger_pri) { @@ -573,30 +573,30 @@ SCREEN_UPDATE( flytiger ) } tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 4); - draw_sprites(screen->machine(), bitmap, cliprect, 4); + draw_sprites(screen.machine(), bitmap, cliprect, 4); return 0; } SCREEN_UPDATE( bluehawk ) { - dooyong_state *state = screen->machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + dooyong_state *state = screen.machine().driver_data(); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2); tilemap_draw(bitmap, cliprect, state->m_fg2_tilemap, 0, 4); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 4); - draw_sprites(screen->machine(), bitmap, cliprect, 3); + draw_sprites(screen.machine(), bitmap, cliprect, 3); return 0; } SCREEN_UPDATE( primella ) { - dooyong_state *state = screen->machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + dooyong_state *state = screen.machine().driver_data(); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); if (state->m_tx_pri) tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); @@ -607,28 +607,28 @@ SCREEN_UPDATE( primella ) SCREEN_UPDATE( rshark ) { - dooyong_state *state = screen->machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + dooyong_state *state = screen.machine().driver_data(); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1); tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, (state->m_rshark_pri ? 2 : 1)); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2); tilemap_draw(bitmap, cliprect, state->m_fg2_tilemap, 0, 2); - rshark_draw_sprites(screen->machine(), bitmap, cliprect); + rshark_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( popbingo ) { - dooyong_state *state = screen->machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + dooyong_state *state = screen.machine().driver_data(); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1); - rshark_draw_sprites(screen->machine(), bitmap, cliprect); + rshark_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } @@ -933,14 +933,14 @@ VIDEO_START( popbingo ) SCREEN_EOF( dooyong ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram_w(space, 0, 0); } SCREEN_EOF( rshark ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram16_w(space, 0, 0, 0xffff); } diff --git a/src/mame/video/dragrace.c b/src/mame/video/dragrace.c index 4cb5264cb15..deff333ff91 100644 --- a/src/mame/video/dragrace.c +++ b/src/mame/video/dragrace.c @@ -49,7 +49,7 @@ VIDEO_START( dragrace ) SCREEN_UPDATE( dragrace ) { - dragrace_state *state = screen->machine().driver_data(); + dragrace_state *state = screen.machine().driver_data(); int y; tilemap_mark_all_tiles_dirty(state->m_bg_tilemap); diff --git a/src/mame/video/drgnmst.c b/src/mame/video/drgnmst.c index 03c1c4874ed..0ce2a56e337 100644 --- a/src/mame/video/drgnmst.c +++ b/src/mame/video/drgnmst.c @@ -141,7 +141,7 @@ VIDEO_START(drgnmst) SCREEN_UPDATE(drgnmst) { - drgnmst_state *state = screen->machine().driver_data(); + drgnmst_state *state = screen.machine().driver_data(); int y, rowscroll_bank; tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_vidregs[10] - 18); // verify @@ -194,7 +194,7 @@ SCREEN_UPDATE(drgnmst) } - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); // popmessage ("x %04x x %04x x %04x x %04x x %04x", state->m_vidregs2[0], state->m_vidregs[12], state->m_vidregs[13], state->m_vidregs[14], state->m_vidregs[15]); // popmessage ("x %04x x %04x y %04x y %04x z %04x z %04x",state->m_vidregs[0],state->m_vidregs[1],state->m_vidregs[2],state->m_vidregs[3],state->m_vidregs[4],state->m_vidregs[5]); diff --git a/src/mame/video/dribling.c b/src/mame/video/dribling.c index e6765ddf260..939d9d8c163 100644 --- a/src/mame/video/dribling.c +++ b/src/mame/video/dribling.c @@ -60,9 +60,9 @@ WRITE8_HANDLER( dribling_colorram_w ) SCREEN_UPDATE( dribling ) { - dribling_state *state = screen->machine().driver_data(); - UINT8 *prombase = screen->machine().region("proms")->base(); - UINT8 *gfxbase = screen->machine().region("gfx1")->base(); + dribling_state *state = screen.machine().driver_data(); + UINT8 *prombase = screen.machine().region("proms")->base(); + UINT8 *gfxbase = screen.machine().region("gfx1")->base(); int x, y; /* loop over rows */ diff --git a/src/mame/video/drmicro.c b/src/mame/video/drmicro.c index 63e16f38c60..c15959b91f6 100644 --- a/src/mame/video/drmicro.c +++ b/src/mame/video/drmicro.c @@ -118,7 +118,7 @@ VIDEO_START( drmicro) SCREEN_UPDATE( drmicro ) { - drmicro_state *state = screen->machine().driver_data(); + drmicro_state *state = screen.machine().driver_data(); int offs, adr, g; int chr, col, attr; int x, y, fx, fy; @@ -150,7 +150,7 @@ SCREEN_UPDATE( drmicro ) else x = (240 - x) & 0xff; - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[3-g], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[3-g], chr, col, fx,fy, @@ -158,7 +158,7 @@ SCREEN_UPDATE( drmicro ) if (x > 240) { - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[3-g], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[3-g], chr, col, fx,fy, diff --git a/src/mame/video/dynax.c b/src/mame/video/dynax.c index 7d2cae7851e..7b632f8035c 100644 --- a/src/mame/video/dynax.c +++ b/src/mame/video/dynax.c @@ -1280,14 +1280,14 @@ static int debug_viewer( running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( hanamai ) { - dynax_state *state = screen->machine().driver_data(); + dynax_state *state = screen.machine().driver_data(); int layers_ctrl = ~state->m_layer_enable; int lay[4]; - if (debug_viewer(screen->machine(), bitmap, cliprect)) + if (debug_viewer(screen.machine(), bitmap, cliprect)) return 0; - layers_ctrl &= debug_mask(screen->machine()); + layers_ctrl &= debug_mask(screen.machine()); bitmap_fill(bitmap, cliprect, (state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256); @@ -1306,25 +1306,25 @@ SCREEN_UPDATE( hanamai ) case 0x15: lay[0] = 0; lay[1] = 2; lay[2] = 3; lay[3] = 1; break; } - if (BIT(layers_ctrl, lay[0])) hanamai_copylayer(screen->machine(), bitmap, cliprect, lay[0]); - if (BIT(layers_ctrl, lay[1])) hanamai_copylayer(screen->machine(), bitmap, cliprect, lay[1]); - if (BIT(layers_ctrl, lay[2])) hanamai_copylayer(screen->machine(), bitmap, cliprect, lay[2]); - if (BIT(layers_ctrl, lay[3])) hanamai_copylayer(screen->machine(), bitmap, cliprect, lay[3]); + if (BIT(layers_ctrl, lay[0])) hanamai_copylayer(screen.machine(), bitmap, cliprect, lay[0]); + if (BIT(layers_ctrl, lay[1])) hanamai_copylayer(screen.machine(), bitmap, cliprect, lay[1]); + if (BIT(layers_ctrl, lay[2])) hanamai_copylayer(screen.machine(), bitmap, cliprect, lay[2]); + if (BIT(layers_ctrl, lay[3])) hanamai_copylayer(screen.machine(), bitmap, cliprect, lay[3]); return 0; } SCREEN_UPDATE( hnoridur ) { - dynax_state *state = screen->machine().driver_data(); + dynax_state *state = screen.machine().driver_data(); int layers_ctrl = ~BITSWAP8(state->m_hanamai_priority, 7, 6, 5, 4, 0, 1, 2, 3); int lay[4]; int pri; - if (debug_viewer(screen->machine(), bitmap, cliprect)) + if (debug_viewer(screen.machine(), bitmap, cliprect)) return 0; - layers_ctrl &= debug_mask(screen->machine()); + layers_ctrl &= debug_mask(screen.machine()); bitmap_fill(bitmap, cliprect, (state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 0x0f) * 256); @@ -1342,10 +1342,10 @@ SCREEN_UPDATE( hnoridur ) lay[2] = (pri >> 4) & 3; lay[3] = (pri >> 0) & 3; - if (BIT(layers_ctrl, lay[0])) hanamai_copylayer(screen->machine(), bitmap, cliprect, lay[0]); - if (BIT(layers_ctrl, lay[1])) hanamai_copylayer(screen->machine(), bitmap, cliprect, lay[1]); - if (BIT(layers_ctrl, lay[2])) hanamai_copylayer(screen->machine(), bitmap, cliprect, lay[2]); - if (BIT(layers_ctrl, lay[3])) hanamai_copylayer(screen->machine(), bitmap, cliprect, lay[3]); + if (BIT(layers_ctrl, lay[0])) hanamai_copylayer(screen.machine(), bitmap, cliprect, lay[0]); + if (BIT(layers_ctrl, lay[1])) hanamai_copylayer(screen.machine(), bitmap, cliprect, lay[1]); + if (BIT(layers_ctrl, lay[2])) hanamai_copylayer(screen.machine(), bitmap, cliprect, lay[2]); + if (BIT(layers_ctrl, lay[3])) hanamai_copylayer(screen.machine(), bitmap, cliprect, lay[3]); return 0; } @@ -1353,67 +1353,76 @@ SCREEN_UPDATE( hnoridur ) SCREEN_UPDATE( sprtmtch ) { - dynax_state *state = screen->machine().driver_data(); + dynax_state *state = screen.machine().driver_data(); int layers_ctrl = ~state->m_layer_enable; - if (debug_viewer(screen->machine(),bitmap,cliprect)) + if (debug_viewer(screen.machine(),bitmap,cliprect)) return 0; - layers_ctrl &= debug_mask(screen->machine()); + layers_ctrl &= debug_mask(screen.machine()); bitmap_fill(bitmap, cliprect, (state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256); - if (BIT(layers_ctrl, 0)) hanamai_copylayer(screen->machine(), bitmap, cliprect, 0); - if (BIT(layers_ctrl, 1)) hanamai_copylayer(screen->machine(), bitmap, cliprect, 1); - if (BIT(layers_ctrl, 2)) hanamai_copylayer(screen->machine(), bitmap, cliprect, 2); + if (BIT(layers_ctrl, 0)) hanamai_copylayer(screen.machine(), bitmap, cliprect, 0); + if (BIT(layers_ctrl, 1)) hanamai_copylayer(screen.machine(), bitmap, cliprect, 1); + if (BIT(layers_ctrl, 2)) hanamai_copylayer(screen.machine(), bitmap, cliprect, 2); return 0; } -SCREEN_UPDATE( jantouki ) +SCREEN_UPDATE( jantouki_top ) { - dynax_state *state = screen->machine().driver_data(); + dynax_state *state = screen.machine().driver_data(); int layers_ctrl = state->m_layer_enable; - if (debug_viewer(screen->machine(), bitmap, cliprect)) + if (debug_viewer(screen.machine(), bitmap, cliprect)) return 0; - layers_ctrl &= debug_mask(screen->machine()); + layers_ctrl &= debug_mask(screen.machine()); bitmap_fill(bitmap, cliprect, (state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256); - if (screen == state->m_top_scr) - { - // if (BIT(layers_ctrl, 0)) jantouki_copylayer(screen->machine(), bitmap, cliprect, 3, 0); - if (BIT(layers_ctrl, 1)) jantouki_copylayer(screen->machine(), bitmap, cliprect, 2, 0); - if (BIT(layers_ctrl, 2)) jantouki_copylayer(screen->machine(), bitmap, cliprect, 1, 0); - if (BIT(layers_ctrl, 3)) jantouki_copylayer(screen->machine(), bitmap, cliprect, 0, 0); - } - else if (screen == state->m_bot_scr) - { - if (BIT(layers_ctrl, 0)) jantouki_copylayer(screen->machine(), bitmap, cliprect, 3, 0); - if (BIT(layers_ctrl, 4)) jantouki_copylayer(screen->machine(), bitmap, cliprect, 7, 0); - if (BIT(layers_ctrl, 5)) jantouki_copylayer(screen->machine(), bitmap, cliprect, 6, 0); - if (BIT(layers_ctrl, 6)) jantouki_copylayer(screen->machine(), bitmap, cliprect, 5, 0); - if (BIT(layers_ctrl, 7)) jantouki_copylayer(screen->machine(), bitmap, cliprect, 4, 0); - } +// if (BIT(layers_ctrl, 0)) jantouki_copylayer(screen.machine(), bitmap, cliprect, 3, 0); + if (BIT(layers_ctrl, 1)) jantouki_copylayer(screen.machine(), bitmap, cliprect, 2, 0); + if (BIT(layers_ctrl, 2)) jantouki_copylayer(screen.machine(), bitmap, cliprect, 1, 0); + if (BIT(layers_ctrl, 3)) jantouki_copylayer(screen.machine(), bitmap, cliprect, 0, 0); + return 0; +} + +SCREEN_UPDATE( jantouki_bottom ) +{ + dynax_state *state = screen.machine().driver_data(); + int layers_ctrl = state->m_layer_enable; + + if (debug_viewer(screen.machine(), bitmap, cliprect)) + return 0; + + layers_ctrl &= debug_mask(screen.machine()); + + bitmap_fill(bitmap, cliprect, (state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256); + + if (BIT(layers_ctrl, 0)) jantouki_copylayer(screen.machine(), bitmap, cliprect, 3, 0); + if (BIT(layers_ctrl, 4)) jantouki_copylayer(screen.machine(), bitmap, cliprect, 7, 0); + if (BIT(layers_ctrl, 5)) jantouki_copylayer(screen.machine(), bitmap, cliprect, 6, 0); + if (BIT(layers_ctrl, 6)) jantouki_copylayer(screen.machine(), bitmap, cliprect, 5, 0); + if (BIT(layers_ctrl, 7)) jantouki_copylayer(screen.machine(), bitmap, cliprect, 4, 0); return 0; } SCREEN_UPDATE( mjdialq2 ) { - dynax_state *state = screen->machine().driver_data(); + dynax_state *state = screen.machine().driver_data(); int layers_ctrl = ~state->m_layer_enable; - if (debug_viewer(screen->machine(), bitmap, cliprect)) + if (debug_viewer(screen.machine(), bitmap, cliprect)) return 0; - layers_ctrl &= debug_mask(screen->machine()); + layers_ctrl &= debug_mask(screen.machine()); bitmap_fill(bitmap, cliprect, (state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256); - if (BIT(layers_ctrl, 0)) mjdialq2_copylayer(screen->machine(), bitmap, cliprect, 0); - if (BIT(layers_ctrl, 1)) mjdialq2_copylayer(screen->machine(), bitmap, cliprect, 1); + if (BIT(layers_ctrl, 0)) mjdialq2_copylayer(screen.machine(), bitmap, cliprect, 0); + if (BIT(layers_ctrl, 1)) mjdialq2_copylayer(screen.machine(), bitmap, cliprect, 1); return 0; } @@ -1427,7 +1436,7 @@ VIDEO_START(htengoku) SCREEN_UPDATE(htengoku) { - dynax_state *state = screen->machine().driver_data(); + dynax_state *state = screen.machine().driver_data(); int layer, x, y; // render the layers, one by one, "dynax.c" style. Then convert the pixmaps to "ddenlovr.c" @@ -1435,7 +1444,7 @@ SCREEN_UPDATE(htengoku) for (layer = 0; layer < 4; layer++) { bitmap_fill(bitmap, cliprect, 0); - hanamai_copylayer(screen->machine(), bitmap, cliprect, layer); + hanamai_copylayer(screen.machine(), bitmap, cliprect, layer); for (y = 0; y < 256; y++) for (x = 0; x < 512; x++) diff --git a/src/mame/video/dynduke.c b/src/mame/video/dynduke.c index acc165c7338..410a04751c3 100644 --- a/src/mame/video/dynduke.c +++ b/src/mame/video/dynduke.c @@ -230,7 +230,7 @@ static void draw_background(running_machine &machine, bitmap_t *bitmap, const re SCREEN_UPDATE( dynduke ) { - dynduke_state *state = screen->machine().driver_data(); + dynduke_state *state = screen.machine().driver_data(); /* Setup the tilemaps */ tilemap_set_scrolly( state->m_fg_layer,0, ((state->m_scroll_ram[0x11]&0x30)<<4)+((state->m_scroll_ram[0x12]&0x7f)<<1)+((state->m_scroll_ram[0x12]&0x80)>>7) ); tilemap_set_scrollx( state->m_fg_layer,0, ((state->m_scroll_ram[0x19]&0x30)<<4)+((state->m_scroll_ram[0x1a]&0x7f)<<1)+((state->m_scroll_ram[0x1a]&0x80)>>7) ); @@ -238,14 +238,14 @@ SCREEN_UPDATE( dynduke ) tilemap_set_enable( state->m_tx_layer,state->m_txt_enable); - draw_background(screen->machine(), bitmap, cliprect,0x00); - draw_sprites(screen->machine(),bitmap,cliprect,0); // Untested: does anything use it? Could be behind background - draw_sprites(screen->machine(),bitmap,cliprect,1); - draw_background(screen->machine(), bitmap, cliprect,0x20); + draw_background(screen.machine(), bitmap, cliprect,0x00); + draw_sprites(screen.machine(),bitmap,cliprect,0); // Untested: does anything use it? Could be behind background + draw_sprites(screen.machine(),bitmap,cliprect,1); + draw_background(screen.machine(), bitmap, cliprect,0x20); - draw_sprites(screen->machine(),bitmap,cliprect,2); + draw_sprites(screen.machine(),bitmap,cliprect,2); tilemap_draw(bitmap,cliprect,state->m_fg_layer,0,0); - draw_sprites(screen->machine(),bitmap,cliprect,3); + draw_sprites(screen.machine(),bitmap,cliprect,3); tilemap_draw(bitmap,cliprect,state->m_tx_layer,0,0); return 0; @@ -253,7 +253,7 @@ SCREEN_UPDATE( dynduke ) SCREEN_EOF( dynduke ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram16_w(space, 0, 0, 0xffff); // Could be a memory location instead } diff --git a/src/mame/video/eolith.c b/src/mame/video/eolith.c index 4eda1c7a1fb..a2943c1e1a3 100644 --- a/src/mame/video/eolith.c +++ b/src/mame/video/eolith.c @@ -40,7 +40,7 @@ VIDEO_START( eolith ) SCREEN_UPDATE( eolith ) { - eolith_state *state = screen->machine().driver_data(); + eolith_state *state = screen.machine().driver_data(); int y; for (y = 0; y < 240; y++) diff --git a/src/mame/video/epos.c b/src/mame/video/epos.c index 19f525d3864..af19d650fd0 100644 --- a/src/mame/video/epos.c +++ b/src/mame/video/epos.c @@ -74,11 +74,11 @@ WRITE8_HANDLER( epos_port_1_w ) SCREEN_UPDATE( epos ) { - epos_state *state = screen->machine().driver_data(); + epos_state *state = screen.machine().driver_data(); pen_t pens[0x20]; offs_t offs; - get_pens(screen->machine(), pens); + get_pens(screen.machine(), pens); for (offs = 0; offs < state->m_videoram_size; offs++) { diff --git a/src/mame/video/eprom.c b/src/mame/video/eprom.c index 9fad4de2647..2a49d66f4e2 100644 --- a/src/mame/video/eprom.c +++ b/src/mame/video/eprom.c @@ -236,18 +236,18 @@ void eprom_scanline_update(screen_device &screen, int scanline) SCREEN_UPDATE( eprom ) { - eprom_state *state = screen->machine().driver_data(); + eprom_state *state = screen.machine().driver_data(); atarimo_rect_list rectlist; bitmap_t *mobitmap; int x, y, r; if (state->m_video_disable) { - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); return 0; } - update_palette(screen->machine()); + update_palette(screen.machine()); /* draw the playfield */ tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 0, 0); @@ -391,18 +391,18 @@ SCREEN_UPDATE( eprom ) SCREEN_UPDATE( guts ) { - eprom_state *state = screen->machine().driver_data(); + eprom_state *state = screen.machine().driver_data(); atarimo_rect_list rectlist; bitmap_t *mobitmap; int x, y, r; if (state->m_video_disable) { - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); return 0; } - update_palette(screen->machine()); + update_palette(screen.machine()); /* draw the playfield */ tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 0, 0); diff --git a/src/mame/video/equites.c b/src/mame/video/equites.c index a4915598ee3..e05c3399068 100644 --- a/src/mame/video/equites.c +++ b/src/mame/video/equites.c @@ -465,12 +465,12 @@ static void splndrbt_copy_bg( running_machine &machine, bitmap_t *dst_bitmap, co SCREEN_UPDATE( equites ) { - equites_state *state = screen->machine().driver_data(); + equites_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, state->m_bgcolor); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - equites_draw_sprites(screen->machine(), bitmap, cliprect); + equites_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); @@ -479,15 +479,15 @@ SCREEN_UPDATE( equites ) SCREEN_UPDATE( splndrbt ) { - equites_state *state = screen->machine().driver_data(); + equites_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, state->m_bgcolor); - splndrbt_copy_bg(screen->machine(), bitmap, cliprect); + splndrbt_copy_bg(screen.machine(), bitmap, cliprect); if (state->m_fg_char_bank) tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - splndrbt_draw_sprites(screen->machine(), bitmap, cliprect); + splndrbt_draw_sprites(screen.machine(), bitmap, cliprect); if (!state->m_fg_char_bank) tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); diff --git a/src/mame/video/esd16.c b/src/mame/video/esd16.c index 1d40849ced1..c0563a84313 100644 --- a/src/mame/video/esd16.c +++ b/src/mame/video/esd16.c @@ -325,10 +325,10 @@ static void hedpanic_draw_sprites( running_machine &machine, bitmap_t *bitmap, c SCREEN_UPDATE( esd16 ) { - esd16_state *state = screen->machine().driver_data(); + esd16_state *state = screen.machine().driver_data(); int layers_ctrl = -1; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_set_scrollx(state->m_tilemap_0, 0, state->m_scroll_0[0]); tilemap_set_scrolly(state->m_tilemap_0, 0, state->m_scroll_0[1]); @@ -337,12 +337,12 @@ SCREEN_UPDATE( esd16 ) tilemap_set_scrolly(state->m_tilemap_1, 0, state->m_scroll_1[1]); #ifdef MAME_DEBUG -if (screen->machine().input().code_pressed(KEYCODE_Z)) +if (screen.machine().input().code_pressed(KEYCODE_Z)) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= 2; - if (screen->machine().input().code_pressed(KEYCODE_A)) msk |= 4; + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= 4; if (msk != 0) layers_ctrl &= msk; } #endif @@ -352,25 +352,25 @@ if (screen->machine().input().code_pressed(KEYCODE_Z)) if (layers_ctrl & 2) tilemap_draw(bitmap, cliprect, state->m_tilemap_1, 0, 1); - if (layers_ctrl & 4) esd16_draw_sprites(screen->machine(), bitmap, cliprect); + if (layers_ctrl & 4) esd16_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( hedpanic ) { - esd16_state *state = screen->machine().driver_data(); + esd16_state *state = screen.machine().driver_data(); int layers_ctrl = -1; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); #ifdef MAME_DEBUG -if (screen->machine().input().code_pressed(KEYCODE_Z)) +if (screen.machine().input().code_pressed(KEYCODE_Z)) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= 2; - if (screen->machine().input().code_pressed(KEYCODE_A)) msk |= 4; + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= 4; if (msk != 0) layers_ctrl &= msk; } #endif @@ -413,7 +413,7 @@ if (screen->machine().input().code_pressed(KEYCODE_Z)) } - if (layers_ctrl & 4) hedpanic_draw_sprites(screen->machine(),bitmap,cliprect); + if (layers_ctrl & 4) hedpanic_draw_sprites(screen.machine(),bitmap,cliprect); // popmessage("%04x %04x %04x %04x %04x",head_unknown1[0],head_layersize[0],head_unknown3[0],head_unknown4[0],head_unknown5[0]); return 0; @@ -422,18 +422,18 @@ if (screen->machine().input().code_pressed(KEYCODE_Z)) // uses older style sprites SCREEN_UPDATE( hedpanio ) { - esd16_state *state = screen->machine().driver_data(); + esd16_state *state = screen.machine().driver_data(); int layers_ctrl = -1; - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); #ifdef MAME_DEBUG -if ( screen->machine().input().code_pressed(KEYCODE_Z) ) +if ( screen.machine().input().code_pressed(KEYCODE_Z) ) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= 2; - if (screen->machine().input().code_pressed(KEYCODE_A)) msk |= 4; + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= 4; if (msk != 0) layers_ctrl &= msk; } #endif @@ -476,7 +476,7 @@ if ( screen->machine().input().code_pressed(KEYCODE_Z) ) } - if (layers_ctrl & 4) esd16_draw_sprites(screen->machine(),bitmap,cliprect); + if (layers_ctrl & 4) esd16_draw_sprites(screen.machine(),bitmap,cliprect); // popmessage("%04x %04x %04x %04x %04x",head_unknown1[0],head_layersize[0],head_unknown3[0],head_unknown4[0],head_unknown5[0]); return 0; diff --git a/src/mame/video/espial.c b/src/mame/video/espial.c index d28f73bb127..fb021064ef1 100644 --- a/src/mame/video/espial.c +++ b/src/mame/video/espial.c @@ -234,9 +234,9 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( espial ) { - espial_state *state = screen->machine().driver_data(); + espial_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/esripsys.c b/src/mame/video/esripsys.c index 4980f92209b..0d37a806762 100644 --- a/src/mame/video/esripsys.c +++ b/src/mame/video/esripsys.c @@ -153,7 +153,7 @@ VIDEO_START( esripsys ) SCREEN_UPDATE( esripsys ) { - esripsys_state *state = screen->machine().driver_data(); + esripsys_state *state = screen.machine().driver_data(); struct line_buffer_t *line_buffer = state->m_line_buffer; int x, y; diff --git a/src/mame/video/exedexes.c b/src/mame/video/exedexes.c index 4f316a79a43..65a2e3078d3 100644 --- a/src/mame/video/exedexes.c +++ b/src/mame/video/exedexes.c @@ -219,7 +219,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( exedexes ) { - exedexes_state *state = screen->machine().driver_data(); + exedexes_state *state = screen.machine().driver_data(); if (state->m_sc2on) { tilemap_set_scrollx(state->m_bg_tilemap, 0, ((state->m_bg_scroll[1]) << 8) + state->m_bg_scroll[0]); @@ -228,7 +228,7 @@ SCREEN_UPDATE( exedexes ) else bitmap_fill(bitmap, cliprect, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); if (state->m_sc1on) { @@ -237,7 +237,7 @@ SCREEN_UPDATE( exedexes ) tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); } - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0); if (state->m_chon) tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); @@ -247,7 +247,7 @@ SCREEN_UPDATE( exedexes ) SCREEN_EOF( exedexes ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram_w(space, 0, 0); } diff --git a/src/mame/video/exerion.c b/src/mame/video/exerion.c index fbb4ab8fa07..6359677f5d6 100644 --- a/src/mame/video/exerion.c +++ b/src/mame/video/exerion.c @@ -352,11 +352,11 @@ static void draw_background( running_machine &machine, bitmap_t *bitmap, const r SCREEN_UPDATE( exerion ) { - exerion_state *state = screen->machine().driver_data(); + exerion_state *state = screen.machine().driver_data(); int sx, sy, offs, i; /* draw background */ - draw_background(screen->machine(), bitmap, cliprect); + draw_background(screen.machine(), bitmap, cliprect); /* draw sprites */ for (i = 0; i < state->m_spriteram_size; i += 4) @@ -373,7 +373,7 @@ SCREEN_UPDATE( exerion ) int code2 = code; int color = ((flags >> 1) & 0x03) | ((code >> 5) & 0x04) | (code & 0x08) | (state->m_sprite_palette * 16); - const gfx_element *gfx = doubled ? screen->machine().gfx[2] : screen->machine().gfx[1]; + const gfx_element *gfx = doubled ? screen.machine().gfx[2] : screen.machine().gfx[1]; if (state->m_cocktail_flip) { @@ -392,11 +392,11 @@ SCREEN_UPDATE( exerion ) code &= ~0x10, code2 |= 0x10; drawgfx_transmask(bitmap, cliprect, gfx, code2, color, xflip, yflip, x, y + gfx->height, - colortable_get_transpen_mask(screen->machine().colortable, gfx, color, 0x10)); + colortable_get_transpen_mask(screen.machine().colortable, gfx, color, 0x10)); } drawgfx_transmask(bitmap, cliprect, gfx, code, color, xflip, yflip, x, y, - colortable_get_transpen_mask(screen->machine().colortable, gfx, color, 0x10)); + colortable_get_transpen_mask(screen.machine().colortable, gfx, color, 0x10)); if (doubled) i += 4; } @@ -409,7 +409,7 @@ SCREEN_UPDATE( exerion ) int y = state->m_cocktail_flip ? (31*8 - 8*sy) : 8*sy; offs = sx + sy * 64; - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], state->m_videoram[offs] + 256 * state->m_char_bank, ((state->m_videoram[offs] & 0xf0) >> 4) + state->m_char_palette * 16, state->m_cocktail_flip, state->m_cocktail_flip, x, y, 0); diff --git a/src/mame/video/exidy.c b/src/mame/video/exidy.c index 1b8ab4bc46f..3d046af72af 100644 --- a/src/mame/video/exidy.c +++ b/src/mame/video/exidy.c @@ -361,19 +361,19 @@ static void check_collision(running_machine &machine) SCREEN_UPDATE( exidy ) { - exidy_state *state = screen->machine().driver_data(); + exidy_state *state = screen.machine().driver_data(); /* refresh the colors from the palette (static or dynamic) */ - set_colors(screen->machine()); + set_colors(screen.machine()); /* update the background and draw it */ - draw_background(screen->machine()); + draw_background(screen.machine()); copybitmap(bitmap, state->m_background_bitmap, 0, 0, 0, 0, cliprect); /* draw the sprites */ - draw_sprites(screen->machine(), bitmap, NULL); + draw_sprites(screen.machine(), bitmap, NULL); /* check for collision, this will set the appropriate bits in collision_mask */ - check_collision(screen->machine()); + check_collision(screen.machine()); return 0; } diff --git a/src/mame/video/exidy440.c b/src/mame/video/exidy440.c index a542c6cd5aa..c23f4de02e6 100644 --- a/src/mame/video/exidy440.c +++ b/src/mame/video/exidy440.c @@ -436,15 +436,15 @@ static void update_screen(screen_device &screen, bitmap_t *bitmap, const rectang static SCREEN_UPDATE( exidy440 ) { /* redraw the screen */ - update_screen(*screen, bitmap, cliprect, 0, TRUE); + update_screen(screen, bitmap, cliprect, 0, TRUE); /* generate an interrupt once/frame for the beam */ - if (cliprect->max_y == screen->visible_area().max_y) + if (cliprect->max_y == screen.visible_area().max_y) { int i; - int beamx = ((input_port_read(screen->machine(), "AN0") & 0xff) * (HBSTART - HBEND)) >> 8; - int beamy = ((input_port_read(screen->machine(), "AN1") & 0xff) * (VBSTART - VBEND)) >> 8; + int beamx = ((input_port_read(screen.machine(), "AN0") & 0xff) * (HBSTART - HBEND)) >> 8; + int beamy = ((input_port_read(screen.machine(), "AN1") & 0xff) * (VBSTART - VBEND)) >> 8; /* The timing of this FIRQ is very important. The games look for an FIRQ and then wait about 650 cycles, clear the old FIRQ, and wait a @@ -452,11 +452,11 @@ static SCREEN_UPDATE( exidy440 ) From this, it appears that they are expecting to get beams over a 12 scanline period, and trying to pick roughly the middle one. This is how it is implemented. */ - attotime increment = screen->scan_period(); - attotime time = screen->time_until_pos(beamy, beamx) - increment * 6; + attotime increment = screen.scan_period(); + attotime time = screen.time_until_pos(beamy, beamx) - increment * 6; for (i = 0; i <= 12; i++) { - screen->machine().scheduler().timer_set(time, FUNC(beam_firq_callback), beamx); + screen.machine().scheduler().timer_set(time, FUNC(beam_firq_callback), beamx); time += increment; } } @@ -467,9 +467,9 @@ static SCREEN_UPDATE( exidy440 ) static SCREEN_UPDATE( topsecex ) { - exidy440_state *state = screen->machine().driver_data(); + exidy440_state *state = screen.machine().driver_data(); /* redraw the screen */ - update_screen(*screen, bitmap, cliprect, *state->m_topsecex_yscroll, FALSE); + update_screen(screen, bitmap, cliprect, *state->m_topsecex_yscroll, FALSE); return 0; } diff --git a/src/mame/video/exprraid.c b/src/mame/video/exprraid.c index 48daa6922f3..7fb3c5df457 100644 --- a/src/mame/video/exprraid.c +++ b/src/mame/video/exprraid.c @@ -138,9 +138,9 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( exprraid ) { - exprraid_state *state = screen->machine().driver_data(); + exprraid_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 1, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; diff --git a/src/mame/video/exzisus.c b/src/mame/video/exzisus.c index 8383fdf2bb4..0170d5b80e9 100644 --- a/src/mame/video/exzisus.c +++ b/src/mame/video/exzisus.c @@ -78,7 +78,7 @@ WRITE8_HANDLER( exzisus_objectram_1_w ) SCREEN_UPDATE( exzisus ) { - exzisus_state *state = screen->machine().driver_data(); + exzisus_state *state = screen.machine().driver_data(); int offs; int sx, sy, xc, yc; int gfx_num, gfx_attr, gfx_offs; @@ -139,16 +139,16 @@ SCREEN_UPDATE( exzisus ) x = (sx + (xc << 3)) & 0xff; y = (sy + (yc << 3)) & 0xff; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { x = 248 - x; y = 248 - y; } - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], code & 0x3fff, color, - flip_screen_get(screen->machine()), flip_screen_get(screen->machine()), + flip_screen_get(screen.machine()), flip_screen_get(screen.machine()), x, y, 15); goffs += 2; } @@ -208,16 +208,16 @@ SCREEN_UPDATE( exzisus ) x = (sx + (xc << 3)) & 0xff; y = (sy + (yc << 3)) & 0xff; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { x = 248 - x; y = 248 - y; } - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], code & 0x3fff, color, - flip_screen_get(screen->machine()), flip_screen_get(screen->machine()), + flip_screen_get(screen.machine()), flip_screen_get(screen.machine()), x, y, 15); goffs += 2; } diff --git a/src/mame/video/f1gp.c b/src/mame/video/f1gp.c index 5990e89fd70..0611e46b8b9 100644 --- a/src/mame/video/f1gp.c +++ b/src/mame/video/f1gp.c @@ -252,9 +252,9 @@ static void f1gp_draw_sprites( running_machine &machine, bitmap_t *bitmap, const SCREEN_UPDATE( f1gp ) { - f1gp_state *state = screen->machine().driver_data(); + f1gp_state *state = screen.machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); k053936_zoom_draw(state->m_k053936, bitmap, cliprect, state->m_roz_tilemap, 0, 0, 1); @@ -263,13 +263,13 @@ SCREEN_UPDATE( f1gp ) /* quick kludge for "continue" screen priority */ if (state->m_gfxctrl == 0x00) { - f1gp_draw_sprites(screen->machine(), bitmap, cliprect, 0, 0x02); - f1gp_draw_sprites(screen->machine(), bitmap, cliprect, 1, 0x02); + f1gp_draw_sprites(screen.machine(), bitmap, cliprect, 0, 0x02); + f1gp_draw_sprites(screen.machine(), bitmap, cliprect, 1, 0x02); } else { - f1gp_draw_sprites(screen->machine(), bitmap, cliprect, 0, 0x00); - f1gp_draw_sprites(screen->machine(), bitmap, cliprect, 1, 0x02); + f1gp_draw_sprites(screen.machine(), bitmap, cliprect, 0, 0x00); + f1gp_draw_sprites(screen.machine(), bitmap, cliprect, 1, 0x02); } return 0; } @@ -345,7 +345,7 @@ static void f1gpb_draw_sprites( running_machine &machine, bitmap_t *bitmap,const SCREEN_UPDATE( f1gpb ) { - f1gp_state *state = screen->machine().driver_data(); + f1gp_state *state = screen.machine().driver_data(); UINT32 startx, starty; int incxx, incxy, incyx, incyy; @@ -357,7 +357,7 @@ SCREEN_UPDATE( f1gpb ) tilemap_set_scrolly(state->m_fg_tilemap, 0, state->m_fgregs[0] + 8); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw_roz(bitmap, cliprect, state->m_roz_tilemap, startx << 13, starty << 13, @@ -366,7 +366,7 @@ SCREEN_UPDATE( f1gpb ) tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 1); - f1gpb_draw_sprites(screen->machine(), bitmap, cliprect); + f1gpb_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } @@ -446,28 +446,28 @@ static void f1gp2_draw_sprites( running_machine &machine, bitmap_t *bitmap, cons SCREEN_UPDATE( f1gp2 ) { - f1gp_state *state = screen->machine().driver_data(); + f1gp_state *state = screen.machine().driver_data(); if (state->m_gfxctrl & 4) /* blank screen */ - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); else { switch (state->m_gfxctrl & 3) { case 0: k053936_zoom_draw(state->m_k053936, bitmap, cliprect, state->m_roz_tilemap, TILEMAP_DRAW_OPAQUE, 0, 1); - f1gp2_draw_sprites(screen->machine(), bitmap, cliprect); + f1gp2_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); break; case 1: k053936_zoom_draw(state->m_k053936, bitmap, cliprect, state->m_roz_tilemap, TILEMAP_DRAW_OPAQUE, 0, 1); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - f1gp2_draw_sprites(screen->machine(), bitmap, cliprect); + f1gp2_draw_sprites(screen.machine(), bitmap, cliprect); break; case 2: tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, TILEMAP_DRAW_OPAQUE, 0); k053936_zoom_draw(state->m_k053936, bitmap, cliprect, state->m_roz_tilemap, 0, 0, 1); - f1gp2_draw_sprites(screen->machine(), bitmap, cliprect); + f1gp2_draw_sprites(screen.machine(), bitmap, cliprect); break; #ifdef MAME_DEBUG case 3: diff --git a/src/mame/video/fantland.c b/src/mame/video/fantland.c index f3ef1f4f4e6..29ba51c450d 100644 --- a/src/mame/video/fantland.c +++ b/src/mame/video/fantland.c @@ -142,7 +142,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( fantland ) { bitmap_fill(bitmap,cliprect,0); - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); return 0; } diff --git a/src/mame/video/fastfred.c b/src/mame/video/fastfred.c index f69533115c6..e1f74df6385 100644 --- a/src/mame/video/fastfred.c +++ b/src/mame/video/fastfred.c @@ -309,10 +309,10 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( fastfred ) { - fastfred_state *state = screen->machine().driver_data(); + fastfred_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, *state->m_background_color); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } @@ -379,11 +379,11 @@ VIDEO_START( imago ) SCREEN_UPDATE( imago ) { - fastfred_state *state = screen->machine().driver_data(); + fastfred_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_web_tilemap,0,0); - galaxold_draw_stars(screen->machine(), bitmap, cliprect); + galaxold_draw_stars(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); return 0; diff --git a/src/mame/video/fastlane.c b/src/mame/video/fastlane.c index 4af6ad68727..db18a2ac69b 100644 --- a/src/mame/video/fastlane.c +++ b/src/mame/video/fastlane.c @@ -157,14 +157,14 @@ WRITE8_HANDLER( fastlane_vram2_w ) SCREEN_UPDATE( fastlane ) { - fastlane_state *state = screen->machine().driver_data(); + fastlane_state *state = screen.machine().driver_data(); rectangle finalclip0 = state->m_clip0, finalclip1 = state->m_clip1; int i, xoffs; sect_rect(&finalclip0, cliprect); sect_rect(&finalclip1, cliprect); - set_pens(screen->machine()); + set_pens(screen.machine()); /* set scroll registers */ xoffs = k007121_ctrlram_r(state->m_k007121, 0); @@ -174,7 +174,7 @@ SCREEN_UPDATE( fastlane ) tilemap_set_scrolly(state->m_layer0, 0, k007121_ctrlram_r(state->m_k007121, 2)); tilemap_draw(bitmap, &finalclip0, state->m_layer0, 0, 0); - k007121_sprites_draw(state->m_k007121, bitmap, cliprect, screen->machine().gfx[0], screen->machine().colortable, state->m_spriteram, 0, 40, 0, (UINT32)-1); + k007121_sprites_draw(state->m_k007121, bitmap, cliprect, screen.machine().gfx[0], screen.machine().colortable, state->m_spriteram, 0, 40, 0, (UINT32)-1); tilemap_draw(bitmap, &finalclip1, state->m_layer1, 0, 0); return 0; } diff --git a/src/mame/video/fcombat.c b/src/mame/video/fcombat.c index 83ec1e508fb..1fdec30c16e 100644 --- a/src/mame/video/fcombat.c +++ b/src/mame/video/fcombat.c @@ -136,7 +136,7 @@ WRITE8_HANDLER( fcombat_videoreg_w ) SCREEN_UPDATE( fcombat ) { - fcombat_state *state = screen->machine().driver_data(); + fcombat_state *state = screen.machine().driver_data(); int sx, sy, offs, i; /* draw background */ @@ -162,7 +162,7 @@ SCREEN_UPDATE( fcombat ) int code2 = code; int color = ((flags >> 1) & 0x03) | ((code >> 5) & 0x04) | (code & 0x08) | (state->m_sprite_palette * 16); - const gfx_element *gfx = screen->machine().gfx[1]; + const gfx_element *gfx = screen.machine().gfx[1]; if (state->m_cocktail_flip) { @@ -204,7 +204,7 @@ SCREEN_UPDATE( fcombat ) int y = state->m_cocktail_flip ? (31 * 8 - 8 * sy) : 8 * sy; offs = sx + sy * 64; - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], state->m_videoram[offs] + 256 * state->m_char_bank, ((state->m_videoram[offs] & 0xf0) >> 4) + state->m_char_palette * 16, state->m_cocktail_flip, state->m_cocktail_flip, x, y, 0); diff --git a/src/mame/video/fgoal.c b/src/mame/video/fgoal.c index 76b03d4591d..d64e122a70e 100644 --- a/src/mame/video/fgoal.c +++ b/src/mame/video/fgoal.c @@ -42,7 +42,7 @@ VIDEO_START( fgoal ) SCREEN_UPDATE( fgoal ) { - fgoal_state *state = screen->machine().driver_data(); + fgoal_state *state = screen.machine().driver_data(); const UINT8* VRAM = state->m_video_ram; int x; @@ -51,16 +51,16 @@ SCREEN_UPDATE( fgoal ) /* draw color overlay foreground and background */ - if (state->m_fgoal_player == 1 && (input_port_read(screen->machine(), "IN1") & 0x40)) + if (state->m_fgoal_player == 1 && (input_port_read(screen.machine(), "IN1") & 0x40)) { - drawgfxzoom_opaque(state->m_fgbitmap, cliprect, screen->machine().gfx[0], + drawgfxzoom_opaque(state->m_fgbitmap, cliprect, screen.machine().gfx[0], 0, (state->m_fgoal_player << 2) | state->m_current_color, 1, 1, 0, 16, 0x40000, 0x40000); - drawgfxzoom_opaque(state->m_bgbitmap, cliprect, screen->machine().gfx[1], + drawgfxzoom_opaque(state->m_bgbitmap, cliprect, screen.machine().gfx[1], 0, 0, 1, 1, 0, 16, @@ -69,14 +69,14 @@ SCREEN_UPDATE( fgoal ) } else { - drawgfxzoom_opaque(state->m_fgbitmap, cliprect, screen->machine().gfx[0], + drawgfxzoom_opaque(state->m_fgbitmap, cliprect, screen.machine().gfx[0], 0, (state->m_fgoal_player << 2) | state->m_current_color, 0, 0, 0, 0, 0x40000, 0x40000); - drawgfxzoom_opaque(state->m_bgbitmap, cliprect, screen->machine().gfx[1], + drawgfxzoom_opaque(state->m_bgbitmap, cliprect, screen.machine().gfx[1], 0, 0, 0, 0, 0, 0, diff --git a/src/mame/video/finalizr.c b/src/mame/video/finalizr.c index 6a3e340939f..fb4d2a3399c 100644 --- a/src/mame/video/finalizr.c +++ b/src/mame/video/finalizr.c @@ -87,7 +87,7 @@ WRITE8_HANDLER( finalizr_videoctrl_w ) SCREEN_UPDATE( finalizr ) { - finalizr_state *state = screen->machine().driver_data(); + finalizr_state *state = screen.machine().driver_data(); int offs; tilemap_mark_all_tiles_dirty(state->m_bg_tilemap); @@ -98,8 +98,8 @@ SCREEN_UPDATE( finalizr ) /* Draw the sprites. */ { - const gfx_element *gfx1 = screen->machine().gfx[1]; - const gfx_element *gfx2 = screen->machine().gfx[2]; + const gfx_element *gfx1 = screen.machine().gfx[1]; + const gfx_element *gfx2 = screen.machine().gfx[2]; UINT8 *sr = state->m_spriterambank ? state->m_spriteram_2 : state->m_spriteram; @@ -122,7 +122,7 @@ SCREEN_UPDATE( finalizr ) if (size >= 0x10) /* 32x32 */ { - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { sx = 256 - sx; sy = 224 - sy; @@ -153,7 +153,7 @@ SCREEN_UPDATE( finalizr ) } else { - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { sx = ((size & 0x08) ? 280:272) - sx; sy = ((size & 0x04) ? 248:240) - sy; @@ -213,7 +213,7 @@ SCREEN_UPDATE( finalizr ) } { - const rectangle &visarea = screen->visible_area(); + const rectangle &visarea = screen.visible_area(); rectangle clip = *cliprect; /* draw top status region */ diff --git a/src/mame/video/firetrap.c b/src/mame/video/firetrap.c index eb158cf1a01..7f28dd94286 100644 --- a/src/mame/video/firetrap.c +++ b/src/mame/video/firetrap.c @@ -273,10 +273,10 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( firetrap ) { - firetrap_state *state = screen->machine().driver_data(); + firetrap_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/firetrk.c b/src/mame/video/firetrk.c index 5312873d2be..817a1e15192 100644 --- a/src/mame/video/firetrk.c +++ b/src/mame/video/firetrk.c @@ -359,8 +359,8 @@ static void check_collision(firetrk_state *state, int which) SCREEN_UPDATE( firetrk ) { - firetrk_state *state = screen->machine().driver_data(); - tilemap_mark_all_tiles_dirty_all(screen->machine()); + firetrk_state *state = screen.machine().driver_data(); + tilemap_mark_all_tiles_dirty_all(screen.machine()); tilemap_set_scrollx(state->m_tilemap1, 0, *state->m_scroll_x - 37); tilemap_set_scrollx(state->m_tilemap2, 0, *state->m_scroll_x - 37); tilemap_set_scrolly(state->m_tilemap1, 0, *state->m_scroll_y); @@ -368,21 +368,21 @@ SCREEN_UPDATE( firetrk ) bitmap_fill(bitmap, cliprect, 0); tilemap_draw(bitmap, &playfield_window, state->m_tilemap1, 0, 0); - firetrk_draw_car(screen->machine(), bitmap, &playfield_window, screen->machine().gfx, 0, state->m_flash); - firetrk_draw_car(screen->machine(), bitmap, &playfield_window, screen->machine().gfx, 1, state->m_flash); - draw_text(bitmap, cliprect, screen->machine().gfx, state->m_alpha_num_ram + 0x00, 296, 0x10, 0x10); - draw_text(bitmap, cliprect, screen->machine().gfx, state->m_alpha_num_ram + 0x10, 8, 0x10, 0x10); + firetrk_draw_car(screen.machine(), bitmap, &playfield_window, screen.machine().gfx, 0, state->m_flash); + firetrk_draw_car(screen.machine(), bitmap, &playfield_window, screen.machine().gfx, 1, state->m_flash); + draw_text(bitmap, cliprect, screen.machine().gfx, state->m_alpha_num_ram + 0x00, 296, 0x10, 0x10); + draw_text(bitmap, cliprect, screen.machine().gfx, state->m_alpha_num_ram + 0x10, 8, 0x10, 0x10); - if (cliprect->max_y == screen->visible_area().max_y) + if (cliprect->max_y == screen.visible_area().max_y) { tilemap_draw(state->m_helper1, &playfield_window, state->m_tilemap2, 0, 0); bitmap_fill(state->m_helper2, &playfield_window, 0xff); - firetrk_draw_car(screen->machine(), state->m_helper2, &playfield_window, screen->machine().gfx, 0, FALSE); + firetrk_draw_car(screen.machine(), state->m_helper2, &playfield_window, screen.machine().gfx, 0, FALSE); check_collision(state, 0); bitmap_fill(state->m_helper2, &playfield_window, 0xff); - firetrk_draw_car(screen->machine(), state->m_helper2, &playfield_window, screen->machine().gfx, 1, FALSE); + firetrk_draw_car(screen.machine(), state->m_helper2, &playfield_window, screen.machine().gfx, 1, FALSE); check_collision(state, 1); *state->m_blink = FALSE; @@ -394,8 +394,8 @@ SCREEN_UPDATE( firetrk ) SCREEN_UPDATE( superbug ) { - firetrk_state *state = screen->machine().driver_data(); - tilemap_mark_all_tiles_dirty_all(screen->machine()); + firetrk_state *state = screen.machine().driver_data(); + tilemap_mark_all_tiles_dirty_all(screen.machine()); tilemap_set_scrollx(state->m_tilemap1, 0, *state->m_scroll_x - 37); tilemap_set_scrollx(state->m_tilemap2, 0, *state->m_scroll_x - 37); tilemap_set_scrolly(state->m_tilemap1, 0, *state->m_scroll_y); @@ -403,16 +403,16 @@ SCREEN_UPDATE( superbug ) bitmap_fill(bitmap, cliprect, 0); tilemap_draw(bitmap, &playfield_window, state->m_tilemap1, 0, 0); - superbug_draw_car(screen->machine(), bitmap, &playfield_window, screen->machine().gfx, state->m_flash); - draw_text(bitmap, cliprect, screen->machine().gfx, state->m_alpha_num_ram + 0x00, 296, 0x10, 0x10); - draw_text(bitmap, cliprect, screen->machine().gfx, state->m_alpha_num_ram + 0x10, 8, 0x10, 0x10); + superbug_draw_car(screen.machine(), bitmap, &playfield_window, screen.machine().gfx, state->m_flash); + draw_text(bitmap, cliprect, screen.machine().gfx, state->m_alpha_num_ram + 0x00, 296, 0x10, 0x10); + draw_text(bitmap, cliprect, screen.machine().gfx, state->m_alpha_num_ram + 0x10, 8, 0x10, 0x10); - if (cliprect->max_y == screen->visible_area().max_y) + if (cliprect->max_y == screen.visible_area().max_y) { tilemap_draw(state->m_helper1, &playfield_window, state->m_tilemap2, 0, 0); bitmap_fill(state->m_helper2, &playfield_window, 0xff); - superbug_draw_car(screen->machine(), state->m_helper2, &playfield_window, screen->machine().gfx, FALSE); + superbug_draw_car(screen.machine(), state->m_helper2, &playfield_window, screen.machine().gfx, FALSE); check_collision(state, 0); *state->m_blink = FALSE; @@ -424,8 +424,8 @@ SCREEN_UPDATE( superbug ) SCREEN_UPDATE( montecar ) { - firetrk_state *state = screen->machine().driver_data(); - tilemap_mark_all_tiles_dirty_all(screen->machine()); + firetrk_state *state = screen.machine().driver_data(); + tilemap_mark_all_tiles_dirty_all(screen.machine()); tilemap_set_scrollx(state->m_tilemap1, 0, *state->m_scroll_x - 37); tilemap_set_scrollx(state->m_tilemap2, 0, *state->m_scroll_x - 37); tilemap_set_scrolly(state->m_tilemap1, 0, *state->m_scroll_y); @@ -433,21 +433,21 @@ SCREEN_UPDATE( montecar ) bitmap_fill(bitmap, cliprect, 0x2c); tilemap_draw(bitmap, &playfield_window, state->m_tilemap1, 0, 0); - montecar_draw_car(screen->machine(), bitmap, &playfield_window, screen->machine().gfx, 0, FALSE); - montecar_draw_car(screen->machine(), bitmap, &playfield_window, screen->machine().gfx, 1, FALSE); - draw_text(bitmap, cliprect, screen->machine().gfx, state->m_alpha_num_ram + 0x00, 24, 0x20, 0x08); - draw_text(bitmap, cliprect, screen->machine().gfx, state->m_alpha_num_ram + 0x20, 16, 0x20, 0x08); + montecar_draw_car(screen.machine(), bitmap, &playfield_window, screen.machine().gfx, 0, FALSE); + montecar_draw_car(screen.machine(), bitmap, &playfield_window, screen.machine().gfx, 1, FALSE); + draw_text(bitmap, cliprect, screen.machine().gfx, state->m_alpha_num_ram + 0x00, 24, 0x20, 0x08); + draw_text(bitmap, cliprect, screen.machine().gfx, state->m_alpha_num_ram + 0x20, 16, 0x20, 0x08); - if (cliprect->max_y == screen->visible_area().max_y) + if (cliprect->max_y == screen.visible_area().max_y) { tilemap_draw(state->m_helper1, &playfield_window, state->m_tilemap2, 0, 0); bitmap_fill(state->m_helper2, &playfield_window, 0xff); - montecar_draw_car(screen->machine(), state->m_helper2, &playfield_window, screen->machine().gfx, 0, TRUE); + montecar_draw_car(screen.machine(), state->m_helper2, &playfield_window, screen.machine().gfx, 0, TRUE); check_collision(state, 0); bitmap_fill(state->m_helper2, &playfield_window, 0xff); - montecar_draw_car(screen->machine(), state->m_helper2, &playfield_window, screen->machine().gfx, 1, TRUE); + montecar_draw_car(screen.machine(), state->m_helper2, &playfield_window, screen.machine().gfx, 1, TRUE); check_collision(state, 1); } diff --git a/src/mame/video/fitfight.c b/src/mame/video/fitfight.c index 31211f8f27c..2dd6d73ede4 100644 --- a/src/mame/video/fitfight.c +++ b/src/mame/video/fitfight.c @@ -116,7 +116,7 @@ VIDEO_START(fitfight) SCREEN_UPDATE(fitfight) { - fitfight_state *state = screen->machine().driver_data(); + fitfight_state *state = screen.machine().driver_data(); /* scroll isn't right */ @@ -126,15 +126,15 @@ SCREEN_UPDATE(fitfight) vblank = (state->m_fof_700000[0] & 0x8000); if (vblank > 0) - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); else { -// if (screen->machine().input().code_pressed(KEYCODE_Q)) +// if (screen.machine().input().code_pressed(KEYCODE_Q)) // scrollbak = ((state->m_fof_a00000[0] & 0xff00) >> 5) - ((state->m_fof_700000[0] & 0x0038) >> 3); -// else if (screen->machine().input().code_pressed(KEYCODE_W)) +// else if (screen.machine().input().code_pressed(KEYCODE_W)) // scrollbak = ((state->m_fof_a00000[0] & 0xff00) >> 5) + ((state->m_fof_700000[0] & 0x01c0) >> 6); -// else if (screen->machine().input().code_pressed(KEYCODE_E)) +// else if (screen.machine().input().code_pressed(KEYCODE_E)) // scrollbak = ((state->m_fof_a00000[0] & 0xff00) >> 5) - ((state->m_fof_700000[0] & 0x01c0) >> 6); -// else if (screen->machine().input().code_pressed(KEYCODE_R)) +// else if (screen.machine().input().code_pressed(KEYCODE_R)) // scrollbak = ((state->m_fof_a00000[0] & 0xff00) >> 5) + ((state->m_fof_700000[0] & 0x0038) >> 3); // else scrollbak = ((state->m_fof_a00000[0] & 0xff00) >> 5); @@ -142,24 +142,24 @@ SCREEN_UPDATE(fitfight) tilemap_set_scrolly(state->m_fof_bak_tilemap,0, state->m_fof_a00000[0] & 0xff); tilemap_draw(bitmap, cliprect, state->m_fof_bak_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0); -// if (screen->machine().input().code_pressed(KEYCODE_A)) +// if (screen.machine().input().code_pressed(KEYCODE_A)) // scrollmid = ((state->m_fof_900000[0] & 0xff00) >> 5) - ((state->m_fof_700000[0] & 0x01c0) >> 6); -// else if (screen->machine().input().code_pressed(KEYCODE_S)) +// else if (screen.machine().input().code_pressed(KEYCODE_S)) // scrollmid = ((state->m_fof_900000[0] & 0xff00) >> 5) + ((state->m_fof_700000[0] & 0x0038) >> 3); -// else if (screen->machine().input().code_pressed(KEYCODE_D)) +// else if (screen.machine().input().code_pressed(KEYCODE_D)) // scrollmid = ((state->m_fof_900000[0] & 0xff00) >> 5) - ((state->m_fof_700000[0] & 0x0038) >> 3); -// else if (screen->machine().input().code_pressed(KEYCODE_F)) +// else if (screen.machine().input().code_pressed(KEYCODE_F)) // scrollmid = ((state->m_fof_900000[0] & 0xff00) >> 5) + ((state->m_fof_700000[0] & 0x01c0) >> 6); // else scrollmid = ((state->m_fof_900000[0] & 0xff00) >> 5); tilemap_set_scrollx(state->m_fof_mid_tilemap, 0, scrollmid ); tilemap_set_scrolly(state->m_fof_mid_tilemap, 0, state->m_fof_900000[0] & 0xff); -// if (!screen->machine().input().code_pressed(KEYCODE_F)) +// if (!screen.machine().input().code_pressed(KEYCODE_F)) tilemap_draw(bitmap, cliprect, state->m_fof_mid_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); tilemap_draw(bitmap, cliprect, state->m_fof_txt_tilemap, 0, 0); } diff --git a/src/mame/video/flkatck.c b/src/mame/video/flkatck.c index 32d5eb691c7..af1e22d0dd1 100644 --- a/src/mame/video/flkatck.c +++ b/src/mame/video/flkatck.c @@ -134,9 +134,9 @@ WRITE8_HANDLER( flkatck_k007121_regs_w ) SCREEN_UPDATE( flkatck ) { - flkatck_state *state = screen->machine().driver_data(); + flkatck_state *state = screen.machine().driver_data(); rectangle clip[2]; - const rectangle &visarea = screen->visible_area(); + const rectangle &visarea = screen.visible_area(); if (state->m_flipscreen) { @@ -170,7 +170,7 @@ SCREEN_UPDATE( flkatck ) /* draw the graphics */ tilemap_draw(bitmap, &clip[0], state->m_k007121_tilemap[0], 0, 0); - k007121_sprites_draw(state->m_k007121, bitmap, cliprect, screen->machine().gfx[0], NULL, &state->m_k007121_ram[0x1000], 0, 40, 0, (UINT32)-1); + k007121_sprites_draw(state->m_k007121, bitmap, cliprect, screen.machine().gfx[0], NULL, &state->m_k007121_ram[0x1000], 0, 40, 0, (UINT32)-1); tilemap_draw(bitmap, &clip[1], state->m_k007121_tilemap[1], 0, 0); return 0; } diff --git a/src/mame/video/flower.c b/src/mame/video/flower.c index 954c760e531..8d2daa11ecd 100644 --- a/src/mame/video/flower.c +++ b/src/mame/video/flower.c @@ -165,7 +165,7 @@ VIDEO_START(flower) SCREEN_UPDATE( flower ) { - flower_state *state = screen->machine().driver_data(); + flower_state *state = screen.machine().driver_data(); rectangle myclip = *cliprect; tilemap_set_scrolly(state->m_bg0_tilemap,0, state->m_bg0_scroll[0]+16); @@ -174,9 +174,9 @@ SCREEN_UPDATE( flower ) tilemap_draw(bitmap,cliprect,state->m_bg0_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_bg1_tilemap,0,0); - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); - if(flip_screen_get(screen->machine())) + if(flip_screen_get(screen.machine())) { myclip.min_x = cliprect->min_x; myclip.max_x = cliprect->min_x + 15; diff --git a/src/mame/video/flstory.c b/src/mame/video/flstory.c index 7079aa21a35..fa2ef5d89f6 100644 --- a/src/mame/video/flstory.c +++ b/src/mame/video/flstory.c @@ -225,12 +225,12 @@ static void flstory_draw_sprites( running_machine &machine, bitmap_t *bitmap, co SCREEN_UPDATE( flstory ) { - flstory_state *state = screen->machine().driver_data(); + flstory_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0 | TILEMAP_DRAW_LAYER1, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 1 | TILEMAP_DRAW_LAYER1, 0); - flstory_draw_sprites(screen->machine(), bitmap, cliprect, 0x00); + flstory_draw_sprites(screen.machine(), bitmap, cliprect, 0x00); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0 | TILEMAP_DRAW_LAYER0, 0); - flstory_draw_sprites(screen->machine(), bitmap, cliprect, 0x80); + flstory_draw_sprites(screen.machine(), bitmap, cliprect, 0x80); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 1 | TILEMAP_DRAW_LAYER0, 0); return 0; } @@ -282,20 +282,20 @@ static void victnine_draw_sprites( running_machine &machine, bitmap_t *bitmap, c SCREEN_UPDATE( victnine ) { - flstory_state *state = screen->machine().driver_data(); + flstory_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - victnine_draw_sprites(screen->machine(), bitmap, cliprect); + victnine_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( rumba ) { - flstory_state *state = screen->machine().driver_data(); + flstory_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0 | TILEMAP_DRAW_LAYER1, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 1 | TILEMAP_DRAW_LAYER1, 0); - victnine_draw_sprites(screen->machine(), bitmap, cliprect); + victnine_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0 | TILEMAP_DRAW_LAYER0, 0); - victnine_draw_sprites(screen->machine(), bitmap, cliprect); + victnine_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 1 | TILEMAP_DRAW_LAYER0, 0); return 0; } diff --git a/src/mame/video/foodf.c b/src/mame/video/foodf.c index 3e163a3de9c..72d4c6c315e 100644 --- a/src/mame/video/foodf.c +++ b/src/mame/video/foodf.c @@ -116,10 +116,10 @@ WRITE16_HANDLER( foodf_paletteram_w ) SCREEN_UPDATE( foodf ) { - foodf_state *state = screen->machine().driver_data(); + foodf_state *state = screen.machine().driver_data(); int offs; - const gfx_element *gfx = screen->machine().gfx[1]; - bitmap_t *priority_bitmap = screen->machine().priority_bitmap; + const gfx_element *gfx = screen.machine().gfx[1]; + bitmap_t *priority_bitmap = screen.machine().priority_bitmap; UINT16 *spriteram16 = state->m_spriteram; /* first draw the playfield opaquely */ diff --git a/src/mame/video/freekick.c b/src/mame/video/freekick.c index 9e079ba51a8..36927e57c82 100644 --- a/src/mame/video/freekick.c +++ b/src/mame/video/freekick.c @@ -136,24 +136,24 @@ static void freekick_draw_sprites( running_machine &machine, bitmap_t *bitmap, c SCREEN_UPDATE( gigas ) { - freekick_state *state = screen->machine().driver_data(); + freekick_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_freek_tilemap, 0, 0); - gigas_draw_sprites(screen->machine(), bitmap, cliprect); + gigas_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( pbillrd ) { - freekick_state *state = screen->machine().driver_data(); + freekick_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_freek_tilemap, 0, 0); - pbillrd_draw_sprites(screen->machine(), bitmap, cliprect); + pbillrd_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( freekick ) { - freekick_state *state = screen->machine().driver_data(); + freekick_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_freek_tilemap, 0, 0); - freekick_draw_sprites(screen->machine(), bitmap, cliprect); + freekick_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/fromanc2.c b/src/mame/video/fromanc2.c index 342e50ec18d..48ac23e21fd 100644 --- a/src/mame/video/fromanc2.c +++ b/src/mame/video/fromanc2.c @@ -547,34 +547,36 @@ VIDEO_START( fromanc4 ) ******************************************************************************/ -SCREEN_UPDATE( fromanc2 ) +SCREEN_UPDATE( fromanc2_left ) { - fromanc2_state *state = screen->machine().driver_data(); + fromanc2_state *state = screen.machine().driver_data(); int i; - int *scrollx = NULL; - int *scrolly = NULL; - tilemap_t **tilemaps = NULL; - - if (screen == state->m_left_screen) - { - tilemaps = state->m_tilemap[0]; - scrollx = state->m_scrollx[0]; - scrolly = state->m_scrolly[0]; - } - else if (screen == state->m_right_screen) - { - tilemaps = state->m_tilemap[1]; - scrollx = state->m_scrollx[1]; - scrolly = state->m_scrolly[1]; - } for (i = 0; i < 4; i++) { - if (tilemaps[i]) + if (state->m_tilemap[0][i]) { - tilemap_set_scrollx(tilemaps[i], 0, -scrollx[i]); - tilemap_set_scrolly(tilemaps[i], 0, -scrolly[i]); - tilemap_draw(bitmap, cliprect, tilemaps[i], 0, 0); + tilemap_set_scrollx(state->m_tilemap[0][i], 0, -state->m_scrollx[0][i]); + tilemap_set_scrolly(state->m_tilemap[0][i], 0, -state->m_scrolly[0][i]); + tilemap_draw(bitmap, cliprect, state->m_tilemap[0][i], 0, 0); + } + } + + return 0; +} + +SCREEN_UPDATE( fromanc2_right ) +{ + fromanc2_state *state = screen.machine().driver_data(); + int i; + + for (i = 0; i < 4; i++) + { + if (state->m_tilemap[1][i]) + { + tilemap_set_scrollx(state->m_tilemap[1][i], 0, -state->m_scrollx[1][i]); + tilemap_set_scrolly(state->m_tilemap[1][i], 0, -state->m_scrolly[1][i]); + tilemap_draw(bitmap, cliprect, state->m_tilemap[1][i], 0, 0); } } diff --git a/src/mame/video/fromance.c b/src/mame/video/fromance.c index b66377057f9..97d010d8de2 100644 --- a/src/mame/video/fromance.c +++ b/src/mame/video/fromance.c @@ -424,7 +424,7 @@ static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectang SCREEN_UPDATE( fromance ) { - fromance_state *state = screen->machine().driver_data(); + fromance_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_scrollx[0]); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_scrolly[0]); @@ -439,7 +439,7 @@ SCREEN_UPDATE( fromance ) SCREEN_UPDATE( pipedrm ) { - fromance_state *state = screen->machine().driver_data(); + fromance_state *state = screen.machine().driver_data(); /* there seems to be no logical mapping for the X scroll register -- maybe it's gone */ tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_scrolly[1]); @@ -448,7 +448,7 @@ SCREEN_UPDATE( pipedrm ) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - draw_sprites(*screen, bitmap, cliprect, 0); - draw_sprites(*screen, bitmap, cliprect, 1); + draw_sprites(screen, bitmap, cliprect, 0); + draw_sprites(screen, bitmap, cliprect, 1); return 0; } diff --git a/src/mame/video/funkybee.c b/src/mame/video/funkybee.c index 36ae59b82c3..bb880c50742 100644 --- a/src/mame/video/funkybee.c +++ b/src/mame/video/funkybee.c @@ -162,9 +162,9 @@ static void draw_columns( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( funkybee ) { - funkybee_state *state = screen->machine().driver_data(); + funkybee_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); - draw_columns(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); + draw_columns(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/funkyjet.c b/src/mame/video/funkyjet.c index 57a548b358c..3fd8e4ff863 100644 --- a/src/mame/video/funkyjet.c +++ b/src/mame/video/funkyjet.c @@ -13,15 +13,15 @@ SCREEN_UPDATE( funkyjet ) { - funkyjet_state *state = screen->machine().driver_data(); + funkyjet_state *state = screen.machine().driver_data(); UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); - flip_screen_set(screen->machine(), BIT(flip, 7)); + flip_screen_set(screen.machine(), BIT(flip, 7)); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); bitmap_fill(bitmap, cliprect, 768); deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram, 0x400); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0x400); return 0; } diff --git a/src/mame/video/funworld.c b/src/mame/video/funworld.c index c766394c35a..20c49e83f84 100644 --- a/src/mame/video/funworld.c +++ b/src/mame/video/funworld.c @@ -197,7 +197,7 @@ VIDEO_START(magicrd2) SCREEN_UPDATE(funworld) { - funworld_state *state = screen->machine().driver_data(); + funworld_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/funybubl.c b/src/mame/video/funybubl.c index 5027e3f13c1..6133cca14f6 100644 --- a/src/mame/video/funybubl.c +++ b/src/mame/video/funybubl.c @@ -75,11 +75,11 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE(funybubl) { - funybubl_state *state = screen->machine().driver_data(); + funybubl_state *state = screen.machine().driver_data(); int x, y, offs; offs = 0; - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); /* tilemap .. convert it .. banking makes it slightly more annoying but still easy */ for (y = 0; y < 32; y++) @@ -89,15 +89,15 @@ SCREEN_UPDATE(funybubl) int data; data = state->m_banked_vram[offs] | (state->m_banked_vram[offs + 1] << 8); - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], data & 0x7fff, (data & 0x8000) ? 2 : 1, 0, 0, x*8, y*8, 0); + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], data & 0x7fff, (data & 0x8000) ? 2 : 1, 0, 0, x*8, y*8, 0); offs += 2; } } - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); #if 0 - if ( screen->machine().input().code_pressed_once(KEYCODE_W) ) + if ( screen.machine().input().code_pressed_once(KEYCODE_W) ) { FILE *fp; diff --git a/src/mame/video/fuukifg2.c b/src/mame/video/fuukifg2.c index 3db5246dd6e..7ef26341dc6 100644 --- a/src/mame/video/fuukifg2.c +++ b/src/mame/video/fuukifg2.c @@ -284,7 +284,7 @@ static void fuuki16_draw_layer( running_machine &machine, bitmap_t *bitmap, cons SCREEN_UPDATE( fuuki16 ) { - fuuki16_state *state = screen->machine().driver_data(); + fuuki16_state *state = screen.machine().driver_data(); UINT16 layer0_scrollx, layer0_scrolly; UINT16 layer1_scrollx, layer1_scrolly; UINT16 layer2_scrollx, layer2_scrolly; @@ -306,12 +306,12 @@ SCREEN_UPDATE( fuuki16 ) int tm_middle = pri_table[state->m_priority[0] & 0x0f][1]; int tm_back = pri_table[state->m_priority[0] & 0x0f][2]; - flip_screen_set(screen->machine(), state->m_vregs[0x1e / 2] & 1); + flip_screen_set(screen.machine(), state->m_vregs[0x1e / 2] & 1); /* Layers scrolling */ - scrolly_offs = state->m_vregs[0xc / 2] - (flip_screen_get(screen->machine()) ? 0x103 : 0x1f3); - scrollx_offs = state->m_vregs[0xe / 2] - (flip_screen_get(screen->machine()) ? 0x2a7 : 0x3f6); + scrolly_offs = state->m_vregs[0xc / 2] - (flip_screen_get(screen.machine()) ? 0x103 : 0x1f3); + scrollx_offs = state->m_vregs[0xe / 2] - (flip_screen_get(screen.machine()) ? 0x2a7 : 0x3f6); layer0_scrolly = state->m_vregs[0x0 / 2] + scrolly_offs; layer0_scrollx = state->m_vregs[0x2 / 2] + scrollx_offs; @@ -334,17 +334,17 @@ SCREEN_UPDATE( fuuki16 ) /* The backmost tilemap decides the background color(s) but sprites can go below the opaque pixels of that tilemap. We thus need to mark the transparent pixels of this layer with a different priority value */ -// fuuki16_draw_layer(screen->machine(), bitmap, cliprect, tm_back, TILEMAP_DRAW_OPAQUE, 0); +// fuuki16_draw_layer(screen.machine(), bitmap, cliprect, tm_back, TILEMAP_DRAW_OPAQUE, 0); /* Actually, bg colour is simply the last pen i.e. 0x1fff -pjp */ bitmap_fill(bitmap, cliprect, (0x800 * 4) - 1); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); - fuuki16_draw_layer(screen->machine(), bitmap, cliprect, tm_back, 0, 1); - fuuki16_draw_layer(screen->machine(), bitmap, cliprect, tm_middle, 0, 2); - fuuki16_draw_layer(screen->machine(), bitmap, cliprect, tm_front, 0, 4); + fuuki16_draw_layer(screen.machine(), bitmap, cliprect, tm_back, 0, 1); + fuuki16_draw_layer(screen.machine(), bitmap, cliprect, tm_middle, 0, 2); + fuuki16_draw_layer(screen.machine(), bitmap, cliprect, tm_front, 0, 4); - draw_sprites(*screen, bitmap, cliprect); + draw_sprites(screen, bitmap, cliprect); return 0; } diff --git a/src/mame/video/fuukifg3.c b/src/mame/video/fuukifg3.c index e1552bb8d65..3affefcc226 100644 --- a/src/mame/video/fuukifg3.c +++ b/src/mame/video/fuukifg3.c @@ -308,7 +308,7 @@ static void fuuki32_draw_layer( running_machine &machine, bitmap_t *bitmap, cons SCREEN_UPDATE( fuuki32 ) { - fuuki32_state *state = screen->machine().driver_data(); + fuuki32_state *state = screen.machine().driver_data(); UINT16 layer0_scrollx, layer0_scrolly; UINT16 layer1_scrollx, layer1_scrolly; UINT16 layer2_scrollx, layer2_scrolly; @@ -330,12 +330,12 @@ SCREEN_UPDATE( fuuki32 ) int tm_middle = pri_table[(state->m_priority[0] >> 16) & 0x0f][1]; int tm_back = pri_table[(state->m_priority[0] >> 16) & 0x0f][2]; - flip_screen_set(screen->machine(), (state->m_vregs[0x1e / 4] & 0x0000ffff) & 1); + flip_screen_set(screen.machine(), (state->m_vregs[0x1e / 4] & 0x0000ffff) & 1); /* Layers scrolling */ - scrolly_offs = ((state->m_vregs[0xc / 4] & 0xffff0000) >> 16) - (flip_screen_get(screen->machine()) ? 0x103 : 0x1f3); - scrollx_offs = (state->m_vregs[0xc / 4] & 0x0000ffff) - (flip_screen_get(screen->machine()) ? 0x2c7 : 0x3f6); + scrolly_offs = ((state->m_vregs[0xc / 4] & 0xffff0000) >> 16) - (flip_screen_get(screen.machine()) ? 0x103 : 0x1f3); + scrollx_offs = (state->m_vregs[0xc / 4] & 0x0000ffff) - (flip_screen_get(screen.machine()) ? 0x2c7 : 0x3f6); layer0_scrolly = ((state->m_vregs[0x0 / 4] & 0xffff0000) >> 16) + scrolly_offs; layer0_scrollx = ((state->m_vregs[0x0 / 4] & 0x0000ffff)) + scrollx_offs; @@ -357,19 +357,19 @@ SCREEN_UPDATE( fuuki32 ) /* The bg colour is the last pen i.e. 0x1fff */ bitmap_fill(bitmap, cliprect, (0x800 * 4) - 1); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); - fuuki32_draw_layer(screen->machine(), bitmap, cliprect, tm_back, 0, 1); - fuuki32_draw_layer(screen->machine(), bitmap, cliprect, tm_middle, 0, 2); - fuuki32_draw_layer(screen->machine(), bitmap, cliprect, tm_front, 0, 4); + fuuki32_draw_layer(screen.machine(), bitmap, cliprect, tm_back, 0, 1); + fuuki32_draw_layer(screen.machine(), bitmap, cliprect, tm_middle, 0, 2); + fuuki32_draw_layer(screen.machine(), bitmap, cliprect, tm_front, 0, 4); - draw_sprites(*screen, bitmap, cliprect); + draw_sprites(screen, bitmap, cliprect); return 0; } SCREEN_EOF( fuuki32 ) { - fuuki32_state *state = machine.driver_data(); + fuuki32_state *state = screen.machine().driver_data(); /* Buffer sprites and tilebank by 2 frames */ state->m_spr_buffered_tilebank[1] = state->m_spr_buffered_tilebank[0]; diff --git a/src/mame/video/gaelco.c b/src/mame/video/gaelco.c index d062479e177..1db5df9716d 100644 --- a/src/mame/video/gaelco.c +++ b/src/mame/video/gaelco.c @@ -189,7 +189,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( maniacsq ) { - gaelco_state *state = screen->machine().driver_data(); + gaelco_state *state = screen.machine().driver_data(); /* set scroll registers */ tilemap_set_scrolly(state->m_tilemap[0], 0, state->m_vregs[0]); @@ -197,7 +197,7 @@ SCREEN_UPDATE( maniacsq ) tilemap_set_scrolly(state->m_tilemap[1], 0, state->m_vregs[2]); tilemap_set_scrollx(state->m_tilemap[1], 0, state->m_vregs[3]); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_tilemap[1], 3, 0); @@ -212,13 +212,13 @@ SCREEN_UPDATE( maniacsq ) tilemap_draw(bitmap, cliprect, state->m_tilemap[1], 0, 4); tilemap_draw(bitmap, cliprect, state->m_tilemap[0], 0, 4); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( bigkarnk ) { - gaelco_state *state = screen->machine().driver_data(); + gaelco_state *state = screen.machine().driver_data(); /* set scroll registers */ tilemap_set_scrolly(state->m_tilemap[0], 0, state->m_vregs[0]); @@ -226,7 +226,7 @@ SCREEN_UPDATE( bigkarnk ) tilemap_set_scrolly(state->m_tilemap[1], 0, state->m_vregs[2]); tilemap_set_scrollx(state->m_tilemap[1], 0, state->m_vregs[3]); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_tilemap[1], TILEMAP_DRAW_LAYER1 | 3, 0); @@ -253,6 +253,6 @@ SCREEN_UPDATE( bigkarnk ) tilemap_draw(bitmap, cliprect, state->m_tilemap[1], TILEMAP_DRAW_LAYER0 | 0, 8); tilemap_draw(bitmap, cliprect, state->m_tilemap[0], TILEMAP_DRAW_LAYER0 | 0, 8); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/gaelco2.c b/src/mame/video/gaelco2.c index 4399f78c00c..45fcc5b9221 100644 --- a/src/mame/video/gaelco2.c +++ b/src/mame/video/gaelco2.c @@ -339,19 +339,19 @@ VIDEO_START( gaelco2_dual ) ***************************************************************************/ -static void draw_sprites(screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int mask, int xoffs) +static void draw_sprites(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int mask, int xoffs) { - gaelco2_state *state = screen->machine().driver_data(); - UINT16 *buffered_spriteram16 = screen->machine().generic.buffered_spriteram.u16; + gaelco2_state *state = screen.machine().driver_data(); + UINT16 *buffered_spriteram16 = screen.machine().generic.buffered_spriteram.u16; int j, x, y, ex, ey, px, py; - const gfx_element *gfx = screen->machine().gfx[0]; + const gfx_element *gfx = screen.machine().gfx[0]; /* get sprite ram start and end offsets */ int start_offset = (state->m_vregs[1] & 0x10)*0x100; int end_offset = start_offset + 0x1000; /* sprite offset is based on the visible area */ - int spr_x_adjust = (screen->visible_area().max_x - 320 + 1) - (511 - 320 - 1) - ((state->m_vregs[0] >> 4) & 0x01) + xoffs; + int spr_x_adjust = (screen.visible_area().max_x - 320 + 1) - (511 - 320 - 1) - ((state->m_vregs[0] >> 4) & 0x01) + xoffs; for (j = start_offset; j < end_offset; j += 8){ int data = buffered_spriteram16[(j/2) + 0]; @@ -438,7 +438,7 @@ static void draw_sprites(screen_device *screen, bitmap_t *bitmap, const rectangl SCREEN_UPDATE( gaelco2 ) { - gaelco2_state *state = screen->machine().driver_data(); + gaelco2_state *state = screen.machine().driver_data(); int i; /* read scroll values */ @@ -466,14 +466,11 @@ SCREEN_UPDATE( gaelco2 ) return 0; } -SCREEN_UPDATE( gaelco2_dual ) +static UINT32 dual_update(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int index) { - gaelco2_state *state = screen->machine().driver_data(); + gaelco2_state *state = screen.machine().driver_data(); int i; - device_t *left_screen = screen->machine().device("lscreen"); - device_t *right_screen = screen->machine().device("rscreen"); - /* read scroll values */ int scroll0x = state->m_videoram[0x2802/2] + 0x14; int scroll1x = state->m_videoram[0x2806/2] + 0x10; @@ -493,26 +490,20 @@ SCREEN_UPDATE( gaelco2_dual ) /* draw screen */ bitmap_fill(bitmap, cliprect, 0); - if (screen == right_screen) - { - /* monitor 2 output */ - tilemap_draw(bitmap,cliprect,state->m_pant[1], 0, 0); - draw_sprites(screen,bitmap,cliprect, 0x8000, 0); - } - else if (screen == left_screen) - { - /* monitor 1 output */ - tilemap_draw(bitmap,cliprect,state->m_pant[0], 0, 0); - draw_sprites(screen,bitmap,cliprect, 0x0000, 0); - } + tilemap_draw(bitmap,cliprect,state->m_pant[index], 0, 0); + draw_sprites(screen,bitmap,cliprect, 0x8000 * index, 0); return 0; } +SCREEN_UPDATE( gaelco2_left ) { return dual_update(screen, bitmap, cliprect, 0); } +SCREEN_UPDATE( gaelco2_right ) { return dual_update(screen, bitmap, cliprect, 1); } + + SCREEN_EOF( gaelco2 ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); /* sprites are one frame ahead */ buffer_spriteram16_w(space, 0, 0, 0xffff); diff --git a/src/mame/video/gaelco3d.c b/src/mame/video/gaelco3d.c index dc81354ac2e..d3d3fca6549 100644 --- a/src/mame/video/gaelco3d.c +++ b/src/mame/video/gaelco3d.c @@ -433,30 +433,30 @@ WRITE32_HANDLER( gaelco3d_paletteram_020_w ) SCREEN_UPDATE( gaelco3d ) { - gaelco3d_state *state = screen->machine().driver_data(); + gaelco3d_state *state = screen.machine().driver_data(); int ret; /* - if (DISPLAY_TEXTURE && (screen->machine().input().code_pressed(KEYCODE_Z) || screen->machine().input().code_pressed(KEYCODE_X))) + if (DISPLAY_TEXTURE && (screen.machine().input().code_pressed(KEYCODE_Z) || screen.machine().input().code_pressed(KEYCODE_X))) { static int xv = 0, yv = 0x1000; UINT8 *base = state->m_texture; int length = state->m_texture_size; - if (screen->machine().input().code_pressed(KEYCODE_X)) + if (screen.machine().input().code_pressed(KEYCODE_X)) { base = state->m_texmask; length = state->m_texmask_size; } - if (screen->machine().input().code_pressed(KEYCODE_LEFT) && xv >= 4) + if (screen.machine().input().code_pressed(KEYCODE_LEFT) && xv >= 4) xv -= 4; - if (screen->machine().input().code_pressed(KEYCODE_RIGHT) && xv < 4096 - 4) + if (screen.machine().input().code_pressed(KEYCODE_RIGHT) && xv < 4096 - 4) xv += 4; - if (screen->machine().input().code_pressed(KEYCODE_UP) && yv >= 4) + if (screen.machine().input().code_pressed(KEYCODE_UP) && yv >= 4) yv -= 4; - if (screen->machine().input().code_pressed(KEYCODE_DOWN) && yv < 0x40000) + if (screen.machine().input().code_pressed(KEYCODE_DOWN) && yv < 0x40000) yv += 4; for (y = cliprect->min_y; y <= cliprect->max_y; y++) diff --git a/src/mame/video/gaiden.c b/src/mame/video/gaiden.c index 6bdc0237465..95e90760e84 100644 --- a/src/mame/video/gaiden.c +++ b/src/mame/video/gaiden.c @@ -672,8 +672,8 @@ static void drgnbowl_draw_sprites(running_machine &machine, bitmap_t *bitmap, co SCREEN_UPDATE( gaiden ) { - gaiden_state *state = screen->machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + gaiden_state *state = screen.machine().driver_data(); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(state->m_tile_bitmap_bg, cliprect, 0x200); bitmap_fill(state->m_tile_bitmap_fg, cliprect, 0); @@ -688,18 +688,18 @@ SCREEN_UPDATE( gaiden ) tilemap_draw(state->m_tile_bitmap_fg, cliprect, state->m_text_layer, 0, 4); /* draw sprites into a 16-bit bitmap */ - gaiden_draw_sprites(screen->machine(), state->m_tile_bitmap_bg, state->m_tile_bitmap_fg, state->m_sprite_bitmap, cliprect); + gaiden_draw_sprites(screen.machine(), state->m_tile_bitmap_bg, state->m_tile_bitmap_fg, state->m_sprite_bitmap, cliprect); /* mix & blend the tilemaps and sprites into a 32-bit bitmap */ - blendbitmaps(screen->machine(), bitmap, state->m_tile_bitmap_bg, state->m_tile_bitmap_fg, state->m_sprite_bitmap, 0, 0, cliprect); + blendbitmaps(screen.machine(), bitmap, state->m_tile_bitmap_bg, state->m_tile_bitmap_fg, state->m_sprite_bitmap, 0, 0, cliprect); return 0; } SCREEN_UPDATE( raiga ) { - gaiden_state *state = screen->machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + gaiden_state *state = screen.machine().driver_data(); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(state->m_tile_bitmap_bg, cliprect, 0x200); bitmap_fill(state->m_tile_bitmap_fg, cliprect, 0); @@ -714,21 +714,21 @@ SCREEN_UPDATE( raiga ) tilemap_draw(state->m_tile_bitmap_fg, cliprect, state->m_text_layer, 0, 4); /* draw sprites into a 16-bit bitmap */ - raiga_draw_sprites(screen->machine(), state->m_tile_bitmap_bg, state->m_tile_bitmap_fg, state->m_sprite_bitmap, cliprect); + raiga_draw_sprites(screen.machine(), state->m_tile_bitmap_bg, state->m_tile_bitmap_fg, state->m_sprite_bitmap, cliprect); /* mix & blend the tilemaps and sprites into a 32-bit bitmap */ - blendbitmaps(screen->machine(), bitmap, state->m_tile_bitmap_bg, state->m_tile_bitmap_fg, state->m_sprite_bitmap, 0, 0, cliprect); + blendbitmaps(screen.machine(), bitmap, state->m_tile_bitmap_bg, state->m_tile_bitmap_fg, state->m_sprite_bitmap, 0, 0, cliprect); return 0; } SCREEN_UPDATE( drgnbowl ) { - gaiden_state *state = screen->machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + gaiden_state *state = screen.machine().driver_data(); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_background, 0, 1); tilemap_draw(bitmap, cliprect, state->m_foreground, 0, 2); tilemap_draw(bitmap, cliprect, state->m_text_layer, 0, 4); - drgnbowl_draw_sprites(screen->machine(), bitmap, cliprect); + drgnbowl_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/galaga.c b/src/mame/video/galaga.c index 81453517ec8..43ee954ea49 100644 --- a/src/mame/video/galaga.c +++ b/src/mame/video/galaga.c @@ -567,11 +567,11 @@ static void draw_stars(running_machine &machine, bitmap_t *bitmap, const rectang SCREEN_UPDATE( galaga ) { - galaga_state *state = screen->machine().driver_data(); + galaga_state *state = screen.machine().driver_data(); - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); - draw_stars(screen->machine(),bitmap,cliprect); - draw_sprites(screen->machine(),bitmap,cliprect); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); + draw_stars(screen.machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); return 0; } @@ -580,7 +580,7 @@ SCREEN_UPDATE( galaga ) SCREEN_EOF( galaga ) { - galaga_state *state = machine.driver_data(); + galaga_state *state = screen.machine().driver_data(); /* this function is called by galaga_interrupt_1() */ int s0,s1,s2; static const int speeds[8] = { -1, -2, -3, 0, 3, 2, 1, 0 }; diff --git a/src/mame/video/galastrm.c b/src/mame/video/galastrm.c index 00bb77e05aa..06762ae3ef5 100644 --- a/src/mame/video/galastrm.c +++ b/src/mame/video/galastrm.c @@ -437,20 +437,20 @@ static void tc0610_rotate_draw(running_machine &machine, bitmap_t *bitmap, bitma SCREEN_UPDATE( galastrm ) { - galastrm_state *state = screen->machine().driver_data(); - device_t *tc0100scn = screen->machine().device("tc0100scn"); - device_t *tc0480scp = screen->machine().device("tc0480scp"); + galastrm_state *state = screen.machine().driver_data(); + device_t *tc0100scn = screen.machine().device("tc0100scn"); + device_t *tc0480scp = screen.machine().device("tc0480scp"); UINT8 layer[5]; UINT8 pivlayer[3]; UINT16 priority; static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0}; rectangle clip; - bitmap_t *priority_bitmap = screen->machine().priority_bitmap; + bitmap_t *priority_bitmap = screen.machine().priority_bitmap; clip.min_x = 0; clip.min_y = 0; - clip.max_x = screen->width() -1; - clip.max_y = screen->height() -1; + clip.max_x = screen.width() -1; + clip.max_y = screen.height() -1; tc0100scn_tilemap_update(tc0100scn); tc0480scp_tilemap_update(tc0480scp); @@ -476,17 +476,17 @@ SCREEN_UPDATE( galastrm ) #if 0 if (layer[0]==0 && layer[1]==3 && layer[2]==2 && layer[3]==1) { - if (!screen->machine().input().code_pressed(KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[0], 0, 1); - if (!screen->machine().input().code_pressed(KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[1], 0, 4); - if (!screen->machine().input().code_pressed(KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[2], 0, 4); - if (!screen->machine().input().code_pressed(KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[3], 0, 4); + if (!screen.machine().input().code_pressed(KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[0], 0, 1); + if (!screen.machine().input().code_pressed(KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[1], 0, 4); + if (!screen.machine().input().code_pressed(KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[2], 0, 4); + if (!screen.machine().input().code_pressed(KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[3], 0, 4); } else { - if (!screen->machine().input().code_pressed(KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[0], 0, 1); - if (!screen->machine().input().code_pressed(KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[1], 0, 2); - if (!screen->machine().input().code_pressed(KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[2], 0, 4); - if (!screen->machine().input().code_pressed(KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[3], 0, 8); + if (!screen.machine().input().code_pressed(KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[0], 0, 1); + if (!screen.machine().input().code_pressed(KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[1], 0, 2); + if (!screen.machine().input().code_pressed(KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[2], 0, 4); + if (!screen.machine().input().code_pressed(KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[3], 0, 8); } if (layer[0]==3 && layer[1]==0 && layer[2]==1 && layer[3]==2) @@ -505,18 +505,18 @@ SCREEN_UPDATE( galastrm ) } } - draw_sprites_pre(screen->machine(), 42-X_OFFSET, -571+Y_OFFSET); - draw_sprites(screen->machine(),state->m_tmpbitmaps,&clip,primasks,1); + draw_sprites_pre(screen.machine(), 42-X_OFFSET, -571+Y_OFFSET); + draw_sprites(screen.machine(),state->m_tmpbitmaps,&clip,primasks,1); copybitmap_trans(bitmap,state->m_polybitmap,0,0, 0,0,cliprect,0); bitmap_fill(state->m_polybitmap, &clip, 0); - tc0610_rotate_draw(screen->machine(),state->m_polybitmap,state->m_tmpbitmaps,cliprect); + tc0610_rotate_draw(screen.machine(),state->m_polybitmap,state->m_tmpbitmaps,cliprect); bitmap_fill(priority_bitmap, cliprect, 0); - draw_sprites(screen->machine(),bitmap,cliprect,primasks,0); + draw_sprites(screen.machine(),bitmap,cliprect,primasks,0); - if (!screen->machine().input().code_pressed(KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0); - if (!screen->machine().input().code_pressed(KEYCODE_M)) tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[2], 0, 0); + if (!screen.machine().input().code_pressed(KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0); + if (!screen.machine().input().code_pressed(KEYCODE_M)) tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[2], 0, 0); @@ -552,15 +552,15 @@ SCREEN_UPDATE( galastrm ) } } - draw_sprites_pre(screen->machine(), 42-X_OFFSET, -571+Y_OFFSET); - draw_sprites(screen->machine(),state->m_tmpbitmaps,&clip,primasks,1); + draw_sprites_pre(screen.machine(), 42-X_OFFSET, -571+Y_OFFSET); + draw_sprites(screen.machine(),state->m_tmpbitmaps,&clip,primasks,1); copybitmap_trans(bitmap,state->m_polybitmap,0,0, 0,0,cliprect,0); bitmap_fill(state->m_polybitmap, &clip, 0); - tc0610_rotate_draw(screen->machine(),state->m_polybitmap,state->m_tmpbitmaps,cliprect); + tc0610_rotate_draw(screen.machine(),state->m_polybitmap,state->m_tmpbitmaps,cliprect); bitmap_fill(priority_bitmap, cliprect, 0); - draw_sprites(screen->machine(),bitmap,cliprect,primasks,0); + draw_sprites(screen.machine(),bitmap,cliprect,primasks,0); tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0); tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[2], 0, 0); diff --git a/src/mame/video/galaxian.c b/src/mame/video/galaxian.c index 3cd14397b49..257496cce1d 100644 --- a/src/mame/video/galaxian.c +++ b/src/mame/video/galaxian.c @@ -454,19 +454,19 @@ static void state_save_register(running_machine &machine) SCREEN_UPDATE( galaxian ) { - galaxian_state *state = screen->machine().driver_data(); + galaxian_state *state = screen.machine().driver_data(); /* draw the background layer (including stars) */ - (*state->m_draw_background_ptr)(screen->machine(), bitmap, cliprect); + (*state->m_draw_background_ptr)(screen.machine(), bitmap, cliprect); /* draw the tilemap characters over top */ tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); /* render the sprites next */ - sprites_draw(screen->machine(), bitmap, cliprect, &screen->machine().generic.spriteram.u8[0x40]); + sprites_draw(screen.machine(), bitmap, cliprect, &screen.machine().generic.spriteram.u8[0x40]); /* if we have bullets to draw, render them following */ if (state->m_draw_bullet_ptr != NULL) - bullets_draw(screen->machine(), bitmap, cliprect, &screen->machine().generic.spriteram.u8[0x60]); + bullets_draw(screen.machine(), bitmap, cliprect, &screen.machine().generic.spriteram.u8[0x60]); return 0; } @@ -477,7 +477,7 @@ SCREEN_UPDATE( zigzag ) SCREEN_UPDATE_CALL(galaxian); /* zigzag has an extra sprite generator instead of bullets (note: ideally, this should be rendered in parallel) */ - sprites_draw(screen->machine(), bitmap, cliprect, &screen->machine().generic.spriteram.u8[0x60]); + sprites_draw(screen.machine(), bitmap, cliprect, &screen.machine().generic.spriteram.u8[0x60]); return 0; } diff --git a/src/mame/video/galaxold.c b/src/mame/video/galaxold.c index 70c624c300e..4ace276ba37 100644 --- a/src/mame/video/galaxold.c +++ b/src/mame/video/galaxold.c @@ -1812,13 +1812,13 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, UINT8 *spri SCREEN_UPDATE( galaxold ) { - galaxold_state *state = screen->machine().driver_data(); + galaxold_state *state = screen.machine().driver_data(); - (*state->m_draw_background)(screen->machine(), bitmap, cliprect); + (*state->m_draw_background)(screen.machine(), bitmap, cliprect); if (state->m_stars_on) { - (*state->m_draw_stars)(screen->machine(), bitmap, cliprect); + (*state->m_draw_stars)(screen.machine(), bitmap, cliprect); } @@ -1826,15 +1826,15 @@ SCREEN_UPDATE( galaxold ) if (state->m_draw_bullets) { - draw_bullets_common(screen->machine(), bitmap, cliprect); + draw_bullets_common(screen.machine(), bitmap, cliprect); } - draw_sprites(screen->machine(), bitmap, state->m_spriteram, state->m_spriteram_size); + draw_sprites(screen.machine(), bitmap, state->m_spriteram, state->m_spriteram_size); if (state->m_spriteram2_present) { - draw_sprites(screen->machine(), bitmap, state->m_spriteram2, state->m_spriteram2_size); + draw_sprites(screen.machine(), bitmap, state->m_spriteram2, state->m_spriteram2_size); } return 0; } @@ -1842,15 +1842,15 @@ SCREEN_UPDATE( galaxold ) SCREEN_UPDATE( dambustr ) { - galaxold_state *state = screen->machine().driver_data(); + galaxold_state *state = screen.machine().driver_data(); int i, j; UINT8 color; - (*state->m_draw_background)(screen->machine(), bitmap, cliprect); + (*state->m_draw_background)(screen.machine(), bitmap, cliprect); if (state->m_stars_on) { - (*state->m_draw_stars)(screen->machine(), bitmap, cliprect); + (*state->m_draw_stars)(screen.machine(), bitmap, cliprect); } /* save the background for drawing it again later, if background has priority over characters */ @@ -1860,15 +1860,15 @@ SCREEN_UPDATE( dambustr ) if (state->m_draw_bullets) { - draw_bullets_common(screen->machine(), bitmap, cliprect); + draw_bullets_common(screen.machine(), bitmap, cliprect); } - draw_sprites(screen->machine(), bitmap, state->m_spriteram, state->m_spriteram_size); + draw_sprites(screen.machine(), bitmap, state->m_spriteram, state->m_spriteram_size); if (state->m_dambustr_bg_priority) { /* draw the upper part of the background, as it has priority */ - dambustr_draw_upper_background(screen->machine(), bitmap, cliprect); + dambustr_draw_upper_background(screen.machine(), bitmap, cliprect); /* only rows with color code > 3 are stronger than the background */ memset(state->m_dambustr_videoram2, 0x20, 0x0400); diff --git a/src/mame/video/galivan.c b/src/mame/video/galivan.c index 14a7fdb2cc2..619d64bc6c9 100644 --- a/src/mame/video/galivan.c +++ b/src/mame/video/galivan.c @@ -347,7 +347,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( galivan ) { - galivan_state *state = screen->machine().driver_data(); + galivan_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_galivan_scrollx[0] + 256 * (state->m_galivan_scrollx[1] & 0x07)); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_galivan_scrolly[0] + 256 * (state->m_galivan_scrolly[1] & 0x07)); @@ -360,11 +360,11 @@ SCREEN_UPDATE( galivan ) { tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 1, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); } else { - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 1, 0); } @@ -374,7 +374,7 @@ SCREEN_UPDATE( galivan ) SCREEN_UPDATE( ninjemak ) { - galivan_state *state = screen->machine().driver_data(); + galivan_state *state = screen.machine().driver_data(); /* (scrollx[1] & 0x40) does something */ tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_scrollx); @@ -385,7 +385,7 @@ SCREEN_UPDATE( ninjemak ) else tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/galpani2.c b/src/mame/video/galpani2.c index 4cac46443dc..f9f3a42a150 100644 --- a/src/mame/video/galpani2.c +++ b/src/mame/video/galpani2.c @@ -143,23 +143,23 @@ VIDEO_START( galpani2 ) SCREEN_UPDATE( galpani2 ) { - galpani2_state *state = screen->machine().driver_data(); + galpani2_state *state = screen.machine().driver_data(); int layers_ctrl = -1; #ifdef MAME_DEBUG -if (screen->machine().input().code_pressed(KEYCODE_Z)) +if (screen.machine().input().code_pressed(KEYCODE_Z)) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= 2; - if (screen->machine().input().code_pressed(KEYCODE_E)) msk |= 4; - if (screen->machine().input().code_pressed(KEYCODE_A)) msk |= 8; + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (screen.machine().input().code_pressed(KEYCODE_E)) msk |= 4; + if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= 8; if (msk != 0) layers_ctrl &= msk; } #endif bitmap_fill(bitmap,cliprect,0); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); if (layers_ctrl & 0x1) { @@ -194,6 +194,6 @@ if (screen->machine().input().code_pressed(KEYCODE_Z)) cliprect,0x4000 + 0); } - if (layers_ctrl & 0x8) kaneko16_draw_sprites(screen->machine(), bitmap, cliprect); + if (layers_ctrl & 0x8) kaneko16_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/galpanic.c b/src/mame/video/galpanic.c index 464a07b3a46..ed823b7b4f9 100644 --- a/src/mame/video/galpanic.c +++ b/src/mame/video/galpanic.c @@ -102,12 +102,12 @@ static void draw_fgbitmap(running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( galpanic ) { - device_t *pandora = screen->machine().device("pandora"); + device_t *pandora = screen.machine().device("pandora"); /* copy the temporary bitmap to the screen */ - copybitmap(bitmap,screen->machine().generic.tmpbitmap,0,0,0,0,cliprect); + copybitmap(bitmap,screen.machine().generic.tmpbitmap,0,0,0,0,cliprect); - draw_fgbitmap(screen->machine(), bitmap, cliprect); + draw_fgbitmap(screen.machine(), bitmap, cliprect); pandora_update(pandora, bitmap, cliprect); @@ -116,22 +116,22 @@ SCREEN_UPDATE( galpanic ) SCREEN_UPDATE( comad ) { - galpanic_state *state = screen->machine().driver_data(); + galpanic_state *state = screen.machine().driver_data(); /* copy the temporary bitmap to the screen */ - copybitmap(bitmap,screen->machine().generic.tmpbitmap,0,0,0,0,cliprect); + copybitmap(bitmap,screen.machine().generic.tmpbitmap,0,0,0,0,cliprect); - draw_fgbitmap(screen->machine(), bitmap, cliprect); + draw_fgbitmap(screen.machine(), bitmap, cliprect); // if(galpanic_clear_sprites) { bitmap_fill(state->m_sprites_bitmap,cliprect,0); - comad_draw_sprites(screen->machine(),bitmap,cliprect); + comad_draw_sprites(screen.machine(),bitmap,cliprect); } // else // { // /* keep sprites on the bitmap without clearing them */ -// comad_draw_sprites(screen->machine(),state->m_sprites_bitmap,0); +// comad_draw_sprites(screen.machine(),state->m_sprites_bitmap,0); // copybitmap_trans(bitmap,state->m_sprites_bitmap,0,0,0,0,cliprect,0); // } return 0; diff --git a/src/mame/video/galspnbl.c b/src/mame/video/galspnbl.c index 78293f44563..330d54fc16a 100644 --- a/src/mame/video/galspnbl.c +++ b/src/mame/video/galspnbl.c @@ -103,12 +103,12 @@ static void draw_background( running_machine &machine, bitmap_t *bitmap, const r SCREEN_UPDATE( galspnbl ) { - galspnbl_state *state = screen->machine().driver_data(); + galspnbl_state *state = screen.machine().driver_data(); int offs; - draw_background(screen->machine(), bitmap, cliprect); + draw_background(screen.machine(), bitmap, cliprect); - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0); for (offs = 0; offs < 0x1000 / 2; offs++) { @@ -123,7 +123,7 @@ SCREEN_UPDATE( galspnbl ) /* What is this? A priority/half transparency marker? */ if (!(attr & 0x0008)) { - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], code, color, 0,0, @@ -132,6 +132,6 @@ SCREEN_UPDATE( galspnbl ) } } - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); return 0; } diff --git a/src/mame/video/gameplan.c b/src/mame/video/gameplan.c index bd19245f667..bc268f231b2 100644 --- a/src/mame/video/gameplan.c +++ b/src/mame/video/gameplan.c @@ -71,7 +71,7 @@ static void leprechn_get_pens( pen_t *pens ) static SCREEN_UPDATE( gameplan ) { - gameplan_state *state = screen->machine().driver_data(); + gameplan_state *state = screen.machine().driver_data(); pen_t pens[GAMEPLAN_NUM_PENS]; offs_t offs; @@ -91,7 +91,7 @@ static SCREEN_UPDATE( gameplan ) static SCREEN_UPDATE( leprechn ) { - gameplan_state *state = screen->machine().driver_data(); + gameplan_state *state = screen.machine().driver_data(); pen_t pens[LEPRECHN_NUM_PENS]; offs_t offs; diff --git a/src/mame/video/gaplus.c b/src/mame/video/gaplus.c index 5adb8c6dc66..d6a9b9687f4 100644 --- a/src/mame/video/gaplus.c +++ b/src/mame/video/gaplus.c @@ -309,18 +309,18 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( gaplus ) { - gaplus_state *state = screen->machine().driver_data(); + gaplus_state *state = screen.machine().driver_data(); /* flip screen control is embedded in RAM */ - flip_screen_set(screen->machine(), state->m_spriteram[0x1f7f-0x800] & 1); + flip_screen_set(screen.machine(), state->m_spriteram[0x1f7f-0x800] & 1); bitmap_fill(bitmap, cliprect, 0); - starfield_render(screen->machine(), bitmap); + starfield_render(screen.machine(), bitmap); /* draw the low priority characters */ tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); /* draw the high priority characters */ /* (I don't know if this feature is used by Gaplus, but it's shown in the schematics) */ @@ -331,12 +331,12 @@ SCREEN_UPDATE( gaplus ) SCREEN_EOF( gaplus ) /* update starfields */ { - gaplus_state *state = machine.driver_data(); + gaplus_state *state = screen.machine().driver_data(); struct star *stars = state->m_stars; int i; - int width = machine.primary_screen->width(); - int height = machine.primary_screen->height(); + int width = screen.machine().primary_screen->width(); + int height = screen.machine().primary_screen->height(); /* check if we're running */ if ( ( state->m_starfield_control[0] & 1 ) == 0 ) diff --git a/src/mame/video/gatron.c b/src/mame/video/gatron.c index 26c47f26a52..4c7278ed7e3 100644 --- a/src/mame/video/gatron.c +++ b/src/mame/video/gatron.c @@ -53,7 +53,7 @@ VIDEO_START( gat ) SCREEN_UPDATE( gat ) { - gatron_state *state = screen->machine().driver_data(); + gatron_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/gauntlet.c b/src/mame/video/gauntlet.c index e702567fc37..97d668b691a 100644 --- a/src/mame/video/gauntlet.c +++ b/src/mame/video/gauntlet.c @@ -178,7 +178,7 @@ WRITE16_HANDLER( gauntlet_yscroll_w ) SCREEN_UPDATE( gauntlet ) { - gauntlet_state *state = screen->machine().driver_data(); + gauntlet_state *state = screen.machine().driver_data(); atarimo_rect_list rectlist; bitmap_t *mobitmap; int x, y, r; diff --git a/src/mame/video/gberet.c b/src/mame/video/gberet.c index c69e641bec9..1a53132a8de 100644 --- a/src/mame/video/gberet.c +++ b/src/mame/video/gberet.c @@ -170,10 +170,10 @@ static void gberet_draw_sprites( running_machine &machine, bitmap_t *bitmap, con SCREEN_UPDATE( gberet ) { - gberet_state *state = screen->machine().driver_data(); + gberet_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0); - gberet_draw_sprites(screen->machine(), bitmap, cliprect); + gberet_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } @@ -226,9 +226,9 @@ static void gberetb_draw_sprites( running_machine &machine, bitmap_t *bitmap, co SCREEN_UPDATE( gberetb ) { - gberet_state *state = screen->machine().driver_data(); + gberet_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0); - gberetb_draw_sprites(screen->machine(), bitmap, cliprect); + gberetb_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/gbusters.c b/src/mame/video/gbusters.c index 356a02974c1..422d13129d0 100644 --- a/src/mame/video/gbusters.c +++ b/src/mame/video/gbusters.c @@ -49,7 +49,7 @@ VIDEO_START( gbusters ) SCREEN_UPDATE( gbusters ) { - gbusters_state *state = screen->machine().driver_data(); + gbusters_state *state = screen.machine().driver_data(); k052109_tilemap_update(state->m_k052109); diff --git a/src/mame/video/gcpinbal.c b/src/mame/video/gcpinbal.c index 6c7e791413c..bb6af7b0170 100644 --- a/src/mame/video/gcpinbal.c +++ b/src/mame/video/gcpinbal.c @@ -250,25 +250,25 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( gcpinbal ) { - gcpinbal_state *state = screen->machine().driver_data(); + gcpinbal_state *state = screen.machine().driver_data(); int i; UINT16 tile_sets = 0; UINT8 layer[3]; #ifdef MAME_DEBUG - if (screen->machine().input().code_pressed_once(KEYCODE_V)) + if (screen.machine().input().code_pressed_once(KEYCODE_V)) { state->m_dislayer[0] ^= 1; popmessage("bg0: %01x", state->m_dislayer[0]); } - if (screen->machine().input().code_pressed_once(KEYCODE_B)) + if (screen.machine().input().code_pressed_once(KEYCODE_B)) { state->m_dislayer[1] ^= 1; popmessage("bg1: %01x", state->m_dislayer[1]); } - if (screen->machine().input().code_pressed_once(KEYCODE_N)) + if (screen.machine().input().code_pressed_once(KEYCODE_N)) { state->m_dislayer[2] ^= 1; popmessage("fg: %01x", state->m_dislayer[2]); @@ -292,7 +292,7 @@ SCREEN_UPDATE( gcpinbal ) tilemap_set_scrolly(state->m_tilemap[i], 0, state->m_scrolly[i]); } - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); layer[0] = 0; @@ -316,7 +316,7 @@ SCREEN_UPDATE( gcpinbal ) tilemap_draw(bitmap, cliprect, state->m_tilemap[layer[2]], 0, 4); - draw_sprites(screen->machine(), bitmap, cliprect, 16); + draw_sprites(screen.machine(), bitmap, cliprect, 16); #if 0 { diff --git a/src/mame/video/genesis.c b/src/mame/video/genesis.c index 50890bd7455..ae4883466b5 100644 --- a/src/mame/video/genesis.c +++ b/src/mame/video/genesis.c @@ -119,7 +119,7 @@ static UINT8 window_width; /* window width */ ******************************************************************************/ -static void start_genesis_vdp(screen_device *screen) +static void start_genesis_vdp(screen_device &screen) { static const UINT8 vdp_init[24] = { @@ -129,12 +129,12 @@ static void start_genesis_vdp(screen_device *screen) }; int i; - genesis_screen = screen; + genesis_screen = &screen; /* allocate memory for the VDP, the lookup table, and the buffer bitmap */ - vdp_vram = auto_alloc_array(screen->machine(), UINT8, VRAM_SIZE); - vdp_vsram = auto_alloc_array(screen->machine(), UINT8, VSRAM_SIZE); - transparent_lookup = auto_alloc_array(screen->machine(), UINT16, 0x1000); + vdp_vram = auto_alloc_array(screen.machine(), UINT8, VRAM_SIZE); + vdp_vsram = auto_alloc_array(screen.machine(), UINT8, VSRAM_SIZE); + transparent_lookup = auto_alloc_array(screen.machine(), UINT16, 0x1000); /* clear the VDP memory, prevents corrupt tile in Puyo Puyo 2 */ memset(vdp_vram, 0, VRAM_SIZE); @@ -163,41 +163,41 @@ static void start_genesis_vdp(screen_device *screen) /* reset VDP */ for (i = 0; i < 24; i++) - vdp_register_w(screen->machine(), 0x8000 | (i << 8) | vdp_init[i], 1); + vdp_register_w(screen.machine(), 0x8000 | (i << 8) | vdp_init[i], 1); vdp_cmdpart = 0; vdp_code = 0; vdp_address = 0; /* Save State Stuff */ - state_save_register_global_array(screen->machine(), genesis_vdp_regs); - state_save_register_global_pointer(screen->machine(), vdp_vram, 0x10000); - state_save_register_global_pointer(screen->machine(), vdp_vsram, 0x80); - state_save_register_global_array(screen->machine(), genesis_bg_pal_lookup); - state_save_register_global_array(screen->machine(), genesis_sp_pal_lookup); - state_save_register_global(screen->machine(), display_enable); - state_save_register_global(screen->machine(), vdp_scrollabase); - state_save_register_global(screen->machine(), vdp_scrollbbase); - state_save_register_global(screen->machine(), vdp_windowbase); - state_save_register_global(screen->machine(), vdp_spritebase); - state_save_register_global(screen->machine(), vdp_hscrollbase); - state_save_register_global(screen->machine(), vdp_hscrollmask); - state_save_register_global(screen->machine(), vdp_hscrollsize); - state_save_register_global(screen->machine(), vdp_vscrollmode); - state_save_register_global(screen->machine(), vdp_cmdpart); - state_save_register_global(screen->machine(), vdp_code); - state_save_register_global(screen->machine(), vdp_address); - state_save_register_global(screen->machine(), vdp_dmafill); - state_save_register_global(screen->machine(), scrollheight); - state_save_register_global(screen->machine(), scrollwidth); - state_save_register_global(screen->machine(), bgcol); - state_save_register_global(screen->machine(), window_down); - state_save_register_global(screen->machine(), window_vpos); + state_save_register_global_array(screen.machine(), genesis_vdp_regs); + state_save_register_global_pointer(screen.machine(), vdp_vram, 0x10000); + state_save_register_global_pointer(screen.machine(), vdp_vsram, 0x80); + state_save_register_global_array(screen.machine(), genesis_bg_pal_lookup); + state_save_register_global_array(screen.machine(), genesis_sp_pal_lookup); + state_save_register_global(screen.machine(), display_enable); + state_save_register_global(screen.machine(), vdp_scrollabase); + state_save_register_global(screen.machine(), vdp_scrollbbase); + state_save_register_global(screen.machine(), vdp_windowbase); + state_save_register_global(screen.machine(), vdp_spritebase); + state_save_register_global(screen.machine(), vdp_hscrollbase); + state_save_register_global(screen.machine(), vdp_hscrollmask); + state_save_register_global(screen.machine(), vdp_hscrollsize); + state_save_register_global(screen.machine(), vdp_vscrollmode); + state_save_register_global(screen.machine(), vdp_cmdpart); + state_save_register_global(screen.machine(), vdp_code); + state_save_register_global(screen.machine(), vdp_address); + state_save_register_global(screen.machine(), vdp_dmafill); + state_save_register_global(screen.machine(), scrollheight); + state_save_register_global(screen.machine(), scrollwidth); + state_save_register_global(screen.machine(), bgcol); + state_save_register_global(screen.machine(), window_down); + state_save_register_global(screen.machine(), window_vpos); } void system18_vdp_start(running_machine &machine) { - start_genesis_vdp(machine.primary_screen); + start_genesis_vdp(*machine.primary_screen); genesis_palette_base = 0x1800; genesis_bg_pal_lookup[0] = genesis_sp_pal_lookup[0] = 0x1800; diff --git a/src/mame/video/gijoe.c b/src/mame/video/gijoe.c index 6b8d4b5dd02..070ab561342 100644 --- a/src/mame/video/gijoe.c +++ b/src/mame/video/gijoe.c @@ -77,7 +77,7 @@ VIDEO_START( gijoe ) SCREEN_UPDATE( gijoe ) { - gijoe_state *state = screen->machine().driver_data(); + gijoe_state *state = screen.machine().driver_data(); static const int K053251_CI[4] = { K053251_CI1, K053251_CI2, K053251_CI3, K053251_CI4 }; int layer[4]; int vrc_mode, vrc_new, colorbase_new, /*primode,*/ dirty, i; @@ -158,8 +158,8 @@ SCREEN_UPDATE( gijoe ) konami_sortlayers4(layer, state->m_layer_pri); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, layer[0], 0, 1); k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, layer[1], 0, 2); diff --git a/src/mame/video/ginganin.c b/src/mame/video/ginganin.c index 9b9e6ab2aca..e51b050a152 100644 --- a/src/mame/video/ginganin.c +++ b/src/mame/video/ginganin.c @@ -247,18 +247,18 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const recta SCREEN_UPDATE( ginganin ) { - ginganin_state *state = screen->machine().driver_data(); + ginganin_state *state = screen.machine().driver_data(); int layers_ctrl1 = state->m_layers_ctrl; #ifdef MAME_DEBUG -if (screen->machine().input().code_pressed(KEYCODE_Z)) +if (screen.machine().input().code_pressed(KEYCODE_Z)) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) { msk |= 0xfff1;} - if (screen->machine().input().code_pressed(KEYCODE_W)) { msk |= 0xfff2;} - if (screen->machine().input().code_pressed(KEYCODE_E)) { msk |= 0xfff4;} - if (screen->machine().input().code_pressed(KEYCODE_A)) { msk |= 0xfff8;} + if (screen.machine().input().code_pressed(KEYCODE_Q)) { msk |= 0xfff1;} + if (screen.machine().input().code_pressed(KEYCODE_W)) { msk |= 0xfff2;} + if (screen.machine().input().code_pressed(KEYCODE_E)) { msk |= 0xfff4;} + if (screen.machine().input().code_pressed(KEYCODE_A)) { msk |= 0xfff8;} if (msk != 0) layers_ctrl1 &= msk; #define SETSCROLL \ @@ -268,11 +268,11 @@ if (screen->machine().input().code_pressed(KEYCODE_Z)) tilemap_set_scrolly(state->m_fg_tilemap, 0, state->m_posy); \ popmessage("B>%04X:%04X F>%04X:%04X",state->m_posx%(BG_NX*16),state->m_posy%(BG_NY*16),state->m_posx%(FG_NX*16),state->m_posy%(FG_NY*16)); - if (screen->machine().input().code_pressed(KEYCODE_L)) { state->m_posx +=8; SETSCROLL } - if (screen->machine().input().code_pressed(KEYCODE_J)) { state->m_posx -=8; SETSCROLL } - if (screen->machine().input().code_pressed(KEYCODE_K)) { state->m_posy +=8; SETSCROLL } - if (screen->machine().input().code_pressed(KEYCODE_I)) { state->m_posy -=8; SETSCROLL } - if (screen->machine().input().code_pressed(KEYCODE_H)) { state->m_posx = state->m_posy = 0; SETSCROLL } + if (screen.machine().input().code_pressed(KEYCODE_L)) { state->m_posx +=8; SETSCROLL } + if (screen.machine().input().code_pressed(KEYCODE_J)) { state->m_posx -=8; SETSCROLL } + if (screen.machine().input().code_pressed(KEYCODE_K)) { state->m_posy +=8; SETSCROLL } + if (screen.machine().input().code_pressed(KEYCODE_I)) { state->m_posy -=8; SETSCROLL } + if (screen.machine().input().code_pressed(KEYCODE_H)) { state->m_posx = state->m_posy = 0; SETSCROLL } } #endif @@ -286,7 +286,7 @@ if (screen->machine().input().code_pressed(KEYCODE_Z)) if (layers_ctrl1 & 2) tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); if (layers_ctrl1 & 8) - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); if (layers_ctrl1 & 4) tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); diff --git a/src/mame/video/gladiatr.c b/src/mame/video/gladiatr.c index ea186cf0243..88c46d3e9a5 100644 --- a/src/mame/video/gladiatr.c +++ b/src/mame/video/gladiatr.c @@ -253,9 +253,9 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( ppking ) { - gladiatr_state *state = screen->machine().driver_data(); + gladiatr_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); /* the fg layer just selects the upper palette bank on underlying pixels */ { @@ -289,25 +289,25 @@ SCREEN_UPDATE( ppking ) SCREEN_UPDATE( gladiatr ) { - gladiatr_state *state = screen->machine().driver_data(); + gladiatr_state *state = screen.machine().driver_data(); if (state->m_video_attributes & 0x20) { int scroll; scroll = state->m_bg_scrollx + ((state->m_video_attributes & 0x04) << 6); - tilemap_set_scrollx(state->m_bg_tilemap, 0, scroll ^ (flip_screen_get(screen->machine()) ? 0x0f : 0)); + tilemap_set_scrollx(state->m_bg_tilemap, 0, scroll ^ (flip_screen_get(screen.machine()) ? 0x0f : 0)); scroll = state->m_fg_scrollx + ((state->m_video_attributes & 0x08) << 5); - tilemap_set_scrollx(state->m_fg_tilemap, 0, scroll ^ (flip_screen_get(screen->machine()) ? 0x0f : 0)); + tilemap_set_scrollx(state->m_fg_tilemap, 0, scroll ^ (flip_screen_get(screen.machine()) ? 0x0f : 0)); // always 0 anyway tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_bg_scrolly); tilemap_set_scrolly(state->m_fg_tilemap, 0, state->m_fg_scrolly); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); } else - bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine())); + bitmap_fill( bitmap, cliprect , get_black_pen(screen.machine())); return 0; } diff --git a/src/mame/video/glass.c b/src/mame/video/glass.c index a60cd85de72..b41e40d057a 100644 --- a/src/mame/video/glass.c +++ b/src/mame/video/glass.c @@ -197,7 +197,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( glass ) { - glass_state *state = screen->machine().driver_data(); + glass_state *state = screen.machine().driver_data(); /* set scroll registers */ tilemap_set_scrolly(state->m_pant[0], 0, state->m_vregs[0]); tilemap_set_scrollx(state->m_pant[0], 0, state->m_vregs[1] + 0x04); @@ -205,10 +205,10 @@ SCREEN_UPDATE( glass ) tilemap_set_scrollx(state->m_pant[1], 0, state->m_vregs[3]); /* draw layers + sprites */ - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); copybitmap(bitmap, state->m_screen_bitmap, 0, 0, 0x18, 0x24, cliprect); tilemap_draw(bitmap, cliprect, state->m_pant[1], 0, 0); tilemap_draw(bitmap, cliprect, state->m_pant[0], 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/gng.c b/src/mame/video/gng.c index c9063299039..a77149b2894 100644 --- a/src/mame/video/gng.c +++ b/src/mame/video/gng.c @@ -141,10 +141,10 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( gng ) { - gng_state *state = screen->machine().driver_data(); + gng_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; @@ -152,7 +152,7 @@ SCREEN_UPDATE( gng ) SCREEN_EOF( gng ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram_w(space, 0, 0); } diff --git a/src/mame/video/goal92.c b/src/mame/video/goal92.c index 74766f38fdc..9e765b3004e 100644 --- a/src/mame/video/goal92.c +++ b/src/mame/video/goal92.c @@ -154,7 +154,7 @@ VIDEO_START( goal92 ) SCREEN_UPDATE( goal92 ) { - goal92_state *state = screen->machine().driver_data(); + goal92_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_layer, 0, state->m_scrollram[0] + 60); tilemap_set_scrolly(state->m_bg_layer, 0, state->m_scrollram[1] + 8); @@ -169,27 +169,27 @@ SCREEN_UPDATE( goal92 ) tilemap_set_scrolly(state->m_fg_layer, 0, state->m_scrollram[3] + 8); } - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); tilemap_draw(bitmap, cliprect, state->m_bg_layer, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 2); + draw_sprites(screen.machine(), bitmap, cliprect, 2); if (!(state->m_fg_bank & 0xff)) - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); tilemap_draw(bitmap, cliprect, state->m_fg_layer, 0, 0); if(state->m_fg_bank & 0xff) - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); - draw_sprites(screen->machine(), bitmap, cliprect, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 3); + draw_sprites(screen.machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 3); tilemap_draw(bitmap, cliprect, state->m_tx_layer, 0, 0); return 0; } SCREEN_EOF( goal92 ) { - goal92_state *state = machine.driver_data(); + goal92_state *state = screen.machine().driver_data(); memcpy(state->m_buffered_spriteram, state->m_spriteram, 0x400 * 2); } diff --git a/src/mame/video/goindol.c b/src/mame/video/goindol.c index 48d1a899c6f..466f98eab68 100644 --- a/src/mame/video/goindol.c +++ b/src/mame/video/goindol.c @@ -125,13 +125,13 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( goindol ) { - goindol_state *state = screen->machine().driver_data(); + goindol_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_fg_tilemap, 0, *state->m_fg_scrollx); tilemap_set_scrolly(state->m_fg_tilemap, 0, *state->m_fg_scrolly); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 1, state->m_spriteram); - draw_sprites(screen->machine(), bitmap, cliprect, 0, state->m_spriteram2); + draw_sprites(screen.machine(), bitmap, cliprect, 1, state->m_spriteram); + draw_sprites(screen.machine(), bitmap, cliprect, 0, state->m_spriteram2); return 0; } diff --git a/src/mame/video/goldstar.c b/src/mame/video/goldstar.c index 931d79bcedc..6867de01d2f 100644 --- a/src/mame/video/goldstar.c +++ b/src/mame/video/goldstar.c @@ -415,10 +415,10 @@ static const rectangle bingowng_visible1 = { 0*8, (14+48)*8-1, 3*8, (4+7)*8-1 SCREEN_UPDATE( goldstar ) { - goldstar_state *state = screen->machine().driver_data(); + goldstar_state *state = screen.machine().driver_data(); int i; - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); if (!state->m_cm_enable_reg &0x01) return 0; @@ -440,9 +440,9 @@ SCREEN_UPDATE( goldstar ) if (state->m_cm_enable_reg &0x04) { - if (screen->machine().region("user1")->base()) + if (screen.machine().region("user1")->base()) { - const gfx_element *gfx = screen->machine().gfx[2]; + const gfx_element *gfx = screen.machine().gfx[2]; int girlyscroll = (INT8)((state->m_cm_girl_scroll & 0xf0)); int girlxscroll = (INT8)((state->m_cm_girl_scroll & 0x0f)<<4); @@ -461,10 +461,10 @@ SCREEN_UPDATE( goldstar ) SCREEN_UPDATE( bingowng ) { - goldstar_state *state = screen->machine().driver_data(); + goldstar_state *state = screen.machine().driver_data(); int i; - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); if (!state->m_cm_enable_reg &0x01) return 0; @@ -482,9 +482,9 @@ SCREEN_UPDATE( bingowng ) if (state->m_cm_enable_reg &0x04) { - if (screen->machine().region("user1")->base()) + if (screen.machine().region("user1")->base()) { - const gfx_element *gfx = screen->machine().gfx[2]; + const gfx_element *gfx = screen.machine().gfx[2]; int girlyscroll = (INT8)((state->m_cm_girl_scroll & 0xf0)); int girlxscroll = (INT8)((state->m_cm_girl_scroll & 0x0f)<<4); @@ -503,10 +503,10 @@ SCREEN_UPDATE( bingowng ) SCREEN_UPDATE( magical ) { - goldstar_state *state = screen->machine().driver_data(); + goldstar_state *state = screen.machine().driver_data(); int i; - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); if (!state->m_cm_enable_reg &0x01) return 0; @@ -555,10 +555,10 @@ SCREEN_UPDATE( magical ) SCREEN_UPDATE( unkch ) { - goldstar_state *state = screen->machine().driver_data(); + goldstar_state *state = screen.machine().driver_data(); int i; - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); if (!state->m_cm_enable_reg &0x01) return 0; @@ -605,10 +605,10 @@ SCREEN_UPDATE( unkch ) SCREEN_UPDATE( cmast91 ) { - goldstar_state *state = screen->machine().driver_data(); + goldstar_state *state = screen.machine().driver_data(); int i; - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); if (!state->m_cm_enable_reg &0x01) return 0; @@ -637,10 +637,10 @@ SCREEN_UPDATE( cmast91 ) SCREEN_UPDATE( amcoe1a ) { - goldstar_state *state = screen->machine().driver_data(); + goldstar_state *state = screen.machine().driver_data(); int i; - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); if (!state->m_cm_enable_reg &0x01) return 0; diff --git a/src/mame/video/gomoku.c b/src/mame/video/gomoku.c index a6bc9728a8e..6ec9db8c509 100644 --- a/src/mame/video/gomoku.c +++ b/src/mame/video/gomoku.c @@ -152,10 +152,10 @@ VIDEO_START( gomoku ) SCREEN_UPDATE( gomoku ) { - gomoku_state *state = screen->machine().driver_data(); - UINT8 *GOMOKU_BG_X = screen->machine().region( "user1" )->base(); - UINT8 *GOMOKU_BG_Y = screen->machine().region( "user2" )->base(); - UINT8 *GOMOKU_BG_D = screen->machine().region( "user3" )->base(); + gomoku_state *state = screen.machine().driver_data(); + UINT8 *GOMOKU_BG_X = screen.machine().region( "user1" )->base(); + UINT8 *GOMOKU_BG_Y = screen.machine().region( "user2" )->base(); + UINT8 *GOMOKU_BG_D = screen.machine().region( "user3" )->base(); int x, y; int bgram; int bgoffs; diff --git a/src/mame/video/gotcha.c b/src/mame/video/gotcha.c index f908fb9e753..47b758fd417 100644 --- a/src/mame/video/gotcha.c +++ b/src/mame/video/gotcha.c @@ -137,9 +137,9 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( gotcha ) { - gotcha_state *state = screen->machine().driver_data(); + gotcha_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/gottlieb.c b/src/mame/video/gottlieb.c index ddaffeff6a0..d5caf3e1585 100644 --- a/src/mame/video/gottlieb.c +++ b/src/mame/video/gottlieb.c @@ -253,7 +253,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( gottlieb ) { - gottlieb_state *state = screen->machine().driver_data(); + gottlieb_state *state = screen.machine().driver_data(); /* if the background has lower priority, render it first, else clear the screen */ if (!state->m_background_priority) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_OPAQUE, 0); @@ -261,7 +261,7 @@ SCREEN_UPDATE( gottlieb ) bitmap_fill(bitmap, cliprect, 0); /* draw the sprites */ - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); /* if the background has higher priority, render it now */ if (state->m_background_priority) diff --git a/src/mame/video/gotya.c b/src/mame/video/gotya.c index 103c22516c7..66931e1ec26 100644 --- a/src/mame/video/gotya.c +++ b/src/mame/video/gotya.c @@ -179,10 +179,10 @@ static void draw_status( running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( gotya ) { - gotya_state *state = screen->machine().driver_data(); + gotya_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, -(*state->m_scroll + (state->m_scroll_bit_8 * 256)) - 2 * 8); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); - draw_status(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); + draw_status(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/gradius3.c b/src/mame/video/gradius3.c index b0197aa9ede..0bf9ab0009c 100644 --- a/src/mame/video/gradius3.c +++ b/src/mame/video/gradius3.c @@ -125,7 +125,7 @@ WRITE16_HANDLER( gradius3_gfxram_w ) SCREEN_UPDATE( gradius3 ) { - gradius3_state *state = screen->machine().driver_data(); + gradius3_state *state = screen.machine().driver_data(); /* TODO: this kludge enforces the char banks. For some reason, they don't work otherwise. */ k052109_w(state->m_k052109, 0x1d80, 0x10); @@ -133,7 +133,7 @@ SCREEN_UPDATE( gradius3 ) k052109_tilemap_update(state->m_k052109); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); if (state->m_priority == 0) { k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 2); diff --git a/src/mame/video/grchamp.c b/src/mame/video/grchamp.c index aae12923579..c38c06bdc2b 100644 --- a/src/mame/video/grchamp.c +++ b/src/mame/video/grchamp.c @@ -366,10 +366,10 @@ SCREEN_UPDATE( grchamp ) MAKE_RGB(RGB_MAX,RGB_MAX,RGB_MAX) }; - grchamp_state *state = screen->machine().driver_data(); - const UINT8 *amedata = screen->machine().region("gfx5")->base(); - const UINT8 *headdata = screen->machine().region("gfx6")->base(); - const UINT8 *pldata = screen->machine().region("gfx7")->base(); + grchamp_state *state = screen.machine().driver_data(); + const UINT8 *amedata = screen.machine().region("gfx5")->base(); + const UINT8 *headdata = screen.machine().region("gfx6")->base(); + const UINT8 *pldata = screen.machine().region("gfx7")->base(); bitmap_t *lpixmap = tilemap_get_pixmap(state->m_left_tilemap); bitmap_t *rpixmap = tilemap_get_pixmap(state->m_right_tilemap); bitmap_t *cpixmap = tilemap_get_pixmap(state->m_center_tilemap); @@ -409,7 +409,7 @@ SCREEN_UPDATE( grchamp ) UINT8 objdata[256]; /* draw the objects for this scanline */ - draw_objects(screen->machine(), state, y, objdata); + draw_objects(screen.machine(), state, y, objdata); /* iterate over columns */ for (x = cliprect->min_x; x <= cliprect->max_x; x++) diff --git a/src/mame/video/gridlee.c b/src/mame/video/gridlee.c index 6c8eea3f38a..086f94ed6a6 100644 --- a/src/mame/video/gridlee.c +++ b/src/mame/video/gridlee.c @@ -134,8 +134,8 @@ WRITE8_HANDLER( gridlee_palette_select_w ) SCREEN_UPDATE( gridlee ) { - gridlee_state *state = screen->machine().driver_data(); - const pen_t *pens = &screen->machine().pens[state->m_palettebank_vis * 32]; + gridlee_state *state = screen.machine().driver_data(); + const pen_t *pens = &screen.machine().pens[state->m_palettebank_vis * 32]; UINT8 *gfx; int x, y, i; @@ -160,7 +160,7 @@ SCREEN_UPDATE( gridlee ) } /* draw the sprite images */ - gfx = screen->machine().region("gfx1")->base(); + gfx = screen.machine().region("gfx1")->base(); for (i = 0; i < 32; i++) { UINT8 *sprite = state->m_spriteram + i * 4; diff --git a/src/mame/video/groundfx.c b/src/mame/video/groundfx.c index bbdaf7c525b..5d89438f9c8 100644 --- a/src/mame/video/groundfx.c +++ b/src/mame/video/groundfx.c @@ -201,9 +201,9 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( groundfx ) { - groundfx_state *state = screen->machine().driver_data(); - device_t *tc0100scn = screen->machine().device("tc0100scn"); - device_t *tc0480scp = screen->machine().device("tc0480scp"); + groundfx_state *state = screen.machine().driver_data(); + device_t *tc0100scn = screen.machine().device("tc0100scn"); + device_t *tc0480scp = screen.machine().device("tc0480scp"); UINT8 layer[5]; UINT8 pivlayer[3]; UINT16 priority; @@ -223,7 +223,7 @@ SCREEN_UPDATE( groundfx ) pivlayer[1] = pivlayer[0]^1; pivlayer[2] = 2; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); /* wrong color? */ tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[0], TILEMAP_DRAW_OPAQUE, 0); @@ -256,7 +256,7 @@ SCREEN_UPDATE( groundfx ) if (tc0480scp_long_r(tc0480scp, 0x20 / 4, 0xffffffff) != 0x240866) /* Stupid hack for start of race */ tc0480scp_tilemap_draw(tc0480scp, bitmap, &state->m_hack_cliprect, layer[0], 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 1, 44, -574); + draw_sprites(screen.machine(), bitmap, cliprect, 1, 44, -574); } else { @@ -267,7 +267,7 @@ SCREEN_UPDATE( groundfx ) tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[2], 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0, 44, -574); + draw_sprites(screen.machine(), bitmap, cliprect, 0, 44, -574); } tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0); /* TC0480SCP text layer */ diff --git a/src/mame/video/gstriker.c b/src/mame/video/gstriker.c index 22930ee90a2..f17435d8652 100644 --- a/src/mame/video/gstriker.c +++ b/src/mame/video/gstriker.c @@ -535,18 +535,18 @@ WRITE16_HANDLER( gsx_videoram3_w ) SCREEN_UPDATE(gstriker) { - gstriker_state *state = screen->machine().driver_data(); - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + gstriker_state *state = screen.machine().driver_data(); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); // Sandwitched screen/sprite0/score/sprite1. Surely wrong, probably // needs sprite orthogonality - MB60553_draw(screen->machine(), 0, bitmap,cliprect, 0); + MB60553_draw(screen.machine(), 0, bitmap,cliprect, 0); - CG10103_draw(screen->machine(), 0, bitmap, cliprect, 0); + CG10103_draw(screen.machine(), 0, bitmap, cliprect, 0); VS920A_draw(state, 0, bitmap, cliprect, 0); - CG10103_draw(screen->machine(), 0, bitmap, cliprect, 1); + CG10103_draw(screen.machine(), 0, bitmap, cliprect, 1); #if 0 popmessage("%04x %04x %04x %04x %04x %04x %04x %04x", diff --git a/src/mame/video/gsword.c b/src/mame/video/gsword.c index c89a1a708e5..b528d52121b 100644 --- a/src/mame/video/gsword.c +++ b/src/mame/video/gsword.c @@ -207,8 +207,8 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( gsword ) { - gsword_state *state = screen->machine().driver_data(); + gsword_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/gticlub.c b/src/mame/video/gticlub.c index 2212f99c53f..259f5f7891e 100644 --- a/src/mame/video/gticlub.c +++ b/src/mame/video/gticlub.c @@ -983,7 +983,7 @@ VIDEO_START( gticlub ) SCREEN_UPDATE( gticlub ) { - device_t *k001604 = screen->machine().device("k001604_1"); + device_t *k001604 = screen.machine().device("k001604_1"); k001604_draw_back_layer(k001604, bitmap, cliprect); @@ -995,15 +995,15 @@ SCREEN_UPDATE( gticlub ) if( tick >= 5 ) { tick = 0; - if( screen->machine().input().code_pressed(KEYCODE_O) ) + if( screen.machine().input().code_pressed(KEYCODE_O) ) debug_tex_page++; - if( screen->machine().input().code_pressed(KEYCODE_I) ) + if( screen.machine().input().code_pressed(KEYCODE_I) ) debug_tex_page--; - if (screen->machine().input().code_pressed(KEYCODE_U)) + if (screen.machine().input().code_pressed(KEYCODE_U)) debug_tex_palette++; - if (screen->machine().input().code_pressed(KEYCODE_Y)) + if (screen.machine().input().code_pressed(KEYCODE_Y)) debug_tex_palette--; if (debug_tex_page < 0) @@ -1044,19 +1044,19 @@ SCREEN_UPDATE( gticlub ) draw_7segment_led(bitmap, 3, 3, gticlub_led_reg[0]); draw_7segment_led(bitmap, 9, 3, gticlub_led_reg[1]); - //cputag_set_input_line(screen->machine(), "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE); - sharc_set_flag_input(screen->machine().device("dsp"), 1, ASSERT_LINE); + //cputag_set_input_line(screen.machine(), "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE); + sharc_set_flag_input(screen.machine().device("dsp"), 1, ASSERT_LINE); return 0; } SCREEN_UPDATE( hangplt ) { - bitmap_fill(bitmap, cliprect, screen->machine().pens[0]); + bitmap_fill(bitmap, cliprect, screen.machine().pens[0]); - if (strcmp(screen->tag(), "lscreen") == 0) + if (strcmp(screen.tag(), "lscreen") == 0) { - device_t *k001604 = screen->machine().device("k001604_1"); - device_t *voodoo = screen->machine().device("voodoo0"); + device_t *k001604 = screen.machine().device("k001604_1"); + device_t *voodoo = screen.machine().device("voodoo0"); // k001604_draw_back_layer(k001604, bitmap, cliprect); @@ -1064,10 +1064,10 @@ SCREEN_UPDATE( hangplt ) k001604_draw_front_layer(k001604, bitmap, cliprect); } - else if (strcmp(screen->tag(), "rscreen") == 0) + else if (strcmp(screen.tag(), "rscreen") == 0) { - device_t *k001604 = screen->machine().device("k001604_2"); - device_t *voodoo = screen->machine().device("voodoo1"); + device_t *k001604 = screen.machine().device("k001604_2"); + device_t *voodoo = screen.machine().device("voodoo1"); // k001604_draw_back_layer(k001604, bitmap, cliprect); diff --git a/src/mame/video/gumbo.c b/src/mame/video/gumbo.c index 16fe230ac01..7ddaf90e6e1 100644 --- a/src/mame/video/gumbo.c +++ b/src/mame/video/gumbo.c @@ -44,7 +44,7 @@ VIDEO_START( gumbo ) SCREEN_UPDATE( gumbo ) { - gumbo_state *state = screen->machine().driver_data(); + gumbo_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; diff --git a/src/mame/video/gunbustr.c b/src/mame/video/gunbustr.c index cd8d05558e9..4f61a03ff29 100644 --- a/src/mame/video/gunbustr.c +++ b/src/mame/video/gunbustr.c @@ -204,7 +204,7 @@ logerror("Sprite number %04x had %02x invalid chunks\n",tilenum,bad_chunks); SCREEN_UPDATE( gunbustr ) { - device_t *tc0480scp = screen->machine().device("tc0480scp"); + device_t *tc0480scp = screen.machine().device("tc0480scp"); UINT8 layer[5]; UINT16 priority; static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0}; @@ -218,25 +218,25 @@ SCREEN_UPDATE( gunbustr ) layer[3] = (priority & 0x000f) >> 0; /* tells us which is top */ layer[4] = 4; /* text layer always over bg layers */ - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); /* We have to assume 2nd to bottom layer is always underneath sprites as pdrawgfx cannot yet cope with more than 4 layers */ #ifdef MAME_DEBUG - if (!screen->machine().input().code_pressed (KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0],TILEMAP_DRAW_OPAQUE, 0); - if (!screen->machine().input().code_pressed (KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1); - if (!screen->machine().input().code_pressed (KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2); - if (!screen->machine().input().code_pressed (KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4); - if (!screen->machine().input().code_pressed (KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8); - if (!screen->machine().input().code_pressed (KEYCODE_N)) draw_sprites(screen->machine(), bitmap, cliprect, primasks, 48, -116); + if (!screen.machine().input().code_pressed (KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0],TILEMAP_DRAW_OPAQUE, 0); + if (!screen.machine().input().code_pressed (KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1); + if (!screen.machine().input().code_pressed (KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2); + if (!screen.machine().input().code_pressed (KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4); + if (!screen.machine().input().code_pressed (KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8); + if (!screen.machine().input().code_pressed (KEYCODE_N)) draw_sprites(screen.machine(), bitmap, cliprect, primasks, 48, -116); #else tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0); tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1); tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2); tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4); tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8); /* text layer */ - draw_sprites(screen->machine(), bitmap, cliprect, primasks, 48, -116); + draw_sprites(screen.machine(), bitmap, cliprect, primasks, 48, -116); #endif return 0; } diff --git a/src/mame/video/gundealr.c b/src/mame/video/gundealr.c index f7dab9e7e10..df271621504 100644 --- a/src/mame/video/gundealr.c +++ b/src/mame/video/gundealr.c @@ -134,7 +134,7 @@ WRITE8_HANDLER( gundealr_flipscreen_w ) SCREEN_UPDATE( gundealr ) { - gundealr_state *state = screen->machine().driver_data(); + gundealr_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; diff --git a/src/mame/video/gunsmoke.c b/src/mame/video/gunsmoke.c index 5931ca38ca1..4714b8a8751 100644 --- a/src/mame/video/gunsmoke.c +++ b/src/mame/video/gunsmoke.c @@ -176,17 +176,17 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( gunsmoke ) { - gunsmoke_state *state = screen->machine().driver_data(); + gunsmoke_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_scrollx[0] + 256 * state->m_scrollx[1]); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_scrolly[0]); if (state->m_bgon) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); else - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); if (state->m_objon) - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); if (state->m_chon) tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); diff --git a/src/mame/video/gyruss.c b/src/mame/video/gyruss.c index 63481ffd0a2..a9d2b237099 100644 --- a/src/mame/video/gyruss.c +++ b/src/mame/video/gyruss.c @@ -152,16 +152,16 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( gyruss ) { - gyruss_state *state = screen->machine().driver_data(); + gyruss_state *state = screen.machine().driver_data(); - if (cliprect->min_y == screen->visible_area().min_y) + if (cliprect->min_y == screen.visible_area().min_y) { - tilemap_mark_all_tiles_dirty_all(screen->machine()); - tilemap_set_flip_all(screen->machine(), (*state->m_flipscreen & 0x01) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); + tilemap_mark_all_tiles_dirty_all(screen.machine()); + tilemap_set_flip_all(screen.machine(), (*state->m_flipscreen & 0x01) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); } tilemap_draw(bitmap, cliprect, state->m_tilemap, TILEMAP_DRAW_OPAQUE, 0); - draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().gfx); + draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().gfx); tilemap_draw(bitmap, cliprect, state->m_tilemap, 0, 0); return 0; diff --git a/src/mame/video/hanaawas.c b/src/mame/video/hanaawas.c index 63f34aaa9d4..4c410997f55 100644 --- a/src/mame/video/hanaawas.c +++ b/src/mame/video/hanaawas.c @@ -110,7 +110,7 @@ VIDEO_START( hanaawas ) SCREEN_UPDATE( hanaawas ) { - hanaawas_state *state = screen->machine().driver_data(); + hanaawas_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/hcastle.c b/src/mame/video/hcastle.c index 836749b4e0e..6607ece4654 100644 --- a/src/mame/video/hcastle.c +++ b/src/mame/video/hcastle.c @@ -224,7 +224,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( hcastle ) { - hcastle_state *state = screen->machine().driver_data(); + hcastle_state *state = screen.machine().driver_data(); UINT8 ctrl_1_0 = k007121_ctrlram_r(state->m_k007121_1, 0); UINT8 ctrl_1_1 = k007121_ctrlram_r(state->m_k007121_1, 1); @@ -235,7 +235,7 @@ SCREEN_UPDATE( hcastle ) UINT8 ctrl_2_2 = k007121_ctrlram_r(state->m_k007121_2, 2); UINT8 ctrl_2_3 = k007121_ctrlram_r(state->m_k007121_2, 3); - set_pens(screen->machine()); + set_pens(screen.machine()); state->m_pf1_bankbase = 0x0000; state->m_pf2_bankbase = 0x4000 * ((state->m_gfx_bank & 2) >> 1); @@ -264,16 +264,16 @@ SCREEN_UPDATE( hcastle ) if ((state->m_gfx_bank & 0x04) == 0) { tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u8, 0); - draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram2.u8, 1); + draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u8, 0); + draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram2.u8, 1); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); } else { tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u8, 0); - draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram2.u8, 1); + draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u8, 0); + draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram2.u8, 1); } return 0; } diff --git a/src/mame/video/hexion.c b/src/mame/video/hexion.c index e296319ddeb..168d9008406 100644 --- a/src/mame/video/hexion.c +++ b/src/mame/video/hexion.c @@ -167,7 +167,7 @@ WRITE8_HANDLER( hexion_gfxrom_select_w ) SCREEN_UPDATE( hexion ) { - hexion_state *state = screen->machine().driver_data(); + hexion_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap[1],0,0); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap[0],0,0); return 0; diff --git a/src/mame/video/higemaru.c b/src/mame/video/higemaru.c index f23ebea4a7c..3b221cf9c60 100644 --- a/src/mame/video/higemaru.c +++ b/src/mame/video/higemaru.c @@ -147,8 +147,8 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( higemaru ) { - higemaru_state *state = screen->machine().driver_data(); + higemaru_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/himesiki.c b/src/mame/video/himesiki.c index 9f7e0985415..b150036cb4d 100644 --- a/src/mame/video/himesiki.c +++ b/src/mame/video/himesiki.c @@ -119,12 +119,12 @@ static void himesiki_draw_sprites( running_machine &machine, bitmap_t *bitmap, c SCREEN_UPDATE( himesiki ) { - himesiki_state *state = screen->machine().driver_data(); + himesiki_state *state = screen.machine().driver_data(); int x = -(state->m_scrollx[0] << 8 | state->m_scrollx[1]) & 0x1ff; tilemap_set_scrolldx(state->m_bg_tilemap, x, x); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_OPAQUE, 0); - himesiki_draw_sprites(screen->machine(), bitmap, cliprect); + himesiki_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/hnayayoi.c b/src/mame/video/hnayayoi.c index 4f9541a4485..27dff182ee5 100644 --- a/src/mame/video/hnayayoi.c +++ b/src/mame/video/hnayayoi.c @@ -265,7 +265,7 @@ static void draw_layer_interleaved( running_machine &machine, bitmap_t *bitmap, SCREEN_UPDATE( hnayayoi ) { - hnayayoi_state *state = screen->machine().driver_data(); + hnayayoi_state *state = screen.machine().driver_data(); int col0 = (state->m_palbank >> 0) & 0x0f; int col1 = (state->m_palbank >> 4) & 0x0f; int col2 = (state->m_palbank >> 8) & 0x0f; @@ -273,15 +273,15 @@ SCREEN_UPDATE( hnayayoi ) if (state->m_total_pixmaps == 4) { - draw_layer_interleaved(screen->machine(), bitmap, cliprect, 3, 2, col1, 0); - draw_layer_interleaved(screen->machine(), bitmap, cliprect, 1, 0, col0, 1); + draw_layer_interleaved(screen.machine(), bitmap, cliprect, 3, 2, col1, 0); + draw_layer_interleaved(screen.machine(), bitmap, cliprect, 1, 0, col0, 1); } else /* total_pixmaps == 8 */ { - draw_layer_interleaved(screen->machine(), bitmap, cliprect, 7, 6, col3, 0); - draw_layer_interleaved(screen->machine(), bitmap, cliprect, 5, 4, col2, 1); - draw_layer_interleaved(screen->machine(), bitmap, cliprect, 3, 2, col1, 1); - draw_layer_interleaved(screen->machine(), bitmap, cliprect, 1, 0, col0, 1); + draw_layer_interleaved(screen.machine(), bitmap, cliprect, 7, 6, col3, 0); + draw_layer_interleaved(screen.machine(), bitmap, cliprect, 5, 4, col2, 1); + draw_layer_interleaved(screen.machine(), bitmap, cliprect, 3, 2, col1, 1); + draw_layer_interleaved(screen.machine(), bitmap, cliprect, 1, 0, col0, 1); } return 0; } diff --git a/src/mame/video/hng64.c b/src/mame/video/hng64.c index 02fe212980e..016447165e9 100644 --- a/src/mame/video/hng64.c +++ b/src/mame/video/hng64.c @@ -1448,7 +1448,7 @@ static void hng64_drawtilemap(running_machine& machine, bitmap_t *bitmap, const SCREEN_UPDATE( hng64 ) { - hng64_state *state = screen->machine().driver_data(); + hng64_state *state = screen.machine().driver_data(); UINT32 *hng64_videoregs = state->m_videoregs; UINT32 *hng64_videoram = state->m_videoram; UINT32 *hng64_tcram = state->m_tcram; @@ -1461,15 +1461,15 @@ SCREEN_UPDATE( hng64 ) // press in sams64_2 attract mode for a nice debug screen from the game // not sure how functional it is, and it doesn't appear to test everything (rowscroll modes etc.) // but it could be useful - if ( screen->machine().input().code_pressed_once(KEYCODE_L) ) + if ( screen.machine().input().code_pressed_once(KEYCODE_L) ) { - address_space *space = screen->machine().device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); space->write_byte(0x2f27c8, 0x2); } #endif - bitmap_fill(bitmap, 0, hng64_tcram[0x50/4] & 0x10000 ? get_black_pen(screen->machine()) : screen->machine().pens[0]); //FIXME: Is the register correct? check with HW tests - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0x00); + bitmap_fill(bitmap, 0, hng64_tcram[0x50/4] & 0x10000 ? get_black_pen(screen.machine()) : screen.machine().pens[0]); //FIXME: Is the register correct? check with HW tests + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0x00); if (state->m_screen_dis) return 0; @@ -1539,10 +1539,10 @@ SCREEN_UPDATE( hng64 ) //hng64_mark_all_tiles_dirty(state, 2); //hng64_mark_all_tiles_dirty(state, 3); - hng64_drawtilemap(screen->machine(),bitmap,cliprect, 3); - hng64_drawtilemap(screen->machine(),bitmap,cliprect, 2); - hng64_drawtilemap(screen->machine(),bitmap,cliprect, 1); - hng64_drawtilemap(screen->machine(),bitmap,cliprect, 0); + hng64_drawtilemap(screen.machine(),bitmap,cliprect, 3); + hng64_drawtilemap(screen.machine(),bitmap,cliprect, 2); + hng64_drawtilemap(screen.machine(),bitmap,cliprect, 1); + hng64_drawtilemap(screen.machine(),bitmap,cliprect, 0); // 3d really shouldn't be last, but you don't see some cool stuff right now if it's put before sprites. { @@ -1566,10 +1566,10 @@ SCREEN_UPDATE( hng64 ) //printf("NEW FRAME!\n"); /* Debug - ajg */ } - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); if(0) - transition_control(screen->machine(), bitmap, cliprect); + transition_control(screen.machine(), bitmap, cliprect); if (0) popmessage("%08x %08x %08x %08x %08x", state->m_spriteregs[0], state->m_spriteregs[1], state->m_spriteregs[2], state->m_spriteregs[3], state->m_spriteregs[4]); @@ -1629,22 +1629,22 @@ SCREEN_UPDATE( hng64 ) hng64_tcram[0x58/4], hng64_tcram[0x5c/4]); - if ( screen->machine().input().code_pressed_once(KEYCODE_T) ) + if ( screen.machine().input().code_pressed_once(KEYCODE_T) ) { state->m_additive_tilemap_debug ^= 1; popmessage("blend changed %02x", state->m_additive_tilemap_debug); } - if ( screen->machine().input().code_pressed_once(KEYCODE_Y) ) + if ( screen.machine().input().code_pressed_once(KEYCODE_Y) ) { state->m_additive_tilemap_debug ^= 2; popmessage("blend changed %02x", state->m_additive_tilemap_debug); } - if ( screen->machine().input().code_pressed_once(KEYCODE_U) ) + if ( screen.machine().input().code_pressed_once(KEYCODE_U) ) { state->m_additive_tilemap_debug ^= 4; popmessage("blend changed %02x", state->m_additive_tilemap_debug); } - if ( screen->machine().input().code_pressed_once(KEYCODE_I) ) + if ( screen.machine().input().code_pressed_once(KEYCODE_I) ) { state->m_additive_tilemap_debug ^= 8; popmessage("blend changed %02x", state->m_additive_tilemap_debug); @@ -1655,7 +1655,7 @@ SCREEN_UPDATE( hng64 ) SCREEN_EOF( hng64 ) { - clear3d(screen->machine()); + clear3d(screen.machine()); } VIDEO_START( hng64 ) diff --git a/src/mame/video/holeland.c b/src/mame/video/holeland.c index 4d49073f8c6..2d73fc309c9 100644 --- a/src/mame/video/holeland.c +++ b/src/mame/video/holeland.c @@ -190,18 +190,18 @@ static void crzrally_draw_sprites( running_machine &machine, bitmap_t *bitmap,co SCREEN_UPDATE( holeland ) { - holeland_state *state = screen->machine().driver_data(); + holeland_state *state = screen.machine().driver_data(); /*tilemap_mark_all_tiles_dirty(state->m_bg_tilemap); */ tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1, 0); - holeland_draw_sprites(screen->machine(), bitmap, cliprect); + holeland_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0, 0); return 0; } SCREEN_UPDATE( crzrally ) { - holeland_state *state = screen->machine().driver_data(); + holeland_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - crzrally_draw_sprites(screen->machine(), bitmap, cliprect); + crzrally_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/homedata.c b/src/mame/video/homedata.c index 63af7bf05a5..1e71ef864a9 100644 --- a/src/mame/video/homedata.c +++ b/src/mame/video/homedata.c @@ -839,13 +839,13 @@ WRITE8_HANDLER( pteacher_blitter_start_w ) SCREEN_UPDATE( mrokumei ) { - homedata_state *state = screen->machine().driver_data(); + homedata_state *state = screen.machine().driver_data(); int flags,width; /* blank screen */ if (state->m_vreg[0x3] == 0xc1 && state->m_vreg[0x4] == 0xc0 && state->m_vreg[0x5] == 0xff) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } @@ -853,7 +853,7 @@ SCREEN_UPDATE( mrokumei ) if (flags != state->m_flipscreen) { state->m_flipscreen = flags; - tilemap_mark_all_tiles_dirty_all(screen->machine()); + tilemap_mark_all_tiles_dirty_all(screen.machine()); } switch (state->m_vreg[0x3]) @@ -872,7 +872,7 @@ SCREEN_UPDATE( mrokumei ) width = 54; break; } - screen->set_visible_area(0*8, width*8-1, 2*8, 30*8-1); + screen.set_visible_area(0*8, width*8-1, 2*8, 30*8-1); tilemap_set_scrollx(state->m_bg_tilemap[state->m_visible_page][0], 0, state->m_vreg[0xc] << 1); @@ -884,7 +884,7 @@ SCREEN_UPDATE( mrokumei ) #ifdef UNUSED_FUNCTION SCREEN_UPDATE( reikaids ) { - homedata_state *state = screen->machine().driver_data(); + homedata_state *state = screen.machine().driver_data(); int flags; static const int pritable[8][4] = { @@ -904,11 +904,11 @@ SCREEN_UPDATE( reikaids ) if (flags != state->m_flipscreen) { state->m_flipscreen = flags; - tilemap_mark_all_tiles_dirty_all(screen->machine()); + tilemap_mark_all_tiles_dirty_all(screen.machine()); } - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); pri = (state->m_bank & 0x70) >> 4; for (i = 0; i < 4; i++) @@ -919,7 +919,7 @@ SCREEN_UPDATE( reikaids ) SCREEN_UPDATE( reikaids ) { - homedata_state *state = screen->machine().driver_data(); + homedata_state *state = screen.machine().driver_data(); int flags; static const int pritable[2][8][4] = /* table of priorities derived from the PROM */ { @@ -951,11 +951,11 @@ SCREEN_UPDATE( reikaids ) if (flags != state->m_flipscreen) { state->m_flipscreen = flags; - tilemap_mark_all_tiles_dirty_all(screen->machine()); + tilemap_mark_all_tiles_dirty_all(screen.machine()); } - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); pri = (state->m_blitter_bank & 0x70) >> 4; for (i = 0; i < 4; i++) @@ -966,14 +966,14 @@ SCREEN_UPDATE( reikaids ) SCREEN_UPDATE( pteacher ) { - homedata_state *state = screen->machine().driver_data(); + homedata_state *state = screen.machine().driver_data(); int flags, scroll_low, scroll_high; /* blank screen */ if (state->m_vreg[0x3] == 0xc1 && state->m_vreg[0x4] == 0xc0 && state->m_vreg[0x5] == 0xff) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } @@ -981,7 +981,7 @@ SCREEN_UPDATE( pteacher ) if (flags != state->m_flipscreen) { state->m_flipscreen = flags; - tilemap_mark_all_tiles_dirty_all(screen->machine()); + tilemap_mark_all_tiles_dirty_all(screen.machine()); } /* bit 2 of blitter_bank stretches characters horizontally by 3/2, @@ -1013,24 +1013,24 @@ SCREEN_UPDATE( pteacher ) if (state->m_vreg[0x4] == 0xae || state->m_vreg[0x4] == 0xb8) { /* kludge for mjkinjas */ - screen->set_visible_area(0*8, 42*8-1, 2*8, 30*8-1); + screen.set_visible_area(0*8, 42*8-1, 2*8, 30*8-1); scroll_low = 0; } else { if (state->m_vreg[0x3] == 0xa6) - screen->set_visible_area(0*8, 33*8-1, 2*8, 30*8-1); + screen.set_visible_area(0*8, 33*8-1, 2*8, 30*8-1); else - screen->set_visible_area(0*8, 35*8-1, 2*8, 30*8-1); + screen.set_visible_area(0*8, 35*8-1, 2*8, 30*8-1); scroll_low = (11 - (state->m_vreg[0x4] & 0x0f)) * 8 / 12; } } else { if (state->m_vreg[0x3] == 0xa6) - screen->set_visible_area(0*8, 51*8-1, 2*8, 30*8-1); + screen.set_visible_area(0*8, 51*8-1, 2*8, 30*8-1); else - screen->set_visible_area(0*8, 54*8-1, 2*8, 30*8-1); + screen.set_visible_area(0*8, 54*8-1, 2*8, 30*8-1); scroll_low = 7 - (state->m_vreg[0x4] & 0x0f); } scroll_high = state->m_vreg[0xb] >> 2; @@ -1051,6 +1051,6 @@ SCREEN_UPDATE( mirderby ) SCREEN_EOF( homedata ) { - homedata_state *state = machine.driver_data(); + homedata_state *state = screen.machine().driver_data(); state->m_visible_page ^= 1; } diff --git a/src/mame/video/homerun.c b/src/mame/video/homerun.c index b83352490b5..9e239411871 100644 --- a/src/mame/video/homerun.c +++ b/src/mame/video/homerun.c @@ -84,7 +84,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE(homerun) { - homerun_state *state = screen->machine().driver_data(); + homerun_state *state = screen.machine().driver_data(); rectangle myclip = *cliprect; /* upper part */ @@ -94,14 +94,14 @@ SCREEN_UPDATE(homerun) myclip.max_y /= 2; state->m_gfx_ctrl = state->m_gc_up; tilemap_draw(bitmap, &myclip, state->m_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, &myclip); + draw_sprites(screen.machine(), bitmap, &myclip); /* lower part */ myclip.min_y += myclip.max_y; myclip.max_y *= 2; state->m_gfx_ctrl = state->m_gc_down; tilemap_draw(bitmap, &myclip, state->m_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, &myclip); + draw_sprites(screen.machine(), bitmap, &myclip); state->m_gc_down = state->m_gc_up; return 0; diff --git a/src/mame/video/hyhoo.c b/src/mame/video/hyhoo.c index 5a343bf641e..2a97a5d9a76 100644 --- a/src/mame/video/hyhoo.c +++ b/src/mame/video/hyhoo.c @@ -233,7 +233,7 @@ VIDEO_START( hyhoo ) SCREEN_UPDATE( hyhoo ) { - hyhoo_state *state = screen->machine().driver_data(); + hyhoo_state *state = screen.machine().driver_data(); if (state->m_dispflag) copybitmap(bitmap, state->m_tmpbitmap, state->m_flipscreen, state->m_flipscreen, 0, 0, cliprect); else diff --git a/src/mame/video/hyperspt.c b/src/mame/video/hyperspt.c index 53ad27eaaca..801beaa927a 100644 --- a/src/mame/video/hyperspt.c +++ b/src/mame/video/hyperspt.c @@ -176,18 +176,18 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( hyperspt ) { - hyperspt_state *state = screen->machine().driver_data(); + hyperspt_state *state = screen.machine().driver_data(); int row; for (row = 0; row < 32; row++) { int scrollx = state->m_scroll[row * 2] + (state->m_scroll[(row * 2) + 1] & 0x01) * 256; - if (flip_screen_get(screen->machine())) scrollx = -scrollx; + if (flip_screen_get(screen.machine())) scrollx = -scrollx; tilemap_set_scrollx(state->m_bg_tilemap, row, scrollx); } tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/hyprduel.c b/src/mame/video/hyprduel.c index 7893132518e..188206dc285 100644 --- a/src/mame/video/hyprduel.c +++ b/src/mame/video/hyprduel.c @@ -673,7 +673,7 @@ static void dirty_tiles( running_machine &machine, int layer, UINT16 *vram ) SCREEN_UPDATE( hyprduel ) { - hyprduel_state *state = screen->machine().driver_data(); + hyprduel_state *state = screen.machine().driver_data(); int i, pri, layers_ctrl = -1; UINT16 screenctrl = *state->m_screenctrl; @@ -696,17 +696,17 @@ SCREEN_UPDATE( hyprduel ) if (dirty) { - dirty_tiles(screen->machine(), 0, state->m_vram_0); - dirty_tiles(screen->machine(), 1, state->m_vram_1); - dirty_tiles(screen->machine(), 2, state->m_vram_2); + dirty_tiles(screen.machine(), 0, state->m_vram_0); + dirty_tiles(screen.machine(), 1, state->m_vram_1); + dirty_tiles(screen.machine(), 2, state->m_vram_2); } } - state->m_sprite_xoffs = state->m_videoregs[0x06 / 2] - screen->width() / 2; - state->m_sprite_yoffs = state->m_videoregs[0x04 / 2] - screen->height() / 2 - state->m_sprite_yoffs_sub; + state->m_sprite_xoffs = state->m_videoregs[0x06 / 2] - screen.width() / 2; + state->m_sprite_yoffs = state->m_videoregs[0x04 / 2] - screen.height() / 2 - state->m_sprite_yoffs_sub; /* The background color is selected by a register */ - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, ((state->m_videoregs[0x12 / 2] & 0x0fff)) + 0x1000); /* Screen Control Register: @@ -722,15 +722,15 @@ SCREEN_UPDATE( hyprduel ) ---- ---- ---- ---0 Flip Screen */ if (screenctrl & 2) return 0; - flip_screen_set(screen->machine(), screenctrl & 1); + flip_screen_set(screen.machine(), screenctrl & 1); #if 0 -if (screen->machine().input().code_pressed(KEYCODE_Z)) +if (screen.machine().input().code_pressed(KEYCODE_Z)) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 0x01; - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= 0x02; - if (screen->machine().input().code_pressed(KEYCODE_E)) msk |= 0x04; - if (screen->machine().input().code_pressed(KEYCODE_A)) msk |= 0x08; + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 0x01; + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 0x02; + if (screen.machine().input().code_pressed(KEYCODE_E)) msk |= 0x04; + if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= 0x08; if (msk != 0) { bitmap_fill(bitmap, cliprect,0); @@ -745,10 +745,10 @@ if (screen->machine().input().code_pressed(KEYCODE_Z)) #endif for (pri = 3; pri >= 0; pri--) - draw_layers(screen->machine(), bitmap, cliprect, pri, layers_ctrl); + draw_layers(screen.machine(), bitmap, cliprect, pri, layers_ctrl); if (layers_ctrl & 0x08) - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/ikki.c b/src/mame/video/ikki.c index d16943d5f14..d7e4f0ecf35 100644 --- a/src/mame/video/ikki.c +++ b/src/mame/video/ikki.c @@ -126,9 +126,9 @@ VIDEO_START( ikki ) SCREEN_UPDATE( ikki ) { - ikki_state *state = screen->machine().driver_data(); + ikki_state *state = screen.machine().driver_data(); offs_t offs; - UINT8 *VIDEOATTR = screen->machine().region("user1")->base(); + UINT8 *VIDEOATTR = screen.machine().region("user1")->base(); /* draw bg layer */ @@ -178,14 +178,14 @@ SCREEN_UPDATE( ikki ) bank = (color & 0xe0) << 3; color = ((color & 0x1f)<<0) | ((color & 0x80) >> 2); - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0], state->m_videoram[offs * 2 + 1] + bank, color, state->m_flipscreen,state->m_flipscreen, x,y); } - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); /* mask sprites */ @@ -213,7 +213,7 @@ SCREEN_UPDATE( ikki ) bank = (color & 0xe0) << 3; color = ((color & 0x1f)<<0) | ((color & 0x80) >> 2); - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0], state->m_videoram[offs * 2 + 1] + bank, color, state->m_flipscreen,state->m_flipscreen, diff --git a/src/mame/video/inufuku.c b/src/mame/video/inufuku.c index 0bb7e1b069a..5c0144cce6d 100644 --- a/src/mame/video/inufuku.c +++ b/src/mame/video/inufuku.c @@ -236,11 +236,11 @@ VIDEO_START( inufuku ) SCREEN_UPDATE( inufuku ) { - inufuku_state *state = screen->machine().driver_data(); + inufuku_state *state = screen.machine().driver_data(); int i; - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); - bitmap_fill(screen->machine().priority_bitmap, NULL, 0); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); + bitmap_fill(screen.machine().priority_bitmap, NULL, 0); if (state->m_bg_raster) { @@ -260,6 +260,6 @@ SCREEN_UPDATE( inufuku ) tilemap_set_scrolly(state->m_tx_tilemap, 0, state->m_tx_scrolly); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 4); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/iqblock.c b/src/mame/video/iqblock.c index a74837cb19a..cb02bc2a843 100644 --- a/src/mame/video/iqblock.c +++ b/src/mame/video/iqblock.c @@ -92,7 +92,7 @@ WRITE8_HANDLER( iqblock_fgscroll_w ) SCREEN_UPDATE( iqblock ) { - iqblock_state *state = screen->machine().driver_data(); + iqblock_state *state = screen.machine().driver_data(); if (!state->m_videoenable) return 0; tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); diff --git a/src/mame/video/irobot.c b/src/mame/video/irobot.c index d784d6a4695..7f58ca18202 100644 --- a/src/mame/video/irobot.c +++ b/src/mame/video/irobot.c @@ -348,7 +348,7 @@ void irobot_run_video(running_machine &machine) SCREEN_UPDATE( irobot ) { - irobot_state *state = screen->machine().driver_data(); + irobot_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; UINT8 *bitmap_base = state->m_bufsel ? state->m_polybitmap1 : state->m_polybitmap2; int x, y, offs; @@ -364,7 +364,7 @@ SCREEN_UPDATE( irobot ) int code = videoram[offs] & 0x3f; int color = ((videoram[offs] & 0xc0) >> 6) | (state->m_alphamap >> 3); - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], code, color, 0,0, 8*x,8*y,0); diff --git a/src/mame/video/ironhors.c b/src/mame/video/ironhors.c index 93b06bf4cca..c804dcb7c85 100644 --- a/src/mame/video/ironhors.c +++ b/src/mame/video/ironhors.c @@ -241,14 +241,14 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( ironhors ) { - ironhors_state *state = screen->machine().driver_data(); + ironhors_state *state = screen.machine().driver_data(); int row; for (row = 0; row < 32; row++) tilemap_set_scrollx(state->m_bg_tilemap, row, state->m_scroll[row]); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } @@ -354,14 +354,14 @@ static void farwest_draw_sprites( running_machine &machine, bitmap_t *bitmap, co SCREEN_UPDATE( farwest) { - ironhors_state *state = screen->machine().driver_data(); + ironhors_state *state = screen.machine().driver_data(); int row; for (row = 0; row < 32; row++) tilemap_set_scrollx(state->m_bg_tilemap, row, state->m_scroll[row]); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - farwest_draw_sprites(screen->machine(), bitmap, cliprect); + farwest_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/itech32.c b/src/mame/video/itech32.c index 8e2fb1ddb18..afc0f13f222 100644 --- a/src/mame/video/itech32.c +++ b/src/mame/video/itech32.c @@ -1432,7 +1432,7 @@ READ32_HANDLER( itech020_video_r ) SCREEN_UPDATE( itech32 ) { - itech32_state *state = screen->machine().driver_data(); + itech32_state *state = screen.machine().driver_data(); int y; /* loop over height */ diff --git a/src/mame/video/itech8.c b/src/mame/video/itech8.c index ce94fdbc0d0..49f7cb000b5 100644 --- a/src/mame/video/itech8.c +++ b/src/mame/video/itech8.c @@ -610,11 +610,11 @@ TIMER_DEVICE_CALLBACK( grmatch_palette_update ) SCREEN_UPDATE( itech8_2layer ) { - itech8_state *state = screen->machine().driver_data(); + itech8_state *state = screen.machine().driver_data(); struct tms34061_display &tms_state = state->m_tms_state; UINT32 page_offset; int x, y; - const rgb_t *pens = tlc34076_get_pens(screen->machine().device("tlc34076")); + const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076")); /* first get the current display state */ tms34061_get_display_state(&tms_state); @@ -622,7 +622,7 @@ SCREEN_UPDATE( itech8_2layer ) /* if we're blanked, just fill with black */ if (tms_state.blanked) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } @@ -648,7 +648,7 @@ SCREEN_UPDATE( itech8_2layer ) SCREEN_UPDATE( itech8_grmatch ) { - itech8_state *state = screen->machine().driver_data(); + itech8_state *state = screen.machine().driver_data(); struct tms34061_display &tms_state = state->m_tms_state; UINT32 page_offset; int x, y; @@ -659,7 +659,7 @@ SCREEN_UPDATE( itech8_grmatch ) /* if we're blanked, just fill with black */ if (tms_state.blanked) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } @@ -697,11 +697,11 @@ SCREEN_UPDATE( itech8_grmatch ) SCREEN_UPDATE( itech8_2page ) { - itech8_state *state = screen->machine().driver_data(); + itech8_state *state = screen.machine().driver_data(); struct tms34061_display &tms_state = state->m_tms_state; UINT32 page_offset; int x, y; - const rgb_t *pens = tlc34076_get_pens(screen->machine().device("tlc34076")); + const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076")); /* first get the current display state */ tms34061_get_display_state(&tms_state); @@ -709,7 +709,7 @@ SCREEN_UPDATE( itech8_2page ) /* if we're blanked, just fill with black */ if (tms_state.blanked) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } @@ -730,11 +730,11 @@ SCREEN_UPDATE( itech8_2page ) SCREEN_UPDATE( itech8_2page_large ) { - itech8_state *state = screen->machine().driver_data(); + itech8_state *state = screen.machine().driver_data(); struct tms34061_display &tms_state = state->m_tms_state; UINT32 page_offset; int x, y; - const rgb_t *pens = tlc34076_get_pens(screen->machine().device("tlc34076")); + const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076")); /* first get the current display state */ tms34061_get_display_state(&tms_state); @@ -742,7 +742,7 @@ SCREEN_UPDATE( itech8_2page_large ) /* if we're blanked, just fill with black */ if (tms_state.blanked) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } diff --git a/src/mame/video/jack.c b/src/mame/video/jack.c index 20480d24911..39125507efe 100644 --- a/src/mame/video/jack.c +++ b/src/mame/video/jack.c @@ -99,9 +99,9 @@ static void jack_draw_sprites( running_machine &machine, bitmap_t *bitmap, const SCREEN_UPDATE( jack ) { - jack_state *state = screen->machine().driver_data(); + jack_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - jack_draw_sprites(screen->machine(), bitmap, cliprect); + jack_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } @@ -184,8 +184,8 @@ static void joinem_draw_sprites( running_machine &machine, bitmap_t *bitmap, con SCREEN_UPDATE( joinem ) { - jack_state *state = screen->machine().driver_data(); + jack_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - joinem_draw_sprites(screen->machine(), bitmap, cliprect); + joinem_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/jackal.c b/src/mame/video/jackal.c index 296a0ec9e21..1124295d5bb 100644 --- a/src/mame/video/jackal.c +++ b/src/mame/video/jackal.c @@ -224,8 +224,8 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( jackal ) { - set_pens(screen->machine()); - draw_background(screen->machine(), bitmap, cliprect); - draw_sprites(screen->machine(), bitmap, cliprect); + set_pens(screen.machine()); + draw_background(screen.machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/jailbrek.c b/src/mame/video/jailbrek.c index 9b588ee5d67..da0133df880 100644 --- a/src/mame/video/jailbrek.c +++ b/src/mame/video/jailbrek.c @@ -97,7 +97,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( jailbrek ) { - jailbrek_state *state = screen->machine().driver_data(); + jailbrek_state *state = screen.machine().driver_data(); int i; // added support for vertical scrolling (credits). 23/1/2002 -BR @@ -122,6 +122,6 @@ SCREEN_UPDATE( jailbrek ) } tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/jedi.c b/src/mame/video/jedi.c index 397ccbaffbe..39e42d0ed98 100644 --- a/src/mame/video/jedi.c +++ b/src/mame/video/jedi.c @@ -329,7 +329,7 @@ static void draw_sprites(running_machine &machine, jedi_state *state, bitmap_t * static SCREEN_UPDATE( jedi ) { - jedi_state *state = screen->machine().driver_data(); + jedi_state *state = screen.machine().driver_data(); /* if no video, clear it all to black */ if (*state->m_video_off & 0x01) @@ -338,8 +338,8 @@ static SCREEN_UPDATE( jedi ) { /* draw the background/text layers, followed by the sprites - it needs to be done in this order*/ - draw_background_and_text(screen->machine(), state, bitmap, cliprect); - draw_sprites(screen->machine(), state, bitmap, cliprect); + draw_background_and_text(screen.machine(), state, bitmap, cliprect); + draw_sprites(screen.machine(), state, bitmap, cliprect); do_pen_lookup(state, bitmap, cliprect); } diff --git a/src/mame/video/kan_panb.c b/src/mame/video/kan_panb.c index 40d5b718789..0d1c66cc6a9 100644 --- a/src/mame/video/kan_panb.c +++ b/src/mame/video/kan_panb.c @@ -6,7 +6,7 @@ SCREEN_UPDATE( honeydol ) { - snowbros_state *state = screen->machine().driver_data(); + snowbros_state *state = screen.machine().driver_data(); UINT16 *spriteram16 = state->m_bootleg_spriteram16; int sx=0, sy=0, x=0, y=0, offs; /* sprites clip on left / right edges when scrolling, but it seems correct, @@ -33,7 +33,7 @@ SCREEN_UPDATE( honeydol ) x = dx; y = dy; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { sx = 240 - x; sy = 240 - y; @@ -46,7 +46,7 @@ SCREEN_UPDATE( honeydol ) sy = y; } - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1], tile, tilecolour, flipx, flipy, @@ -64,7 +64,7 @@ SCREEN_UPDATE( honeydol ) x = dx; y = dy; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { sx = 240 - x; sy = 240 - y; @@ -80,7 +80,7 @@ SCREEN_UPDATE( honeydol ) tilecolour = (tilecolour&0x03f0) >> 4; tilecolour ^=0x3f; // unusual, but correct.. - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], tile, tilecolour, flipx, flipy, @@ -92,7 +92,7 @@ SCREEN_UPDATE( honeydol ) SCREEN_UPDATE( twinadv ) { - snowbros_state *state = screen->machine().driver_data(); + snowbros_state *state = screen.machine().driver_data(); UINT16 *spriteram16 = state->m_bootleg_spriteram16; int sx=0, sy=0, x=0, y=0, offs; /* sprites clip on left / right edges when scrolling, but it seems correct, @@ -120,7 +120,7 @@ SCREEN_UPDATE( twinadv ) x = dx; y = dy; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { sx = 240 - x; sy = 240 - y; @@ -136,7 +136,7 @@ SCREEN_UPDATE( twinadv ) tilecolour = (tilecolour&0x00f0) >> 4; tilecolour ^=0xf; // unusual, but correct.. - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], tile, tilecolour, flipx, flipy, @@ -148,11 +148,11 @@ SCREEN_UPDATE( twinadv ) SCREEN_UPDATE( wintbob ) { - snowbros_state *state = screen->machine().driver_data(); + snowbros_state *state = screen.machine().driver_data(); UINT16 *spriteram16 = state->m_bootleg_spriteram16; int offs; - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); for (offs = 0;offs < state->m_spriteram_size/2;offs += 8) { @@ -169,7 +169,7 @@ SCREEN_UPDATE( wintbob ) if (wrapr == 8) xpos -= 256; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { xpos = 240 - xpos; ypos = 240 - ypos; @@ -179,7 +179,7 @@ SCREEN_UPDATE( wintbob ) if ((xpos > -16) && (ypos > 0) && (xpos < 256) && (ypos < 240) && (disbl !=2)) { - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], tilen, colr, flipx, flipy, @@ -192,7 +192,7 @@ SCREEN_UPDATE( wintbob ) SCREEN_UPDATE( snowbro3 ) { - snowbros_state *state = screen->machine().driver_data(); + snowbros_state *state = screen.machine().driver_data(); UINT16 *spriteram16 = state->m_bootleg_spriteram16; int sx=0, sy=0, x=0, y=0, offs; @@ -220,11 +220,11 @@ SCREEN_UPDATE( snowbro3 ) /* This clears & redraws the entire screen each pass */ - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); for (offs = 0;offs < state->m_spriteram_size/2;offs += 8) { - gfx_element *gfx = screen->machine().gfx[0]; + gfx_element *gfx = screen.machine().gfx[0]; int dx = spriteram16[offs+4] & 0xff; int dy = spriteram16[offs+5] & 0xff; int tilecolour = spriteram16[offs+3]; @@ -249,7 +249,7 @@ SCREEN_UPDATE( snowbro3 ) if (x > 511) x &= 0x1ff; if (y > 511) y &= 0x1ff; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { sx = 240 - x; sy = 240 - y; @@ -264,7 +264,7 @@ SCREEN_UPDATE( snowbro3 ) if (offs < 0x800) /* i guess this is the right way */ { - gfx = screen->machine().gfx[1]; + gfx = screen.machine().gfx[1]; tilecolour = 0x10; } diff --git a/src/mame/video/kaneko16.c b/src/mame/video/kaneko16.c index 29fc5f0b841..e2e9fb77b02 100644 --- a/src/mame/video/kaneko16.c +++ b/src/mame/video/kaneko16.c @@ -1009,15 +1009,15 @@ static SCREEN_UPDATE( common ) { int i; - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); - kaneko16_prepare_first_tilemap_chip(screen->machine(), bitmap, cliprect); - kaneko16_prepare_second_tilemap_chip(screen->machine(), bitmap, cliprect); + kaneko16_prepare_first_tilemap_chip(screen.machine(), bitmap, cliprect); + kaneko16_prepare_second_tilemap_chip(screen.machine(), bitmap, cliprect); for ( i = 0; i < 8; i++ ) { - kaneko16_render_first_tilemap_chip(screen->machine(),bitmap,cliprect,i); - kaneko16_render_second_tilemap_chip(screen->machine(),bitmap,cliprect,i); + kaneko16_render_first_tilemap_chip(screen.machine(),bitmap,cliprect,i); + kaneko16_render_second_tilemap_chip(screen.machine(),bitmap,cliprect,i); } return 0; @@ -1025,22 +1025,22 @@ static SCREEN_UPDATE( common ) SCREEN_UPDATE(berlwall) { - kaneko16_state *state = screen->machine().driver_data(); + kaneko16_state *state = screen.machine().driver_data(); // berlwall uses a 15bpp bitmap as a bg, not a solid fill - kaneko16_render_15bpp_bitmap(screen->machine(),bitmap,cliprect); + kaneko16_render_15bpp_bitmap(screen.machine(),bitmap,cliprect); // if the display is disabled, do nothing? if (!state->m_disp_enable) return 0; SCREEN_UPDATE_CALL(common); - kaneko16_render_sprites(screen->machine(),bitmap,cliprect); + kaneko16_render_sprites(screen.machine(),bitmap,cliprect); return 0; } SCREEN_UPDATE( jchan_view2 ) { - kaneko16_state *state = screen->machine().driver_data(); + kaneko16_state *state = screen.machine().driver_data(); int dx,dy; SCREEN_UPDATE_CALL(common); @@ -1060,21 +1060,21 @@ SCREEN_UPDATE( jchan_view2 ) SCREEN_UPDATE( kaneko16 ) { - kaneko16_state *state = screen->machine().driver_data(); - kaneko16_fill_bitmap(screen->machine(),bitmap,cliprect); + kaneko16_state *state = screen.machine().driver_data(); + kaneko16_fill_bitmap(screen.machine(),bitmap,cliprect); // if the display is disabled, do nothing? if (!state->m_disp_enable) return 0; SCREEN_UPDATE_CALL(common); - kaneko16_render_sprites(screen->machine(),bitmap,cliprect); + kaneko16_render_sprites(screen.machine(),bitmap,cliprect); return 0; } SCREEN_UPDATE( galsnew ) { - kaneko16_state *state = screen->machine().driver_data(); -// kaneko16_fill_bitmap(screen->machine(),bitmap,cliprect); + kaneko16_state *state = screen.machine().driver_data(); +// kaneko16_fill_bitmap(screen.machine(),bitmap,cliprect); int y,x; int count; @@ -1115,16 +1115,16 @@ SCREEN_UPDATE( galsnew ) SCREEN_UPDATE_CALL(common); - kaneko16_render_sprites(screen->machine(),bitmap,cliprect); + kaneko16_render_sprites(screen.machine(),bitmap,cliprect); return 0; } SCREEN_UPDATE( sandscrp ) { - kaneko16_state *state = screen->machine().driver_data(); - device_t *pandora = screen->machine().device("pandora"); - kaneko16_fill_bitmap(screen->machine(),bitmap,cliprect); + kaneko16_state *state = screen.machine().driver_data(); + device_t *pandora = screen.machine().device("pandora"); + kaneko16_fill_bitmap(screen.machine(),bitmap,cliprect); // if the display is disabled, do nothing? if (!state->m_disp_enable) return 0; diff --git a/src/mame/video/kangaroo.c b/src/mame/video/kangaroo.c index 69180e524a9..fd1a061afb2 100644 --- a/src/mame/video/kangaroo.c +++ b/src/mame/video/kangaroo.c @@ -138,7 +138,7 @@ static void blitter_execute( running_machine &machine ) SCREEN_UPDATE( kangaroo ) { - kangaroo_state *state = screen->machine().driver_data(); + kangaroo_state *state = screen.machine().driver_data(); UINT8 scrolly = state->m_video_control[6]; UINT8 scrollx = state->m_video_control[7]; UINT8 maska = (state->m_video_control[10] & 0x28) >> 3; diff --git a/src/mame/video/karnov.c b/src/mame/video/karnov.c index 0d20f603e0d..8d8dfbe7f37 100644 --- a/src/mame/video/karnov.c +++ b/src/mame/video/karnov.c @@ -125,9 +125,9 @@ static void draw_background( running_machine &machine, bitmap_t *bitmap, const r SCREEN_UPDATE( karnov ) { - karnov_state *state = screen->machine().driver_data(); - draw_background(screen->machine(), bitmap, cliprect); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0x800, 0); + karnov_state *state = screen.machine().driver_data(); + draw_background(screen.machine(), bitmap, cliprect); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u16, 0x800, 0); tilemap_draw(bitmap, cliprect, state->m_fix_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/kchamp.c b/src/mame/video/kchamp.c index 667f03e399a..0344865eae2 100644 --- a/src/mame/video/kchamp.c +++ b/src/mame/video/kchamp.c @@ -129,18 +129,18 @@ static void kchampvs_draw_sprites( running_machine &machine, bitmap_t *bitmap, c SCREEN_UPDATE( kchamp ) { - kchamp_state *state = screen->machine().driver_data(); + kchamp_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - kchamp_draw_sprites(screen->machine(), bitmap, cliprect); + kchamp_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( kchampvs ) { - kchamp_state *state = screen->machine().driver_data(); + kchamp_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - kchampvs_draw_sprites(screen->machine(), bitmap, cliprect); + kchampvs_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/kickgoal.c b/src/mame/video/kickgoal.c index d03db4bc0b5..2e2bf572629 100644 --- a/src/mame/video/kickgoal.c +++ b/src/mame/video/kickgoal.c @@ -124,7 +124,7 @@ static void kickgoal_draw_sprites( running_machine &machine, bitmap_t *bitmap,co SCREEN_UPDATE( kickgoal ) { - kickgoal_state *state = screen->machine().driver_data(); + kickgoal_state *state = screen.machine().driver_data(); /* set scroll */ tilemap_set_scrollx(state->m_fgtm, 0, state->m_scrram[0]); @@ -138,7 +138,7 @@ SCREEN_UPDATE( kickgoal ) tilemap_draw(bitmap, cliprect, state->m_bg2tm, 0, 0); tilemap_draw(bitmap, cliprect, state->m_bgtm, 0, 0); - kickgoal_draw_sprites(screen->machine(), bitmap, cliprect); + kickgoal_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fgtm, 0, 0); @@ -255,7 +255,7 @@ static void actionhw_draw_sprites(running_machine &machine, bitmap_t *bitmap,con SCREEN_UPDATE( actionhw ) { - kickgoal_state *state = screen->machine().driver_data(); + kickgoal_state *state = screen.machine().driver_data(); /* set scroll */ tilemap_set_scrollx(state->m_fgtm, 0, state->m_scrram[0]); tilemap_set_scrolly(state->m_fgtm, 0, state->m_scrram[1]); @@ -268,7 +268,7 @@ SCREEN_UPDATE( actionhw ) tilemap_draw(bitmap, cliprect, state->m_bg2tm, 0, 0); tilemap_draw(bitmap, cliprect, state->m_bgtm, 0, 0); - actionhw_draw_sprites(screen->machine(), bitmap, cliprect); + actionhw_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fgtm, 0, 0); return 0; diff --git a/src/mame/video/kingobox.c b/src/mame/video/kingobox.c index 389edc965bd..650431b3287 100644 --- a/src/mame/video/kingobox.c +++ b/src/mame/video/kingobox.c @@ -248,11 +248,11 @@ static void kingofb_draw_sprites(running_machine &machine, bitmap_t *bitmap, con SCREEN_UPDATE( kingofb ) { - kingofb_state *state = screen->machine().driver_data(); + kingofb_state *state = screen.machine().driver_data(); tilemap_set_scrolly(state->m_bg_tilemap, 0, -(*state->m_scroll_y)); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - kingofb_draw_sprites(screen->machine(), bitmap, cliprect); + kingofb_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } @@ -310,11 +310,11 @@ static void ringking_draw_sprites( running_machine &machine, bitmap_t *bitmap, c SCREEN_UPDATE( ringking ) { - kingofb_state *state = screen->machine().driver_data(); + kingofb_state *state = screen.machine().driver_data(); tilemap_set_scrolly(state->m_bg_tilemap, 0, -(*state->m_scroll_y)); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - ringking_draw_sprites(screen->machine(), bitmap, cliprect); + ringking_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/klax.c b/src/mame/video/klax.c index 6263f83b408..606eb45600b 100644 --- a/src/mame/video/klax.c +++ b/src/mame/video/klax.c @@ -103,7 +103,7 @@ WRITE16_HANDLER( klax_latch_w ) SCREEN_UPDATE( klax ) { - klax_state *state = screen->machine().driver_data(); + klax_state *state = screen.machine().driver_data(); atarimo_rect_list rectlist; bitmap_t *mobitmap; int x, y, r; diff --git a/src/mame/video/kncljoe.c b/src/mame/video/kncljoe.c index 015450955a0..2d229a1ac55 100644 --- a/src/mame/video/kncljoe.c +++ b/src/mame/video/kncljoe.c @@ -240,9 +240,9 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( kncljoe ) { - kncljoe_state *state = screen->machine().driver_data(); + kncljoe_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/konamigx.c b/src/mame/video/konamigx.c index 0bd0ab9b67b..4b1f504537c 100644 --- a/src/mame/video/konamigx.c +++ b/src/mame/video/konamigx.c @@ -2384,98 +2384,6 @@ VIDEO_START(racinfrc) SCREEN_UPDATE(konamigx) { int i, newbank, newbase, dirty, unchained; - bitmap_t* realbitmap = bitmap; - - if (konamigx_has_dual_screen) - { - device_t *left_screen = screen->machine().device("screen"); - device_t *right_screen = screen->machine().device("screen2"); - - /* the video gets demuxed by a board which plugs into the jamma connector */ - if (screen==left_screen) - { - konamigx_current_frame^=1; - - if (konamigx_current_frame==1) - { - int offset=0; - - if (konamigx_palformat==1) - { - for (offset=0;offset<0x4000/4;offset++) - { - UINT32 coldat = screen->machine().generic.paletteram.u32[offset]; - - set_color_555(screen->machine(), offset*2, 0, 5, 10,coldat >> 16); - set_color_555(screen->machine(), offset*2+1, 0, 5, 10,coldat & 0xffff); - } - } - else - { - for (offset=0;offset<0x8000/4;offset++) - { - int r,g,b; - - r = (screen->machine().generic.paletteram.u32[offset] >>16) & 0xff; - g = (screen->machine().generic.paletteram.u32[offset] >> 8) & 0xff; - b = (screen->machine().generic.paletteram.u32[offset] >> 0) & 0xff; - - palette_set_color(screen->machine(),offset,MAKE_RGB(r,g,b)); - } - } - - bitmap = dualscreen_left_tempbitmap; - // draw - } - else - { - copybitmap(bitmap, dualscreen_left_tempbitmap, 0, 0, 0, 0, cliprect); - return 0; - } - - } - else if (screen==right_screen) - { - - if (konamigx_current_frame==1) - { - copybitmap(bitmap, dualscreen_right_tempbitmap, 0, 0, 0, 0, cliprect); - return 0; - } - else - { - - int offset=0; - - if (konamigx_palformat==1) - { - for (offset=0;offset<0x4000/4;offset++) - { - UINT32 coldat = gx_subpaletteram32[offset]; - - set_color_555(screen->machine(), offset*2, 0, 5, 10,coldat >> 16); - set_color_555(screen->machine(), offset*2+1, 0, 5, 10,coldat & 0xffff); - } - } - else - { - for (offset=0;offset<0x8000/4;offset++) - { - int r,g,b; - - r = (gx_subpaletteram32[offset] >>16) & 0xff; - g = (gx_subpaletteram32[offset] >> 8) & 0xff; - b = (gx_subpaletteram32[offset] >> 0) & 0xff; - - palette_set_color(screen->machine(),offset,MAKE_RGB(r,g,b)); - } - } - bitmap = dualscreen_right_tempbitmap; - // draw - } - } - } - /* if any banks are different from last render, we need to flush the planes */ for (dirty = 0, i = 0; i < 8; i++) @@ -2536,7 +2444,7 @@ SCREEN_UPDATE(konamigx) if (gx_specialrozenable==3) { - konamigx_mixer(screen->machine(), bitmap, cliprect, gx_psac_tilemap, GXSUB_8BPP,0,0, 0, 0, gx_rushingheroes_hack); + konamigx_mixer(screen.machine(), bitmap, cliprect, gx_psac_tilemap, GXSUB_8BPP,0,0, 0, 0, gx_rushingheroes_hack); } // hack, draw the roz tilemap if W is held // todo: fix so that it works with the mixer without crashing(!) @@ -2553,11 +2461,11 @@ SCREEN_UPDATE(konamigx) else K053936_0_zoom_draw(type3_roz_temp_bitmap, &temprect,gx_psac_tilemap, 0,0,0); // soccerss playfield - konamigx_mixer(screen->machine(), bitmap, cliprect, 0, 0, 0, 0, 0, type3_roz_temp_bitmap, gx_rushingheroes_hack); + konamigx_mixer(screen.machine(), bitmap, cliprect, 0, 0, 0, 0, 0, type3_roz_temp_bitmap, gx_rushingheroes_hack); } else { - konamigx_mixer(screen->machine(), bitmap, cliprect, 0, 0, 0, 0, 0, 0, gx_rushingheroes_hack); + konamigx_mixer(screen.machine(), bitmap, cliprect, 0, 0, 0, 0, 0, 0, gx_rushingheroes_hack); } @@ -2565,14 +2473,14 @@ SCREEN_UPDATE(konamigx) /* Hack! draw type-1 roz layer here for testing purposes only */ if (gx_specialrozenable == 1) { - const pen_t *paldata = screen->machine().pens; + const pen_t *paldata = screen.machine().pens; - if ( screen->machine().input().code_pressed(KEYCODE_W) ) + if ( screen.machine().input().code_pressed(KEYCODE_W) ) { int y,x; // make it flicker, to compare positioning - //if (screen->frame_number() & 1) + //if (screen.frame_number() & 1) { for (y=0;y<256;y++) @@ -2597,19 +2505,96 @@ SCREEN_UPDATE(konamigx) } - if (konamigx_has_dual_screen) - { - device_t *left_screen = screen->machine().device("screen"); - device_t *right_screen = screen->machine().device("screen2"); + return 0; +} - if (screen==left_screen) +SCREEN_UPDATE(konamigx_left) +{ + /* the video gets demuxed by a board which plugs into the jamma connector */ + konamigx_current_frame^=1; + + if (konamigx_current_frame==1) + { + int offset=0; + + if (konamigx_palformat==1) { - copybitmap(realbitmap, dualscreen_left_tempbitmap, 0, 0, 0, 0, cliprect); + for (offset=0;offset<0x4000/4;offset++) + { + UINT32 coldat = screen.machine().generic.paletteram.u32[offset]; + + set_color_555(screen.machine(), offset*2, 0, 5, 10,coldat >> 16); + set_color_555(screen.machine(), offset*2+1, 0, 5, 10,coldat & 0xffff); + } } - else if (screen==right_screen) + else { - copybitmap(realbitmap, dualscreen_right_tempbitmap, 0, 0, 0, 0, cliprect); + for (offset=0;offset<0x8000/4;offset++) + { + int r,g,b; + + r = (screen.machine().generic.paletteram.u32[offset] >>16) & 0xff; + g = (screen.machine().generic.paletteram.u32[offset] >> 8) & 0xff; + b = (screen.machine().generic.paletteram.u32[offset] >> 0) & 0xff; + + palette_set_color(screen.machine(),offset,MAKE_RGB(r,g,b)); + } } + + bitmap_t* realbitmap = bitmap; + bitmap = dualscreen_left_tempbitmap; + SCREEN_UPDATE_CALL(konamigx); + + copybitmap(realbitmap, dualscreen_left_tempbitmap, 0, 0, 0, 0, cliprect); + } + else + { + copybitmap(bitmap, dualscreen_left_tempbitmap, 0, 0, 0, 0, cliprect); + } + + return 0; +} + +SCREEN_UPDATE(konamigx_right) +{ + if (konamigx_current_frame==1) + { + copybitmap(bitmap, dualscreen_right_tempbitmap, 0, 0, 0, 0, cliprect); + } + else + { + + int offset=0; + + if (konamigx_palformat==1) + { + for (offset=0;offset<0x4000/4;offset++) + { + UINT32 coldat = gx_subpaletteram32[offset]; + + set_color_555(screen.machine(), offset*2, 0, 5, 10,coldat >> 16); + set_color_555(screen.machine(), offset*2+1, 0, 5, 10,coldat & 0xffff); + } + } + else + { + for (offset=0;offset<0x8000/4;offset++) + { + int r,g,b; + + r = (gx_subpaletteram32[offset] >>16) & 0xff; + g = (gx_subpaletteram32[offset] >> 8) & 0xff; + b = (gx_subpaletteram32[offset] >> 0) & 0xff; + + palette_set_color(screen.machine(),offset,MAKE_RGB(r,g,b)); + } + } + + bitmap_t* realbitmap = bitmap; + bitmap = dualscreen_right_tempbitmap; + SCREEN_UPDATE_CALL(konamigx); + + copybitmap(realbitmap, dualscreen_right_tempbitmap, 0, 0, 0, 0, cliprect); } return 0; diff --git a/src/mame/video/kopunch.c b/src/mame/video/kopunch.c index 14a60b0b5e6..18a54bd2d7e 100644 --- a/src/mame/video/kopunch.c +++ b/src/mame/video/kopunch.c @@ -99,7 +99,7 @@ VIDEO_START( kopunch ) SCREEN_UPDATE( kopunch ) { - kopunch_state *state = screen->machine().driver_data(); + kopunch_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); diff --git a/src/mame/video/ksayakyu.c b/src/mame/video/ksayakyu.c index 302d8aa1180..3b6f89bd6b8 100644 --- a/src/mame/video/ksayakyu.c +++ b/src/mame/video/ksayakyu.c @@ -126,7 +126,7 @@ VIDEO_START(ksayakyu) SCREEN_UPDATE(ksayakyu) { - ksayakyu_state *state = screen->machine().driver_data(); + ksayakyu_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, 0); @@ -134,6 +134,6 @@ SCREEN_UPDATE(ksayakyu) tilemap_draw(bitmap, cliprect,state->m_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_textmap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/kyugo.c b/src/mame/video/kyugo.c index 8e8d87cc982..aa10aee856d 100644 --- a/src/mame/video/kyugo.c +++ b/src/mame/video/kyugo.c @@ -222,7 +222,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( kyugo ) { - kyugo_state *state = screen->machine().driver_data(); + kyugo_state *state = screen.machine().driver_data(); if (state->m_flipscreen) tilemap_set_scrollx(state->m_bg_tilemap, 0, -(state->m_scroll_x_lo + (state->m_scroll_x_hi * 256))); @@ -232,7 +232,7 @@ SCREEN_UPDATE( kyugo ) tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_scroll_y); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/labyrunr.c b/src/mame/video/labyrunr.c index 452412b4b3e..e100704fbee 100644 --- a/src/mame/video/labyrunr.c +++ b/src/mame/video/labyrunr.c @@ -182,14 +182,14 @@ WRITE8_HANDLER( labyrunr_vram2_w ) SCREEN_UPDATE( labyrunr ) { - labyrunr_state *state = screen->machine().driver_data(); + labyrunr_state *state = screen.machine().driver_data(); UINT8 ctrl_0 = k007121_ctrlram_r(state->m_k007121, 0); rectangle finalclip0, finalclip1; - set_pens(screen->machine()); + set_pens(screen.machine()); - bitmap_fill(screen->machine().priority_bitmap, cliprect,0); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(screen.machine().priority_bitmap, cliprect,0); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); if (~k007121_ctrlram_r(state->m_k007121, 3) & 0x20) { @@ -214,7 +214,7 @@ SCREEN_UPDATE( labyrunr ) } tilemap_draw(bitmap, &finalclip0, state->m_layer0, TILEMAP_DRAW_OPAQUE, 0); - k007121_sprites_draw(state->m_k007121, bitmap, cliprect, screen->machine().gfx[0], screen->machine().colortable, state->m_spriteram,(k007121_ctrlram_r(state->m_k007121, 6) & 0x30) * 2, 40,0,(k007121_ctrlram_r(state->m_k007121, 3) & 0x40) >> 5); + k007121_sprites_draw(state->m_k007121, bitmap, cliprect, screen.machine().gfx[0], screen.machine().colortable, state->m_spriteram,(k007121_ctrlram_r(state->m_k007121, 6) & 0x30) * 2, 40,0,(k007121_ctrlram_r(state->m_k007121, 3) & 0x40) >> 5); /* we ignore the transparency because layer1 is drawn only at the top of the screen also covering sprites */ tilemap_draw(bitmap, &finalclip1, state->m_layer1, TILEMAP_DRAW_OPAQUE, 0); } @@ -284,7 +284,7 @@ SCREEN_UPDATE( labyrunr ) if(use_clip3[1]) tilemap_draw(bitmap, &finalclip3, state->m_layer1, 0, 1); - k007121_sprites_draw(state->m_k007121, bitmap, cliprect, screen->machine().gfx[0], screen->machine().colortable, state->m_spriteram, (k007121_ctrlram_r(state->m_k007121, 6) & 0x30) * 2,40,0,(k007121_ctrlram_r(state->m_k007121, 3) & 0x40) >> 5); + k007121_sprites_draw(state->m_k007121, bitmap, cliprect, screen.machine().gfx[0], screen.machine().colortable, state->m_spriteram, (k007121_ctrlram_r(state->m_k007121, 6) & 0x30) * 2,40,0,(k007121_ctrlram_r(state->m_k007121, 3) & 0x40) >> 5); } return 0; } diff --git a/src/mame/video/ladybug.c b/src/mame/video/ladybug.c index 6517b85fb4c..086bdc36731 100644 --- a/src/mame/video/ladybug.c +++ b/src/mame/video/ladybug.c @@ -284,7 +284,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( ladybug ) { - ladybug_state *state = screen->machine().driver_data(); + ladybug_state *state = screen.machine().driver_data(); int offs; // clear the bg bitmap @@ -295,25 +295,25 @@ SCREEN_UPDATE( ladybug ) int sx = offs % 4; int sy = offs / 4; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) tilemap_set_scrollx(state->m_bg_tilemap, offs, -state->m_videoram[32 * sx + sy]); else tilemap_set_scrollx(state->m_bg_tilemap, offs, state->m_videoram[32 * sx + sy]); } tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_EOF( sraider ) /* update starfield position */ { - redclash_update_stars_state(machine); + redclash_update_stars_state(screen.machine()); } SCREEN_UPDATE( sraider ) { - ladybug_state *state = screen->machine().driver_data(); + ladybug_state *state = screen.machine().driver_data(); // this part is boilerplate from ladybug, not sure if hardware does this, // since it's not used @@ -326,7 +326,7 @@ SCREEN_UPDATE( sraider ) int sx = offs % 4; int sy = offs / 4; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) tilemap_set_scrollx(state->m_bg_tilemap, offs, -state->m_videoram[32 * sx + sy]); else tilemap_set_scrollx(state->m_bg_tilemap, offs, state->m_videoram[32 * sx + sy]); @@ -336,16 +336,16 @@ SCREEN_UPDATE( sraider ) bitmap_fill(bitmap, cliprect, 0); // draw the stars - if (flip_screen_get(screen->machine())) - redclash_draw_stars(screen->machine(), bitmap, cliprect, 0x60, 1, 0x27, 0xff); + if (flip_screen_get(screen.machine())) + redclash_draw_stars(screen.machine(), bitmap, cliprect, 0x60, 1, 0x27, 0xff); else - redclash_draw_stars(screen->machine(), bitmap, cliprect, 0x60, 1, 0x00, 0xd8); + redclash_draw_stars(screen.machine(), bitmap, cliprect, 0x60, 1, 0x00, 0xd8); // draw the gridlines - colortable_palette_set_color(screen->machine().colortable, 0x40, MAKE_RGB(state->m_grid_color & 0x40 ? 0xff : 0, + colortable_palette_set_color(screen.machine().colortable, 0x40, MAKE_RGB(state->m_grid_color & 0x40 ? 0xff : 0, state->m_grid_color & 0x20 ? 0xff : 0, state->m_grid_color & 0x10 ? 0xff : 0)); - tilemap_draw(bitmap, cliprect, state->m_grid_tilemap, 0, flip_screen_get(screen->machine())); + tilemap_draw(bitmap, cliprect, state->m_grid_tilemap, 0, flip_screen_get(screen.machine())); for (i = 0; i < 0x100; i++) { @@ -354,7 +354,7 @@ SCREEN_UPDATE( sraider ) UINT8 x = i; int height = cliprect->max_y - cliprect->min_y + 1; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) x = ~x; plot_box(bitmap, x, cliprect->min_y, 1, height, 0x81); @@ -362,10 +362,10 @@ SCREEN_UPDATE( sraider ) } // now the chars - tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, flip_screen_get(screen->machine())); + tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, flip_screen_get(screen.machine())); // now the sprites - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/ladyfrog.c b/src/mame/video/ladyfrog.c index ffa0d7390ef..63f5a185ce7 100644 --- a/src/mame/video/ladyfrog.c +++ b/src/mame/video/ladyfrog.c @@ -175,9 +175,9 @@ VIDEO_START( toucheme ) SCREEN_UPDATE( ladyfrog ) { - ladyfrog_state *state = screen->machine().driver_data(); + ladyfrog_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/lasso.c b/src/mame/video/lasso.c index 18ece201569..5db71c95573 100644 --- a/src/mame/video/lasso.c +++ b/src/mame/video/lasso.c @@ -369,25 +369,25 @@ static void draw_lasso( running_machine &machine, bitmap_t *bitmap, const rectan SCREEN_UPDATE( lasso ) { - lasso_state *state = screen->machine().driver_data(); - palette_set_color(screen->machine(), 0, get_color(*state->m_back_color)); + lasso_state *state = screen.machine().driver_data(); + palette_set_color(screen.machine(), 0, get_color(*state->m_back_color)); bitmap_fill(bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_lasso(screen->machine(), bitmap, cliprect); - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_lasso(screen.machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect, 0); return 0; } SCREEN_UPDATE( chameleo ) { - lasso_state *state = screen->machine().driver_data(); - palette_set_color(screen->machine(), 0, get_color(*state->m_back_color)); + lasso_state *state = screen.machine().driver_data(); + palette_set_color(screen.machine(), 0, get_color(*state->m_back_color)); bitmap_fill(bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0); return 0; } @@ -395,9 +395,9 @@ SCREEN_UPDATE( chameleo ) SCREEN_UPDATE( wwjgtin ) { - lasso_state *state = screen->machine().driver_data(); - colortable_palette_set_color(screen->machine().colortable, 0, get_color(*state->m_back_color)); - wwjgtin_set_last_four_colors(screen->machine(), screen->machine().colortable); + lasso_state *state = screen.machine().driver_data(); + colortable_palette_set_color(screen.machine().colortable, 0, get_color(*state->m_back_color)); + wwjgtin_set_last_four_colors(screen.machine(), screen.machine().colortable); tilemap_set_scrollx(state->m_track_tilemap, 0, state->m_track_scroll[0] + state->m_track_scroll[1] * 256); tilemap_set_scrolly(state->m_track_tilemap, 0, state->m_track_scroll[2] + state->m_track_scroll[3] * 256); @@ -405,9 +405,9 @@ SCREEN_UPDATE( wwjgtin ) if (state->m_track_enable) tilemap_draw(bitmap, cliprect, state->m_track_tilemap, 0, 0); else - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); - draw_sprites(screen->machine(), bitmap, cliprect, 1); // reverse order + draw_sprites(screen.machine(), bitmap, cliprect, 1); // reverse order tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; diff --git a/src/mame/video/lastduel.c b/src/mame/video/lastduel.c index 75a90cad9a7..e281e513c40 100644 --- a/src/mame/video/lastduel.c +++ b/src/mame/video/lastduel.c @@ -271,36 +271,36 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( lastduel ) { - lastduel_state *state = screen->machine().driver_data(); + lastduel_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, TILEMAP_DRAW_LAYER1, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, TILEMAP_DRAW_LAYER0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); return 0; } SCREEN_UPDATE( madgear ) { - lastduel_state *state = screen->machine().driver_data(); + lastduel_state *state = screen.machine().driver_data(); if (state->m_tilemap_priority) { tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, TILEMAP_DRAW_LAYER1 | TILEMAP_DRAW_OPAQUE, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, TILEMAP_DRAW_LAYER0, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); } else { tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_OPAQUE, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, TILEMAP_DRAW_LAYER1, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, TILEMAP_DRAW_LAYER0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); } tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); return 0; @@ -308,7 +308,7 @@ SCREEN_UPDATE( madgear ) SCREEN_EOF( lastduel ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); /* Spriteram is always 1 frame ahead, suggesting buffering. I can't find a register to control this so I assume it happens automatically diff --git a/src/mame/video/lazercmd.c b/src/mame/video/lazercmd.c index ef837b45735..74f4da50ef4 100644 --- a/src/mame/video/lazercmd.c +++ b/src/mame/video/lazercmd.c @@ -52,10 +52,10 @@ static void plot_pattern( running_machine &machine, bitmap_t *bitmap, int x, int SCREEN_UPDATE( lazercmd ) { - lazercmd_state *state = screen->machine().driver_data(); + lazercmd_state *state = screen.machine().driver_data(); int i, x, y; - int video_inverted = input_port_read(screen->machine(), "DSW") & 0x20; + int video_inverted = input_port_read(screen.machine(), "DSW") & 0x20; /* The first row of characters are invisible */ for (i = 0; i < (VERT_RES - 1) * HORZ_RES; i++) @@ -68,7 +68,7 @@ SCREEN_UPDATE( lazercmd ) sx *= HORZ_CHR; sy *= VERT_CHR; - drawgfx_opaque(bitmap, cliprect,screen->machine().gfx[0], + drawgfx_opaque(bitmap, cliprect,screen.machine().gfx[0], state->m_videoram[i], video_inverted ? 1 : 0, 0,0, sx,sy); @@ -76,7 +76,7 @@ SCREEN_UPDATE( lazercmd ) x = state->m_marker_x - 1; /* normal video lags marker by 1 pixel */ y = vert_scale(state->m_marker_y) - VERT_CHR; /* first line used as scratch pad */ - plot_pattern(screen->machine(), bitmap, x, y); + plot_pattern(screen.machine(), bitmap, x, y); return 0; } diff --git a/src/mame/video/legionna.c b/src/mame/video/legionna.c index 7580fb7917f..3675524ad49 100644 --- a/src/mame/video/legionna.c +++ b/src/mame/video/legionna.c @@ -417,7 +417,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( legionna ) { - legionna_state *state = screen->machine().driver_data(); + legionna_state *state = screen.machine().driver_data(); /* Setup the tilemaps */ tilemap_set_scrollx( state->m_background_layer, 0, state->m_scrollram16[0] ); tilemap_set_scrolly( state->m_background_layer, 0, state->m_scrollram16[1] ); @@ -428,8 +428,8 @@ SCREEN_UPDATE( legionna ) tilemap_set_scrollx( state->m_text_layer, 0, 0/*state->m_scrollram16[6]*/ ); tilemap_set_scrolly( state->m_text_layer, 0, 0/*state->m_scrollram16[7]*/ ); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); /* wrong color? */ + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); /* wrong color? */ /* state->m_layer_disable is a guess based on 'stage 1' screen in heatbrl */ @@ -438,7 +438,7 @@ SCREEN_UPDATE( legionna ) if (!(state->m_layer_disable&0x0002)) tilemap_draw(bitmap,cliprect,state->m_background_layer,0, 1); if (!(state->m_layer_disable&0x0001)) tilemap_draw(bitmap,cliprect,state->m_text_layer,0, 2); - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); return 0; @@ -447,7 +447,7 @@ SCREEN_UPDATE( legionna ) SCREEN_UPDATE( godzilla ) { - legionna_state *state = screen->machine().driver_data(); + legionna_state *state = screen.machine().driver_data(); // tilemap_set_scrollx( state->m_text_layer, 0, 0 ); // tilemap_set_scrolly( state->m_text_layer, 0, 112 ); /* Setup the tilemaps */ @@ -462,21 +462,21 @@ SCREEN_UPDATE( godzilla ) bitmap_fill(bitmap,cliprect,0x0200); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); if (!(state->m_layer_disable&0x0001)) tilemap_draw(bitmap,cliprect,state->m_background_layer,0,0); if (!(state->m_layer_disable&0x0002)) tilemap_draw(bitmap,cliprect,state->m_midground_layer,0,0); if (!(state->m_layer_disable&0x0004)) tilemap_draw(bitmap,cliprect,state->m_foreground_layer,0,1); if (!(state->m_layer_disable&0x0008)) tilemap_draw(bitmap,cliprect,state->m_text_layer,0,2); - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); return 0; } SCREEN_UPDATE( grainbow ) { - legionna_state *state = screen->machine().driver_data(); + legionna_state *state = screen.machine().driver_data(); /* Setup the tilemaps */ tilemap_set_scrollx( state->m_background_layer, 0, state->m_scrollram16[0] ); tilemap_set_scrolly( state->m_background_layer, 0, state->m_scrollram16[1] ); @@ -487,8 +487,8 @@ SCREEN_UPDATE( grainbow ) tilemap_set_scrollx( state->m_text_layer, 0, 0/*state->m_scrollram16[6]*/ ); tilemap_set_scrolly( state->m_text_layer, 0, 0/*state->m_scrollram16[7]*/ ); - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); if(!(state->m_layer_disable & 1)) tilemap_draw(bitmap,cliprect,state->m_background_layer,0,1); @@ -502,7 +502,7 @@ SCREEN_UPDATE( grainbow ) if(!(state->m_layer_disable & 8)) tilemap_draw(bitmap,cliprect,state->m_text_layer,0,8); - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); return 0; } diff --git a/src/mame/video/leland.c b/src/mame/video/leland.c index 880524fa85f..1309f87b17a 100644 --- a/src/mame/video/leland.c +++ b/src/mame/video/leland.c @@ -390,12 +390,12 @@ READ8_HANDLER( ataxx_svram_port_r ) static SCREEN_UPDATE( leland ) { - leland_state *state = screen->machine().driver_data(); + leland_state *state = screen.machine().driver_data(); int y; - const UINT8 *bg_prom = screen->machine().region("user1")->base(); - const UINT8 *bg_gfx = screen->machine().region("gfx1")->base(); - offs_t bg_gfx_bank_page_size = screen->machine().region("gfx1")->bytes() / 3; + const UINT8 *bg_prom = screen.machine().region("user1")->base(); + const UINT8 *bg_gfx = screen.machine().region("gfx1")->base(); + offs_t bg_gfx_bank_page_size = screen.machine().region("gfx1")->bytes() / 3; offs_t char_bank = (((state->m_gfxbank >> 4) & 0x03) * 0x2000) & (bg_gfx_bank_page_size - 1); offs_t prom_bank = ((state->m_gfxbank >> 3) & 0x01) * 0x2000; @@ -459,11 +459,11 @@ static SCREEN_UPDATE( leland ) static SCREEN_UPDATE( ataxx ) { - leland_state *state = screen->machine().driver_data(); + leland_state *state = screen.machine().driver_data(); int y; - const UINT8 *bg_gfx = screen->machine().region("gfx1")->base(); - offs_t bg_gfx_bank_page_size = screen->machine().region("gfx1")->bytes() / 6; + const UINT8 *bg_gfx = screen.machine().region("gfx1")->base(); + offs_t bg_gfx_bank_page_size = screen.machine().region("gfx1")->bytes() / 6; offs_t bg_gfx_offs_mask = bg_gfx_bank_page_size - 1; /* for each scanline in the visible region */ diff --git a/src/mame/video/lemmings.c b/src/mame/video/lemmings.c index a4a15c6473b..d95e94fd991 100644 --- a/src/mame/video/lemmings.c +++ b/src/mame/video/lemmings.c @@ -107,10 +107,10 @@ VIDEO_START( lemmings ) SCREEN_EOF( lemmings ) { - lemmings_state *state = machine.driver_data(); + lemmings_state *state = screen.machine().driver_data(); - memcpy(state->m_sprite_triple_buffer_0, machine.generic.buffered_spriteram.u16, 0x800); - memcpy(state->m_sprite_triple_buffer_1, machine.generic.buffered_spriteram2.u16, 0x800); + memcpy(state->m_sprite_triple_buffer_0, screen.machine().generic.buffered_spriteram.u16, 0x800); + memcpy(state->m_sprite_triple_buffer_1, screen.machine().generic.buffered_spriteram2.u16, 0x800); } /******************************************************************************/ @@ -168,7 +168,7 @@ WRITE16_HANDLER( lemmings_vram_w ) SCREEN_UPDATE( lemmings ) { - lemmings_state *state = screen->machine().driver_data(); + lemmings_state *state = screen.machine().driver_data(); int x1 = -state->m_control_data[0]; int x0 = -state->m_control_data[2]; int y = 0; @@ -176,8 +176,8 @@ SCREEN_UPDATE( lemmings ) rect.max_y = cliprect->max_y; rect.min_y = cliprect->min_y; - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); - draw_sprites(screen->machine(), bitmap, cliprect, state->m_sprite_triple_buffer_1, 1, 0x0000); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_sprite_triple_buffer_1, 1, 0x0000); /* Pixel layer can be windowed in hardware (two player mode) */ if ((state->m_control_data[6] & 2) == 0) @@ -191,9 +191,9 @@ SCREEN_UPDATE( lemmings ) rect.min_x = 160; copyscrollbitmap_trans(bitmap, state->m_bitmap0, 1, &x1, 1, &y, &rect, 0x100); } - draw_sprites(screen->machine(), bitmap, cliprect, state->m_sprite_triple_buffer_0, 0, 0x0000); - draw_sprites(screen->machine(), bitmap, cliprect, state->m_sprite_triple_buffer_1, 1, 0x2000); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_sprite_triple_buffer_0, 0, 0x0000); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_sprite_triple_buffer_1, 1, 0x2000); tilemap_draw(bitmap, cliprect, state->m_vram_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, state->m_sprite_triple_buffer_0, 0, 0x2000); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_sprite_triple_buffer_0, 0, 0x2000); return 0; } diff --git a/src/mame/video/lethal.c b/src/mame/video/lethal.c index 49f2e45d6e2..2bccc5509a7 100644 --- a/src/mame/video/lethal.c +++ b/src/mame/video/lethal.c @@ -104,10 +104,10 @@ WRITE8_HANDLER(lethalen_palette_control) SCREEN_UPDATE(lethalen) { - lethal_state *state = screen->machine().driver_data(); + lethal_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, 7168); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, 3, K056832_DRAW_FLAG_MIRROR, 1); k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, 2, K056832_DRAW_FLAG_MIRROR, 2); diff --git a/src/mame/video/liberate.c b/src/mame/video/liberate.c index 574b85f214c..53fec9319e1 100644 --- a/src/mame/video/liberate.c +++ b/src/mame/video/liberate.c @@ -514,7 +514,7 @@ static void prosoccr_draw_sprites( running_machine &machine, bitmap_t *bitmap, c SCREEN_UPDATE( prosoccr ) { - liberate_state *state = screen->machine().driver_data(); + liberate_state *state = screen.machine().driver_data(); tilemap_set_scrolly(state->m_back_tilemap, 0, state->m_io_ram[1]); tilemap_set_scrollx(state->m_back_tilemap, 0, -state->m_io_ram[0]); @@ -524,14 +524,14 @@ SCREEN_UPDATE( prosoccr ) tilemap_draw(bitmap, cliprect, state->m_back_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fix_tilemap, 0, 0); - prosoccr_draw_sprites(screen->machine(), bitmap, cliprect); + prosoccr_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( prosport ) { - liberate_state *state = screen->machine().driver_data(); + liberate_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; UINT8 *colorram = state->m_colorram; int mx, my, tile, offs, gfx_region; @@ -564,18 +564,18 @@ SCREEN_UPDATE( prosport ) my = (offs) % 32; mx = (offs) / 32; - drawgfx_transpen(bitmap, cliprect,screen->machine().gfx[gfx_region], + drawgfx_transpen(bitmap, cliprect,screen.machine().gfx[gfx_region], tile, 1, 0, 0, 248 - 8 * mx, 8 * my, 0); } - prosport_draw_sprites(screen->machine(), bitmap, cliprect); + prosport_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( boomrang ) { - liberate_state *state = screen->machine().driver_data(); + liberate_state *state = screen.machine().driver_data(); tilemap_set_scrolly(state->m_back_tilemap, 0, state->m_io_ram[1]); tilemap_set_scrollx(state->m_back_tilemap, 0, -state->m_io_ram[0]); @@ -584,18 +584,18 @@ SCREEN_UPDATE( boomrang ) else tilemap_draw(bitmap, cliprect, state->m_back_tilemap, TILEMAP_DRAW_LAYER1, 0); - boomrang_draw_sprites(screen->machine(),bitmap,cliprect,8); + boomrang_draw_sprites(screen.machine(),bitmap,cliprect,8); if (!state->m_background_disable) tilemap_draw(bitmap, cliprect, state->m_back_tilemap, TILEMAP_DRAW_LAYER0, 0); - boomrang_draw_sprites(screen->machine(), bitmap, cliprect, 0); + boomrang_draw_sprites(screen.machine(), bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_fix_tilemap, 0, 0); return 0; } SCREEN_UPDATE( liberate ) { - liberate_state *state = screen->machine().driver_data(); + liberate_state *state = screen.machine().driver_data(); tilemap_set_scrolly(state->m_back_tilemap, 0, state->m_io_ram[1]); tilemap_set_scrollx(state->m_back_tilemap, 0, -state->m_io_ram[0]); @@ -604,7 +604,7 @@ SCREEN_UPDATE( liberate ) else tilemap_draw(bitmap, cliprect, state->m_back_tilemap, 0, 0); - liberate_draw_sprites(screen->machine(), bitmap, cliprect); + liberate_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fix_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/lkage.c b/src/mame/video/lkage.c index 3c456db511c..7ebb8a10a23 100644 --- a/src/mame/video/lkage.c +++ b/src/mame/video/lkage.c @@ -174,11 +174,11 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( lkage ) { - lkage_state *state = screen->machine().driver_data(); + lkage_state *state = screen.machine().driver_data(); int bank; - flip_screen_x_set(screen->machine(), ~state->m_vreg[2] & 0x01); - flip_screen_y_set(screen->machine(), ~state->m_vreg[2] & 0x02); + flip_screen_x_set(screen.machine(), ~state->m_vreg[2] & 0x01); + flip_screen_y_set(screen.machine(), ~state->m_vreg[2] & 0x02); bank = state->m_vreg[1] & 0x08; @@ -215,13 +215,13 @@ SCREEN_UPDATE( lkage ) tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_scroll[4]); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_scroll[5]); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); if ((state->m_vreg[2] & 0xf0) == 0xf0) { tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, (state->m_vreg[1] & 2) ? 2 : 4); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 4); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); } else { diff --git a/src/mame/video/lockon.c b/src/mame/video/lockon.c index b9e17f81341..bf73694854e 100644 --- a/src/mame/video/lockon.c +++ b/src/mame/video/lockon.c @@ -931,30 +931,30 @@ VIDEO_START( lockon ) SCREEN_UPDATE( lockon ) { - lockon_state *state = screen->machine().driver_data(); + lockon_state *state = screen.machine().driver_data(); /* If screen output is disabled, fill with black */ if (!BIT(state->m_ctrl_reg, 7)) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } /* Scan out the frame buffer in rotated order */ - rotate_draw(screen->machine(), bitmap, cliprect); + rotate_draw(screen.machine(), bitmap, cliprect); /* Draw the character tilemap */ tilemap_draw(bitmap, cliprect, state->m_tilemap, 0, 0); /* Draw the HUD */ - hud_draw(screen->machine(), bitmap, cliprect); + hud_draw(screen.machine(), bitmap, cliprect); return 0; } SCREEN_EOF( lockon ) { - lockon_state *state = machine.driver_data(); + lockon_state *state = screen.machine().driver_data(); /* Swap the frame buffers */ bitmap_t *tmp = state->m_front_buffer; @@ -962,7 +962,7 @@ SCREEN_EOF( lockon ) state->m_back_buffer = tmp; /* Draw the frame buffer layers */ - scene_draw(machine); - ground_draw(machine); - objects_draw(machine); + scene_draw(screen.machine()); + ground_draw(screen.machine()); + objects_draw(screen.machine()); } diff --git a/src/mame/video/lordgun.c b/src/mame/video/lordgun.c index d07c541c20b..8f2c5eb2ae6 100644 --- a/src/mame/video/lordgun.c +++ b/src/mame/video/lordgun.c @@ -327,26 +327,26 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( lordgun ) { - lordgun_state *state = screen->machine().driver_data(); + lordgun_state *state = screen.machine().driver_data(); int layers_ctrl = -1; #ifdef MAME_DEBUG - if (screen->machine().input().code_pressed(KEYCODE_Z)) + if (screen.machine().input().code_pressed(KEYCODE_Z)) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= 2; - if (screen->machine().input().code_pressed(KEYCODE_E)) msk |= 4; - if (screen->machine().input().code_pressed(KEYCODE_R)) msk |= 8; - if (screen->machine().input().code_pressed(KEYCODE_A)) msk |= 16; + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (screen.machine().input().code_pressed(KEYCODE_E)) msk |= 4; + if (screen.machine().input().code_pressed(KEYCODE_R)) msk |= 8; + if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= 16; if (msk != 0) layers_ctrl &= msk; } #endif if (state->m_whitescreen) { - bitmap_fill(bitmap, cliprect, get_white_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_white_pen(screen.machine())); return 0; } @@ -382,7 +382,7 @@ SCREEN_UPDATE( lordgun ) if (layers_ctrl & 2) tilemap_draw(state->m_bitmaps[1], cliprect, state->m_tilemap[1], 0, 0); if (layers_ctrl & 4) tilemap_draw(state->m_bitmaps[2], cliprect, state->m_tilemap[2], 0, 0); if (layers_ctrl & 8) tilemap_draw(state->m_bitmaps[3], cliprect, state->m_tilemap[3], 0, 0); - if (layers_ctrl & 16) draw_sprites(screen->machine(), state->m_bitmaps[4], cliprect); + if (layers_ctrl & 16) draw_sprites(screen.machine(), state->m_bitmaps[4], cliprect); // copy to screen bitmap diff --git a/src/mame/video/lsasquad.c b/src/mame/video/lsasquad.c index 71be7c9927d..a3fa24ba677 100644 --- a/src/mame/video/lsasquad.c +++ b/src/mame/video/lsasquad.c @@ -200,13 +200,13 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( lsasquad ) { - lsasquad_state *state = screen->machine().driver_data(); + lsasquad_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, 511); - draw_layer(screen->machine(), bitmap, cliprect, state->m_scrollram + 0x000); - draw_layer(screen->machine(), bitmap, cliprect, state->m_scrollram + 0x080); - draw_sprites(screen->machine(), bitmap, cliprect); - draw_layer(screen->machine(), bitmap, cliprect, state->m_scrollram + 0x100); + draw_layer(screen.machine(), bitmap, cliprect, state->m_scrollram + 0x000); + draw_layer(screen.machine(), bitmap, cliprect, state->m_scrollram + 0x080); + draw_sprites(screen.machine(), bitmap, cliprect); + draw_layer(screen.machine(), bitmap, cliprect, state->m_scrollram + 0x100); return 0; } @@ -214,8 +214,8 @@ SCREEN_UPDATE( lsasquad ) SCREEN_UPDATE( daikaiju ) { bitmap_fill(bitmap, cliprect, 511); - drawbg(screen->machine(), bitmap, cliprect, 0); // bottom - draw_sprites(screen->machine(), bitmap, cliprect); - drawbg(screen->machine(), bitmap, cliprect, 1); // top = pallete $d ? + drawbg(screen.machine(), bitmap, cliprect, 0); // bottom + draw_sprites(screen.machine(), bitmap, cliprect); + drawbg(screen.machine(), bitmap, cliprect, 1); // top = pallete $d ? return 0; } diff --git a/src/mame/video/lucky74.c b/src/mame/video/lucky74.c index a0792b4417f..914ca2e571e 100644 --- a/src/mame/video/lucky74.c +++ b/src/mame/video/lucky74.c @@ -243,7 +243,7 @@ VIDEO_START( lucky74 ) SCREEN_UPDATE( lucky74 ) { - lucky74_state *state = screen->machine().driver_data(); + lucky74_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; diff --git a/src/mame/video/lvcards.c b/src/mame/video/lvcards.c index 3d94805a75c..1a9f51ef1fa 100644 --- a/src/mame/video/lvcards.c +++ b/src/mame/video/lvcards.c @@ -114,7 +114,7 @@ VIDEO_START( lvcards ) SCREEN_UPDATE( lvcards ) { - lvcards_state *state = screen->machine().driver_data(); + lvcards_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/lwings.c b/src/mame/video/lwings.c index 8bc0b1067d1..6e1135b8e6d 100644 --- a/src/mame/video/lwings.c +++ b/src/mame/video/lwings.c @@ -271,21 +271,21 @@ static void trojan_draw_sprites( running_machine &machine, bitmap_t *bitmap, con SCREEN_UPDATE( lwings ) { - lwings_state *state = screen->machine().driver_data(); + lwings_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); - lwings_draw_sprites(screen->machine(), bitmap, cliprect); + lwings_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } SCREEN_UPDATE( trojan ) { - lwings_state *state = screen->machine().driver_data(); + lwings_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, TILEMAP_DRAW_LAYER1, 0); - trojan_draw_sprites(screen->machine(), bitmap, cliprect); + trojan_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, TILEMAP_DRAW_LAYER0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; @@ -293,7 +293,7 @@ SCREEN_UPDATE( trojan ) SCREEN_EOF( lwings ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram_w(space, 0, 0); } diff --git a/src/mame/video/m10.c b/src/mame/video/m10.c index 4c34665bce8..62fe9ae8941 100644 --- a/src/mame/video/m10.c +++ b/src/mame/video/m10.c @@ -139,7 +139,7 @@ VIDEO_START( m15 ) SCREEN_UPDATE( m10 ) { - m10_state *state = screen->machine().driver_data(); + m10_state *state = screen.machine().driver_data(); int offs; static const int color[4]= { 3, 3, 5, 5 }; static const int xpos[4] = { 4*8, 26*8, 7*8, 6*8}; @@ -158,7 +158,7 @@ SCREEN_UPDATE( m10 ) int y; for (y = IREMM10_VBEND; y < IREMM10_VBSTART; y++) - plot_pixel_m10(screen->machine(), bitmap, 16, y, 1); + plot_pixel_m10(screen.machine(), bitmap, 16, y, 1); } for (offs = state->m_videoram_size - 1; offs >= 0; offs--) @@ -179,7 +179,7 @@ SCREEN_UPDATE( m10 ) SCREEN_UPDATE( m15 ) { - m10_state *state = screen->machine().driver_data(); + m10_state *state = screen.machine().driver_data(); int offs; for (offs = state->m_videoram_size - 1; offs >= 0; offs--) diff --git a/src/mame/video/m107.c b/src/mame/video/m107.c index 96d417ca8c3..081eb562400 100644 --- a/src/mame/video/m107.c +++ b/src/mame/video/m107.c @@ -390,8 +390,8 @@ WRITE16_HANDLER( m107_spritebuffer_w ) SCREEN_UPDATE( m107 ) { - m107_update_scroll_positions(screen->machine()); - m107_screenrefresh(screen->machine(), bitmap, cliprect); + m107_update_scroll_positions(screen.machine()); + m107_screenrefresh(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/m52.c b/src/mame/video/m52.c index f532b14c424..6f5addc7bec 100644 --- a/src/mame/video/m52.c +++ b/src/mame/video/m52.c @@ -362,7 +362,7 @@ static void draw_background(running_machine &machine, bitmap_t *bitmap, const re SCREEN_UPDATE( m52 ) { - m52_state *state = screen->machine().driver_data(); + m52_state *state = screen.machine().driver_data(); int offs; bitmap_fill(bitmap, cliprect, 0); @@ -370,16 +370,16 @@ SCREEN_UPDATE( m52 ) if (!(state->m_bgcontrol & 0x20)) { if (!(state->m_bgcontrol & 0x10)) - draw_background(screen->machine(), bitmap, cliprect, state->m_bg2xpos, state->m_bg2ypos, 2); /* distant mountains */ + draw_background(screen.machine(), bitmap, cliprect, state->m_bg2xpos, state->m_bg2ypos, 2); /* distant mountains */ if (!(state->m_bgcontrol & 0x02)) - draw_background(screen->machine(), bitmap, cliprect, state->m_bg1xpos, state->m_bg1ypos, 3); /* hills */ + draw_background(screen.machine(), bitmap, cliprect, state->m_bg1xpos, state->m_bg1ypos, 3); /* hills */ if (!(state->m_bgcontrol & 0x04)) - draw_background(screen->machine(), bitmap, cliprect, state->m_bg1xpos, state->m_bg1ypos, 4); /* cityscape */ + draw_background(screen.machine(), bitmap, cliprect, state->m_bg1xpos, state->m_bg1ypos, 4); /* cityscape */ } - tilemap_set_flip(state->m_bg_tilemap, flip_screen_get(screen->machine()) ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); + tilemap_set_flip(state->m_bg_tilemap, flip_screen_get(screen.machine()) ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); @@ -403,7 +403,7 @@ SCREEN_UPDATE( m52 ) clip.min_y = 128, clip.max_y = 255; /* adjust for flipping */ - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { int temp = clip.min_y; clip.min_y = 255 - clip.max_y; @@ -423,9 +423,9 @@ SCREEN_UPDATE( m52 ) clip = *cliprect; #endif - drawgfx_transmask(bitmap, &clip, screen->machine().gfx[1], + drawgfx_transmask(bitmap, &clip, screen.machine().gfx[1], code, color, flipx, flipy, sx, sy, - colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[1], color, 512 + 32)); + colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color, 512 + 32)); } return 0; } diff --git a/src/mame/video/m57.c b/src/mame/video/m57.c index 10d86a6f8eb..acc4ec5a2c9 100644 --- a/src/mame/video/m57.c +++ b/src/mame/video/m57.c @@ -269,7 +269,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( m57 ) { - draw_background(screen->machine(), bitmap, cliprect); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_background(screen.machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/m58.c b/src/mame/video/m58.c index 33e1d7a6760..a95c0deb7a2 100644 --- a/src/mame/video/m58.c +++ b/src/mame/video/m58.c @@ -314,13 +314,13 @@ static void draw_panel( running_machine &machine, bitmap_t *bitmap, const rectan SCREEN_UPDATE( yard ) { - m58_state *state = screen->machine().driver_data(); + m58_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, (*state->m_yard_scroll_x_high * 0x100) + *state->m_yard_scroll_x_low); tilemap_set_scrolly(state->m_bg_tilemap, 0, *state->m_yard_scroll_y_low); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); - draw_panel(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); + draw_panel(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/m62.c b/src/mame/video/m62.c index 01c8f186988..4305c735dde 100644 --- a/src/mame/video/m62.c +++ b/src/mame/video/m62.c @@ -474,7 +474,7 @@ VIDEO_START( kungfum ) SCREEN_UPDATE( kungfum ) { - m62_state *state = screen->machine().driver_data(); + m62_state *state = screen.machine().driver_data(); int i; for (i = 0; i < 6; i++) { @@ -485,7 +485,7 @@ SCREEN_UPDATE( kungfum ) tilemap_set_scrollx(state->m_bg_tilemap, i, state->m_m62_background_hscroll); } tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0x1f, 0x00, 0x00); + draw_sprites(screen.machine(), bitmap, cliprect, 0x1f, 0x00, 0x00); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 1, 0); return 0; } @@ -523,14 +523,14 @@ VIDEO_START( ldrun ) SCREEN_UPDATE( ldrun ) { - m62_state *state = screen->machine().driver_data(); + m62_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_m62_background_hscroll); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_m62_background_vscroll); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0x0f, 0x10, 0x00); + draw_sprites(screen.machine(), bitmap, cliprect, 0x0f, 0x10, 0x00); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0x0f, 0x10, 0x10); + draw_sprites(screen.machine(), bitmap, cliprect, 0x0f, 0x10, 0x10); return 0; } @@ -571,7 +571,7 @@ WRITE8_HANDLER( ldrun3_topbottom_mask_w ) SCREEN_UPDATE( ldrun3 ) { - m62_state *state = screen->machine().driver_data(); + m62_state *state = screen.machine().driver_data(); SCREEN_UPDATE_CALL(ldrun); if (state->m_ldrun3_topbottom_mask) @@ -580,11 +580,11 @@ SCREEN_UPDATE( ldrun3 ) my_cliprect.min_y = 0 * 8; my_cliprect.max_y = 1 * 8 - 1; - bitmap_fill(bitmap, &my_cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, &my_cliprect, get_black_pen(screen.machine())); my_cliprect.min_y = 31 * 8; my_cliprect.max_y = 32 * 8 - 1; - bitmap_fill(bitmap, &my_cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, &my_cliprect, get_black_pen(screen.machine())); } return 0; @@ -632,7 +632,7 @@ VIDEO_START( battroad ) SCREEN_UPDATE( battroad ) { - m62_state *state = screen->machine().driver_data(); + m62_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_m62_background_hscroll); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_m62_background_vscroll); tilemap_set_scrollx(state->m_fg_tilemap, 0, 128); @@ -640,9 +640,9 @@ SCREEN_UPDATE( battroad ) tilemap_set_transparent_pen(state->m_fg_tilemap, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0x0f, 0x10, 0x00); + draw_sprites(screen.machine(), bitmap, cliprect, 0x0f, 0x10, 0x00); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0x0f, 0x10, 0x10); + draw_sprites(screen.machine(), bitmap, cliprect, 0x0f, 0x10, 0x10); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } @@ -667,11 +667,11 @@ VIDEO_START( ldrun4 ) SCREEN_UPDATE( ldrun4 ) { - m62_state *state = screen->machine().driver_data(); + m62_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_m62_background_hscroll - 2); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0x1f, 0x00, 0x00); + draw_sprites(screen.machine(), bitmap, cliprect, 0x1f, 0x00, 0x00); return 0; } @@ -710,7 +710,7 @@ VIDEO_START( lotlot ) SCREEN_UPDATE( lotlot ) { - m62_state *state = screen->machine().driver_data(); + m62_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_m62_background_hscroll - 64); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_m62_background_vscroll + 32); tilemap_set_scrollx(state->m_fg_tilemap, 0, -64); @@ -719,7 +719,7 @@ SCREEN_UPDATE( lotlot ) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0x1f, 0x00, 0x00); + draw_sprites(screen.machine(), bitmap, cliprect, 0x1f, 0x00, 0x00); return 0; } @@ -782,14 +782,14 @@ VIDEO_START( kidniki ) SCREEN_UPDATE( kidniki ) { - m62_state *state = screen->machine().driver_data(); + m62_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_m62_background_hscroll); tilemap_set_scrollx(state->m_fg_tilemap, 0, -64); tilemap_set_scrolly(state->m_fg_tilemap, 0, state->m_kidniki_text_vscroll + 128); tilemap_set_transparent_pen(state->m_fg_tilemap, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0x1f, 0x00, 0x00); + draw_sprites(screen.machine(), bitmap, cliprect, 0x1f, 0x00, 0x00); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; @@ -836,7 +836,7 @@ VIDEO_START( spelunkr ) SCREEN_UPDATE( spelunkr ) { - m62_state *state = screen->machine().driver_data(); + m62_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_m62_background_hscroll); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_m62_background_vscroll + 128); tilemap_set_scrollx(state->m_fg_tilemap, 0, -64); @@ -844,7 +844,7 @@ SCREEN_UPDATE( spelunkr ) tilemap_set_transparent_pen(state->m_fg_tilemap, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0x1f, 0x00, 0x00); + draw_sprites(screen.machine(), bitmap, cliprect, 0x1f, 0x00, 0x00); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } @@ -881,7 +881,7 @@ VIDEO_START( spelunk2 ) SCREEN_UPDATE( spelunk2 ) { - m62_state *state = screen->machine().driver_data(); + m62_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_m62_background_hscroll - 1); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_m62_background_vscroll + 128); tilemap_set_scrollx(state->m_fg_tilemap, 0, -65); @@ -889,7 +889,7 @@ SCREEN_UPDATE( spelunk2 ) tilemap_set_transparent_pen(state->m_fg_tilemap, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0x1f, 0x00, 0x00); + draw_sprites(screen.machine(), bitmap, cliprect, 0x1f, 0x00, 0x00); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } @@ -930,14 +930,14 @@ VIDEO_START( youjyudn ) SCREEN_UPDATE( youjyudn ) { - m62_state *state = screen->machine().driver_data(); + m62_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_m62_background_hscroll); tilemap_set_scrollx(state->m_fg_tilemap, 0, -64); tilemap_set_scrolly(state->m_fg_tilemap, 0, 0); tilemap_set_transparent_pen(state->m_fg_tilemap, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0x1f, 0x00, 0x00); + draw_sprites(screen.machine(), bitmap, cliprect, 0x1f, 0x00, 0x00); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; @@ -975,14 +975,14 @@ VIDEO_START( horizon ) SCREEN_UPDATE( horizon ) { - m62_state *state = screen->machine().driver_data(); + m62_state *state = screen.machine().driver_data(); int i; for (i = 0; i < 32; i++) { tilemap_set_scrollx(state->m_bg_tilemap, i, state->m_scrollram[i << 1] | (state->m_scrollram[(i << 1) | 1] << 8)); } tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0x1f, 0x00, 0x00); + draw_sprites(screen.machine(), bitmap, cliprect, 0x1f, 0x00, 0x00); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0, 0); return 0; } diff --git a/src/mame/video/m72.c b/src/mame/video/m72.c index 80449c295b5..2464da50f99 100644 --- a/src/mame/video/m72.c +++ b/src/mame/video/m72.c @@ -537,10 +537,10 @@ static void majtitle_draw_sprites(running_machine &machine, bitmap_t *bitmap,con SCREEN_UPDATE( m72 ) { - m72_state *state = screen->machine().driver_data(); + m72_state *state = screen.machine().driver_data(); if (state->m_video_off) { - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); return 0; } @@ -552,7 +552,7 @@ SCREEN_UPDATE( m72 ) tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,TILEMAP_DRAW_LAYER1,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,TILEMAP_DRAW_LAYER1,0); - m72_draw_sprites(screen->machine(), bitmap,cliprect); + m72_draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,TILEMAP_DRAW_LAYER0,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,TILEMAP_DRAW_LAYER0,0); return 0; @@ -560,13 +560,13 @@ SCREEN_UPDATE( m72 ) SCREEN_UPDATE( majtitle ) { - m72_state *state = screen->machine().driver_data(); + m72_state *state = screen.machine().driver_data(); int i; if (state->m_video_off) { - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); return 0; } @@ -589,8 +589,8 @@ SCREEN_UPDATE( majtitle ) tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,TILEMAP_DRAW_LAYER1,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,TILEMAP_DRAW_LAYER1,0); - majtitle_draw_sprites(screen->machine(), bitmap,cliprect); - m72_draw_sprites(screen->machine(), bitmap,cliprect); + majtitle_draw_sprites(screen.machine(), bitmap,cliprect); + m72_draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,TILEMAP_DRAW_LAYER0,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,TILEMAP_DRAW_LAYER0,0); return 0; diff --git a/src/mame/video/m90.c b/src/mame/video/m90.c index 63a79f98175..17fb4c5c7ea 100644 --- a/src/mame/video/m90.c +++ b/src/mame/video/m90.c @@ -299,7 +299,7 @@ WRITE16_HANDLER( m90_video_w ) SCREEN_UPDATE( m90 ) { - m90_state *state = screen->machine().driver_data(); + m90_state *state = screen.machine().driver_data(); UINT8 pf1_base = state->m_video_control_data[5] & 0x3; UINT8 pf2_base = state->m_video_control_data[6] & 0x3; int i,pf1_enable,pf2_enable, video_enable; @@ -363,7 +363,7 @@ SCREEN_UPDATE( m90 ) tilemap_set_scrollx( state->m_pf2_wide_layer,0, state->m_video_control_data[3]+256-2 ); } - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); if (video_enable) { @@ -454,10 +454,10 @@ SCREEN_UPDATE( m90 ) } } - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); } else { - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); } return 0; @@ -465,10 +465,10 @@ SCREEN_UPDATE( m90 ) SCREEN_UPDATE( bomblord ) { - m90_state *state = screen->machine().driver_data(); + m90_state *state = screen.machine().driver_data(); int i; - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); /* Setup scrolling */ if (state->m_video_control_data[6]&0x20) { @@ -511,16 +511,16 @@ SCREEN_UPDATE( bomblord ) tilemap_draw(bitmap,cliprect,state->m_pf1_layer,1,1); } - bomblord_draw_sprites(screen->machine(),bitmap,cliprect); + bomblord_draw_sprites(screen.machine(),bitmap,cliprect); return 0; } SCREEN_UPDATE( dynablsb ) { - m90_state *state = screen->machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + m90_state *state = screen.machine().driver_data(); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); if (!(state->m_video_data[0xf008/2] & 0x4000)) { tilemap_mark_all_tiles_dirty(state->m_pf1_wide_layer); @@ -554,7 +554,7 @@ SCREEN_UPDATE( dynablsb ) tilemap_draw(bitmap,cliprect,state->m_pf2_layer,1,1); } - dynablsb_draw_sprites(screen->machine(),bitmap,cliprect); + dynablsb_draw_sprites(screen.machine(),bitmap,cliprect); return 0; } diff --git a/src/mame/video/m92.c b/src/mame/video/m92.c index 828445c8d61..8a24e7be972 100644 --- a/src/mame/video/m92.c +++ b/src/mame/video/m92.c @@ -547,34 +547,34 @@ static void m92_draw_tiles(running_machine &machine, bitmap_t *bitmap,const rect SCREEN_UPDATE( m92 ) { - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); - m92_update_scroll_positions(screen->machine()); - m92_draw_tiles(screen->machine(), bitmap, cliprect); + m92_update_scroll_positions(screen.machine()); + m92_draw_tiles(screen.machine(), bitmap, cliprect); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); /* Flipscreen appears hardwired to the dipswitch - strange */ - if (input_port_read(screen->machine(), "DSW") & 0x100) - flip_screen_set(screen->machine(), 0); + if (input_port_read(screen.machine(), "DSW") & 0x100) + flip_screen_set(screen.machine(), 0); else - flip_screen_set(screen->machine(), 1); + flip_screen_set(screen.machine(), 1); return 0; } SCREEN_UPDATE( ppan ) { - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); - m92_update_scroll_positions(screen->machine()); - m92_draw_tiles(screen->machine(), bitmap, cliprect); + m92_update_scroll_positions(screen.machine()); + m92_draw_tiles(screen.machine(), bitmap, cliprect); - ppan_draw_sprites(screen->machine(), bitmap, cliprect); + ppan_draw_sprites(screen.machine(), bitmap, cliprect); /* Flipscreen appears hardwired to the dipswitch - strange */ - if (input_port_read(screen->machine(), "DSW") & 0x100) - flip_screen_set(screen->machine(), 0); + if (input_port_read(screen.machine(), "DSW") & 0x100) + flip_screen_set(screen.machine(), 0); else - flip_screen_set(screen->machine(), 1); + flip_screen_set(screen.machine(), 1); return 0; } diff --git a/src/mame/video/macrossp.c b/src/mame/video/macrossp.c index 1122457f7ac..379aff803cd 100644 --- a/src/mame/video/macrossp.c +++ b/src/mame/video/macrossp.c @@ -389,10 +389,10 @@ static void sortlayers(int *layer,int *pri) SCREEN_UPDATE( macrossp ) { - macrossp_state *state = screen->machine().driver_data(); + macrossp_state *state = screen.machine().driver_data(); int layers[3],layerpri[3]; - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); layers[0] = 0; layerpri[0] = (state->m_scra_videoregs[0] & 0x0000c000) >> 14; @@ -403,13 +403,13 @@ SCREEN_UPDATE( macrossp ) sortlayers(layers, layerpri); - draw_layer(screen->machine(), bitmap, cliprect, layers[0]); - draw_sprites(screen->machine(), bitmap, cliprect, 0); - draw_layer(screen->machine(), bitmap, cliprect, layers[1]); - draw_sprites(screen->machine(), bitmap, cliprect, 1); - draw_layer(screen->machine(), bitmap, cliprect, layers[2]); - draw_sprites(screen->machine(), bitmap, cliprect, 2); - draw_sprites(screen->machine(), bitmap, cliprect, 3); + draw_layer(screen.machine(), bitmap, cliprect, layers[0]); + draw_sprites(screen.machine(), bitmap, cliprect, 0); + draw_layer(screen.machine(), bitmap, cliprect, layers[1]); + draw_sprites(screen.machine(), bitmap, cliprect, 1); + draw_layer(screen.machine(), bitmap, cliprect, layers[2]); + draw_sprites(screen.machine(), bitmap, cliprect, 2); + draw_sprites(screen.machine(), bitmap, cliprect, 3); tilemap_draw(bitmap, cliprect, state->m_text_tilemap, 0, 0); #if 0 @@ -431,7 +431,7 @@ state->m_scrc_videoregs[2]);// 08 - 0b SCREEN_EOF( macrossp ) { - macrossp_state *state = machine.driver_data(); + macrossp_state *state = screen.machine().driver_data(); /* looks like sprites are *two* frames ahead, like nmk16 */ memcpy(state->m_spriteram_old2, state->m_spriteram_old, state->m_spriteram_size); diff --git a/src/mame/video/madalien.c b/src/mame/video/madalien.c index d10937df7e9..bdda00f6665 100644 --- a/src/mame/video/madalien.c +++ b/src/mame/video/madalien.c @@ -253,8 +253,8 @@ WRITE8_HANDLER( madalien_charram_w ) static SCREEN_UPDATE( madalien ) { - madalien_state *state = screen->machine().driver_data(); - int flip = BIT(input_port_read(screen->machine(), "DSW"), 6) && BIT(*state->m_video_control, 0); + madalien_state *state = screen.machine().driver_data(); + int flip = BIT(input_port_read(screen.machine(), "DSW"), 6) && BIT(*state->m_video_control, 0); // bits #0 and #1 define scrolling mode // @@ -266,8 +266,8 @@ static SCREEN_UPDATE( madalien ) int scroll_mode = *state->m_scroll & 3; bitmap_fill(bitmap, cliprect, 0); - draw_edges(screen->machine(), bitmap, cliprect, flip, scroll_mode); - draw_foreground(screen->machine(), bitmap, cliprect, flip); + draw_edges(screen.machine(), bitmap, cliprect, flip, scroll_mode); + draw_foreground(screen.machine(), bitmap, cliprect, flip); /* highlight section A (outside of tunnels). * also, bit 1 of the video_flags register (6A) is @@ -301,7 +301,7 @@ static SCREEN_UPDATE( madalien ) *BITMAP_ADDR16(bitmap, y, x) |= 8; } - draw_headlight(screen->machine(), bitmap, cliprect, flip); + draw_headlight(screen.machine(), bitmap, cliprect, flip); return 0; } diff --git a/src/mame/video/madmotor.c b/src/mame/video/madmotor.c index b99e8baad27..f24ed78d0cd 100644 --- a/src/mame/video/madmotor.c +++ b/src/mame/video/madmotor.c @@ -24,14 +24,14 @@ VIDEO_START( madmotor ) SCREEN_UPDATE( madmotor ) { - madmotor_state *state = screen->machine().driver_data(); - flip_screen_set(screen->machine(), screen->machine().device("tilegen1")->get_flip_state()); + madmotor_state *state = screen.machine().driver_data(); + flip_screen_set(screen.machine(), screen.machine().device("tilegen1")->get_flip_state()); -// tilemap_set_flip_all(screen->machine(), screen->machine().device("tilegen1")->get_flip_state() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); +// tilemap_set_flip_all(screen.machine(), screen.machine().device("tilegen1")->get_flip_state() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); - screen->machine().device("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); - screen->machine().device("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram, 0x00, 0x00, 0x0f); - screen->machine().device("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0x00, 0x00, 0x0f); + screen.machine().device("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); return 0; } diff --git a/src/mame/video/magmax.c b/src/mame/video/magmax.c index 368414f28cc..fd7b03cb071 100644 --- a/src/mame/video/magmax.c +++ b/src/mame/video/magmax.c @@ -86,7 +86,7 @@ VIDEO_START( magmax ) SCREEN_UPDATE( magmax ) { - magmax_state *state = screen->machine().driver_data(); + magmax_state *state = screen.machine().driver_data(); UINT16 *videoram = state->m_videoram; UINT16 *spriteram16 = state->m_spriteram; int offs; @@ -100,12 +100,12 @@ SCREEN_UPDATE( magmax ) else { int v; - UINT8 * rom18B = screen->machine().region("user1")->base(); + UINT8 * rom18B = screen.machine().region("user1")->base(); UINT32 scroll_h = (*state->m_scroll_x) & 0x3fff; UINT32 scroll_v = (*state->m_scroll_y) & 0xff; /*clear background-over-sprites bitmap*/ - bitmap_fill(screen->machine().generic.tmpbitmap, NULL, 0); + bitmap_fill(screen.machine().generic.tmpbitmap, NULL, 0); for (v = 2*8; v < 30*8; v++) /*only for visible area*/ { @@ -156,7 +156,7 @@ SCREEN_UPDATE( magmax ) /*priority: background over sprites*/ if (map_v_scr_100 && ((graph_data & 0x0c)==0x0c)) - *BITMAP_ADDR16(screen->machine().generic.tmpbitmap, v, h) = line_data[h]; + *BITMAP_ADDR16(screen.machine().generic.tmpbitmap, v, h) = line_data[h]; } if (state->m_flipscreen) @@ -201,17 +201,17 @@ SCREEN_UPDATE( magmax ) if (code & 0x80) /* sprite bankswitch */ code += (*state->m_vreg & 0x30) * 0x8; - drawgfx_transmask(bitmap, cliprect, screen->machine().gfx[1], + drawgfx_transmask(bitmap, cliprect, screen.machine().gfx[1], code, color, flipx, flipy, sx, sy, - colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[1], color, 0x1f)); + colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color, 0x1f)); } } if (!(*state->m_vreg & 0x40)) /* background disable */ - copybitmap_trans(bitmap, screen->machine().generic.tmpbitmap, state->m_flipscreen,state->m_flipscreen,0,0, cliprect, 0); + copybitmap_trans(bitmap, screen.machine().generic.tmpbitmap, state->m_flipscreen,state->m_flipscreen,0,0, cliprect, 0); /* draw the foreground characters */ for (offs = 32*32-1; offs >= 0; offs -= 1) @@ -231,7 +231,7 @@ SCREEN_UPDATE( magmax ) sy = 31 - sy; } - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], code, 0, state->m_flipscreen, state->m_flipscreen, diff --git a/src/mame/video/mainevt.c b/src/mame/video/mainevt.c index 8d88ff175fe..a943b86ab96 100644 --- a/src/mame/video/mainevt.c +++ b/src/mame/video/mainevt.c @@ -95,11 +95,11 @@ VIDEO_START( dv ) SCREEN_UPDATE( mainevt ) { - mainevt_state *state = screen->machine().driver_data(); + mainevt_state *state = screen.machine().driver_data(); k052109_tilemap_update(state->m_k052109); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 1); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 2, 1, 2); /* low priority part of layer */ k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 2, 0, 4); /* high priority part of layer */ @@ -111,7 +111,7 @@ SCREEN_UPDATE( mainevt ) SCREEN_UPDATE( dv ) { - mainevt_state *state = screen->machine().driver_data(); + mainevt_state *state = screen.machine().driver_data(); k052109_tilemap_update(state->m_k052109); diff --git a/src/mame/video/mainsnk.c b/src/mame/video/mainsnk.c index 47ed7f8c2a3..618e2aeb629 100644 --- a/src/mame/video/mainsnk.c +++ b/src/mame/video/mainsnk.c @@ -170,10 +170,10 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE(mainsnk) { - mainsnk_state *state = screen->machine().driver_data(); + mainsnk_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0, 0); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); return 0; diff --git a/src/mame/video/malzak.c b/src/mame/video/malzak.c index 23bce9a1455..f7c0f708969 100644 --- a/src/mame/video/malzak.c +++ b/src/mame/video/malzak.c @@ -20,7 +20,7 @@ SCREEN_UPDATE( malzak ) { - malzak_state *state = screen->machine().driver_data(); + malzak_state *state = screen.machine().driver_data(); int sx, sy; int x,y; bitmap_t *s2636_0_bitmap; @@ -43,7 +43,7 @@ SCREEN_UPDATE( malzak ) if (sx < -15*2) sx += 256*2; - drawgfxzoom_transpen(bitmap,cliprect, screen->machine().gfx[0], state->m_playfield_code[x * 16 + y], 7*2, 0, 0, sx, sy, 0x20000, 0x20000, 0); + drawgfxzoom_transpen(bitmap,cliprect, screen.machine().gfx[0], state->m_playfield_code[x * 16 + y], 7*2, 0, 0, sx, sy, 0x20000, 0x20000, 0); } /* update the S2636 chips */ diff --git a/src/mame/video/mappy.c b/src/mame/video/mappy.c index 628a46a3f41..429d0b5a61e 100644 --- a/src/mame/video/mappy.c +++ b/src/mame/video/mappy.c @@ -539,14 +539,14 @@ static void phozon_draw_sprites(running_machine &machine, bitmap_t *bitmap, cons SCREEN_UPDATE( superpac ) { - mappy_state *state = screen->machine().driver_data(); + mappy_state *state = screen.machine().driver_data(); bitmap_t *sprite_bitmap = state->m_sprite_bitmap; int x,y; tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES,0); bitmap_fill(sprite_bitmap,cliprect,15); - mappy_draw_sprites(screen->machine(),sprite_bitmap,cliprect,state->m_spriteram); + mappy_draw_sprites(screen.machine(),sprite_bitmap,cliprect,state->m_spriteram); copybitmap_trans(bitmap,sprite_bitmap,0,0,0,0,cliprect,15); /* Redraw the high priority characters */ @@ -558,7 +558,7 @@ SCREEN_UPDATE( superpac ) for (x = 0;x < sprite_bitmap->width;x++) { int spr_entry = *BITMAP_ADDR16(sprite_bitmap, y, x); - int spr_pen = colortable_entry_get_value(screen->machine().colortable, spr_entry); + int spr_pen = colortable_entry_get_value(screen.machine().colortable, spr_entry); if (spr_pen == 0 || spr_pen == 1) *BITMAP_ADDR16(bitmap, y, x) = spr_entry; } @@ -568,14 +568,14 @@ SCREEN_UPDATE( superpac ) SCREEN_UPDATE( phozon ) { - mappy_state *state = screen->machine().driver_data(); + mappy_state *state = screen.machine().driver_data(); /* flip screen control is embedded in RAM */ - flip_screen_set(screen->machine(), state->m_spriteram[0x1f7f-0x800] & 1); + flip_screen_set(screen.machine(), state->m_spriteram[0x1f7f-0x800] & 1); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES,0); - phozon_draw_sprites(screen->machine(),bitmap,cliprect,state->m_spriteram); + phozon_draw_sprites(screen.machine(),bitmap,cliprect,state->m_spriteram); /* Redraw the high priority characters */ tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,1,0); @@ -584,7 +584,7 @@ SCREEN_UPDATE( phozon ) SCREEN_UPDATE( mappy ) { - mappy_state *state = screen->machine().driver_data(); + mappy_state *state = screen.machine().driver_data(); int offs; for (offs = 2;offs < 34;offs++) @@ -592,7 +592,7 @@ SCREEN_UPDATE( mappy ) tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES,0); - mappy_draw_sprites(screen->machine(),bitmap,cliprect,state->m_spriteram); + mappy_draw_sprites(screen.machine(),bitmap,cliprect,state->m_spriteram); /* Redraw the high priority characters */ tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,1,0); diff --git a/src/mame/video/marineb.c b/src/mame/video/marineb.c index 11000f0b7b6..40727246831 100644 --- a/src/mame/video/marineb.c +++ b/src/mame/video/marineb.c @@ -179,10 +179,10 @@ static void set_tilemap_scrolly( running_machine &machine, int cols ) SCREEN_UPDATE( marineb ) { - marineb_state *state = screen->machine().driver_data(); + marineb_state *state = screen.machine().driver_data(); int offs; - set_tilemap_scrolly(screen->machine(), 24); + set_tilemap_scrolly(screen.machine(), 24); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); /* draw the sprites */ @@ -220,7 +220,7 @@ SCREEN_UPDATE( marineb ) if (!state->m_flipscreen_y) { - sy = 256 - screen->machine().gfx[gfx]->width - sy; + sy = 256 - screen.machine().gfx[gfx]->width - sy; flipy = !flipy; } @@ -229,7 +229,7 @@ SCREEN_UPDATE( marineb ) sx++; } - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[gfx], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[gfx], code, col, flipx,flipy, @@ -241,10 +241,10 @@ SCREEN_UPDATE( marineb ) SCREEN_UPDATE( changes ) { - marineb_state *state = screen->machine().driver_data(); + marineb_state *state = screen.machine().driver_data(); int offs, sx, sy, code, col, flipx, flipy; - set_tilemap_scrolly(screen->machine(), 26); + set_tilemap_scrolly(screen.machine(), 26); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); /* draw the small sprites */ @@ -263,7 +263,7 @@ SCREEN_UPDATE( changes ) if (!state->m_flipscreen_y) { - sy = 256 - screen->machine().gfx[1]->width - sy; + sy = 256 - screen.machine().gfx[1]->width - sy; flipy = !flipy; } @@ -272,7 +272,7 @@ SCREEN_UPDATE( changes ) sx++; } - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1], code >> 2, col, flipx,flipy, @@ -290,7 +290,7 @@ SCREEN_UPDATE( changes ) if (!state->m_flipscreen_y) { - sy = 256 - screen->machine().gfx[2]->width - sy; + sy = 256 - screen.machine().gfx[2]->width - sy; flipy = !flipy; } @@ -301,7 +301,7 @@ SCREEN_UPDATE( changes ) code >>= 4; - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[2], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[2], code, col, flipx,flipy, @@ -309,7 +309,7 @@ SCREEN_UPDATE( changes ) /* draw again for wrap around */ - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[2], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[2], code, col, flipx,flipy, @@ -320,10 +320,10 @@ SCREEN_UPDATE( changes ) SCREEN_UPDATE( springer ) { - marineb_state *state = screen->machine().driver_data(); + marineb_state *state = screen.machine().driver_data(); int offs; - set_tilemap_scrolly(screen->machine(), 0); + set_tilemap_scrolly(screen.machine(), 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); /* draw the sprites */ @@ -359,7 +359,7 @@ SCREEN_UPDATE( springer ) if (!state->m_flipscreen_y) { - sy = 256 - screen->machine().gfx[gfx]->width - sy; + sy = 256 - screen.machine().gfx[gfx]->width - sy; flipy = !flipy; } @@ -368,7 +368,7 @@ SCREEN_UPDATE( springer ) sx--; } - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[gfx], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[gfx], code, col, flipx,flipy, @@ -380,10 +380,10 @@ SCREEN_UPDATE( springer ) SCREEN_UPDATE( hoccer ) { - marineb_state *state = screen->machine().driver_data(); + marineb_state *state = screen.machine().driver_data(); int offs; - set_tilemap_scrolly(screen->machine(), 0); + set_tilemap_scrolly(screen.machine(), 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); /* draw the sprites */ @@ -402,17 +402,17 @@ SCREEN_UPDATE( hoccer ) if (!state->m_flipscreen_y) { - sy = 256 - screen->machine().gfx[1]->width - sy; + sy = 256 - screen.machine().gfx[1]->width - sy; flipy = !flipy; } if (state->m_flipscreen_x) { - sx = 256 - screen->machine().gfx[1]->width - sx; + sx = 256 - screen.machine().gfx[1]->width - sx; flipx = !flipx; } - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1], code >> 2, col, flipx,flipy, @@ -424,10 +424,10 @@ SCREEN_UPDATE( hoccer ) SCREEN_UPDATE( hopprobo ) { - marineb_state *state = screen->machine().driver_data(); + marineb_state *state = screen.machine().driver_data(); int offs; - set_tilemap_scrolly(screen->machine(), 0); + set_tilemap_scrolly(screen.machine(), 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); /* draw the sprites */ @@ -462,7 +462,7 @@ SCREEN_UPDATE( hopprobo ) if (!state->m_flipscreen_y) { - sy = 256 - screen->machine().gfx[gfx]->width - sy; + sy = 256 - screen.machine().gfx[gfx]->width - sy; flipy = !flipy; } @@ -471,7 +471,7 @@ SCREEN_UPDATE( hopprobo ) sx--; } - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[gfx], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[gfx], code, col, flipx,flipy, diff --git a/src/mame/video/mario.c b/src/mame/video/mario.c index a6f4de2c309..afd0d94c8fa 100644 --- a/src/mame/video/mario.c +++ b/src/mame/video/mario.c @@ -210,21 +210,21 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( mario ) { - mario_state *state = screen->machine().driver_data(); + mario_state *state = screen.machine().driver_data(); int t; - t = input_port_read(screen->machine(), "MONITOR"); + t = input_port_read(screen.machine(), "MONITOR"); if (t != state->m_monitor) { state->m_monitor = t; - tilemap_mark_all_tiles_dirty_all(screen->machine()); + tilemap_mark_all_tiles_dirty_all(screen.machine()); } tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_flip ? (HTOTAL-HBSTART) : 0); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_gfx_scroll - (state->m_flip ? 8 : 0)); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/markham.c b/src/mame/video/markham.c index f8d7afaad7e..49df4a2916f 100644 --- a/src/mame/video/markham.c +++ b/src/mame/video/markham.c @@ -119,7 +119,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( markham ) { - markham_state *state = screen->machine().driver_data(); + markham_state *state = screen.machine().driver_data(); int i; for (i = 0; i < 32; i++) @@ -131,6 +131,6 @@ SCREEN_UPDATE( markham ) } tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/matmania.c b/src/mame/video/matmania.c index b75ae72bf96..2a838b3ff2a 100644 --- a/src/mame/video/matmania.c +++ b/src/mame/video/matmania.c @@ -129,7 +129,7 @@ VIDEO_START( matmania ) SCREEN_UPDATE( matmania ) { - matmania_state *state = screen->machine().driver_data(); + matmania_state *state = screen.machine().driver_data(); UINT8 *spriteram = state->m_spriteram; int offs; @@ -140,7 +140,7 @@ SCREEN_UPDATE( matmania ) int sx = 15 - offs / 32; int sy = offs % 32; - drawgfx_opaque(state->m_tmpbitmap, 0, screen->machine().gfx[1], + drawgfx_opaque(state->m_tmpbitmap, 0, screen.machine().gfx[1], state->m_videoram[offs] + ((state->m_colorram[offs] & 0x08) << 5), (state->m_colorram[offs] & 0x30) >> 4, 0,sy >= 16, /* flip horizontally tiles on the right half of the bitmap */ @@ -153,7 +153,7 @@ SCREEN_UPDATE( matmania ) int sx = 15 - offs / 32; int sy = offs % 32; - drawgfx_opaque(state->m_tmpbitmap2, 0, screen->machine().gfx[1], + drawgfx_opaque(state->m_tmpbitmap2, 0, screen.machine().gfx[1], state->m_videoram3[offs] + ((state->m_colorram3[offs] & 0x08) << 5), (state->m_colorram3[offs] & 0x30) >> 4, 0,sy >= 16, /* flip horizontally tiles on the right half of the bitmap */ @@ -175,7 +175,7 @@ SCREEN_UPDATE( matmania ) { if (spriteram[offs] & 0x01) { - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[2], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[2], spriteram[offs + 1] + ((spriteram[offs] & 0xf0) << 4), (spriteram[offs] & 0x08) >> 3, spriteram[offs] & 0x04, spriteram[offs] & 0x02, @@ -190,7 +190,7 @@ SCREEN_UPDATE( matmania ) int sx = 31 - offs / 32; int sy = offs % 32; - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], state->m_videoram2[offs] + 256 * (state->m_colorram2[offs] & 0x07), (state->m_colorram2[offs] & 0x30) >> 4, 0,0, @@ -201,7 +201,7 @@ SCREEN_UPDATE( matmania ) SCREEN_UPDATE( maniach ) { - matmania_state *state = screen->machine().driver_data(); + matmania_state *state = screen.machine().driver_data(); UINT8 *spriteram = state->m_spriteram; int offs; @@ -212,7 +212,7 @@ SCREEN_UPDATE( maniach ) int sx = 15 - offs / 32; int sy = offs % 32; - drawgfx_opaque(state->m_tmpbitmap, 0, screen->machine().gfx[1], + drawgfx_opaque(state->m_tmpbitmap, 0, screen.machine().gfx[1], state->m_videoram[offs] + ((state->m_colorram[offs] & 0x03) << 8), (state->m_colorram[offs] & 0x30) >> 4, 0,sy >= 16, /* flip horizontally tiles on the right half of the bitmap */ @@ -225,7 +225,7 @@ SCREEN_UPDATE( maniach ) int sx = 15 - offs / 32; int sy = offs % 32; - drawgfx_opaque(state->m_tmpbitmap2, 0, screen->machine().gfx[1], + drawgfx_opaque(state->m_tmpbitmap2, 0, screen.machine().gfx[1], state->m_videoram3[offs] + ((state->m_colorram3[offs] & 0x03) << 8), (state->m_colorram3[offs] & 0x30) >> 4, 0,sy >= 16, /* flip horizontally tiles on the right half of the bitmap */ @@ -249,7 +249,7 @@ SCREEN_UPDATE( maniach ) { if (spriteram[offs] & 0x01) { - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[2], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[2], spriteram[offs+1] + ((spriteram[offs] & 0xf0) << 4), (spriteram[offs] & 0x08) >> 3, spriteram[offs] & 0x04,spriteram[offs] & 0x02, @@ -264,7 +264,7 @@ SCREEN_UPDATE( maniach ) int sx = 31 - offs / 32; int sy = offs % 32; - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], state->m_videoram2[offs] + 256 * (state->m_colorram2[offs] & 0x07), (state->m_colorram2[offs] & 0x30) >> 4, 0,0, diff --git a/src/mame/video/mcatadv.c b/src/mame/video/mcatadv.c index 997489961bd..d77fe9da123 100644 --- a/src/mame/video/mcatadv.c +++ b/src/mame/video/mcatadv.c @@ -202,11 +202,11 @@ static void mcatadv_draw_tilemap_part( UINT16* current_scroll, UINT16* current_v SCREEN_UPDATE( mcatadv ) { - mcatadv_state *state = screen->machine().driver_data(); + mcatadv_state *state = screen.machine().driver_data(); int i; - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); if (state->m_scroll1[2] != state->m_palette_bank1) { @@ -231,21 +231,21 @@ SCREEN_UPDATE( mcatadv ) for (i = 0; i <= 3; i++) { #ifdef MAME_DEBUG - if (!screen->machine().input().code_pressed(KEYCODE_Q)) + if (!screen.machine().input().code_pressed(KEYCODE_Q)) #endif mcatadv_draw_tilemap_part(state->m_scroll1, state->m_videoram1, i, state->m_tilemap1, bitmap, cliprect); #ifdef MAME_DEBUG - if (!screen->machine().input().code_pressed(KEYCODE_W)) + if (!screen.machine().input().code_pressed(KEYCODE_W)) #endif mcatadv_draw_tilemap_part(state->m_scroll2, state->m_videoram2, i, state->m_tilemap2, bitmap, cliprect); } g_profiler.start(PROFILER_USER1); #ifdef MAME_DEBUG - if (!screen->machine().input().code_pressed(KEYCODE_E)) + if (!screen.machine().input().code_pressed(KEYCODE_E)) #endif - draw_sprites (screen->machine(), bitmap, cliprect); + draw_sprites (screen.machine(), bitmap, cliprect); g_profiler.stop(); return 0; } @@ -271,7 +271,7 @@ VIDEO_START( mcatadv ) SCREEN_EOF( mcatadv ) { - mcatadv_state *state = machine.driver_data(); + mcatadv_state *state = screen.machine().driver_data(); memcpy(state->m_spriteram_old, state->m_spriteram, state->m_spriteram_size); memcpy(state->m_vidregs_old, state->m_vidregs, 0xf); } diff --git a/src/mame/video/mcd212.c b/src/mame/video/mcd212.c index 28ac48a4c3b..cffca0e00e3 100644 --- a/src/mame/video/mcd212.c +++ b/src/mame/video/mcd212.c @@ -1663,13 +1663,13 @@ VIDEO_START( cdimono1 ) SCREEN_UPDATE( cdimono1 ) { - copybitmap(bitmap, screen->machine().generic.tmpbitmap, 0, 0, 0, 0, cliprect); + copybitmap(bitmap, screen.machine().generic.tmpbitmap, 0, 0, 0, 0, cliprect); return 0; } SCREEN_UPDATE( cdimono1_lcd ) { - cdi_state *state = screen->machine().driver_data(); + cdi_state *state = screen.machine().driver_data(); copybitmap(bitmap, state->m_lcdbitmap, 0, 0, 0, 0, cliprect); return 0; } diff --git a/src/mame/video/mcr.c b/src/mame/video/mcr.c index 82e86d35064..0fb4381d968 100644 --- a/src/mame/video/mcr.c +++ b/src/mame/video/mcr.c @@ -407,7 +407,7 @@ SCREEN_UPDATE( mcr ) tilemap_set_flip(bg_tilemap, mcr_cocktail_flip ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); /* draw the background */ - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0x00); tilemap_draw(bitmap, cliprect, bg_tilemap, 1, 0x10); tilemap_draw(bitmap, cliprect, bg_tilemap, 2, 0x20); @@ -417,18 +417,18 @@ SCREEN_UPDATE( mcr ) switch (mcr_sprite_board) { case 91399: - render_sprites_91399(screen->machine(), bitmap, cliprect); + render_sprites_91399(screen.machine(), bitmap, cliprect); break; case 91464: if (mcr_cpu_board == 91442) - render_sprites_91464(screen->machine(), bitmap, cliprect, 0x00, 0x30, 0x00); + render_sprites_91464(screen.machine(), bitmap, cliprect, 0x00, 0x30, 0x00); else if (mcr_cpu_board == 91475) - render_sprites_91464(screen->machine(), bitmap, cliprect, 0x00, 0x30, 0x40); + render_sprites_91464(screen.machine(), bitmap, cliprect, 0x00, 0x30, 0x40); else if (mcr_cpu_board == 91490) - render_sprites_91464(screen->machine(), bitmap, cliprect, 0x00, 0x30, 0x00); + render_sprites_91464(screen.machine(), bitmap, cliprect, 0x00, 0x30, 0x00); else if (mcr_cpu_board == 91721) - render_sprites_91464(screen->machine(), bitmap, cliprect, 0x00, 0x30, 0x00); + render_sprites_91464(screen.machine(), bitmap, cliprect, 0x00, 0x30, 0x00); break; } return 0; diff --git a/src/mame/video/mcr3.c b/src/mame/video/mcr3.c index 96bdb6c2a3d..0cc72bcd89f 100644 --- a/src/mame/video/mcr3.c +++ b/src/mame/video/mcr3.c @@ -282,7 +282,7 @@ static void mcr3_update_sprites(running_machine &machine, bitmap_t *bitmap, cons SCREEN_UPDATE( mcr3 ) { - mcr3_state *state = screen->machine().driver_data(); + mcr3_state *state = screen.machine().driver_data(); /* update the flip state */ tilemap_set_flip(state->m_bg_tilemap, mcr_cocktail_flip ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); @@ -290,14 +290,14 @@ SCREEN_UPDATE( mcr3 ) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); /* draw the sprites */ - mcr3_update_sprites(screen->machine(), bitmap, cliprect, 0x03, 0, 0, 0); + mcr3_update_sprites(screen.machine(), bitmap, cliprect, 0x03, 0, 0, 0); return 0; } SCREEN_UPDATE( spyhunt ) { - mcr3_state *state = screen->machine().driver_data(); + mcr3_state *state = screen.machine().driver_data(); /* for every character in the Video RAM, check if it has been modified */ /* since last time and update it accordingly. */ tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_spyhunt_scrollx * 2 + state->m_spyhunt_scroll_offset); @@ -305,7 +305,7 @@ SCREEN_UPDATE( spyhunt ) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); /* draw the sprites */ - mcr3_update_sprites(screen->machine(), bitmap, cliprect, state->m_spyhunt_sprite_color_mask, 0, -12, 0); + mcr3_update_sprites(screen.machine(), bitmap, cliprect, state->m_spyhunt_sprite_color_mask, 0, -12, 0); /* render any characters on top */ tilemap_draw(bitmap, cliprect, state->m_alpha_tilemap, 0, 0); diff --git a/src/mame/video/mcr68.c b/src/mame/video/mcr68.c index 12eca461904..ce7efd1642b 100644 --- a/src/mame/video/mcr68.c +++ b/src/mame/video/mcr68.c @@ -333,35 +333,35 @@ static void zwackery_update_sprites(running_machine &machine, bitmap_t *bitmap, SCREEN_UPDATE( mcr68 ) { - mcr68_state *state = screen->machine().driver_data(); + mcr68_state *state = screen.machine().driver_data(); /* draw the background */ tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0); /* draw the low-priority sprites */ - mcr68_update_sprites(screen->machine(), bitmap, cliprect, 0); + mcr68_update_sprites(screen.machine(), bitmap, cliprect, 0); /* redraw tiles with priority over sprites */ tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 1, 0); /* draw the high-priority sprites */ - mcr68_update_sprites(screen->machine(), bitmap, cliprect, 1); + mcr68_update_sprites(screen.machine(), bitmap, cliprect, 1); return 0; } SCREEN_UPDATE( zwackery ) { - mcr68_state *state = screen->machine().driver_data(); + mcr68_state *state = screen.machine().driver_data(); /* draw the background */ tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); /* draw the low-priority sprites */ - zwackery_update_sprites(screen->machine(), bitmap, cliprect, 0); + zwackery_update_sprites(screen.machine(), bitmap, cliprect, 0); /* redraw tiles with priority over sprites */ tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 1, 0); /* draw the high-priority sprites */ - zwackery_update_sprites(screen->machine(), bitmap, cliprect, 1); + zwackery_update_sprites(screen.machine(), bitmap, cliprect, 1); return 0; } diff --git a/src/mame/video/meadows.c b/src/mame/video/meadows.c index 23c3c3d4ec6..0372dfbe560 100644 --- a/src/mame/video/meadows.c +++ b/src/mame/video/meadows.c @@ -107,12 +107,12 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( meadows ) { - meadows_state *state = screen->machine().driver_data(); + meadows_state *state = screen.machine().driver_data(); /* draw the background */ tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); /* draw the sprites */ - if (screen->machine().gfx[1]) - draw_sprites(screen->machine(), bitmap, cliprect); + if (screen.machine().gfx[1]) + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/megasys1.c b/src/mame/video/megasys1.c index 129368770c2..f74c64657bf 100644 --- a/src/mame/video/megasys1.c +++ b/src/mame/video/megasys1.c @@ -926,7 +926,7 @@ PALETTE_INIT( megasys1 ) SCREEN_UPDATE( megasys1 ) { - megasys1_state *state = screen->machine().driver_data(); + megasys1_state *state = screen.machine().driver_data(); int i,flag,pri,primask; int active_layers; @@ -960,7 +960,7 @@ SCREEN_UPDATE( megasys1 ) active_layers |= 1 << ((pri & 0xf0000) >> 16); // bottom layer can't be disabled } - tilemap_set_flip_all( screen->machine(), (state->m_screen_flag & 1) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0 ); + tilemap_set_flip_all( screen.machine(), (state->m_screen_flag & 1) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0 ); for (i = 0;i < 3;i++) { @@ -973,7 +973,7 @@ SCREEN_UPDATE( megasys1 ) } } - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); flag = TILEMAP_DRAW_OPAQUE; primask = 0; @@ -1016,13 +1016,13 @@ SCREEN_UPDATE( megasys1 ) } if (active_layers & 0x08) - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); return 0; } SCREEN_EOF( megasys1 ) { - megasys1_state *state = machine.driver_data(); + megasys1_state *state = screen.machine().driver_data(); /* Sprite are TWO frames ahead, like NMK16 HW. */ //state->m_objectram memcpy(state->m_buffer2_objectram,state->m_buffer_objectram, 0x2000); diff --git a/src/mame/video/megazone.c b/src/mame/video/megazone.c index 06613e4756a..b7fb157f6f5 100644 --- a/src/mame/video/megazone.c +++ b/src/mame/video/megazone.c @@ -113,7 +113,7 @@ VIDEO_START( megazone ) SCREEN_UPDATE( megazone ) { - megazone_state *state = screen->machine().driver_data(); + megazone_state *state = screen.machine().driver_data(); int offs; int x, y; @@ -135,7 +135,7 @@ SCREEN_UPDATE( megazone ) flipy = !flipy; } - drawgfx_opaque(state->m_tmpbitmap, 0, screen->machine().gfx[1], + drawgfx_opaque(state->m_tmpbitmap, 0, screen.machine().gfx[1], ((int)state->m_videoram[offs]) + ((state->m_colorram[offs] & (1 << 7) ? 256 : 0) ), (state->m_colorram[offs] & 0x0f) + 0x10, flipx,flipy, @@ -182,12 +182,12 @@ SCREEN_UPDATE( megazone ) else sx = sx + 32; - drawgfx_transmask(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transmask(bitmap,cliprect,screen.machine().gfx[0], spriteram[offs + 2], color, flipx,flipy, sx,sy, - colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[0], color, 0)); + colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[0], color, 0)); } } @@ -215,7 +215,7 @@ SCREEN_UPDATE( megazone ) - drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[1], + drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[1], ((int)state->m_videoram2[offs]) + ((state->m_colorram2[offs] & (1 << 7) ? 256 : 0) ), (state->m_colorram2[offs] & 0x0f) + 0x10, flipx,flipy, diff --git a/src/mame/video/mermaid.c b/src/mame/video/mermaid.c index 372f1c42213..3a8267765ac 100644 --- a/src/mame/video/mermaid.c +++ b/src/mame/video/mermaid.c @@ -241,11 +241,11 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( mermaid ) { - mermaid_state *state = screen->machine().driver_data(); + mermaid_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } @@ -273,8 +273,8 @@ static UINT8 collision_check( running_machine &machine, rectangle* rect ) SCREEN_EOF( mermaid ) { - mermaid_state *state = machine.driver_data(); - const rectangle &visarea = machine.primary_screen->visible_area(); + mermaid_state *state = screen.machine().driver_data(); + const rectangle &visarea = screen.machine().primary_screen->visible_area(); UINT8 *spriteram = state->m_spriteram; int offs, offs2; @@ -305,13 +305,13 @@ SCREEN_EOF( mermaid ) code |= state->m_rougien_gfxbank1 * 0x2800; code |= state->m_rougien_gfxbank2 * 0x2400; - if (flip_screen_x_get(machine)) + if (flip_screen_x_get(screen.machine())) { flipx = !flipx; sx = 240 - sx; } - if (flip_screen_y_get(machine)) + if (flip_screen_y_get(screen.machine())) { flipy = !flipy; sy = 240 - sy; @@ -319,8 +319,8 @@ SCREEN_EOF( mermaid ) rect.min_x = sx; rect.min_y = sy; - rect.max_x = sx + machine.gfx[1]->width - 1; - rect.max_y = sy + machine.gfx[1]->height - 1; + rect.max_x = sx + screen.machine().gfx[1]->width - 1; + rect.max_y = sy + screen.machine().gfx[1]->height - 1; if (rect.min_x < visarea.min_x) rect.min_x = visarea.min_x; @@ -338,9 +338,9 @@ SCREEN_EOF( mermaid ) tilemap_draw(state->m_helper, &rect, state->m_bg_tilemap, 0, 0); - drawgfx_transpen(state->m_helper2, &rect, machine.gfx[1], code, 0, flipx, flipy, sx, sy, 0); + drawgfx_transpen(state->m_helper2, &rect, screen.machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0); - state->m_coll_bit2 |= collision_check(machine, &rect); + state->m_coll_bit2 |= collision_check(screen.machine(), &rect); // check collision sprite - foreground @@ -349,9 +349,9 @@ SCREEN_EOF( mermaid ) tilemap_draw(state->m_helper, &rect, state->m_fg_tilemap, 0, 0); - drawgfx_transpen(state->m_helper2, &rect, machine.gfx[1], code, 0, flipx, flipy, sx, sy, 0); + drawgfx_transpen(state->m_helper2, &rect, screen.machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0); - state->m_coll_bit1 |= collision_check(machine, &rect); + state->m_coll_bit1 |= collision_check(screen.machine(), &rect); // check collision sprite - sprite @@ -375,24 +375,24 @@ SCREEN_EOF( mermaid ) code2 |= state->m_rougien_gfxbank1 * 0x2800; code2 |= state->m_rougien_gfxbank2 * 0x2400; - if (flip_screen_x_get(machine)) + if (flip_screen_x_get(screen.machine())) { flipx2 = !flipx2; sx2 = 240 - sx2; } - if (flip_screen_y_get(machine)) + if (flip_screen_y_get(screen.machine())) { flipy2 = !flipy2; sy2 = 240 - sy2; } - drawgfx_transpen(state->m_helper, &rect, machine.gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0); + drawgfx_transpen(state->m_helper, &rect, screen.machine().gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0); } - drawgfx_transpen(state->m_helper2, &rect, machine.gfx[1], code, 0, flipx, flipy, sx, sy, 0); + drawgfx_transpen(state->m_helper2, &rect, screen.machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0); - state->m_coll_bit0 |= collision_check(machine, &rect); + state->m_coll_bit0 |= collision_check(screen.machine(), &rect); } // check for bit 3 (sprite-sprite) @@ -415,13 +415,13 @@ SCREEN_EOF( mermaid ) code |= state->m_rougien_gfxbank1 * 0x2800; code |= state->m_rougien_gfxbank2 * 0x2400; - if (flip_screen_x_get(machine)) + if (flip_screen_x_get(screen.machine())) { flipx = !flipx; sx = 240 - sx; } - if (flip_screen_y_get(machine)) + if (flip_screen_y_get(screen.machine())) { flipy = !flipy; sy = 240 - sy; @@ -429,8 +429,8 @@ SCREEN_EOF( mermaid ) rect.min_x = sx; rect.min_y = sy; - rect.max_x = sx + machine.gfx[1]->width - 1; - rect.max_y = sy + machine.gfx[1]->height - 1; + rect.max_x = sx + screen.machine().gfx[1]->width - 1; + rect.max_y = sy + screen.machine().gfx[1]->height - 1; if (rect.min_x < visarea.min_x) rect.min_x = visarea.min_x; @@ -463,24 +463,24 @@ SCREEN_EOF( mermaid ) code2 |= state->m_rougien_gfxbank1 * 0x2800; code2 |= state->m_rougien_gfxbank2 * 0x2400; - if (flip_screen_x_get(machine)) + if (flip_screen_x_get(screen.machine())) { flipx2 = !flipx2; sx2 = 240 - sx2; } - if (flip_screen_y_get(machine)) + if (flip_screen_y_get(screen.machine())) { flipy2 = !flipy2; sy2 = 240 - sy2; } - drawgfx_transpen(state->m_helper, &rect, machine.gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0); + drawgfx_transpen(state->m_helper, &rect, screen.machine().gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0); } - drawgfx_transpen(state->m_helper2, &rect, machine.gfx[1], code, 0, flipx, flipy, sx, sy, 0); + drawgfx_transpen(state->m_helper2, &rect, screen.machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0); - state->m_coll_bit3 |= collision_check(machine, &rect); + state->m_coll_bit3 |= collision_check(screen.machine(), &rect); } // check for bit 6 @@ -503,13 +503,13 @@ SCREEN_EOF( mermaid ) code |= state->m_rougien_gfxbank1 * 0x2800; code |= state->m_rougien_gfxbank2 * 0x2400; - if (flip_screen_x_get(machine)) + if (flip_screen_x_get(screen.machine())) { flipx = !flipx; sx = 240 - sx; } - if (flip_screen_y_get(machine)) + if (flip_screen_y_get(screen.machine())) { flipy = !flipy; sy = 240 - sy; @@ -517,8 +517,8 @@ SCREEN_EOF( mermaid ) rect.min_x = sx; rect.min_y = sy; - rect.max_x = sx + machine.gfx[1]->width - 1; - rect.max_y = sy + machine.gfx[1]->height - 1; + rect.max_x = sx + screen.machine().gfx[1]->width - 1; + rect.max_y = sy + screen.machine().gfx[1]->height - 1; if (rect.min_x < visarea.min_x) rect.min_x = visarea.min_x; @@ -551,24 +551,24 @@ SCREEN_EOF( mermaid ) code2 |= state->m_rougien_gfxbank1 * 0x2800; code2 |= state->m_rougien_gfxbank2 * 0x2400; - if (flip_screen_x_get(machine)) + if (flip_screen_x_get(screen.machine())) { flipx2 = !flipx2; sx2 = 240 - sx2; } - if (flip_screen_y_get(machine)) + if (flip_screen_y_get(screen.machine())) { flipy2 = !flipy2; sy2 = 240 - sy2; } - drawgfx_transpen(state->m_helper, &rect, machine.gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0); + drawgfx_transpen(state->m_helper, &rect, screen.machine().gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0); } - drawgfx_transpen(state->m_helper2, &rect, machine.gfx[1], code, 0, flipx, flipy, sx, sy, 0); + drawgfx_transpen(state->m_helper2, &rect, screen.machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0); - state->m_coll_bit6 |= collision_check(machine, &rect); + state->m_coll_bit6 |= collision_check(screen.machine(), &rect); } } diff --git a/src/mame/video/metlclsh.c b/src/mame/video/metlclsh.c index 8020d72d066..730e41fe4a3 100644 --- a/src/mame/video/metlclsh.c +++ b/src/mame/video/metlclsh.c @@ -244,7 +244,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( metlclsh ) { - metlclsh_state *state = screen->machine().driver_data(); + metlclsh_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, 0x10); @@ -253,11 +253,11 @@ SCREEN_UPDATE( metlclsh ) if (state->m_scrollx[0] & 0x08) // background (if enabled) { /* The background seems to be always flipped along x */ - tilemap_set_flip(state->m_bg_tilemap, (flip_screen_get(screen->machine()) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0) ^ TILEMAP_FLIPX); + tilemap_set_flip(state->m_bg_tilemap, (flip_screen_get(screen.machine()) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0) ^ TILEMAP_FLIPX); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_scrollx[1] + ((state->m_scrollx[0] & 0x02) << 7) ); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); } - draw_sprites(screen->machine(), bitmap, cliprect); // sprites + draw_sprites(screen.machine(), bitmap, cliprect); // sprites tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 2, 0); // high priority tiles of foreground // popmessage("%02X", state->m_scrollx[0]); diff --git a/src/mame/video/metro.c b/src/mame/video/metro.c index 9a1decacaaa..f8fa0e6b9d5 100644 --- a/src/mame/video/metro.c +++ b/src/mame/video/metro.c @@ -723,16 +723,16 @@ static void draw_layers( running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( metro ) { - metro_state *state = screen->machine().driver_data(); + metro_state *state = screen.machine().driver_data(); int pri, layers_ctrl = -1; UINT16 screenctrl = *state->m_screenctrl; - const rectangle &visarea = screen->machine().primary_screen->visible_area(); + const rectangle &visarea = screen.machine().primary_screen->visible_area(); state->m_sprite_xoffs = state->m_videoregs[0x06 / 2] - (visarea.max_x + 1) / 2; state->m_sprite_yoffs = state->m_videoregs[0x04 / 2] - (visarea.max_y + 1) / 2; /* The background color is selected by a register */ - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, ((state->m_videoregs[0x12/2] & 0x0fff)) + 0x1000); /* Screen Control Register: @@ -749,7 +749,7 @@ SCREEN_UPDATE( metro ) if (screenctrl & 2) return 0; - //flip_screen_set(screen->machine(), screenctrl & 1); + //flip_screen_set(screen.machine(), screenctrl & 1); state->m_flip_screen = screenctrl & 1; /* If the game supports 16x16 tiles, make sure that the @@ -770,13 +770,13 @@ SCREEN_UPDATE( metro ) #ifdef MAME_DEBUG -if (screen->machine().input().code_pressed(KEYCODE_Z)) +if (screen.machine().input().code_pressed(KEYCODE_Z)) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= 2; - if (screen->machine().input().code_pressed(KEYCODE_E)) msk |= 4; - if (screen->machine().input().code_pressed(KEYCODE_A)) msk |= 8; + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (screen.machine().input().code_pressed(KEYCODE_E)) msk |= 4; + if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= 8; if (msk != 0) { bitmap_fill(bitmap, cliprect, 0); @@ -794,9 +794,9 @@ if (screen->machine().input().code_pressed(KEYCODE_Z)) k053936_zoom_draw(state->m_k053936, bitmap, cliprect, state->m_k053936_tilemap, 0, 0, 1); for (pri = 3; pri >= 0; pri--) - draw_layers(screen->machine(), bitmap, cliprect, pri, layers_ctrl); + draw_layers(screen.machine(), bitmap, cliprect, pri, layers_ctrl); if (layers_ctrl & 0x08) - metro_draw_sprites(screen->machine(), bitmap, cliprect); + metro_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/mexico86.c b/src/mame/video/mexico86.c index e0e977ab000..8ee3ef4d10e 100644 --- a/src/mame/video/mexico86.c +++ b/src/mame/video/mexico86.c @@ -18,7 +18,7 @@ WRITE8_HANDLER( mexico86_bankswitch_w ) SCREEN_UPDATE( mexico86 ) { - mexico86_state *state = screen->machine().driver_data(); + mexico86_state *state = screen.machine().driver_data(); int offs; int sx, sy, xc, yc; int gfx_num, gfx_attr, gfx_offs; @@ -88,7 +88,7 @@ SCREEN_UPDATE( mexico86 ) x = (sx + xc * 8) & 0xff; y = (sy + yc * 8) & 0xff; - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], code, color, flipx,flipy, @@ -101,7 +101,7 @@ SCREEN_UPDATE( mexico86 ) SCREEN_UPDATE( kikikai ) { - mexico86_state *state = screen->machine().driver_data(); + mexico86_state *state = screen.machine().driver_data(); int offs; int sx, sy, yc; int gfx_num, /*gfx_attr,*/ gfx_offs; @@ -109,7 +109,7 @@ SCREEN_UPDATE( kikikai ) int goffs, code, color, y; int tx, ty; - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); sx = 0; for (offs = 0; offs < state->m_objectram_size; offs += 4) { @@ -147,7 +147,7 @@ SCREEN_UPDATE( kikikai ) color = (state->m_videoram[goffs + 1] & 0xe0) >> 5; goffs += 0x40; - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], code, color, 0,0, @@ -156,7 +156,7 @@ SCREEN_UPDATE( kikikai ) code = state->m_videoram[goffs] + ((state->m_videoram[goffs + 1] & 0x1f) << 8); color = (state->m_videoram[goffs + 1] & 0xe0) >> 5; - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], code, color, 0,0, diff --git a/src/mame/video/midvunit.c b/src/mame/video/midvunit.c index 5015a41d880..cd04f333bc9 100644 --- a/src/mame/video/midvunit.c +++ b/src/mame/video/midvunit.c @@ -527,7 +527,7 @@ READ32_HANDLER( midvunit_textureram_r ) SCREEN_UPDATE( midvunit ) { - midvunit_state *state = screen->machine().driver_data(); + midvunit_state *state = screen.machine().driver_data(); int x, y, width, xoffs; UINT32 offset; @@ -551,7 +551,7 @@ SCREEN_UPDATE( midvunit ) /* adjust the offset */ offset += xoffs; - offset += 512 * (cliprect->min_y - screen->visible_area().min_y); + offset += 512 * (cliprect->min_y - screen.visible_area().min_y); /* loop over rows */ for (y = cliprect->min_y; y <= cliprect->max_y; y++) diff --git a/src/mame/video/midzeus.c b/src/mame/video/midzeus.c index 69d86898c1a..23d7deca1e2 100644 --- a/src/mame/video/midzeus.c +++ b/src/mame/video/midzeus.c @@ -339,10 +339,10 @@ SCREEN_UPDATE( midzeus ) poly_wait(poly, "VIDEO_UPDATE"); /* normal update case */ - if (!screen->machine().input().code_pressed(KEYCODE_W)) + if (!screen.machine().input().code_pressed(KEYCODE_W)) { const void *base = waveram1_ptr_from_expanded_addr(zeusbase[0xcc]); - int xoffs = screen->visible_area().min_x; + int xoffs = screen.visible_area().min_x; for (y = cliprect->min_y; y <= cliprect->max_y; y++) { UINT16 *dest = (UINT16 *)bitmap->base + y * bitmap->rowpixels; @@ -356,10 +356,10 @@ SCREEN_UPDATE( midzeus ) { const void *base; - if (screen->machine().input().code_pressed(KEYCODE_DOWN)) yoffs += screen->machine().input().code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1; - if (screen->machine().input().code_pressed(KEYCODE_UP)) yoffs -= screen->machine().input().code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1; - if (screen->machine().input().code_pressed(KEYCODE_LEFT) && texel_width > 4) { texel_width >>= 1; while (screen->machine().input().code_pressed(KEYCODE_LEFT)) ; } - if (screen->machine().input().code_pressed(KEYCODE_RIGHT) && texel_width < 512) { texel_width <<= 1; while (screen->machine().input().code_pressed(KEYCODE_RIGHT)) ; } + if (screen.machine().input().code_pressed(KEYCODE_DOWN)) yoffs += screen.machine().input().code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1; + if (screen.machine().input().code_pressed(KEYCODE_UP)) yoffs -= screen.machine().input().code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1; + if (screen.machine().input().code_pressed(KEYCODE_LEFT) && texel_width > 4) { texel_width >>= 1; while (screen.machine().input().code_pressed(KEYCODE_LEFT)) ; } + if (screen.machine().input().code_pressed(KEYCODE_RIGHT) && texel_width < 512) { texel_width <<= 1; while (screen.machine().input().code_pressed(KEYCODE_RIGHT)) ; } if (yoffs < 0) yoffs = 0; base = waveram0_ptr_from_block_addr(yoffs << 12); diff --git a/src/mame/video/midzeus2.c b/src/mame/video/midzeus2.c index 76d7dbb6e9d..27473b1cdce 100644 --- a/src/mame/video/midzeus2.c +++ b/src/mame/video/midzeus2.c @@ -364,14 +364,14 @@ SCREEN_UPDATE( midzeus2 ) poly_wait(poly, "VIDEO_UPDATE"); -if (screen->machine().input().code_pressed(KEYCODE_UP)) { zbase += 1.0f; popmessage("Zbase = %f", zbase); } -if (screen->machine().input().code_pressed(KEYCODE_DOWN)) { zbase -= 1.0f; popmessage("Zbase = %f", zbase); } +if (screen.machine().input().code_pressed(KEYCODE_UP)) { zbase += 1.0f; popmessage("Zbase = %f", zbase); } +if (screen.machine().input().code_pressed(KEYCODE_DOWN)) { zbase -= 1.0f; popmessage("Zbase = %f", zbase); } /* normal update case */ - if (!screen->machine().input().code_pressed(KEYCODE_W)) + if (!screen.machine().input().code_pressed(KEYCODE_W)) { const void *base = waveram1_ptr_from_expanded_addr(zeusbase[0x38]); - int xoffs = screen->visible_area().min_x; + int xoffs = screen.visible_area().min_x; for (y = cliprect->min_y; y <= cliprect->max_y; y++) { UINT32 *dest = (UINT32 *)bitmap->base + y * bitmap->rowpixels; @@ -385,10 +385,10 @@ if (screen->machine().input().code_pressed(KEYCODE_DOWN)) { zbase -= 1.0f; popme { const UINT64 *base; - if (screen->machine().input().code_pressed(KEYCODE_DOWN)) yoffs += screen->machine().input().code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1; - if (screen->machine().input().code_pressed(KEYCODE_UP)) yoffs -= screen->machine().input().code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1; - if (screen->machine().input().code_pressed(KEYCODE_LEFT) && texel_width > 4) { texel_width >>= 1; while (screen->machine().input().code_pressed(KEYCODE_LEFT)) ; } - if (screen->machine().input().code_pressed(KEYCODE_RIGHT) && texel_width < 512) { texel_width <<= 1; while (screen->machine().input().code_pressed(KEYCODE_RIGHT)) ; } + if (screen.machine().input().code_pressed(KEYCODE_DOWN)) yoffs += screen.machine().input().code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1; + if (screen.machine().input().code_pressed(KEYCODE_UP)) yoffs -= screen.machine().input().code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1; + if (screen.machine().input().code_pressed(KEYCODE_LEFT) && texel_width > 4) { texel_width >>= 1; while (screen.machine().input().code_pressed(KEYCODE_LEFT)) ; } + if (screen.machine().input().code_pressed(KEYCODE_RIGHT) && texel_width < 512) { texel_width <<= 1; while (screen.machine().input().code_pressed(KEYCODE_RIGHT)) ; } if (yoffs < 0) yoffs = 0; base = (const UINT64 *)waveram0_ptr_from_expanded_addr(yoffs << 16); diff --git a/src/mame/video/mikie.c b/src/mame/video/mikie.c index d698ad83ae8..4ae6f7c21e8 100644 --- a/src/mame/video/mikie.c +++ b/src/mame/video/mikie.c @@ -177,9 +177,9 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( mikie ) { - mikie_state *state = screen->machine().driver_data(); + mikie_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_CATEGORY(0), 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_CATEGORY(1), 0); return 0; } diff --git a/src/mame/video/mitchell.c b/src/mame/video/mitchell.c index 46ec38b6d3d..3660569e748 100644 --- a/src/mame/video/mitchell.c +++ b/src/mame/video/mitchell.c @@ -330,10 +330,10 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( pang ) { - mitchell_state *state = screen->machine().driver_data(); + mitchell_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/mjkjidai.c b/src/mame/video/mjkjidai.c index 4abadb752ab..76ee781f47d 100644 --- a/src/mame/video/mjkjidai.c +++ b/src/mame/video/mjkjidai.c @@ -131,13 +131,13 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( mjkjidai ) { - mjkjidai_state *state = screen->machine().driver_data(); + mjkjidai_state *state = screen.machine().driver_data(); if (!state->m_display_enable) - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); else { tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); } return 0; } diff --git a/src/mame/video/model1.c b/src/mame/video/model1.c index f71815842c6..80eac92d4f1 100644 --- a/src/mame/video/model1.c +++ b/src/mame/video/model1.c @@ -454,10 +454,10 @@ static void draw_quads(model1_state *state, bitmap_t *bitmap, const rectangle *c fill_quad(bitmap, view, q); #if 0 - draw_line(bitmap, get_black_pen(screen->machine()), q->p[0]->s.x, q->p[0]->s.y, q->p[1]->s.x, q->p[1]->s.y); - draw_line(bitmap, get_black_pen(screen->machine()), q->p[1]->s.x, q->p[1]->s.y, q->p[2]->s.x, q->p[2]->s.y); - draw_line(bitmap, get_black_pen(screen->machine()), q->p[2]->s.x, q->p[2]->s.y, q->p[3]->s.x, q->p[3]->s.y); - draw_line(bitmap, get_black_pen(screen->machine()), q->p[3]->s.x, q->p[3]->s.y, q->p[0]->s.x, q->p[0]->s.y); + draw_line(bitmap, get_black_pen(screen.machine()), q->p[0]->s.x, q->p[0]->s.y, q->p[1]->s.x, q->p[1]->s.y); + draw_line(bitmap, get_black_pen(screen.machine()), q->p[1]->s.x, q->p[1]->s.y, q->p[2]->s.x, q->p[2]->s.y); + draw_line(bitmap, get_black_pen(screen.machine()), q->p[2]->s.x, q->p[2]->s.y, q->p[3]->s.x, q->p[3]->s.y); + draw_line(bitmap, get_black_pen(screen.machine()), q->p[3]->s.x, q->p[3]->s.y, q->p[0]->s.x, q->p[0]->s.y); #endif } @@ -1470,7 +1470,7 @@ VIDEO_START(model1) SCREEN_UPDATE(model1) { - model1_state *state = screen->machine().driver_data(); + model1_state *state = screen.machine().driver_data(); struct view *view = state->m_view; #if 0 { @@ -1478,35 +1478,35 @@ SCREEN_UPDATE(model1) double delta; delta = 1; - if(screen->machine().input().code_pressed(KEYCODE_F)) { + if(screen.machine().input().code_pressed(KEYCODE_F)) { mod = 1; view->vxx -= delta; } - if(screen->machine().input().code_pressed(KEYCODE_G)) { + if(screen.machine().input().code_pressed(KEYCODE_G)) { mod = 1; view->vxx += delta; } - if(screen->machine().input().code_pressed(KEYCODE_H)) { + if(screen.machine().input().code_pressed(KEYCODE_H)) { mod = 1; view->vyy -= delta; } - if(screen->machine().input().code_pressed(KEYCODE_J)) { + if(screen.machine().input().code_pressed(KEYCODE_J)) { mod = 1; view->vyy += delta; } - if(screen->machine().input().code_pressed(KEYCODE_K)) { + if(screen.machine().input().code_pressed(KEYCODE_K)) { mod = 1; view->vzz -= delta; } - if(screen->machine().input().code_pressed(KEYCODE_L)) { + if(screen.machine().input().code_pressed(KEYCODE_L)) { mod = 1; view->vzz += delta; } - if(screen->machine().input().code_pressed(KEYCODE_U)) { + if(screen.machine().input().code_pressed(KEYCODE_U)) { mod = 1; view->ayy -= 0.05; } - if(screen->machine().input().code_pressed(KEYCODE_I)) { + if(screen.machine().input().code_pressed(KEYCODE_I)) { mod = 1; view->ayy += 0.05; } @@ -1518,16 +1518,16 @@ SCREEN_UPDATE(model1) view->ayyc = cos(view->ayy); view->ayys = sin(view->ayy); - bitmap_fill(screen->machine().priority_bitmap, NULL, 0); - bitmap_fill(bitmap, cliprect, screen->machine().pens[0]); + bitmap_fill(screen.machine().priority_bitmap, NULL, 0); + bitmap_fill(bitmap, cliprect, screen.machine().pens[0]); - segas24_tile *tile = screen->machine().device("tile"); + segas24_tile *tile = screen.machine().device("tile"); tile->draw(bitmap, cliprect, 6, 0, 0); tile->draw(bitmap, cliprect, 4, 0, 0); tile->draw(bitmap, cliprect, 2, 0, 0); tile->draw(bitmap, cliprect, 0, 0, 0); - tgp_render(screen->machine(), bitmap, cliprect); + tgp_render(screen.machine(), bitmap, cliprect); tile->draw(bitmap, cliprect, 7, 0, 0); tile->draw(bitmap, cliprect, 5, 0, 0); @@ -1539,7 +1539,7 @@ SCREEN_UPDATE(model1) SCREEN_EOF(model1) { - tgp_scan(machine); - end_frame(machine); + tgp_scan(screen.machine()); + end_frame(screen.machine()); LOG_TGP(("TGP: vsync\n")); } diff --git a/src/mame/video/model2.c b/src/mame/video/model2.c index a39590a38f4..5491e0ba701 100644 --- a/src/mame/video/model2.c +++ b/src/mame/video/model2.c @@ -2746,19 +2746,19 @@ static void convert_bitmap( running_machine &machine, bitmap_t *dst, bitmap_t *s SCREEN_UPDATE(model2) { - model2_state *state = screen->machine().driver_data(); + model2_state *state = screen.machine().driver_data(); logerror("--- frame ---\n"); - bitmap_fill(bitmap, cliprect, screen->machine().pens[0]); + bitmap_fill(bitmap, cliprect, screen.machine().pens[0]); bitmap_fill(state->m_sys24_bitmap, cliprect, 0); - segas24_tile *tile = screen->machine().device("tile"); + segas24_tile *tile = screen.machine().device("tile"); tile->draw(state->m_sys24_bitmap, cliprect, 7, 0, 0); tile->draw(state->m_sys24_bitmap, cliprect, 6, 0, 0); tile->draw(state->m_sys24_bitmap, cliprect, 5, 0, 0); tile->draw(state->m_sys24_bitmap, cliprect, 4, 0, 0); - convert_bitmap(screen->machine(), bitmap, state->m_sys24_bitmap, cliprect); + convert_bitmap(screen.machine(), bitmap, state->m_sys24_bitmap, cliprect); /* tell the rasterizer we're starting a frame */ model2_3d_frame_start(state); @@ -2775,7 +2775,7 @@ SCREEN_UPDATE(model2) tile->draw(state->m_sys24_bitmap, cliprect, 1, 0, 0); tile->draw(state->m_sys24_bitmap, cliprect, 0, 0, 0); - convert_bitmap(screen->machine(), bitmap, state->m_sys24_bitmap, cliprect); + convert_bitmap(screen.machine(), bitmap, state->m_sys24_bitmap, cliprect); return 0; } diff --git a/src/mame/video/model3.c b/src/mame/video/model3.c index fc17433f479..c4a2c3101ee 100644 --- a/src/mame/video/model3.c +++ b/src/mame/video/model3.c @@ -340,7 +340,7 @@ static void copy_screen(running_machine &machine, bitmap_t *bitmap, const rectan SCREEN_UPDATE( model3 ) { - model3_state *state = screen->machine().driver_data(); + model3_state *state = screen.machine().driver_data(); #if 0 int layer_scroll_x[4], layer_scroll_y[4]; UINT32 layer_data[4]; @@ -370,25 +370,25 @@ SCREEN_UPDATE( model3 ) if( state->m_tick >= 5 ) { state->m_tick = 0; - if( screen->machine().input().code_pressed(KEYCODE_Y) ) + if( screen.machine().input().code_pressed(KEYCODE_Y) ) state->m_debug_layer_disable ^= 0x1; - if( screen->machine().input().code_pressed(KEYCODE_U) ) + if( screen.machine().input().code_pressed(KEYCODE_U) ) state->m_debug_layer_disable ^= 0x2; - if( screen->machine().input().code_pressed(KEYCODE_I) ) + if( screen.machine().input().code_pressed(KEYCODE_I) ) state->m_debug_layer_disable ^= 0x4; - if( screen->machine().input().code_pressed(KEYCODE_O) ) + if( screen.machine().input().code_pressed(KEYCODE_O) ) state->m_debug_layer_disable ^= 0x8; - if( screen->machine().input().code_pressed(KEYCODE_T) ) + if( screen.machine().input().code_pressed(KEYCODE_T) ) state->m_debug_layer_disable ^= 0x10; } bitmap_fill(bitmap, cliprect, 0); if (!(state->m_debug_layer_disable & 0x8)) - draw_layer(screen->machine(), bitmap, cliprect, 3, (state->m_layer_enable >> 3) & 0x1); + draw_layer(screen.machine(), bitmap, cliprect, 3, (state->m_layer_enable >> 3) & 0x1); if (!(state->m_debug_layer_disable & 0x4)) - draw_layer(screen->machine(), bitmap, cliprect, 2, (state->m_layer_enable >> 2) & 0x1); + draw_layer(screen.machine(), bitmap, cliprect, 2, (state->m_layer_enable >> 2) & 0x1); if( !(state->m_debug_layer_disable & 0x10) ) { @@ -396,17 +396,17 @@ SCREEN_UPDATE( model3 ) if(state->m_real3d_display_list) { bitmap_fill(state->m_zbuffer, cliprect, 0); bitmap_fill(state->m_bitmap3d, cliprect, 0x8000); - real3d_traverse_display_list(screen->machine()); + real3d_traverse_display_list(screen.machine()); } #endif copybitmap_trans(bitmap, state->m_bitmap3d, 0, 0, 0, 0, cliprect, 0x8000); } if (!(state->m_debug_layer_disable & 0x2)) - draw_layer(screen->machine(), bitmap, cliprect, 1, (state->m_layer_enable >> 1) & 0x1); + draw_layer(screen.machine(), bitmap, cliprect, 1, (state->m_layer_enable >> 1) & 0x1); if (!(state->m_debug_layer_disable & 0x1)) - draw_layer(screen->machine(), bitmap, cliprect, 0, (state->m_layer_enable >> 0) & 0x1); + draw_layer(screen.machine(), bitmap, cliprect, 0, (state->m_layer_enable >> 0) & 0x1); //copy_screen(bitmap, cliprect); diff --git a/src/mame/video/momoko.c b/src/mame/video/momoko.c index cecea557250..465dab666a3 100644 --- a/src/mame/video/momoko.c +++ b/src/mame/video/momoko.c @@ -113,17 +113,17 @@ static void momoko_draw_bg_pri( running_machine &machine, bitmap_t *bitmap, int SCREEN_UPDATE( momoko ) { - momoko_state *state = screen->machine().driver_data(); + momoko_state *state = screen.machine().driver_data(); int x, y, dx, dy, rx, ry, radr, chr, sy, fx, fy, px, py, offs, col, pri, flip ; UINT8 *spriteram = state->m_spriteram; - UINT8 *BG_MAP = screen->machine().region("user1")->base(); - UINT8 *BG_COL_MAP = screen->machine().region("user2")->base(); - UINT8 *FG_MAP = screen->machine().region("user3")->base(); - UINT8 *TEXT_COLOR = screen->machine().region("proms")->base(); + UINT8 *BG_MAP = screen.machine().region("user1")->base(); + UINT8 *BG_COL_MAP = screen.machine().region("user2")->base(); + UINT8 *FG_MAP = screen.machine().region("user3")->base(); + UINT8 *TEXT_COLOR = screen.machine().region("proms")->base(); - flip = state->m_flipscreen ^ (input_port_read(screen->machine(), "FAKE") & 0x01); + flip = state->m_flipscreen ^ (input_port_read(screen.machine(), "FAKE") & 0x01); /* draw BG layer */ dx = (7 - state->m_bg_scrollx[0]) & 7; @@ -153,7 +153,7 @@ SCREEN_UPDATE( momoko ) py = 248 - (8 * y + dy + 9); } - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[1], + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[1], chr, col, flip,flip, @@ -187,7 +187,7 @@ SCREEN_UPDATE( momoko ) py = y + 1; } - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[3], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[3], chr, col, !fx,fy, @@ -221,7 +221,7 @@ SCREEN_UPDATE( momoko ) { col = col & 0x0f; chr = chr + state->m_bg_select * 512; - momoko_draw_bg_pri(screen->machine(), bitmap, chr, col, flip, flip, px, py, pri); + momoko_draw_bg_pri(screen.machine(), bitmap, chr, col, flip, flip, px, py, pri); } } } @@ -249,7 +249,7 @@ SCREEN_UPDATE( momoko ) px = 248 - x; py = y + 1; } - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[3], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[3], chr, col, !fx,fy, @@ -282,7 +282,7 @@ SCREEN_UPDATE( momoko ) px = 248 - x * 8; py = 255 - y; } - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], state->m_videoram[(sy >> 3) * 32 + x] * 8 + dy, col, flip,0, @@ -315,7 +315,7 @@ SCREEN_UPDATE( momoko ) px = 248 - (8 * x + dx - 8); py = 248 - (8 * y + dy + 9); } - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[2], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[2], chr, 0, /* color */ flip,flip, /* flip */ diff --git a/src/mame/video/moo.c b/src/mame/video/moo.c index d8c290a03af..a482cdfba6f 100644 --- a/src/mame/video/moo.c +++ b/src/mame/video/moo.c @@ -65,7 +65,7 @@ VIDEO_START(moo) SCREEN_UPDATE(moo) { - moo_state *state = screen->machine().driver_data(); + moo_state *state = screen.machine().driver_data(); static const int K053251_CI[4] = { K053251_CI1, K053251_CI2, K053251_CI3, K053251_CI4 }; int layers[3]; int new_colorbase, plane, dirty, alpha; @@ -112,7 +112,7 @@ SCREEN_UPDATE(moo) k054338_update_all_shadows(state->m_k054338, 0); k054338_fill_backcolor(state->m_k054338, bitmap, 0); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); if (state->m_layerpri[0] < k053251_get_priority(state->m_k053251, K053251_CI1)) /* bucky hides back layer behind background */ k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, layers[0], 0, 1); diff --git a/src/mame/video/mosaic.c b/src/mame/video/mosaic.c index d5baf511500..4cfc272ce29 100644 --- a/src/mame/video/mosaic.c +++ b/src/mame/video/mosaic.c @@ -82,7 +82,7 @@ WRITE8_HANDLER( mosaic_bgvideoram_w ) SCREEN_UPDATE( mosaic ) { - mosaic_state *state = screen->machine().driver_data(); + mosaic_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); diff --git a/src/mame/video/mouser.c b/src/mame/video/mouser.c index 50d4077df5a..00580c5ad91 100644 --- a/src/mame/video/mouser.c +++ b/src/mame/video/mouser.c @@ -56,7 +56,7 @@ WRITE8_HANDLER( mouser_flip_screen_y_w ) SCREEN_UPDATE( mouser ) { - mouser_state *state = screen->machine().driver_data(); + mouser_state *state = screen.machine().driver_data(); UINT8 *spriteram = state->m_spriteram; int offs; int sx, sy; @@ -71,12 +71,12 @@ SCREEN_UPDATE( mouser ) sx = offs % 32; sy = offs / 32; - if (flip_screen_x_get(screen->machine())) + if (flip_screen_x_get(screen.machine())) { sx = 31 - sx; } - if (flip_screen_y_get(screen->machine())) + if (flip_screen_y_get(screen.machine())) { sy = 31 - sy; } @@ -90,10 +90,10 @@ SCREEN_UPDATE( mouser ) /* Note: this is _not_ dependant on flipping */ color_offs = offs % 32 + ((256 + 8 * (offs / 32) - spriteram[offs % 32] )% 256) / 8 * 32; - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0], state->m_videoram[offs] | (state->m_colorram[color_offs] >> 5) * 256 | ((state->m_colorram[color_offs] >> 4) & 1) * 512, state->m_colorram[color_offs]%16, - flip_screen_x_get(screen->machine()),flip_screen_y_get(screen->machine()), + flip_screen_x_get(screen.machine()),flip_screen_y_get(screen.machine()), 8*sx,scrolled_y_position); } @@ -108,20 +108,20 @@ SCREEN_UPDATE( mouser ) flipx = BIT(spriteram[offs], 6); flipy = BIT(spriteram[offs], 7); - if (flip_screen_x_get(screen->machine())) + if (flip_screen_x_get(screen.machine())) { flipx = !flipx; sx = 240 - sx; } - if (flip_screen_y_get(screen->machine())) + if (flip_screen_y_get(screen.machine())) { flipy = !flipy; sy = 238 - sy; } if (BIT(spriteram[offs + 1], 4)) - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1+((spriteram[offs+1]&0x20)>>5)], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1+((spriteram[offs+1]&0x20)>>5)], spriteram[offs]&0x3f, spriteram[offs+1]%16, flipx,flipy, @@ -137,20 +137,20 @@ SCREEN_UPDATE( mouser ) flipx = BIT(spriteram[offs], 6); flipy = BIT(spriteram[offs], 7); - if (flip_screen_x_get(screen->machine())) + if (flip_screen_x_get(screen.machine())) { flipx = !flipx; sx = 240 - sx; } - if (flip_screen_y_get(screen->machine())) + if (flip_screen_y_get(screen.machine())) { flipy = !flipy; sy = 238 - sy; } if (BIT(spriteram[offs + 1], 4)) - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1+((spriteram[offs+1]&0x20)>>5)], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1+((spriteram[offs+1]&0x20)>>5)], spriteram[offs]&0x3f, spriteram[offs+1]%16, flipx,flipy, diff --git a/src/mame/video/mrdo.c b/src/mame/video/mrdo.c index c5e77d45db1..62566d679cb 100644 --- a/src/mame/video/mrdo.c +++ b/src/mame/video/mrdo.c @@ -263,11 +263,11 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const recta SCREEN_UPDATE( mrdo ) { - mrdo_state *state = screen->machine().driver_data(); + mrdo_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect,0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/mrflea.c b/src/mame/video/mrflea.c index 0d349fdb951..19cc0c130b8 100644 --- a/src/mame/video/mrflea.c +++ b/src/mame/video/mrflea.c @@ -106,7 +106,7 @@ static void draw_background( running_machine &machine, bitmap_t *bitmap, const r SCREEN_UPDATE( mrflea ) { - draw_background(screen->machine(), bitmap, cliprect); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_background(screen.machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/mrjong.c b/src/mame/video/mrjong.c index 58cf62b2108..9cc95d89c97 100644 --- a/src/mame/video/mrjong.c +++ b/src/mame/video/mrjong.c @@ -147,8 +147,8 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( mrjong ) { - mrjong_state *state = screen->machine().driver_data(); + mrjong_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/ms32.c b/src/mame/video/ms32.c index 92ba26f1498..af05f902c09 100644 --- a/src/mame/video/ms32.c +++ b/src/mame/video/ms32.c @@ -360,7 +360,7 @@ static void draw_roz(running_machine &machine, bitmap_t *bitmap, const rectangle SCREEN_UPDATE( ms32 ) { - ms32_state *state = screen->machine().driver_data(); + ms32_state *state = screen.machine().driver_data(); int scrollx,scrolly; int asc_pri; int scr_pri; @@ -377,7 +377,7 @@ SCREEN_UPDATE( ms32 ) int i; for (i = 0;i < 0x10000;i++) // colors 0x3000-0x3fff are not used - update_color(screen->machine(), i); + update_color(screen.machine(), i); scrollx = state->m_tx_scroll[0x00/4] + state->m_tx_scroll[0x08/4] + 0x18; scrolly = state->m_tx_scroll[0x0c/4] + state->m_tx_scroll[0x14/4]; @@ -392,7 +392,7 @@ SCREEN_UPDATE( ms32 ) tilemap_set_scrolly(state->m_bg_tilemap_alt, 0, scrolly); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); @@ -404,7 +404,7 @@ SCREEN_UPDATE( ms32 ) bitmap_fill(state->m_temp_bitmap_sprites,cliprect,0); bitmap_fill(state->m_temp_bitmap_sprites_pri,cliprect,0); - draw_sprites(screen->machine(), state->m_temp_bitmap_sprites, state->m_temp_bitmap_sprites_pri, cliprect, state->m_sprram_16, 0x20000, 0, state->m_reverse_sprite_order); + draw_sprites(screen.machine(), state->m_temp_bitmap_sprites, state->m_temp_bitmap_sprites_pri, cliprect, state->m_sprram_16, 0x20000, 0, state->m_reverse_sprite_order); @@ -427,7 +427,7 @@ SCREEN_UPDATE( ms32 ) rot_pri++; if (rot_pri == 0) - draw_roz(screen->machine(), state->m_temp_bitmap_tilemaps, cliprect, 1 << 1); + draw_roz(screen.machine(), state->m_temp_bitmap_tilemaps, cliprect, 1 << 1); else if (scr_pri == 0) if (state->m_tilemaplayoutcontrol&1) { @@ -441,7 +441,7 @@ SCREEN_UPDATE( ms32 ) tilemap_draw(state->m_temp_bitmap_tilemaps,cliprect, state->m_tx_tilemap, 0, 1 << 2); if (rot_pri == 1) - draw_roz(screen->machine(), state->m_temp_bitmap_tilemaps, cliprect, 1 << 1); + draw_roz(screen.machine(), state->m_temp_bitmap_tilemaps, cliprect, 1 << 1); else if (scr_pri == 1) if (state->m_tilemaplayoutcontrol&1) { @@ -455,7 +455,7 @@ SCREEN_UPDATE( ms32 ) tilemap_draw(state->m_temp_bitmap_tilemaps,cliprect, state->m_tx_tilemap, 0, 1 << 2); if (rot_pri == 2) - draw_roz(screen->machine(), state->m_temp_bitmap_tilemaps, cliprect, 1 << 1); + draw_roz(screen.machine(), state->m_temp_bitmap_tilemaps, cliprect, 1 << 1); else if (scr_pri == 2) if (state->m_tilemaplayoutcontrol&1) { @@ -474,9 +474,9 @@ SCREEN_UPDATE( ms32 ) than are supported here.. I don't know, it will need hw tests I think */ { int xx, yy; - int width = screen->width(); - int height = screen->height(); - const pen_t *paldata = screen->machine().pens; + int width = screen.width(); + int height = screen.height(); + const pen_t *paldata = screen.machine().pens; UINT16* srcptr_tile; UINT8* srcptr_tilepri; @@ -490,7 +490,7 @@ SCREEN_UPDATE( ms32 ) for (yy=0;yym_temp_bitmap_tilemaps, yy, 0); - srcptr_tilepri = BITMAP_ADDR8(screen->machine().priority_bitmap, yy, 0); + srcptr_tilepri = BITMAP_ADDR8(screen.machine().priority_bitmap, yy, 0); srcptr_spri = BITMAP_ADDR16(state->m_temp_bitmap_sprites, yy, 0); //srcptr_spripri = BITMAP_ADDR8(state->m_temp_bitmap_sprites_pri, yy, 0); dstptr_bitmap = BITMAP_ADDR32(bitmap, yy, 0); @@ -579,7 +579,7 @@ SCREEN_UPDATE( ms32 ) } else if (primask == 0xc0) { - dstptr_bitmap[xx] = paldata[screen->machine().rand()&0xfff]; + dstptr_bitmap[xx] = paldata[screen.machine().rand()&0xfff]; } else if (primask == 0xf0) { @@ -663,12 +663,12 @@ SCREEN_UPDATE( ms32 ) } else if (src_tilepri==0x06) { - //dstptr_bitmap[xx] = paldata[screen->machine().rand()&0xfff]; + //dstptr_bitmap[xx] = paldata[screen.machine().rand()&0xfff]; dstptr_bitmap[xx] = paldata[src_tile]; // assumed } else if (src_tilepri==0x07) { - //dstptr_bitmap[xx] = paldata[screen->machine().rand()&0xfff]; + //dstptr_bitmap[xx] = paldata[screen.machine().rand()&0xfff]; dstptr_bitmap[xx] = paldata[src_tile]; // assumed } } diff --git a/src/mame/video/msisaac.c b/src/mame/video/msisaac.c index d2dc0384747..d6c7182ca3e 100644 --- a/src/mame/video/msisaac.c +++ b/src/mame/video/msisaac.c @@ -246,10 +246,10 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( msisaac ) { - msisaac_state *state = screen->machine().driver_data(); + msisaac_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/mugsmash.c b/src/mame/video/mugsmash.c index ecc0ae43622..de6b09553f6 100644 --- a/src/mame/video/mugsmash.c +++ b/src/mame/video/mugsmash.c @@ -153,10 +153,10 @@ VIDEO_START( mugsmash ) SCREEN_UPDATE( mugsmash ) { - mugsmash_state *state = screen->machine().driver_data(); + mugsmash_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_tilemap2, 0, 0); tilemap_draw(bitmap, cliprect, state->m_tilemap1, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/munchmo.c b/src/mame/video/munchmo.c index cfe6784c4f7..438f21b1112 100644 --- a/src/mame/video/munchmo.c +++ b/src/mame/video/munchmo.c @@ -152,8 +152,8 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( mnchmobl ) { - draw_background(screen->machine(), bitmap, cliprect); - draw_sprites(screen->machine(), bitmap, cliprect); - draw_status(screen->machine(), bitmap, cliprect); + draw_background(screen.machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); + draw_status(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/mustache.c b/src/mame/video/mustache.c index 9677697b438..84e8af2a894 100644 --- a/src/mame/video/mustache.c +++ b/src/mame/video/mustache.c @@ -145,8 +145,8 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( mustache ) { - mustache_state *state = screen->machine().driver_data(); + mustache_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/mw8080bw.c b/src/mame/video/mw8080bw.c index c12355ef8c0..68f04e5bf4c 100644 --- a/src/mame/video/mw8080bw.c +++ b/src/mame/video/mw8080bw.c @@ -10,7 +10,7 @@ SCREEN_UPDATE( mw8080bw ) { - mw8080bw_state *state = screen->machine().driver_data(); + mw8080bw_state *state = screen.machine().driver_data(); UINT8 x = 0; UINT8 y = MW8080BW_VCOUNTER_START_NO_VBLANK; UINT8 video_data = 0; @@ -77,7 +77,7 @@ SCREEN_UPDATE( mw8080bw ) SCREEN_UPDATE( spcenctr ) { - mw8080bw_state *state = screen->machine().driver_data(); + mw8080bw_state *state = screen.machine().driver_data(); UINT8 line_buf[256]; /* 256x1 bit RAM */ UINT8 x = 0; @@ -221,7 +221,7 @@ SCREEN_UPDATE( spcenctr ) SCREEN_UPDATE( phantom2 ) { - mw8080bw_state *state = screen->machine().driver_data(); + mw8080bw_state *state = screen.machine().driver_data(); UINT8 x = 0; UINT8 y = MW8080BW_VCOUNTER_START_NO_VBLANK; UINT8 video_data = 0; @@ -229,7 +229,7 @@ SCREEN_UPDATE( phantom2 ) UINT16 cloud_counter = state->m_phantom2_cloud_counter; - UINT8 *cloud_region = screen->machine().region("proms")->base(); + UINT8 *cloud_region = screen.machine().region("proms")->base(); while (1) { @@ -313,7 +313,7 @@ SCREEN_UPDATE( phantom2 ) SCREEN_EOF( phantom2 ) { - mw8080bw_state *state = machine.driver_data(); + mw8080bw_state *state = screen.machine().driver_data(); state->m_phantom2_cloud_counter += MW8080BW_VTOTAL; @@ -333,7 +333,7 @@ SCREEN_EOF( phantom2 ) SCREEN_UPDATE( invaders ) { - mw8080bw_state *state = screen->machine().driver_data(); + mw8080bw_state *state = screen.machine().driver_data(); UINT8 x = 0; UINT8 y = MW8080BW_VCOUNTER_START_NO_VBLANK; UINT8 video_data = 0; diff --git a/src/mame/video/mystston.c b/src/mame/video/mystston.c index 1e56174a611..e0d02c4c03f 100644 --- a/src/mame/video/mystston.c +++ b/src/mame/video/mystston.c @@ -256,18 +256,18 @@ static VIDEO_RESET( mystston ) static SCREEN_UPDATE( mystston ) { - mystston_state *state = screen->machine().driver_data(); + mystston_state *state = screen.machine().driver_data(); - int flip = (*state->m_video_control & 0x80) ^ ((input_port_read(screen->machine(), "DSW1") & 0x20) << 2); + int flip = (*state->m_video_control & 0x80) ^ ((input_port_read(screen.machine(), "DSW1") & 0x20) << 2); - set_palette(screen->machine(), state); + set_palette(screen.machine(), state); - tilemap_mark_all_tiles_dirty_all(screen->machine()); + tilemap_mark_all_tiles_dirty_all(screen.machine()); tilemap_set_scrolly(state->m_bg_tilemap, 0, *state->m_scroll); - tilemap_set_flip_all(screen->machine(), flip ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + tilemap_set_flip_all(screen.machine(), flip ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(bitmap, cliprect, screen->machine().gfx[2], flip); + draw_sprites(bitmap, cliprect, screen.machine().gfx[2], flip); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; diff --git a/src/mame/video/mystwarr.c b/src/mame/video/mystwarr.c index fc0cbcd52e3..fca1b67d93e 100644 --- a/src/mame/video/mystwarr.c +++ b/src/mame/video/mystwarr.c @@ -331,7 +331,7 @@ VIDEO_START(martchmp) SCREEN_UPDATE(mystwarr) { - mystwarr_state *state = screen->machine().driver_data(); + mystwarr_state *state = screen.machine().driver_data(); int i, old, blendmode=0; if (state->m_cbparam<0) state->m_cbparam=0; else if (state->m_cbparam>=32) blendmode=(1<<16|GXMIX_BLEND_FORCE)<<2; //* water hack (TEMPORARY) @@ -345,13 +345,13 @@ SCREEN_UPDATE(mystwarr) state->m_sprite_colorbase = K055555_get_palette_index(4)<<5; - konamigx_mixer(screen->machine(), bitmap, cliprect, 0, 0, 0, 0, blendmode, 0, 0); + konamigx_mixer(screen.machine(), bitmap, cliprect, 0, 0, 0, 0, blendmode, 0, 0); return 0; } SCREEN_UPDATE(metamrph) { - mystwarr_state *state = screen->machine().driver_data(); + mystwarr_state *state = screen.machine().driver_data(); int i, old; for (i = 0; i < 4; i++) @@ -363,13 +363,13 @@ SCREEN_UPDATE(metamrph) state->m_sprite_colorbase = K055555_get_palette_index(4)<<4; - konamigx_mixer(screen->machine(), bitmap, cliprect, 0, GXSUB_K053250 | GXSUB_4BPP, 0, 0, 0, 0, 0); + konamigx_mixer(screen.machine(), bitmap, cliprect, 0, GXSUB_K053250 | GXSUB_4BPP, 0, 0, 0, 0, 0); return 0; } SCREEN_UPDATE(martchmp) { - mystwarr_state *state = screen->machine().driver_data(); + mystwarr_state *state = screen.machine().driver_data(); int i, old, blendmode; for (i = 0; i < 4; i++) @@ -387,7 +387,7 @@ SCREEN_UPDATE(martchmp) // not quite right blendmode = (state->m_oinprion==0xef && K054338_read_register(K338_REG_PBLEND)) ? ((1<<16|GXMIX_BLEND_FORCE)<<2) : 0; - konamigx_mixer(screen->machine(), bitmap, cliprect, 0, 0, 0, 0, blendmode, 0, 0); + konamigx_mixer(screen.machine(), bitmap, cliprect, 0, 0, 0, 0, blendmode, 0, 0); return 0; } @@ -501,7 +501,7 @@ READ16_HANDLER(ddd_053936_tilerom_2_r) SCREEN_UPDATE(dadandrn) /* and gaiapols */ { - mystwarr_state *state = screen->machine().driver_data(); + mystwarr_state *state = screen.machine().driver_data(); int i, newbase, dirty, rozmode; if (state->m_gametype == 0) @@ -553,6 +553,6 @@ SCREEN_UPDATE(dadandrn) /* and gaiapols */ popmessage("K053936: PSAC colorbase changed"); } - konamigx_mixer(screen->machine(), bitmap, cliprect, (state->m_roz_enable) ? state->m_ult_936_tilemap : 0, rozmode, 0, 0, 0, 0, 0); + konamigx_mixer(screen.machine(), bitmap, cliprect, (state->m_roz_enable) ? state->m_ult_936_tilemap : 0, rozmode, 0, 0, 0, 0, 0); return 0; } diff --git a/src/mame/video/n64.c b/src/mame/video/n64.c index d97b3f475a6..8f07f9aab3d 100644 --- a/src/mame/video/n64.c +++ b/src/mame/video/n64.c @@ -182,7 +182,7 @@ void Processor::VideoUpdate16(bitmap_t *bitmap) /* if (gamma_dither) { - dith = screen->machine().rand() & 0x3f; + dith = screen.machine().rand() & 0x3f; } if (gamma) { @@ -3269,7 +3269,7 @@ VIDEO_START(n64) SCREEN_UPDATE(n64) { - _n64_state *state = screen->machine().driver_data<_n64_state>(); + _n64_state *state = screen.machine().driver_data<_n64_state>(); int height = state->m_rdp.GetMiscState()->m_fb_height; //UINT16 *frame_buffer = (UINT16*)&rdram[(n64_vi_origin & 0xffffff) >> 2]; diff --git a/src/mame/video/n8080.c b/src/mame/video/n8080.c index 657afc641b7..76c38c51dd4 100644 --- a/src/mame/video/n8080.c +++ b/src/mame/video/n8080.c @@ -141,14 +141,14 @@ VIDEO_START( helifire ) SCREEN_UPDATE( spacefev ) { - n8080_state *state = screen->machine().driver_data(); - UINT8 mask = flip_screen_get(screen->machine()) ? 0xff : 0x00; + n8080_state *state = screen.machine().driver_data(); + UINT8 mask = flip_screen_get(screen.machine()) ? 0xff : 0x00; int x; int y; const UINT8* pRAM = state->m_videoram; - const UINT8* pPROM = screen->machine().region("proms")->base(); + const UINT8* pPROM = screen.machine().region("proms")->base(); for (y = 0; y < 256; y++) { @@ -183,7 +183,7 @@ SCREEN_UPDATE( spacefev ) 6, /* cyan */ }; - int cycle = screen->frame_number() / 32; + int cycle = screen.frame_number() / 32; color = ufo_color[cycle % 6]; } @@ -211,10 +211,10 @@ SCREEN_UPDATE( spacefev ) SCREEN_UPDATE( sheriff ) { - n8080_state *state = screen->machine().driver_data(); - UINT8 mask = flip_screen_get(screen->machine()) ? 0xff : 0x00; + n8080_state *state = screen.machine().driver_data(); + UINT8 mask = flip_screen_get(screen.machine()) ? 0xff : 0x00; - const UINT8* pPROM = screen->machine().region("proms")->base(); + const UINT8* pPROM = screen.machine().region("proms")->base(); int x; int y; @@ -254,9 +254,9 @@ SCREEN_UPDATE( sheriff ) SCREEN_UPDATE( helifire ) { - n8080_state *state = screen->machine().driver_data(); - int SUN_BRIGHTNESS = input_port_read(screen->machine(), "POT0"); - int SEA_BRIGHTNESS = input_port_read(screen->machine(), "POT1"); + n8080_state *state = screen.machine().driver_data(); + int SUN_BRIGHTNESS = input_port_read(screen.machine(), "POT0"); + int SEA_BRIGHTNESS = input_port_read(screen.machine(), "POT1"); static const int wave[8] = { 0, 1, 2, 2, 2, 1, 0, 0 }; @@ -324,7 +324,7 @@ SCREEN_UPDATE( helifire ) for (n = 0; n < 8; n++) { - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { if ((state->m_videoram[offset ^ 0x1fff] << n) & 0x80) { @@ -343,7 +343,7 @@ SCREEN_UPDATE( helifire ) /* next line */ - helifire_next_line(screen->machine()); + helifire_next_line(screen.machine()); } state->m_helifire_mv = saved_mv; @@ -354,8 +354,8 @@ SCREEN_UPDATE( helifire ) SCREEN_EOF( helifire ) { - n8080_state *state = machine.driver_data(); - int n = (machine.primary_screen->frame_number() >> 1) % sizeof state->m_helifire_LSFR; + n8080_state *state = screen.machine().driver_data(); + int n = (screen.machine().primary_screen->frame_number() >> 1) % sizeof state->m_helifire_LSFR; int i; @@ -372,13 +372,13 @@ SCREEN_EOF( helifire ) G |= B; } - if (machine.primary_screen->frame_number() & 0x04) + if (screen.machine().primary_screen->frame_number() & 0x04) { R |= G; } } - palette_set_color_rgb(machine,i, + palette_set_color_rgb(screen.machine(),i, R ? 255 : 0, G ? 255 : 0, B ? 255 : 0); @@ -386,6 +386,6 @@ SCREEN_EOF( helifire ) for (i = 0; i < 256; i++) { - helifire_next_line(machine); + helifire_next_line(screen.machine()); } } diff --git a/src/mame/video/namcofl.c b/src/mame/video/namcofl.c index 3c93c4189da..499c2e9a1fd 100644 --- a/src/mame/video/namcofl.c +++ b/src/mame/video/namcofl.c @@ -84,16 +84,16 @@ SCREEN_UPDATE( namcofl ) { int pri; - namcofl_install_palette(screen->machine()); + namcofl_install_palette(screen.machine()); - bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine())); + bitmap_fill( bitmap, cliprect , get_black_pen(screen.machine())); for( pri=0; pri<16; pri++ ) { namco_roz_draw( bitmap,cliprect,pri ); if((pri&1)==0) namco_tilemap_draw( bitmap, cliprect, pri>>1 ); - namco_obj_draw(screen->machine(), bitmap, cliprect, pri ); + namco_obj_draw(screen.machine(), bitmap, cliprect, pri ); } return 0; diff --git a/src/mame/video/namcona1.c b/src/mame/video/namcona1.c index 4cc6904371b..411c7481e83 100644 --- a/src/mame/video/namcona1.c +++ b/src/mame/video/namcona1.c @@ -640,7 +640,7 @@ static void draw_background(running_machine &machine, bitmap_t *bitmap, const re SCREEN_UPDATE( namcona1 ) { - namcona1_state *state = screen->machine().driver_data(); + namcona1_state *state = screen.machine().driver_data(); int which; int priority; @@ -653,11 +653,11 @@ SCREEN_UPDATE( namcona1 ) /* palette updates are delayed when graphics are disabled */ for( which=0; which<0x1000; which++ ) { - UpdatePalette(screen->machine(), which ); + UpdatePalette(screen.machine(), which ); } state->m_palette_is_dirty = 0; } - UpdateGfx(screen->machine()); + UpdateGfx(screen.machine()); for( which=0; whichm_vreg[0xb0/2+(which&3)]&0xf; @@ -677,7 +677,7 @@ SCREEN_UPDATE( namcona1 ) } } - bitmap_fill( screen->machine().priority_bitmap,cliprect ,0); + bitmap_fill( screen.machine().priority_bitmap,cliprect ,0); bitmap_fill( bitmap, cliprect , 0xff); /* background color? */ @@ -696,12 +696,12 @@ SCREEN_UPDATE( namcona1 ) } if( pri == priority ) { - draw_background(screen->machine(),bitmap,cliprect,which,priority); + draw_background(screen.machine(),bitmap,cliprect,which,priority); } } /* next tilemap */ } /* next priority level */ - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); } /* gfx enabled */ return 0; } diff --git a/src/mame/video/namconb1.c b/src/mame/video/namconb1.c index 3a74f9b5be2..38b91ebda2f 100644 --- a/src/mame/video/namconb1.c +++ b/src/mame/video/namconb1.c @@ -136,8 +136,8 @@ SCREEN_UPDATE( namconb1 ) /* compute window for custom screen blanking */ rectangle clip; //004a 016a 0021 0101 0144 0020 (nebulas ray) - UINT32 xclip = screen->machine().generic.paletteram.u32[0x1800/4]; - UINT32 yclip = screen->machine().generic.paletteram.u32[0x1804/4]; + UINT32 xclip = screen.machine().generic.paletteram.u32[0x1800/4]; + UINT32 yclip = screen.machine().generic.paletteram.u32[0x1804/4]; clip.min_x = (xclip>>16) - 0x4a; clip.max_x = (xclip&0xffff) - 0x4a - 1; clip.min_y = (yclip>>16) - 0x21; @@ -148,9 +148,9 @@ SCREEN_UPDATE( namconb1 ) if( clip.max_x > cliprect->max_x ){ clip.max_x = cliprect->max_x; } if( clip.max_y > cliprect->max_y ){ clip.max_y = cliprect->max_y; } - bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine())); + bitmap_fill( bitmap, cliprect , get_black_pen(screen.machine())); - video_update_common( screen->machine(), bitmap, &clip, 0 ); + video_update_common( screen.machine(), bitmap, &clip, 0 ); return 0; } @@ -173,12 +173,12 @@ VIDEO_START( namconb1 ) SCREEN_UPDATE( namconb2 ) { - namconb1_state *state = screen->machine().driver_data(); + namconb1_state *state = screen.machine().driver_data(); /* compute window for custom screen blanking */ rectangle clip; //004a016a 00210101 01440020 - UINT32 xclip = screen->machine().generic.paletteram.u32[0x1800/4]; - UINT32 yclip = screen->machine().generic.paletteram.u32[0x1804/4]; + UINT32 xclip = screen.machine().generic.paletteram.u32[0x1800/4]; + UINT32 yclip = screen.machine().generic.paletteram.u32[0x1804/4]; clip.min_x = (xclip>>16) - 0x4b; clip.max_x = (xclip&0xffff) - 0x4b - 1; clip.min_y = (yclip>>16) - 0x21; @@ -189,14 +189,14 @@ SCREEN_UPDATE( namconb2 ) if( clip.max_x > cliprect->max_x ){ clip.max_x = cliprect->max_x; } if( clip.max_y > cliprect->max_y ){ clip.max_y = cliprect->max_y; } - bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine())); + bitmap_fill( bitmap, cliprect , get_black_pen(screen.machine())); if( memcmp(state->m_tilemap_tile_bank,state->m_tilebank32,sizeof(state->m_tilemap_tile_bank))!=0 ) { namco_tilemap_invalidate(); memcpy(state->m_tilemap_tile_bank,state->m_tilebank32,sizeof(state->m_tilemap_tile_bank)); } - video_update_common( screen->machine(), bitmap, &clip, 1 ); + video_update_common( screen.machine(), bitmap, &clip, 1 ); return 0; } diff --git a/src/mame/video/namcos1.c b/src/mame/video/namcos1.c index a68436ca81f..714849fe4cc 100644 --- a/src/mame/video/namcos1.c +++ b/src/mame/video/namcos1.c @@ -372,18 +372,18 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( namcos1 ) { - namcos1_state *state = screen->machine().driver_data(); + namcos1_state *state = screen.machine().driver_data(); int i, j, scrollx, scrolly, priority; rectangle new_clip = *cliprect; /* flip screen is embedded in the sprite control registers */ - /* can't use flip_screen_set(screen->machine(), ) because the visible area is asymmetrical */ - flip_screen_set_no_update(screen->machine(), state->m_spriteram[0x0ff6] & 1); - tilemap_set_flip_all(screen->machine(),flip_screen_get(screen->machine()) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + /* can't use flip_screen_set(screen.machine(), ) because the visible area is asymmetrical */ + flip_screen_set_no_update(screen.machine(), state->m_spriteram[0x0ff6] & 1); + tilemap_set_flip_all(screen.machine(),flip_screen_get(screen.machine()) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); /* background color */ - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); /* berabohm uses asymmetrical visibility windows to iris on the character */ i = ((state->m_cus116[0] << 8) | state->m_cus116[1]) - 1; // min x @@ -411,7 +411,7 @@ SCREEN_UPDATE( namcos1 ) scrollx = ( state->m_playfield_control[j+1] + (state->m_playfield_control[j+0]<<8) ) - disp_x[i]; scrolly = ( state->m_playfield_control[j+3] + (state->m_playfield_control[j+2]<<8) ) + 8; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { scrollx = -scrollx; scrolly = -scrolly; @@ -422,7 +422,7 @@ SCREEN_UPDATE( namcos1 ) } - bitmap_fill(screen->machine().priority_bitmap, &new_clip, 0); + bitmap_fill(screen.machine().priority_bitmap, &new_clip, 0); /* bit 0-2 priority */ /* bit 3 disable */ @@ -435,14 +435,14 @@ SCREEN_UPDATE( namcos1 ) } } - draw_sprites(screen->machine(), bitmap, &new_clip); + draw_sprites(screen.machine(), bitmap, &new_clip); return 0; } SCREEN_EOF( namcos1 ) { - namcos1_state *state = machine.driver_data(); + namcos1_state *state = screen.machine().driver_data(); if (state->m_copy_sprites) { UINT8 *spriteram = state->m_spriteram + 0x800; diff --git a/src/mame/video/namcos2.c b/src/mame/video/namcos2.c index a393f4433c8..e5144489bd1 100644 --- a/src/mame/video/namcos2.c +++ b/src/mame/video/namcos2.c @@ -465,8 +465,8 @@ SCREEN_UPDATE( namcos2_default ) rectangle clip; int pri; - UpdatePalette(screen->machine()); - bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine())); + UpdatePalette(screen.machine()); + bitmap_fill( bitmap, cliprect , get_black_pen(screen.machine())); ApplyClip( &clip, cliprect ); /* HACK: enable ROZ layer only if it has priority > 0 */ @@ -482,7 +482,7 @@ SCREEN_UPDATE( namcos2_default ) { DrawROZ(bitmap,&clip); } - namcos2_draw_sprites(screen->machine(), bitmap, &clip, pri/2, namcos2_gfx_ctrl ); + namcos2_draw_sprites(screen.machine(), bitmap, &clip, pri/2, namcos2_gfx_ctrl ); } } return 0; @@ -502,8 +502,8 @@ SCREEN_UPDATE( finallap ) rectangle clip; int pri; - UpdatePalette(screen->machine()); - bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine())); + UpdatePalette(screen.machine()); + bitmap_fill( bitmap, cliprect , get_black_pen(screen.machine())); ApplyClip( &clip, cliprect ); for( pri=0; pri<16; pri++ ) @@ -512,8 +512,8 @@ SCREEN_UPDATE( finallap ) { namco_tilemap_draw( bitmap, &clip, pri/2 ); } - namco_road_draw(screen->machine(), bitmap,&clip,pri ); - namcos2_draw_sprites(screen->machine(), bitmap,&clip,pri,namcos2_gfx_ctrl ); + namco_road_draw(screen.machine(), bitmap,&clip,pri ); + namcos2_draw_sprites(screen.machine(), bitmap,&clip,pri,namcos2_gfx_ctrl ); } return 0; } @@ -539,8 +539,8 @@ SCREEN_UPDATE( luckywld ) rectangle clip; int pri; - UpdatePalette(screen->machine()); - bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine())); + UpdatePalette(screen.machine()); + bitmap_fill( bitmap, cliprect , get_black_pen(screen.machine())); ApplyClip( &clip, cliprect ); for( pri=0; pri<16; pri++ ) @@ -549,12 +549,12 @@ SCREEN_UPDATE( luckywld ) { namco_tilemap_draw( bitmap, &clip, pri/2 ); } - namco_road_draw(screen->machine(), bitmap,&clip,pri ); + namco_road_draw(screen.machine(), bitmap,&clip,pri ); if( namcos2_gametype==NAMCOS2_LUCKY_AND_WILD ) { namco_roz_draw( bitmap, &clip, pri ); } - namco_obj_draw(screen->machine(), bitmap, &clip, pri ); + namco_obj_draw(screen.machine(), bitmap, &clip, pri ); } return 0; } @@ -572,14 +572,14 @@ SCREEN_UPDATE( sgunner ) rectangle clip; int pri; - UpdatePalette(screen->machine()); - bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine())); + UpdatePalette(screen.machine()); + bitmap_fill( bitmap, cliprect , get_black_pen(screen.machine())); ApplyClip( &clip, cliprect ); for( pri=0; pri<8; pri++ ) { namco_tilemap_draw( bitmap, &clip, pri ); - namco_obj_draw(screen->machine(), bitmap, &clip, pri ); + namco_obj_draw(screen.machine(), bitmap, &clip, pri ); } return 0; } @@ -598,8 +598,8 @@ SCREEN_UPDATE( metlhawk ) rectangle clip; int pri; - UpdatePalette(screen->machine()); - bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine())); + UpdatePalette(screen.machine()); + bitmap_fill( bitmap, cliprect , get_black_pen(screen.machine())); ApplyClip( &clip, cliprect ); for( pri=0; pri<16; pri++ ) @@ -609,7 +609,7 @@ SCREEN_UPDATE( metlhawk ) namco_tilemap_draw( bitmap, &clip, pri/2 ); } namco_roz_draw( bitmap, &clip, pri ); - namcos2_draw_sprites_metalhawk(screen->machine(), bitmap,&clip,pri ); + namcos2_draw_sprites_metalhawk(screen.machine(), bitmap,&clip,pri ); } return 0; } diff --git a/src/mame/video/namcos21.c b/src/mame/video/namcos21.c index e3739b7d062..04afa95a7e3 100644 --- a/src/mame/video/namcos21.c +++ b/src/mame/video/namcos21.c @@ -174,37 +174,37 @@ update_palette( running_machine &machine ) SCREEN_UPDATE( namcos21 ) { - namcos21_state *state = screen->machine().driver_data(); + namcos21_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; int pivot = 3; int pri; - update_palette(screen->machine()); + update_palette(screen.machine()); bitmap_fill( bitmap, cliprect , 0xff); if( namcos2_gametype != NAMCOS21_WINRUN91 ) { /* draw low priority 2d sprites */ - namco_obj_draw(screen->machine(), bitmap, cliprect, 2 ); - namco_obj_draw(screen->machine(), bitmap, cliprect, 14 ); //driver's eyes + namco_obj_draw(screen.machine(), bitmap, cliprect, 2 ); + namco_obj_draw(screen.machine(), bitmap, cliprect, 14 ); //driver's eyes } - CopyVisiblePolyFrameBuffer( screen->machine(), bitmap, cliprect, 0x7fc0, 0x7ffe ); + CopyVisiblePolyFrameBuffer( screen.machine(), bitmap, cliprect, 0x7fc0, 0x7ffe ); if( namcos2_gametype != NAMCOS21_WINRUN91 ) { /* draw low priority 2d sprites */ - namco_obj_draw(screen->machine(), bitmap, cliprect, 0 ); - namco_obj_draw(screen->machine(), bitmap, cliprect, 1 ); + namco_obj_draw(screen.machine(), bitmap, cliprect, 0 ); + namco_obj_draw(screen.machine(), bitmap, cliprect, 1 ); } - CopyVisiblePolyFrameBuffer( screen->machine(), bitmap, cliprect, 0, 0x7fbf ); + CopyVisiblePolyFrameBuffer( screen.machine(), bitmap, cliprect, 0, 0x7fbf ); if( namcos2_gametype != NAMCOS21_WINRUN91 ) { /* draw high priority 2d sprites */ for( pri=pivot; pri<8; pri++ ) { - namco_obj_draw(screen->machine(), bitmap, cliprect, pri ); + namco_obj_draw(screen.machine(), bitmap, cliprect, pri ); } - namco_obj_draw(screen->machine(), bitmap, cliprect, 15 ); //driver's eyes + namco_obj_draw(screen.machine(), bitmap, cliprect, 15 ); //driver's eyes } else { /* winrun bitmap layer */ diff --git a/src/mame/video/namcos22.c b/src/mame/video/namcos22.c index 5062867da6c..c6e2b863e80 100644 --- a/src/mame/video/namcos22.c +++ b/src/mame/video/namcos22.c @@ -2813,11 +2813,11 @@ VIDEO_START( namcos22s ) SCREEN_UPDATE( namcos22s ) { - namcos22_state *state = screen->machine().driver_data(); - UpdateVideoMixer(screen->machine()); - UpdatePalette(screen->machine()); - namcos22s_recalc_czram(screen->machine()); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + namcos22_state *state = screen.machine().driver_data(); + UpdateVideoMixer(screen.machine()); + UpdatePalette(screen.machine()); + namcos22s_recalc_czram(screen.machine()); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); // background color rgbint bg_color; @@ -2832,21 +2832,21 @@ SCREEN_UPDATE( namcos22s ) // layers UINT8 layer = nthbyte(state->m_gamma,0x1f); - if (layer&4) DrawCharacterLayer(screen->machine(), bitmap, cliprect); - if (layer&2) DrawSprites(screen->machine(), bitmap, cliprect); - if (layer&1) DrawPolygons(screen->machine(), bitmap); - RenderScene(screen->machine(), bitmap ); - if (layer&4) namcos22s_mix_textlayer(screen->machine(), bitmap, cliprect, 6); - ApplyGamma(screen->machine(), bitmap); + if (layer&4) DrawCharacterLayer(screen.machine(), bitmap, cliprect); + if (layer&2) DrawSprites(screen.machine(), bitmap, cliprect); + if (layer&1) DrawPolygons(screen.machine(), bitmap); + RenderScene(screen.machine(), bitmap ); + if (layer&4) namcos22s_mix_textlayer(screen.machine(), bitmap, cliprect, 6); + ApplyGamma(screen.machine(), bitmap); // debug stuff #if ALLOW_MEMDUMP - if( screen->machine().input().code_pressed(KEYCODE_D) ) + if( screen.machine().input().code_pressed(KEYCODE_D) ) { FILE *f = fopen( "dump.txt", "wb" ); if( f ) { - address_space *space = screen->machine().device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); if (1) // czram { @@ -2885,7 +2885,7 @@ SCREEN_UPDATE( namcos22s ) //Dump(space, f,0xc00000, 0xc1ffff, "polygonram"); fclose( f ); } - while( screen->machine().input().code_pressed(KEYCODE_D) ){} + while( screen.machine().input().code_pressed(KEYCODE_D) ){} } #endif @@ -2896,22 +2896,22 @@ SCREEN_UPDATE( namcos22s ) SCREEN_UPDATE( namcos22 ) { - UpdateVideoMixer(screen->machine()); - UpdatePalette(screen->machine()); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); - DrawPolygons(screen->machine(), bitmap); - RenderScene(screen->machine(), bitmap); - DrawCharacterLayer(screen->machine(), bitmap, cliprect); - ApplyGamma(screen->machine(), bitmap); + UpdateVideoMixer(screen.machine()); + UpdatePalette(screen.machine()); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); + DrawPolygons(screen.machine(), bitmap); + RenderScene(screen.machine(), bitmap); + DrawCharacterLayer(screen.machine(), bitmap, cliprect); + ApplyGamma(screen.machine(), bitmap); #if ALLOW_MEMDUMP - if( screen->machine().input().code_pressed(KEYCODE_D) ) + if( screen.machine().input().code_pressed(KEYCODE_D) ) { FILE *f = fopen( "dump.txt", "wb" ); if( f ) { - address_space *space = screen->machine().device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); //Dump(space, f,0x90000000, 0x90000003, "led?" ); Dump(space, f,0x90010000, 0x90017fff, "cz_ram"); @@ -2920,7 +2920,7 @@ SCREEN_UPDATE( namcos22 ) //Dump(space, f,0x70000000, 0x7001ffff, "polygonram"); fclose( f ); } - while( screen->machine().input().code_pressed(KEYCODE_D) ){} + while( screen.machine().input().code_pressed(KEYCODE_D) ){} } #endif diff --git a/src/mame/video/namcos86.c b/src/mame/video/namcos86.c index d1929a0cff2..efc32c6c0c2 100644 --- a/src/mame/video/namcos86.c +++ b/src/mame/video/namcos86.c @@ -364,21 +364,21 @@ static void set_scroll(running_machine &machine, int layer) SCREEN_UPDATE( namcos86 ) { - namcos86_state *state = screen->machine().driver_data(); + namcos86_state *state = screen.machine().driver_data(); int layer; /* flip screen is embedded in the sprite control registers */ - /* can't use flip_screen_set(screen->machine(), ) because the visible area is asymmetrical */ - flip_screen_set_no_update(screen->machine(), state->m_spriteram[0x07f6] & 1); - tilemap_set_flip_all(screen->machine(),flip_screen_get(screen->machine()) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); - set_scroll(screen->machine(), 0); - set_scroll(screen->machine(), 1); - set_scroll(screen->machine(), 2); - set_scroll(screen->machine(), 3); + /* can't use flip_screen_set(screen.machine(), ) because the visible area is asymmetrical */ + flip_screen_set_no_update(screen.machine(), state->m_spriteram[0x07f6] & 1); + tilemap_set_flip_all(screen.machine(),flip_screen_get(screen.machine()) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + set_scroll(screen.machine(), 0); + set_scroll(screen.machine(), 1); + set_scroll(screen.machine(), 2); + set_scroll(screen.machine(), 3); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); - bitmap_fill(bitmap,cliprect,screen->machine().gfx[0]->color_base + 8*state->m_backcolor+7); + bitmap_fill(bitmap,cliprect,screen.machine().gfx[0]->color_base + 8*state->m_backcolor+7); for (layer = 0;layer < 8;layer++) { @@ -391,14 +391,14 @@ SCREEN_UPDATE( namcos86 ) } } - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); return 0; } SCREEN_EOF( namcos86 ) { - namcos86_state *state = machine.driver_data(); + namcos86_state *state = screen.machine().driver_data(); if (state->m_copy_sprites) { UINT8 *spriteram = state->m_spriteram; diff --git a/src/mame/video/naughtyb.c b/src/mame/video/naughtyb.c index 18ebd8fcb98..c6df6c4a68e 100644 --- a/src/mame/video/naughtyb.c +++ b/src/mame/video/naughtyb.c @@ -202,7 +202,7 @@ WRITE8_HANDLER( popflame_videoreg_w ) ***************************************************************************/ SCREEN_UPDATE( naughtyb ) { - naughtyb_state *state = screen->machine().driver_data(); + naughtyb_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; int offs; @@ -239,13 +239,13 @@ SCREEN_UPDATE( naughtyb ) } } - drawgfx_opaque(screen->machine().generic.tmpbitmap,0,screen->machine().gfx[0], + drawgfx_opaque(screen.machine().generic.tmpbitmap,0,screen.machine().gfx[0], state->m_videoram2[offs] + 256 * state->m_bankreg, (state->m_videoram2[offs] >> 5) + 8 * state->m_palreg, state->m_cocktail,state->m_cocktail, 8*sx,8*sy); - drawgfx_transpen(screen->machine().generic.tmpbitmap,0,screen->machine().gfx[1], + drawgfx_transpen(screen.machine().generic.tmpbitmap,0,screen.machine().gfx[1], videoram[offs] + 256*state->m_bankreg, (videoram[offs] >> 5) + 8 * state->m_palreg, state->m_cocktail,state->m_cocktail, @@ -256,11 +256,11 @@ SCREEN_UPDATE( naughtyb ) { int scrollx; - copybitmap(bitmap,screen->machine().generic.tmpbitmap,0,0,-66*8,0,&leftvisiblearea); - copybitmap(bitmap,screen->machine().generic.tmpbitmap,0,0,-30*8,0,&rightvisiblearea); + copybitmap(bitmap,screen.machine().generic.tmpbitmap,0,0,-66*8,0,&leftvisiblearea); + copybitmap(bitmap,screen.machine().generic.tmpbitmap,0,0,-30*8,0,&rightvisiblearea); scrollx = ( state->m_cocktail ) ? *state->m_scrollreg - 239 : -*state->m_scrollreg + 16; - copyscrollbitmap(bitmap,screen->machine().generic.tmpbitmap,1,&scrollx,0,0,&scrollvisiblearea); + copyscrollbitmap(bitmap,screen.machine().generic.tmpbitmap,1,&scrollx,0,0,&scrollvisiblearea); } return 0; } diff --git a/src/mame/video/nbmj8688.c b/src/mame/video/nbmj8688.c index 51f457bce1d..3ce5f347dfe 100644 --- a/src/mame/video/nbmj8688.c +++ b/src/mame/video/nbmj8688.c @@ -678,7 +678,7 @@ WRITE8_HANDLER( nbmj8688_HD61830B_both_data_w ) SCREEN_UPDATE( mbmj8688 ) { - nbmj8688_state *state = screen->machine().driver_data(); + nbmj8688_state *state = screen.machine().driver_data(); int x, y; if (state->m_mjsikaku_screen_refresh) @@ -712,7 +712,7 @@ SCREEN_UPDATE( mbmj8688 ) SCREEN_UPDATE( mbmj8688_lcd0 ) { - nbmj8688_state *state = screen->machine().driver_data(); + nbmj8688_state *state = screen.machine().driver_data(); int x, y, b; for (y = 0;y < 64;y++) @@ -728,7 +728,7 @@ SCREEN_UPDATE( mbmj8688_lcd0 ) SCREEN_UPDATE( mbmj8688_lcd1 ) { - nbmj8688_state *state = screen->machine().driver_data(); + nbmj8688_state *state = screen.machine().driver_data(); int x, y, b; for (y = 0;y < 64;y++) diff --git a/src/mame/video/nbmj8891.c b/src/mame/video/nbmj8891.c index a68b09c0728..44e1af5d66e 100644 --- a/src/mame/video/nbmj8891.c +++ b/src/mame/video/nbmj8891.c @@ -533,23 +533,23 @@ VIDEO_START( nbmj8891_2layer ) ******************************************************************************/ SCREEN_UPDATE( nbmj8891 ) { - nbmj8891_state *state = screen->machine().driver_data(); + nbmj8891_state *state = screen.machine().driver_data(); int x, y; if (state->m_screen_refresh) { - int width = screen->width(); - int height = screen->height(); + int width = screen.width(); + int height = screen.height(); state->m_screen_refresh = 0; for (y = 0; y < height; y++) for (x = 0; x < width; x++) - update_pixel0(screen->machine(), x, y); + update_pixel0(screen.machine(), x, y); if (state->m_gfxdraw_mode) for (y = 0; y < height; y++) for (x = 0; x < width; x++) - update_pixel1(screen->machine(), x, y); + update_pixel1(screen.machine(), x, y); } if (state->m_dispflag) diff --git a/src/mame/video/nbmj8900.c b/src/mame/video/nbmj8900.c index 29d03216574..2191b589ee6 100644 --- a/src/mame/video/nbmj8900.c +++ b/src/mame/video/nbmj8900.c @@ -401,7 +401,7 @@ VIDEO_START( nbmj8900_2layer ) ******************************************************************************/ SCREEN_UPDATE( nbmj8900 ) { - nbmj8900_state *state = screen->machine().driver_data(); + nbmj8900_state *state = screen.machine().driver_data(); int x, y; if (state->m_screen_refresh) @@ -411,7 +411,7 @@ SCREEN_UPDATE( nbmj8900 ) { for (x = 0; x < state->m_screen_width; x++) { - update_pixel0(screen->machine(), x, y); + update_pixel0(screen.machine(), x, y); } } if (state->m_gfxdraw_mode) @@ -420,7 +420,7 @@ SCREEN_UPDATE( nbmj8900 ) { for (x = 0; x < state->m_screen_width; x++) { - update_pixel1(screen->machine(), x, y); + update_pixel1(screen.machine(), x, y); } } } diff --git a/src/mame/video/nbmj8991.c b/src/mame/video/nbmj8991.c index 8fa2b591a13..5b89afb5276 100644 --- a/src/mame/video/nbmj8991.c +++ b/src/mame/video/nbmj8991.c @@ -304,19 +304,19 @@ VIDEO_START( nbmj8991 ) SCREEN_UPDATE( nbmj8991_type1 ) { - nbmj8991_state *state = screen->machine().driver_data(); + nbmj8991_state *state = screen.machine().driver_data(); int x, y; if (state->m_screen_refresh) { - int width = screen->machine().primary_screen->width(); - int height = screen->machine().primary_screen->height(); + int width = screen.machine().primary_screen->width(); + int height = screen.machine().primary_screen->height(); state->m_screen_refresh = 0; for (y = 0; y < height; y++) for (x = 0; x < width; x++) - update_pixel(screen->machine(), x, y); + update_pixel(screen.machine(), x, y); } if (state->m_dispflag) @@ -344,19 +344,19 @@ SCREEN_UPDATE( nbmj8991_type1 ) SCREEN_UPDATE( nbmj8991_type2 ) { - nbmj8991_state *state = screen->machine().driver_data(); + nbmj8991_state *state = screen.machine().driver_data(); int x, y; if (state->m_screen_refresh) { - int width = screen->width(); - int height = screen->height(); + int width = screen.width(); + int height = screen.height(); state->m_screen_refresh = 0; for (y = 0; y < height; y++) for (x = 0; x < width; x++) - update_pixel(screen->machine(), x, y); + update_pixel(screen.machine(), x, y); } if (nb1413m3_inputport & 0x20) diff --git a/src/mame/video/nbmj9195.c b/src/mame/video/nbmj9195.c index 6ca0cf2e0d5..f40d9c962cb 100644 --- a/src/mame/video/nbmj9195.c +++ b/src/mame/video/nbmj9195.c @@ -447,25 +447,25 @@ VIDEO_START( nbmj9195_nb22090 ) ******************************************************************************/ SCREEN_UPDATE( nbmj9195 ) { - nbmj9195_state *state = screen->machine().driver_data(); + nbmj9195_state *state = screen.machine().driver_data(); int i; int x, y; int scrolly[2]; if (state->m_screen_refresh) { - int width = screen->width(); - int height = screen->height(); + int width = screen.width(); + int height = screen.height(); state->m_screen_refresh = 0; for (y = 0; y < height; y++) for (x = 0; x < width; x++) { - update_pixel(screen->machine(), 0, x, y); + update_pixel(screen.machine(), 0, x, y); if (state->m_gfxdraw_mode) - update_pixel(screen->machine(), 1, x, y); + update_pixel(screen.machine(), 1, x, y); } } diff --git a/src/mame/video/nemesis.c b/src/mame/video/nemesis.c index 18b1da6235d..ec488c03482 100644 --- a/src/mame/video/nemesis.c +++ b/src/mame/video/nemesis.c @@ -427,11 +427,11 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( nemesis ) { - nemesis_state *state = screen->machine().driver_data(); + nemesis_state *state = screen.machine().driver_data(); int offs; rectangle clip; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); clip.min_x = 0; @@ -476,7 +476,7 @@ SCREEN_UPDATE( nemesis ) } } - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); return 0; } diff --git a/src/mame/video/neogeo.c b/src/mame/video/neogeo.c index 8d05b45277f..60182d7c387 100644 --- a/src/mame/video/neogeo.c +++ b/src/mame/video/neogeo.c @@ -922,14 +922,14 @@ VIDEO_RESET( neogeo ) SCREEN_UPDATE( neogeo ) { - neogeo_state *state = screen->machine().driver_data(); + neogeo_state *state = screen.machine().driver_data(); /* fill with background color first */ bitmap_fill(bitmap, cliprect, state->m_pens[0x0fff]); - draw_sprites(screen->machine(), bitmap, cliprect->min_y); + draw_sprites(screen.machine(), bitmap, cliprect->min_y); - draw_fixed_layer(screen->machine(), bitmap, cliprect->min_y); + draw_fixed_layer(screen.machine(), bitmap, cliprect->min_y); return 0; } diff --git a/src/mame/video/news.c b/src/mame/video/news.c index 5713d49b1a6..e8ad749ac62 100644 --- a/src/mame/video/news.c +++ b/src/mame/video/news.c @@ -99,7 +99,7 @@ WRITE8_HANDLER( news_bgpic_w ) SCREEN_UPDATE( news ) { - news_state *state = screen->machine().driver_data(); + news_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; diff --git a/src/mame/video/ninjakd2.c b/src/mame/video/ninjakd2.c index a5a6008b1da..02c2173295a 100644 --- a/src/mame/video/ninjakd2.c +++ b/src/mame/video/ninjakd2.c @@ -486,10 +486,10 @@ static void update_sprites(running_machine& machine) SCREEN_UPDATE( ninjakd2 ) { - ninjakd2_state *state = screen->machine().driver_data(); + ninjakd2_state *state = screen.machine().driver_data(); // updating sprites here instead than in screen_eof avoids a palette glitch // at the end of the "rainbow sky" screens. - update_sprites(screen->machine()); + update_sprites(screen.machine()); state->m_sprites_updated = 1; bitmap_fill(bitmap, cliprect, 0); @@ -505,8 +505,8 @@ SCREEN_UPDATE( ninjakd2 ) SCREEN_UPDATE( robokid ) { - ninjakd2_state *state = screen->machine().driver_data(); - update_sprites(screen->machine()); + ninjakd2_state *state = screen.machine().driver_data(); + update_sprites(screen.machine()); state->m_sprites_updated = 1; bitmap_fill(bitmap, cliprect, 0); @@ -526,8 +526,8 @@ SCREEN_UPDATE( robokid ) SCREEN_UPDATE( omegaf ) { - ninjakd2_state *state = screen->machine().driver_data(); - update_sprites(screen->machine()); + ninjakd2_state *state = screen.machine().driver_data(); + update_sprites(screen.machine()); state->m_sprites_updated = 1; bitmap_fill(bitmap, cliprect, 0); @@ -548,9 +548,9 @@ SCREEN_UPDATE( omegaf ) SCREEN_EOF( ninjakd2 ) { - ninjakd2_state *state = machine.driver_data(); + ninjakd2_state *state = screen.machine().driver_data(); if (!state->m_sprites_updated) - update_sprites(machine); + update_sprites(screen.machine()); state->m_sprites_updated = 0; } diff --git a/src/mame/video/ninjaw.c b/src/mame/video/ninjaw.c index bbf1e4420f1..3332326bb2f 100644 --- a/src/mame/video/ninjaw.c +++ b/src/mame/video/ninjaw.c @@ -97,28 +97,9 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN REFRESH **************************************************************/ -SCREEN_UPDATE( ninjaw ) +static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int xoffs, device_t *tc0100scn) { - ninjaw_state *state = screen->machine().driver_data(); - int xoffs = 0; UINT8 layer[3], nodraw; - device_t *tc0100scn = NULL; - - if (screen == state->m_lscreen) - { - xoffs = 36 * 8 * 0; - tc0100scn = state->m_tc0100scn_1; - } - else if (screen == state->m_mscreen) - { - xoffs = 36 * 8 * 1; - tc0100scn = state->m_tc0100scn_2; - } - else if (screen == state->m_rscreen) - { - xoffs = 36 * 8 * 2; - tc0100scn = state->m_tc0100scn_3; - } tc0100scn_tilemap_update(tc0100scn); @@ -132,17 +113,21 @@ SCREEN_UPDATE( ninjaw ) /* Ensure screen blanked even when bottom layers not drawn due to disable bit */ if (nodraw) - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); /* Sprites can be under/over the layer below text layer */ - draw_sprites(screen->machine(), bitmap, cliprect, 1, xoffs, 8); // draw sprites with priority 1 which are under the mid layer + draw_sprites(screen.machine(), bitmap, cliprect, 1, xoffs, 8); // draw sprites with priority 1 which are under the mid layer // draw middle layer tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[1], 0, 0); - draw_sprites(screen->machine(),bitmap,cliprect,0,xoffs,8); // draw sprites with priority 0 which are over the mid layer + draw_sprites(screen.machine(),bitmap,cliprect,0,xoffs,8); // draw sprites with priority 0 which are over the mid layer // draw top(text) layer tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[2], 0, 0); return 0; } + +SCREEN_UPDATE( ninjaw_left ) { return update_screen(screen, bitmap, cliprect, 36 * 8 * 0, screen.machine().driver_data()->m_tc0100scn_1); } +SCREEN_UPDATE( ninjaw_middle ) { return update_screen(screen, bitmap, cliprect, 36 * 8 * 1, screen.machine().driver_data()->m_tc0100scn_2); } +SCREEN_UPDATE( ninjaw_right ) { return update_screen(screen, bitmap, cliprect, 36 * 8 * 2, screen.machine().driver_data()->m_tc0100scn_3); } diff --git a/src/mame/video/nitedrvr.c b/src/mame/video/nitedrvr.c index 6497f4338a6..33bee5fc717 100644 --- a/src/mame/video/nitedrvr.c +++ b/src/mame/video/nitedrvr.c @@ -75,9 +75,9 @@ static void draw_roadway( running_machine &machine, bitmap_t *bitmap ) SCREEN_UPDATE( nitedrvr ) { - nitedrvr_state *state = screen->machine().driver_data(); + nitedrvr_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_roadway(screen->machine(), bitmap); + draw_roadway(screen.machine(), bitmap); return 0; } diff --git a/src/mame/video/niyanpai.c b/src/mame/video/niyanpai.c index 3315f6b0c4f..dd567b8b1a5 100644 --- a/src/mame/video/niyanpai.c +++ b/src/mame/video/niyanpai.c @@ -387,24 +387,24 @@ VIDEO_START( niyanpai ) ******************************************************************************/ SCREEN_UPDATE( niyanpai ) { - niyanpai_state *state = screen->machine().driver_data(); + niyanpai_state *state = screen.machine().driver_data(); int i; int x, y; int scrollx[3], scrolly[3]; if (state->m_screen_refresh) { - int width = screen->width(); - int height = screen->height(); + int width = screen.width(); + int height = screen.height(); state->m_screen_refresh = 0; for (y = 0; y < height; y++) for (x = 0; x < width; x++) { - update_pixel(screen->machine(), 0, x, y); - update_pixel(screen->machine(), 1, x, y); - update_pixel(screen->machine(), 2, x, y); + update_pixel(screen.machine(), 0, x, y); + update_pixel(screen.machine(), 1, x, y); + update_pixel(screen.machine(), 2, x, y); } } diff --git a/src/mame/video/nmk16.c b/src/mame/video/nmk16.c index 34aa133389e..5fb9543efd7 100644 --- a/src/mame/video/nmk16.c +++ b/src/mame/video/nmk16.c @@ -542,15 +542,15 @@ static void nmk16_draw_sprites_flipsupported(running_machine &machine, bitmap_t SCREEN_UPDATE( macross ) { - nmk16_state *state = screen->machine().driver_data(); + nmk16_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_tx_tilemap,0,-state->m_videoshift); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap0,0,0); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,3); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,2); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,1); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,0); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,3); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,2); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,1); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); return 0; @@ -558,17 +558,17 @@ SCREEN_UPDATE( macross ) SCREEN_UPDATE( tdragon ) { - nmk16_state *state = screen->machine().driver_data(); -// mcu_run(screen->machine(), 1); + nmk16_state *state = screen.machine().driver_data(); +// mcu_run(screen.machine(), 1); tilemap_set_scrollx(state->m_tx_tilemap,0,-state->m_videoshift); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap0,0,0); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,3); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,2); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,1); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,0); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,3); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,2); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,1); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); return 0; @@ -576,17 +576,17 @@ SCREEN_UPDATE( tdragon ) SCREEN_UPDATE( hachamf ) { - nmk16_state *state = screen->machine().driver_data(); -// mcu_run(screen->machine(), 0); + nmk16_state *state = screen.machine().driver_data(); +// mcu_run(screen.machine(), 0); tilemap_set_scrollx(state->m_tx_tilemap,0,-state->m_videoshift); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap0,0,0); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,3); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,2); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,1); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,0); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,3); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,2); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,1); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); return 0; @@ -594,15 +594,15 @@ SCREEN_UPDATE( hachamf ) SCREEN_UPDATE( manybloc ) { - nmk16_state *state = screen->machine().driver_data(); + nmk16_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_tx_tilemap,0,-state->m_videoshift); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap0,0,0); - nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,3); - nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,2); - nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,1); - nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,0); + nmk16_draw_sprites_flipsupported(screen.machine(), bitmap,cliprect,3); + nmk16_draw_sprites_flipsupported(screen.machine(), bitmap,cliprect,2); + nmk16_draw_sprites_flipsupported(screen.machine(), bitmap,cliprect,1); + nmk16_draw_sprites_flipsupported(screen.machine(), bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); return 0; @@ -610,7 +610,7 @@ SCREEN_UPDATE( manybloc ) SCREEN_UPDATE( tharrier ) { - nmk16_state *state = screen->machine().driver_data(); + nmk16_state *state = screen.machine().driver_data(); /* I think the protection device probably copies this to the regs... */ UINT16 tharrier_scroll = state->m_mainram[0x9f00/2]; @@ -618,10 +618,10 @@ SCREEN_UPDATE( tharrier ) tilemap_set_scrollx(state->m_bg_tilemap0,0,tharrier_scroll); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap0,0,0); - nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,3); - nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,2); - nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,1); - nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,0); + nmk16_draw_sprites_flipsupported(screen.machine(), bitmap,cliprect,3); + nmk16_draw_sprites_flipsupported(screen.machine(), bitmap,cliprect,2); + nmk16_draw_sprites_flipsupported(screen.machine(), bitmap,cliprect,1); + nmk16_draw_sprites_flipsupported(screen.machine(), bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); return 0; @@ -629,7 +629,7 @@ SCREEN_UPDATE( tharrier ) SCREEN_UPDATE( gunnail ) { - nmk16_state *state = screen->machine().driver_data(); + nmk16_state *state = screen.machine().driver_data(); int y1; int i=16; rectangle bgclip = *cliprect; @@ -696,10 +696,10 @@ SCREEN_UPDATE( gunnail ) tilemap_draw(bitmap,cliprect,bg_tilemap,0,0); } - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,3); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,2); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,1); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,0); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,3); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,2); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,1); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,0); tilemap_set_scrollx(state->m_tx_tilemap,0,-state->m_videoshift); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); @@ -708,8 +708,8 @@ SCREEN_UPDATE( gunnail ) SCREEN_UPDATE( bioship ) { - nmk16_state *state = screen->machine().driver_data(); - UINT16 *tilerom = (UINT16 *)screen->machine().region("gfx5")->base(); + nmk16_state *state = screen.machine().driver_data(); + UINT16 *tilerom = (UINT16 *)screen.machine().region("gfx5")->base(); int scrollx=-(state->m_bioship_scroll[1] + state->m_bioship_scroll[0]*256); int scrolly=-(state->m_bioship_scroll[3] + state->m_bioship_scroll[2]*256); @@ -727,7 +727,7 @@ SCREEN_UPDATE( bioship ) int numtile = data&0xfff; int color = (data&0xf000)>>12; - drawgfx_opaque(state->m_background_bitmap,0,screen->machine().gfx[3], + drawgfx_opaque(state->m_background_bitmap,0,screen.machine().gfx[3], numtile, color, 0,0, /* no flip */ @@ -736,7 +736,7 @@ SCREEN_UPDATE( bioship ) data = tilerom[offs+0x1000+bank]; numtile = data&0xfff; color = (data&0xf000)>>12; - drawgfx_opaque(state->m_background_bitmap,0,screen->machine().gfx[3], + drawgfx_opaque(state->m_background_bitmap,0,screen.machine().gfx[3], numtile, color, 0,0, /* no flip */ @@ -750,10 +750,10 @@ SCREEN_UPDATE( bioship ) copyscrollbitmap(bitmap,state->m_background_bitmap,1,&scrollx,1,&scrolly,cliprect); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap0,0,0); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,3); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,2); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,1); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,0); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,3); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,2); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,1); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); return 0; @@ -761,16 +761,16 @@ SCREEN_UPDATE( bioship ) SCREEN_UPDATE( strahl ) { - nmk16_state *state = screen->machine().driver_data(); + nmk16_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_tx_tilemap,0,-state->m_videoshift); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap0,0,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,3); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,2); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,1); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,0); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,3); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,2); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,1); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); return 0; @@ -778,22 +778,22 @@ SCREEN_UPDATE( strahl ) SCREEN_UPDATE( bjtwin ) { - nmk16_state *state = screen->machine().driver_data(); + nmk16_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap0,0,-state->m_videoshift); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap0,0,0); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,3); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,2); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,1); - nmk16_draw_sprites(screen->machine(), bitmap,cliprect,0); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,3); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,2); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,1); + nmk16_draw_sprites(screen.machine(), bitmap,cliprect,0); return 0; } SCREEN_EOF( nmk ) { - nmk16_state *state = machine.driver_data(); + nmk16_state *state = screen.machine().driver_data(); /* sprites are DMA'd from Main RAM to a private buffer automatically (or at least this is how I interpret the datasheet) */ @@ -806,7 +806,7 @@ SCREEN_EOF( nmk ) SCREEN_EOF( strahl ) { - nmk16_state *state = machine.driver_data(); + nmk16_state *state = screen.machine().driver_data(); /* sprites are DMA'd from Main RAM to a private buffer automatically (or at least this is how I interpret the datasheet) */ @@ -949,23 +949,23 @@ static void redhawki_video_update(running_machine &machine, bitmap_t *bitmap, co nmk16_draw_sprites_flipsupported(machine, bitmap,cliprect,0); } -SCREEN_UPDATE( afega ) { video_update(screen->machine(),bitmap,cliprect, 1, -0x100,+0x000, 0x0001); return 0; } -SCREEN_UPDATE( bubl2000 ) { video_update(screen->machine(),bitmap,cliprect, 0, -0x100,+0x000, 0x0001); return 0; } // no flipscreen support, I really would confirmation from the schematics -SCREEN_UPDATE( redhawkb ) { video_update(screen->machine(),bitmap,cliprect, 0, +0x000,+0x100, 0x0001); return 0; } -SCREEN_UPDATE( redhawki ) { redhawki_video_update(screen->machine(),bitmap,cliprect); return 0;} // strange scroll regs +SCREEN_UPDATE( afega ) { video_update(screen.machine(),bitmap,cliprect, 1, -0x100,+0x000, 0x0001); return 0; } +SCREEN_UPDATE( bubl2000 ) { video_update(screen.machine(),bitmap,cliprect, 0, -0x100,+0x000, 0x0001); return 0; } // no flipscreen support, I really would confirmation from the schematics +SCREEN_UPDATE( redhawkb ) { video_update(screen.machine(),bitmap,cliprect, 0, +0x000,+0x100, 0x0001); return 0; } +SCREEN_UPDATE( redhawki ) { redhawki_video_update(screen.machine(),bitmap,cliprect); return 0;} // strange scroll regs SCREEN_UPDATE( firehawk ) { - nmk16_state *state = screen->machine().driver_data(); + nmk16_state *state = screen.machine().driver_data(); tilemap_set_scrolly(state->m_bg_tilemap0, 0, state->m_afega_scroll_1[1] + 0x100); tilemap_set_scrollx(state->m_bg_tilemap0, 0, state->m_afega_scroll_1[0]); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap0,0,0); - nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,3); - nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,2); - nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,1); - nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,0); + nmk16_draw_sprites_flipsupported(screen.machine(), bitmap,cliprect,3); + nmk16_draw_sprites_flipsupported(screen.machine(), bitmap,cliprect,2); + nmk16_draw_sprites_flipsupported(screen.machine(), bitmap,cliprect,1); + nmk16_draw_sprites_flipsupported(screen.machine(), bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); return 0; diff --git a/src/mame/video/nova2001.c b/src/mame/video/nova2001.c index 81a094b7de3..de7001a0a66 100644 --- a/src/mame/video/nova2001.c +++ b/src/mame/video/nova2001.c @@ -357,10 +357,10 @@ static void pkunwar_draw_sprites(running_machine &machine, bitmap_t *bitmap, con SCREEN_UPDATE( nova2001 ) { - nova2001_state *state = screen->machine().driver_data(); + nova2001_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - nova2001_draw_sprites(screen->machine(), bitmap, cliprect); + nova2001_draw_sprites(screen.machine(), bitmap, cliprect); // according to the schematics, fg category 0 should be drawn behind sprites, // but it doesn't look right that way @@ -372,10 +372,10 @@ SCREEN_UPDATE( nova2001 ) SCREEN_UPDATE( pkunwar ) { - nova2001_state *state = screen->machine().driver_data(); + nova2001_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0); - pkunwar_draw_sprites(screen->machine(), bitmap, cliprect); + pkunwar_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 1, 0); @@ -384,12 +384,12 @@ SCREEN_UPDATE( pkunwar ) SCREEN_UPDATE( ninjakun ) { - nova2001_state *state = screen->machine().driver_data(); + nova2001_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 1, 0); - nova2001_draw_sprites(screen->machine(), bitmap, cliprect); + nova2001_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); @@ -398,10 +398,10 @@ SCREEN_UPDATE( ninjakun ) SCREEN_UPDATE( raiders5 ) { - nova2001_state *state = screen->machine().driver_data(); + nova2001_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - pkunwar_draw_sprites(screen->machine(), bitmap, cliprect); + pkunwar_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); diff --git a/src/mame/video/nycaptor.c b/src/mame/video/nycaptor.c index 95f7b437593..7100bcf412f 100644 --- a/src/mame/video/nycaptor.c +++ b/src/mame/video/nycaptor.c @@ -251,10 +251,10 @@ static void nycaptor_setmask( running_machine &machine ) SCREEN_UPDATE( nycaptor ) { - nycaptor_state *state = screen->machine().driver_data(); + nycaptor_state *state = screen.machine().driver_data(); #if NYCAPTOR_DEBUG - nycaptor_setmask(screen->machine()); + nycaptor_setmask(screen.machine()); if (state->m_mask & 0x1000) { tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1 | 3, 0); @@ -265,46 +265,46 @@ SCREEN_UPDATE( nycaptor ) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0 | 1, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1 | 0, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0 | 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 1); - draw_sprites(screen->machine(), bitmap, cliprect, 2); - draw_sprites(screen->machine(), bitmap, cliprect, 3); - draw_sprites(screen->machine(), bitmap, cliprect, 4); - draw_sprites(screen->machine(), bitmap, cliprect, 5); - draw_sprites(screen->machine(), bitmap, cliprect, 6); - draw_sprites(screen->machine(), bitmap, cliprect, 7); + draw_sprites(screen.machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 2); + draw_sprites(screen.machine(), bitmap, cliprect, 3); + draw_sprites(screen.machine(), bitmap, cliprect, 4); + draw_sprites(screen.machine(), bitmap, cliprect, 5); + draw_sprites(screen.machine(), bitmap, cliprect, 6); + draw_sprites(screen.machine(), bitmap, cliprect, 7); } else #endif - switch (nycaptor_spot(screen->machine()) & 3) + switch (nycaptor_spot(screen.machine()) & 3) { case 0: tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1 | 3, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 6); + draw_sprites(screen.machine(), bitmap, cliprect, 6); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0 | 3, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1 | 2, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0 | 2, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1 | 1, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 3); + draw_sprites(screen.machine(), bitmap, cliprect, 3); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0 | 1, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 2); + draw_sprites(screen.machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 2); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1 | 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0 | 0, 0); break; case 1: tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1 | 3, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 3); + draw_sprites(screen.machine(), bitmap, cliprect, 3); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0 | 3, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 2); + draw_sprites(screen.machine(), bitmap, cliprect, 2); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1 | 2, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1 | 1, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0 | 1, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0 | 2, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1 | 0, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0 | 0, 0); break; @@ -313,20 +313,20 @@ SCREEN_UPDATE( nycaptor ) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1 | 3, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0 | 3, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1 | 1, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0 | 1, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1 | 2, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0 | 2, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1 | 0, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0 | 0, 0); break; case 3: tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1 | 1, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0 | 1, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1 | 0, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0 | 0, 0); break; diff --git a/src/mame/video/offtwall.c b/src/mame/video/offtwall.c index 589241959e8..6a6b022d88f 100644 --- a/src/mame/video/offtwall.c +++ b/src/mame/video/offtwall.c @@ -91,7 +91,7 @@ VIDEO_START( offtwall ) SCREEN_UPDATE( offtwall ) { - offtwall_state *state = screen->machine().driver_data(); + offtwall_state *state = screen.machine().driver_data(); atarimo_rect_list rectlist; bitmap_t *mobitmap; int x, y, r; diff --git a/src/mame/video/ohmygod.c b/src/mame/video/ohmygod.c index 45ebd331067..adf90d41c87 100644 --- a/src/mame/video/ohmygod.c +++ b/src/mame/video/ohmygod.c @@ -107,9 +107,9 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( ohmygod ) { - ohmygod_state *state = screen->machine().driver_data(); + ohmygod_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/ojankohs.c b/src/mame/video/ojankohs.c index 9729453dd3a..d81024cadc3 100644 --- a/src/mame/video/ojankohs.c +++ b/src/mame/video/ojankohs.c @@ -314,7 +314,7 @@ VIDEO_START( ojankoc ) SCREEN_UPDATE( ojankohs ) { - ojankohs_state *state = screen->machine().driver_data(); + ojankohs_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_tilemap, 0, state->m_scrollx); tilemap_set_scrolly(state->m_tilemap, 0, state->m_scrolly); @@ -325,12 +325,12 @@ SCREEN_UPDATE( ojankohs ) SCREEN_UPDATE( ojankoc ) { - ojankohs_state *state = screen->machine().driver_data(); + ojankohs_state *state = screen.machine().driver_data(); int offs; if (state->m_screen_refresh) { - address_space *space = screen->machine().device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); /* redraw bitmap */ for (offs = 0; offs < 0x8000; offs++) diff --git a/src/mame/video/oneshot.c b/src/mame/video/oneshot.c index 88ef7d44bf3..2ac9e12418e 100644 --- a/src/mame/video/oneshot.c +++ b/src/mame/video/oneshot.c @@ -158,33 +158,33 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( oneshot ) { - oneshot_state *state = screen->machine().driver_data(); + oneshot_state *state = screen.machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); tilemap_set_scrollx(state->m_mid_tilemap, 0, state->m_scroll[0] - 0x1f5); tilemap_set_scrolly(state->m_mid_tilemap, 0, state->m_scroll[1]); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_mid_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - draw_crosshairs(screen->machine(), bitmap, cliprect); + draw_crosshairs(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( maddonna ) { - oneshot_state *state = screen->machine().driver_data(); + oneshot_state *state = screen.machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); tilemap_set_scrolly(state->m_mid_tilemap, 0, state->m_scroll[1]); // other registers aren't used so we don't know which layers they relate to tilemap_draw(bitmap, cliprect, state->m_mid_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); // popmessage ("%04x %04x %04x %04x %04x %04x %04x %04x", state->m_scroll[0], state->m_scroll[1], state->m_scroll[2], state->m_scroll[3], state->m_scroll[4], state->m_scroll[5], state->m_scroll[6], state->m_scroll[7]); return 0; diff --git a/src/mame/video/opwolf.c b/src/mame/video/opwolf.c index 1adf2ee8fba..72bc3881070 100644 --- a/src/mame/video/opwolf.c +++ b/src/mame/video/opwolf.c @@ -38,7 +38,7 @@ WRITE16_HANDLER( opwolf_spritectrl_w ) SCREEN_UPDATE( opwolf ) { - opwolf_state *state = screen->machine().driver_data(); + opwolf_state *state = screen.machine().driver_data(); int layer[2]; pc080sn_tilemap_update(state->m_pc080sn); @@ -46,7 +46,7 @@ SCREEN_UPDATE( opwolf ) layer[0] = 0; layer[1] = 1; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[1], 0, 2); diff --git a/src/mame/video/orbit.c b/src/mame/video/orbit.c index 5e80f4ede72..2a55ceac0d9 100644 --- a/src/mame/video/orbit.c +++ b/src/mame/video/orbit.c @@ -81,12 +81,12 @@ static void draw_sprites( running_machine &machine, bitmap_t* bitmap, const rect SCREEN_UPDATE( orbit ) { - orbit_state *state = screen->machine().driver_data(); + orbit_state *state = screen.machine().driver_data(); - state->m_flip_screen = input_port_read(screen->machine(), "DSW2") & 8; + state->m_flip_screen = input_port_read(screen.machine(), "DSW2") & 8; tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/othldrby.c b/src/mame/video/othldrby.c index 6c4565d1ccf..d8dd9815657 100644 --- a/src/mame/video/othldrby.c +++ b/src/mame/video/othldrby.c @@ -182,14 +182,14 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( othldrby ) { - othldrby_state *state = screen->machine().driver_data(); + othldrby_state *state = screen.machine().driver_data(); int layer; - flip_screen_set(screen->machine(), state->m_vreg[0x0f] & 0x80); + flip_screen_set(screen.machine(), state->m_vreg[0x0f] & 0x80); for (layer = 0; layer < 3; layer++) { - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { tilemap_set_scrollx(state->m_bg_tilemap[layer], 0, state->m_vreg[2 * layer] + 59); tilemap_set_scrolly(state->m_bg_tilemap[layer], 0, state->m_vreg[2 * layer + 1] + 248); @@ -201,32 +201,32 @@ SCREEN_UPDATE( othldrby ) } } - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); for (layer = 0; layer < 3; layer++) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[layer], 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0); for (layer = 0; layer < 3; layer++) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[layer], 1, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); for (layer = 0; layer < 3; layer++) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[layer], 2, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 2); + draw_sprites(screen.machine(), bitmap, cliprect, 2); for (layer = 0; layer < 3; layer++) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[layer], 3, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 3); + draw_sprites(screen.machine(), bitmap, cliprect, 3); return 0; } SCREEN_EOF( othldrby ) { - othldrby_state *state = machine.driver_data(); + othldrby_state *state = screen.machine().driver_data(); /* sprites need to be delayed two frames */ memcpy(state->m_buf_spriteram, state->m_buf_spriteram2, SPRITERAM_SIZE * sizeof(state->m_buf_spriteram[0])); diff --git a/src/mame/video/othunder.c b/src/mame/video/othunder.c index 1842e56d9af..e6ddb957d87 100644 --- a/src/mame/video/othunder.c +++ b/src/mame/video/othunder.c @@ -202,7 +202,7 @@ logerror("Sprite number %04x had %02x invalid chunks\n",tilenum,bad_chunks); SCREEN_UPDATE( othunder ) { - othunder_state *state = screen->machine().driver_data(); + othunder_state *state = screen.machine().driver_data(); int layer[3]; tc0100scn_tilemap_update(state->m_tc0100scn); @@ -211,7 +211,7 @@ SCREEN_UPDATE( othunder ) layer[1] = layer[0] ^ 1; layer[2] = 2; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ bitmap_fill(bitmap, cliprect, 0); @@ -223,7 +223,7 @@ SCREEN_UPDATE( othunder ) /* Sprites can be under/over the layer below text layer */ { static const int primasks[2] = {0xf0, 0xfc}; - draw_sprites(screen->machine(), bitmap, cliprect, primasks, 3); + draw_sprites(screen.machine(), bitmap, cliprect, primasks, 3); } return 0; diff --git a/src/mame/video/overdriv.c b/src/mame/video/overdriv.c index 31df37cab84..8705f3644e0 100644 --- a/src/mame/video/overdriv.c +++ b/src/mame/video/overdriv.c @@ -52,7 +52,7 @@ void overdriv_zoom_callback_1( running_machine &machine, int *code, int *color, SCREEN_UPDATE( overdriv ) { - overdriv_state *state = screen->machine().driver_data(); + overdriv_state *state = screen.machine().driver_data(); state->m_sprite_colorbase = k053251_get_palette_index(state->m_k053251, K053251_CI0); state->m_road_colorbase[1] = k053251_get_palette_index(state->m_k053251, K053251_CI1); @@ -60,7 +60,7 @@ SCREEN_UPDATE( overdriv ) state->m_zoom_colorbase[1] = k053251_get_palette_index(state->m_k053251, K053251_CI3); state->m_zoom_colorbase[0] = k053251_get_palette_index(state->m_k053251, K053251_CI4); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); k051316_zoom_draw(state->m_k051316_1, bitmap, cliprect, 0, 0); k051316_zoom_draw(state->m_k051316_2, bitmap, cliprect, 0, 1); diff --git a/src/mame/video/pacland.c b/src/mame/video/pacland.c index b9bb9461d88..7f0ba5b64ab 100644 --- a/src/mame/video/pacland.c +++ b/src/mame/video/pacland.c @@ -375,32 +375,32 @@ static void draw_fg(running_machine &machine, bitmap_t *bitmap, const rectangle SCREEN_UPDATE( pacland ) { - pacland_state *state = screen->machine().driver_data(); + pacland_state *state = screen.machine().driver_data(); int row; for (row = 5; row < 29; row++) - tilemap_set_scrollx(state->m_fg_tilemap, row, flip_screen_get(screen->machine()) ? state->m_scroll0-7 : state->m_scroll0); - tilemap_set_scrollx(state->m_bg_tilemap, 0, flip_screen_get(screen->machine()) ? state->m_scroll1-4 : state->m_scroll1-3); + tilemap_set_scrollx(state->m_fg_tilemap, row, flip_screen_get(screen.machine()) ? state->m_scroll0-7 : state->m_scroll0); + tilemap_set_scrollx(state->m_bg_tilemap, 0, flip_screen_get(screen.machine()) ? state->m_scroll1-4 : state->m_scroll1-3); /* draw high priority sprite pixels, setting priority bitmap to non-zero wherever there is a high-priority pixel; note that we draw to the bitmap which is safe because the bg_tilemap draw will overwrite everything */ - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0x00); - draw_sprites(screen->machine(), bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0x00); + draw_sprites(screen.machine(), bitmap, cliprect, 0); /* draw background */ tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); /* draw low priority fg tiles */ - draw_fg(screen->machine(), bitmap, cliprect, 0); + draw_fg(screen.machine(), bitmap, cliprect, 0); /* draw sprites with regular transparency */ - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); /* draw high priority fg tiles */ - draw_fg(screen->machine(), bitmap, cliprect, 1); + draw_fg(screen.machine(), bitmap, cliprect, 1); /* draw sprite pixels with colortable values >= 0xf0, which have priority over everything */ - draw_sprites(screen->machine(), bitmap, cliprect, 2); + draw_sprites(screen.machine(), bitmap, cliprect, 2); return 0; } diff --git a/src/mame/video/pacman.c b/src/mame/video/pacman.c index cea6758f636..24f5da3398b 100644 --- a/src/mame/video/pacman.c +++ b/src/mame/video/pacman.c @@ -222,16 +222,16 @@ WRITE8_HANDLER( pacman_flipscreen_w ) SCREEN_UPDATE( pacman ) { - pacman_state *state = screen->machine().driver_data(); + pacman_state *state = screen.machine().driver_data(); if (state->m_bgpriority != 0) bitmap_fill(bitmap,cliprect,0); else tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,TILEMAP_DRAW_OPAQUE,0); - if( screen->machine().generic.spriteram_size ) + if( screen.machine().generic.spriteram_size ) { - UINT8 *spriteram = screen->machine().generic.spriteram.u8; - UINT8 *spriteram_2 = screen->machine().generic.spriteram2.u8; + UINT8 *spriteram = screen.machine().generic.spriteram.u8; + UINT8 *spriteram_2 = screen.machine().generic.spriteram2.u8; int offs; rectangle spriteclip = spritevisiblearea; @@ -239,7 +239,7 @@ SCREEN_UPDATE( pacman ) /* Draw the sprites. Note that it is important to draw them exactly in this */ /* order, to have the correct priorities. */ - for (offs = screen->machine().generic.spriteram_size - 2;offs > 2*2;offs -= 2) + for (offs = screen.machine().generic.spriteram_size - 2;offs > 2*2;offs -= 2) { int color; int sx,sy; @@ -261,20 +261,20 @@ SCREEN_UPDATE( pacman ) color = ( spriteram[offs + 1] & 0x1f ) | (state->m_colortablebank << 5) | (state->m_palettebank << 6 ); - drawgfx_transmask(bitmap,&spriteclip,screen->machine().gfx[1], + drawgfx_transmask(bitmap,&spriteclip,screen.machine().gfx[1], ( spriteram[offs] >> 2 ) | (state->m_spritebank << 6), color, fx,fy, sx,sy, - colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[1], color & 0x3f, 0)); + colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color & 0x3f, 0)); /* also plot the sprite with wraparound (tunnel in Crush Roller) */ - drawgfx_transmask(bitmap,&spriteclip,screen->machine().gfx[1], + drawgfx_transmask(bitmap,&spriteclip,screen.machine().gfx[1], ( spriteram[offs] >> 2 ) | (state->m_spritebank << 6), color, fx,fy, sx - 256,sy, - colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[1], color & 0x3f, 0)); + colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color & 0x3f, 0)); } /* In the Pac Man based games (NOT Pengo) the first two sprites must be offset */ /* one pixel to the left to get a more correct placement */ @@ -299,20 +299,20 @@ SCREEN_UPDATE( pacman ) fx = (spriteram[offs] & 1) ^ state->m_inv_spr; fy = (spriteram[offs] & 2) ^ ((state->m_inv_spr) << 1); - drawgfx_transmask(bitmap,&spriteclip,screen->machine().gfx[1], + drawgfx_transmask(bitmap,&spriteclip,screen.machine().gfx[1], ( spriteram[offs] >> 2 ) | (state->m_spritebank << 6), color, fx,fy, sx,sy + state->m_xoffsethack, - colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[1], color & 0x3f, 0)); + colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color & 0x3f, 0)); /* also plot the sprite with wraparound (tunnel in Crush Roller) */ - drawgfx_transmask(bitmap,&spriteclip,screen->machine().gfx[1], + drawgfx_transmask(bitmap,&spriteclip,screen.machine().gfx[1], ( spriteram[offs] >> 2 ) | (state->m_spritebank << 6), color, fy,fx, //FIXME: flipping bits are really supposed to be inverted here? sx - 256,sy + state->m_xoffsethack, - colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[1], color & 0x3f, 0)); + colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color & 0x3f, 0)); } } @@ -420,14 +420,14 @@ VIDEO_START( s2650games ) SCREEN_UPDATE( s2650games ) { - pacman_state *state = screen->machine().driver_data(); - UINT8 *spriteram = screen->machine().generic.spriteram.u8; - UINT8 *spriteram_2 = screen->machine().generic.spriteram2.u8; + pacman_state *state = screen.machine().driver_data(); + UINT8 *spriteram = screen.machine().generic.spriteram.u8; + UINT8 *spriteram_2 = screen.machine().generic.spriteram2.u8; int offs; tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - for (offs = screen->machine().generic.spriteram_size - 2;offs > 2*2;offs -= 2) + for (offs = screen.machine().generic.spriteram_size - 2;offs > 2*2;offs -= 2) { int color; int sx,sy; @@ -438,12 +438,12 @@ SCREEN_UPDATE( s2650games ) color = spriteram[offs + 1] & 0x1f; /* TODO: ?? */ - drawgfx_transmask(bitmap,cliprect,screen->machine().gfx[1], + drawgfx_transmask(bitmap,cliprect,screen.machine().gfx[1], (spriteram[offs] >> 2) | ((state->m_s2650games_spriteram[offs] & 3) << 6), color, spriteram[offs] & 1,spriteram[offs] & 2, sx,sy, - colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[1], color & 0x3f, 0)); + colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color & 0x3f, 0)); } /* In the Pac Man based games (NOT Pengo) the first two sprites must be offset */ /* one pixel to the left to get a more correct placement */ @@ -458,12 +458,12 @@ SCREEN_UPDATE( s2650games ) color = spriteram[offs + 1] & 0x1f; /* TODO: ?? */ - drawgfx_transmask(bitmap,cliprect,screen->machine().gfx[1], + drawgfx_transmask(bitmap,cliprect,screen.machine().gfx[1], (spriteram[offs] >> 2) | ((state->m_s2650games_spriteram[offs] & 3)<<6), color, spriteram[offs] & 1,spriteram[offs] & 2, sx,sy + state->m_xoffsethack, - colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[1], color & 0x3f, 0)); + colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color & 0x3f, 0)); } return 0; } diff --git a/src/mame/video/pandoras.c b/src/mame/video/pandoras.c index 249889c9462..6bcff496a0b 100644 --- a/src/mame/video/pandoras.c +++ b/src/mame/video/pandoras.c @@ -179,9 +179,9 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( pandoras ) { - pandoras_state *state = screen->machine().driver_data(); + pandoras_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect, state->m_layer0, 1 ,0); - draw_sprites(screen->machine(), bitmap, cliprect, &state->m_spriteram[0x800] ); + draw_sprites(screen.machine(), bitmap, cliprect, &state->m_spriteram[0x800] ); tilemap_draw(bitmap,cliprect, state->m_layer0, 0 ,0); return 0; } diff --git a/src/mame/video/paradise.c b/src/mame/video/paradise.c index 484c5cc27fd..4b90b89697a 100644 --- a/src/mame/video/paradise.c +++ b/src/mame/video/paradise.c @@ -243,40 +243,40 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( paradise ) { - paradise_state *state = screen->machine().driver_data(); + paradise_state *state = screen.machine().driver_data(); int layers_ctrl = -1; #ifdef MAME_DEBUG -if (screen->machine().input().code_pressed(KEYCODE_Z)) +if (screen.machine().input().code_pressed(KEYCODE_Z)) { int mask = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) mask |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) mask |= 2; - if (screen->machine().input().code_pressed(KEYCODE_E)) mask |= 4; - if (screen->machine().input().code_pressed(KEYCODE_R)) mask |= 8; - if (screen->machine().input().code_pressed(KEYCODE_A)) mask |= 16; + if (screen.machine().input().code_pressed(KEYCODE_Q)) mask |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) mask |= 2; + if (screen.machine().input().code_pressed(KEYCODE_E)) mask |= 4; + if (screen.machine().input().code_pressed(KEYCODE_R)) mask |= 8; + if (screen.machine().input().code_pressed(KEYCODE_A)) mask |= 16; if (mask != 0) layers_ctrl &= mask; } #endif - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); if (!(state->m_priority & 4)) /* Screen blanking */ return 0; if (state->m_priority & 1) if (layers_ctrl & 16) - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); if (layers_ctrl & 1) tilemap_draw(bitmap, cliprect, state->m_tilemap_0, 0, 0); if (layers_ctrl & 2) tilemap_draw(bitmap, cliprect, state->m_tilemap_1, 0, 0); - if (layers_ctrl & 4) copybitmap_trans(bitmap, state->m_tmpbitmap, flip_screen_get(screen->machine()), flip_screen_get(screen->machine()), 0, 0, cliprect, 0x80f); + if (layers_ctrl & 4) copybitmap_trans(bitmap, state->m_tmpbitmap, flip_screen_get(screen.machine()), flip_screen_get(screen.machine()), 0, 0, cliprect, 0x80f); if (state->m_priority & 2) { if (!(state->m_priority & 1)) if (layers_ctrl & 16) - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); if (layers_ctrl & 8) tilemap_draw(bitmap,cliprect, state->m_tilemap_2, 0, 0); } @@ -286,7 +286,7 @@ if (screen->machine().input().code_pressed(KEYCODE_Z)) tilemap_draw(bitmap, cliprect, state->m_tilemap_2, 0, 0); if (!(state->m_priority & 1)) if (layers_ctrl & 16) - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); } return 0; } @@ -294,22 +294,22 @@ if (screen->machine().input().code_pressed(KEYCODE_Z)) /* no pix layer, no tilemap_0, different priority bits */ SCREEN_UPDATE( torus ) { - paradise_state *state = screen->machine().driver_data(); + paradise_state *state = screen.machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); if (!(state->m_priority & 2)) /* Screen blanking */ return 0; if (state->m_priority & 1) - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_tilemap_1, 0,0); if (state->m_priority & 4) { if (!(state->m_priority & 1)) - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_tilemap_2, 0, 0); } @@ -318,7 +318,7 @@ SCREEN_UPDATE( torus ) tilemap_draw(bitmap, cliprect, state->m_tilemap_2, 0, 0); if (!(state->m_priority & 1)) - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); } return 0; } @@ -326,12 +326,12 @@ SCREEN_UPDATE( torus ) /* I don't know how the priority bits work on this one */ SCREEN_UPDATE( madball ) { - paradise_state *state = screen->machine().driver_data(); + paradise_state *state = screen.machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); tilemap_draw(bitmap, cliprect, state->m_tilemap_0, 0, 0); tilemap_draw(bitmap, cliprect, state->m_tilemap_1, 0, 0); tilemap_draw(bitmap, cliprect, state->m_tilemap_2, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/parodius.c b/src/mame/video/parodius.c index b6fc03b9d13..06124126997 100644 --- a/src/mame/video/parodius.c +++ b/src/mame/video/parodius.c @@ -47,7 +47,7 @@ void parodius_sprite_callback( running_machine &machine, int *code, int *color, SCREEN_UPDATE( parodius ) { - parodius_state *state = screen->machine().driver_data(); + parodius_state *state = screen.machine().driver_data(); int layer[3], bg_colorbase; bg_colorbase = k053251_get_palette_index(state->m_k053251, K053251_CI0); @@ -67,7 +67,7 @@ SCREEN_UPDATE( parodius ) konami_sortlayers3(layer, state->m_layerpri); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 16 * bg_colorbase); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[0], 0,1); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[1], 0,2); diff --git a/src/mame/video/pass.c b/src/mame/video/pass.c index 22b52f0b6e9..da7a3da324d 100644 --- a/src/mame/video/pass.c +++ b/src/mame/video/pass.c @@ -59,7 +59,7 @@ VIDEO_START( pass ) SCREEN_UPDATE( pass ) { - pass_state *state = screen->machine().driver_data(); + pass_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap, 0, 0); diff --git a/src/mame/video/pastelg.c b/src/mame/video/pastelg.c index 56bc0d55cd8..b8631e3a111 100644 --- a/src/mame/video/pastelg.c +++ b/src/mame/video/pastelg.c @@ -304,12 +304,12 @@ VIDEO_START( pastelg ) ******************************************************************************/ SCREEN_UPDATE( pastelg ) { - pastelg_state *state = screen->machine().driver_data(); + pastelg_state *state = screen.machine().driver_data(); if (state->m_dispflag) { int x, y; - int width = screen->width(); - int height = screen->height(); + int width = screen.width(); + int height = screen.height(); for (y = 0; y < height; y++) for (x = 0; x < width; x++) diff --git a/src/mame/video/pbaction.c b/src/mame/video/pbaction.c index 7d15e9f1170..964afff37d0 100644 --- a/src/mame/video/pbaction.c +++ b/src/mame/video/pbaction.c @@ -134,10 +134,10 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( pbaction ) { - pbaction_state *state = screen->machine().driver_data(); + pbaction_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/pcktgal.c b/src/mame/video/pcktgal.c index aefbf9cb659..7b192533961 100644 --- a/src/mame/video/pcktgal.c +++ b/src/mame/video/pcktgal.c @@ -66,15 +66,15 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( pcktgal ) { -// flip_screen_set(screen->machine(), screen->machine().device("tilegen1")->get_flip_state()); - screen->machine().device("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); - draw_sprites(screen->machine(), bitmap, cliprect); +// flip_screen_set(screen.machine(), screen.machine().device("tilegen1")->get_flip_state()); + screen.machine().device("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( pcktgalb ) { // the bootleg doesn't properly set the tilemap registers, because it's on non-original hardware, which probably doesn't have the flexible tilemaps. - screen->machine().device("tilegen1")->deco_bac06_pf_draw_bootleg(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0, 2); - draw_sprites(screen->machine(), bitmap, cliprect); + screen.machine().device("tilegen1")->deco_bac06_pf_draw_bootleg(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0, 2); + draw_sprites(screen.machine(), bitmap, cliprect); return 0;} diff --git a/src/mame/video/pgm.c b/src/mame/video/pgm.c index 5a879dec26f..dee4aea1265 100644 --- a/src/mame/video/pgm.c +++ b/src/mame/video/pgm.c @@ -364,13 +364,13 @@ VIDEO_START( pgm ) SCREEN_UPDATE( pgm ) { - pgm_state *state = screen->machine().driver_data(); + pgm_state *state = screen.machine().driver_data(); int y; - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); bitmap_fill(state->m_tmppgmbitmap, cliprect, 0x00000000); - draw_sprites(screen->machine(), state->m_tmppgmbitmap, state->m_spritebufferram); + draw_sprites(screen.machine(), state->m_tmppgmbitmap, state->m_spritebufferram); tilemap_set_scrolly(state->m_bg_tilemap,0, state->m_videoregs[0x2000/2]); @@ -420,7 +420,7 @@ SCREEN_UPDATE( pgm ) SCREEN_EOF( pgm ) { - pgm_state *state = machine.driver_data(); + pgm_state *state = screen.machine().driver_data(); /* first 0xa00 of main ram = sprites, seems to be buffered, DMA? */ memcpy(state->m_spritebufferram, pgm_mainram, 0xa00); diff --git a/src/mame/video/phoenix.c b/src/mame/video/phoenix.c index 7ce24afdd3c..b172f8c6a44 100644 --- a/src/mame/video/phoenix.c +++ b/src/mame/video/phoenix.c @@ -452,7 +452,7 @@ READ_LINE_DEVICE_HANDLER( survival_sid_callback ) SCREEN_UPDATE( phoenix ) { - phoenix_state *state = screen->machine().driver_data(); + phoenix_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); return 0; diff --git a/src/mame/video/pingpong.c b/src/mame/video/pingpong.c index 3c7b915ad5d..7e3dd847eb0 100644 --- a/src/mame/video/pingpong.c +++ b/src/mame/video/pingpong.c @@ -154,8 +154,8 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( pingpong ) { - pingpong_state *state = screen->machine().driver_data(); + pingpong_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/pirates.c b/src/mame/video/pirates.c index f1ba2a1f5ce..9fd46b43033 100644 --- a/src/mame/video/pirates.c +++ b/src/mame/video/pirates.c @@ -109,12 +109,12 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE(pirates) { - pirates_state *state = screen->machine().driver_data(); + pirates_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap,0,state->m_scroll[0]); tilemap_set_scrollx(state->m_fg_tilemap,0,state->m_scroll[0]); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); return 0; } diff --git a/src/mame/video/pitnrun.c b/src/mame/video/pitnrun.c index 90dff383a24..0e9697a672b 100644 --- a/src/mame/video/pitnrun.c +++ b/src/mame/video/pitnrun.c @@ -219,26 +219,26 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( pitnrun ) { - pitnrun_state *state = screen->machine().driver_data(); + pitnrun_state *state = screen.machine().driver_data(); int dx=0,dy=0; rectangle myclip=*cliprect; #ifdef MAME_DEBUG - if (screen->machine().input().code_pressed_once(KEYCODE_Q)) + if (screen.machine().input().code_pressed_once(KEYCODE_Q)) { - UINT8 *ROM = screen->machine().region("maincpu")->base(); + UINT8 *ROM = screen.machine().region("maincpu")->base(); ROM[0x84f6]=0; /* lap 0 - normal */ } - if (screen->machine().input().code_pressed_once(KEYCODE_W)) + if (screen.machine().input().code_pressed_once(KEYCODE_W)) { - UINT8 *ROM = screen->machine().region("maincpu")->base(); + UINT8 *ROM = screen.machine().region("maincpu")->base(); ROM[0x84f6]=6; /* lap 6 = spotlight */ } - if (screen->machine().input().code_pressed_once(KEYCODE_E)) + if (screen.machine().input().code_pressed_once(KEYCODE_E)) { - UINT8 *ROM = screen->machine().region("maincpu")->base(); + UINT8 *ROM = screen.machine().region("maincpu")->base(); ROM[0x84f6]=2; /* lap 3 (trial 2)= lightnings */ ROM[0x8102]=1; } @@ -253,10 +253,10 @@ SCREEN_UPDATE( pitnrun ) dx=128-state->m_h_heed+((state->m_ha&8)<<5)+3; dy=128-state->m_v_heed+((state->m_ha&0x10)<<4); - if (flip_screen_x_get(screen->machine())) + if (flip_screen_x_get(screen.machine())) dx=128-dx+16; - if (flip_screen_y_get(screen->machine())) + if (flip_screen_y_get(screen.machine())) dy=128-dy; myclip.min_x=dx; @@ -274,10 +274,10 @@ SCREEN_UPDATE( pitnrun ) tilemap_draw(bitmap,&myclip,state->m_bg, 0,0); } - draw_sprites(screen->machine(),bitmap,&myclip); + draw_sprites(screen.machine(),bitmap,&myclip); if(state->m_ha&4) - copybitmap_trans(bitmap,state->m_tmp_bitmap[state->m_ha&3],flip_screen_x_get(screen->machine()),flip_screen_y_get(screen->machine()),dx,dy,&myclip, 1); + copybitmap_trans(bitmap,state->m_tmp_bitmap[state->m_ha&3],flip_screen_x_get(screen.machine()),flip_screen_y_get(screen.machine()),dx,dy,&myclip, 1); tilemap_draw(bitmap,cliprect,state->m_fg, 0,0); return 0; } diff --git a/src/mame/video/pk8000.c b/src/mame/video/pk8000.c index d43d7bcf3a9..0563d95647d 100644 --- a/src/mame/video/pk8000.c +++ b/src/mame/video/pk8000.c @@ -95,7 +95,7 @@ PALETTE_INIT( pk8000 ) palette_set_colors(machine, 0, pk8000_palette, ARRAY_LENGTH(pk8000_palette)); } -UINT32 pk8000_video_update(device_t *screen, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *videomem) +UINT32 pk8000_video_update(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *videomem) { int x,y,j,b; UINT16 offset = (pk8000_video_mode & 0xc0) << 8; diff --git a/src/mame/video/pktgaldx.c b/src/mame/video/pktgaldx.c index a83613962f5..4b2e6d4330f 100644 --- a/src/mame/video/pktgaldx.c +++ b/src/mame/video/pktgaldx.c @@ -7,17 +7,17 @@ SCREEN_UPDATE( pktgaldx ) { - pktgaldx_state *state = screen->machine().driver_data(); + pktgaldx_state *state = screen.machine().driver_data(); UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); - flip_screen_set(screen->machine(), BIT(flip, 7)); + flip_screen_set(screen.machine(), BIT(flip, 7)); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); bitmap_fill(bitmap, cliprect, 0); /* not Confirmed */ - bitmap_fill(screen->machine().priority_bitmap, NULL, 0); + bitmap_fill(screen.machine().priority_bitmap, NULL, 0); deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram, 0x400, true); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0x400, true); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; } @@ -26,13 +26,13 @@ SCREEN_UPDATE( pktgaldx ) SCREEN_UPDATE( pktgaldb ) { - pktgaldx_state *state = screen->machine().driver_data(); + pktgaldx_state *state = screen.machine().driver_data(); int x, y; int offset = 0; int tileno; int colour; - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); /* the bootleg seems to treat the tilemaps as sprites */ for (offset = 0; offset < 0x1600 / 2; offset += 8) @@ -46,7 +46,7 @@ SCREEN_UPDATE( pktgaldb ) y &= 0x1ff; y -= 8; - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], tileno ^ 0x1000, colour, 0, 0, x, y, 0); + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], tileno ^ 0x1000, colour, 0, 0, x, y, 0); } for (offset = 0x1600/2; offset < 0x2000 / 2; offset += 8) @@ -60,7 +60,7 @@ SCREEN_UPDATE( pktgaldb ) y &= 0x1ff; y -= 8; - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], tileno ^ 0x4000, colour, 0, 0, x, y, 0); + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], tileno ^ 0x4000, colour, 0, 0, x, y, 0); } for (offset = 0x2000/2; offset < 0x4000 / 2; offset += 8) @@ -74,7 +74,7 @@ SCREEN_UPDATE( pktgaldb ) y &= 0x1ff; y -= 8; - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], tileno ^ 0x3000, colour, 0, 0, x, y, 0); + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], tileno ^ 0x3000, colour, 0, 0, x, y, 0); } return 0; diff --git a/src/mame/video/playch10.c b/src/mame/video/playch10.c index 2ba508d651b..bcda758484f 100644 --- a/src/mame/video/playch10.c +++ b/src/mame/video/playch10.c @@ -121,63 +121,67 @@ VIDEO_START( playch10_hboard ) ***************************************************************************/ -SCREEN_UPDATE( playch10 ) +SCREEN_UPDATE( playch10_single ) { - playch10_state *state = screen->machine().driver_data(); - device_t *ppu = screen->machine().device("ppu"); + playch10_state *state = screen.machine().driver_data(); + device_t *ppu = screen.machine().device("ppu"); - /* Dual monitor version */ - if (state->m_pc10_bios == 1) + rectangle top_monitor = screen.visible_area(); + + top_monitor.max_y = ( top_monitor.max_y - top_monitor.min_y ) / 2; + + if(state->m_pc10_dispmask_old != state->m_pc10_dispmask) { - device_t *top_screen = screen->machine().device("top"); + state->m_pc10_dispmask_old = state->m_pc10_dispmask; - /* On Playchoice 10 single monitor, this bit toggles */ - /* between PPU and BIOS display. */ - /* We support the multi-monitor layout. In this case, */ - /* if the bit is not set, then we should display */ - /* the PPU portion. */ - - if (screen == top_screen) - { - if ( !state->m_pc10_dispmask ) - /* render the ppu */ - ppu2c0x_render( ppu, bitmap, 0, 0, 0, 0 ); - else - bitmap_fill(bitmap, cliprect, 0); - } - else - { - /* When the bios is accessing vram, the video circuitry can't access it */ - - if ( !state->m_pc10_sdcs ) - tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - else - bitmap_fill(bitmap, cliprect, 0); - } + if(state->m_pc10_dispmask) + state->m_pc10_game_mode ^= 1; } - else /* Single Monitor version */ + + if ( state->m_pc10_game_mode ) + /* render the ppu */ + ppu2c0x_render( ppu, bitmap, 0, 0, 0, 0 ); + else { - rectangle top_monitor = screen->visible_area(); - - top_monitor.max_y = ( top_monitor.max_y - top_monitor.min_y ) / 2; - - if(state->m_pc10_dispmask_old != state->m_pc10_dispmask) - { - state->m_pc10_dispmask_old = state->m_pc10_dispmask; - - if(state->m_pc10_dispmask) - state->m_pc10_game_mode ^= 1; - } - - if ( state->m_pc10_game_mode ) - /* render the ppu */ - ppu2c0x_render( ppu, bitmap, 0, 0, 0, 0 ); - else - { - /* When the bios is accessing vram, the video circuitry can't access it */ - if ( !state->m_pc10_sdcs ) - tilemap_draw(bitmap, &top_monitor, state->m_bg_tilemap, 0, 0); - } + /* When the bios is accessing vram, the video circuitry can't access it */ + if ( !state->m_pc10_sdcs ) + tilemap_draw(bitmap, &top_monitor, state->m_bg_tilemap, 0, 0); } return 0; } + +SCREEN_UPDATE( playch10_top ) +{ + playch10_state *state = screen.machine().driver_data(); + device_t *ppu = screen.machine().device("ppu"); + + /* Single Monitor version */ + if (state->m_pc10_bios != 1) + return SCREEN_UPDATE_CALL(playch10_single); + + if ( !state->m_pc10_dispmask ) + /* render the ppu */ + ppu2c0x_render( ppu, bitmap, 0, 0, 0, 0 ); + else + bitmap_fill(bitmap, cliprect, 0); + + return 0; +} + +SCREEN_UPDATE( playch10_bottom ) +{ + playch10_state *state = screen.machine().driver_data(); + + /* Single Monitor version */ + if (state->m_pc10_bios != 1) + return SCREEN_UPDATE_CALL(playch10_single); + + /* When the bios is accessing vram, the video circuitry can't access it */ + + if ( !state->m_pc10_sdcs ) + tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); + else + bitmap_fill(bitmap, cliprect, 0); + + return 0; +} diff --git a/src/mame/video/playmark.c b/src/mame/video/playmark.c index 965924ae6f8..117ebd7f160 100644 --- a/src/mame/video/playmark.c +++ b/src/mame/video/playmark.c @@ -520,14 +520,14 @@ static void draw_bitmap( running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( bigtwin ) { - playmark_state *state = screen->machine().driver_data(); + playmark_state *state = screen.machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); if (state->m_bg_enable) - draw_bitmap(screen->machine(), bitmap, cliprect); - draw_sprites(screen->machine(), bitmap, cliprect, 4); + draw_bitmap(screen.machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect, 4); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); return 0; } @@ -535,38 +535,38 @@ SCREEN_UPDATE( bigtwin ) SCREEN_UPDATE( bigtwinb ) { - playmark_state *state = screen->machine().driver_data(); + playmark_state *state = screen.machine().driver_data(); // video enabled if (state->m_scroll[6] & 1) { tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - bigtwinb_draw_sprites(screen->machine(), bitmap, cliprect, 4); + bigtwinb_draw_sprites(screen.machine(), bitmap, cliprect, 4); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); } else - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } SCREEN_UPDATE( excelsr ) { - playmark_state *state = screen->machine().driver_data(); + playmark_state *state = screen.machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 1); if (state->m_bg_enable) - draw_bitmap(screen->machine(), bitmap, cliprect); + draw_bitmap(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 4); - draw_sprites(screen->machine(), bitmap, cliprect, 2); + draw_sprites(screen.machine(), bitmap, cliprect, 2); return 0; } SCREEN_UPDATE( wbeachvl ) { - playmark_state *state = screen->machine().driver_data(); + playmark_state *state = screen.machine().driver_data(); if (state->m_fg_rowscroll_enable) { @@ -582,30 +582,30 @@ SCREEN_UPDATE( wbeachvl ) tilemap_set_scrollx(state->m_fg_tilemap, 0, state->m_fgscrollx); } - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2); - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); return 0; } SCREEN_UPDATE( hrdtimes ) { - playmark_state *state = screen->machine().driver_data(); + playmark_state *state = screen.machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); // video enabled if (state->m_scroll[6] & 1) { tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2); - draw_sprites(screen->machine(), bitmap, cliprect, 2); + draw_sprites(screen.machine(), bitmap, cliprect, 2); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); } else - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } diff --git a/src/mame/video/plygonet.c b/src/mame/video/plygonet.c index 57fe69d9dab..9d76f0f4c45 100644 --- a/src/mame/video/plygonet.c +++ b/src/mame/video/plygonet.c @@ -125,10 +125,10 @@ VIDEO_START( polygonet ) SCREEN_UPDATE( polygonet ) { - polygonet_state *state = screen->machine().driver_data(); - device_t *k053936 = screen->machine().device("k053936"); - bitmap_fill(screen->machine().priority_bitmap, NULL, 0); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + polygonet_state *state = screen.machine().driver_data(); + device_t *k053936 = screen.machine().device("k053936"); + bitmap_fill(screen.machine().priority_bitmap, NULL, 0); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); k053936_zoom_draw(k053936, bitmap, cliprect, state->m_roz_tilemap, 0, 0, 0); diff --git a/src/mame/video/pokechmp.c b/src/mame/video/pokechmp.c index def4a4d9fa0..dd1bb19a424 100644 --- a/src/mame/video/pokechmp.c +++ b/src/mame/video/pokechmp.c @@ -74,8 +74,8 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( pokechmp ) { - pokechmp_state *state = screen->machine().driver_data(); + pokechmp_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/polepos.c b/src/mame/video/polepos.c index 75d66a0ed4d..9a97ad2cf6c 100644 --- a/src/mame/video/polepos.c +++ b/src/mame/video/polepos.c @@ -522,12 +522,12 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( polepos ) { - polepos_state *state = screen->machine().driver_data(); + polepos_state *state = screen.machine().driver_data(); rectangle clip = *cliprect; clip.max_y = 127; tilemap_draw(bitmap,&clip,state->m_bg_tilemap,0,0); - draw_road(screen->machine(), bitmap); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_road(screen.machine(), bitmap); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); return 0; } diff --git a/src/mame/video/policetr.c b/src/mame/video/policetr.c index e8a73a9d2f0..6e567c33872 100644 --- a/src/mame/video/policetr.c +++ b/src/mame/video/policetr.c @@ -350,7 +350,7 @@ WRITE32_HANDLER( policetr_palette_data_w ) SCREEN_UPDATE( policetr ) { - policetr_state *state = screen->machine().driver_data(); + policetr_state *state = screen.machine().driver_data(); int width = cliprect->max_x - cliprect->min_x + 1; int y; diff --git a/src/mame/video/polyplay.c b/src/mame/video/polyplay.c index 220e55dfa8c..5f6fc785232 100644 --- a/src/mame/video/polyplay.c +++ b/src/mame/video/polyplay.c @@ -49,7 +49,7 @@ VIDEO_START( polyplay ) SCREEN_UPDATE( polyplay ) { - polyplay_state *state = screen->machine().driver_data(); + polyplay_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; offs_t offs; @@ -60,7 +60,7 @@ SCREEN_UPDATE( polyplay ) int sy = offs >> 6 << 3; UINT8 code = videoram[offs]; - drawgfx_opaque(bitmap,cliprect, screen->machine().gfx[(code >> 7) & 0x01], + drawgfx_opaque(bitmap,cliprect, screen.machine().gfx[(code >> 7) & 0x01], code, 0, 0, 0, sx, sy); } diff --git a/src/mame/video/poolshrk.c b/src/mame/video/poolshrk.c index a266329844a..510de897211 100644 --- a/src/mame/video/poolshrk.c +++ b/src/mame/video/poolshrk.c @@ -29,7 +29,7 @@ VIDEO_START( poolshrk ) SCREEN_UPDATE( poolshrk ) { - poolshrk_state *state = screen->machine().driver_data(); + poolshrk_state *state = screen.machine().driver_data(); int i; tilemap_mark_all_tiles_dirty(state->m_bg_tilemap); @@ -43,7 +43,7 @@ SCREEN_UPDATE( poolshrk ) int hpos = state->m_hpos_ram[i]; int vpos = state->m_vpos_ram[i]; - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], i, (i == 0) ? 0 : 1, 0, 0, + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], i, (i == 0) ? 0 : 1, 0, 0, 248 - hpos, vpos - 15, 0); } diff --git a/src/mame/video/pooyan.c b/src/mame/video/pooyan.c index eccd1678f5c..dc29e4bf1af 100644 --- a/src/mame/video/pooyan.c +++ b/src/mame/video/pooyan.c @@ -194,9 +194,9 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( pooyan ) { - pooyan_state *state = screen->machine().driver_data(); + pooyan_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/popeye.c b/src/mame/video/popeye.c index 5b78cad3f64..2af124d1c4e 100644 --- a/src/mame/video/popeye.c +++ b/src/mame/video/popeye.c @@ -373,9 +373,9 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( popeye ) { - popeye_state *state = screen->machine().driver_data(); - draw_background(screen->machine(), bitmap, cliprect); - draw_sprites(screen->machine(), bitmap, cliprect); + popeye_state *state = screen.machine().driver_data(); + draw_background(screen.machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/popper.c b/src/mame/video/popper.c index 30fbcb08724..e59bc9ca0d8 100644 --- a/src/mame/video/popper.c +++ b/src/mame/video/popper.c @@ -248,7 +248,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const recta SCREEN_UPDATE( popper ) { - popper_state *state = screen->machine().driver_data(); + popper_state *state = screen.machine().driver_data(); rectangle finalclip = state->m_tilemap_clip; sect_rect(&finalclip, cliprect); @@ -263,7 +263,7 @@ SCREEN_UPDATE( popper ) tilemap_draw(bitmap, &finalclip, state->m_ol_p123_tilemap, TILEMAP_DRAW_LAYER1, 0); tilemap_draw(bitmap, &finalclip, state->m_ol_p0_tilemap, TILEMAP_DRAW_LAYER1, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_p123_tilemap, TILEMAP_DRAW_LAYER0, 0); tilemap_draw(bitmap, cliprect, state->m_p0_tilemap, TILEMAP_DRAW_LAYER0, 0); diff --git a/src/mame/video/portrait.c b/src/mame/video/portrait.c index f2809b1147d..c32e7d04cc9 100644 --- a/src/mame/video/portrait.c +++ b/src/mame/video/portrait.c @@ -190,7 +190,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( portrait ) { - portrait_state *state = screen->machine().driver_data(); + portrait_state *state = screen.machine().driver_data(); rectangle cliprect_scroll, cliprect_no_scroll; cliprect_scroll = cliprect_no_scroll = *cliprect; @@ -208,6 +208,6 @@ SCREEN_UPDATE( portrait ) tilemap_draw(bitmap, &cliprect_scroll, state->m_background, 0, 0); tilemap_draw(bitmap, &cliprect_scroll, state->m_foreground, 0, 0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); return 0; } diff --git a/src/mame/video/powerins.c b/src/mame/video/powerins.c index 3ea5dea35c1..85a386c0f2f 100644 --- a/src/mame/video/powerins.c +++ b/src/mame/video/powerins.c @@ -342,7 +342,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( powerins ) { - powerins_state *state = screen->machine().driver_data(); + powerins_state *state = screen.machine().driver_data(); int layers_ctrl = -1; int scrollx = (state->m_vctrl_0[2/2]&0xff) + (state->m_vctrl_0[0/2]&0xff)*256; @@ -355,21 +355,21 @@ SCREEN_UPDATE( powerins ) tilemap_set_scrolly( state->m_tilemap_1, 0, 0x00); #ifdef MAME_DEBUG -if (screen->machine().input().code_pressed(KEYCODE_Z)) +if (screen.machine().input().code_pressed(KEYCODE_Z)) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= 2; -// if (screen->machine().input().code_pressed(KEYCODE_E)) msk |= 4; - if (screen->machine().input().code_pressed(KEYCODE_A)) msk |= 8; + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 2; +// if (screen.machine().input().code_pressed(KEYCODE_E)) msk |= 4; + if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= 8; if (msk != 0) layers_ctrl &= msk; } #endif if (layers_ctrl&1) tilemap_draw(bitmap,cliprect, state->m_tilemap_0, 0, 0); else bitmap_fill(bitmap,cliprect,0); - if (layers_ctrl&8) draw_sprites(screen->machine(),bitmap,cliprect); + if (layers_ctrl&8) draw_sprites(screen.machine(),bitmap,cliprect); if (layers_ctrl&2) tilemap_draw(bitmap,cliprect, state->m_tilemap_1, 0, 0); return 0; } diff --git a/src/mame/video/prehisle.c b/src/mame/video/prehisle.c index b004a08b250..fa33493650e 100644 --- a/src/mame/video/prehisle.c +++ b/src/mame/video/prehisle.c @@ -166,12 +166,12 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( prehisle ) { - prehisle_state *state = screen->machine().driver_data(); + prehisle_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/psikyo.c b/src/mame/video/psikyo.c index a2ae7a88513..8fe3c599d9f 100644 --- a/src/mame/video/psikyo.c +++ b/src/mame/video/psikyo.c @@ -526,7 +526,7 @@ static int tilemap_width( int size ) SCREEN_UPDATE( psikyo ) { - psikyo_state *state = screen->machine().driver_data(); + psikyo_state *state = screen.machine().driver_data(); int i, layers_ctrl = -1; UINT32 tm0size, tm1size; @@ -539,7 +539,7 @@ SCREEN_UPDATE( psikyo ) tilemap_t *tmptilemap0, *tmptilemap1; - flip_screen_set(screen->machine(), ~input_port_read(screen->machine(), "DSW") & 0x00010000); // hardwired to a DSW bit + flip_screen_set(screen.machine(), ~input_port_read(screen.machine(), "DSW") & 0x00010000); // hardwired to a DSW bit /* Layers enable (not quite right) */ @@ -574,8 +574,8 @@ SCREEN_UPDATE( psikyo ) /* For gfx banking for s1945jn/gunbird/btlkroad */ if (state->m_ka302c_banking) { - psikyo_switch_banks(screen->machine(), 0, (layer0_ctrl & 0x400) >> 10); - psikyo_switch_banks(screen->machine(), 1, (layer1_ctrl & 0x400) >> 10); + psikyo_switch_banks(screen.machine(), 0, (layer0_ctrl & 0x400) >> 10); + psikyo_switch_banks(screen.machine(), 1, (layer1_ctrl & 0x400) >> 10); } switch ((layer0_ctrl & 0x00c0) >> 6) @@ -674,9 +674,9 @@ SCREEN_UPDATE( psikyo ) tilemap_set_transparent_pen(state->m_tilemap_1_size2, (layer1_ctrl & 8 ? 0 : 15)); tilemap_set_transparent_pen(state->m_tilemap_1_size3, (layer1_ctrl & 8 ? 0 : 15)); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); if (layers_ctrl & 1) tilemap_draw(bitmap, cliprect, tmptilemap0, layer0_ctrl & 2 ? TILEMAP_DRAW_OPAQUE : 0, 1); @@ -685,7 +685,7 @@ SCREEN_UPDATE( psikyo ) tilemap_draw(bitmap, cliprect, tmptilemap1, layer1_ctrl & 2 ? TILEMAP_DRAW_OPAQUE : 0, 2); if (layers_ctrl & 4) - draw_sprites(screen->machine(), bitmap, cliprect, (spr_ctrl & 4 ? 0 : 15)); + draw_sprites(screen.machine(), bitmap, cliprect, (spr_ctrl & 4 ? 0 : 15)); return 0; } @@ -700,7 +700,7 @@ SCREEN_UPDATE( psikyo ) SCREEN_UPDATE( psikyo_bootleg ) { - psikyo_state *state = screen->machine().driver_data(); + psikyo_state *state = screen.machine().driver_data(); int i, layers_ctrl = -1; UINT32 tm0size, tm1size; @@ -713,7 +713,7 @@ SCREEN_UPDATE( psikyo_bootleg ) tilemap_t *tmptilemap0, *tmptilemap1; - flip_screen_set(screen->machine(), ~input_port_read(screen->machine(), "DSW") & 0x00010000); // hardwired to a DSW bit + flip_screen_set(screen.machine(), ~input_port_read(screen.machine(), "DSW") & 0x00010000); // hardwired to a DSW bit /* Layers enable (not quite right) */ @@ -748,8 +748,8 @@ SCREEN_UPDATE( psikyo_bootleg ) /* For gfx banking for s1945jn/gunbird/btlkroad */ if (state->m_ka302c_banking) { - psikyo_switch_banks(screen->machine(), 0, (layer0_ctrl & 0x400) >> 10); - psikyo_switch_banks(screen->machine(), 1, (layer1_ctrl & 0x400) >> 10); + psikyo_switch_banks(screen.machine(), 0, (layer0_ctrl & 0x400) >> 10); + psikyo_switch_banks(screen.machine(), 1, (layer1_ctrl & 0x400) >> 10); } switch ((layer0_ctrl & 0x00c0) >> 6) @@ -848,9 +848,9 @@ SCREEN_UPDATE( psikyo_bootleg ) tilemap_set_transparent_pen(state->m_tilemap_1_size2, (layer1_ctrl & 8 ? 0 : 15)); tilemap_set_transparent_pen(state->m_tilemap_1_size3, (layer1_ctrl & 8 ? 0 : 15)); - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); if (layers_ctrl & 1) tilemap_draw(bitmap, cliprect, tmptilemap0, layer0_ctrl & 2 ? TILEMAP_DRAW_OPAQUE : 0, 1); @@ -859,7 +859,7 @@ SCREEN_UPDATE( psikyo_bootleg ) tilemap_draw(bitmap, cliprect, tmptilemap1, layer1_ctrl & 2 ? TILEMAP_DRAW_OPAQUE : 0, 2); if (layers_ctrl & 4) - draw_sprites_bootleg(screen->machine(), bitmap, cliprect, (spr_ctrl & 4 ? 0 : 15)); + draw_sprites_bootleg(screen.machine(), bitmap, cliprect, (spr_ctrl & 4 ? 0 : 15)); return 0; } @@ -867,7 +867,7 @@ SCREEN_UPDATE( psikyo_bootleg ) SCREEN_EOF( psikyo ) { - psikyo_state *state = machine.driver_data(); + psikyo_state *state = screen.machine().driver_data(); memcpy(state->m_spritebuf2, state->m_spritebuf1, 0x2000); memcpy(state->m_spritebuf1, state->m_spriteram, 0x2000); } diff --git a/src/mame/video/psikyo4.c b/src/mame/video/psikyo4.c index 247a67ae443..1930e058451 100644 --- a/src/mame/video/psikyo4.c +++ b/src/mame/video/psikyo4.c @@ -127,21 +127,17 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect } } -SCREEN_UPDATE( psikyo4 ) +SCREEN_UPDATE( psikyo4_left ) { - device_t *left_screen = screen->machine().device("lscreen"); - device_t *right_screen = screen->machine().device("rscreen"); + bitmap_fill(bitmap, cliprect, 0x1000); + draw_sprites(screen.machine(), bitmap, cliprect, 0x0000); + return 0; +} - if (screen == left_screen) - { - bitmap_fill(bitmap, cliprect, 0x1000); - draw_sprites(screen->machine(), bitmap, cliprect, 0x0000); - } - if (screen == right_screen) - { - bitmap_fill(bitmap, cliprect, 0x1001); - draw_sprites(screen->machine(), bitmap, cliprect, 0x2000); - } +SCREEN_UPDATE( psikyo4_right ) +{ + bitmap_fill(bitmap, cliprect, 0x1001); + draw_sprites(screen.machine(), bitmap, cliprect, 0x2000); return 0; } diff --git a/src/mame/video/psikyosh.c b/src/mame/video/psikyosh.c index fa8a13fcec2..6853ceee057 100644 --- a/src/mame/video/psikyosh.c +++ b/src/mame/video/psikyosh.c @@ -1295,7 +1295,7 @@ VIDEO_START( psikyosh ) SCREEN_UPDATE( psikyosh ) /* Note the z-buffer on each sprite to get correct priority */ { int i; - psikyosh_state *state = screen->machine().driver_data(); + psikyosh_state *state = screen.machine().driver_data(); // show only the priority associated with a given keypress(s) and/or hide sprites/tilemaps int pri_debug = false; @@ -1305,14 +1305,14 @@ SCREEN_UPDATE( psikyosh ) /* Note the z-buffer on each sprite to get correct pri #ifdef DEBUG_KEYS for (i = 0; i <= 7; i++) { - if(screen->machine().input().code_pressed(pri_keys[i])) { + if(screen.machine().input().code_pressed(pri_keys[i])) { pri_debug = true; } } - if(screen->machine().input().code_pressed(KEYCODE_G)) { + if(screen.machine().input().code_pressed(KEYCODE_G)) { sprites = false; } - if(screen->machine().input().code_pressed(KEYCODE_H)) { + if(screen.machine().input().code_pressed(KEYCODE_H)) { backgrounds = false; } #endif @@ -1327,18 +1327,18 @@ popmessage ("%08x %08x %08x %08x\n%08x %08x %08x %08x", bitmap_fill(state->m_z_bitmap, cliprect, 0); /* z-buffer */ - psikyosh_prelineblend(screen->machine(), bitmap, cliprect); // fills screen + psikyosh_prelineblend(screen.machine(), bitmap, cliprect); // fills screen for (i = 0; i <= 7; i++) { - if(!pri_debug || screen->machine().input().code_pressed(pri_keys[i])) + if(!pri_debug || screen.machine().input().code_pressed(pri_keys[i])) { if(sprites) { - draw_sprites(screen->machine(), bitmap, cliprect, i); // When same priority bg's have higher pri + draw_sprites(screen.machine(), bitmap, cliprect, i); // When same priority bg's have higher pri } if(backgrounds) { - draw_background(screen->machine(), bitmap, cliprect, i); + draw_background(screen.machine(), bitmap, cliprect, i); } - psikyosh_postlineblend(screen->machine(), bitmap, cliprect, i); // assume this has highest priority at same priority level + psikyosh_postlineblend(screen.machine(), bitmap, cliprect, i); // assume this has highest priority at same priority level } } return 0; @@ -1346,7 +1346,7 @@ popmessage ("%08x %08x %08x %08x\n%08x %08x %08x %08x", SCREEN_EOF( psikyosh ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram32_w(space, 0, 0, 0xffffffff); } diff --git a/src/mame/video/psychic5.c b/src/mame/video/psychic5.c index e09bf444fa0..cf384fea2b6 100644 --- a/src/mame/video/psychic5.c +++ b/src/mame/video/psychic5.c @@ -434,24 +434,24 @@ static void draw_background(running_machine &machine, bitmap_t *bitmap, const re SCREEN_UPDATE( psychic5 ) { - psychic5_state *state = screen->machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + psychic5_state *state = screen.machine().driver_data(); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); if (state->m_bg_status & 1) /* Backgound enable */ - draw_background(screen->machine(), bitmap, cliprect); + draw_background(screen.machine(), bitmap, cliprect); if (!(state->m_title_screen & 1)) - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } SCREEN_UPDATE( bombsa ) { - psychic5_state *state = screen->machine().driver_data(); + psychic5_state *state = screen.machine().driver_data(); if (state->m_bg_status & 1) /* Backgound enable */ tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); else - bitmap_fill(bitmap, cliprect, screen->machine().pens[0x0ff]); - draw_sprites(screen->machine(), bitmap, cliprect); + bitmap_fill(bitmap, cliprect, screen.machine().pens[0x0ff]); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/punchout.c b/src/mame/video/punchout.c index 46b1cbbc4dd..398b1bba5d1 100644 --- a/src/mame/video/punchout.c +++ b/src/mame/video/punchout.c @@ -369,67 +369,68 @@ static void punchout_copy_bot_palette(running_machine &machine, int bank) } -SCREEN_UPDATE( punchout ) +SCREEN_UPDATE( punchout_top ) { - punchout_state *state = screen->machine().driver_data(); - device_t *top_screen = screen->machine().device("top"); - device_t *bottom_screen = screen->machine().device("bottom"); + punchout_state *state = screen.machine().driver_data(); - if (screen == top_screen) - { - punchout_copy_top_palette(screen->machine(), BIT(*state->m_palettebank,1)); + punchout_copy_top_palette(screen.machine(), BIT(*state->m_palettebank,1)); - tilemap_draw(bitmap, cliprect, state->m_bg_top_tilemap, 0, 0); + tilemap_draw(bitmap, cliprect, state->m_bg_top_tilemap, 0, 0); - if (state->m_spr1_ctrlram[7] & 1) /* display in top monitor */ - draw_big_sprite(screen->machine(), bitmap, cliprect, 0); - } - else if (screen == bottom_screen) - { - int offs; + if (state->m_spr1_ctrlram[7] & 1) /* display in top monitor */ + draw_big_sprite(screen.machine(), bitmap, cliprect, 0); - punchout_copy_bot_palette(screen->machine(), BIT(*state->m_palettebank,0)); + return 0; +} - /* copy the character mapped graphics */ - for (offs = 0;offs < 32;offs++) - tilemap_set_scrollx(state->m_bg_bot_tilemap, offs, 58 + state->m_bg_bot_videoram[2*offs] + 256 * (state->m_bg_bot_videoram[2*offs + 1] & 0x01)); +SCREEN_UPDATE( punchout_bottom ) +{ + punchout_state *state = screen.machine().driver_data(); + int offs; - tilemap_draw(bitmap, cliprect, state->m_bg_bot_tilemap, 0, 0); + punchout_copy_bot_palette(screen.machine(), BIT(*state->m_palettebank,0)); + + /* copy the character mapped graphics */ + for (offs = 0;offs < 32;offs++) + tilemap_set_scrollx(state->m_bg_bot_tilemap, offs, 58 + state->m_bg_bot_videoram[2*offs] + 256 * (state->m_bg_bot_videoram[2*offs + 1] & 0x01)); + + tilemap_draw(bitmap, cliprect, state->m_bg_bot_tilemap, 0, 0); + + if (state->m_spr1_ctrlram[7] & 2) /* display in bottom monitor */ + draw_big_sprite(screen.machine(), bitmap, cliprect, 1); + drawbs2(screen.machine(), bitmap, cliprect); - if (state->m_spr1_ctrlram[7] & 2) /* display in bottom monitor */ - draw_big_sprite(screen->machine(), bitmap, cliprect, 1); - drawbs2(screen->machine(), bitmap, cliprect); - } return 0; } -SCREEN_UPDATE( armwrest ) +SCREEN_UPDATE( armwrest_top ) { - punchout_state *state = screen->machine().driver_data(); - device_t *top_screen = screen->machine().device("top"); - device_t *bottom_screen = screen->machine().device("bottom"); + punchout_state *state = screen.machine().driver_data(); - if (screen == top_screen) - { - punchout_copy_top_palette(screen->machine(), BIT(*state->m_palettebank,1)); + punchout_copy_top_palette(screen.machine(), BIT(*state->m_palettebank,1)); - tilemap_draw(bitmap, cliprect, state->m_bg_top_tilemap, 0, 0); + tilemap_draw(bitmap, cliprect, state->m_bg_top_tilemap, 0, 0); - if (state->m_spr1_ctrlram[7] & 1) /* display in top monitor */ - armwrest_draw_big_sprite(screen->machine(), bitmap, cliprect, 0); - } - else if (screen == bottom_screen) - { - punchout_copy_bot_palette(screen->machine(), BIT(*state->m_palettebank,0)); + if (state->m_spr1_ctrlram[7] & 1) /* display in top monitor */ + armwrest_draw_big_sprite(screen.machine(), bitmap, cliprect, 0); + + return 0; +} + +SCREEN_UPDATE( armwrest_bottom ) +{ + punchout_state *state = screen.machine().driver_data(); + + punchout_copy_bot_palette(screen.machine(), BIT(*state->m_palettebank,0)); + + tilemap_draw(bitmap, cliprect, state->m_bg_bot_tilemap, 0, 0); + + if (state->m_spr1_ctrlram[7] & 2) /* display in bottom monitor */ + armwrest_draw_big_sprite(screen.machine(), bitmap, cliprect, 1); + drawbs2(screen.machine(), bitmap, cliprect); + + tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - tilemap_draw(bitmap, cliprect, state->m_bg_bot_tilemap, 0, 0); - - if (state->m_spr1_ctrlram[7] & 2) /* display in bottom monitor */ - armwrest_draw_big_sprite(screen->machine(), bitmap, cliprect, 1); - drawbs2(screen->machine(), bitmap, cliprect); - - tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - } return 0; } diff --git a/src/mame/video/pushman.c b/src/mame/video/pushman.c index 50416a1605c..50d27b11ca7 100644 --- a/src/mame/video/pushman.c +++ b/src/mame/video/pushman.c @@ -122,14 +122,14 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( pushman ) { - pushman_state *state = screen->machine().driver_data(); + pushman_state *state = screen.machine().driver_data(); /* Setup the tilemaps */ tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_control[0]); tilemap_set_scrolly(state->m_bg_tilemap, 0, 0xf00 - state->m_control[1]); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/qdrmfgp.c b/src/mame/video/qdrmfgp.c index 148b6ff4a37..9ddef8c7756 100644 --- a/src/mame/video/qdrmfgp.c +++ b/src/mame/video/qdrmfgp.c @@ -59,8 +59,8 @@ VIDEO_START( qdrmfgp2 ) SCREEN_UPDATE( qdrmfgp ) { - device_t *k056832 = screen->machine().device("k056832"); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + device_t *k056832 = screen.machine().device("k056832"); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); k056832_tilemap_draw(k056832, bitmap, cliprect, 3, 0, 1); k056832_tilemap_draw(k056832, bitmap, cliprect, 2, 0, 2); diff --git a/src/mame/video/qix.c b/src/mame/video/qix.c index d5c20934284..04974aaf67c 100644 --- a/src/mame/video/qix.c +++ b/src/mame/video/qix.c @@ -346,7 +346,7 @@ static MC6845_UPDATE_ROW( update_row ) static SCREEN_UPDATE( qix ) { - mc6845_device *mc6845 = screen->machine().device(MC6845_TAG); + mc6845_device *mc6845 = screen.machine().device(MC6845_TAG); mc6845->update(bitmap, cliprect); return 0; diff --git a/src/mame/video/quasar.c b/src/mame/video/quasar.c index 4037928ca14..0a1929023ef 100644 --- a/src/mame/video/quasar.c +++ b/src/mame/video/quasar.c @@ -105,7 +105,7 @@ VIDEO_START( quasar ) SCREEN_UPDATE( quasar ) { - quasar_state *state = screen->machine().driver_data(); + quasar_state *state = screen.machine().driver_data(); int offs; bitmap_t *s2636_0_bitmap, *s2636_1_bitmap, *s2636_2_bitmap; @@ -127,7 +127,7 @@ SCREEN_UPDATE( quasar ) *BITMAP_ADDR16(bitmap, y + oy, x + ox) = forecolor; /* Main Screen */ - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], code, state->m_color_ram[offs] & 0x3f, 0,0, @@ -137,7 +137,7 @@ SCREEN_UPDATE( quasar ) /* background for Collision Detection (it can only hit certain items) */ if((state->m_color_ram[offs] & 7) == 0) { - drawgfx_opaque(state->m_collision_background,cliprect,screen->machine().gfx[0], + drawgfx_opaque(state->m_collision_background,cliprect,screen.machine().gfx[0], code, 64, 0,0, @@ -191,7 +191,7 @@ SCREEN_UPDATE( quasar ) *BITMAP_ADDR16(bitmap, y, x) = S2636_PIXEL_COLOR(pixel); /* S2636 vs. background collision detection */ - if (colortable_entry_get_value(screen->machine().colortable, *BITMAP_ADDR16(state->m_collision_background, y, x))) + if (colortable_entry_get_value(screen.machine().colortable, *BITMAP_ADDR16(state->m_collision_background, y, x))) { if (S2636_IS_PIXEL_DRAWN(pixel0)) state->m_collision_register |= 0x01; if (S2636_IS_PIXEL_DRAWN(pixel2)) state->m_collision_register |= 0x02; diff --git a/src/mame/video/quizdna.c b/src/mame/video/quizdna.c index efe3f3e8b35..38096c60127 100644 --- a/src/mame/video/quizdna.c +++ b/src/mame/video/quizdna.c @@ -194,14 +194,14 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( quizdna ) { - quizdna_state *state = screen->machine().driver_data(); + quizdna_state *state = screen.machine().driver_data(); if (state->m_video_enable) { tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); } else - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } diff --git a/src/mame/video/quizpani.c b/src/mame/video/quizpani.c index c3b74b8af70..9e2e192edbe 100644 --- a/src/mame/video/quizpani.c +++ b/src/mame/video/quizpani.c @@ -81,7 +81,7 @@ VIDEO_START( quizpani ) SCREEN_UPDATE( quizpani ) { - quizpani_state *state = screen->machine().driver_data(); + quizpani_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_scrollreg[0] - 64); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_scrollreg[1] + 16); tilemap_set_scrollx(state->m_txt_tilemap, 0, state->m_scrollreg[2] - 64); diff --git a/src/mame/video/raiden.c b/src/mame/video/raiden.c index 43875bb6067..8a080e5b635 100644 --- a/src/mame/video/raiden.c +++ b/src/mame/video/raiden.c @@ -155,7 +155,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( raiden ) { - raiden_state *state = screen->machine().driver_data(); + raiden_state *state = screen.machine().driver_data(); /* Setup the tilemaps, alternate version has different scroll positions */ if (!state->m_alternate) { tilemap_set_scrollx( state->m_bg_layer,0, state->m_scroll_ram[0]); @@ -173,11 +173,11 @@ SCREEN_UPDATE( raiden ) tilemap_draw(bitmap,cliprect,state->m_bg_layer,0,0); /* Draw sprites underneath foreground */ - draw_sprites(screen->machine(),bitmap,cliprect,0x40); + draw_sprites(screen.machine(),bitmap,cliprect,0x40); tilemap_draw(bitmap,cliprect,state->m_fg_layer,0,0); /* Rest of sprites */ - draw_sprites(screen->machine(),bitmap,cliprect,0x80); + draw_sprites(screen.machine(),bitmap,cliprect,0x80); /* Text layer */ tilemap_draw(bitmap,cliprect,state->m_tx_layer,0,0); diff --git a/src/mame/video/rainbow.c b/src/mame/video/rainbow.c index 19ebf20a8f6..9bbcfec68ae 100644 --- a/src/mame/video/rainbow.c +++ b/src/mame/video/rainbow.c @@ -44,7 +44,7 @@ WRITE16_HANDLER( jumping_spritectrl_w ) SCREEN_UPDATE( rainbow ) { - rainbow_state *state = screen->machine().driver_data(); + rainbow_state *state = screen.machine().driver_data(); int layer[2]; pc080sn_tilemap_update(state->m_pc080sn); @@ -52,7 +52,7 @@ SCREEN_UPDATE( rainbow ) layer[0] = 0; layer[1] = 1; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[1], 0, 2); @@ -89,7 +89,7 @@ VIDEO_START( jumping ) SCREEN_UPDATE( jumping ) { - rainbow_state *state = screen->machine().driver_data(); + rainbow_state *state = screen.machine().driver_data(); UINT16 *spriteram = state->m_spriteram; int offs, layer[2]; int sprite_colbank = (state->m_sprite_ctrl & 0xe0) >> 1; @@ -102,7 +102,7 @@ SCREEN_UPDATE( jumping ) layer[0] = 0; layer[1] = 1; - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0); @@ -110,7 +110,7 @@ SCREEN_UPDATE( jumping ) for (offs = state->m_spriteram_size / 2 - 8; offs >= 0; offs -= 8) { int tile = spriteram[offs]; - if (tile < screen->machine().gfx[1]->total_elements) + if (tile < screen.machine().gfx[1]->total_elements) { int sx,sy,color,data1; @@ -122,7 +122,7 @@ SCREEN_UPDATE( jumping ) data1 = spriteram[offs + 3]; color = (spriteram[offs + 4] & 0x0f) | sprite_colbank; - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], tile, color, data1 & 0x40, data1 & 0x80, diff --git a/src/mame/video/rallyx.c b/src/mame/video/rallyx.c index 73e4b4a17aa..0a47f52dfa9 100644 --- a/src/mame/video/rallyx.c +++ b/src/mame/video/rallyx.c @@ -629,13 +629,13 @@ static void locomotn_draw_bullets( running_machine &machine, bitmap_t *bitmap, c SCREEN_UPDATE( rallyx ) { - rallyx_state *state = screen->machine().driver_data(); + rallyx_state *state = screen.machine().driver_data(); /* the radar tilemap is just 8x32. We rely on the tilemap code to repeat it across the screen, and clip it to only the position where it is supposed to be shown */ rectangle fg_clip = *cliprect; rectangle bg_clip = *cliprect; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { bg_clip.min_x = 8 * 8; fg_clip.max_x = 8 * 8 - 1; @@ -646,16 +646,16 @@ SCREEN_UPDATE( rallyx ) fg_clip.min_x = 28 * 8; } - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, &bg_clip, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, &fg_clip, state->m_fg_tilemap, 0, 0); tilemap_draw(bitmap, &bg_clip, state->m_bg_tilemap, 1, 1); tilemap_draw(bitmap, &fg_clip, state->m_fg_tilemap, 1, 1); - rallyx_draw_bullets(screen->machine(), bitmap, cliprect, TRUE); - rallyx_draw_sprites(screen->machine(), bitmap, cliprect, 1); - rallyx_draw_bullets(screen->machine(), bitmap, cliprect, FALSE); + rallyx_draw_bullets(screen.machine(), bitmap, cliprect, TRUE); + rallyx_draw_sprites(screen.machine(), bitmap, cliprect, 1); + rallyx_draw_bullets(screen.machine(), bitmap, cliprect, FALSE); return 0; } @@ -663,13 +663,13 @@ SCREEN_UPDATE( rallyx ) SCREEN_UPDATE( jungler ) { - rallyx_state *state = screen->machine().driver_data(); + rallyx_state *state = screen.machine().driver_data(); /* the radar tilemap is just 8x32. We rely on the tilemap code to repeat it across the screen, and clip it to only the position where it is supposed to be shown */ rectangle fg_clip = *cliprect; rectangle bg_clip = *cliprect; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { bg_clip.min_x = 8 * 8; fg_clip.max_x = 8 * 8 - 1; @@ -680,7 +680,7 @@ SCREEN_UPDATE( jungler ) fg_clip.min_x = 28 * 8; } - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); /* tile priority doesn't seem to be supported in Jungler */ tilemap_draw(bitmap,&bg_clip, state->m_bg_tilemap, 0, 0); @@ -688,12 +688,12 @@ SCREEN_UPDATE( jungler ) tilemap_draw(bitmap,&bg_clip, state->m_bg_tilemap, 1, 0); tilemap_draw(bitmap,&fg_clip, state->m_fg_tilemap, 1, 0); - jungler_draw_bullets(screen->machine(), bitmap, cliprect, TRUE); - rallyx_draw_sprites(screen->machine(), bitmap, cliprect, 0); - jungler_draw_bullets(screen->machine(), bitmap, cliprect, FALSE); + jungler_draw_bullets(screen.machine(), bitmap, cliprect, TRUE); + rallyx_draw_sprites(screen.machine(), bitmap, cliprect, 0); + jungler_draw_bullets(screen.machine(), bitmap, cliprect, FALSE); if (state->m_stars_enable) - draw_stars(screen->machine(), bitmap, cliprect); + draw_stars(screen.machine(), bitmap, cliprect); return 0; } @@ -701,16 +701,16 @@ SCREEN_UPDATE( jungler ) SCREEN_UPDATE( locomotn ) { - rallyx_state *state = screen->machine().driver_data(); + rallyx_state *state = screen.machine().driver_data(); /* the radar tilemap is just 8x32. We rely on the tilemap code to repeat it across the screen, and clip it to only the position where it is supposed to be shown */ rectangle fg_clip = *cliprect; rectangle bg_clip = *cliprect; - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { /* handle reduced visible area in some games */ - if (screen->visible_area().max_x == 32 * 8 - 1) + if (screen.visible_area().max_x == 32 * 8 - 1) { bg_clip.min_x = 4 * 8; fg_clip.max_x = 4 * 8 - 1; @@ -727,19 +727,19 @@ SCREEN_UPDATE( locomotn ) fg_clip.min_x = 28 * 8; } - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, &bg_clip, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, &fg_clip, state->m_fg_tilemap, 0, 0); tilemap_draw(bitmap, &bg_clip, state->m_bg_tilemap, 1, 1); tilemap_draw(bitmap, &fg_clip, state->m_fg_tilemap, 1, 1); - locomotn_draw_bullets(screen->machine(), bitmap, cliprect, TRUE); - locomotn_draw_sprites(screen->machine(), bitmap, cliprect, 0); - locomotn_draw_bullets(screen->machine(), bitmap, cliprect, FALSE); + locomotn_draw_bullets(screen.machine(), bitmap, cliprect, TRUE); + locomotn_draw_sprites(screen.machine(), bitmap, cliprect, 0); + locomotn_draw_bullets(screen.machine(), bitmap, cliprect, FALSE); if (state->m_stars_enable) - draw_stars(screen->machine(), bitmap, cliprect); + draw_stars(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/rampart.c b/src/mame/video/rampart.c index a566f855921..2776a92a4be 100644 --- a/src/mame/video/rampart.c +++ b/src/mame/video/rampart.c @@ -79,7 +79,7 @@ SCREEN_UPDATE( rampart ) int x, y, r; /* draw the playfield */ - rampart_bitmap_render(screen->machine(), bitmap, cliprect); + rampart_bitmap_render(screen.machine(), bitmap, cliprect); /* draw and merge the MO */ mobitmap = atarimo_render(0, cliprect, &rectlist); diff --git a/src/mame/video/rastan.c b/src/mame/video/rastan.c index 3b1994fa17f..b742139aabe 100644 --- a/src/mame/video/rastan.c +++ b/src/mame/video/rastan.c @@ -33,7 +33,7 @@ WRITE16_HANDLER( rastan_spritectrl_w ) SCREEN_UPDATE( rastan ) { - rastan_state *state = screen->machine().driver_data(); + rastan_state *state = screen.machine().driver_data(); int layer[2]; pc080sn_tilemap_update(state->m_pc080sn); @@ -41,7 +41,7 @@ SCREEN_UPDATE( rastan ) layer[0] = 0; layer[1] = 1; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[1], 0, 2); diff --git a/src/mame/video/realbrk.c b/src/mame/video/realbrk.c index 35804c7c39c..abfcb1db07a 100644 --- a/src/mame/video/realbrk.c +++ b/src/mame/video/realbrk.c @@ -499,7 +499,7 @@ WRITE16_HANDLER( realbrk_vregs_w ) SCREEN_UPDATE(realbrk) { - realbrk_state *state = screen->machine().driver_data(); + realbrk_state *state = screen.machine().driver_data(); int layers_ctrl = -1; tilemap_set_scrolly(state->m_tilemap_0, 0, state->m_vregs[0x0/2]); @@ -509,20 +509,20 @@ SCREEN_UPDATE(realbrk) tilemap_set_scrollx(state->m_tilemap_1, 0, state->m_vregs[0x6/2]); #ifdef MAME_DEBUG -if ( screen->machine().input().code_pressed(KEYCODE_Z) ) +if ( screen.machine().input().code_pressed(KEYCODE_Z) ) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= 2; - if (screen->machine().input().code_pressed(KEYCODE_E)) msk |= 4; - if (screen->machine().input().code_pressed(KEYCODE_A)) msk |= 8; + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (screen.machine().input().code_pressed(KEYCODE_E)) msk |= 4; + if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= 8; if (msk != 0) layers_ctrl &= msk; } #endif if (state->m_disable_video) { - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); return 0; } else @@ -531,7 +531,7 @@ if ( screen->machine().input().code_pressed(KEYCODE_Z) ) if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect,state->m_tilemap_1,0,0); if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect,state->m_tilemap_0,0,0); - if (layers_ctrl & 8) draw_sprites(screen->machine(),bitmap,cliprect); + if (layers_ctrl & 8) draw_sprites(screen.machine(),bitmap,cliprect); if (layers_ctrl & 4) tilemap_draw(bitmap,cliprect,state->m_tilemap_2,0,0); @@ -542,7 +542,7 @@ if ( screen->machine().input().code_pressed(KEYCODE_Z) ) /* DaiDaiKakumei */ SCREEN_UPDATE(dai2kaku) { - realbrk_state *state = screen->machine().driver_data(); + realbrk_state *state = screen.machine().driver_data(); int layers_ctrl = -1; int offs, bgx0, bgy0, bgx1, bgy1; @@ -580,20 +580,20 @@ SCREEN_UPDATE(dai2kaku) tilemap_set_scrolly( state->m_tilemap_1, 0, bgy1 ); #ifdef MAME_DEBUG -if ( screen->machine().input().code_pressed(KEYCODE_Z) ) +if ( screen.machine().input().code_pressed(KEYCODE_Z) ) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= 2; - if (screen->machine().input().code_pressed(KEYCODE_E)) msk |= 4; - if (screen->machine().input().code_pressed(KEYCODE_A)) msk |= 8; + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (screen.machine().input().code_pressed(KEYCODE_E)) msk |= 4; + if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= 8; if (msk != 0) layers_ctrl &= msk; } #endif if (state->m_disable_video) { - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); return 0; } else @@ -602,7 +602,7 @@ if ( screen->machine().input().code_pressed(KEYCODE_Z) ) // spr 0 - if (layers_ctrl & 8) dai2kaku_draw_sprites(screen->machine(),bitmap,cliprect,2); + if (layers_ctrl & 8) dai2kaku_draw_sprites(screen.machine(),bitmap,cliprect,2); // bglow if( state->m_vregs[8/2] & (0x8000)){ @@ -612,7 +612,7 @@ if ( screen->machine().input().code_pressed(KEYCODE_Z) ) } // spr 1 - if (layers_ctrl & 8) dai2kaku_draw_sprites(screen->machine(),bitmap,cliprect,1); + if (layers_ctrl & 8) dai2kaku_draw_sprites(screen.machine(),bitmap,cliprect,1); // bghigh if( state->m_vregs[8/2] & (0x8000)){ @@ -622,7 +622,7 @@ if ( screen->machine().input().code_pressed(KEYCODE_Z) ) } // spr 2 - if (layers_ctrl & 8) dai2kaku_draw_sprites(screen->machine(),bitmap,cliprect,0); + if (layers_ctrl & 8) dai2kaku_draw_sprites(screen.machine(),bitmap,cliprect,0); // fix if (layers_ctrl & 4) tilemap_draw(bitmap,cliprect,state->m_tilemap_2,0,0); diff --git a/src/mame/video/redalert.c b/src/mame/video/redalert.c index fbe77a5d238..ba8b14aacb0 100644 --- a/src/mame/video/redalert.c +++ b/src/mame/video/redalert.c @@ -188,11 +188,11 @@ static VIDEO_START( ww3 ) static SCREEN_UPDATE( redalert ) { - redalert_state *state = screen->machine().driver_data(); + redalert_state *state = screen.machine().driver_data(); pen_t pens[NUM_CHARMAP_PENS + NUM_BITMAP_PENS + 1]; offs_t offs; - get_pens(screen->machine(), pens); + get_pens(screen.machine(), pens); for (offs = 0; offs < 0x2000; offs++) { @@ -261,11 +261,11 @@ static SCREEN_UPDATE( redalert ) static SCREEN_UPDATE( demoneye ) { - redalert_state *state = screen->machine().driver_data(); + redalert_state *state = screen.machine().driver_data(); pen_t pens[NUM_CHARMAP_PENS + NUM_BITMAP_PENS + 1]; offs_t offs; - get_pens(screen->machine(), pens); + get_pens(screen.machine(), pens); for (offs = 0; offs < 0x2000; offs++) { @@ -336,11 +336,11 @@ static SCREEN_UPDATE( demoneye ) static SCREEN_UPDATE( panther ) { - redalert_state *state = screen->machine().driver_data(); + redalert_state *state = screen.machine().driver_data(); pen_t pens[NUM_CHARMAP_PENS + NUM_BITMAP_PENS + 1]; offs_t offs; - get_panther_pens(screen->machine(), pens); + get_panther_pens(screen.machine(), pens); for (offs = 0; offs < 0x2000; offs++) { diff --git a/src/mame/video/redclash.c b/src/mame/video/redclash.c index cd9efc83a4e..4a2b7690866 100644 --- a/src/mame/video/redclash.c +++ b/src/mame/video/redclash.c @@ -420,17 +420,17 @@ void redclash_draw_stars( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_EOF( redclash ) { - redclash_update_stars_state(machine); + redclash_update_stars_state(screen.machine()); } SCREEN_UPDATE( redclash ) { - ladybug_state *state = screen->machine().driver_data(); + ladybug_state *state = screen.machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); - redclash_draw_stars(screen->machine(), bitmap, cliprect, 0x60, 0, 0x00, 0xff); - draw_sprites(screen->machine(), bitmap, cliprect); - draw_bullets(screen->machine(), bitmap, cliprect); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); + redclash_draw_stars(screen.machine(), bitmap, cliprect, 0x60, 0, 0x00, 0xff); + draw_sprites(screen.machine(), bitmap, cliprect); + draw_bullets(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/relief.c b/src/mame/video/relief.c index 38088e71b9f..381700962aa 100644 --- a/src/mame/video/relief.c +++ b/src/mame/video/relief.c @@ -110,8 +110,8 @@ VIDEO_START( relief ) SCREEN_UPDATE( relief ) { - relief_state *state = screen->machine().driver_data(); - bitmap_t *priority_bitmap = screen->machine().priority_bitmap; + relief_state *state = screen.machine().driver_data(); + bitmap_t *priority_bitmap = screen.machine().priority_bitmap; atarimo_rect_list rectlist; bitmap_t *mobitmap; int x, y, r; diff --git a/src/mame/video/renegade.c b/src/mame/video/renegade.c index ac87c6ce7f0..1970f7e3088 100644 --- a/src/mame/video/renegade.c +++ b/src/mame/video/renegade.c @@ -133,10 +133,10 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( renegade ) { - renegade_state *state = screen->machine().driver_data(); + renegade_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_scrollx); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0 , 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0 , 0); return 0; } diff --git a/src/mame/video/retofinv.c b/src/mame/video/retofinv.c index a6977170554..233566c3622 100644 --- a/src/mame/video/retofinv.c +++ b/src/mame/video/retofinv.c @@ -231,9 +231,9 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap) SCREEN_UPDATE( retofinv ) { - retofinv_state *state = screen->machine().driver_data(); + retofinv_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap); + draw_sprites(screen.machine(), bitmap); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); return 0; } diff --git a/src/mame/video/rltennis.c b/src/mame/video/rltennis.c index 235889e3347..949777316fb 100644 --- a/src/mame/video/rltennis.c +++ b/src/mame/video/rltennis.c @@ -232,7 +232,7 @@ VIDEO_START( rltennis ) SCREEN_UPDATE( rltennis ) { - rltennis_state *state = screen->machine().driver_data(); + rltennis_state *state = screen.machine().driver_data(); copybitmap(bitmap, state->m_tmp_bitmap[BITMAP_BG], 0, 0, 0, 0, cliprect); copybitmap_trans(bitmap, state->m_tmp_bitmap[BITMAP_FG_DISPLAY], 0, 0, 0, 0, cliprect, 0); return 0; diff --git a/src/mame/video/rockrage.c b/src/mame/video/rockrage.c index 4af997a0cbd..c8444804d0d 100644 --- a/src/mame/video/rockrage.c +++ b/src/mame/video/rockrage.c @@ -98,14 +98,14 @@ WRITE8_HANDLER( rockrage_vreg_w ) SCREEN_UPDATE( rockrage ) { - rockrage_state *state = screen->machine().driver_data(); + rockrage_state *state = screen.machine().driver_data(); - set_pens(screen->machine()); + set_pens(screen.machine()); k007342_tilemap_update(state->m_k007342); k007342_tilemap_draw(state->m_k007342, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); - k007420_sprites_draw(state->m_k007420, bitmap, cliprect, screen->machine().gfx[1]); + k007420_sprites_draw(state->m_k007420, bitmap, cliprect, screen.machine().gfx[1]); k007342_tilemap_draw(state->m_k007342, bitmap, cliprect, 0, 1 | TILEMAP_DRAW_OPAQUE, 0); k007342_tilemap_draw(state->m_k007342, bitmap, cliprect, 1, 0, 0); k007342_tilemap_draw(state->m_k007342, bitmap, cliprect, 1, 1, 0); diff --git a/src/mame/video/rocnrope.c b/src/mame/video/rocnrope.c index 79ee0d673ac..9903ae9c392 100644 --- a/src/mame/video/rocnrope.c +++ b/src/mame/video/rocnrope.c @@ -144,8 +144,8 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( rocnrope ) { - rocnrope_state *state = screen->machine().driver_data(); + rocnrope_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/rohga.c b/src/mame/video/rohga.c index 78f17274aa4..7bf62b01a92 100644 --- a/src/mame/video/rohga.c +++ b/src/mame/video/rohga.c @@ -419,20 +419,20 @@ sprite 2: /******************************************************************************/ -static void update_rohga( device_t *screen, bitmap_t *bitmap, const rectangle *cliprect, int is_schmeisr ) +static void update_rohga( screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int is_schmeisr ) { - rohga_state *state = screen->machine().driver_data(); + rohga_state *state = screen.machine().driver_data(); UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); UINT16 priority = decocomn_priority_r(state->m_decocomn, 0, 0xffff); /* Update playfields */ - flip_screen_set(screen->machine(), BIT(flip, 7)); + flip_screen_set(screen.machine(), BIT(flip, 7)); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); /* Draw playfields */ - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); - bitmap_fill(bitmap, cliprect, screen->machine().pens[768]); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); + bitmap_fill(bitmap, cliprect, screen.machine().pens[768]); switch (priority & 3) { @@ -462,7 +462,7 @@ static void update_rohga( device_t *screen, bitmap_t *bitmap, const rectangle *c break; } - rohga_draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram, is_schmeisr); + rohga_draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, is_schmeisr); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); } @@ -482,22 +482,22 @@ SCREEN_UPDATE( schmeisr ) SCREEN_UPDATE( wizdfire ) { - rohga_state *state = screen->machine().driver_data(); + rohga_state *state = screen.machine().driver_data(); UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); UINT16 priority = decocomn_priority_r(state->m_decocomn, 0, 0xffff); /* Update playfields */ - flip_screen_set(screen->machine(), BIT(flip, 7)); + flip_screen_set(screen.machine(), BIT(flip, 7)); deco16ic_pf_update(state->m_deco_tilegen1, 0, 0); deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); /* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */ - bitmap_fill(bitmap, cliprect, screen->machine().pens[512]); + bitmap_fill(bitmap, cliprect, screen.machine().pens[512]); deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); - wizdfire_draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 4, 3); + wizdfire_draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u16, 4, 3); deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); - wizdfire_draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 3, 3); + wizdfire_draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u16, 3, 3); if ((priority & 0x1f) == 0x1f) /* Wizdfire has bit 0x40 always set, Dark Seal 2 doesn't?! */ deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_ALPHA(0x80), 0); @@ -505,9 +505,9 @@ SCREEN_UPDATE( wizdfire ) deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 0); /* See notes in wizdfire_draw_sprites about this */ - wizdfire_draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0, 3); - wizdfire_draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram2.u16, 2, 4); - wizdfire_draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram2.u16, 1, 4); + wizdfire_draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u16, 0, 3); + wizdfire_draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram2.u16, 2, 4); + wizdfire_draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram2.u16, 1, 4); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; @@ -515,25 +515,25 @@ SCREEN_UPDATE( wizdfire ) SCREEN_UPDATE( nitrobal ) { - rohga_state *state = screen->machine().driver_data(); + rohga_state *state = screen.machine().driver_data(); UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); /* Update playfields */ - flip_screen_set(screen->machine(), BIT(flip, 7)); + flip_screen_set(screen.machine(), BIT(flip, 7)); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); /* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */ - bitmap_fill(bitmap, cliprect, screen->machine().pens[512]); - bitmap_fill(screen->machine().priority_bitmap, NULL, 0); + bitmap_fill(bitmap, cliprect, screen.machine().pens[512]); + bitmap_fill(screen.machine().priority_bitmap, NULL, 0); decocomn_clear_sprite_priority_bitmap(state->m_decocomn); /* pf3 and pf4 are combined into a single 8bpp bitmap */ deco16ic_tilemap_12_combine_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 16); - nitrobal_draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 3); - nitrobal_draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram2.u16, 4); + nitrobal_draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u16, 3); + nitrobal_draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram2.u16, 4); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/video/rollerg.c b/src/mame/video/rollerg.c index a842a2683dd..4bda152e1f2 100644 --- a/src/mame/video/rollerg.c +++ b/src/mame/video/rollerg.c @@ -61,10 +61,10 @@ VIDEO_START( rollerg ) SCREEN_UPDATE( rollerg ) { - rollerg_state *state = screen->machine().driver_data(); + rollerg_state *state = screen.machine().driver_data(); int bg_colorbase = 16; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 16 * bg_colorbase); k051316_zoom_draw(state->m_k051316, bitmap, cliprect, 0, 1); k053245_sprites_draw(state->m_k053244, bitmap, cliprect); diff --git a/src/mame/video/rollrace.c b/src/mame/video/rollrace.c index 4f2f19e9511..7fd08efffe8 100644 --- a/src/mame/video/rollrace.c +++ b/src/mame/video/rollrace.c @@ -103,13 +103,13 @@ WRITE8_HANDLER( rollrace_flipx_w ) SCREEN_UPDATE( rollrace ) { - rollrace_state *state = screen->machine().driver_data(); + rollrace_state *state = screen.machine().driver_data(); UINT8 *spriteram = state->m_spriteram; int offs; int sx, sy; int scroll; int col; - const UINT8 *mem = screen->machine().region("user1")->base(); + const UINT8 *mem = screen.machine().region("user1")->base(); /* fill in background colour*/ bitmap_fill(bitmap,cliprect,state->m_ra_bkgpen); @@ -133,7 +133,7 @@ SCREEN_UPDATE( rollrace ) sy = 31-sy ; drawgfx_transpen(bitmap, - cliprect,screen->machine().gfx[RA_BGCHAR_BASE], + cliprect,screen.machine().gfx[RA_BGCHAR_BASE], mem[offs + ( state->m_ra_bkgpage * 1024 )] + ((( mem[offs + 0x4000 + ( state->m_ra_bkgpage * 1024 )] & 0xc0 ) >> 6 ) * 256 ) , state->m_ra_bkgcol, @@ -171,7 +171,7 @@ SCREEN_UPDATE( rollrace ) if(bank) bank += state->m_ra_spritebank; - drawgfx_transpen(bitmap, cliprect,screen->machine().gfx[ RA_SP_BASE + bank ], + drawgfx_transpen(bitmap, cliprect,screen.machine().gfx[ RA_SP_BASE + bank ], spriteram[offs+1] & 0x3f , spriteram[offs+2] & 0x1f, state->m_ra_flipx,!(s_flipy^state->m_ra_flipy), @@ -199,7 +199,7 @@ SCREEN_UPDATE( rollrace ) if (state->m_ra_flipx) sx = 31 - sx; - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[RA_FGCHAR_BASE + state->m_ra_chrbank] , + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[RA_FGCHAR_BASE + state->m_ra_chrbank] , state->m_videoram[ offs ] , col, state->m_ra_flipx,state->m_ra_flipy, diff --git a/src/mame/video/route16.c b/src/mame/video/route16.c index 0bb486dd033..4cf4bbcdb1a 100644 --- a/src/mame/video/route16.c +++ b/src/mame/video/route16.c @@ -72,11 +72,11 @@ static pen_t ttmajng_make_pen(UINT8 color) SCREEN_UPDATE( route16 ) { - route16_state *state = screen->machine().driver_data(); + route16_state *state = screen.machine().driver_data(); offs_t offs; - UINT8 *color_prom1 = &screen->machine().region("proms")->base()[0x000]; - UINT8 *color_prom2 = &screen->machine().region("proms")->base()[0x100]; + UINT8 *color_prom1 = &screen.machine().region("proms")->base()[0x000]; + UINT8 *color_prom2 = &screen.machine().region("proms")->base()[0x100]; for (offs = 0; offs < state->m_videoram_size; offs++) { @@ -179,11 +179,11 @@ static int video_update_stratvox_ttmahjng(running_machine &machine, bitmap_t *bi SCREEN_UPDATE( stratvox ) { - return video_update_stratvox_ttmahjng(screen->machine(), bitmap, cliprect, route16_make_pen); + return video_update_stratvox_ttmahjng(screen.machine(), bitmap, cliprect, route16_make_pen); } SCREEN_UPDATE( ttmahjng ) { - return video_update_stratvox_ttmahjng(screen->machine(), bitmap, cliprect, ttmajng_make_pen); + return video_update_stratvox_ttmahjng(screen.machine(), bitmap, cliprect, ttmajng_make_pen); } diff --git a/src/mame/video/rpunch.c b/src/mame/video/rpunch.c index 5a2b1b48b56..0846b5825b0 100644 --- a/src/mame/video/rpunch.c +++ b/src/mame/video/rpunch.c @@ -274,17 +274,17 @@ static void draw_bitmap(running_machine &machine, bitmap_t *bitmap, const rectan SCREEN_UPDATE( rpunch ) { - rpunch_state *state = screen->machine().driver_data(); + rpunch_state *state = screen.machine().driver_data(); int effbins; /* this seems like the most plausible explanation */ effbins = (state->m_bins > state->m_gins) ? state->m_gins : state->m_bins; tilemap_draw(bitmap, cliprect, state->m_background[0], 0,0); - draw_sprites(screen->machine(), bitmap, cliprect, 0, effbins); + draw_sprites(screen.machine(), bitmap, cliprect, 0, effbins); tilemap_draw(bitmap, cliprect, state->m_background[1], 0,0); - draw_sprites(screen->machine(), bitmap, cliprect, effbins, state->m_gins); + draw_sprites(screen.machine(), bitmap, cliprect, effbins, state->m_gins); if (state->m_bitmapram) - draw_bitmap(screen->machine(), bitmap, cliprect); + draw_bitmap(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/runaway.c b/src/mame/video/runaway.c index 753e4fe741b..5d0a4da6817 100644 --- a/src/mame/video/runaway.c +++ b/src/mame/video/runaway.c @@ -91,7 +91,7 @@ VIDEO_START( qwak ) SCREEN_UPDATE( runaway ) { - runaway_state *state = screen->machine().driver_data(); + runaway_state *state = screen.machine().driver_data(); int i; tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); @@ -108,13 +108,13 @@ SCREEN_UPDATE( runaway ) code |= (state->m_sprite_ram[i + 0x30] << 2) & 0x1c0; - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], code, 0, flipx, flipy, x, 240 - y, 0); - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], code, 0, flipx, flipy, @@ -126,7 +126,7 @@ SCREEN_UPDATE( runaway ) SCREEN_UPDATE( qwak ) { - runaway_state *state = screen->machine().driver_data(); + runaway_state *state = screen.machine().driver_data(); int i; tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); @@ -143,13 +143,13 @@ SCREEN_UPDATE( qwak ) code |= (state->m_sprite_ram[i + 0x30] << 2) & 0x1c0; - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], code, 0, flipx, flipy, x, 240 - y, 0); - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], code, 0, flipx, flipy, diff --git a/src/mame/video/rungun.c b/src/mame/video/rungun.c index d1dd0c60046..9b72af717a5 100644 --- a/src/mame/video/rungun.c +++ b/src/mame/video/rungun.c @@ -105,10 +105,10 @@ VIDEO_START( rng ) SCREEN_UPDATE(rng) { - rungun_state *state = screen->machine().driver_data(); + rungun_state *state = screen.machine().driver_data(); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); k053936_zoom_draw(state->m_k053936, bitmap, cliprect, state->m_936_tilemap, 0, 0, 1); diff --git a/src/mame/video/sauro.c b/src/mame/video/sauro.c index 79b1e477628..f21348a24ea 100644 --- a/src/mame/video/sauro.c +++ b/src/mame/video/sauro.c @@ -156,11 +156,11 @@ static void sauro_draw_sprites(running_machine &machine, bitmap_t *bitmap, const SCREEN_UPDATE( sauro ) { - sauro_state *state = screen->machine().driver_data(); + sauro_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - sauro_draw_sprites(screen->machine(), bitmap, cliprect); + sauro_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } @@ -232,8 +232,8 @@ static void trckydoc_draw_sprites(running_machine &machine, bitmap_t *bitmap, co SCREEN_UPDATE( trckydoc ) { - sauro_state *state = screen->machine().driver_data(); + sauro_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - trckydoc_draw_sprites(screen->machine(), bitmap, cliprect); + trckydoc_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/sbasketb.c b/src/mame/video/sbasketb.c index 1fdc75a2fb9..9c369ca8f6c 100644 --- a/src/mame/video/sbasketb.c +++ b/src/mame/video/sbasketb.c @@ -173,13 +173,13 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( sbasketb ) { - sbasketb_state *state = screen->machine().driver_data(); + sbasketb_state *state = screen.machine().driver_data(); int col; for (col = 6; col < 32; col++) tilemap_set_scrolly(state->m_bg_tilemap, col, *state->m_scroll); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/sbugger.c b/src/mame/video/sbugger.c index 0e80d194ddd..9c18846338a 100644 --- a/src/mame/video/sbugger.c +++ b/src/mame/video/sbugger.c @@ -38,7 +38,7 @@ VIDEO_START(sbugger) SCREEN_UPDATE(sbugger) { - sbugger_state *state = screen->machine().driver_data(); + sbugger_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_tilemap,0,0); return 0; } diff --git a/src/mame/video/scotrsht.c b/src/mame/video/scotrsht.c index ac395246af2..957ffd1afbc 100644 --- a/src/mame/video/scotrsht.c +++ b/src/mame/video/scotrsht.c @@ -140,13 +140,13 @@ VIDEO_START( scotrsht ) SCREEN_UPDATE( scotrsht ) { - scotrsht_state *state = screen->machine().driver_data(); + scotrsht_state *state = screen.machine().driver_data(); int col; for (col = 0; col < 32; col++) tilemap_set_scrolly(state->m_bg_tilemap, col, state->m_scroll[col]); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/sderby.c b/src/mame/video/sderby.c index 5f150f4b02e..c697408c01e 100644 --- a/src/mame/video/sderby.c +++ b/src/mame/video/sderby.c @@ -110,10 +110,10 @@ VIDEO_START( sderby ) SCREEN_UPDATE( sderby ) { - sderby_state *state = screen->machine().driver_data(); + sderby_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect,0); + draw_sprites(screen.machine(), bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_md_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); return 0; @@ -121,11 +121,11 @@ SCREEN_UPDATE( sderby ) SCREEN_UPDATE( pmroulet ) { - sderby_state *state = screen->machine().driver_data(); + sderby_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_md_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect,0); + draw_sprites(screen.machine(), bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); return 0; } diff --git a/src/mame/video/sega16sp.c b/src/mame/video/sega16sp.c index 6e528289081..b036ba44061 100644 --- a/src/mame/video/sega16sp.c +++ b/src/mame/video/sega16sp.c @@ -1455,15 +1455,15 @@ void segaic16_sprites_16a_bootleg_shinobld_draw(running_machine &machine, device * *************************************/ -void segaic16_sprites_draw(device_t *screen, bitmap_t *bitmap, const rectangle *cliprect, int which) +void segaic16_sprites_draw(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int which) { device_t* device = 0; sega16sp_state *sega16sp; if (!which) - device = screen->machine().device("segaspr1"); + device = screen.machine().device("segaspr1"); else - device = screen->machine().device("segaspr2"); + device = screen.machine().device("segaspr2"); if (!device) fatalerror("segaic16_sprites_draw device not found\n"); @@ -1475,7 +1475,7 @@ void segaic16_sprites_draw(device_t *screen, bitmap_t *bitmap, const rectangle * else sega16sp->spriteram = segaic16_spriteram_1; - (*sega16sp->draw)(screen->machine(), device, bitmap, cliprect); + (*sega16sp->draw)(screen.machine(), device, bitmap, cliprect); } @@ -1502,8 +1502,8 @@ void segaic16_sprites_set_bank(running_machine &machine, int which, int banknum, if (sega16sp->bank[banknum] != offset) { - screen_device *screen = machine.primary_screen; - screen->update_partial(screen->vpos()); + screen_device &screen = *machine.primary_screen; + screen.update_partial(screen.vpos()); sega16sp->bank[banknum] = offset; } } @@ -1533,8 +1533,8 @@ void segaic16_sprites_set_flip(running_machine &machine, int which, int flip) flip = (flip != 0); if (sega16sp->flip != flip) { - screen_device *screen = machine.primary_screen; - screen->update_partial(screen->vpos()); + screen_device &screen = *machine.primary_screen; + screen.update_partial(screen.vpos()); sega16sp->flip = flip; } } @@ -1564,8 +1564,8 @@ void segaic16_sprites_set_shadow(running_machine &machine, int which, int shadow shadow = (shadow != 0); if (sega16sp->shadow != shadow) { - screen_device *screen = machine.primary_screen; - screen->update_partial(screen->vpos()); + screen_device &screen = *machine.primary_screen; + screen.update_partial(screen.vpos()); sega16sp->shadow = shadow; } } diff --git a/src/mame/video/segag80r.c b/src/mame/video/segag80r.c index 4738ec3f756..5fbe00a4343 100644 --- a/src/mame/video/segag80r.c +++ b/src/mame/video/segag80r.c @@ -811,7 +811,7 @@ static void draw_background_full_scroll(running_machine &machine, bitmap_t *bitm SCREEN_UPDATE( segag80r ) { - segag80r_state *state = screen->machine().driver_data(); + segag80r_state *state = screen.machine().driver_data(); UINT8 transparent_pens[16]; switch (state->m_background_pcb) @@ -820,7 +820,7 @@ SCREEN_UPDATE( segag80r ) /* background: none */ case G80_BACKGROUND_NONE: memset(transparent_pens, 0, 16); - draw_videoram(screen->machine(), bitmap, cliprect, transparent_pens); + draw_videoram(screen.machine(), bitmap, cliprect, transparent_pens); break; /* foreground: visible except where black */ @@ -828,32 +828,32 @@ SCREEN_UPDATE( segag80r ) /* we draw the foreground first, then the background to do collision detection */ case G80_BACKGROUND_SPACEOD: memset(transparent_pens, 0, 16); - draw_videoram(screen->machine(), bitmap, cliprect, transparent_pens); - draw_background_spaceod(screen->machine(), bitmap, cliprect); + draw_videoram(screen.machine(), bitmap, cliprect, transparent_pens); + draw_background_spaceod(screen.machine(), bitmap, cliprect); break; /* foreground: visible except for pen 0 (this disagrees with schematics) */ /* background: page-granular scrolling */ case G80_BACKGROUND_MONSTERB: memset(transparent_pens, 1, 16); - draw_background_page_scroll(screen->machine(), bitmap, cliprect); - draw_videoram(screen->machine(), bitmap, cliprect, transparent_pens); + draw_background_page_scroll(screen.machine(), bitmap, cliprect); + draw_videoram(screen.machine(), bitmap, cliprect, transparent_pens); break; /* foreground: visible except for pen 0 */ /* background: full scrolling */ case G80_BACKGROUND_PIGNEWT: memset(transparent_pens, 1, 16); - draw_background_full_scroll(screen->machine(), bitmap, cliprect); - draw_videoram(screen->machine(), bitmap, cliprect, transparent_pens); + draw_background_full_scroll(screen.machine(), bitmap, cliprect); + draw_videoram(screen.machine(), bitmap, cliprect, transparent_pens); break; /* foreground: visible except for pen 0 */ /* background: page-granular scrolling */ case G80_BACKGROUND_SINDBADM: memset(transparent_pens, 1, 16); - draw_background_page_scroll(screen->machine(), bitmap, cliprect); - draw_videoram(screen->machine(), bitmap, cliprect, transparent_pens); + draw_background_page_scroll(screen.machine(), bitmap, cliprect); + draw_videoram(screen.machine(), bitmap, cliprect, transparent_pens); break; } return 0; diff --git a/src/mame/video/segag80v.c b/src/mame/video/segag80v.c index 68ed0045cbc..d990aa62182 100644 --- a/src/mame/video/segag80v.c +++ b/src/mame/video/segag80v.c @@ -337,7 +337,7 @@ VIDEO_START( segag80v ) SCREEN_UPDATE( segag80v ) { - sega_generate_vector_list(screen->machine()); + sega_generate_vector_list(screen.machine()); SCREEN_UPDATE_CALL(vector); return 0; } diff --git a/src/mame/video/segahang.c b/src/mame/video/segahang.c index ccad73ad8ec..538cc057063 100644 --- a/src/mame/video/segahang.c +++ b/src/mame/video/segahang.c @@ -54,12 +54,12 @@ SCREEN_UPDATE( hangon ) /* if no drawing is happening, fill with black and get out */ if (!segaic16_display_enable) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } /* reset priorities */ - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); /* draw the low priority road layer */ segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND); diff --git a/src/mame/video/segaic16.c b/src/mame/video/segaic16.c index 493aff16db1..70aa9cf4eb1 100644 --- a/src/mame/video/segaic16.c +++ b/src/mame/video/segaic16.c @@ -1224,9 +1224,9 @@ void segaic16_tilemap_init(running_machine &machine, int which, int type, int co * *************************************/ -void segaic16_tilemap_draw(device_t *screen, bitmap_t *bitmap, const rectangle *cliprect, int which, int map, int priority, int priority_mark) +void segaic16_tilemap_draw(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int which, int map, int priority, int priority_mark) { - running_machine &machine = screen->machine(); + running_machine &machine = screen.machine(); struct tilemap_info *info = &bg_tilemap[which]; /* text layer is a special common case */ @@ -1268,8 +1268,8 @@ void segaic16_tilemap_set_bank(running_machine &machine, int which, int banknum, if (info->bank[banknum] != offset) { - screen_device *screen = machine.primary_screen; - screen->update_partial(screen->vpos()); + screen_device &screen = *machine.primary_screen; + screen.update_partial(screen.vpos()); info->bank[banknum] = offset; tilemap_mark_all_tiles_dirty_all(machine); } @@ -1291,8 +1291,8 @@ void segaic16_tilemap_set_flip(running_machine &machine, int which, int flip) flip = (flip != 0); if (info->flip != flip) { - screen_device *screen = machine.primary_screen; - screen->update_partial(screen->vpos()); + screen_device &screen = *machine.primary_screen; + screen.update_partial(screen.vpos()); info->flip = flip; tilemap_set_flip(info->textmap, flip ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); for (pagenum = 0; pagenum < info->numpages; pagenum++) @@ -1315,8 +1315,8 @@ void segaic16_tilemap_set_rowscroll(running_machine &machine, int which, int ena enable = (enable != 0); if (info->rowscroll != enable) { - screen_device *screen = machine.primary_screen; - screen->update_partial(screen->vpos()); + screen_device &screen = *machine.primary_screen; + screen.update_partial(screen.vpos()); info->rowscroll = enable; } } @@ -1336,8 +1336,8 @@ void segaic16_tilemap_set_colscroll(running_machine &machine, int which, int ena enable = (enable != 0); if (info->colscroll != enable) { - screen_device *screen = machine.primary_screen; - screen->update_partial(screen->vpos()); + screen_device &screen = *machine.primary_screen; + screen.update_partial(screen.vpos()); info->colscroll = enable; } } diff --git a/src/mame/video/segaic16.h b/src/mame/video/segaic16.h index 2200d9edef0..fc59f7973e0 100644 --- a/src/mame/video/segaic16.h +++ b/src/mame/video/segaic16.h @@ -37,7 +37,7 @@ WRITE16_HANDLER( segaic16_paletteram_w ); void segaic16_tilemap_init(running_machine &machine, int which, int type, int colorbase, int xoffs, int numbanks); void segaic16_tilemap_reset(running_machine &machine, int which); -void segaic16_tilemap_draw(device_t *screen, bitmap_t *bitmap, const rectangle *cliprect, int which, int map, int priority, int priority_mark); +void segaic16_tilemap_draw(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int which, int map, int priority, int priority_mark); void segaic16_tilemap_set_bank(running_machine &machine, int which, int banknum, int offset); void segaic16_tilemap_set_flip(running_machine &machine, int which, int flip); void segaic16_tilemap_set_rowscroll(running_machine &machine, int which, int enable); @@ -52,7 +52,7 @@ WRITE16_HANDLER( segaic16_textram_0_w ); #define SEGAIC16_SPRITES_OUTRUN 4 #define SEGAIC16_SPRITES_XBOARD 5 -void segaic16_sprites_draw(device_t *screen, bitmap_t *bitmap, const rectangle *cliprect, int which); +void segaic16_sprites_draw(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int which); void segaic16_sprites_set_bank(running_machine &machine, int which, int banknum, int offset); void segaic16_sprites_set_flip(running_machine &machine, int which, int flip); void segaic16_sprites_set_shadow(running_machine &machine, int which, int shadow); diff --git a/src/mame/video/segaorun.c b/src/mame/video/segaorun.c index 31212d9b510..03959285082 100644 --- a/src/mame/video/segaorun.c +++ b/src/mame/video/segaorun.c @@ -52,7 +52,7 @@ VIDEO_START( outrun ) SCREEN_UPDATE( shangon ) { /* reset priorities */ - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); /* draw the low priority road layer */ segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND); @@ -85,12 +85,12 @@ SCREEN_UPDATE( outrun ) /* if no drawing is happening, fill with black and get out */ if (!segaic16_display_enable) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } /* reset priorities */ - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); /* draw the low priority road layer */ segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND); diff --git a/src/mame/video/segas16a.c b/src/mame/video/segas16a.c index ad86b37eb8c..8f4574fc893 100644 --- a/src/mame/video/segas16a.c +++ b/src/mame/video/segas16a.c @@ -38,12 +38,12 @@ SCREEN_UPDATE( system16a ) /* if no drawing is happening, fill with black and get out */ if (!segaic16_display_enable) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } /* reset priorities */ - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); /* draw background opaquely first, not setting any priorities */ segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00); diff --git a/src/mame/video/segas16b.c b/src/mame/video/segas16b.c index 404f5c9a83f..f48748246f4 100644 --- a/src/mame/video/segas16b.c +++ b/src/mame/video/segas16b.c @@ -50,12 +50,12 @@ SCREEN_UPDATE( system16b ) /* if no drawing is happening, fill with black and get out */ if (!segaic16_display_enable) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } /* reset priorities */ - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); /* draw background opaquely first, not setting any priorities */ segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00); diff --git a/src/mame/video/segas18.c b/src/mame/video/segas18.c index ceedc24ec9b..81a782e6add 100644 --- a/src/mame/video/segas18.c +++ b/src/mame/video/segas18.c @@ -116,11 +116,11 @@ void system18_set_vdp_mixing(running_machine &machine, int mixing) * *************************************/ -static void draw_vdp(device_t *screen, bitmap_t *bitmap, const rectangle *cliprect, int priority) +static void draw_vdp(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int priority) { - segas1x_state *state = screen->machine().driver_data(); + segas1x_state *state = screen.machine().driver_data(); int x, y; - bitmap_t *priority_bitmap = screen->machine().priority_bitmap; + bitmap_t *priority_bitmap = screen.machine().priority_bitmap; for (y = cliprect->min_y; y <= cliprect->max_y; y++) { @@ -150,7 +150,7 @@ static void draw_vdp(device_t *screen, bitmap_t *bitmap, const rectangle *clipre SCREEN_UPDATE( system18 ) { - segas1x_state *state = screen->machine().driver_data(); + segas1x_state *state = screen.machine().driver_data(); int vdppri, vdplayer; /* @@ -188,21 +188,21 @@ SCREEN_UPDATE( system18 ) vdppri = (state->m_vdp_mixing & 1) ? (1 << vdplayer) : 0; #if DEBUG_VDP - if (screen->machine().input().code_pressed(KEYCODE_Q)) vdplayer = 0; - if (screen->machine().input().code_pressed(KEYCODE_W)) vdplayer = 1; - if (screen->machine().input().code_pressed(KEYCODE_E)) vdplayer = 2; - if (screen->machine().input().code_pressed(KEYCODE_R)) vdplayer = 3; - if (screen->machine().input().code_pressed(KEYCODE_A)) vdppri = 0x00; - if (screen->machine().input().code_pressed(KEYCODE_S)) vdppri = 0x01; - if (screen->machine().input().code_pressed(KEYCODE_D)) vdppri = 0x02; - if (screen->machine().input().code_pressed(KEYCODE_F)) vdppri = 0x04; - if (screen->machine().input().code_pressed(KEYCODE_G)) vdppri = 0x08; + if (screen.machine().input().code_pressed(KEYCODE_Q)) vdplayer = 0; + if (screen.machine().input().code_pressed(KEYCODE_W)) vdplayer = 1; + if (screen.machine().input().code_pressed(KEYCODE_E)) vdplayer = 2; + if (screen.machine().input().code_pressed(KEYCODE_R)) vdplayer = 3; + if (screen.machine().input().code_pressed(KEYCODE_A)) vdppri = 0x00; + if (screen.machine().input().code_pressed(KEYCODE_S)) vdppri = 0x01; + if (screen.machine().input().code_pressed(KEYCODE_D)) vdppri = 0x02; + if (screen.machine().input().code_pressed(KEYCODE_F)) vdppri = 0x04; + if (screen.machine().input().code_pressed(KEYCODE_G)) vdppri = 0x08; #endif /* if no drawing is happening, fill with black and get out */ if (!segaic16_display_enable) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } @@ -211,7 +211,7 @@ SCREEN_UPDATE( system18 ) system18_vdp_update(state->m_tmp_bitmap, cliprect); /* reset priorities */ - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); /* draw background opaquely first, not setting any priorities */ segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00); @@ -237,12 +237,12 @@ SCREEN_UPDATE( system18 ) segaic16_sprites_draw(screen, bitmap, cliprect, 0); #if DEBUG_VDP - if (state->m_vdp_enable && screen->machine().input().code_pressed(KEYCODE_V)) + if (state->m_vdp_enable && screen.machine().input().code_pressed(KEYCODE_V)) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); update_system18_vdp(bitmap, cliprect); } - if (vdp_enable && screen->machine().input().code_pressed(KEYCODE_B)) + if (vdp_enable && screen.machine().input().code_pressed(KEYCODE_B)) { FILE *f = fopen("vdp.bin", "w"); fwrite(state->m_tmp_bitmap->base, 1, state->m_tmp_bitmap->rowpixels * (state->m_tmp_bitmap->bpp / 8) * state->m_tmp_bitmap->height, f); diff --git a/src/mame/video/segas24.c b/src/mame/video/segas24.c index 4e1cee5400d..49b140111be 100644 --- a/src/mame/video/segas24.c +++ b/src/mame/video/segas24.c @@ -25,14 +25,14 @@ namespace { SCREEN_UPDATE(system24) { - segas24_state *state = screen->machine().driver_data(); + segas24_state *state = screen.machine().driver_data(); if(state->vmixer->get_reg(13) & 1) { - bitmap_fill(bitmap, 0, get_black_pen(screen->machine())); + bitmap_fill(bitmap, 0, get_black_pen(screen.machine())); return 0; } - bitmap_fill(screen->machine().priority_bitmap, 0, 0); + bitmap_fill(screen.machine().priority_bitmap, 0, 0); bitmap_fill(bitmap, cliprect, 0); std::vector order; diff --git a/src/mame/video/segas32.c b/src/mame/video/segas32.c index fc855cbf34d..84572f58204 100644 --- a/src/mame/video/segas32.c +++ b/src/mame/video/segas32.c @@ -2423,35 +2423,35 @@ static void print_mixer_data(segas32_state *state, int which) SCREEN_UPDATE( system32 ) { - segas32_state *state = screen->machine().driver_data(); + segas32_state *state = screen.machine().driver_data(); UINT8 enablemask; /* update the visible area */ if (state->m_system32_videoram[0x1ff00/2] & 0x8000) - screen->set_visible_area(0, 52*8-1, 0, 28*8-1); + screen.set_visible_area(0, 52*8-1, 0, 28*8-1); else - screen->set_visible_area(0, 40*8-1, 0, 28*8-1); + screen.set_visible_area(0, 40*8-1, 0, 28*8-1); /* if the display is off, punt */ if (!state->m_system32_displayenable[0]) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } /* update the tilemaps */ g_profiler.start(PROFILER_USER1); - enablemask = update_tilemaps(*screen, cliprect); + enablemask = update_tilemaps(screen, cliprect); g_profiler.stop(); /* debugging */ #if QWERTY_LAYER_ENABLE - if (screen->machine().input().code_pressed(KEYCODE_Q)) enablemask = 0x01; - if (screen->machine().input().code_pressed(KEYCODE_W)) enablemask = 0x02; - if (screen->machine().input().code_pressed(KEYCODE_E)) enablemask = 0x04; - if (screen->machine().input().code_pressed(KEYCODE_R)) enablemask = 0x08; - if (screen->machine().input().code_pressed(KEYCODE_T)) enablemask = 0x10; - if (screen->machine().input().code_pressed(KEYCODE_Y)) enablemask = 0x20; + if (screen.machine().input().code_pressed(KEYCODE_Q)) enablemask = 0x01; + if (screen.machine().input().code_pressed(KEYCODE_W)) enablemask = 0x02; + if (screen.machine().input().code_pressed(KEYCODE_E)) enablemask = 0x04; + if (screen.machine().input().code_pressed(KEYCODE_R)) enablemask = 0x08; + if (screen.machine().input().code_pressed(KEYCODE_T)) enablemask = 0x10; + if (screen.machine().input().code_pressed(KEYCODE_Y)) enablemask = 0x20; #endif /* do the mixing */ @@ -2459,9 +2459,9 @@ SCREEN_UPDATE( system32 ) mix_all_layers(state, 0, 0, bitmap, cliprect, enablemask); g_profiler.stop(); - if (LOG_SPRITES && screen->machine().input().code_pressed(KEYCODE_L)) + if (LOG_SPRITES && screen.machine().input().code_pressed(KEYCODE_L)) { - const rectangle &visarea = screen->visible_area(); + const rectangle &visarea = screen.visible_area(); FILE *f = fopen("sprite.txt", "w"); int x, y; @@ -2537,13 +2537,13 @@ SCREEN_UPDATE( system32 ) { int showclip = -1; -// if (screen->machine().input().code_pressed(KEYCODE_V)) +// if (screen.machine().input().code_pressed(KEYCODE_V)) // showclip = 0; -// if (screen->machine().input().code_pressed(KEYCODE_B)) +// if (screen.machine().input().code_pressed(KEYCODE_B)) // showclip = 1; -// if (screen->machine().input().code_pressed(KEYCODE_N)) +// if (screen.machine().input().code_pressed(KEYCODE_N)) // showclip = 2; -// if (screen->machine().input().code_pressed(KEYCODE_M)) +// if (screen.machine().input().code_pressed(KEYCODE_M)) // showclip = 3; // if (showclip != -1) for (showclip = 0; showclip < 4; showclip++) @@ -2556,10 +2556,10 @@ for (showclip = 0; showclip < 4; showclip++) for (i = 0; i < 4; i++) if (clips & (1 << i)) { - const rectangle &visarea = screen->visible_area(); + const rectangle &visarea = screen.visible_area(); rectangle rect; - pen_t white = get_white_pen(screen->machine()); + pen_t white = get_white_pen(screen.machine()); if (!flip) { rect.min_x = state->m_system32_videoram[0x1ff60/2 + i * 4] & 0x1ff; @@ -2574,7 +2574,7 @@ for (showclip = 0; showclip < 4; showclip++) rect.min_x = (visarea.max_x + 1) - ((state->m_system32_videoram[0x1ff64/2 + i * 4] & 0x1ff) + 1); rect.min_y = (visarea.max_y + 1) - ((state->m_system32_videoram[0x1ff66/2 + i * 4] & 0x0ff) + 1); } - sect_rect(&rect, &screen->visible_area()); + sect_rect(&rect, &screen.visible_area()); if (rect.min_y <= rect.max_y && rect.min_x <= rect.max_x) { @@ -2600,54 +2600,52 @@ for (showclip = 0; showclip < 4; showclip++) } -SCREEN_UPDATE( multi32 ) +static UINT32 multi32_update(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int index) { - segas32_state *state = screen->machine().driver_data(); + segas32_state *state = screen.machine().driver_data(); UINT8 enablemask; - device_t *left_screen = screen->machine().device("lscreen"); - /* update the visible area */ if (state->m_system32_videoram[0x1ff00/2] & 0x8000) - screen->set_visible_area(0, 52*8-1, 0, 28*8-1); + screen.set_visible_area(0, 52*8-1, 0, 28*8-1); else - screen->set_visible_area(0, 40*8-1, 0, 28*8-1); + screen.set_visible_area(0, 40*8-1, 0, 28*8-1); /* if the display is off, punt */ - if (!state->m_system32_displayenable[(screen == left_screen) ? 0 : 1]) + if (!state->m_system32_displayenable[index]) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } /* update the tilemaps */ g_profiler.start(PROFILER_USER1); - enablemask = update_tilemaps(*screen, cliprect); + enablemask = update_tilemaps(screen, cliprect); g_profiler.stop(); /* debugging */ #if QWERTY_LAYER_ENABLE - if (screen->machine().input().code_pressed(KEYCODE_Q)) enablemask = 0x01; - if (screen->machine().input().code_pressed(KEYCODE_W)) enablemask = 0x02; - if (screen->machine().input().code_pressed(KEYCODE_E)) enablemask = 0x04; - if (screen->machine().input().code_pressed(KEYCODE_R)) enablemask = 0x08; - if (screen->machine().input().code_pressed(KEYCODE_T)) enablemask = 0x10; - if (screen->machine().input().code_pressed(KEYCODE_Y)) enablemask = 0x20; + if (screen.machine().input().code_pressed(KEYCODE_Q)) enablemask = 0x01; + if (screen.machine().input().code_pressed(KEYCODE_W)) enablemask = 0x02; + if (screen.machine().input().code_pressed(KEYCODE_E)) enablemask = 0x04; + if (screen.machine().input().code_pressed(KEYCODE_R)) enablemask = 0x08; + if (screen.machine().input().code_pressed(KEYCODE_T)) enablemask = 0x10; + if (screen.machine().input().code_pressed(KEYCODE_Y)) enablemask = 0x20; #endif /* do the mixing */ g_profiler.start(PROFILER_USER3); - mix_all_layers(state, ((screen == left_screen) ? 0 : 1), 0, bitmap, cliprect, enablemask); + mix_all_layers(state, index, 0, bitmap, cliprect, enablemask); g_profiler.stop(); if (PRINTF_MIXER_DATA) { - if (!screen->machine().input().code_pressed(KEYCODE_M)) print_mixer_data(state, 0); + if (!screen.machine().input().code_pressed(KEYCODE_M)) print_mixer_data(state, 0); else print_mixer_data(state, 1); } - if (LOG_SPRITES && screen->machine().input().code_pressed(KEYCODE_L)) + if (LOG_SPRITES && screen.machine().input().code_pressed(KEYCODE_L)) { - const rectangle &visarea = screen->visible_area(); + const rectangle &visarea = screen.visible_area(); FILE *f = fopen("sprite.txt", "w"); int x, y; @@ -2664,6 +2662,8 @@ if (PRINTF_MIXER_DATA) return 0; } +SCREEN_UPDATE( multi32_left ) { return multi32_update(screen, bitmap, cliprect, 0); } +SCREEN_UPDATE( multi32_right ) { return multi32_update(screen, bitmap, cliprect, 1); } /* diff --git a/src/mame/video/segaxbd.c b/src/mame/video/segaxbd.c index 1248290b19c..2fca5284eb7 100644 --- a/src/mame/video/segaxbd.c +++ b/src/mame/video/segaxbd.c @@ -36,17 +36,17 @@ VIDEO_START( xboard ) SCREEN_UPDATE( xboard ) { - segas1x_state *state = screen->machine().driver_data(); + segas1x_state *state = screen.machine().driver_data(); /* if no drawing is happening, fill with black and get out */ if (!segaic16_display_enable) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } /* reset priorities */ - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); /* draw the low priority road layer */ segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND); diff --git a/src/mame/video/segaybd.c b/src/mame/video/segaybd.c index bcea3bba4f1..aae106f80a4 100644 --- a/src/mame/video/segaybd.c +++ b/src/mame/video/segaybd.c @@ -41,13 +41,13 @@ VIDEO_START( yboard ) SCREEN_UPDATE( yboard ) { - segas1x_state *state = screen->machine().driver_data(); + segas1x_state *state = screen.machine().driver_data(); rectangle yboard_clip; /* if no drawing is happening, fill with black and get out */ if (!segaic16_display_enable) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } @@ -57,7 +57,7 @@ SCREEN_UPDATE( yboard ) segaic16_sprites_draw(screen, state->m_tmp_bitmap, &yboard_clip, 1); /* apply rotation */ - segaic16_rotate_draw(screen->machine(), 0, bitmap, cliprect, state->m_tmp_bitmap); + segaic16_rotate_draw(screen.machine(), 0, bitmap, cliprect, state->m_tmp_bitmap); /* draw the 16B sprites */ segaic16_sprites_draw(screen, bitmap, cliprect, 0); diff --git a/src/mame/video/sei_crtc.c b/src/mame/video/sei_crtc.c index 423c76109f8..d1dd90ce4a3 100644 --- a/src/mame/video/sei_crtc.c +++ b/src/mame/video/sei_crtc.c @@ -271,7 +271,7 @@ VIDEO_START( seibu_crtc ) SCREEN_UPDATE( seibu_crtc ) { - bitmap_fill(bitmap, cliprect, screen->machine().pens[0x7ff]); //black pen + bitmap_fill(bitmap, cliprect, screen.machine().pens[0x7ff]); //black pen tilemap_set_scrollx( sc0_tilemap,0, (SEIBU_CRTC_SC0_SX + SEIBU_CRTC_FIX_SX+64) & 0x1ff ); tilemap_set_scrolly( sc0_tilemap,0, (SEIBU_CRTC_SC0_SY + SEIBU_CRTC_FIX_SY+1) & 0x1ff ); @@ -283,13 +283,13 @@ SCREEN_UPDATE( seibu_crtc ) tilemap_set_scrolly( SEIBU_CRTC_SC3_PAGE_SEL ? sc3_tilemap_0 : sc3_tilemap_1,0, (SEIBU_CRTC_FIX_SY+1) & 0x1ff ); if(SEIBU_CRTC_ENABLE_SC0) { tilemap_draw(bitmap,cliprect,sc0_tilemap,0,0); } - if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen->machine(), bitmap,cliprect, 2); } + if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen.machine(), bitmap,cliprect, 2); } if(SEIBU_CRTC_ENABLE_SC2) { tilemap_draw(bitmap,cliprect,sc2_tilemap,0,0); } - if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen->machine(), bitmap,cliprect, 1); } + if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen.machine(), bitmap,cliprect, 1); } if(SEIBU_CRTC_ENABLE_SC1) { tilemap_draw(bitmap,cliprect,sc1_tilemap,0,0); } - if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen->machine(), bitmap,cliprect, 0); } + if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen.machine(), bitmap,cliprect, 0); } if(SEIBU_CRTC_ENABLE_SC3) { tilemap_draw(bitmap,cliprect,SEIBU_CRTC_SC3_PAGE_SEL ? sc3_tilemap_0 : sc3_tilemap_1,0,0); } - if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen->machine(), bitmap,cliprect, 3); } + if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen.machine(), bitmap,cliprect, 3); } return 0; } diff --git a/src/mame/video/seibuspi.c b/src/mame/video/seibuspi.c index 35654476592..5d925faf7d2 100644 --- a/src/mame/video/seibuspi.c +++ b/src/mame/video/seibuspi.c @@ -609,7 +609,7 @@ static void combine_tilemap(running_machine &machine, bitmap_t *bitmap, const re SCREEN_UPDATE( spi ) { - seibuspi_state *state = screen->machine().driver_data(); + seibuspi_state *state = screen.machine().driver_data(); INT16 *back_rowscroll, *mid_rowscroll, *fore_rowscroll; if( state->m_layer_bank & 0x80000000 ) { back_rowscroll = (INT16*)&state->m_tilemap_ram[0x200]; @@ -625,29 +625,29 @@ SCREEN_UPDATE( spi ) bitmap_fill(bitmap, cliprect, 0); if (!(state->m_layer_enable & 0x1)) - combine_tilemap(screen->machine(), bitmap, cliprect, state->m_back_layer, state->m_spi_scrollram[0] & 0xffff, (state->m_spi_scrollram[0] >> 16) & 0xffff, 1, back_rowscroll); + combine_tilemap(screen.machine(), bitmap, cliprect, state->m_back_layer, state->m_spi_scrollram[0] & 0xffff, (state->m_spi_scrollram[0] >> 16) & 0xffff, 1, back_rowscroll); - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0); // if fore layer is enabled, draw priority 1 sprites behind mid layer if (!(state->m_layer_enable & 0x4)) - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); if (!(state->m_layer_enable & 0x2)) - combine_tilemap(screen->machine(), bitmap, cliprect, state->m_mid_layer, state->m_spi_scrollram[1] & 0xffff, (state->m_spi_scrollram[1] >> 16) & 0xffff, 0, mid_rowscroll); + combine_tilemap(screen.machine(), bitmap, cliprect, state->m_mid_layer, state->m_spi_scrollram[1] & 0xffff, (state->m_spi_scrollram[1] >> 16) & 0xffff, 0, mid_rowscroll); // if fore layer is disabled, draw priority 1 sprites above mid layer if ((state->m_layer_enable & 0x4)) - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); - draw_sprites(screen->machine(), bitmap, cliprect, 2); + draw_sprites(screen.machine(), bitmap, cliprect, 2); if (!(state->m_layer_enable & 0x4)) - combine_tilemap(screen->machine(), bitmap, cliprect, state->m_fore_layer, state->m_spi_scrollram[2] & 0xffff, (state->m_spi_scrollram[2] >> 16) & 0xffff, 0, fore_rowscroll); + combine_tilemap(screen.machine(), bitmap, cliprect, state->m_fore_layer, state->m_spi_scrollram[2] & 0xffff, (state->m_spi_scrollram[2] >> 16) & 0xffff, 0, fore_rowscroll); - draw_sprites(screen->machine(), bitmap, cliprect, 3); + draw_sprites(screen.machine(), bitmap, cliprect, 3); - combine_tilemap(screen->machine(), bitmap, cliprect, state->m_text_layer, 0, 0, 0, NULL); + combine_tilemap(screen.machine(), bitmap, cliprect, state->m_text_layer, 0, 0, 0, NULL); return 0; } @@ -673,9 +673,9 @@ VIDEO_START( sys386f2 ) SCREEN_UPDATE( sys386f2 ) { bitmap_fill(bitmap, cliprect, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 1); - draw_sprites(screen->machine(), bitmap, cliprect, 2); - draw_sprites(screen->machine(), bitmap, cliprect, 3); + draw_sprites(screen.machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 2); + draw_sprites(screen.machine(), bitmap, cliprect, 3); return 0; } diff --git a/src/mame/video/seicross.c b/src/mame/video/seicross.c index 514130633e6..a961917ba16 100644 --- a/src/mame/video/seicross.c +++ b/src/mame/video/seicross.c @@ -139,13 +139,13 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( seicross ) { - seicross_state *state = screen->machine().driver_data(); + seicross_state *state = screen.machine().driver_data(); int col; for (col = 0; col < 32; col++) tilemap_set_scrolly(state->m_bg_tilemap, col, state->m_row_scroll[col]); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/senjyo.c b/src/mame/video/senjyo.c index afcabce79d0..7f1de72f6df 100644 --- a/src/mame/video/senjyo.c +++ b/src/mame/video/senjyo.c @@ -291,16 +291,16 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( senjyo ) { - senjyo_state *state = screen->machine().driver_data(); + senjyo_state *state = screen.machine().driver_data(); int i; /* two colors for the radar dots (verified on the real board) */ - palette_set_color(screen->machine(),512,MAKE_RGB(0xff,0x00,0x00)); /* red for enemies */ - palette_set_color(screen->machine(),513,MAKE_RGB(0xff,0xff,0x00)); /* yellow for player */ + palette_set_color(screen.machine(),512,MAKE_RGB(0xff,0x00,0x00)); /* red for enemies */ + palette_set_color(screen.machine(),513,MAKE_RGB(0xff,0xff,0x00)); /* yellow for player */ { - int flip = flip_screen_get(screen->machine()); + int flip = flip_screen_get(screen.machine()); int scrollx,scrolly; for (i = 0;i < 32;i++) @@ -333,16 +333,16 @@ SCREEN_UPDATE( senjyo ) tilemap_set_scrolly(state->m_bg3_tilemap, 0, scrolly); } - draw_bgbitmap(screen->machine(), bitmap, cliprect); - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_bgbitmap(screen.machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg3_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 2); + draw_sprites(screen.machine(), bitmap, cliprect, 2); tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 3); + draw_sprites(screen.machine(), bitmap, cliprect, 3); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - draw_radar(screen->machine(), bitmap, cliprect); + draw_radar(screen.machine(), bitmap, cliprect); #if 0 { diff --git a/src/mame/video/seta.c b/src/mame/video/seta.c index 62f39f3011f..5f8ed7032b7 100644 --- a/src/mame/video/seta.c +++ b/src/mame/video/seta.c @@ -830,25 +830,25 @@ static void draw_tilemap_palette_effect(running_machine &machine, bitmap_t *bitm /* For games without tilemaps */ SCREEN_UPDATE( seta_no_layers ) { - set_pens(screen->machine()); + set_pens(screen.machine()); bitmap_fill(bitmap,cliprect,0x1f0); - screen->machine().device("spritegen")->seta001_draw_sprites(screen->machine(),bitmap,cliprect,0x1000, 1); + screen.machine().device("spritegen")->seta001_draw_sprites(screen.machine(),bitmap,cliprect,0x1000, 1); return 0; } /* For games with 1 or 2 tilemaps */ -void seta_layers_update(screen_device* screen, bitmap_t *bitmap, const rectangle *cliprect, int sprite_bank_size, int sprite_setac ) +void seta_layers_update(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int sprite_bank_size, int sprite_setac ) { - seta_state *state = screen->machine().driver_data(); + seta_state *state = screen.machine().driver_data(); int layers_ctrl = -1; int enab_0, enab_1, x_0, x_1=0, y_0, y_1=0; int order = 0; - int flip = screen->machine().device("spritegen")->is_flipped(); + int flip = screen.machine().device("spritegen")->is_flipped(); - const rectangle &visarea = screen->visible_area(); + const rectangle &visarea = screen.visible_area(); int vis_dimy = visarea.max_y - visarea.min_y + 1; // check tilemaps color modes @@ -872,7 +872,7 @@ void seta_layers_update(screen_device* screen, bitmap_t *bitmap, const rectangle flip ^= state->m_tilemaps_flip; - tilemap_set_flip_all(screen->machine(), flip ? (TILEMAP_FLIPX|TILEMAP_FLIPY) : 0 ); + tilemap_set_flip_all(screen.machine(), flip ? (TILEMAP_FLIPX|TILEMAP_FLIPY) : 0 ); x_0 = state->m_vctrl_0[ 0/2 ]; y_0 = state->m_vctrl_0[ 2/2 ]; @@ -930,11 +930,11 @@ void seta_layers_update(screen_device* screen, bitmap_t *bitmap, const rectangle #ifdef MAME_DEBUG -if (screen->machine().input().code_pressed(KEYCODE_Z)) +if (screen.machine().input().code_pressed(KEYCODE_Z)) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= 2; - if (screen->machine().input().code_pressed(KEYCODE_A)) msk |= 8; + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= 8; if (msk != 0) layers_ctrl &= msk; if (state->m_tilemap_2) @@ -956,7 +956,7 @@ if (screen->machine().input().code_pressed(KEYCODE_Z)) if (order & 2) // layer-sprite priority? { - if (layers_ctrl & 8) screen->machine().device("spritegen")->seta001_draw_sprites(screen->machine(),bitmap,cliprect,sprite_bank_size, sprite_setac); + if (layers_ctrl & 8) screen.machine().device("spritegen")->seta001_draw_sprites(screen.machine(),bitmap,cliprect,sprite_bank_size, sprite_setac); if(order & 4) { @@ -976,7 +976,7 @@ if (screen->machine().input().code_pressed(KEYCODE_Z)) if (layers_ctrl & 1) tilemap_draw(bitmap, cliprect, state->m_tilemap_0, 0, 0); if (layers_ctrl & 1) tilemap_draw(bitmap, cliprect, state->m_tilemap_1, 0, 0); - if (layers_ctrl & 8) screen->machine().device("spritegen")->seta001_draw_sprites(screen->machine(),bitmap,cliprect,sprite_bank_size, sprite_setac); + if (layers_ctrl & 8) screen.machine().device("spritegen")->seta001_draw_sprites(screen.machine(),bitmap,cliprect,sprite_bank_size, sprite_setac); } } else @@ -986,17 +986,17 @@ if (screen->machine().input().code_pressed(KEYCODE_Z)) if (order & 2) // layer-sprite priority? { - if (layers_ctrl & 8) screen->machine().device("spritegen")->seta001_draw_sprites(screen->machine(),bitmap,cliprect,sprite_bank_size, sprite_setac); + if (layers_ctrl & 8) screen.machine().device("spritegen")->seta001_draw_sprites(screen.machine(),bitmap,cliprect,sprite_bank_size, sprite_setac); if((order & 4) && state->m_paletteram2 != NULL) { if(tilemap_get_enable(state->m_tilemap_2)) { - draw_tilemap_palette_effect(screen->machine(), bitmap, cliprect, state->m_tilemap_2, x_1, y_1, 2 + ((state->m_vctrl_2[ 4/2 ] & 0x10) >> state->m_color_mode_shift), flip); + draw_tilemap_palette_effect(screen.machine(), bitmap, cliprect, state->m_tilemap_2, x_1, y_1, 2 + ((state->m_vctrl_2[ 4/2 ] & 0x10) >> state->m_color_mode_shift), flip); } else { - draw_tilemap_palette_effect(screen->machine(), bitmap, cliprect, state->m_tilemap_3, x_1, y_1, 2 + ((state->m_vctrl_2[ 4/2 ] & 0x10) >> state->m_color_mode_shift), flip); + draw_tilemap_palette_effect(screen.machine(), bitmap, cliprect, state->m_tilemap_3, x_1, y_1, 2 + ((state->m_vctrl_2[ 4/2 ] & 0x10) >> state->m_color_mode_shift), flip); } } else @@ -1019,11 +1019,11 @@ if (screen->machine().input().code_pressed(KEYCODE_Z)) { if(tilemap_get_enable(state->m_tilemap_2)) { - draw_tilemap_palette_effect(screen->machine(), bitmap, cliprect, state->m_tilemap_2, x_1, y_1, 2 + ((state->m_vctrl_2[ 4/2 ] & 0x10) >> state->m_color_mode_shift), flip); + draw_tilemap_palette_effect(screen.machine(), bitmap, cliprect, state->m_tilemap_2, x_1, y_1, 2 + ((state->m_vctrl_2[ 4/2 ] & 0x10) >> state->m_color_mode_shift), flip); } else { - draw_tilemap_palette_effect(screen->machine(), bitmap, cliprect, state->m_tilemap_3, x_1, y_1, 2 + ((state->m_vctrl_2[ 4/2 ] & 0x10) >> state->m_color_mode_shift), flip); + draw_tilemap_palette_effect(screen.machine(), bitmap, cliprect, state->m_tilemap_3, x_1, y_1, 2 + ((state->m_vctrl_2[ 4/2 ] & 0x10) >> state->m_color_mode_shift), flip); } } else @@ -1040,7 +1040,7 @@ if (screen->machine().input().code_pressed(KEYCODE_Z)) } } - if (layers_ctrl & 8) screen->machine().device("spritegen")->seta001_draw_sprites(screen->machine(),bitmap,cliprect,sprite_bank_size, sprite_setac); + if (layers_ctrl & 8) screen.machine().device("spritegen")->seta001_draw_sprites(screen.machine(),bitmap,cliprect,sprite_bank_size, sprite_setac); } } @@ -1057,8 +1057,8 @@ SCREEN_UPDATE( setaroul ) { bitmap_fill(bitmap, cliprect, 0x0); - screen->machine().device("spritegen")->set_fg_yoffsets( -0x12, 0x0e ); - screen->machine().device("spritegen")->set_bg_yoffsets( 0x1, -0x1 ); + screen.machine().device("spritegen")->set_fg_yoffsets( -0x12, 0x0e ); + screen.machine().device("spritegen")->set_bg_yoffsets( 0x1, -0x1 ); seta_layers_update(screen, bitmap, cliprect, 0x800, 1 ); @@ -1067,21 +1067,21 @@ SCREEN_UPDATE( setaroul ) SCREEN_EOF( setaroul ) { - machine.device("spritegen")->tnzs_eof(); + screen.machine().device("spritegen")->tnzs_eof(); } SCREEN_UPDATE( seta ) { - set_pens(screen->machine()); + set_pens(screen.machine()); return SCREEN_UPDATE_CALL(seta_layers); } SCREEN_UPDATE( usclssic ) { - usclssic_set_pens(screen->machine()); + usclssic_set_pens(screen.machine()); return SCREEN_UPDATE_CALL(seta_layers); } diff --git a/src/mame/video/seta2.c b/src/mame/video/seta2.c index d2914607f21..896a7ea0dff 100644 --- a/src/mame/video/seta2.c +++ b/src/mame/video/seta2.c @@ -480,20 +480,20 @@ VIDEO_START( seta2_yoffset ) SCREEN_UPDATE( seta2 ) { - seta2_state *state = screen->machine().driver_data(); + seta2_state *state = screen.machine().driver_data(); // Black or pen 0? - bitmap_fill(bitmap, cliprect, screen->machine().pens[0]); + bitmap_fill(bitmap, cliprect, screen.machine().pens[0]); if ( (state->m_vregs[0x30/2] & 1) == 0 ) // 1 = BLANK SCREEN - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_EOF( seta2 ) { - seta2_state *state = machine.driver_data(); + seta2_state *state = screen.machine().driver_data(); // Buffer sprites by 1 frame memcpy(state->m_buffered_spriteram, state->m_spriteram, state->m_spriteram_size); diff --git a/src/mame/video/sf.c b/src/mame/video/sf.c index 0bcc78662b0..04c443eac22 100644 --- a/src/mame/video/sf.c +++ b/src/mame/video/sf.c @@ -220,7 +220,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const recta SCREEN_UPDATE( sf ) { - sf_state *state = screen->machine().driver_data(); + sf_state *state = screen.machine().driver_data(); if (state->m_sf_active & 0x20) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); @@ -230,7 +230,7 @@ SCREEN_UPDATE( sf ) tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); if (state->m_sf_active & 0x80) - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); return 0; diff --git a/src/mame/video/shadfrce.c b/src/mame/video/shadfrce.c index 6fa258d05e5..acacec194b8 100644 --- a/src/mame/video/shadfrce.c +++ b/src/mame/video/shadfrce.c @@ -164,19 +164,19 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( shadfrce ) { - shadfrce_state *state = screen->machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + shadfrce_state *state = screen.machine().driver_data(); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); if (state->m_video_enable) { tilemap_draw(bitmap,cliprect,state->m_bg1tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_bg0tilemap,0,1); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_fgtilemap, 0,0); } else { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); } return 0; @@ -184,7 +184,7 @@ SCREEN_UPDATE( shadfrce ) SCREEN_EOF( shadfrce ) { - shadfrce_state *state = machine.driver_data(); + shadfrce_state *state = screen.machine().driver_data(); /* looks like sprites are *two* frames ahead */ memcpy(state->m_spvideoram_old, state->m_spvideoram, state->m_spvideoram_size); diff --git a/src/mame/video/shangha3.c b/src/mame/video/shangha3.c index 17cc47d268e..6ebea11a710 100644 --- a/src/mame/video/shangha3.c +++ b/src/mame/video/shangha3.c @@ -263,7 +263,7 @@ else SCREEN_UPDATE( shangha3 ) { - shangha3_state *state = screen->machine().driver_data(); + shangha3_state *state = screen.machine().driver_data(); copybitmap(bitmap, state->m_rawbitmap, 0, 0, 0, 0, cliprect); return 0; diff --git a/src/mame/video/shangkid.c b/src/mame/video/shangkid.c index 64e16fdb245..9a422eaa04c 100644 --- a/src/mame/video/shangkid.c +++ b/src/mame/video/shangkid.c @@ -187,14 +187,14 @@ static void shangkid_draw_sprites(running_machine &machine, bitmap_t *bitmap, co SCREEN_UPDATE( shangkid ) { - shangkid_state *state = screen->machine().driver_data(); + shangkid_state *state = screen.machine().driver_data(); int flipscreen = state->m_videoreg[1]&0x80; tilemap_set_flip( state->m_background, flipscreen?(TILEMAP_FLIPX|TILEMAP_FLIPY):0 ); tilemap_set_scrollx( state->m_background,0,state->m_videoreg[0]-40 ); tilemap_set_scrolly( state->m_background,0,state->m_videoreg[2]+0x10 ); tilemap_draw( bitmap,cliprect,state->m_background,0,0 ); - shangkid_draw_sprites(screen->machine(), bitmap,cliprect ); + shangkid_draw_sprites(screen.machine(), bitmap,cliprect ); tilemap_draw( bitmap,cliprect,state->m_background,1,0 ); /* high priority tiles */ return 0; } @@ -323,8 +323,8 @@ static void dynamski_draw_sprites(running_machine &machine, bitmap_t *bitmap, co SCREEN_UPDATE( dynamski ) { - dynamski_draw_background(screen->machine(), bitmap,cliprect, 0 ); - dynamski_draw_sprites(screen->machine(), bitmap,cliprect ); - dynamski_draw_background(screen->machine(), bitmap,cliprect, 1 ); + dynamski_draw_background(screen.machine(), bitmap,cliprect, 0 ); + dynamski_draw_sprites(screen.machine(), bitmap,cliprect ); + dynamski_draw_background(screen.machine(), bitmap,cliprect, 1 ); return 0; } diff --git a/src/mame/video/shaolins.c b/src/mame/video/shaolins.c index 8b0e1dab943..63082b0d842 100644 --- a/src/mame/video/shaolins.c +++ b/src/mame/video/shaolins.c @@ -194,9 +194,9 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( shaolins ) { - shaolins_state *state = screen->machine().driver_data(); + shaolins_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/shisen.c b/src/mame/video/shisen.c index 3ead752f549..1948388b964 100644 --- a/src/mame/video/shisen.c +++ b/src/mame/video/shisen.c @@ -64,12 +64,12 @@ VIDEO_START( sichuan2 ) SCREEN_UPDATE( sichuan2 ) { - shisen_state *state = screen->machine().driver_data(); + shisen_state *state = screen.machine().driver_data(); // on Irem boards, screen flip is handled in both hardware and software. // this game doesn't have cocktail mode so if there's software control we don't // know where it is mapped. - flip_screen_set(screen->machine(), ~input_port_read(screen->machine(), "DSW2") & 1); + flip_screen_set(screen.machine(), ~input_port_read(screen.machine(), "DSW2") & 1); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); diff --git a/src/mame/video/shootout.c b/src/mame/video/shootout.c index 534b00c5c29..37238727926 100644 --- a/src/mame/video/shootout.c +++ b/src/mame/video/shootout.c @@ -173,24 +173,24 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( shootout ) { - shootout_state *state = screen->machine().driver_data(); + shootout_state *state = screen.machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_background,0,0); tilemap_draw(bitmap,cliprect,state->m_foreground,0,1); - draw_sprites(screen->machine(), bitmap,cliprect,3/*bank bits */); + draw_sprites(screen.machine(), bitmap,cliprect,3/*bank bits */); return 0; } SCREEN_UPDATE( shootouj ) { - shootout_state *state = screen->machine().driver_data(); + shootout_state *state = screen.machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_background,0,0); tilemap_draw(bitmap,cliprect,state->m_foreground,0,1); - draw_sprites(screen->machine(), bitmap,cliprect,2/*bank bits*/); + draw_sprites(screen.machine(), bitmap,cliprect,2/*bank bits*/); return 0; } diff --git a/src/mame/video/shuuz.c b/src/mame/video/shuuz.c index f3995c5b0dd..a15e07f8d51 100644 --- a/src/mame/video/shuuz.c +++ b/src/mame/video/shuuz.c @@ -91,7 +91,7 @@ VIDEO_START( shuuz ) SCREEN_UPDATE( shuuz ) { - shuuz_state *state = screen->machine().driver_data(); + shuuz_state *state = screen.machine().driver_data(); atarimo_rect_list rectlist; bitmap_t *mobitmap; int x, y, r; diff --git a/src/mame/video/sidearms.c b/src/mame/video/sidearms.c index 25efbbb8d03..ab6c6a9b9a1 100644 --- a/src/mame/video/sidearms.c +++ b/src/mame/video/sidearms.c @@ -348,9 +348,9 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( sidearms ) { - sidearms_state *state = screen->machine().driver_data(); + sidearms_state *state = screen.machine().driver_data(); - sidearms_draw_starfield(screen->machine(), bitmap); + sidearms_draw_starfield(screen.machine(), bitmap); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_bg_scrollx[0] + (state->m_bg_scrollx[1] << 8 & 0xf00)); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_bg_scrolly[0] + (state->m_bg_scrolly[1] << 8 & 0xf00)); @@ -359,7 +359,7 @@ SCREEN_UPDATE( sidearms ) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); if (state->m_objon) - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); if (state->m_charon) tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); @@ -368,7 +368,7 @@ SCREEN_UPDATE( sidearms ) SCREEN_EOF( sidearms ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram_w(space, 0, 0); } diff --git a/src/mame/video/sidepckt.c b/src/mame/video/sidepckt.c index fe3bb851cf6..b411bc100dd 100644 --- a/src/mame/video/sidepckt.c +++ b/src/mame/video/sidepckt.c @@ -143,9 +143,9 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( sidepckt ) { - sidepckt_state *state = screen->machine().driver_data(); + sidepckt_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,TILEMAP_DRAW_LAYER1,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,TILEMAP_DRAW_LAYER0,0); return 0; } diff --git a/src/mame/video/silkroad.c b/src/mame/video/silkroad.c index 9ed7311abf8..f722f8b964c 100644 --- a/src/mame/video/silkroad.c +++ b/src/mame/video/silkroad.c @@ -143,8 +143,8 @@ VIDEO_START(silkroad) SCREEN_UPDATE(silkroad) { - silkroad_state *state = screen->machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + silkroad_state *state = screen.machine().driver_data(); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); bitmap_fill(bitmap,cliprect,0x7c0); tilemap_set_scrollx( state->m_fg_tilemap, 0, ((state->m_regs[0] & 0xffff0000) >> 16) ); @@ -159,7 +159,7 @@ SCREEN_UPDATE(silkroad) tilemap_draw(bitmap,cliprect,state->m_fg_tilemap, 0,0); tilemap_draw(bitmap,cliprect,state->m_fg2_tilemap,0,1); tilemap_draw(bitmap,cliprect,state->m_fg3_tilemap,0,2); - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); if (0) { diff --git a/src/mame/video/simpl156.c b/src/mame/video/simpl156.c index e5ff59b9b3c..57229871c87 100644 --- a/src/mame/video/simpl156.c +++ b/src/mame/video/simpl156.c @@ -27,9 +27,9 @@ VIDEO_START( simpl156 ) SCREEN_UPDATE( simpl156 ) { - simpl156_state *state = screen->machine().driver_data(); + simpl156_state *state = screen.machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap, NULL, 0); + bitmap_fill(screen.machine().priority_bitmap, NULL, 0); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); @@ -39,8 +39,8 @@ SCREEN_UPDATE( simpl156 ) deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 4); //FIXME: flip_screen_x should not be written! - flip_screen_set_no_update(screen->machine(), 1); + flip_screen_set_no_update(screen.machine(), 1); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram, 0x800); // 0x800 needed to charlien title + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0x800); // 0x800 needed to charlien title return 0; } diff --git a/src/mame/video/simpsons.c b/src/mame/video/simpsons.c index af888bfe181..8a6faf10c86 100644 --- a/src/mame/video/simpsons.c +++ b/src/mame/video/simpsons.c @@ -124,7 +124,7 @@ void simpsons_video_banking( running_machine &machine, int bank ) SCREEN_UPDATE( simpsons ) { - simpsons_state *state = screen->machine().driver_data(); + simpsons_state *state = screen.machine().driver_data(); int layer[3], bg_colorbase; bg_colorbase = k053251_get_palette_index(state->m_k053251, K053251_CI0); @@ -144,7 +144,7 @@ SCREEN_UPDATE( simpsons ) konami_sortlayers3(layer, state->m_layerpri); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 16 * bg_colorbase); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[0], 0, 1); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[1], 0, 2); diff --git a/src/mame/video/skullxbo.c b/src/mame/video/skullxbo.c index 8b2787578d7..9dfd93b6418 100644 --- a/src/mame/video/skullxbo.c +++ b/src/mame/video/skullxbo.c @@ -245,7 +245,7 @@ void skullxbo_scanline_update(running_machine &machine, int scanline) SCREEN_UPDATE( skullxbo ) { - skullxbo_state *state = screen->machine().driver_data(); + skullxbo_state *state = screen.machine().driver_data(); atarimo_rect_list rectlist; bitmap_t *mobitmap; int x, y, r; diff --git a/src/mame/video/skydiver.c b/src/mame/video/skydiver.c index 29cc7dbdafd..975ba39495f 100644 --- a/src/mame/video/skydiver.c +++ b/src/mame/video/skydiver.c @@ -208,9 +208,9 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( skydiver ) { - skydiver_state *state = screen->machine().driver_data(); + skydiver_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/skyfox.c b/src/mame/video/skyfox.c index cabd28fc68b..84c1077d813 100644 --- a/src/mame/video/skyfox.c +++ b/src/mame/video/skyfox.c @@ -284,7 +284,7 @@ static void draw_background(running_machine &machine, bitmap_t *bitmap, const re SCREEN_UPDATE( skyfox ) { bitmap_fill(bitmap, cliprect, 255); // the bg is black - draw_background(screen->machine(), bitmap, cliprect); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_background(screen.machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/skykid.c b/src/mame/video/skykid.c index 66b7874ebee..2e0dcedb2d1 100644 --- a/src/mame/video/skykid.c +++ b/src/mame/video/skykid.c @@ -240,8 +240,8 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( skykid ) { - skykid_state *state = screen->machine().driver_data(); - if (flip_screen_get(screen->machine())) + skykid_state *state = screen.machine().driver_data(); + if (flip_screen_get(screen.machine())) { tilemap_set_scrollx(state->m_bg_tilemap, 0, 189 - (state->m_scroll_x ^ 1)); tilemap_set_scrolly(state->m_bg_tilemap, 0, 7 - state->m_scroll_y); @@ -262,7 +262,7 @@ SCREEN_UPDATE( skykid ) // draw low priority tiles tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, pri, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); // draw the other tiles for (cat = 0; cat < 0xf; cat++) @@ -270,7 +270,7 @@ SCREEN_UPDATE( skykid ) } else { - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, TILEMAP_DRAW_ALL_CATEGORIES, 0); } diff --git a/src/mame/video/skyraid.c b/src/mame/video/skyraid.c index 974fedfd76c..6b2c45ab508 100644 --- a/src/mame/video/skyraid.c +++ b/src/mame/video/skyraid.c @@ -140,14 +140,14 @@ static void draw_trapezoid(running_machine &machine, bitmap_t* dst, bitmap_t* sr SCREEN_UPDATE( skyraid ) { - skyraid_state *state = screen->machine().driver_data(); + skyraid_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, 0); - draw_terrain(screen->machine(), state->m_helper, NULL); - draw_sprites(screen->machine(), state->m_helper, NULL); - draw_missiles(screen->machine(), state->m_helper, NULL); - draw_trapezoid(screen->machine(), bitmap, state->m_helper); - draw_text(screen->machine(), bitmap, cliprect); + draw_terrain(screen.machine(), state->m_helper, NULL); + draw_sprites(screen.machine(), state->m_helper, NULL); + draw_missiles(screen.machine(), state->m_helper, NULL); + draw_trapezoid(screen.machine(), bitmap, state->m_helper); + draw_text(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/slapfght.c b/src/mame/video/slapfght.c index d732d49bbee..abd73201c2b 100644 --- a/src/mame/video/slapfght.c +++ b/src/mame/video/slapfght.c @@ -189,7 +189,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( perfrman ) { - slapfght_state *state = screen->machine().driver_data(); + slapfght_state *state = screen.machine().driver_data(); tilemap_set_flip( state->m_pf1_tilemap, state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); tilemap_set_scrolly( state->m_pf1_tilemap ,0 , 0 ); if (state->m_flipscreen) { @@ -200,22 +200,22 @@ SCREEN_UPDATE( perfrman ) } tilemap_draw(bitmap,cliprect,state->m_pf1_tilemap,TILEMAP_DRAW_OPAQUE,0); - draw_sprites(screen->machine(), bitmap,cliprect,0); + draw_sprites(screen.machine(), bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_pf1_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect,0x80); + draw_sprites(screen.machine(), bitmap,cliprect,0x80); - slapfght_log_vram(screen->machine()); + slapfght_log_vram(screen.machine()); return 0; } SCREEN_UPDATE( slapfight ) { - slapfght_state *state = screen->machine().driver_data(); - UINT8 *buffered_spriteram = screen->machine().generic.buffered_spriteram.u8; + slapfght_state *state = screen.machine().driver_data(); + UINT8 *buffered_spriteram = screen.machine().generic.buffered_spriteram.u8; int offs; - tilemap_set_flip_all(screen->machine(),state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + tilemap_set_flip_all(screen.machine(),state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); if (state->m_flipscreen) { tilemap_set_scrollx( state->m_fix_tilemap,0,296); tilemap_set_scrollx( state->m_pf1_tilemap,0,(*state->m_slapfight_scrollx_lo + 256 * *state->m_slapfight_scrollx_hi)+296 ); @@ -232,16 +232,16 @@ SCREEN_UPDATE( slapfight ) tilemap_draw(bitmap,cliprect,state->m_pf1_tilemap,0,0); /* Draw the sprites */ - for (offs = 0;offs < screen->machine().generic.spriteram_size;offs += 4) + for (offs = 0;offs < screen.machine().generic.spriteram_size;offs += 4) { if (state->m_flipscreen) - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[2], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[2], buffered_spriteram[offs] + ((buffered_spriteram[offs+2] & 0xc0) << 2), (buffered_spriteram[offs+2] & 0x1e) >> 1, 1,1, 288-(buffered_spriteram[offs+1] + ((buffered_spriteram[offs+2] & 0x01) << 8)) +18,240-buffered_spriteram[offs+3],0); else - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[2], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[2], buffered_spriteram[offs] + ((buffered_spriteram[offs+2] & 0xc0) << 2), (buffered_spriteram[offs+2] & 0x1e) >> 1, 0,0, @@ -250,6 +250,6 @@ SCREEN_UPDATE( slapfight ) tilemap_draw(bitmap,cliprect,state->m_fix_tilemap,0,0); - slapfght_log_vram(screen->machine()); + slapfght_log_vram(screen.machine()); return 0; } diff --git a/src/mame/video/slapshot.c b/src/mame/video/slapshot.c index 2899c4899b5..b1673999e02 100644 --- a/src/mame/video/slapshot.c +++ b/src/mame/video/slapshot.c @@ -430,9 +430,9 @@ static void taito_update_sprites_active_area( running_machine &machine ) SCREEN_EOF( taito_no_buffer ) { - slapshot_state *state = machine.driver_data(); + slapshot_state *state = screen.machine().driver_data(); - taito_update_sprites_active_area(machine); + taito_update_sprites_active_area(screen.machine()); state->m_prepare_sprites = 1; } @@ -456,45 +456,45 @@ a bg layer given priority over some sprites. SCREEN_UPDATE( slapshot ) { - slapshot_state *state = screen->machine().driver_data(); + slapshot_state *state = screen.machine().driver_data(); UINT8 layer[5]; UINT8 tilepri[5]; UINT8 spritepri[4]; UINT16 priority; #ifdef MAME_DEBUG - if (screen->machine().input().code_pressed_once (KEYCODE_Z)) + if (screen.machine().input().code_pressed_once (KEYCODE_Z)) { state->m_dislayer[0] ^= 1; popmessage("bg0: %01x",state->m_dislayer[0]); } - if (screen->machine().input().code_pressed_once (KEYCODE_X)) + if (screen.machine().input().code_pressed_once (KEYCODE_X)) { state->m_dislayer[1] ^= 1; popmessage("bg1: %01x",state->m_dislayer[1]); } - if (screen->machine().input().code_pressed_once (KEYCODE_C)) + if (screen.machine().input().code_pressed_once (KEYCODE_C)) { state->m_dislayer[2] ^= 1; popmessage("bg2: %01x",state->m_dislayer[2]); } - if (screen->machine().input().code_pressed_once (KEYCODE_V)) + if (screen.machine().input().code_pressed_once (KEYCODE_V)) { state->m_dislayer[3] ^= 1; popmessage("bg3: %01x",state->m_dislayer[3]); } - if (screen->machine().input().code_pressed_once (KEYCODE_B)) + if (screen.machine().input().code_pressed_once (KEYCODE_B)) { state->m_dislayer[4] ^= 1; popmessage("text: %01x",state->m_dislayer[4]); } #endif - taito_handle_sprite_buffering(screen->machine()); + taito_handle_sprite_buffering(screen.machine()); tc0480scp_tilemap_update(state->m_tc0480scp); @@ -519,7 +519,7 @@ SCREEN_UPDATE( slapshot ) spritepri[2] = tc0360pri_r(state->m_tc0360pri, 7) & 0x0f; spritepri[3] = tc0360pri_r(state->m_tc0360pri, 7) >> 4; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); #ifdef MAME_DEBUG @@ -554,7 +554,7 @@ SCREEN_UPDATE( slapshot ) if (spritepri[i] < tilepri[(layer[3])]) primasks[i] |= 0xff00; } - draw_sprites(screen->machine(),bitmap,cliprect,primasks,0); + draw_sprites(screen.machine(),bitmap,cliprect,primasks,0); } /* diff --git a/src/mame/video/snes.c b/src/mame/video/snes.c index 25aedee057c..5df26ecb4be 100644 --- a/src/mame/video/snes.c +++ b/src/mame/video/snes.c @@ -1796,7 +1796,7 @@ SCREEN_UPDATE( snes ) /*NTSC SNES draw range is 1-225. */ for (y = cliprect->min_y; y <= cliprect->max_y; y++) { - snes_refresh_scanline(screen->machine(), bitmap, y + 1); + snes_refresh_scanline(screen.machine(), bitmap, y + 1); } return 0; } diff --git a/src/mame/video/snk.c b/src/mame/video/snk.c index 56cdb42a38e..913773b441a 100644 --- a/src/mame/video/snk.c +++ b/src/mame/video/snk.c @@ -992,7 +992,7 @@ static void tdfever_draw_sprites(running_machine &machine, bitmap_t *bitmap, con SCREEN_UPDATE( marvins ) { - snk_state *state = screen->machine().driver_data(); + snk_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_bg_scrollx); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_bg_scrolly); @@ -1000,9 +1000,9 @@ SCREEN_UPDATE( marvins ) tilemap_set_scrolly(state->m_fg_tilemap, 0, state->m_fg_scrolly); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - marvins_draw_sprites(screen->machine(), bitmap, cliprect, state->m_sp16_scrollx, state->m_sp16_scrolly, 0, state->m_sprite_split_point>>2); + marvins_draw_sprites(screen.machine(), bitmap, cliprect, state->m_sp16_scrollx, state->m_sp16_scrolly, 0, state->m_sprite_split_point>>2); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - marvins_draw_sprites(screen->machine(), bitmap, cliprect, state->m_sp16_scrollx, state->m_sp16_scrolly, state->m_sprite_split_point>>2, 25); + marvins_draw_sprites(screen.machine(), bitmap, cliprect, state->m_sp16_scrollx, state->m_sp16_scrolly, state->m_sprite_split_point>>2, 25); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); return 0; @@ -1011,13 +1011,13 @@ SCREEN_UPDATE( marvins ) SCREEN_UPDATE( tnk3 ) { - snk_state *state = screen->machine().driver_data(); + snk_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_bg_scrollx); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_bg_scrolly); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - tnk3_draw_sprites(screen->machine(), bitmap, cliprect, state->m_sp16_scrollx, state->m_sp16_scrolly); + tnk3_draw_sprites(screen.machine(), bitmap, cliprect, state->m_sp16_scrollx, state->m_sp16_scrolly); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); return 0; @@ -1026,16 +1026,16 @@ SCREEN_UPDATE( tnk3 ) SCREEN_UPDATE( ikari ) { - snk_state *state = screen->machine().driver_data(); + snk_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_bg_scrollx); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_bg_scrolly); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - ikari_draw_sprites(screen->machine(), bitmap, cliprect, 0, state->m_sp16_scrollx, state->m_sp16_scrolly, state->m_spriteram + 0x800, 2 ); - ikari_draw_sprites(screen->machine(), bitmap, cliprect, 0, state->m_sp32_scrollx, state->m_sp32_scrolly, state->m_spriteram, 3 ); - ikari_draw_sprites(screen->machine(), bitmap, cliprect, 25, state->m_sp16_scrollx, state->m_sp16_scrolly, state->m_spriteram + 0x800, 2 ); + ikari_draw_sprites(screen.machine(), bitmap, cliprect, 0, state->m_sp16_scrollx, state->m_sp16_scrolly, state->m_spriteram + 0x800, 2 ); + ikari_draw_sprites(screen.machine(), bitmap, cliprect, 0, state->m_sp32_scrollx, state->m_sp32_scrolly, state->m_spriteram, 3 ); + ikari_draw_sprites(screen.machine(), bitmap, cliprect, 25, state->m_sp16_scrollx, state->m_sp16_scrolly, state->m_spriteram + 0x800, 2 ); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); return 0; @@ -1044,16 +1044,16 @@ SCREEN_UPDATE( ikari ) SCREEN_UPDATE( gwar ) { - snk_state *state = screen->machine().driver_data(); + snk_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_bg_scrollx); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_bg_scrolly); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - tdfever_draw_sprites(screen->machine(), bitmap, cliprect, state->m_sp16_scrollx, state->m_sp16_scrolly, state->m_spriteram + 0x800, 2, 0, 0, state->m_sprite_split_point ); - tdfever_draw_sprites(screen->machine(), bitmap, cliprect, state->m_sp32_scrollx, state->m_sp32_scrolly, state->m_spriteram, 3, 0, 0, 32 ); - tdfever_draw_sprites(screen->machine(), bitmap, cliprect, state->m_sp16_scrollx, state->m_sp16_scrolly, state->m_spriteram + 0x800, 2, 0, state->m_sprite_split_point, 64 ); + tdfever_draw_sprites(screen.machine(), bitmap, cliprect, state->m_sp16_scrollx, state->m_sp16_scrolly, state->m_spriteram + 0x800, 2, 0, 0, state->m_sprite_split_point ); + tdfever_draw_sprites(screen.machine(), bitmap, cliprect, state->m_sp32_scrollx, state->m_sp32_scrolly, state->m_spriteram, 3, 0, 0, 32 ); + tdfever_draw_sprites(screen.machine(), bitmap, cliprect, state->m_sp16_scrollx, state->m_sp16_scrolly, state->m_spriteram + 0x800, 2, 0, state->m_sprite_split_point, 64 ); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); @@ -1063,14 +1063,14 @@ SCREEN_UPDATE( gwar ) SCREEN_UPDATE( tdfever ) { - snk_state *state = screen->machine().driver_data(); + snk_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_bg_scrollx); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_bg_scrolly); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - tdfever_draw_sprites(screen->machine(), bitmap, cliprect, state->m_sp32_scrollx, state->m_sp32_scrolly, state->m_spriteram, 2, 1, 0, 32 ); + tdfever_draw_sprites(screen.machine(), bitmap, cliprect, state->m_sp32_scrollx, state->m_sp32_scrolly, state->m_spriteram, 2, 1, 0, 32 ); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); diff --git a/src/mame/video/snk6502.c b/src/mame/video/snk6502.c index 693cf34db87..1bc2be690a6 100644 --- a/src/mame/video/snk6502.c +++ b/src/mame/video/snk6502.c @@ -205,7 +205,7 @@ VIDEO_START( pballoon ) SCREEN_UPDATE( snk6502 ) { - snk6502_state *state = screen->machine().driver_data(); + snk6502_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); diff --git a/src/mame/video/snk68.c b/src/mame/video/snk68.c index e55635e2933..3c8eaf5df93 100644 --- a/src/mame/video/snk68.c +++ b/src/mame/video/snk68.c @@ -290,14 +290,14 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( pow ) { - snk68_state *state = screen->machine().driver_data(); + snk68_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, 0x7ff); /* This appears to be the correct priority order */ - draw_sprites(screen->machine(), bitmap, cliprect, 2); - draw_sprites(screen->machine(), bitmap, cliprect, 3); - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 2); + draw_sprites(screen.machine(), bitmap, cliprect, 3); + draw_sprites(screen.machine(), bitmap, cliprect, 1); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; diff --git a/src/mame/video/snookr10.c b/src/mame/video/snookr10.c index 79e9c2be3d5..e98ec4db3ba 100644 --- a/src/mame/video/snookr10.c +++ b/src/mame/video/snookr10.c @@ -189,7 +189,7 @@ VIDEO_START( apple10 ) SCREEN_UPDATE( snookr10 ) { - snookr10_state *state = screen->machine().driver_data(); + snookr10_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/solomon.c b/src/mame/video/solomon.c index 4280d828350..a596a40f818 100644 --- a/src/mame/video/solomon.c +++ b/src/mame/video/solomon.c @@ -109,9 +109,9 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( solomon ) { - solomon_state *state = screen->machine().driver_data(); + solomon_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/sonson.c b/src/mame/video/sonson.c index 45366ff7421..0c073af6f71 100644 --- a/src/mame/video/sonson.c +++ b/src/mame/video/sonson.c @@ -177,8 +177,8 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( sonson ) { - sonson_state *state = screen->machine().driver_data(); + sonson_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/spacefb.c b/src/mame/video/spacefb.c index 21b96867306..b71b264d395 100644 --- a/src/mame/video/spacefb.c +++ b/src/mame/video/spacefb.c @@ -399,8 +399,8 @@ static void draw_objects(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( spacefb ) { - draw_objects(screen->machine(), bitmap, cliprect); - draw_starfield(*screen, bitmap, cliprect); + draw_objects(screen.machine(), bitmap, cliprect); + draw_starfield(screen, bitmap, cliprect); return 0; } diff --git a/src/mame/video/spbactn.c b/src/mame/video/spbactn.c index d0465e35df5..dfb6372ce3a 100644 --- a/src/mame/video/spbactn.c +++ b/src/mame/video/spbactn.c @@ -120,7 +120,7 @@ VIDEO_START( spbactn ) SCREEN_UPDATE( spbactn ) { - spbactn_state *state = screen->machine().driver_data(); + spbactn_state *state = screen.machine().driver_data(); int offs, sx, sy; bitmap_fill(state->m_tile_bitmap_fg, cliprect, 0); @@ -135,9 +135,9 @@ SCREEN_UPDATE( spbactn ) color = ((attr & 0x00f0) >> 4) | 0x80; - drawgfx_transpen_raw(state->m_tile_bitmap_bg, cliprect, screen->machine().gfx[1], + drawgfx_transpen_raw(state->m_tile_bitmap_bg, cliprect, screen.machine().gfx[1], code, - screen->machine().gfx[1]->color_base + color * screen->machine().gfx[1]->color_granularity, + screen.machine().gfx[1]->color_base + color * screen.machine().gfx[1]->color_granularity, 0, 0, 16 * sx, 8 * sy, (UINT32)-1); @@ -150,7 +150,7 @@ SCREEN_UPDATE( spbactn ) } } - if (draw_sprites(screen->machine(), state->m_tile_bitmap_bg, cliprect, 0)) + if (draw_sprites(screen.machine(), state->m_tile_bitmap_bg, cliprect, 0)) { /* kludge: draw table bg gfx again if priority 0 sprites are enabled */ for (sx = sy = offs = 0; offs < 0x4000 / 2; offs++) @@ -162,9 +162,9 @@ SCREEN_UPDATE( spbactn ) color = ((attr & 0x00f0) >> 4) | 0x80; - drawgfx_transpen_raw(state->m_tile_bitmap_bg, cliprect, screen->machine().gfx[1], + drawgfx_transpen_raw(state->m_tile_bitmap_bg, cliprect, screen.machine().gfx[1], code, - screen->machine().gfx[1]->color_base + color * screen->machine().gfx[1]->color_granularity, + screen.machine().gfx[1]->color_base + color * screen.machine().gfx[1]->color_granularity, 0, 0, 16 * sx, 8 * sy, 0); @@ -178,7 +178,7 @@ SCREEN_UPDATE( spbactn ) } } - draw_sprites(screen->machine(), state->m_tile_bitmap_bg, cliprect, 1); + draw_sprites(screen.machine(), state->m_tile_bitmap_bg, cliprect, 1); /* draw table fg gfx */ for (sx = sy = offs = 0; offs < 0x4000 / 2; offs++) @@ -196,9 +196,9 @@ SCREEN_UPDATE( spbactn ) else color |= 0x0080; - drawgfx_transpen_raw(state->m_tile_bitmap_fg, cliprect, screen->machine().gfx[0], + drawgfx_transpen_raw(state->m_tile_bitmap_fg, cliprect, screen.machine().gfx[0], code, - screen->machine().gfx[0]->color_base + color * screen->machine().gfx[0]->color_granularity, + screen.machine().gfx[0]->color_base + color * screen.machine().gfx[0]->color_granularity, 0, 0, 16 * sx, 8 * sy, 0); @@ -211,10 +211,10 @@ SCREEN_UPDATE( spbactn ) } } - draw_sprites(screen->machine(), state->m_tile_bitmap_fg, cliprect, 2); - draw_sprites(screen->machine(), state->m_tile_bitmap_fg, cliprect, 3); + draw_sprites(screen.machine(), state->m_tile_bitmap_fg, cliprect, 2); + draw_sprites(screen.machine(), state->m_tile_bitmap_fg, cliprect, 3); /* mix & blend the tilemaps and sprites into a 32-bit bitmap */ - blendbitmaps(screen->machine(), bitmap, state->m_tile_bitmap_bg, state->m_tile_bitmap_fg, cliprect); + blendbitmaps(screen.machine(), bitmap, state->m_tile_bitmap_bg, state->m_tile_bitmap_fg, cliprect); return 0; } diff --git a/src/mame/video/spcforce.c b/src/mame/video/spcforce.c index 3075fd9dcb1..4642a6d6e85 100644 --- a/src/mame/video/spcforce.c +++ b/src/mame/video/spcforce.c @@ -18,9 +18,9 @@ WRITE8_HANDLER( spcforce_flip_screen_w ) SCREEN_UPDATE( spcforce ) { - spcforce_state *state = screen->machine().driver_data(); + spcforce_state *state = screen.machine().driver_data(); int offs; - int flip = flip_screen_get(screen->machine()); + int flip = flip_screen_get(screen.machine()); /* draw the characters as sprites because they could be overlapping */ bitmap_fill(bitmap,cliprect,0); @@ -40,7 +40,7 @@ SCREEN_UPDATE( spcforce ) sy = 248 - sy; } - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], code, col, flip, flip, sx, sy,0); diff --git a/src/mame/video/spdodgeb.c b/src/mame/video/spdodgeb.c index 9d674ac2c06..1a9fe5b9387 100644 --- a/src/mame/video/spdodgeb.c +++ b/src/mame/video/spdodgeb.c @@ -210,9 +210,9 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( spdodgeb ) { - spdodgeb_state *state = screen->machine().driver_data(); + spdodgeb_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap,0,state->m_lastscroll+5); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); return 0; } diff --git a/src/mame/video/speedatk.c b/src/mame/video/speedatk.c index adb8ecdb0f2..178a35fa1fa 100644 --- a/src/mame/video/speedatk.c +++ b/src/mame/video/speedatk.c @@ -89,7 +89,7 @@ WRITE8_HANDLER( speedatk_6845_w ) SCREEN_UPDATE( speedatk ) { - speedatk_state *state = screen->machine().driver_data(); + speedatk_state *state = screen.machine().driver_data(); int x,y; int count; UINT16 tile; @@ -109,7 +109,7 @@ SCREEN_UPDATE( speedatk ) color = state->m_colorram[count] & 0x1f; region = (state->m_colorram[count] & 0x10) >> 4; - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[region],tile,color,state->m_flip_scr,state->m_flip_scr,x*8,y*8); + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[region],tile,color,state->m_flip_scr,state->m_flip_scr,x*8,y*8); count = (state->m_flip_scr) ? count-1 : count+1; count&=0x3ff; diff --git a/src/mame/video/speedbal.c b/src/mame/video/speedbal.c index abfe3e8390c..ac9b1da2376 100644 --- a/src/mame/video/speedbal.c +++ b/src/mame/video/speedbal.c @@ -129,10 +129,10 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( speedbal ) { - speedbal_state *state = screen->machine().driver_data(); + speedbal_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, TILEMAP_DRAW_LAYER1, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, TILEMAP_DRAW_LAYER0, 0); return 0; diff --git a/src/mame/video/speedspn.c b/src/mame/video/speedspn.c index 61dedd478d1..f9bf978495e 100644 --- a/src/mame/video/speedspn.c +++ b/src/mame/video/speedspn.c @@ -95,10 +95,10 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE(speedspn) { - speedspn_state *state = screen->machine().driver_data(); + speedspn_state *state = screen.machine().driver_data(); if (state->m_display_disable) { - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); return 0; } @@ -112,6 +112,6 @@ SCREEN_UPDATE(speedspn) #endif tilemap_set_scrollx(state->m_tilemap,0, 0x100); // verify tilemap_draw(bitmap,cliprect,state->m_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); return 0; } diff --git a/src/mame/video/splash.c b/src/mame/video/splash.c index 9fbc1bcbdeb..08e8e6c3297 100644 --- a/src/mame/video/splash.c +++ b/src/mame/video/splash.c @@ -260,33 +260,33 @@ static void funystrp_draw_sprites(running_machine &machine, bitmap_t *bitmap,con SCREEN_UPDATE( splash ) { - splash_state *state = screen->machine().driver_data(); + splash_state *state = screen.machine().driver_data(); /* set scroll registers */ tilemap_set_scrolly(state->m_bg_tilemap[0], 0, state->m_vregs[0]); tilemap_set_scrolly(state->m_bg_tilemap[1], 0, state->m_vregs[1]); - draw_bitmap(screen->machine(), bitmap, cliprect); + draw_bitmap(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[1], 0, 0); - splash_draw_sprites(screen->machine(), bitmap, cliprect); + splash_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[0], 0, 0); return 0; } SCREEN_UPDATE( funystrp ) { - splash_state *state = screen->machine().driver_data(); + splash_state *state = screen.machine().driver_data(); /* set scroll registers */ tilemap_set_scrolly(state->m_bg_tilemap[0], 0, state->m_vregs[0]); tilemap_set_scrolly(state->m_bg_tilemap[1], 0, state->m_vregs[1]); - draw_bitmap(screen->machine(), bitmap, cliprect); + draw_bitmap(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[1], 0, 0); /*Sprite chip is similar but not the same*/ - funystrp_draw_sprites(screen->machine(), bitmap, cliprect); + funystrp_draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[0], 0, 0); return 0; } diff --git a/src/mame/video/sprcros2.c b/src/mame/video/sprcros2.c index 32a79f50955..24f8d4a1869 100644 --- a/src/mame/video/sprcros2.c +++ b/src/mame/video/sprcros2.c @@ -196,10 +196,10 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( sprcros2 ) { - sprcros2_state *state = screen->machine().driver_data(); + sprcros2_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bgtilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fgtilemap, 0, 0); return 0; } diff --git a/src/mame/video/sprint2.c b/src/mame/video/sprint2.c index 6833ccaf3bd..7f178d4f8b5 100644 --- a/src/mame/video/sprint2.c +++ b/src/mame/video/sprint2.c @@ -123,7 +123,7 @@ INLINE int get_sprite_y(UINT8 *video_ram, int n) SCREEN_UPDATE( sprint2 ) { - sprint2_state *state = screen->machine().driver_data(); + sprint2_state *state = screen.machine().driver_data(); UINT8 *video_ram = state->m_video_ram; int i; @@ -133,7 +133,7 @@ SCREEN_UPDATE( sprint2 ) for (i = 0; i < 4; i++) { - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], get_sprite_code(video_ram, i), i, 0, 0, @@ -146,11 +146,11 @@ SCREEN_UPDATE( sprint2 ) SCREEN_EOF( sprint2 ) { - sprint2_state *state = machine.driver_data(); + sprint2_state *state = screen.machine().driver_data(); UINT8 *video_ram = state->m_video_ram; int i; int j; - const rectangle &visarea = machine.primary_screen->visible_area(); + const rectangle &visarea = screen.machine().primary_screen->visible_area(); /* * Collisions are detected for both player cars: @@ -166,8 +166,8 @@ SCREEN_EOF( sprint2 ) rect.min_x = get_sprite_x(video_ram, i); rect.min_y = get_sprite_y(video_ram, i); - rect.max_x = get_sprite_x(video_ram, i) + machine.gfx[1]->width - 1; - rect.max_y = get_sprite_y(video_ram, i) + machine.gfx[1]->height - 1; + rect.max_x = get_sprite_x(video_ram, i) + screen.machine().gfx[1]->width - 1; + rect.max_y = get_sprite_y(video_ram, i) + screen.machine().gfx[1]->height - 1; if (rect.min_x < visarea.min_x) rect.min_x = visarea.min_x; @@ -182,21 +182,21 @@ SCREEN_EOF( sprint2 ) tilemap_draw(state->m_helper, &rect, state->m_bg_tilemap, 0, 0); - drawgfx_transpen(state->m_helper, &rect, machine.gfx[1], + drawgfx_transpen(state->m_helper, &rect, screen.machine().gfx[1], get_sprite_code(video_ram, i), 0, 0, 0, get_sprite_x(video_ram, i), get_sprite_y(video_ram, i), 1); - state->m_collision[i] |= collision_check(state, machine.colortable, &rect); + state->m_collision[i] |= collision_check(state, screen.machine().colortable, &rect); /* check for sprite-sprite collisions */ for (j = 0; j < 4; j++) if (j != i) { - drawgfx_transpen(state->m_helper, &rect, machine.gfx[1], + drawgfx_transpen(state->m_helper, &rect, screen.machine().gfx[1], get_sprite_code(video_ram, j), 1, 0, 0, @@ -204,13 +204,13 @@ SCREEN_EOF( sprint2 ) get_sprite_y(video_ram, j), 0); } - drawgfx_transpen(state->m_helper, &rect, machine.gfx[1], + drawgfx_transpen(state->m_helper, &rect, screen.machine().gfx[1], get_sprite_code(video_ram, i), 0, 0, 0, get_sprite_x(video_ram, i), get_sprite_y(video_ram, i), 1); - state->m_collision[i] |= collision_check(state, machine.colortable, &rect); + state->m_collision[i] |= collision_check(state, screen.machine().colortable, &rect); } } diff --git a/src/mame/video/sprint4.c b/src/mame/video/sprint4.c index 5a0a1f9046d..17fe87646bf 100644 --- a/src/mame/video/sprint4.c +++ b/src/mame/video/sprint4.c @@ -59,7 +59,7 @@ VIDEO_START( sprint4 ) SCREEN_UPDATE( sprint4 ) { - sprint4_state *state = screen->machine().driver_data(); + sprint4_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; int i; @@ -77,7 +77,7 @@ SCREEN_UPDATE( sprint4 ) if (i & 1) bank = 32; - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], (code >> 3) | bank, (attr & 0x80) ? 4 : i, 0, 0, @@ -90,13 +90,13 @@ SCREEN_UPDATE( sprint4 ) SCREEN_EOF( sprint4 ) { - sprint4_state *state = machine.driver_data(); + sprint4_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; int i; /* check for sprite-playfield collisions */ - device_t *discrete = machine.device("discrete"); + device_t *discrete = screen.machine().device("discrete"); for (i = 0; i < 4; i++) { @@ -113,17 +113,17 @@ SCREEN_EOF( sprint4 ) rect.min_x = horz - 15; rect.min_y = vert - 15; - rect.max_x = horz - 15 + machine.gfx[1]->width - 1; - rect.max_y = vert - 15 + machine.gfx[1]->height - 1; + rect.max_x = horz - 15 + screen.machine().gfx[1]->width - 1; + rect.max_y = vert - 15 + screen.machine().gfx[1]->height - 1; - sect_rect(&rect, &machine.primary_screen->visible_area()); + sect_rect(&rect, &screen.machine().primary_screen->visible_area()); tilemap_draw(state->m_helper, &rect, state->m_playfield, 0, 0); if (i & 1) bank = 32; - drawgfx_transpen(state->m_helper, &rect, machine.gfx[1], + drawgfx_transpen(state->m_helper, &rect, screen.machine().gfx[1], (code >> 3) | bank, 4, 0, 0, @@ -132,7 +132,7 @@ SCREEN_EOF( sprint4 ) for (y = rect.min_y; y <= rect.max_y; y++) for (x = rect.min_x; x <= rect.max_x; x++) - if (colortable_entry_get_value(machine.colortable, *BITMAP_ADDR16(state->m_helper, y, x)) != 0) + if (colortable_entry_get_value(screen.machine().colortable, *BITMAP_ADDR16(state->m_helper, y, x)) != 0) state->m_collision[i] = 1; } diff --git a/src/mame/video/sprint8.c b/src/mame/video/sprint8.c index 45878d8859f..995881948f0 100644 --- a/src/mame/video/sprint8.c +++ b/src/mame/video/sprint8.c @@ -160,26 +160,26 @@ static TIMER_CALLBACK( sprint8_collision_callback ) SCREEN_UPDATE( sprint8 ) { - sprint8_state *state = screen->machine().driver_data(); - set_pens(state, screen->machine().colortable); + sprint8_state *state = screen.machine().driver_data(); + set_pens(state, screen.machine().colortable); tilemap_draw(bitmap, cliprect, state->m_tilemap1, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_EOF( sprint8 ) { - sprint8_state *state = machine.driver_data(); + sprint8_state *state = screen.machine().driver_data(); int x; int y; - const rectangle &visarea = machine.primary_screen->visible_area(); + const rectangle &visarea = screen.machine().primary_screen->visible_area(); tilemap_draw(state->m_helper2, &visarea, state->m_tilemap2, 0, 0); bitmap_fill(state->m_helper1, &visarea, 0x20); - draw_sprites(machine, state->m_helper1, &visarea); + draw_sprites(screen.machine(), state->m_helper1, &visarea); for (y = visarea.min_y; y <= visarea.max_y; y++) { @@ -188,8 +188,8 @@ SCREEN_EOF( sprint8 ) for (x = visarea.min_x; x <= visarea.max_x; x++) if (p1[x] != 0x20 && p2[x] == 0x23) - machine.scheduler().timer_set(machine.primary_screen->time_until_pos(y + 24, x), + screen.machine().scheduler().timer_set(screen.machine().primary_screen->time_until_pos(y + 24, x), FUNC(sprint8_collision_callback), - colortable_entry_get_value(machine.colortable, p1[x])); + colortable_entry_get_value(screen.machine().colortable, p1[x])); } } diff --git a/src/mame/video/spy.c b/src/mame/video/spy.c index f56b49b4150..e99281714be 100644 --- a/src/mame/video/spy.c +++ b/src/mame/video/spy.c @@ -64,11 +64,11 @@ VIDEO_START( spy ) SCREEN_UPDATE( spy ) { - spy_state *state = screen->machine().driver_data(); + spy_state *state = screen.machine().driver_data(); k052109_tilemap_update(state->m_k052109); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); if (!state->m_video_enable) bitmap_fill(bitmap, cliprect, 16 * state->m_layer_colorbase[0]); diff --git a/src/mame/video/srmp2.c b/src/mame/video/srmp2.c index 2db927150c1..cd6d4c5e482 100644 --- a/src/mame/video/srmp2.c +++ b/src/mame/video/srmp2.c @@ -52,51 +52,51 @@ int srmp3_gfxbank_callback( running_machine &machine, UINT16 code, UINT8 color ) SCREEN_UPDATE( srmp2 ) { - srmp2_state *state = screen->machine().driver_data(); + srmp2_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, 0x1ff); - screen->machine().device("spritegen")->set_transpen(15); + screen.machine().device("spritegen")->set_transpen(15); - screen->machine().device("spritegen")->set_colorbase((state->m_color_bank)?0x20:0x00); + screen.machine().device("spritegen")->set_colorbase((state->m_color_bank)?0x20:0x00); - screen->machine().device("spritegen")->set_fg_xoffsets( 0x10, 0x10 ); - screen->machine().device("spritegen")->set_fg_yoffsets( 0x05, 0x07 ); - screen->machine().device("spritegen")->set_bg_xoffsets( 0x00, 0x00 ); // bg not used? - screen->machine().device("spritegen")->set_bg_yoffsets( 0x00, 0x00 ); // bg not used? + screen.machine().device("spritegen")->set_fg_xoffsets( 0x10, 0x10 ); + screen.machine().device("spritegen")->set_fg_yoffsets( 0x05, 0x07 ); + screen.machine().device("spritegen")->set_bg_xoffsets( 0x00, 0x00 ); // bg not used? + screen.machine().device("spritegen")->set_bg_yoffsets( 0x00, 0x00 ); // bg not used? - screen->machine().device("spritegen")->seta001_draw_sprites(screen->machine(),bitmap,cliprect,0x1000, 1); + screen.machine().device("spritegen")->seta001_draw_sprites(screen.machine(),bitmap,cliprect,0x1000, 1); return 0; } SCREEN_UPDATE( srmp3 ) { - //srmp2_state *state = screen->machine().driver_data(); + //srmp2_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, 0x1f0); - screen->machine().device("spritegen")->set_fg_xoffsets( 0x10, 0x10 ); - screen->machine().device("spritegen")->set_fg_yoffsets( 0x06, 0x06 ); - screen->machine().device("spritegen")->set_bg_xoffsets( -0x01, 0x10 ); - screen->machine().device("spritegen")->set_bg_yoffsets( -0x06, 0x06 ); + screen.machine().device("spritegen")->set_fg_xoffsets( 0x10, 0x10 ); + screen.machine().device("spritegen")->set_fg_yoffsets( 0x06, 0x06 ); + screen.machine().device("spritegen")->set_bg_xoffsets( -0x01, 0x10 ); + screen.machine().device("spritegen")->set_bg_yoffsets( -0x06, 0x06 ); - screen->machine().device("spritegen")->set_gfxbank_callback( srmp3_gfxbank_callback ); + screen.machine().device("spritegen")->set_gfxbank_callback( srmp3_gfxbank_callback ); - screen->machine().device("spritegen")->seta001_draw_sprites(screen->machine(),bitmap,cliprect,0x1000, 1); + screen.machine().device("spritegen")->seta001_draw_sprites(screen.machine(),bitmap,cliprect,0x1000, 1); return 0; } SCREEN_UPDATE( mjyuugi ) { - //srmp2_state *state = screen->machine().driver_data(); + //srmp2_state *state = screen.machine().driver_data(); bitmap_fill(bitmap, cliprect, 0x1f0); - screen->machine().device("spritegen")->set_fg_xoffsets( 0x10, 0x10 ); - screen->machine().device("spritegen")->set_fg_yoffsets( 0x06, 0x06 ); - screen->machine().device("spritegen")->set_bg_yoffsets( 0x09, 0x07 ); + screen.machine().device("spritegen")->set_fg_xoffsets( 0x10, 0x10 ); + screen.machine().device("spritegen")->set_fg_yoffsets( 0x06, 0x06 ); + screen.machine().device("spritegen")->set_bg_yoffsets( 0x09, 0x07 ); - screen->machine().device("spritegen")->set_spritelimit( 0x1ff-6 ); + screen.machine().device("spritegen")->set_spritelimit( 0x1ff-6 ); - screen->machine().device("spritegen")->set_gfxbank_callback( srmp3_gfxbank_callback ); + screen.machine().device("spritegen")->set_gfxbank_callback( srmp3_gfxbank_callback ); - screen->machine().device("spritegen")->seta001_draw_sprites(screen->machine(),bitmap,cliprect,0x1000, 1); + screen.machine().device("spritegen")->seta001_draw_sprites(screen.machine(),bitmap,cliprect,0x1000, 1); return 0; } diff --git a/src/mame/video/srumbler.c b/src/mame/video/srumbler.c index dd026fe5b0f..1c7ea9a0f1e 100644 --- a/src/mame/video/srumbler.c +++ b/src/mame/video/srumbler.c @@ -162,9 +162,9 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( srumbler ) { - srumbler_state *state = screen->machine().driver_data(); + srumbler_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,TILEMAP_DRAW_LAYER1,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,TILEMAP_DRAW_LAYER0,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); return 0; @@ -172,7 +172,7 @@ SCREEN_UPDATE( srumbler ) SCREEN_EOF( srumbler ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram_w(space,0,0); } diff --git a/src/mame/video/sshangha.c b/src/mame/video/sshangha.c index 8a5590f9746..9fca60c5a6e 100644 --- a/src/mame/video/sshangha.c +++ b/src/mame/video/sshangha.c @@ -31,35 +31,35 @@ VIDEO_START( sshangha ) SCREEN_UPDATE( sshangha ) { - sshangha_state *state = screen->machine().driver_data(); + sshangha_state *state = screen.machine().driver_data(); - screen->machine().device("spritegen1")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.spriteram.u16, 0x800, true); + screen.machine().device("spritegen1")->draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.spriteram.u16, 0x800, true); // I'm pretty sure only the original has the 2nd spriteram, used for the Japanese text on the 2nd scene (non-scrolling text) in the intro of the quest (3rd in JPN) mode - if (screen->machine().generic.spriteram2.u16) - screen->machine().device("spritegen2")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.spriteram2.u16, 0x800, true); + if (screen.machine().generic.spriteram2.u16) + screen.machine().device("spritegen2")->draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.spriteram2.u16, 0x800, true); - tilemap_set_flip_all(screen->machine(),flip_screen_x_get(screen->machine()) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + tilemap_set_flip_all(screen.machine(),flip_screen_x_get(screen.machine()) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); /* the tilemap 4bpp + 4bpp = 8bpp mixing actually seems external to the tilemap, note video_control is not part of the tilemap chip */ if ((state->m_video_control&4)==0) { deco16ic_tilemap_12_combine_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0, 1); - screen->machine().device("spritegen1")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0200, 0x0200, 0x100, 0x1ff); + screen.machine().device("spritegen1")->inefficient_copy_sprite_bitmap(screen.machine(), bitmap, cliprect, 0x0200, 0x0200, 0x100, 0x1ff); } else { deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); - screen->machine().device("spritegen1")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0200, 0x0200, 0x100, 0x1ff); + screen.machine().device("spritegen1")->inefficient_copy_sprite_bitmap(screen.machine(), bitmap, cliprect, 0x0200, 0x0200, 0x100, 0x1ff); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); } - if (screen->machine().generic.spriteram2.u16) - screen->machine().device("spritegen2")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0000, 0x0000, 0, 0x1ff); + if (screen.machine().generic.spriteram2.u16) + screen.machine().device("spritegen2")->inefficient_copy_sprite_bitmap(screen.machine(), bitmap, cliprect, 0x0000, 0x0000, 0, 0x1ff); - screen->machine().device("spritegen1")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0000, 0x0200, 0, 0x1ff); + screen.machine().device("spritegen1")->inefficient_copy_sprite_bitmap(screen.machine(), bitmap, cliprect, 0x0000, 0x0200, 0, 0x1ff); return 0; } diff --git a/src/mame/video/sslam.c b/src/mame/video/sslam.c index 6cfa390c07d..3c89c87e2c7 100644 --- a/src/mame/video/sslam.c +++ b/src/mame/video/sslam.c @@ -193,11 +193,11 @@ VIDEO_START(powerbls) SCREEN_UPDATE(sslam) { - sslam_state *state = screen->machine().driver_data(); + sslam_state *state = screen.machine().driver_data(); if (!(state->m_regs[6] & 1)) { - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); return 0; } @@ -226,18 +226,18 @@ SCREEN_UPDATE(sslam) tilemap_draw(bitmap,cliprect,state->m_md_tilemap,0,0); } - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); return 0; } SCREEN_UPDATE(powerbls) { - sslam_state *state = screen->machine().driver_data(); + sslam_state *state = screen.machine().driver_data(); if (!(state->m_regs[6] & 1)) { - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); return 0; } @@ -245,6 +245,6 @@ SCREEN_UPDATE(powerbls) tilemap_set_scrolly(state->m_bg_tilemap,0, state->m_regs[1]-240); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); return 0; } diff --git a/src/mame/video/ssozumo.c b/src/mame/video/ssozumo.c index 483e902f613..515c277a649 100644 --- a/src/mame/video/ssozumo.c +++ b/src/mame/video/ssozumo.c @@ -186,10 +186,10 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( ssozumo ) { - ssozumo_state *state = screen->machine().driver_data(); + ssozumo_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/sspeedr.c b/src/mame/video/sspeedr.c index 1138c6fe291..bb318217812 100644 --- a/src/mame/video/sspeedr.c +++ b/src/mame/video/sspeedr.c @@ -260,15 +260,15 @@ VIDEO_START( sspeedr ) SCREEN_UPDATE( sspeedr ) { - draw_track(screen->machine(), bitmap); - draw_drones(screen->machine(), bitmap, cliprect); - draw_driver(screen->machine(), bitmap, cliprect); + draw_track(screen.machine(), bitmap); + draw_drones(screen.machine(), bitmap, cliprect); + draw_driver(screen.machine(), bitmap, cliprect); return 0; } SCREEN_EOF( sspeedr ) { - sspeedr_state *state = machine.driver_data(); + sspeedr_state *state = screen.machine().driver_data(); state->m_toggle ^= 1; } diff --git a/src/mame/video/ssrj.c b/src/mame/video/ssrj.c index 8640b5990e3..e7f342a3861 100644 --- a/src/mame/video/ssrj.c +++ b/src/mame/video/ssrj.c @@ -282,12 +282,12 @@ PALETTE_INIT( ssrj ) SCREEN_UPDATE( ssrj ) { - ssrj_state *state = screen->machine().driver_data(); + ssrj_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_tilemap1, 0, 0xff-state->m_scrollram[2] ); tilemap_set_scrolly(state->m_tilemap1, 0, state->m_scrollram[0] ); tilemap_draw(bitmap, cliprect, state->m_tilemap1, 0, 0); - draw_objects(screen->machine(), bitmap, cliprect); + draw_objects(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_tilemap2, 0, 0); if (state->m_scrollram[0x101] == 0xb) tilemap_draw(bitmap, cliprect, state->m_tilemap4, 0, 0);/* hack to display 4th tilemap */ @@ -296,7 +296,7 @@ SCREEN_UPDATE( ssrj ) SCREEN_EOF( ssrj ) { - ssrj_state *state = screen->machine().driver_data(); + ssrj_state *state = screen.machine().driver_data(); memcpy(state->m_buffer_spriteram, state->m_scrollram, 0x800); } diff --git a/src/mame/video/ssv.c b/src/mame/video/ssv.c index 781f34e1e9b..99ad1ac4930 100644 --- a/src/mame/video/ssv.c +++ b/src/mame/video/ssv.c @@ -1167,13 +1167,13 @@ static void gdfs_draw_zooming_sprites(running_machine &machine, bitmap_t *bitmap SCREEN_UPDATE( gdfs ) { - ssv_state *state = screen->machine().driver_data(); + ssv_state *state = screen.machine().driver_data(); int pri; SCREEN_UPDATE_CALL(ssv); for (pri = 0; pri <= 0xf; pri++) - gdfs_draw_zooming_sprites(screen->machine(), bitmap, cliprect, pri); + gdfs_draw_zooming_sprites(screen.machine(), bitmap, cliprect, pri); tilemap_set_scrollx(state->m_gdfs_tmap, 0, state->m_gdfs_tmapscroll[0x0c/2]); tilemap_set_scrolly(state->m_gdfs_tmap, 0, state->m_gdfs_tmapscroll[0x10/2]); @@ -1193,7 +1193,7 @@ SCREEN_UPDATE( ssv ) { rectangle clip = { 0, 0, 0, 0 }; - ssv_state *state = screen->machine().driver_data(); + ssv_state *state = screen.machine().driver_data(); // Shadow if (state->m_scroll[0x76/2] & 0x0080) @@ -1232,9 +1232,9 @@ SCREEN_UPDATE( ssv ) if (!state->m_enable_video) return 0; - draw_layer(screen->machine(), bitmap, &clip, 0); // "background layer" + draw_layer(screen.machine(), bitmap, &clip, 0); // "background layer" - draw_sprites(screen->machine(), bitmap, &clip); // sprites list + draw_sprites(screen.machine(), bitmap, &clip); // sprites list return 0; diff --git a/src/mame/video/st0016.c b/src/mame/video/st0016.c index 49015e4b0b1..447b55f6d1d 100644 --- a/src/mame/video/st0016.c +++ b/src/mame/video/st0016.c @@ -584,18 +584,18 @@ static void draw_bgmap(running_machine &machine, bitmap_t *bitmap,const rectangl } -void st0016_draw_screen(screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect) +void st0016_draw_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect) { - draw_bgmap(screen->machine(), bitmap,cliprect,0); - draw_sprites(screen->machine(), bitmap,cliprect); - draw_bgmap(screen->machine(), bitmap,cliprect,1); + draw_bgmap(screen.machine(), bitmap,cliprect,0); + draw_sprites(screen.machine(), bitmap,cliprect); + draw_bgmap(screen.machine(), bitmap,cliprect,1); } SCREEN_UPDATE( st0016 ) { #ifdef MAME_DEBUG - if(screen->machine().input().code_pressed_once(KEYCODE_Z)) + if(screen.machine().input().code_pressed_once(KEYCODE_Z)) { int h,j; FILE *p=fopen("vram.bin","wb"); diff --git a/src/mame/video/stactics.c b/src/mame/video/stactics.c index 1be030862cc..5533a4215de 100644 --- a/src/mame/video/stactics.c +++ b/src/mame/video/stactics.c @@ -390,11 +390,11 @@ static VIDEO_START( stactics ) static SCREEN_UPDATE( stactics ) { - stactics_state *state = screen->machine().driver_data(); + stactics_state *state = screen.machine().driver_data(); update_beam(state); draw_background(state, bitmap, cliprect); - update_artwork(screen->machine(), state); + update_artwork(screen.machine(), state); state->m_frame_count = (state->m_frame_count + 1) & 0x0f; diff --git a/src/mame/video/stadhero.c b/src/mame/video/stadhero.c index 7d43472add8..8dd7cb39b6b 100644 --- a/src/mame/video/stadhero.c +++ b/src/mame/video/stadhero.c @@ -21,12 +21,12 @@ SCREEN_UPDATE( stadhero ) { - stadhero_state *state = screen->machine().driver_data(); -// tilemap_set_flip_all(screen->machine(),state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + stadhero_state *state = screen.machine().driver_data(); +// tilemap_set_flip_all(screen.machine(),state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); - screen->machine().device("tilegen1")->set_bppmultmask(0x8, 0x7); - screen->machine().device("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram, 0x00, 0x00, 0x0f); + screen.machine().device("tilegen1")->set_bppmultmask(0x8, 0x7); + screen.machine().device("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0x00, 0x00, 0x0f); tilemap_draw(bitmap,cliprect,state->m_pf1_tilemap,0,0); return 0; } diff --git a/src/mame/video/starcrus.c b/src/mame/video/starcrus.c index 9ec90890854..bc50f254d4e 100644 --- a/src/mame/video/starcrus.c +++ b/src/mame/video/starcrus.c @@ -427,14 +427,14 @@ static int collision_check_s2p1p2(running_machine &machine) SCREEN_UPDATE( starcrus ) { - starcrus_state *state = screen->machine().driver_data(); + starcrus_state *state = screen.machine().driver_data(); bitmap_fill(bitmap,cliprect,0); /* Draw ship 1 */ drawgfx_transpen(bitmap, cliprect, - screen->machine().gfx[8+((state->m_s1_sprite&0x04)>>2)], + screen.machine().gfx[8+((state->m_s1_sprite&0x04)>>2)], (state->m_s1_sprite&0x03)^0x03, 0, (state->m_s1_sprite&0x08)>>3, (state->m_s1_sprite&0x10)>>4, @@ -444,7 +444,7 @@ SCREEN_UPDATE( starcrus ) /* Draw ship 2 */ drawgfx_transpen(bitmap, cliprect, - screen->machine().gfx[10+((state->m_s2_sprite&0x04)>>2)], + screen.machine().gfx[10+((state->m_s2_sprite&0x04)>>2)], (state->m_s2_sprite&0x03)^0x03, 0, (state->m_s2_sprite&0x08)>>3, (state->m_s2_sprite&0x10)>>4, @@ -454,7 +454,7 @@ SCREEN_UPDATE( starcrus ) /* Draw score/projectile 1 */ drawgfx_transpen(bitmap, cliprect, - screen->machine().gfx[(state->m_p1_sprite&0x0c)>>2], + screen.machine().gfx[(state->m_p1_sprite&0x0c)>>2], (state->m_p1_sprite&0x03)^0x03, 0, 0,0, @@ -464,7 +464,7 @@ SCREEN_UPDATE( starcrus ) /* Draw score/projectile 2 */ drawgfx_transpen(bitmap, cliprect, - screen->machine().gfx[4+((state->m_p2_sprite&0x0c)>>2)], + screen.machine().gfx[4+((state->m_p2_sprite&0x0c)>>2)], (state->m_p2_sprite&0x03)^0x03, 0, 0,0, @@ -472,28 +472,28 @@ SCREEN_UPDATE( starcrus ) 0); /* Collision detection */ - if (cliprect->max_y == screen->visible_area().max_y) + if (cliprect->max_y == screen.visible_area().max_y) { state->m_collision_reg = 0x00; /* Check for collisions between ship1 and ship2 */ - if (collision_check_s1s2(screen->machine())) + if (collision_check_s1s2(screen.machine())) { state->m_collision_reg |= 0x08; } /* Check for collisions between ship1 and projectiles */ - if (collision_check_s1p1p2(screen->machine())) + if (collision_check_s1p1p2(screen.machine())) { state->m_collision_reg |= 0x02; } /* Check for collisions between ship1 and projectiles */ - if (collision_check_s2p1p2(screen->machine())) + if (collision_check_s2p1p2(screen.machine())) { state->m_collision_reg |= 0x01; } /* Check for collisions between ship1 and projectiles */ /* Note: I don't think this is used by the game */ - if (collision_check_p1p2(screen->machine())) + if (collision_check_p1p2(screen.machine())) { state->m_collision_reg |= 0x04; } diff --git a/src/mame/video/starfire.c b/src/mame/video/starfire.c index 24d172a0942..9acc422d2ce 100644 --- a/src/mame/video/starfire.c +++ b/src/mame/video/starfire.c @@ -270,7 +270,7 @@ static TIMER_CALLBACK( starfire_scanline_callback ) SCREEN_UPDATE( starfire ) { - starfire_state *state = screen->machine().driver_data(); + starfire_state *state = screen.machine().driver_data(); copybitmap(bitmap, state->m_starfire_screen, 0, 0, 0, 0, cliprect); return 0; diff --git a/src/mame/video/starshp1.c b/src/mame/video/starshp1.c index d73317bc7ec..f09f1c3bd52 100644 --- a/src/mame/video/starshp1.c +++ b/src/mame/video/starshp1.c @@ -358,24 +358,24 @@ static int circle_collision(starshp1_state *state, const rectangle *rect) SCREEN_UPDATE( starshp1 ) { - starshp1_state *state = screen->machine().driver_data(); - set_pens(state, screen->machine().colortable); + starshp1_state *state = screen.machine().driver_data(); + set_pens(state, screen.machine().colortable); bitmap_fill(bitmap, cliprect, 0); if (state->m_starfield_kill == 0) draw_starfield(state, bitmap); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); if (state->m_circle_kill == 0 && state->m_circle_mod != 0) - draw_circle(screen->machine(), bitmap); + draw_circle(screen.machine(), bitmap); if (state->m_attract == 0) - draw_spaceship(screen->machine(), bitmap, cliprect); + draw_spaceship(screen.machine(), bitmap, cliprect); if (state->m_circle_kill == 0 && state->m_circle_mod == 0) - draw_circle(screen->machine(), bitmap); + draw_circle(screen.machine(), bitmap); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); @@ -388,14 +388,14 @@ SCREEN_UPDATE( starshp1 ) SCREEN_EOF( starshp1 ) { - starshp1_state *state = machine.driver_data(); + starshp1_state *state = screen.machine().driver_data(); rectangle rect; - const rectangle &visarea = machine.primary_screen->visible_area(); + const rectangle &visarea = screen.machine().primary_screen->visible_area(); rect.min_x = get_sprite_hpos(state, 13); rect.min_y = get_sprite_vpos(state, 13); - rect.max_x = rect.min_x + machine.gfx[1]->width - 1; - rect.max_y = rect.min_y + machine.gfx[1]->height - 1; + rect.max_x = rect.min_x + screen.machine().gfx[1]->width - 1; + rect.max_y = rect.min_y + screen.machine().gfx[1]->height - 1; if (rect.min_x < 0) rect.min_x = 0; @@ -409,7 +409,7 @@ SCREEN_EOF( starshp1 ) bitmap_fill(state->m_helper, &visarea, 0); if (state->m_attract == 0) - draw_spaceship(machine, state->m_helper, &visarea); + draw_spaceship(screen.machine(), state->m_helper, &visarea); if (circle_collision(state, &visarea)) state->m_collision_latch |= 1; @@ -417,9 +417,9 @@ SCREEN_EOF( starshp1 ) if (circle_collision(state, &rect)) state->m_collision_latch |= 2; - if (spaceship_collision(machine, state->m_helper, &rect)) + if (spaceship_collision(screen.machine(), state->m_helper, &rect)) state->m_collision_latch |= 4; - if (spaceship_collision(machine, state->m_helper, &visarea)) + if (spaceship_collision(screen.machine(), state->m_helper, &visarea)) state->m_collision_latch |= 8; } diff --git a/src/mame/video/stfight.c b/src/mame/video/stfight.c index 48bca0487fc..c6486725bcc 100644 --- a/src/mame/video/stfight.c +++ b/src/mame/video/stfight.c @@ -294,10 +294,10 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( stfight ) { - stfight_state *state = screen->machine().driver_data(); - set_pens(screen->machine()); + stfight_state *state = screen.machine().driver_data(); + set_pens(screen.machine()); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); bitmap_fill(bitmap,cliprect,0); /* in case state->m_bg_tilemap is disabled */ tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); @@ -305,7 +305,7 @@ SCREEN_UPDATE( stfight ) /* Draw sprites (may be obscured by foreground layer) */ if (state->m_vh_latch_ram[0x07] & 0x40) - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); return 0; diff --git a/src/mame/video/stlforce.c b/src/mame/video/stlforce.c index 9875a78bf5e..b5bf9d03004 100644 --- a/src/mame/video/stlforce.c +++ b/src/mame/video/stlforce.c @@ -133,7 +133,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( stlforce ) { - stlforce_state *state = screen->machine().driver_data(); + stlforce_state *state = screen.machine().driver_data(); int i; if (state->m_vidattrram[6] & 1) @@ -179,7 +179,7 @@ SCREEN_UPDATE( stlforce ) tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_mlow_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_mhigh_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); return 0; } diff --git a/src/mame/video/strnskil.c b/src/mame/video/strnskil.c index 5c94a4b83a4..ef8ef39575d 100644 --- a/src/mame/video/strnskil.c +++ b/src/mame/video/strnskil.c @@ -125,9 +125,9 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( strnskil ) { - strnskil_state *state = screen->machine().driver_data(); + strnskil_state *state = screen.machine().driver_data(); int row; - const UINT8 *usr1 = screen->machine().region("user1")->base(); + const UINT8 *usr1 = screen.machine().region("user1")->base(); for (row = 0; row < 32; row++) { @@ -146,6 +146,6 @@ SCREEN_UPDATE( strnskil ) } tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/stvvdp2.c b/src/mame/video/stvvdp2.c index 5516d089923..1467fe46dd4 100644 --- a/src/mame/video/stvvdp2.c +++ b/src/mame/video/stvvdp2.c @@ -6805,40 +6805,40 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( stv_vdp2 ) { - saturn_state *state = screen->machine().driver_data(); + saturn_state *state = screen.machine().driver_data(); static UINT8 pri; - stv_vdp2_fade_effects(screen->machine()); + stv_vdp2_fade_effects(screen.machine()); - stv_vdp2_draw_back(screen->machine(), bitmap,cliprect); + stv_vdp2_draw_back(screen.machine(), bitmap,cliprect); #if DEBUG_MODE - if(screen->machine().input().code_pressed_once(KEYCODE_T)) + if(screen.machine().input().code_pressed_once(KEYCODE_T)) { debug.l_en^=1; popmessage("NBG3 %sabled",debug.l_en & 1 ? "en" : "dis"); } - if(screen->machine().input().code_pressed_once(KEYCODE_Y)) + if(screen.machine().input().code_pressed_once(KEYCODE_Y)) { debug.l_en^=2; popmessage("NBG2 %sabled",debug.l_en & 2 ? "en" : "dis"); } - if(screen->machine().input().code_pressed_once(KEYCODE_U)) + if(screen.machine().input().code_pressed_once(KEYCODE_U)) { debug.l_en^=4; popmessage("NBG1 %sabled",debug.l_en & 4 ? "en" : "dis"); } - if(screen->machine().input().code_pressed_once(KEYCODE_I)) + if(screen.machine().input().code_pressed_once(KEYCODE_I)) { debug.l_en^=8; popmessage("NBG0 %sabled",debug.l_en & 8 ? "en" : "dis"); } - if(screen->machine().input().code_pressed_once(KEYCODE_K)) + if(screen.machine().input().code_pressed_once(KEYCODE_K)) { debug.l_en^=0x10; popmessage("RBG0 %sabled",debug.l_en & 0x10 ? "en" : "dis"); } - if(screen->machine().input().code_pressed_once(KEYCODE_O)) + if(screen.machine().input().code_pressed_once(KEYCODE_O)) { debug.l_en^=0x20; popmessage("SPRITE %sabled",debug.l_en & 0x20 ? "en" : "dis"); @@ -6854,12 +6854,12 @@ SCREEN_UPDATE( stv_vdp2 ) /*If a plane has a priority value of zero it isn't shown at all.*/ for(pri=1;pri<8;pri++) { - if (debug.l_en & 1) { if(pri==STV_VDP2_N3PRIN) stv_vdp2_draw_NBG3(screen->machine(), bitmap,cliprect); } - if (debug.l_en & 2) { if(pri==STV_VDP2_N2PRIN) stv_vdp2_draw_NBG2(screen->machine(), bitmap,cliprect); } - if (debug.l_en & 4) { if(pri==STV_VDP2_N1PRIN) stv_vdp2_draw_NBG1(screen->machine(), bitmap,cliprect); } - if (debug.l_en & 8) { if(pri==STV_VDP2_N0PRIN) stv_vdp2_draw_NBG0(screen->machine(), bitmap,cliprect); } - if (debug.l_en & 0x10) { if(pri==STV_VDP2_R0PRIN) stv_vdp2_draw_RBG0(screen->machine(), bitmap,cliprect); } - if (debug.l_en & 0x20) { draw_sprites(screen->machine(),bitmap,cliprect,pri); } + if (debug.l_en & 1) { if(pri==STV_VDP2_N3PRIN) stv_vdp2_draw_NBG3(screen.machine(), bitmap,cliprect); } + if (debug.l_en & 2) { if(pri==STV_VDP2_N2PRIN) stv_vdp2_draw_NBG2(screen.machine(), bitmap,cliprect); } + if (debug.l_en & 4) { if(pri==STV_VDP2_N1PRIN) stv_vdp2_draw_NBG1(screen.machine(), bitmap,cliprect); } + if (debug.l_en & 8) { if(pri==STV_VDP2_N0PRIN) stv_vdp2_draw_NBG0(screen.machine(), bitmap,cliprect); } + if (debug.l_en & 0x10) { if(pri==STV_VDP2_R0PRIN) stv_vdp2_draw_RBG0(screen.machine(), bitmap,cliprect); } + if (debug.l_en & 0x20) { draw_sprites(screen.machine(),bitmap,cliprect,pri); } } } @@ -6870,51 +6870,51 @@ SCREEN_UPDATE( stv_vdp2 ) ,STV_VDP2_N1ZMXI,STV_VDP2_N1ZMXD ,STV_VDP2_N1ZMYI,STV_VDP2_N1ZMYD);*/ - if ( screen->machine().input().code_pressed_once(KEYCODE_W) ) + if ( screen.machine().input().code_pressed_once(KEYCODE_W) ) { int tilecode; for (tilecode = 0;tilecode<0x8000;tilecode++) { - gfx_element_mark_dirty(screen->machine().gfx[0], tilecode); + gfx_element_mark_dirty(screen.machine().gfx[0], tilecode); } for (tilecode = 0;tilecode<0x2000;tilecode++) { - gfx_element_mark_dirty(screen->machine().gfx[1], tilecode); + gfx_element_mark_dirty(screen.machine().gfx[1], tilecode); } for (tilecode = 0;tilecode<0x4000;tilecode++) { - gfx_element_mark_dirty(screen->machine().gfx[2], tilecode); + gfx_element_mark_dirty(screen.machine().gfx[2], tilecode); } for (tilecode = 0;tilecode<0x1000;tilecode++) { - gfx_element_mark_dirty(screen->machine().gfx[3], tilecode); + gfx_element_mark_dirty(screen.machine().gfx[3], tilecode); } /* vdp 1 ... doesn't have to be tile based */ for (tilecode = 0;tilecode<0x8000;tilecode++) { - gfx_element_mark_dirty(screen->machine().gfx[4], tilecode); + gfx_element_mark_dirty(screen.machine().gfx[4], tilecode); } for (tilecode = 0;tilecode<0x2000;tilecode++) { - gfx_element_mark_dirty(screen->machine().gfx[5], tilecode); + gfx_element_mark_dirty(screen.machine().gfx[5], tilecode); } for (tilecode = 0;tilecode<0x4000;tilecode++) { - gfx_element_mark_dirty(screen->machine().gfx[6], tilecode); + gfx_element_mark_dirty(screen.machine().gfx[6], tilecode); } for (tilecode = 0;tilecode<0x1000;tilecode++) { - gfx_element_mark_dirty(screen->machine().gfx[7], tilecode); + gfx_element_mark_dirty(screen.machine().gfx[7], tilecode); } } - if ( screen->machine().input().code_pressed_once(KEYCODE_N) ) + if ( screen.machine().input().code_pressed_once(KEYCODE_N) ) { FILE *fp; @@ -6926,7 +6926,7 @@ SCREEN_UPDATE( stv_vdp2 ) } } - if ( screen->machine().input().code_pressed_once(KEYCODE_M) ) + if ( screen.machine().input().code_pressed_once(KEYCODE_M) ) { FILE *fp; @@ -7356,16 +7356,16 @@ static void vdp2_palette_entry(running_machine &machine, int *r, int *g, int *b, SCREEN_UPDATE( saturn ) { - saturn_state *state = screen->machine().driver_data(); + saturn_state *state = screen.machine().driver_data(); static UINT8 disclaimer; - vdp2_draw_back(screen->machine(),bitmap,cliprect); + vdp2_draw_back(screen.machine(),bitmap,cliprect); if(STV_VDP2_DISP) { - copy_plane(screen->machine(),3); + copy_plane(screen.machine(),3); - draw_normal_screen(screen->machine(),bitmap,cliprect,3); + draw_normal_screen(screen.machine(),bitmap,cliprect,3); } if(disclaimer == 0) diff --git a/src/mame/video/subs.c b/src/mame/video/subs.c index 46a5c7b12a6..5da93009463 100644 --- a/src/mame/video/subs.c +++ b/src/mame/video/subs.c @@ -37,16 +37,14 @@ WRITE8_HANDLER( subs_invert2_w ) } -SCREEN_UPDATE( subs ) +SCREEN_UPDATE( subs_left ) { - subs_state *state = screen->machine().driver_data(); + subs_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; UINT8 *spriteram = state->m_spriteram; int offs; - device_t *left_screen = screen->machine().device("lscreen"); - device_t *right_screen = screen->machine().device("rscreen"); - device_t *discrete = screen->machine().device("discrete"); + device_t *discrete = screen.machine().device("discrete"); /* for every character in the Video RAM, check if it has been modified */ /* since last time and update it accordingly. */ @@ -78,30 +76,14 @@ SCREEN_UPDATE( subs ) charcode = charcode & 0x3F; /* draw the left screen */ - if (screen == left_screen) - { - if ((left_enable || left_sonar_window) && (!right_sonar_window)) - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0], - charcode, 1, - 0,0,sx,sy); - else - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0], - 0, 1, - 0,0,sx,sy); - } - - /* draw the right screen */ - if (screen == right_screen) - { - if ((right_enable || right_sonar_window) && (!left_sonar_window)) - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0], - charcode, 0, - 0,0,sx,sy); - else - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0], - 0, 0, - 0,0,sx,sy); - } + if ((left_enable || left_sonar_window) && (!right_sonar_window)) + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0], + charcode, 1, + 0,0,sx,sy); + else + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0], + 0, 1, + 0,0,sx,sy); } /* draw the motion objects */ @@ -124,25 +106,11 @@ SCREEN_UPDATE( subs ) charcode = (charcode >> 3) & 0x1F; /* left screen - special check for drawing right screen's sub */ - if (screen == left_screen) - { - if ((offs!=0) || (sub_enable)) - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1], - charcode + 32 * prom_set, - 0, - 0,0,sx,sy,0); - } - - - /* right screen - special check for drawing left screen's sub */ - if (screen == right_screen) - { - if ((offs!=1) || (sub_enable)) - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1], - charcode + 32 * prom_set, - 0, - 0,0,sx,sy,0); - } + if ((offs!=0) || (sub_enable)) + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1], + charcode + 32 * prom_set, + 0, + 0,0,sx,sy,0); } /* Update sound */ @@ -150,3 +118,79 @@ SCREEN_UPDATE( subs ) discrete_sound_w(discrete, SUBS_CRASH_DATA, spriteram[5] >> 4); // Crash/explode data return 0; } + +SCREEN_UPDATE( subs_right ) +{ + subs_state *state = screen.machine().driver_data(); + UINT8 *videoram = state->m_videoram; + UINT8 *spriteram = state->m_spriteram; + int offs; + + /* for every character in the Video RAM, check if it has been modified */ + /* since last time and update it accordingly. */ + for (offs = 0x400 - 1; offs >= 0; offs--) + { + int charcode; + int sx,sy; + int left_enable,right_enable; + int left_sonar_window,right_sonar_window; + + left_sonar_window = 0; + right_sonar_window = 0; + + charcode = videoram[offs]; + + /* Which monitor is this for? */ + right_enable = charcode & 0x40; + left_enable = charcode & 0x80; + + sx = 8 * (offs % 32); + sy = 8 * (offs / 32); + + /* Special hardware logic for sonar windows */ + if ((sy >= (128+64)) && (sx < 32)) + left_sonar_window = 1; + else if ((sy >= (128+64)) && (sx >= (128+64+32))) + right_sonar_window = 1; + else + charcode = charcode & 0x3F; + + /* draw the right screen */ + if ((right_enable || right_sonar_window) && (!left_sonar_window)) + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0], + charcode, 0, + 0,0,sx,sy); + else + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0], + 0, 0, + 0,0,sx,sy); + } + + /* draw the motion objects */ + for (offs = 0; offs < 4; offs++) + { + int sx,sy; + int charcode; + int prom_set; + int sub_enable; + + sx = spriteram[0x00 + (offs * 2)] - 16; + sy = spriteram[0x08 + (offs * 2)] - 16; + charcode = spriteram[0x09 + (offs * 2)]; + if (offs < 2) + sub_enable = spriteram[0x01 + (offs * 2)] & 0x80; + else + sub_enable = 1; + + prom_set = charcode & 0x01; + charcode = (charcode >> 3) & 0x1F; + + if ((offs!=1) || (sub_enable)) + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1], + charcode + 32 * prom_set, + 0, + 0,0,sx,sy,0); + } + + return 0; +} diff --git a/src/mame/video/suna16.c b/src/mame/video/suna16.c index 100e0993c4c..029943a50a5 100644 --- a/src/mame/video/suna16.c +++ b/src/mame/video/suna16.c @@ -223,31 +223,31 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( suna16 ) { - suna16_state *state = screen->machine().driver_data(); + suna16_state *state = screen.machine().driver_data(); /* Suna Quiz indicates the background is the last pen */ bitmap_fill(bitmap,cliprect,0xff); - draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram, 0); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0); return 0; } SCREEN_UPDATE( bestbest ) { - suna16_state *state = screen->machine().driver_data(); + suna16_state *state = screen.machine().driver_data(); int layers_ctrl = -1; #ifdef MAME_DEBUG -if (screen->machine().input().code_pressed(KEYCODE_Z)) +if (screen.machine().input().code_pressed(KEYCODE_Z)) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 2; if (msk != 0) layers_ctrl &= msk; } #endif /* Suna Quiz indicates the background is the last pen */ bitmap_fill(bitmap,cliprect,0xff); - if (layers_ctrl & 1) draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram, 0); - if (layers_ctrl & 2) draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram2, 1); + if (layers_ctrl & 1) draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0); + if (layers_ctrl & 2) draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram2, 1); return 0; } diff --git a/src/mame/video/suna8.c b/src/mame/video/suna8.c index dd51f1a5591..56bffaade9e 100644 --- a/src/mame/video/suna8.c +++ b/src/mame/video/suna8.c @@ -419,17 +419,17 @@ SCREEN_UPDATE( suna8 ) #ifdef MAME_DEBUG #if TILEMAPS - if (screen->machine().input().code_pressed(KEYCODE_Z) || screen->machine().input().code_pressed(KEYCODE_X)) + if (screen.machine().input().code_pressed(KEYCODE_Z) || screen.machine().input().code_pressed(KEYCODE_X)) { - suna8_state *state = screen->machine().driver_data(); - int max_tiles = screen->machine().region("gfx1")->bytes() / (0x400 * 0x20); + suna8_state *state = screen.machine().driver_data(); + int max_tiles = screen.machine().region("gfx1")->bytes() / (0x400 * 0x20); - if (screen->machine().input().code_pressed_once(KEYCODE_Q)) { state->m_page--; tilemap_mark_all_tiles_dirty_all(screen->machine()); } - if (screen->machine().input().code_pressed_once(KEYCODE_W)) { state->m_page++; tilemap_mark_all_tiles_dirty_all(screen->machine()); } - if (screen->machine().input().code_pressed_once(KEYCODE_E)) { state->m_tiles--; tilemap_mark_all_tiles_dirty_all(screen->machine()); } - if (screen->machine().input().code_pressed_once(KEYCODE_R)) { state->m_tiles++; tilemap_mark_all_tiles_dirty_all(screen->machine()); } - if (screen->machine().input().code_pressed_once(KEYCODE_A)) { state->m_trombank--; tilemap_mark_all_tiles_dirty_all(screen->machine()); } - if (screen->machine().input().code_pressed_once(KEYCODE_S)) { state->m_trombank++; tilemap_mark_all_tiles_dirty_all(screen->machine()); } + if (screen.machine().input().code_pressed_once(KEYCODE_Q)) { state->m_page--; tilemap_mark_all_tiles_dirty_all(screen.machine()); } + if (screen.machine().input().code_pressed_once(KEYCODE_W)) { state->m_page++; tilemap_mark_all_tiles_dirty_all(screen.machine()); } + if (screen.machine().input().code_pressed_once(KEYCODE_E)) { state->m_tiles--; tilemap_mark_all_tiles_dirty_all(screen.machine()); } + if (screen.machine().input().code_pressed_once(KEYCODE_R)) { state->m_tiles++; tilemap_mark_all_tiles_dirty_all(screen.machine()); } + if (screen.machine().input().code_pressed_once(KEYCODE_A)) { state->m_trombank--; tilemap_mark_all_tiles_dirty_all(screen.machine()); } + if (screen.machine().input().code_pressed_once(KEYCODE_S)) { state->m_trombank++; tilemap_mark_all_tiles_dirty_all(screen.machine()); } state->m_rombank &= 0xf; state->m_page &= (state->m_text_dim > 0)?3:7; @@ -449,8 +449,8 @@ SCREEN_UPDATE( suna8 ) #endif #endif { - draw_normal_sprites(screen->machine() ,bitmap,cliprect); - draw_text_sprites(screen->machine(), bitmap,cliprect); + draw_normal_sprites(screen.machine() ,bitmap,cliprect); + draw_text_sprites(screen.machine(), bitmap,cliprect); } return 0; } diff --git a/src/mame/video/supbtime.c b/src/mame/video/supbtime.c index 382e60e9f67..b1d3bbc7f06 100644 --- a/src/mame/video/supbtime.c +++ b/src/mame/video/supbtime.c @@ -23,16 +23,16 @@ End sequence uses rowscroll '98 c0' on pf1 (jmp to 1d61a on supbtimj) SCREEN_UPDATE(supbtime) { - supbtime_state *state = screen->machine().driver_data(); + supbtime_state *state = screen.machine().driver_data(); UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); - flip_screen_set(screen->machine(), BIT(flip, 7)); + flip_screen_set(screen.machine(), BIT(flip, 7)); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); bitmap_fill(bitmap, cliprect, 768); deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram, 0x400); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0x400); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; } diff --git a/src/mame/video/superchs.c b/src/mame/video/superchs.c index 9f44c2b86d1..1ef57c628c5 100644 --- a/src/mame/video/superchs.c +++ b/src/mame/video/superchs.c @@ -201,7 +201,7 @@ logerror("Sprite number %04x had %02x invalid chunks\n",tilenum,bad_chunks); SCREEN_UPDATE( superchs ) { - device_t *tc0480scp = screen->machine().device("tc0480scp"); + device_t *tc0480scp = screen.machine().device("tc0480scp"); UINT8 layer[5]; UINT16 priority; static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0}; @@ -215,25 +215,25 @@ SCREEN_UPDATE( superchs ) layer[3] = (priority & 0x000f) >> 0; /* tells us which is top */ layer[4] = 4; /* text layer always over bg layers */ - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); /* We have to assume 2nd to bottom layer is always underneath sprites as pdrawgfx cannot yet cope with more than 4 layers */ #ifdef MAME_DEBUG - if (!screen->machine().input().code_pressed (KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0); - if (!screen->machine().input().code_pressed (KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1); - if (!screen->machine().input().code_pressed (KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2); - if (!screen->machine().input().code_pressed (KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4); - if (!screen->machine().input().code_pressed (KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8); - if (!screen->machine().input().code_pressed (KEYCODE_N)) draw_sprites(screen->machine(), bitmap, cliprect, primasks, 48, -116); + if (!screen.machine().input().code_pressed (KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0); + if (!screen.machine().input().code_pressed (KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1); + if (!screen.machine().input().code_pressed (KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2); + if (!screen.machine().input().code_pressed (KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4); + if (!screen.machine().input().code_pressed (KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8); + if (!screen.machine().input().code_pressed (KEYCODE_N)) draw_sprites(screen.machine(), bitmap, cliprect, primasks, 48, -116); #else tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0); tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1); tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2); tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4); tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8); /* text layer */ - draw_sprites(screen->machine(), bitmap, cliprect, primasks, 48, -116); + draw_sprites(screen.machine(), bitmap, cliprect, primasks, 48, -116); #endif return 0; } diff --git a/src/mame/video/superqix.c b/src/mame/video/superqix.c index aa3a0dd4fd3..9bf1045831c 100644 --- a/src/mame/video/superqix.c +++ b/src/mame/video/superqix.c @@ -227,19 +227,19 @@ static void superqix_draw_sprites(running_machine &machine, bitmap_t *bitmap,con SCREEN_UPDATE( pbillian ) { - superqix_state *state = screen->machine().driver_data(); + superqix_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - pbillian_draw_sprites(screen->machine(), bitmap,cliprect); + pbillian_draw_sprites(screen.machine(), bitmap,cliprect); return 0; } SCREEN_UPDATE( superqix ) { - superqix_state *state = screen->machine().driver_data(); + superqix_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1, 0); - copybitmap_trans(bitmap,state->m_fg_bitmap[state->m_show_bitmap],flip_screen_get(screen->machine()),flip_screen_get(screen->machine()),0,0,cliprect,0); - superqix_draw_sprites(screen->machine(), bitmap,cliprect); + copybitmap_trans(bitmap,state->m_fg_bitmap[state->m_show_bitmap],flip_screen_get(screen.machine()),flip_screen_get(screen.machine()),0,0,cliprect,0); + superqix_draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0, 0); return 0; } diff --git a/src/mame/video/suprloco.c b/src/mame/video/suprloco.c index fb6f943fe65..a513964ed81 100644 --- a/src/mame/video/suprloco.c +++ b/src/mame/video/suprloco.c @@ -271,9 +271,9 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( suprloco ) { - suprloco_state *state = screen->machine().driver_data(); + suprloco_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,1,0); return 0; } diff --git a/src/mame/video/suprnova.c b/src/mame/video/suprnova.c index 79bb22528d2..de12d5904a2 100644 --- a/src/mame/video/suprnova.c +++ b/src/mame/video/suprnova.c @@ -455,11 +455,11 @@ static void supernova_draw_b( running_machine &machine, bitmap_t *bitmap, bitmap SCREEN_UPDATE(skns) { - skns_state *state = screen->machine().driver_data(); + skns_state *state = screen.machine().driver_data(); - palette_update(screen->machine()); + palette_update(screen.machine()); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); bitmap_fill(state->m_tilemap_bitmap_lower, NULL, 0); bitmap_fill(state->m_tilemap_bitmapflags_lower, NULL, 0); bitmap_fill(state->m_tilemap_bitmap_higher, NULL, 0); @@ -476,8 +476,8 @@ SCREEN_UPDATE(skns) //popmessage("pri %d %d\n", supernova_pri_a, supernova_pri_b); /*if (!supernova_pri_b) { */ - supernova_draw_b(screen->machine(), state->m_tilemap_bitmap_lower, state->m_tilemap_bitmapflags_lower, cliprect,tran);// tran = 1; - supernova_draw_a(screen->machine(), state->m_tilemap_bitmap_higher,state->m_tilemap_bitmapflags_higher,cliprect,tran);// tran = 1; + supernova_draw_b(screen.machine(), state->m_tilemap_bitmap_lower, state->m_tilemap_bitmapflags_lower, cliprect,tran);// tran = 1; + supernova_draw_a(screen.machine(), state->m_tilemap_bitmap_higher,state->m_tilemap_bitmapflags_higher,cliprect,tran);// tran = 1; { int x,y; @@ -486,7 +486,7 @@ SCREEN_UPDATE(skns) UINT32* dst; UINT16 pri, pri2, pri3; UINT16 bgpri; - const pen_t *clut = &screen->machine().pens[0]; + const pen_t *clut = &screen.machine().pens[0]; // int drawpri; @@ -631,7 +631,7 @@ SCREEN_UPDATE(skns) bitmap_fill(state->m_sprite_bitmap, cliprect, 0x0000); if (state->m_alt_enable_sprites) - state->m_spritegen->skns_draw_sprites(screen->machine(), state->m_sprite_bitmap, cliprect, screen->machine().generic.spriteram.u32, screen->machine().generic.spriteram_size, screen->machine().region("gfx1")->base(), screen->machine().region ("gfx1")->bytes(), state->m_spc_regs ); + state->m_spritegen->skns_draw_sprites(screen.machine(), state->m_sprite_bitmap, cliprect, screen.machine().generic.spriteram.u32, screen.machine().generic.spriteram_size, screen.machine().region("gfx1")->base(), screen.machine().region ("gfx1")->bytes(), state->m_spc_regs ); return 0; diff --git a/src/mame/video/suprridr.c b/src/mame/video/suprridr.c index 338851ec8d2..7239cdfbb9d 100644 --- a/src/mame/video/suprridr.c +++ b/src/mame/video/suprridr.c @@ -168,11 +168,11 @@ WRITE8_HANDLER( suprridr_fgram_w ) SCREEN_UPDATE( suprridr ) { - suprridr_state *state = screen->machine().driver_data(); + suprridr_state *state = screen.machine().driver_data(); UINT8 *spriteram = state->m_spriteram; rectangle subclip; int i; - const rectangle &visarea = screen->visible_area(); + const rectangle &visarea = screen.visible_area(); /* render left 4 columns with no scroll */ subclip = visarea;; @@ -216,7 +216,7 @@ SCREEN_UPDATE( suprridr ) fy = !fy; y = 240 - y; } - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[2], code, color, fx, fy, x, y, 0); + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[2], code, color, fx, fy, x, y, 0); } return 0; } diff --git a/src/mame/video/suprslam.c b/src/mame/video/suprslam.c index 2c012880dc7..ff937b9ddbd 100644 --- a/src/mame/video/suprslam.c +++ b/src/mame/video/suprslam.c @@ -154,16 +154,16 @@ VIDEO_START( suprslam ) SCREEN_UPDATE( suprslam ) { - suprslam_state *state = screen->machine().driver_data(); + suprslam_state *state = screen.machine().driver_data(); tilemap_set_scrollx( state->m_screen_tilemap,0, state->m_screen_vregs[0x04/2] ); - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); k053936_zoom_draw(state->m_k053936, bitmap, cliprect, state->m_bg_tilemap, 0, 0, 1); if(!(state->m_spr_ctrl[0] & 8)) - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_screen_tilemap, 0, 0); if(state->m_spr_ctrl[0] & 8) - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/surpratk.c b/src/mame/video/surpratk.c index 2175bd198f8..c4f76ed67ef 100644 --- a/src/mame/video/surpratk.c +++ b/src/mame/video/surpratk.c @@ -48,7 +48,7 @@ void surpratk_sprite_callback( running_machine &machine, int *code, int *color, SCREEN_UPDATE( surpratk ) { - surpratk_state *state = screen->machine().driver_data(); + surpratk_state *state = screen.machine().driver_data(); int layer[3], bg_colorbase; bg_colorbase = k053251_get_palette_index(state->m_k053251, K053251_CI0); @@ -68,7 +68,7 @@ SCREEN_UPDATE( surpratk ) konami_sortlayers3(layer, state->m_layerpri); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 16 * bg_colorbase); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[0], 0, 1); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[1], 0, 2); diff --git a/src/mame/video/system1.c b/src/mame/video/system1.c index 03e289a2eef..e7ed9e7b86b 100644 --- a/src/mame/video/system1.c +++ b/src/mame/video/system1.c @@ -499,15 +499,15 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta * *************************************/ -static void video_update_common(device_t *screen, bitmap_t *bitmap, const rectangle *cliprect, bitmap_t *fgpixmap, bitmap_t **bgpixmaps, const int *bgrowscroll, int bgyscroll, int spritexoffs) +static void video_update_common(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, bitmap_t *fgpixmap, bitmap_t **bgpixmaps, const int *bgrowscroll, int bgyscroll, int spritexoffs) { - system1_state *state = screen->machine().driver_data(); - const UINT8 *lookup = screen->machine().region("proms")->base(); + system1_state *state = screen.machine().driver_data(); + const UINT8 *lookup = screen.machine().region("proms")->base(); int x, y; /* first clear the sprite bitmap and draw sprites within this area */ bitmap_fill(state->m_sprite_bitmap, cliprect, 0); - draw_sprites(screen->machine(), state->m_sprite_bitmap, cliprect, spritexoffs); + draw_sprites(screen.machine(), state->m_sprite_bitmap, cliprect, spritexoffs); /* iterate over rows */ for (y = cliprect->min_y; y <= cliprect->max_y; y++) @@ -569,7 +569,7 @@ static void video_update_common(device_t *screen, bitmap_t *bitmap, const rectan SCREEN_UPDATE( system1 ) { - system1_state *state = screen->machine().driver_data(); + system1_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; bitmap_t *bgpixmaps[4], *fgpixmap; int bgrowscroll[32]; @@ -587,7 +587,7 @@ SCREEN_UPDATE( system1 ) yscroll = videoram[0xfbd]; /* adjust for flipping */ - if (flip_screen_get(screen->machine())) + if (flip_screen_get(screen.machine())) { xscroll = 640 - (xscroll & 0x1ff); yscroll = 764 - (yscroll & 0x1ff); @@ -605,7 +605,7 @@ SCREEN_UPDATE( system1 ) SCREEN_UPDATE( system2 ) { - system1_state *state = screen->machine().driver_data(); + system1_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; bitmap_t *bgpixmaps[4], *fgpixmap; int rowscroll[32]; @@ -623,7 +623,7 @@ SCREEN_UPDATE( system2 ) fgpixmap = tilemap_get_pixmap(state->m_tilemap_page[0]); /* get scroll offsets */ - if (!flip_screen_get(screen->machine())) + if (!flip_screen_get(screen.machine())) { xscroll = ((videoram[0x7c0] | (videoram[0x7c1] << 8)) & 0x1ff) - 512 + 10; yscroll = videoram[0x7ba]; @@ -648,7 +648,7 @@ SCREEN_UPDATE( system2 ) SCREEN_UPDATE( system2_rowscroll ) { - system1_state *state = screen->machine().driver_data(); + system1_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; bitmap_t *bgpixmaps[4], *fgpixmap; int rowscroll[32]; @@ -666,7 +666,7 @@ SCREEN_UPDATE( system2_rowscroll ) fgpixmap = tilemap_get_pixmap(state->m_tilemap_page[0]); /* get scroll offsets */ - if (!flip_screen_get(screen->machine())) + if (!flip_screen_get(screen.machine())) { for (y = 0; y < 32; y++) rowscroll[y] = ((videoram[0x7c0 + y * 2] | (videoram[0x7c1 + y * 2] << 8)) & 0x1ff) - 512 + 10; diff --git a/src/mame/video/system16.c b/src/mame/video/system16.c index 3f77431ff0f..5cf7a406aef 100644 --- a/src/mame/video/system16.c +++ b/src/mame/video/system16.c @@ -631,7 +631,7 @@ VIDEO_START( s16a_bootleg_passsht ) // Passing Shot (2 player), Shinobi (Datsu), Wonderboy 3 SCREEN_UPDATE( s16a_bootleg ) { - segas1x_bootleg_state *state = screen->machine().driver_data(); + segas1x_bootleg_state *state = screen.machine().driver_data(); // passing shot int offset_txtx = 192; @@ -641,7 +641,7 @@ SCREEN_UPDATE( s16a_bootleg ) int offset_bg0x = 187; int offset_bg0y = 0; - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); // I can't bring myself to care about dirty tile marking on something which runs at a bazillion % speed anyway, clean code is better tilemap_mark_all_tiles_dirty(state->m_bg_tilemaps[0]); @@ -689,7 +689,7 @@ SCREEN_UPDATE( s16a_bootleg ) /* The Passing Shot 4 Player bootleg has weird scroll registers (different offsets, ^0x7 xor) */ SCREEN_UPDATE( s16a_bootleg_passht4b ) { - segas1x_bootleg_state *state = screen->machine().driver_data(); + segas1x_bootleg_state *state = screen.machine().driver_data(); // passing shot int offset_txtx = 192; @@ -699,7 +699,7 @@ SCREEN_UPDATE( s16a_bootleg_passht4b ) int offset_bg0x = 5; int offset_bg0y = 32; - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); // I can't bring myself to care about dirty tile marking on something which runs at a bazillion % speed anyway, clean code is better tilemap_mark_all_tiles_dirty(state->m_bg_tilemaps[0]); @@ -732,7 +732,7 @@ SCREEN_UPDATE( s16a_bootleg_passht4b ) SCREEN_UPDATE( system16 ) { - segas1x_bootleg_state *state = screen->machine().driver_data(); + segas1x_bootleg_state *state = screen.machine().driver_data(); if (!state->m_refreshenable) { @@ -740,9 +740,9 @@ SCREEN_UPDATE( system16 ) return 0; } - update_page(screen->machine()); + update_page(screen.machine()); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_set_scrollx(state->m_background, 0, -320 - state->m_bg_scrollx); tilemap_set_scrolly(state->m_background, 0, -256 + state->m_bg_scrolly + state->m_back_yscroll); @@ -768,7 +768,7 @@ SCREEN_UPDATE( system16 ) tilemap_draw(bitmap, cliprect, state->m_text_layer, 0, 0xf); - //draw_sprites(screen->machine(), bitmap, cliprect,0); + //draw_sprites(screen.machine(), bitmap, cliprect,0); /* draw the sprites */ segaic16_sprites_draw(screen, bitmap, cliprect, 0); @@ -778,17 +778,17 @@ SCREEN_UPDATE( system16 ) SCREEN_UPDATE( system18old ) { - segas1x_bootleg_state *state = screen->machine().driver_data(); + segas1x_bootleg_state *state = screen.machine().driver_data(); if (!state->m_refreshenable) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } - update_page(screen->machine()); + update_page(screen.machine()); - bitmap_fill(screen->machine().priority_bitmap, NULL, 0); + bitmap_fill(screen.machine().priority_bitmap, NULL, 0); bitmap_fill(bitmap,cliprect,0); diff --git a/src/mame/video/tagteam.c b/src/mame/video/tagteam.c index 2335eeb02ec..32878f73ee3 100644 --- a/src/mame/video/tagteam.c +++ b/src/mame/video/tagteam.c @@ -194,8 +194,8 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( tagteam ) { - tagteam_state *state = screen->machine().driver_data(); + tagteam_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/tail2nos.c b/src/mame/video/tail2nos.c index 5dd65952f79..f23eff68297 100644 --- a/src/mame/video/tail2nos.c +++ b/src/mame/video/tail2nos.c @@ -179,12 +179,12 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( tail2nos ) { - tail2nos_state *state = screen->machine().driver_data(); + tail2nos_state *state = screen.machine().driver_data(); if (state->m_video_enable) { k051316_zoom_draw(state->m_k051316, bitmap, cliprect, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); } else diff --git a/src/mame/video/taito_b.c b/src/mame/video/taito_b.c index fb96544bc9b..2da870e3ad7 100644 --- a/src/mame/video/taito_b.c +++ b/src/mame/video/taito_b.c @@ -377,7 +377,7 @@ g_profiler.stop(); SCREEN_UPDATE( taitob ) { - taitob_state *state = screen->machine().driver_data(); + taitob_state *state = screen.machine().driver_data(); UINT8 video_control = tc0180vcu_get_videoctrl(state->m_tc0180vcu, 0); if ((video_control & 0x20) == 0) @@ -389,7 +389,7 @@ SCREEN_UPDATE( taitob ) /* Draw playfields */ tc0180vcu_tilemap_draw(state->m_tc0180vcu, bitmap, cliprect, 0, 1); - draw_framebuffer(screen->machine(), bitmap, cliprect, 1); + draw_framebuffer(screen.machine(), bitmap, cliprect, 1); tc0180vcu_tilemap_draw(state->m_tc0180vcu, bitmap, cliprect, 1, 0); @@ -402,7 +402,7 @@ SCREEN_UPDATE( taitob ) copyscrollbitmap_trans(bitmap, state->m_pixel_bitmap, 1, &scrollx, 1, &scrolly, cliprect, state->m_b_fg_color_base * 16); } - draw_framebuffer(screen->machine(), bitmap, cliprect, 0); + draw_framebuffer(screen.machine(), bitmap, cliprect, 0); tc0180vcu_tilemap_draw(state->m_tc0180vcu, bitmap, cliprect, 2, 0); @@ -413,8 +413,8 @@ SCREEN_UPDATE( taitob ) SCREEN_UPDATE( realpunc ) { - taitob_state *state = screen->machine().driver_data(); - const rgb_t *palette = palette_entry_list_adjusted(screen->machine().palette); + taitob_state *state = screen.machine().driver_data(); + const rgb_t *palette = palette_entry_list_adjusted(screen.machine().palette); UINT8 video_control = tc0180vcu_get_videoctrl(state->m_tc0180vcu, 0); int x, y; @@ -428,12 +428,12 @@ SCREEN_UPDATE( realpunc ) /* Draw the palettized playfields to an indexed bitmap */ tc0180vcu_tilemap_draw(state->m_tc0180vcu, state->m_realpunc_bitmap, cliprect, 0, 1); - draw_framebuffer(screen->machine(), state->m_realpunc_bitmap, cliprect, 1); + draw_framebuffer(screen.machine(), state->m_realpunc_bitmap, cliprect, 1); tc0180vcu_tilemap_draw(state->m_tc0180vcu, state->m_realpunc_bitmap, cliprect, 1, 0); if (state->m_realpunc_video_ctrl & 0x0001) - draw_framebuffer(screen->machine(), state->m_realpunc_bitmap, cliprect, 0); + draw_framebuffer(screen.machine(), state->m_realpunc_bitmap, cliprect, 0); /* Copy the intermediate bitmap to the output bitmap, applying the palette */ for (y = 0; y <= cliprect->max_y; y++) @@ -443,7 +443,7 @@ SCREEN_UPDATE( realpunc ) /* Draw the 15bpp raw CRTC frame buffer directly to the output bitmap */ if (state->m_realpunc_video_ctrl & 0x0002) { - device_t *hd63484 = screen->machine().device("hd63484"); + device_t *hd63484 = screen.machine().device("hd63484"); int base = (hd63484_regs_r(hd63484, 0xcc/2, 0xffff) << 16) + hd63484_regs_r(hd63484, 0xce/2, 0xffff); int stride = hd63484_regs_r(hd63484, 0xca/2, 0xffff); @@ -484,7 +484,7 @@ SCREEN_UPDATE( realpunc ) bitmap_fill(state->m_realpunc_bitmap, cliprect, 0); if (!(state->m_realpunc_video_ctrl & 0x0001)) - draw_framebuffer(screen->machine(), state->m_realpunc_bitmap, cliprect, 0); + draw_framebuffer(screen.machine(), state->m_realpunc_bitmap, cliprect, 0); tc0180vcu_tilemap_draw(state->m_tc0180vcu, state->m_realpunc_bitmap, cliprect, 2, 0); @@ -505,12 +505,12 @@ SCREEN_UPDATE( realpunc ) SCREEN_EOF( taitob ) { - taitob_state *state = machine.driver_data(); + taitob_state *state = screen.machine().driver_data(); UINT8 video_control = tc0180vcu_get_videoctrl(state->m_tc0180vcu, 0); UINT8 framebuffer_page = tc0180vcu_get_fb_page(state->m_tc0180vcu, 0); if (~video_control & 0x01) - bitmap_fill(state->m_framebuffer[framebuffer_page], &machine.primary_screen->visible_area(), 0); + bitmap_fill(state->m_framebuffer[framebuffer_page], &screen.machine().primary_screen->visible_area(), 0); if (~video_control & 0x80) { @@ -518,5 +518,5 @@ SCREEN_EOF( taitob ) tc0180vcu_set_fb_page(state->m_tc0180vcu, 0, framebuffer_page); } - draw_sprites(machine, state->m_framebuffer[framebuffer_page], &machine.primary_screen->visible_area()); + draw_sprites(screen.machine(), state->m_framebuffer[framebuffer_page], &screen.machine().primary_screen->visible_area()); } diff --git a/src/mame/video/taito_f2.c b/src/mame/video/taito_f2.c index 648dc34cc4d..9628521699e 100644 --- a/src/mame/video/taito_f2.c +++ b/src/mame/video/taito_f2.c @@ -896,20 +896,20 @@ static void taitof2_update_sprites_active_area( running_machine &machine ) SCREEN_EOF( taitof2_no_buffer ) { - taitof2_state *state = machine.driver_data(); + taitof2_state *state = screen.machine().driver_data(); - taitof2_update_sprites_active_area(machine); + taitof2_update_sprites_active_area(screen.machine()); state->m_prepare_sprites = 1; } SCREEN_EOF( taitof2_full_buffer_delayed ) { - taitof2_state *state = machine.driver_data(); + taitof2_state *state = screen.machine().driver_data(); UINT16 *spriteram = state->m_spriteram; int i; - taitof2_update_sprites_active_area(machine); + taitof2_update_sprites_active_area(screen.machine()); state->m_prepare_sprites = 0; memcpy(state->m_spriteram_buffered, state->m_spriteram_delayed, state->m_spriteram_size); @@ -920,11 +920,11 @@ SCREEN_EOF( taitof2_full_buffer_delayed ) SCREEN_EOF( taitof2_partial_buffer_delayed ) { - taitof2_state *state = machine.driver_data(); + taitof2_state *state = screen.machine().driver_data(); UINT16 *spriteram = state->m_spriteram; int i; - taitof2_update_sprites_active_area(machine); + taitof2_update_sprites_active_area(screen.machine()); state->m_prepare_sprites = 0; memcpy(state->m_spriteram_buffered, state->m_spriteram_delayed, state->m_spriteram_size); @@ -935,11 +935,11 @@ SCREEN_EOF( taitof2_partial_buffer_delayed ) SCREEN_EOF( taitof2_partial_buffer_delayed_thundfox ) { - taitof2_state *state = machine.driver_data(); + taitof2_state *state = screen.machine().driver_data(); UINT16 *spriteram = state->m_spriteram; int i; - taitof2_update_sprites_active_area(machine); + taitof2_update_sprites_active_area(screen.machine()); state->m_prepare_sprites = 0; memcpy(state->m_spriteram_buffered, state->m_spriteram_delayed, state->m_spriteram_size); @@ -957,11 +957,11 @@ SCREEN_EOF( taitof2_partial_buffer_delayed_qzchikyu ) /* spriteram[2] and [3] are 1 frame behind... probably thundfox_eof_callback would work fine */ - taitof2_state *state = machine.driver_data(); + taitof2_state *state = screen.machine().driver_data(); UINT16 *spriteram = state->m_spriteram; int i; - taitof2_update_sprites_active_area(machine); + taitof2_update_sprites_active_area(screen.machine()); state->m_prepare_sprites = 0; memcpy(state->m_spriteram_buffered, state->m_spriteram_delayed, state->m_spriteram_size); @@ -981,28 +981,28 @@ SCREEN_EOF( taitof2_partial_buffer_delayed_qzchikyu ) /* SSI */ SCREEN_UPDATE( taitof2_ssi ) { - taitof2_handle_sprite_buffering(screen->machine()); + taitof2_handle_sprite_buffering(screen.machine()); /* SSI only uses sprites, the tilemap registers are not even initialized. (they are in Majestic 12, but the tilemaps are not used anyway) */ - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); - draw_sprites(screen->machine(), bitmap, cliprect, NULL, 0); + draw_sprites(screen.machine(), bitmap, cliprect, NULL, 0); return 0; } SCREEN_UPDATE( taitof2_yesnoj ) { - taitof2_state *state = screen->machine().driver_data(); + taitof2_state *state = screen.machine().driver_data(); - taitof2_handle_sprite_buffering(screen->machine()); + taitof2_handle_sprite_buffering(screen.machine()); tc0100scn_tilemap_update(state->m_tc0100scn); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); /* wrong color? */ - draw_sprites(screen->machine(), bitmap, cliprect, NULL, 0); + draw_sprites(screen.machine(), bitmap, cliprect, NULL, 0); tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, tc0100scn_bottomlayer(state->m_tc0100scn), 0, 0); tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, tc0100scn_bottomlayer(state->m_tc0100scn) ^ 1, 0, 0); tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, 2, 0, 0); @@ -1012,17 +1012,17 @@ SCREEN_UPDATE( taitof2_yesnoj ) SCREEN_UPDATE( taitof2 ) { - taitof2_state *state = screen->machine().driver_data(); + taitof2_state *state = screen.machine().driver_data(); - taitof2_handle_sprite_buffering(screen->machine()); + taitof2_handle_sprite_buffering(screen.machine()); tc0100scn_tilemap_update(state->m_tc0100scn); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); /* wrong color? */ tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, tc0100scn_bottomlayer(state->m_tc0100scn), 0, 0); tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, tc0100scn_bottomlayer(state->m_tc0100scn) ^ 1, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, NULL, 0); + draw_sprites(screen.machine(), bitmap, cliprect, NULL, 0); tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, 2, 0, 0); return 0; } @@ -1030,10 +1030,10 @@ SCREEN_UPDATE( taitof2 ) SCREEN_UPDATE( taitof2_pri ) { - taitof2_state *state = screen->machine().driver_data(); + taitof2_state *state = screen.machine().driver_data(); int layer[3]; - taitof2_handle_sprite_buffering(screen->machine()); + taitof2_handle_sprite_buffering(screen.machine()); tc0100scn_tilemap_update(state->m_tc0100scn); @@ -1051,14 +1051,14 @@ SCREEN_UPDATE( taitof2_pri ) state->m_spriteblendmode = tc0360pri_r(state->m_tc0360pri, 0) & 0xc0; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); /* wrong color? */ tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], 0, 1); tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 2); tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[2], 0, 4); - draw_sprites(screen->machine(), bitmap, cliprect, NULL, 1); + draw_sprites(screen.machine(), bitmap, cliprect, NULL, 1); return 0; } @@ -1077,7 +1077,7 @@ static void draw_roz_layer( running_machine &machine, bitmap_t *bitmap, const re SCREEN_UPDATE( taitof2_pri_roz ) { - taitof2_state *state = screen->machine().driver_data(); + taitof2_state *state = screen.machine().driver_data(); int tilepri[3]; int rozpri; int layer[3]; @@ -1085,7 +1085,7 @@ SCREEN_UPDATE( taitof2_pri_roz ) int i,j; int roz_base_color = (tc0360pri_r(state->m_tc0360pri, 1) & 0x3f) << 2; - taitof2_handle_sprite_buffering(screen->machine()); + taitof2_handle_sprite_buffering(screen.machine()); if (state->m_tc0280grd != NULL) tc0280grd_tilemap_update(state->m_tc0280grd, roz_base_color); @@ -1113,7 +1113,7 @@ SCREEN_UPDATE( taitof2_pri_roz ) state->m_spriteblendmode = tc0360pri_r(state->m_tc0360pri, 0) & 0xc0; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); /* wrong color? */ drawn = 0; @@ -1121,7 +1121,7 @@ SCREEN_UPDATE( taitof2_pri_roz ) { if (rozpri == i) { - draw_roz_layer(screen->machine(), bitmap, cliprect, 1 << drawn); + draw_roz_layer(screen.machine(), bitmap, cliprect, 1 << drawn); state->m_tilepri[drawn] = i; drawn++; } @@ -1137,7 +1137,7 @@ SCREEN_UPDATE( taitof2_pri_roz ) } } - draw_sprites(screen->machine(), bitmap, cliprect, NULL, 1); + draw_sprites(screen.machine(), bitmap, cliprect, NULL, 1); return 0; } @@ -1146,13 +1146,13 @@ SCREEN_UPDATE( taitof2_pri_roz ) /* Thunderfox */ SCREEN_UPDATE( taitof2_thundfox ) { - taitof2_state *state = screen->machine().driver_data(); + taitof2_state *state = screen.machine().driver_data(); int tilepri[2][3]; int spritepri[4]; int layer[2][3]; int drawn[2]; - taitof2_handle_sprite_buffering(screen->machine()); + taitof2_handle_sprite_buffering(screen.machine()); tc0100scn_tilemap_update(state->m_tc0100scn_1); tc0100scn_tilemap_update(state->m_tc0100scn_2); @@ -1176,7 +1176,7 @@ SCREEN_UPDATE( taitof2_thundfox ) spritepri[2] = tc0360pri_r(state->m_tc0360pri, 7) & 0x0f; spritepri[3] = tc0360pri_r(state->m_tc0360pri, 7) >> 4; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); /* wrong color? */ /* @@ -1228,7 +1228,7 @@ SCREEN_UPDATE( taitof2_thundfox ) if (spritepri[i] < tilepri[1][1]) primasks[i] |= 0xff00; } - draw_sprites(screen->machine(), bitmap,cliprect,primasks,0); + draw_sprites(screen.machine(), bitmap,cliprect,primasks,0); } @@ -1283,11 +1283,11 @@ and it changes these (and the sprite pri settings) a lot. SCREEN_UPDATE( taitof2_metalb ) { - taitof2_state *state = screen->machine().driver_data(); + taitof2_state *state = screen.machine().driver_data(); UINT8 layer[5], invlayer[4]; UINT16 priority; - taitof2_handle_sprite_buffering(screen->machine()); + taitof2_handle_sprite_buffering(screen.machine()); tc0480scp_tilemap_update(state->m_tc0480scp); @@ -1317,7 +1317,7 @@ SCREEN_UPDATE( taitof2_metalb ) state->m_spriteblendmode = tc0360pri_r(state->m_tc0360pri, 0) & 0xc0; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); tc0480scp_tilemap_draw(state->m_tc0480scp, bitmap, cliprect, layer[0], 0 ,1); @@ -1326,7 +1326,7 @@ SCREEN_UPDATE( taitof2_metalb ) tc0480scp_tilemap_draw(state->m_tc0480scp, bitmap, cliprect, layer[3], 0, 8); tc0480scp_tilemap_draw(state->m_tc0480scp, bitmap, cliprect, layer[4], 0, 16); - draw_sprites(screen->machine(), bitmap, cliprect, NULL, 1); + draw_sprites(screen.machine(), bitmap, cliprect, NULL, 1); return 0; } @@ -1334,13 +1334,13 @@ SCREEN_UPDATE( taitof2_metalb ) /* Deadconx, Footchmp */ SCREEN_UPDATE( taitof2_deadconx ) { - taitof2_state *state = screen->machine().driver_data(); + taitof2_state *state = screen.machine().driver_data(); UINT8 layer[5]; UINT8 tilepri[5]; UINT8 spritepri[4]; UINT16 priority; - taitof2_handle_sprite_buffering(screen->machine()); + taitof2_handle_sprite_buffering(screen.machine()); tc0480scp_tilemap_update(state->m_tc0480scp); @@ -1365,7 +1365,7 @@ SCREEN_UPDATE( taitof2_deadconx ) spritepri[2] = tc0360pri_r(state->m_tc0360pri, 7) & 0x0f; spritepri[3] = tc0360pri_r(state->m_tc0360pri, 7) >> 4; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); tc0480scp_tilemap_draw(state->m_tc0480scp, bitmap, cliprect, layer[0], 0 ,1); @@ -1385,7 +1385,7 @@ SCREEN_UPDATE( taitof2_deadconx ) if (spritepri[i] < tilepri[(layer[3])]) primasks[i] |= 0xff00; } - draw_sprites(screen->machine(), bitmap, cliprect, primasks, 0); + draw_sprites(screen.machine(), bitmap, cliprect, primasks, 0); } /* diff --git a/src/mame/video/taito_f3.c b/src/mame/video/taito_f3.c index 41933de845d..f78db7473d3 100644 --- a/src/mame/video/taito_f3.c +++ b/src/mame/video/taito_f3.c @@ -517,20 +517,20 @@ static TILE_GET_INFO( get_tile_info_pixel ) SCREEN_EOF( f3 ) { - taito_f3_state *state = machine.driver_data(); + taito_f3_state *state = screen.machine().driver_data(); if (state->m_sprite_lag==2) { - if (machine.video().skip_this_frame() == 0) + if (screen.machine().video().skip_this_frame() == 0) { - get_sprite_info(machine, state->m_spriteram16_buffered); + get_sprite_info(screen.machine(), state->m_spriteram16_buffered); } memcpy(state->m_spriteram16_buffered,state->m_spriteram,0x10000); } else if (state->m_sprite_lag==1) { - if (machine.video().skip_this_frame() == 0) + if (screen.machine().video().skip_this_frame() == 0) { - get_sprite_info(machine, state->m_spriteram); + get_sprite_info(screen.machine(), state->m_spriteram); } } } @@ -3208,11 +3208,11 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( f3 ) { - taito_f3_state *state = screen->machine().driver_data(); + taito_f3_state *state = screen.machine().driver_data(); UINT32 sy_fix[5],sx_fix[5]; state->m_f3_skip_this_frame=0; - tilemap_set_flip_all(screen->machine(),state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + tilemap_set_flip_all(screen.machine(),state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); /* Setup scroll */ sy_fix[0]=((state->m_f3_control_0[4]&0xffff)<< 9) + (1<<16); @@ -3249,25 +3249,25 @@ SCREEN_UPDATE( f3 ) /* sprites */ if (state->m_sprite_lag==0) - get_sprite_info(screen->machine(), state->m_spriteram); + get_sprite_info(screen.machine(), state->m_spriteram); /* Update sprite buffer */ - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); /* Parse sprite, alpha & clipping parts of lineram */ get_spritealphaclip_info(state); /* Parse playfield effects */ - get_line_ram_info(screen->machine(), state->m_pf1_tilemap,sx_fix[0],sy_fix[0],0,state->m_f3_pf_data_1); - get_line_ram_info(screen->machine(), state->m_pf2_tilemap,sx_fix[1],sy_fix[1],1,state->m_f3_pf_data_2); - get_line_ram_info(screen->machine(), state->m_pf3_tilemap,sx_fix[2],sy_fix[2],2,state->m_f3_pf_data_3); - get_line_ram_info(screen->machine(), state->m_pf4_tilemap,sx_fix[3],sy_fix[3],3,state->m_f3_pf_data_4); - get_vram_info(screen->machine(), state->m_vram_layer,state->m_pixel_layer,sx_fix[4],sy_fix[4]); + get_line_ram_info(screen.machine(), state->m_pf1_tilemap,sx_fix[0],sy_fix[0],0,state->m_f3_pf_data_1); + get_line_ram_info(screen.machine(), state->m_pf2_tilemap,sx_fix[1],sy_fix[1],1,state->m_f3_pf_data_2); + get_line_ram_info(screen.machine(), state->m_pf3_tilemap,sx_fix[2],sy_fix[2],2,state->m_f3_pf_data_3); + get_line_ram_info(screen.machine(), state->m_pf4_tilemap,sx_fix[3],sy_fix[3],3,state->m_f3_pf_data_4); + get_vram_info(screen.machine(), state->m_vram_layer,state->m_pixel_layer,sx_fix[4],sy_fix[4]); /* Draw final framebuffer */ - scanline_draw(screen->machine(), bitmap,cliprect); + scanline_draw(screen.machine(), bitmap,cliprect); if (VERBOSE) - print_debug_info(screen->machine(), bitmap); + print_debug_info(screen.machine(), bitmap); return 0; } diff --git a/src/mame/video/taito_h.c b/src/mame/video/taito_h.c index 4615f3de720..f5b6be98d9a 100644 --- a/src/mame/video/taito_h.c +++ b/src/mame/video/taito_h.c @@ -393,17 +393,17 @@ static void taitoh_log_vram(running_machine &machine) SCREEN_UPDATE( syvalion ) { - taitoh_state *state = screen->machine().driver_data(); + taitoh_state *state = screen.machine().driver_data(); tc0080vco_tilemap_update(state->m_tc0080vco); - taitoh_log_vram(screen->machine()); + taitoh_log_vram(screen.machine()); bitmap_fill(bitmap, cliprect, 0); tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 1, 0, 0); - syvalion_draw_sprites(screen->machine(), bitmap,cliprect); + syvalion_draw_sprites(screen.machine(), bitmap,cliprect); tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 2, 0, 0); return 0; @@ -412,28 +412,28 @@ SCREEN_UPDATE( syvalion ) SCREEN_UPDATE( recordbr ) { - taitoh_state *state = screen->machine().driver_data(); + taitoh_state *state = screen.machine().driver_data(); tc0080vco_tilemap_update(state->m_tc0080vco); - taitoh_log_vram(screen->machine()); + taitoh_log_vram(screen.machine()); bitmap_fill(bitmap, cliprect, 0); #ifdef MAME_DEBUG - if (!screen->machine().input().code_pressed(KEYCODE_A)) + if (!screen.machine().input().code_pressed(KEYCODE_A)) tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); - if (!screen->machine().input().code_pressed(KEYCODE_S)) - recordbr_draw_sprites(screen->machine(), bitmap, cliprect, 0); - if (!screen->machine().input().code_pressed(KEYCODE_D)) + if (!screen.machine().input().code_pressed(KEYCODE_S)) + recordbr_draw_sprites(screen.machine(), bitmap, cliprect, 0); + if (!screen.machine().input().code_pressed(KEYCODE_D)) tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 1, 0, 0); - if (!screen->machine().input().code_pressed(KEYCODE_F)) - recordbr_draw_sprites(screen->machine(), bitmap, cliprect, 1); + if (!screen.machine().input().code_pressed(KEYCODE_F)) + recordbr_draw_sprites(screen.machine(), bitmap, cliprect, 1); #else tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); - recordbr_draw_sprites(screen->machine(), bitmap, cliprect, 0); + recordbr_draw_sprites(screen.machine(), bitmap, cliprect, 0); tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 1, 0, 0); - recordbr_draw_sprites(screen->machine(), bitmap, cliprect, 1); + recordbr_draw_sprites(screen.machine(), bitmap, cliprect, 1); #endif tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 2, 0, 0); @@ -443,28 +443,28 @@ SCREEN_UPDATE( recordbr ) SCREEN_UPDATE( dleague ) { - taitoh_state *state = screen->machine().driver_data(); + taitoh_state *state = screen.machine().driver_data(); tc0080vco_tilemap_update(state->m_tc0080vco); - taitoh_log_vram(screen->machine()); + taitoh_log_vram(screen.machine()); bitmap_fill(bitmap, cliprect, 0); #ifdef MAME_DEBUG - if (!screen->machine().input().code_pressed(KEYCODE_A)) + if (!screen.machine().input().code_pressed(KEYCODE_A)) tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); - if (!screen->machine().input().code_pressed(KEYCODE_S)) - dleague_draw_sprites(screen->machine(), bitmap, cliprect, 0); - if (!screen->machine().input().code_pressed(KEYCODE_D)) + if (!screen.machine().input().code_pressed(KEYCODE_S)) + dleague_draw_sprites(screen.machine(), bitmap, cliprect, 0); + if (!screen.machine().input().code_pressed(KEYCODE_D)) tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 1, 0, 0); - if (!screen->machine().input().code_pressed(KEYCODE_F)) - dleague_draw_sprites(screen->machine(), bitmap, cliprect, 1); + if (!screen.machine().input().code_pressed(KEYCODE_F)) + dleague_draw_sprites(screen.machine(), bitmap, cliprect, 1); #else tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); - dleague_draw_sprites (screen->machine(), bitmap, cliprect, 0); + dleague_draw_sprites (screen.machine(), bitmap, cliprect, 0); tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 1, 0, 0); - dleague_draw_sprites (screen->machine(), bitmap, cliprect, 1); + dleague_draw_sprites (screen.machine(), bitmap, cliprect, 1); #endif tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 2, 0, 0); diff --git a/src/mame/video/taito_l.c b/src/mame/video/taito_l.c index d5d1c65074d..174aaf74d4c 100644 --- a/src/mame/video/taito_l.c +++ b/src/mame/video/taito_l.c @@ -286,7 +286,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( taitol ) { - taitol_state *state = screen->machine().driver_data(); + taitol_state *state = screen.machine().driver_data(); int dx, dy; dx = state->m_rambanks[0xb3f4] | (state->m_rambanks[0xb3f5] << 8); @@ -307,7 +307,7 @@ SCREEN_UPDATE( taitol ) if (state->m_cur_ctrl & 0x20) /* display enable */ { - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg19_tilemap, 0, 0); @@ -316,12 +316,12 @@ SCREEN_UPDATE( taitol ) else /* split priority */ tilemap_draw(bitmap, cliprect, state->m_bg18_tilemap,0,1); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_ch1a_tilemap, 0, 0); } else - bitmap_fill(bitmap, cliprect, screen->machine().pens[0]); + bitmap_fill(bitmap, cliprect, screen.machine().pens[0]); return 0; } @@ -329,7 +329,7 @@ SCREEN_UPDATE( taitol ) SCREEN_EOF( taitol ) { - taitol_state *state = machine.driver_data(); + taitol_state *state = screen.machine().driver_data(); UINT8 *spriteram = state->m_rambanks + 0xb000; memcpy(state->m_buff_spriteram, spriteram, TAITOL_SPRITERAM_SIZE); diff --git a/src/mame/video/taito_o.c b/src/mame/video/taito_o.c index 5b22d0f7329..7c251d38620 100644 --- a/src/mame/video/taito_o.c +++ b/src/mame/video/taito_o.c @@ -140,7 +140,7 @@ static void parentj_draw_sprites( running_machine &machine, bitmap_t *bitmap, co SCREEN_UPDATE( parentj ) { - taitoo_state *state = screen->machine().driver_data(); + taitoo_state *state = screen.machine().driver_data(); tc0080vco_tilemap_update(state->m_tc0080vco); @@ -148,8 +148,8 @@ SCREEN_UPDATE( parentj ) tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); - parentj_draw_sprites(screen->machine(), bitmap, cliprect, 0); - parentj_draw_sprites(screen->machine(), bitmap, cliprect, 1); + parentj_draw_sprites(screen.machine(), bitmap, cliprect, 0); + parentj_draw_sprites(screen.machine(), bitmap, cliprect, 1); tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 1, 0, 0); tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 2, 0, 0); diff --git a/src/mame/video/taito_z.c b/src/mame/video/taito_z.c index efdaa8f2053..81beecd79d1 100644 --- a/src/mame/video/taito_z.c +++ b/src/mame/video/taito_z.c @@ -844,7 +844,7 @@ WRITE16_HANDLER( contcirc_out_w ) SCREEN_UPDATE( contcirc ) { - taitoz_state *state = screen->machine().driver_data(); + taitoz_state *state = screen.machine().driver_data(); UINT8 layer[3]; tc0100scn_tilemap_update(state->m_tc0100scn); @@ -853,7 +853,7 @@ SCREEN_UPDATE( contcirc ) layer[1] = layer[0] ^ 1; layer[2] = 2; - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); bitmap_fill(bitmap, cliprect, 0); @@ -862,7 +862,7 @@ SCREEN_UPDATE( contcirc ) tc0150rod_draw(state->m_tc0150rod, bitmap, cliprect, -3, state->m_road_palbank << 6, 1, 0, 1, 2); // -6 tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[2], 0, 4); - contcirc_draw_sprites_16x8(screen->machine(), bitmap, cliprect, 5); // 7 + contcirc_draw_sprites_16x8(screen.machine(), bitmap, cliprect, 5); // 7 return 0; } @@ -871,7 +871,7 @@ SCREEN_UPDATE( contcirc ) SCREEN_UPDATE( chasehq ) { - taitoz_state *state = screen->machine().driver_data(); + taitoz_state *state = screen.machine().driver_data(); UINT8 layer[3]; tc0100scn_tilemap_update(state->m_tc0100scn); @@ -880,7 +880,7 @@ SCREEN_UPDATE( chasehq ) layer[1] = layer[0] ^ 1; layer[2] = 2; - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ bitmap_fill(bitmap, cliprect, 0); @@ -890,14 +890,14 @@ SCREEN_UPDATE( chasehq ) tc0150rod_draw(state->m_tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2); tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[2], 0, 4); - chasehq_draw_sprites_16x16(screen->machine(), bitmap, cliprect, 7); + chasehq_draw_sprites_16x16(screen.machine(), bitmap, cliprect, 7); return 0; } SCREEN_UPDATE( bshark ) { - taitoz_state *state = screen->machine().driver_data(); + taitoz_state *state = screen.machine().driver_data(); UINT8 layer[3]; tc0100scn_tilemap_update(state->m_tc0100scn); @@ -906,7 +906,7 @@ SCREEN_UPDATE( bshark ) layer[1] = layer[0] ^ 1; layer[2] = 2; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ bitmap_fill(bitmap, cliprect, 0); @@ -916,14 +916,14 @@ SCREEN_UPDATE( bshark ) tc0150rod_draw(state->m_tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 1, 1, 2); tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[2], 0, 4); - bshark_draw_sprites_16x8(screen->machine(), bitmap, cliprect, 8); + bshark_draw_sprites_16x8(screen.machine(), bitmap, cliprect, 8); return 0; } SCREEN_UPDATE( sci ) { - taitoz_state *state = screen->machine().driver_data(); + taitoz_state *state = screen.machine().driver_data(); UINT8 layer[3]; tc0100scn_tilemap_update(state->m_tc0100scn); @@ -932,7 +932,7 @@ SCREEN_UPDATE( sci ) layer[1] = layer[0] ^ 1; layer[2] = 2; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ bitmap_fill(bitmap, cliprect, 0); @@ -942,14 +942,14 @@ SCREEN_UPDATE( sci ) tc0150rod_draw(state->m_tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2); tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[2], 0, 4); - sci_draw_sprites_16x8(screen->machine(), bitmap, cliprect, 6); + sci_draw_sprites_16x8(screen.machine(), bitmap, cliprect, 6); return 0; } SCREEN_UPDATE( aquajack ) { - taitoz_state *state = screen->machine().driver_data(); + taitoz_state *state = screen.machine().driver_data(); UINT8 layer[3]; tc0100scn_tilemap_update(state->m_tc0100scn); @@ -958,7 +958,7 @@ SCREEN_UPDATE( aquajack ) layer[1] = layer[0] ^ 1; layer[2] = 2; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ bitmap_fill(bitmap, cliprect, 0); @@ -968,14 +968,14 @@ SCREEN_UPDATE( aquajack ) tc0150rod_draw(state->m_tc0150rod, bitmap, cliprect, -1, 0, 2, 1, 1, 2); tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[2], 0, 4); - aquajack_draw_sprites_16x8(screen->machine(), bitmap, cliprect, 3); + aquajack_draw_sprites_16x8(screen.machine(), bitmap, cliprect, 3); return 0; } SCREEN_UPDATE( spacegun ) { - taitoz_state *state = screen->machine().driver_data(); + taitoz_state *state = screen.machine().driver_data(); UINT8 layer[3]; tc0100scn_tilemap_update(state->m_tc0100scn); @@ -984,7 +984,7 @@ SCREEN_UPDATE( spacegun ) layer[1] = layer[0] ^ 1; layer[2] = 2; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ bitmap_fill(bitmap, cliprect, 0); @@ -993,7 +993,7 @@ SCREEN_UPDATE( spacegun ) tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 2); tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[2], 0, 4); - spacegun_draw_sprites_16x8(screen->machine(), bitmap, cliprect, 4); + spacegun_draw_sprites_16x8(screen.machine(), bitmap, cliprect, 4); return 0; } @@ -1001,7 +1001,7 @@ SCREEN_UPDATE( spacegun ) SCREEN_UPDATE( dblaxle ) { - taitoz_state *state = screen->machine().driver_data(); + taitoz_state *state = screen.machine().driver_data(); UINT8 layer[5]; UINT16 priority; @@ -1015,7 +1015,7 @@ SCREEN_UPDATE( dblaxle ) layer[3] = (priority & 0x000f) >> 0; /* tells us which is top */ layer[4] = 4; /* text layer always over bg layers */ - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); /* Ensure screen blanked - this shouldn't be necessary! */ bitmap_fill(bitmap, cliprect, 0); @@ -1025,7 +1025,7 @@ SCREEN_UPDATE( dblaxle ) tc0480scp_tilemap_draw(state->m_tc0480scp, bitmap, cliprect, layer[2], 0, 1); tc0150rod_draw(state->m_tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2); - bshark_draw_sprites_16x8(screen->machine(), bitmap, cliprect, 7); + bshark_draw_sprites_16x8(screen.machine(), bitmap, cliprect, 7); /* This layer used for the big numeric displays */ tc0480scp_tilemap_draw(state->m_tc0480scp, bitmap, cliprect, layer[3], 0, 4); diff --git a/src/mame/video/taitoair.c b/src/mame/video/taitoair.c index 6bd503dbfbb..ca90dc7e928 100644 --- a/src/mame/video/taitoair.c +++ b/src/mame/video/taitoair.c @@ -573,7 +573,7 @@ VIDEO_START( taitoair ) SCREEN_UPDATE( taitoair ) { - taitoair_state *state = screen->machine().driver_data(); + taitoair_state *state = screen.machine().driver_data(); tc0080vco_tilemap_update(state->m_tc0080vco); @@ -610,13 +610,13 @@ SCREEN_UPDATE( taitoair ) tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 0, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0); copybitmap_trans(bitmap, state->m_framebuffer[1], 0, 0, 0, 0, cliprect, 0); tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 1, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 2, 0, 0); diff --git a/src/mame/video/taitojc.c b/src/mame/video/taitojc.c index b63f4fbdefa..306d12d635d 100644 --- a/src/mame/video/taitojc.c +++ b/src/mame/video/taitojc.c @@ -321,17 +321,17 @@ static void draw_object_bank(running_machine &machine, bitmap_t *bitmap, const r //static int tick = 0; SCREEN_UPDATE( taitojc ) { - taitojc_state *state = screen->machine().driver_data(); + taitojc_state *state = screen.machine().driver_data(); #if 0 tick++; if( tick >= 5 ) { tick = 0; - if( screen->machine().input().code_pressed(KEYCODE_O) ) + if( screen.machine().input().code_pressed(KEYCODE_O) ) debug_tex_pal++; - if( screen->machine().input().code_pressed(KEYCODE_I) ) + if( screen.machine().input().code_pressed(KEYCODE_I) ) debug_tex_pal--; debug_tex_pal &= 0x7f; @@ -346,15 +346,15 @@ SCREEN_UPDATE( taitojc ) //popmessage("%08x %08x %08x %08x",state->m_objlist[0xd20/4],state->m_objlist[0xd24/4],state->m_objlist[0xd28/4],state->m_objlist[0xd2c/4]); - draw_object_bank(screen->machine(), bitmap, cliprect, 0, 0); - draw_object_bank(screen->machine(), bitmap, cliprect, 1, 0); - draw_object_bank(screen->machine(), bitmap, cliprect, 2, 0); + draw_object_bank(screen.machine(), bitmap, cliprect, 0, 0); + draw_object_bank(screen.machine(), bitmap, cliprect, 1, 0); + draw_object_bank(screen.machine(), bitmap, cliprect, 2, 0); copybitmap_trans(bitmap, state->m_framebuffer, 0, 0, 0, 0, cliprect, 0); - draw_object_bank(screen->machine(), bitmap, cliprect, 0, 1); - draw_object_bank(screen->machine(), bitmap, cliprect, 1, 1); - draw_object_bank(screen->machine(), bitmap, cliprect, 2, 1); + draw_object_bank(screen.machine(), bitmap, cliprect, 0, 1); + draw_object_bank(screen.machine(), bitmap, cliprect, 1, 1); + draw_object_bank(screen.machine(), bitmap, cliprect, 2, 1); tilemap_draw(bitmap, cliprect, state->m_tilemap, 0,0); diff --git a/src/mame/video/taitosj.c b/src/mame/video/taitosj.c index 8fdf131db08..00b1da74e12 100644 --- a/src/mame/video/taitosj.c +++ b/src/mame/video/taitosj.c @@ -756,11 +756,11 @@ static int video_update_common(running_machine &machine, bitmap_t *bitmap, SCREEN_UPDATE( taitosj ) { - return video_update_common(screen->machine(), bitmap, cliprect, taitosj_copy_layer); + return video_update_common(screen.machine(), bitmap, cliprect, taitosj_copy_layer); } SCREEN_UPDATE( kikstart ) { - return video_update_common(screen->machine(), bitmap, cliprect, kikstart_copy_layer); + return video_update_common(screen.machine(), bitmap, cliprect, kikstart_copy_layer); } diff --git a/src/mame/video/tank8.c b/src/mame/video/tank8.c index 6343bcc6e33..ed7d253de42 100644 --- a/src/mame/video/tank8.c +++ b/src/mame/video/tank8.c @@ -192,30 +192,30 @@ static TIMER_CALLBACK( tank8_collision_callback ) SCREEN_UPDATE( tank8 ) { - tank8_state *state = screen->machine().driver_data(); - set_pens(state, screen->machine().colortable); + tank8_state *state = screen.machine().driver_data(); + set_pens(state, screen.machine().colortable); tilemap_draw(bitmap, cliprect, state->m_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); - draw_bullets(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); + draw_bullets(screen.machine(), bitmap, cliprect); return 0; } SCREEN_EOF( tank8 ) { - tank8_state *state = machine.driver_data(); + tank8_state *state = screen.machine().driver_data(); int x; int y; - const rectangle &visarea = machine.primary_screen->visible_area(); + const rectangle &visarea = screen.machine().primary_screen->visible_area(); tilemap_draw(state->m_helper1, &visarea, state->m_tilemap, 0, 0); bitmap_fill(state->m_helper2, &visarea, 8); bitmap_fill(state->m_helper3, &visarea, 8); - draw_sprites(machine, state->m_helper2, &visarea); - draw_bullets(machine, state->m_helper3, &visarea); + draw_sprites(screen.machine(), state->m_helper2, &visarea); + draw_bullets(screen.machine(), state->m_helper3, &visarea); for (y = visarea.min_y; y <= visarea.max_y; y++) { @@ -225,7 +225,7 @@ SCREEN_EOF( tank8 ) const UINT16* p2 = BITMAP_ADDR16(state->m_helper2, y, 0); const UINT16* p3 = BITMAP_ADDR16(state->m_helper3, y, 0); - if (y % 2 != machine.primary_screen->frame_number() % 2) + if (y % 2 != screen.machine().primary_screen->frame_number() % 2) continue; /* video display is interlaced */ for (x = visarea.min_x; x <= visarea.max_x; x++) @@ -284,7 +284,7 @@ SCREEN_EOF( tank8 ) index |= 0x80; /* collision on right side */ } - machine.scheduler().timer_set(machine.primary_screen->time_until_pos(y, x), FUNC(tank8_collision_callback), index); + screen.machine().scheduler().timer_set(screen.time_until_pos(y, x), FUNC(tank8_collision_callback), index); _state = 1; } diff --git a/src/mame/video/tankbatt.c b/src/mame/video/tankbatt.c index 337ae6b66d6..5899a5380dd 100644 --- a/src/mame/video/tankbatt.c +++ b/src/mame/video/tankbatt.c @@ -103,8 +103,8 @@ static void draw_bullets(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( tankbatt ) { - tankbatt_state *state = screen->machine().driver_data(); + tankbatt_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_bullets(screen->machine(), bitmap, cliprect); + draw_bullets(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/tankbust.c b/src/mame/video/tankbust.c index 306cdd02c4c..447e9664b7a 100644 --- a/src/mame/video/tankbust.c +++ b/src/mame/video/tankbust.c @@ -234,7 +234,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( tankbust ) { - tankbust_state *state = screen->machine().driver_data(); + tankbust_state *state = screen.machine().driver_data(); #if 0 int i; @@ -250,7 +250,7 @@ SCREEN_UPDATE( tankbust ) #endif tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 1, 0); tilemap_draw(bitmap, cliprect, state->m_txt_tilemap, 0,0); diff --git a/src/mame/video/taotaido.c b/src/mame/video/taotaido.c index f072ed533b2..e71cc027e89 100644 --- a/src/mame/video/taotaido.c +++ b/src/mame/video/taotaido.c @@ -199,7 +199,7 @@ VIDEO_START(taotaido) SCREEN_UPDATE(taotaido) { - taotaido_state *state = screen->machine().driver_data(); + taotaido_state *state = screen.machine().driver_data(); // tilemap_set_scrollx(state->m_bg_tilemap,0,(state->m_scrollram[0x380/2]>>4)); // the values put here end up being wrong every other frame // tilemap_set_scrolly(state->m_bg_tilemap,0,(state->m_scrollram[0x382/2]>>4)); // the values put here end up being wrong every other frame @@ -207,7 +207,7 @@ SCREEN_UPDATE(taotaido) int line; rectangle clip; - const rectangle &visarea = screen->visible_area(); + const rectangle &visarea = screen.visible_area(); clip.min_x = visarea.min_x; clip.max_x = visarea.max_x; clip.min_y = visarea.min_y; @@ -223,13 +223,13 @@ SCREEN_UPDATE(taotaido) tilemap_draw(bitmap,&clip,state->m_bg_tilemap,0,0); } - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); return 0; } SCREEN_EOF( taotaido ) { - taotaido_state *state = machine.driver_data(); + taotaido_state *state = screen.machine().driver_data(); /* sprites need to be delayed by 2 frames? */ memcpy(state->m_spriteram2_older,state->m_spriteram2_old,0x10000); diff --git a/src/mame/video/targeth.c b/src/mame/video/targeth.c index 6edc40f68c4..0a14f62c05e 100644 --- a/src/mame/video/targeth.c +++ b/src/mame/video/targeth.c @@ -135,7 +135,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( targeth ) { - targeth_state *state = screen->machine().driver_data(); + targeth_state *state = screen.machine().driver_data(); /* set scroll registers */ tilemap_set_scrolly(state->m_pant[0], 0, state->m_vregs[0]); tilemap_set_scrollx(state->m_pant[0], 0, state->m_vregs[1] + 0x04); @@ -144,7 +144,7 @@ SCREEN_UPDATE( targeth ) tilemap_draw(bitmap,cliprect,state->m_pant[1],0,0); tilemap_draw(bitmap,cliprect,state->m_pant[0],0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); return 0; } diff --git a/src/mame/video/tatsumi.c b/src/mame/video/tatsumi.c index a727bd896af..6783b33d517 100644 --- a/src/mame/video/tatsumi.c +++ b/src/mame/video/tatsumi.c @@ -1092,43 +1092,43 @@ static void draw_ground(running_machine &machine, bitmap_t *dst, const rectangle SCREEN_UPDATE( apache3 ) { - tatsumi_state *state = screen->machine().driver_data(); - update_cluts(screen->machine(), 1024, 0, 2048); + tatsumi_state *state = screen.machine().driver_data(); + update_cluts(screen.machine(), 1024, 0, 2048); tilemap_set_scrollx(state->m_tx_layer,0,24); - bitmap_fill(bitmap,cliprect,screen->machine().pens[0]); - draw_sky(screen->machine(), bitmap, cliprect, 256, state->m_apache3_rotate_ctrl[1]); -// draw_ground(screen->machine(), bitmap, cliprect); - draw_sprites(screen->machine(), bitmap,cliprect,0, (state->m_sprite_control_ram[0x20]&0x1000) ? 0x1000 : 0); + bitmap_fill(bitmap,cliprect,screen.machine().pens[0]); + draw_sky(screen.machine(), bitmap, cliprect, 256, state->m_apache3_rotate_ctrl[1]); +// draw_ground(screen.machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap,cliprect,0, (state->m_sprite_control_ram[0x20]&0x1000) ? 0x1000 : 0); tilemap_draw(bitmap,cliprect,state->m_tx_layer,0,0); return 0; } SCREEN_UPDATE( roundup5 ) { - tatsumi_state *state = screen->machine().driver_data(); + tatsumi_state *state = screen.machine().driver_data(); // UINT16 bg_x_scroll=state->m_roundup5_unknown1[0]; // UINT16 bg_y_scroll=state->m_roundup5_unknown2[0]; - update_cluts(screen->machine(), 1024, 512, 4096); + update_cluts(screen.machine(), 1024, 512, 4096); tilemap_set_scrollx(state->m_tx_layer,0,24); tilemap_set_scrolly(state->m_tx_layer,0,0); //(((state->m_roundupt_crt_reg[0xe]<<8)|state->m_roundupt_crt_reg[0xf])>>5) + 96); - bitmap_fill(bitmap,cliprect,screen->machine().pens[384]); // todo - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(bitmap,cliprect,screen.machine().pens[384]); // todo + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); - draw_sprites(screen->machine(), screen->machine().priority_bitmap,cliprect,1,(state->m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Alpha pass only - draw_road(screen->machine(), bitmap,cliprect,screen->machine().priority_bitmap); - draw_sprites(screen->machine(), bitmap,cliprect,0,(state->m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Full pass + draw_sprites(screen.machine(), screen.machine().priority_bitmap,cliprect,1,(state->m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Alpha pass only + draw_road(screen.machine(), bitmap,cliprect,screen.machine().priority_bitmap); + draw_sprites(screen.machine(), bitmap,cliprect,0,(state->m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Full pass tilemap_draw(bitmap,cliprect,state->m_tx_layer,0,0); return 0; } SCREEN_UPDATE( cyclwarr ) { - tatsumi_state *state = screen->machine().driver_data(); + tatsumi_state *state = screen.machine().driver_data(); state->m_bigfight_bank=state->m_bigfight_a40000[0]; if (state->m_bigfight_bank!=state->m_bigfight_last_bank) { @@ -1139,21 +1139,21 @@ SCREEN_UPDATE( cyclwarr ) state->m_bigfight_last_bank=state->m_bigfight_bank; } - bitmap_fill(bitmap,cliprect,screen->machine().pens[0]); + bitmap_fill(bitmap,cliprect,screen.machine().pens[0]); - draw_bg(screen->machine(), bitmap, state->m_layer3, &state->m_cyclwarr_videoram1[0x000], &state->m_cyclwarr_videoram1[0x100], state->m_cyclwarr_videoram1, state->m_bigfight_a40000[0], 8, -0x80, 512, 4096); - draw_bg(screen->machine(), bitmap, state->m_layer2, &state->m_cyclwarr_videoram1[0x200], &state->m_cyclwarr_videoram1[0x300], state->m_cyclwarr_videoram1, state->m_bigfight_a40000[0], 8, -0x80, 512, 4096); - draw_bg(screen->machine(), bitmap, state->m_layer1, &state->m_cyclwarr_videoram0[0x000], &state->m_cyclwarr_videoram0[0x100], state->m_cyclwarr_videoram0, state->m_bigfight_a40000[0], 8, -0x40, 1024, 2048); - update_cluts(screen->machine(), 8192, 4096, 8192); - draw_sprites(screen->machine(), bitmap,cliprect,0,(state->m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); - draw_bg(screen->machine(), bitmap, state->m_layer0, &state->m_cyclwarr_videoram0[0x200], &state->m_cyclwarr_videoram0[0x300], state->m_cyclwarr_videoram0, state->m_bigfight_a40000[0], 0x10, -0x80, 512, 4096); + draw_bg(screen.machine(), bitmap, state->m_layer3, &state->m_cyclwarr_videoram1[0x000], &state->m_cyclwarr_videoram1[0x100], state->m_cyclwarr_videoram1, state->m_bigfight_a40000[0], 8, -0x80, 512, 4096); + draw_bg(screen.machine(), bitmap, state->m_layer2, &state->m_cyclwarr_videoram1[0x200], &state->m_cyclwarr_videoram1[0x300], state->m_cyclwarr_videoram1, state->m_bigfight_a40000[0], 8, -0x80, 512, 4096); + draw_bg(screen.machine(), bitmap, state->m_layer1, &state->m_cyclwarr_videoram0[0x000], &state->m_cyclwarr_videoram0[0x100], state->m_cyclwarr_videoram0, state->m_bigfight_a40000[0], 8, -0x40, 1024, 2048); + update_cluts(screen.machine(), 8192, 4096, 8192); + draw_sprites(screen.machine(), bitmap,cliprect,0,(state->m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); + draw_bg(screen.machine(), bitmap, state->m_layer0, &state->m_cyclwarr_videoram0[0x200], &state->m_cyclwarr_videoram0[0x300], state->m_cyclwarr_videoram0, state->m_bigfight_a40000[0], 0x10, -0x80, 512, 4096); return 0; } SCREEN_UPDATE( bigfight ) { - tatsumi_state *state = screen->machine().driver_data(); + tatsumi_state *state = screen.machine().driver_data(); state->m_bigfight_bank=state->m_bigfight_a40000[0]; if (state->m_bigfight_bank!=state->m_bigfight_last_bank) { @@ -1164,13 +1164,13 @@ SCREEN_UPDATE( bigfight ) state->m_bigfight_last_bank=state->m_bigfight_bank; } - bitmap_fill(bitmap,cliprect,screen->machine().pens[0]); - draw_bg(screen->machine(), bitmap, state->m_layer3, &state->m_cyclwarr_videoram1[0x000], &state->m_cyclwarr_videoram1[0x100], state->m_cyclwarr_videoram1, state->m_bigfight_a40000[0], 8, -0x40, 1024, 2048); - draw_bg(screen->machine(), bitmap, state->m_layer2, &state->m_cyclwarr_videoram1[0x200], &state->m_cyclwarr_videoram1[0x300], state->m_cyclwarr_videoram1, state->m_bigfight_a40000[0], 8, -0x40, 1024, 2048); - draw_bg(screen->machine(), bitmap, state->m_layer1, &state->m_cyclwarr_videoram0[0x000], &state->m_cyclwarr_videoram0[0x100], state->m_cyclwarr_videoram0, state->m_bigfight_a40000[0], 8, -0x40, 1024, 2048); - update_cluts(screen->machine(), 8192, 4096, 8192); - draw_sprites(screen->machine(), bitmap,cliprect,0,(state->m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); - draw_bg(screen->machine(), bitmap, state->m_layer0, &state->m_cyclwarr_videoram0[0x200], &state->m_cyclwarr_videoram0[0x300], state->m_cyclwarr_videoram0, state->m_bigfight_a40000[0], 0x10, -0x40, 1024, 2048); + bitmap_fill(bitmap,cliprect,screen.machine().pens[0]); + draw_bg(screen.machine(), bitmap, state->m_layer3, &state->m_cyclwarr_videoram1[0x000], &state->m_cyclwarr_videoram1[0x100], state->m_cyclwarr_videoram1, state->m_bigfight_a40000[0], 8, -0x40, 1024, 2048); + draw_bg(screen.machine(), bitmap, state->m_layer2, &state->m_cyclwarr_videoram1[0x200], &state->m_cyclwarr_videoram1[0x300], state->m_cyclwarr_videoram1, state->m_bigfight_a40000[0], 8, -0x40, 1024, 2048); + draw_bg(screen.machine(), bitmap, state->m_layer1, &state->m_cyclwarr_videoram0[0x000], &state->m_cyclwarr_videoram0[0x100], state->m_cyclwarr_videoram0, state->m_bigfight_a40000[0], 8, -0x40, 1024, 2048); + update_cluts(screen.machine(), 8192, 4096, 8192); + draw_sprites(screen.machine(), bitmap,cliprect,0,(state->m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); + draw_bg(screen.machine(), bitmap, state->m_layer0, &state->m_cyclwarr_videoram0[0x200], &state->m_cyclwarr_videoram0[0x300], state->m_cyclwarr_videoram0, state->m_bigfight_a40000[0], 0x10, -0x40, 1024, 2048); return 0; } diff --git a/src/mame/video/taxidriv.c b/src/mame/video/taxidriv.c index e0af36cf813..65fe32179d2 100644 --- a/src/mame/video/taxidriv.c +++ b/src/mame/video/taxidriv.c @@ -12,7 +12,7 @@ WRITE8_DEVICE_HANDLER( taxidriv_spritectrl_w ) SCREEN_UPDATE( taxidriv ) { - taxidriv_state *state = screen->machine().driver_data(); + taxidriv_state *state = screen.machine().driver_data(); int offs; int sx,sy; @@ -33,7 +33,7 @@ SCREEN_UPDATE( taxidriv ) sx = offs % 32; sy = offs / 32; - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[3], + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[3], state->m_vram3[offs], 0, 0,0, @@ -45,7 +45,7 @@ SCREEN_UPDATE( taxidriv ) sx = offs % 32; sy = offs / 32; - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[2], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[2], state->m_vram2[offs]+256*state->m_vram2[offs+0x400], 0, 0,0, @@ -111,7 +111,7 @@ SCREEN_UPDATE( taxidriv ) sx = offs % 32; sy = offs / 32; - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1], state->m_vram1[offs], 0, 0,0, @@ -138,7 +138,7 @@ SCREEN_UPDATE( taxidriv ) sx = offs % 32; sy = offs / 32; - drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0], state->m_vram0[offs], 0, 0,0, diff --git a/src/mame/video/tbowl.c b/src/mame/video/tbowl.c index 1c3d135cab5..a11972c1547 100644 --- a/src/mame/video/tbowl.c +++ b/src/mame/video/tbowl.c @@ -214,41 +214,42 @@ VIDEO_START( tbowl ) } -SCREEN_UPDATE( tbowl ) +SCREEN_UPDATE( tbowl_left ) { - tbowl_state *state = screen->machine().driver_data(); - device_t *left_screen = screen->machine().device("lscreen"); - device_t *right_screen = screen->machine().device("rscreen"); + tbowl_state *state = screen.machine().driver_data(); - if (screen == left_screen) - { - tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_xscroll ); - tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_yscroll ); - tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2xscroll ); - tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2yscroll ); - tilemap_set_scrollx(state->m_tx_tilemap, 0, 0 ); - tilemap_set_scrolly(state->m_tx_tilemap, 0, 0 ); + tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_xscroll ); + tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_yscroll ); + tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2xscroll ); + tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2yscroll ); + tilemap_set_scrollx(state->m_tx_tilemap, 0, 0 ); + tilemap_set_scrolly(state->m_tx_tilemap, 0, 0 ); - bitmap_fill(bitmap,cliprect,0x100); /* is there a register controling the colour? looks odd when screen is blank */ - tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect, 0); - tilemap_draw(bitmap,cliprect,state->m_bg2_tilemap,0,0); - tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); - } - else if (screen == right_screen) - { - tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_xscroll+32*8 ); - tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_yscroll ); - tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2xscroll+32*8 ); - tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2yscroll ); - tilemap_set_scrollx(state->m_tx_tilemap, 0, 32*8 ); - tilemap_set_scrolly(state->m_tx_tilemap, 0, 0 ); + bitmap_fill(bitmap,cliprect,0x100); /* is there a register controling the colour? looks odd when screen is blank */ + tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); + draw_sprites(screen.machine(), bitmap,cliprect, 0); + tilemap_draw(bitmap,cliprect,state->m_bg2_tilemap,0,0); + tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); + + return 0; +} + +SCREEN_UPDATE( tbowl_right ) +{ + tbowl_state *state = screen.machine().driver_data(); + + tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_xscroll+32*8 ); + tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_yscroll ); + tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2xscroll+32*8 ); + tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2yscroll ); + tilemap_set_scrollx(state->m_tx_tilemap, 0, 32*8 ); + tilemap_set_scrolly(state->m_tx_tilemap, 0, 0 ); + + bitmap_fill(bitmap,cliprect,0x100); /* is there a register controling the colour? looks odd when screen is blank */ + tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); + draw_sprites(screen.machine(), bitmap,cliprect, 32*8); + tilemap_draw(bitmap,cliprect,state->m_bg2_tilemap,0,0); + tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); - bitmap_fill(bitmap,cliprect,0x100); /* is there a register controling the colour? looks odd when screen is blank */ - tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect, 32*8); - tilemap_draw(bitmap,cliprect,state->m_bg2_tilemap,0,0); - tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); - } return 0; } diff --git a/src/mame/video/tceptor.c b/src/mame/video/tceptor.c index ae8a2ef7f4f..a40b7de15bc 100644 --- a/src/mame/video/tceptor.c +++ b/src/mame/video/tceptor.c @@ -520,27 +520,13 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta } -SCREEN_UPDATE( tceptor ) +SCREEN_UPDATE( tceptor_2d ) { - tceptor_state *state = screen->machine().driver_data(); + tceptor_state *state = screen.machine().driver_data(); rectangle rect; int pri; int bg_center = 144 - ((((state->m_bg1_scroll_x + state->m_bg2_scroll_x ) & 0x1ff) - 288) / 2); - device_t *_2d_screen = screen->machine().device("2dscreen"); - device_t *_3d_left_screen = screen->machine().device("3dleft"); - device_t *_3d_right_screen = screen->machine().device("3dright"); - - if (screen != _2d_screen) - { - int frame = screen->frame_number(); - - if ((frame & 1) == 1 && screen == _3d_left_screen) - return UPDATE_HAS_NOT_CHANGED; - if ((frame & 1) == 0 && screen == _3d_right_screen) - return UPDATE_HAS_NOT_CHANGED; - } - // left background rect = *cliprect; rect.max_x = bg_center; @@ -557,18 +543,32 @@ SCREEN_UPDATE( tceptor ) for (pri = 0; pri < 8; pri++) { - namco_road_draw(screen->machine(), bitmap, cliprect, pri * 2); - namco_road_draw(screen->machine(), bitmap, cliprect, pri * 2 + 1); - draw_sprites(screen->machine(), bitmap, cliprect, pri); + namco_road_draw(screen.machine(), bitmap, cliprect, pri * 2); + namco_road_draw(screen.machine(), bitmap, cliprect, pri * 2 + 1); + draw_sprites(screen.machine(), bitmap, cliprect, pri); } tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); return 0; } +SCREEN_UPDATE( tceptor_3d_left ) +{ + if ((screen.frame_number() & 1) == 1) + return UPDATE_HAS_NOT_CHANGED; + return SCREEN_UPDATE_CALL( tceptor_2d ); +} + +SCREEN_UPDATE( tceptor_3d_right ) +{ + if ((screen.frame_number() & 1) == 0) + return UPDATE_HAS_NOT_CHANGED; + return SCREEN_UPDATE_CALL( tceptor_2d ); +} + SCREEN_EOF( tceptor ) { - tceptor_state *state = machine.driver_data(); + tceptor_state *state = screen.machine().driver_data(); memcpy(state->m_sprite_ram_buffered, state->m_sprite_ram, 0x200); } diff --git a/src/mame/video/tecmo.c b/src/mame/video/tecmo.c index 5729bc3ef2b..84abcb80e5d 100644 --- a/src/mame/video/tecmo.c +++ b/src/mame/video/tecmo.c @@ -250,13 +250,13 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( tecmo ) { - tecmo_state *state = screen->machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + tecmo_state *state = screen.machine().driver_data(); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); bitmap_fill(bitmap,cliprect,0x100); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,1); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,2); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,4); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); return 0; } diff --git a/src/mame/video/tecmo16.c b/src/mame/video/tecmo16.c index c31a2cc7830..202f3caeabd 100644 --- a/src/mame/video/tecmo16.c +++ b/src/mame/video/tecmo16.c @@ -492,8 +492,8 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap_bg, bitmap_t SCREEN_UPDATE( tecmo16 ) { - tecmo16_state *state = screen->machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + tecmo16_state *state = screen.machine().driver_data(); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); bitmap_fill(state->m_tile_bitmap_bg, cliprect, 0x300); bitmap_fill(state->m_tile_bitmap_fg, cliprect, 0); @@ -508,9 +508,9 @@ SCREEN_UPDATE( tecmo16 ) tilemap_draw(state->m_tile_bitmap_fg, cliprect,state->m_tx_tilemap, 0, 4); /* draw sprites into a 16-bit bitmap */ - draw_sprites(screen->machine(), state->m_tile_bitmap_bg, state->m_tile_bitmap_fg, state->m_sprite_bitmap, cliprect); + draw_sprites(screen.machine(), state->m_tile_bitmap_bg, state->m_tile_bitmap_fg, state->m_sprite_bitmap, cliprect); /* mix & blend the tilemaps and sprites into a 32-bit bitmap */ - blendbitmaps(screen->machine(), bitmap, state->m_tile_bitmap_bg, state->m_tile_bitmap_fg, state->m_sprite_bitmap, 0, 0, cliprect); + blendbitmaps(screen.machine(), bitmap, state->m_tile_bitmap_bg, state->m_tile_bitmap_fg, state->m_sprite_bitmap, 0, 0, cliprect); return 0; } diff --git a/src/mame/video/tecmosys.c b/src/mame/video/tecmosys.c index 92c0239e013..c0703144b39 100644 --- a/src/mame/video/tecmosys.c +++ b/src/mame/video/tecmosys.c @@ -299,9 +299,9 @@ static void tecmosys_do_final_mix(running_machine &machine, bitmap_t* bitmap) SCREEN_UPDATE(tecmosys) { - tecmosys_state *state = screen->machine().driver_data(); + tecmosys_state *state = screen.machine().driver_data(); - bitmap_fill(bitmap,cliprect,screen->machine().pens[0x4000]); + bitmap_fill(bitmap,cliprect,screen.machine().pens[0x4000]); tilemap_set_scrolly( state->m_bg0tilemap, 0, state->m_c80000regs[1]+16); @@ -332,10 +332,10 @@ SCREEN_UPDATE(tecmosys) tecmosys_tilemap_copy_to_compose(state, 0xc000); - tecmosys_do_final_mix(screen->machine(), bitmap); + tecmosys_do_final_mix(screen.machine(), bitmap); // prepare sprites for NEXT frame - causes 1 frame palette errors, but prevents sprite lag in tkdensho, which is correct? - tecmosys_render_sprites_to_bitmap(screen->machine(), bitmap, state->m_880000regs[0x0], state->m_880000regs[0x1]); + tecmosys_render_sprites_to_bitmap(screen.machine(), bitmap, state->m_880000regs[0x0], state->m_880000regs[0x1]); return 0; } diff --git a/src/mame/video/tehkanwc.c b/src/mame/video/tehkanwc.c index c254b38d70c..bc1464b24dd 100644 --- a/src/mame/video/tehkanwc.c +++ b/src/mame/video/tehkanwc.c @@ -166,13 +166,13 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( tehkanwc ) { - tehkanwc_state *state = screen->machine().driver_data(); + tehkanwc_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_scroll_x[0] + 256 * state->m_scroll_x[1]); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 1, 0); - gridiron_draw_led(screen->machine(), bitmap, cliprect, state->m_led0, 0); - gridiron_draw_led(screen->machine(), bitmap, cliprect, state->m_led1, 1); + gridiron_draw_led(screen.machine(), bitmap, cliprect, state->m_led0, 0); + gridiron_draw_led(screen.machine(), bitmap, cliprect, state->m_led1, 1); return 0; } diff --git a/src/mame/video/terracre.c b/src/mame/video/terracre.c index 36d1af1527c..2ec4a8a7475 100644 --- a/src/mame/video/terracre.c +++ b/src/mame/video/terracre.c @@ -204,13 +204,13 @@ VIDEO_START( amazon ) SCREEN_UPDATE( amazon ) { - terracre_state *state = screen->machine().driver_data(); + terracre_state *state = screen.machine().driver_data(); if( state->m_xscroll&0x2000 ) - bitmap_fill( bitmap,cliprect ,get_black_pen(screen->machine())); + bitmap_fill( bitmap,cliprect ,get_black_pen(screen.machine())); else tilemap_draw( bitmap,cliprect, state->m_background, 0, 0 ); - draw_sprites(screen->machine(), bitmap,cliprect ); + draw_sprites(screen.machine(), bitmap,cliprect ); tilemap_draw( bitmap,cliprect, state->m_foreground, 0, 0 ); return 0; } diff --git a/src/mame/video/tetrisp2.c b/src/mame/video/tetrisp2.c index a688bea8134..20a25db7f64 100644 --- a/src/mame/video/tetrisp2.c +++ b/src/mame/video/tetrisp2.c @@ -461,7 +461,7 @@ static void tetrisp2_draw_sprites(running_machine &machine, bitmap_t *bitmap, bi SCREEN_UPDATE( tetrisp2 ) { - tetrisp2_state *state = screen->machine().driver_data(); + tetrisp2_state *state = screen.machine().driver_data(); int flipscreen; int asc_pri; int scr_pri; @@ -472,13 +472,13 @@ SCREEN_UPDATE( tetrisp2 ) /* Black background color */ bitmap_fill(bitmap, cliprect, 0); - bitmap_fill(screen->machine().priority_bitmap, NULL, 0); + bitmap_fill(screen.machine().priority_bitmap, NULL, 0); /* Flip Screen */ if (flipscreen != state->m_flipscreen_old) { state->m_flipscreen_old = flipscreen; - tilemap_set_flip_all(screen->machine(), flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); + tilemap_set_flip_all(screen.machine(), flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); } /* Flip Screen */ @@ -540,13 +540,13 @@ SCREEN_UPDATE( tetrisp2 ) else if (asc_pri == 2) tilemap_draw(bitmap,cliprect, state->m_tilemap_fg, 0, 1 << 2); - tetrisp2_draw_sprites(screen->machine(), bitmap, screen->machine().priority_bitmap, cliprect, state->m_priority, screen->machine().generic.spriteram.u16, screen->machine().generic.spriteram_size, 0, (state->m_systemregs[0x00] & 0x02)); + tetrisp2_draw_sprites(screen.machine(), bitmap, screen.machine().priority_bitmap, cliprect, state->m_priority, screen.machine().generic.spriteram.u16, screen.machine().generic.spriteram_size, 0, (state->m_systemregs[0x00] & 0x02)); return 0; } SCREEN_UPDATE( rockntread ) { - tetrisp2_state *state = screen->machine().driver_data(); + tetrisp2_state *state = screen.machine().driver_data(); int flipscreen; int asc_pri; int scr_pri; @@ -557,13 +557,13 @@ SCREEN_UPDATE( rockntread ) /* Black background color */ bitmap_fill(bitmap, cliprect, 0); - bitmap_fill(screen->machine().priority_bitmap, NULL, 0); + bitmap_fill(screen.machine().priority_bitmap, NULL, 0); /* Flip Screen */ if (flipscreen != state->m_flipscreen_old) { state->m_flipscreen_old = flipscreen; - tilemap_set_flip_all(screen->machine(), flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); + tilemap_set_flip_all(screen.machine(), flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); } /* Flip Screen */ @@ -625,129 +625,130 @@ SCREEN_UPDATE( rockntread ) else if (asc_pri == 2) tilemap_draw(bitmap,cliprect, state->m_tilemap_fg, 0, 1 << 2); - tetrisp2_draw_sprites(screen->machine(), bitmap, screen->machine().priority_bitmap,cliprect, state->m_priority, screen->machine().generic.spriteram.u16, screen->machine().generic.spriteram_size, 0, (state->m_systemregs[0x00] & 0x02)); + tetrisp2_draw_sprites(screen.machine(), bitmap, screen.machine().priority_bitmap,cliprect, state->m_priority, screen.machine().generic.spriteram.u16, screen.machine().generic.spriteram_size, 0, (state->m_systemregs[0x00] & 0x02)); return 0; } -SCREEN_UPDATE( rocknms ) +SCREEN_UPDATE( rocknms_left ) { - tetrisp2_state *state = screen->machine().driver_data(); + tetrisp2_state *state = screen.machine().driver_data(); int asc_pri; int scr_pri; int rot_pri; - device_t *left_screen = screen->machine().device("lscreen"); - device_t *right_screen = screen->machine().device("rscreen"); + tilemap_set_scrollx(state->m_tilemap_sub_bg, 0, state->m_rocknms_sub_scroll_bg[ 2 ] + 0x000); + tilemap_set_scrolly(state->m_tilemap_sub_bg, 0, state->m_rocknms_sub_scroll_bg[ 5 ] + 0x000); + tilemap_set_scrollx(state->m_tilemap_sub_fg, 0, state->m_rocknms_sub_scroll_fg[ 2 ] + 0x000); + tilemap_set_scrolly(state->m_tilemap_sub_fg, 0, state->m_rocknms_sub_scroll_fg[ 5 ] + 0x000); + tilemap_set_scrollx(state->m_tilemap_sub_rot, 0, state->m_rocknms_sub_rotregs[ 0 ] + 0x400); + tilemap_set_scrolly(state->m_tilemap_sub_rot, 0, state->m_rocknms_sub_rotregs[ 2 ] + 0x400); - /* Black background color */ - if (screen == left_screen) - { - tilemap_set_scrollx(state->m_tilemap_sub_bg, 0, state->m_rocknms_sub_scroll_bg[ 2 ] + 0x000); - tilemap_set_scrolly(state->m_tilemap_sub_bg, 0, state->m_rocknms_sub_scroll_bg[ 5 ] + 0x000); - tilemap_set_scrollx(state->m_tilemap_sub_fg, 0, state->m_rocknms_sub_scroll_fg[ 2 ] + 0x000); - tilemap_set_scrolly(state->m_tilemap_sub_fg, 0, state->m_rocknms_sub_scroll_fg[ 5 ] + 0x000); - tilemap_set_scrollx(state->m_tilemap_sub_rot, 0, state->m_rocknms_sub_rotregs[ 0 ] + 0x400); - tilemap_set_scrolly(state->m_tilemap_sub_rot, 0, state->m_rocknms_sub_rotregs[ 2 ] + 0x400); + bitmap_fill(bitmap, cliprect, screen.machine().pens[0x0000]); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); - bitmap_fill(bitmap, cliprect, screen->machine().pens[0x0000]); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + asc_pri = scr_pri = rot_pri = 0; - asc_pri = scr_pri = rot_pri = 0; + if((state->m_rocknms_sub_priority[0x2b00 / 2] & 0x00ff) == 0x0034) + asc_pri++; + else + rot_pri++; - if((state->m_rocknms_sub_priority[0x2b00 / 2] & 0x00ff) == 0x0034) - asc_pri++; - else - rot_pri++; + if((state->m_rocknms_sub_priority[0x2e00 / 2] & 0x00ff) == 0x0034) + asc_pri++; + else + scr_pri++; - if((state->m_rocknms_sub_priority[0x2e00 / 2] & 0x00ff) == 0x0034) - asc_pri++; - else - scr_pri++; + if((state->m_rocknms_sub_priority[0x3a00 / 2] & 0x00ff) == 0x000c) + scr_pri++; + else + rot_pri++; - if((state->m_rocknms_sub_priority[0x3a00 / 2] & 0x00ff) == 0x000c) - scr_pri++; - else - rot_pri++; + if (rot_pri == 0) + tilemap_draw(bitmap,cliprect, state->m_tilemap_sub_rot, 0, 1 << 1); + else if (scr_pri == 0) + tilemap_draw(bitmap,cliprect, state->m_tilemap_sub_bg, 0, 1 << 0); + else if (asc_pri == 0) + tilemap_draw(bitmap,cliprect, state->m_tilemap_sub_fg, 0, 1 << 2); - if (rot_pri == 0) - tilemap_draw(bitmap,cliprect, state->m_tilemap_sub_rot, 0, 1 << 1); - else if (scr_pri == 0) - tilemap_draw(bitmap,cliprect, state->m_tilemap_sub_bg, 0, 1 << 0); - else if (asc_pri == 0) - tilemap_draw(bitmap,cliprect, state->m_tilemap_sub_fg, 0, 1 << 2); + if (rot_pri == 1) + tilemap_draw(bitmap,cliprect, state->m_tilemap_sub_rot, 0, 1 << 1); + else if (scr_pri == 1) + tilemap_draw(bitmap,cliprect, state->m_tilemap_sub_bg, 0, 1 << 0); + else if (asc_pri == 1) + tilemap_draw(bitmap,cliprect, state->m_tilemap_sub_fg, 0, 1 << 2); - if (rot_pri == 1) - tilemap_draw(bitmap,cliprect, state->m_tilemap_sub_rot, 0, 1 << 1); - else if (scr_pri == 1) - tilemap_draw(bitmap,cliprect, state->m_tilemap_sub_bg, 0, 1 << 0); - else if (asc_pri == 1) - tilemap_draw(bitmap,cliprect, state->m_tilemap_sub_fg, 0, 1 << 2); + if (rot_pri == 2) + tilemap_draw(bitmap,cliprect, state->m_tilemap_sub_rot, 0, 1 << 1); + else if (scr_pri == 2) + tilemap_draw(bitmap,cliprect, state->m_tilemap_sub_bg, 0, 1 << 0); + else if (asc_pri == 2) + tilemap_draw(bitmap,cliprect, state->m_tilemap_sub_fg, 0, 1 << 2); - if (rot_pri == 2) - tilemap_draw(bitmap,cliprect, state->m_tilemap_sub_rot, 0, 1 << 1); - else if (scr_pri == 2) - tilemap_draw(bitmap,cliprect, state->m_tilemap_sub_bg, 0, 1 << 0); - else if (asc_pri == 2) - tilemap_draw(bitmap,cliprect, state->m_tilemap_sub_fg, 0, 1 << 2); - - tetrisp2_draw_sprites(screen->machine(), bitmap, screen->machine().priority_bitmap,cliprect, state->m_priority, screen->machine().generic.spriteram2.u16, screen->machine().generic.spriteram2_size, 4, (state->m_systemregs[0x00] & 0x02)); - } - else if (screen == right_screen) /* game screen */ - { - tilemap_set_scrollx(state->m_tilemap_bg, 0, state->m_scroll_bg[ 2 ] + 0x000); - tilemap_set_scrolly(state->m_tilemap_bg, 0, state->m_scroll_bg[ 5 ] + 0x000); - tilemap_set_scrollx(state->m_tilemap_fg, 0, state->m_scroll_fg[ 2 ] + 0x000); - tilemap_set_scrolly(state->m_tilemap_fg, 0, state->m_scroll_fg[ 5 ] + 0x000); - tilemap_set_scrollx(state->m_tilemap_rot, 0, state->m_rotregs[ 0 ] + 0x400); - tilemap_set_scrolly(state->m_tilemap_rot, 0, state->m_rotregs[ 2 ] + 0x400); - - /* Black background color */ - bitmap_fill(bitmap, cliprect, screen->machine().pens[0x0000]); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); - - asc_pri = scr_pri = rot_pri = 0; - - if((state->m_priority[0x2b00 / 2] & 0x00ff) == 0x0034) - asc_pri++; - else - rot_pri++; - - if((state->m_priority[0x2e00 / 2] & 0x00ff) == 0x0034) - asc_pri++; - else - scr_pri++; - - if((state->m_priority[0x3a00 / 2] & 0x00ff) == 0x000c) - scr_pri++; - else - rot_pri++; - - if (rot_pri == 0) - tilemap_draw(bitmap,cliprect, state->m_tilemap_rot, 0, 1 << 1); - else if (scr_pri == 0) - tilemap_draw(bitmap,cliprect, state->m_tilemap_bg, 0, 1 << 0); - else if (asc_pri == 0) - tilemap_draw(bitmap,cliprect, state->m_tilemap_fg, 0, 1 << 2); - - if (rot_pri == 1) - tilemap_draw(bitmap,cliprect, state->m_tilemap_rot, 0, 1 << 1); - else if (scr_pri == 1) - tilemap_draw(bitmap,cliprect, state->m_tilemap_bg, 0, 1 << 0); - else if (asc_pri == 1) - tilemap_draw(bitmap,cliprect, state->m_tilemap_fg, 0, 1 << 2); - - if (rot_pri == 2) - tilemap_draw(bitmap,cliprect, state->m_tilemap_rot, 0, 1 << 1); - else if (scr_pri == 2) - tilemap_draw(bitmap,cliprect, state->m_tilemap_bg, 0, 1 << 0); - else if (asc_pri == 2) - tilemap_draw(bitmap,cliprect, state->m_tilemap_fg, 0, 1 << 2); - - tetrisp2_draw_sprites(screen->machine(), bitmap, screen->machine().priority_bitmap,cliprect, state->m_priority, screen->machine().generic.spriteram.u16, screen->machine().generic.spriteram_size, 0, (state->m_systemregs[0x00] & 0x02)); - } + tetrisp2_draw_sprites(screen.machine(), bitmap, screen.machine().priority_bitmap,cliprect, state->m_priority, screen.machine().generic.spriteram2.u16, screen.machine().generic.spriteram2_size, 4, (state->m_systemregs[0x00] & 0x02)); + + return 0; +} + +SCREEN_UPDATE( rocknms_right ) +{ + tetrisp2_state *state = screen.machine().driver_data(); + int asc_pri; + int scr_pri; + int rot_pri; + + tilemap_set_scrollx(state->m_tilemap_bg, 0, state->m_scroll_bg[ 2 ] + 0x000); + tilemap_set_scrolly(state->m_tilemap_bg, 0, state->m_scroll_bg[ 5 ] + 0x000); + tilemap_set_scrollx(state->m_tilemap_fg, 0, state->m_scroll_fg[ 2 ] + 0x000); + tilemap_set_scrolly(state->m_tilemap_fg, 0, state->m_scroll_fg[ 5 ] + 0x000); + tilemap_set_scrollx(state->m_tilemap_rot, 0, state->m_rotregs[ 0 ] + 0x400); + tilemap_set_scrolly(state->m_tilemap_rot, 0, state->m_rotregs[ 2 ] + 0x400); + + /* Black background color */ + bitmap_fill(bitmap, cliprect, screen.machine().pens[0x0000]); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); + + asc_pri = scr_pri = rot_pri = 0; + + if((state->m_priority[0x2b00 / 2] & 0x00ff) == 0x0034) + asc_pri++; + else + rot_pri++; + + if((state->m_priority[0x2e00 / 2] & 0x00ff) == 0x0034) + asc_pri++; + else + scr_pri++; + + if((state->m_priority[0x3a00 / 2] & 0x00ff) == 0x000c) + scr_pri++; + else + rot_pri++; + + if (rot_pri == 0) + tilemap_draw(bitmap,cliprect, state->m_tilemap_rot, 0, 1 << 1); + else if (scr_pri == 0) + tilemap_draw(bitmap,cliprect, state->m_tilemap_bg, 0, 1 << 0); + else if (asc_pri == 0) + tilemap_draw(bitmap,cliprect, state->m_tilemap_fg, 0, 1 << 2); + + if (rot_pri == 1) + tilemap_draw(bitmap,cliprect, state->m_tilemap_rot, 0, 1 << 1); + else if (scr_pri == 1) + tilemap_draw(bitmap,cliprect, state->m_tilemap_bg, 0, 1 << 0); + else if (asc_pri == 1) + tilemap_draw(bitmap,cliprect, state->m_tilemap_fg, 0, 1 << 2); + + if (rot_pri == 2) + tilemap_draw(bitmap,cliprect, state->m_tilemap_rot, 0, 1 << 1); + else if (scr_pri == 2) + tilemap_draw(bitmap,cliprect, state->m_tilemap_bg, 0, 1 << 0); + else if (asc_pri == 2) + tilemap_draw(bitmap,cliprect, state->m_tilemap_fg, 0, 1 << 2); + + tetrisp2_draw_sprites(screen.machine(), bitmap, screen.machine().priority_bitmap,cliprect, state->m_priority, screen.machine().generic.spriteram.u16, screen.machine().generic.spriteram_size, 0, (state->m_systemregs[0x00] & 0x02)); return 0; } diff --git a/src/mame/video/thedeep.c b/src/mame/video/thedeep.c index 43b93bc704b..85be395e293 100644 --- a/src/mame/video/thedeep.c +++ b/src/mame/video/thedeep.c @@ -211,7 +211,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( thedeep ) { - thedeep_state *state = screen->machine().driver_data(); + thedeep_state *state = screen.machine().driver_data(); int scrollx = state->m_scroll[0] + (state->m_scroll[1]<<8); int scrolly = state->m_scroll[2] + (state->m_scroll[3]<<8); int x; @@ -224,10 +224,10 @@ SCREEN_UPDATE( thedeep ) tilemap_set_scrolly(state->m_tilemap_0, x, y + scrolly); } - bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); + bitmap_fill(bitmap,cliprect,get_black_pen(screen.machine())); tilemap_draw(bitmap,cliprect,state->m_tilemap_0,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_tilemap_1,0,0); return 0; } diff --git a/src/mame/video/thepit.c b/src/mame/video/thepit.c index 0dcc2af6987..4a3e7388150 100644 --- a/src/mame/video/thepit.c +++ b/src/mame/video/thepit.c @@ -296,7 +296,7 @@ static void draw_sprites(running_machine &machine, SCREEN_UPDATE( thepit ) { - thepit_state *state = screen->machine().driver_data(); + thepit_state *state = screen.machine().driver_data(); offs_t offs; for (offs = 0; offs < 32; offs++) @@ -316,13 +316,13 @@ SCREEN_UPDATE( thepit ) tilemap_draw(bitmap, cliprect, state->m_tilemap, 0, 0); /* low priority sprites */ - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0); /* high priority tiles */ tilemap_draw(bitmap, cliprect, state->m_solid_tilemap, 1, 1); /* high priority sprites */ - draw_sprites(screen->machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, 1); return 0; } diff --git a/src/mame/video/thief.c b/src/mame/video/thief.c index 279b06dc697..adc6d2566c2 100644 --- a/src/mame/video/thief.c +++ b/src/mame/video/thief.c @@ -108,15 +108,15 @@ VIDEO_START( thief ){ } SCREEN_UPDATE( thief ){ - thief_state *state = screen->machine().driver_data(); + thief_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; UINT32 offs; int flipscreen = state->m_video_control&1; const UINT8 *source = videoram; - if (tms9927_screen_reset(screen->machine().device("tms"))) + if (tms9927_screen_reset(screen.machine().device("tms"))) { - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); return 0; } diff --git a/src/mame/video/thoop2.c b/src/mame/video/thoop2.c index de52ef5d817..bcdc15a778c 100644 --- a/src/mame/video/thoop2.c +++ b/src/mame/video/thoop2.c @@ -201,41 +201,41 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( thoop2 ) { - thoop2_state *state = screen->machine().driver_data(); + thoop2_state *state = screen.machine().driver_data(); /* set scroll registers */ tilemap_set_scrolly(state->m_pant[0], 0, state->m_vregs[0]); tilemap_set_scrollx(state->m_pant[0], 0, state->m_vregs[1]+4); tilemap_set_scrolly(state->m_pant[1], 0, state->m_vregs[2]); tilemap_set_scrollx(state->m_pant[1], 0, state->m_vregs[3]); - thoop2_sort_sprites(screen->machine()); + thoop2_sort_sprites(screen.machine()); bitmap_fill( bitmap, cliprect , 0); tilemap_draw(bitmap,cliprect,state->m_pant[1],TILEMAP_DRAW_LAYER1 | 3,0); tilemap_draw(bitmap,cliprect,state->m_pant[0],TILEMAP_DRAW_LAYER1 | 3,0); - draw_sprites(screen->machine(), bitmap,cliprect,3); + draw_sprites(screen.machine(), bitmap,cliprect,3); tilemap_draw(bitmap,cliprect,state->m_pant[1],TILEMAP_DRAW_LAYER0 | 3,0); tilemap_draw(bitmap,cliprect,state->m_pant[0],TILEMAP_DRAW_LAYER0 | 3,0); tilemap_draw(bitmap,cliprect,state->m_pant[1],TILEMAP_DRAW_LAYER1 | 2,0); tilemap_draw(bitmap,cliprect,state->m_pant[0],TILEMAP_DRAW_LAYER1 | 2,0); - draw_sprites(screen->machine(), bitmap,cliprect,2); + draw_sprites(screen.machine(), bitmap,cliprect,2); tilemap_draw(bitmap,cliprect,state->m_pant[1],TILEMAP_DRAW_LAYER0 | 2,0); tilemap_draw(bitmap,cliprect,state->m_pant[0],TILEMAP_DRAW_LAYER0 | 2,0); tilemap_draw(bitmap,cliprect,state->m_pant[1],TILEMAP_DRAW_LAYER1 | 1,0); tilemap_draw(bitmap,cliprect,state->m_pant[0],TILEMAP_DRAW_LAYER1 | 1,0); - draw_sprites(screen->machine(), bitmap,cliprect,1); + draw_sprites(screen.machine(), bitmap,cliprect,1); tilemap_draw(bitmap,cliprect,state->m_pant[1],TILEMAP_DRAW_LAYER0 | 1,0); tilemap_draw(bitmap,cliprect,state->m_pant[0],TILEMAP_DRAW_LAYER0 | 1,0); tilemap_draw(bitmap,cliprect,state->m_pant[1],TILEMAP_DRAW_LAYER1 | 0,0); tilemap_draw(bitmap,cliprect,state->m_pant[0],TILEMAP_DRAW_LAYER1 | 0,0); - draw_sprites(screen->machine(), bitmap,cliprect,0); + draw_sprites(screen.machine(), bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_pant[1],TILEMAP_DRAW_LAYER0 | 0,0); tilemap_draw(bitmap,cliprect,state->m_pant[0],TILEMAP_DRAW_LAYER0 | 0,0); - draw_sprites(screen->machine(), bitmap,cliprect,4); + draw_sprites(screen.machine(), bitmap,cliprect,4); return 0; } diff --git a/src/mame/video/thunderj.c b/src/mame/video/thunderj.c index 80f8ecc3d34..b92e326c785 100644 --- a/src/mame/video/thunderj.c +++ b/src/mame/video/thunderj.c @@ -124,8 +124,8 @@ VIDEO_START( thunderj ) SCREEN_UPDATE( thunderj ) { - thunderj_state *state = screen->machine().driver_data(); - bitmap_t *priority_bitmap = screen->machine().priority_bitmap; + thunderj_state *state = screen.machine().driver_data(); + bitmap_t *priority_bitmap = screen.machine().priority_bitmap; atarimo_rect_list rectlist; bitmap_t *mobitmap; int x, y, r; diff --git a/src/mame/video/thunderx.c b/src/mame/video/thunderx.c index 0f73c5ce66e..f5852b0fa68 100644 --- a/src/mame/video/thunderx.c +++ b/src/mame/video/thunderx.c @@ -68,11 +68,11 @@ VIDEO_START( scontra ) SCREEN_UPDATE( scontra ) { - thunderx_state *state = screen->machine().driver_data(); + thunderx_state *state = screen.machine().driver_data(); k052109_tilemap_update(state->m_k052109); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); /* The background color is always from layer 1 - but it's always black anyway */ // bitmap_fill(bitmap,cliprect,16 * state->m_layer_colorbase[1]); diff --git a/src/mame/video/tia.c b/src/mame/video/tia.c index fa0db852a42..63c25d09f8d 100644 --- a/src/mame/video/tia.c +++ b/src/mame/video/tia.c @@ -282,7 +282,7 @@ VIDEO_START( tia ) SCREEN_UPDATE( tia ) { - screen_height = screen->height(); + screen_height = screen.height(); copybitmap(bitmap, helper[2], 0, 0, 0, 0, cliprect); return 0; } diff --git a/src/mame/video/tiamc1.c b/src/mame/video/tiamc1.c index b16823bc53e..e6629df0f77 100644 --- a/src/mame/video/tiamc1.c +++ b/src/mame/video/tiamc1.c @@ -191,7 +191,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( tiamc1 ) { - tiamc1_state *state = screen->machine().driver_data(); + tiamc1_state *state = screen.machine().driver_data(); #if 0 int i; @@ -214,7 +214,7 @@ SCREEN_UPDATE( tiamc1 ) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap1, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/tigeroad.c b/src/mame/video/tigeroad.c index b626ea3bd3b..c1ea77ead85 100644 --- a/src/mame/video/tigeroad.c +++ b/src/mame/video/tigeroad.c @@ -162,18 +162,18 @@ VIDEO_START( tigeroad ) SCREEN_UPDATE( tigeroad ) { - tigeroad_state *state = screen->machine().driver_data(); + tigeroad_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1, 0); - draw_sprites(screen->machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, 0); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0, 1); - //draw_sprites(screen->machine(), bitmap, cliprect, 1); draw priority sprites? + //draw_sprites(screen.machine(), bitmap, cliprect, 1); draw priority sprites? tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2); return 0; } SCREEN_EOF( tigeroad ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram16_w(space, 0, 0, 0xffff); } diff --git a/src/mame/video/timelimt.c b/src/mame/video/timelimt.c index c5f8c7d9f66..d9cc7b55df2 100644 --- a/src/mame/video/timelimt.c +++ b/src/mame/video/timelimt.c @@ -145,12 +145,12 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( timelimt ) { - timelimt_state *state = screen->machine().driver_data(); + timelimt_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_scrollx); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_scrolly); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; diff --git a/src/mame/video/timeplt.c b/src/mame/video/timeplt.c index 573fddaf3bb..bd2cf601b7b 100644 --- a/src/mame/video/timeplt.c +++ b/src/mame/video/timeplt.c @@ -211,10 +211,10 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( timeplt ) { - timeplt_state *state = screen->machine().driver_data(); + timeplt_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 1, 0); return 0; } diff --git a/src/mame/video/tmnt.c b/src/mame/video/tmnt.c index af381a939fb..3ccbd518fc8 100644 --- a/src/mame/video/tmnt.c +++ b/src/mame/video/tmnt.c @@ -578,7 +578,7 @@ WRITE16_HANDLER( tmnt_priority_w ) SCREEN_UPDATE( mia ) { - tmnt_state *state = screen->machine().driver_data(); + tmnt_state *state = screen.machine().driver_data(); k052109_tilemap_update(state->m_k052109); @@ -593,7 +593,7 @@ SCREEN_UPDATE( mia ) SCREEN_UPDATE( tmnt ) { - tmnt_state *state = screen->machine().driver_data(); + tmnt_state *state = screen.machine().driver_data(); k052109_tilemap_update(state->m_k052109); @@ -609,7 +609,7 @@ SCREEN_UPDATE( tmnt ) SCREEN_UPDATE( punkshot ) { - tmnt_state *state = screen->machine().driver_data(); + tmnt_state *state = screen.machine().driver_data(); state->m_sprite_colorbase = k053251_get_palette_index(state->m_k053251, K053251_CI1); state->m_layer_colorbase[0] = k053251_get_palette_index(state->m_k053251, K053251_CI2); @@ -627,7 +627,7 @@ SCREEN_UPDATE( punkshot ) konami_sortlayers3(state->m_sorted_layer, state->m_layerpri); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[0], TILEMAP_DRAW_OPAQUE, 1); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[1], 0, 2); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[2], 0, 4); @@ -639,7 +639,7 @@ SCREEN_UPDATE( punkshot ) SCREEN_UPDATE( lgtnfght ) { - tmnt_state *state = screen->machine().driver_data(); + tmnt_state *state = screen.machine().driver_data(); int bg_colorbase; bg_colorbase = k053251_get_palette_index(state->m_k053251, K053251_CI0); @@ -659,7 +659,7 @@ SCREEN_UPDATE( lgtnfght ) konami_sortlayers3(state->m_sorted_layer, state->m_layerpri); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 16 * bg_colorbase); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[0], 0, 1); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[1], 0, 2); @@ -686,7 +686,7 @@ popmessage("%04x", state->m_glfgreat_pixel); SCREEN_UPDATE( glfgreat ) { - tmnt_state *state = screen->machine().driver_data(); + tmnt_state *state = screen.machine().driver_data(); int bg_colorbase; bg_colorbase = k053251_get_palette_index(state->m_k053251, K053251_CI0); @@ -708,7 +708,7 @@ SCREEN_UPDATE( glfgreat ) /* not sure about the 053936 priority, but it seems to work */ - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect,16 * bg_colorbase); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[0], 0, 1); @@ -740,7 +740,7 @@ SCREEN_UPDATE( glfgreat ) SCREEN_UPDATE( tmnt2 ) { - tmnt_state *state = screen->machine().driver_data(); + tmnt_state *state = screen.machine().driver_data(); double brt; int i, newdim, newen, cb, ce; @@ -769,21 +769,21 @@ SCREEN_UPDATE( tmnt2 ) // dim all colors before it for (i = 0; i < cb; i++) - palette_set_pen_contrast(screen->machine(), i, brt); + palette_set_pen_contrast(screen.machine(), i, brt); // reset all colors in range for (i = cb; i < ce; i++) - palette_set_pen_contrast(screen->machine(), i, 1.0); + palette_set_pen_contrast(screen.machine(), i, 1.0); // dim all colors after it for (i = ce; i < 2048; i++) - palette_set_pen_contrast(screen->machine(), i, brt); + palette_set_pen_contrast(screen.machine(), i, brt); // toggle shadow/highlight if (~state->m_dim_c & 0x10) - palette_set_shadow_mode(screen->machine(), 1); + palette_set_shadow_mode(screen.machine(), 1); else - palette_set_shadow_mode(screen->machine(), 0); + palette_set_shadow_mode(screen.machine(), 0); } SCREEN_UPDATE_CALL(lgtnfght); @@ -793,7 +793,7 @@ SCREEN_UPDATE( tmnt2 ) SCREEN_UPDATE( thndrx2 ) { - tmnt_state *state = screen->machine().driver_data(); + tmnt_state *state = screen.machine().driver_data(); int bg_colorbase; bg_colorbase = k053251_get_palette_index(state->m_k053251, K053251_CI0); @@ -813,7 +813,7 @@ SCREEN_UPDATE( thndrx2 ) konami_sortlayers3(state->m_sorted_layer, state->m_layerpri); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 16 * bg_colorbase); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[0], 0, 1); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[1], 0, 2); @@ -833,6 +833,6 @@ SCREEN_UPDATE( thndrx2 ) SCREEN_EOF( blswhstl ) { - tmnt_state *state = machine.driver_data(); + tmnt_state *state = screen.machine().driver_data(); k053245_clear_buffer(state->m_k053245); } diff --git a/src/mame/video/tnzs.c b/src/mame/video/tnzs.c index 9bbd7396d81..d28ef5251be 100644 --- a/src/mame/video/tnzs.c +++ b/src/mame/video/tnzs.c @@ -46,14 +46,14 @@ SCREEN_UPDATE( tnzs ) { bitmap_fill(bitmap, cliprect, 0x1f0); - screen->machine().device("spritegen")->set_fg_yoffsets( -0x12, 0x0e ); - screen->machine().device("spritegen")->set_bg_yoffsets( 0x1, -0x1 ); + screen.machine().device("spritegen")->set_fg_yoffsets( -0x12, 0x0e ); + screen.machine().device("spritegen")->set_bg_yoffsets( 0x1, -0x1 ); - screen->machine().device("spritegen")->seta001_draw_sprites(screen->machine(), bitmap, cliprect, 0x800, 0 ); + screen.machine().device("spritegen")->seta001_draw_sprites(screen.machine(), bitmap, cliprect, 0x800, 0 ); return 0; } SCREEN_EOF( tnzs ) { - machine.device("spritegen")->tnzs_eof(); + screen.machine().device("spritegen")->tnzs_eof(); } diff --git a/src/mame/video/toaplan1.c b/src/mame/video/toaplan1.c index 3ef14564b87..eec3b08b1cb 100644 --- a/src/mame/video/toaplan1.c +++ b/src/mame/video/toaplan1.c @@ -1166,10 +1166,10 @@ static void rallybik_draw_sprites(running_machine &machine, bitmap_t *bitmap, co SCREEN_UPDATE( rallybik ) { - toaplan1_state *state = screen->machine().driver_data(); + toaplan1_state *state = screen.machine().driver_data(); int priority; - toaplan1_log_vram(screen->machine()); + toaplan1_log_vram(screen.machine()); bitmap_fill(bitmap,cliprect,0x120); @@ -1182,7 +1182,7 @@ SCREEN_UPDATE( rallybik ) tilemap_draw(bitmap, cliprect, state->m_pf3_tilemap, priority, 0); tilemap_draw(bitmap, cliprect, state->m_pf2_tilemap, priority, 0); tilemap_draw(bitmap, cliprect, state->m_pf1_tilemap, priority, 0); - rallybik_draw_sprites(screen->machine(), bitmap,cliprect,priority << 8); + rallybik_draw_sprites(screen.machine(), bitmap,cliprect,priority << 8); } return 0; @@ -1190,12 +1190,12 @@ SCREEN_UPDATE( rallybik ) SCREEN_UPDATE( toaplan1 ) { - toaplan1_state *state = screen->machine().driver_data(); + toaplan1_state *state = screen.machine().driver_data(); int priority; - toaplan1_log_vram(screen->machine()); + toaplan1_log_vram(screen.machine()); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); bitmap_fill(bitmap,cliprect,0x120); // it's really correct? @@ -1210,7 +1210,7 @@ SCREEN_UPDATE( toaplan1 ) tilemap_draw_primask(bitmap, cliprect, state->m_pf1_tilemap, priority, priority, 0); } - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } @@ -1222,14 +1222,14 @@ SCREEN_UPDATE( toaplan1 ) SCREEN_EOF( rallybik ) { - toaplan1_state *state = machine.driver_data(); + toaplan1_state *state = screen.machine().driver_data(); memcpy(state->m_buffered_spriteram, state->m_spriteram, state->m_spriteram_size); } SCREEN_EOF( toaplan1 ) { - toaplan1_state *state = machine.driver_data(); + toaplan1_state *state = screen.machine().driver_data(); memcpy(state->m_buffered_spriteram, state->m_spriteram, state->m_spriteram_size); memcpy(state->m_buffered_spritesizeram16, state->m_spritesizeram16, TOAPLAN1_SPRITESIZERAM_SIZE); @@ -1237,9 +1237,9 @@ SCREEN_EOF( toaplan1 ) SCREEN_EOF( samesame ) { - toaplan1_state *state = machine.driver_data(); + toaplan1_state *state = screen.machine().driver_data(); memcpy(state->m_buffered_spriteram, state->m_spriteram, state->m_spriteram_size); memcpy(state->m_buffered_spritesizeram16, state->m_spritesizeram16, TOAPLAN1_SPRITESIZERAM_SIZE); - cputag_set_input_line(machine, "maincpu", M68K_IRQ_2, HOLD_LINE); /* Frame done */ + cputag_set_input_line(screen.machine(), "maincpu", M68K_IRQ_2, HOLD_LINE); /* Frame done */ } diff --git a/src/mame/video/toaplan2.c b/src/mame/video/toaplan2.c index 11aa65b849e..327f29a0e9b 100644 --- a/src/mame/video/toaplan2.c +++ b/src/mame/video/toaplan2.c @@ -293,19 +293,19 @@ WRITE16_HANDLER( batrider_objectbank_w ) // Dogyuun doesn't appear to require fancy mixing? SCREEN_UPDATE( toaplan2_dual ) { - toaplan2_state *state = screen->machine().driver_data(); + toaplan2_state *state = screen.machine().driver_data(); if (state->m_vdp1) { bitmap_fill(bitmap,cliprect,0); bitmap_fill(state->m_custom_priority_bitmap, cliprect, 0); - state->m_vdp1->gp9001_render_vdp(screen->machine(), bitmap, cliprect); + state->m_vdp1->gp9001_render_vdp(screen.machine(), bitmap, cliprect); } if (state->m_vdp0) { // bitmap_fill(bitmap,cliprect,0); bitmap_fill(state->m_custom_priority_bitmap, cliprect, 0); - state->m_vdp0->gp9001_render_vdp(screen->machine(), bitmap, cliprect); + state->m_vdp0->gp9001_render_vdp(screen.machine(), bitmap, cliprect); } @@ -316,7 +316,7 @@ SCREEN_UPDATE( toaplan2_dual ) // renders to 2 bitmaps, and mixes output SCREEN_UPDATE( toaplan2_mixed ) { - toaplan2_state *state = screen->machine().driver_data(); + toaplan2_state *state = screen.machine().driver_data(); // bitmap_fill(bitmap,cliprect,0); // bitmap_fill(gp9001_custom_priority_bitmap, cliprect, 0); @@ -325,13 +325,13 @@ SCREEN_UPDATE( toaplan2_mixed ) { bitmap_fill(bitmap,cliprect,0); bitmap_fill(state->m_custom_priority_bitmap, cliprect, 0); - state->m_vdp0->gp9001_render_vdp(screen->machine(), bitmap, cliprect); + state->m_vdp0->gp9001_render_vdp(screen.machine(), bitmap, cliprect); } if (state->m_vdp1) { bitmap_fill(state->m_secondary_render_bitmap,cliprect,0); bitmap_fill(state->m_custom_priority_bitmap, cliprect, 0); - state->m_vdp1->gp9001_render_vdp(screen->machine(), state->m_secondary_render_bitmap, cliprect); + state->m_vdp1->gp9001_render_vdp(screen.machine(), state->m_secondary_render_bitmap, cliprect); } @@ -348,8 +348,8 @@ SCREEN_UPDATE( toaplan2_mixed ) if (state->m_vdp0 && state->m_vdp1) { - int width = screen->width(); - int height = screen->height(); + int width = screen.width(); + int height = screen.height(); int y,x; UINT16* src_vdp0; // output buffer of vdp0 UINT16* src_vdp1; // output buffer of vdp1 @@ -416,18 +416,13 @@ SCREEN_UPDATE( toaplan2_mixed ) SCREEN_UPDATE( toaplan2 ) { - toaplan2_state *state = screen->machine().driver_data(); + toaplan2_state *state = screen.machine().driver_data(); if (state->m_vdp0) { - device_t *screen1 = screen->machine().device("screen"); - - if (screen == screen1) - { - bitmap_fill(bitmap,cliprect,0); - bitmap_fill(state->m_custom_priority_bitmap, cliprect, 0); - state->m_vdp0->gp9001_render_vdp(screen->machine(), bitmap, cliprect); - } + bitmap_fill(bitmap,cliprect,0); + bitmap_fill(state->m_custom_priority_bitmap, cliprect, 0); + state->m_vdp0->gp9001_render_vdp(screen.machine(), bitmap, cliprect); } return 0; @@ -435,7 +430,7 @@ SCREEN_UPDATE( toaplan2 ) SCREEN_UPDATE( truxton2 ) { - toaplan2_state *state = screen->machine().driver_data(); + toaplan2_state *state = screen.machine().driver_data(); SCREEN_UPDATE_CALL(toaplan2); tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); @@ -445,13 +440,13 @@ SCREEN_UPDATE( truxton2 ) SCREEN_UPDATE( batrider ) { - toaplan2_state *state = screen->machine().driver_data(); + toaplan2_state *state = screen.machine().driver_data(); SCREEN_UPDATE_CALL( toaplan2 ); int line; rectangle clip; - const rectangle &visarea = screen->visible_area(); + const rectangle &visarea = screen.visible_area(); clip.min_x = visarea.min_x; clip.max_x = visarea.max_x; @@ -492,7 +487,7 @@ SCREEN_UPDATE( batsugun ) SCREEN_EOF( toaplan2 ) { - toaplan2_state *state = machine.driver_data(); + toaplan2_state *state = screen.machine().driver_data(); if (state->m_vdp0) state->m_vdp0->gp9001_screen_eof(); if (state->m_vdp1) state->m_vdp1->gp9001_screen_eof(); } diff --git a/src/mame/video/toki.c b/src/mame/video/toki.c index d6e7f46d57b..6e20d75b5f3 100644 --- a/src/mame/video/toki.c +++ b/src/mame/video/toki.c @@ -35,12 +35,12 @@ WRITE16_HANDLER( toki_control_w ) SCREEN_EOF( toki ) { - buffer_spriteram16_w(machine.device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff); + buffer_spriteram16_w(screen.machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff); } SCREEN_EOF( tokib ) { - buffer_spriteram16_w(machine.device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff); + buffer_spriteram16_w(screen.machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff); } static TILE_GET_INFO( get_text_tile_info ) @@ -269,7 +269,7 @@ static void tokib_draw_sprites(running_machine &machine, bitmap_t *bitmap,const SCREEN_UPDATE( toki ) { - toki_state *state = screen->machine().driver_data(); + toki_state *state = screen.machine().driver_data(); int background_y_scroll,foreground_y_scroll,background_x_scroll,foreground_x_scroll; background_x_scroll=((state->m_scrollram16[0x06] &0x7f) << 1) @@ -288,7 +288,7 @@ SCREEN_UPDATE( toki ) tilemap_set_scrollx( state->m_foreground_layer, 0, foreground_x_scroll ); tilemap_set_scrolly( state->m_foreground_layer, 0, foreground_y_scroll ); - flip_screen_set(screen->machine(), (state->m_scrollram16[0x28]&0x8000)==0); + flip_screen_set(screen.machine(), (state->m_scrollram16[0x28]&0x8000)==0); if (state->m_scrollram16[0x28]&0x100) { tilemap_draw(bitmap,cliprect,state->m_background_layer,TILEMAP_DRAW_OPAQUE,0); @@ -297,14 +297,14 @@ SCREEN_UPDATE( toki ) tilemap_draw(bitmap,cliprect,state->m_foreground_layer,TILEMAP_DRAW_OPAQUE,0); tilemap_draw(bitmap,cliprect,state->m_background_layer,0,0); } - toki_draw_sprites(screen->machine(), bitmap,cliprect); + toki_draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_text_layer,0,0); return 0; } SCREEN_UPDATE( tokib ) { - toki_state *state = screen->machine().driver_data(); + toki_state *state = screen.machine().driver_data(); tilemap_set_scroll_rows(state->m_foreground_layer,1); tilemap_set_scroll_rows(state->m_background_layer,1); tilemap_set_scrolly( state->m_background_layer, 0, state->m_scrollram16[0]+1 ); @@ -320,7 +320,7 @@ SCREEN_UPDATE( tokib ) tilemap_draw(bitmap,cliprect,state->m_background_layer,0,0); } - tokib_draw_sprites(screen->machine(), bitmap,cliprect); + tokib_draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_text_layer,0,0); return 0; } diff --git a/src/mame/video/toobin.c b/src/mame/video/toobin.c index 4f25b5d85ea..b5683e95ca9 100644 --- a/src/mame/video/toobin.c +++ b/src/mame/video/toobin.c @@ -230,9 +230,9 @@ WRITE16_HANDLER( toobin_slip_w ) SCREEN_UPDATE( toobin ) { - toobin_state *state = screen->machine().driver_data(); - bitmap_t *priority_bitmap = screen->machine().priority_bitmap; - const rgb_t *palette = palette_entry_list_adjusted(screen->machine().palette); + toobin_state *state = screen.machine().driver_data(); + bitmap_t *priority_bitmap = screen.machine().priority_bitmap; + const rgb_t *palette = palette_entry_list_adjusted(screen.machine().palette); atarimo_rect_list rectlist; bitmap_t *mobitmap; int x, y; diff --git a/src/mame/video/topspeed.c b/src/mame/video/topspeed.c index d41586e6963..211dca44e6e 100644 --- a/src/mame/video/topspeed.c +++ b/src/mame/video/topspeed.c @@ -111,35 +111,35 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( topspeed ) { - topspeed_state *state = screen->machine().driver_data(); + topspeed_state *state = screen.machine().driver_data(); UINT8 layer[4]; #ifdef MAME_DEBUG - if (screen->machine().input().code_pressed_once (KEYCODE_V)) + if (screen.machine().input().code_pressed_once (KEYCODE_V)) { state->m_dislayer[0] ^= 1; popmessage("bg: %01x", state->m_dislayer[0]); } - if (screen->machine().input().code_pressed_once (KEYCODE_B)) + if (screen.machine().input().code_pressed_once (KEYCODE_B)) { state->m_dislayer[1] ^= 1; popmessage("fg: %01x", state->m_dislayer[1]); } - if (screen->machine().input().code_pressed_once (KEYCODE_N)) + if (screen.machine().input().code_pressed_once (KEYCODE_N)) { state->m_dislayer[2] ^= 1; popmessage("bg2: %01x", state->m_dislayer[2]); } - if (screen->machine().input().code_pressed_once (KEYCODE_M)) + if (screen.machine().input().code_pressed_once (KEYCODE_M)) { state->m_dislayer[3] ^= 1; popmessage("fg2: %01x", state->m_dislayer[3]); } - if (screen->machine().input().code_pressed_once (KEYCODE_C)) + if (screen.machine().input().code_pressed_once (KEYCODE_C)) { state->m_dislayer[4] ^= 1; popmessage("sprites: %01x", state->m_dislayer[4]); @@ -155,7 +155,7 @@ SCREEN_UPDATE( topspeed ) layer[2] = 1; layer[3] = 0; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); #ifdef MAME_DEBUG @@ -182,6 +182,6 @@ SCREEN_UPDATE( topspeed ) if (state->m_dislayer[4] == 0) #endif - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); return 0; } diff --git a/src/mame/video/toypop.c b/src/mame/video/toypop.c index 9028a294043..870a4f103df 100644 --- a/src/mame/video/toypop.c +++ b/src/mame/video/toypop.c @@ -277,9 +277,9 @@ void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *c SCREEN_UPDATE( toypop ) { - toypop_state *state = screen->machine().driver_data(); - draw_background(screen->machine(), bitmap); + toypop_state *state = screen.machine().driver_data(); + draw_background(screen.machine(), bitmap); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram); return 0; } diff --git a/src/mame/video/tp84.c b/src/mame/video/tp84.c index cd824c6809f..c5c286eb6c4 100644 --- a/src/mame/video/tp84.c +++ b/src/mame/video/tp84.c @@ -177,23 +177,23 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( tp84 ) { - tp84_state *state = screen->machine().driver_data(); + tp84_state *state = screen.machine().driver_data(); rectangle clip = *cliprect; - const rectangle &visarea = screen->visible_area(); + const rectangle &visarea = screen.visible_area(); - if (cliprect->min_y == screen->visible_area().min_y) + if (cliprect->min_y == screen.visible_area().min_y) { - tilemap_mark_all_tiles_dirty_all(screen->machine()); + tilemap_mark_all_tiles_dirty_all(screen.machine()); tilemap_set_scrollx(state->m_bg_tilemap, 0, *state->m_scroll_x); tilemap_set_scrolly(state->m_bg_tilemap, 0, *state->m_scroll_y); - tilemap_set_flip_all(screen->machine(), ((*state->m_flipscreen_x & 0x01) ? TILEMAP_FLIPX : 0) | + tilemap_set_flip_all(screen.machine(), ((*state->m_flipscreen_x & 0x01) ? TILEMAP_FLIPX : 0) | ((*state->m_flipscreen_y & 0x01) ? TILEMAP_FLIPY : 0)); } tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); /* draw top status region */ clip.min_x = visarea.min_x; diff --git a/src/mame/video/trackfld.c b/src/mame/video/trackfld.c index 893284808e6..45d9863b608 100644 --- a/src/mame/video/trackfld.c +++ b/src/mame/video/trackfld.c @@ -250,18 +250,18 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( trackfld ) { - trackfld_state *state = screen->machine().driver_data(); + trackfld_state *state = screen.machine().driver_data(); int row, scrollx; for (row = 0; row < 32; row++) { scrollx = state->m_scroll[row] + 256 * (state->m_scroll2[row] & 0x01); - if (flip_screen_get(screen->machine())) scrollx = -scrollx; + if (flip_screen_get(screen.machine())) scrollx = -scrollx; tilemap_set_scrollx(state->m_bg_tilemap, row, scrollx); } tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/travrusa.c b/src/mame/video/travrusa.c index 3cdad1e8b73..0d3f510829c 100644 --- a/src/mame/video/travrusa.c +++ b/src/mame/video/travrusa.c @@ -342,9 +342,9 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( travrusa ) { - travrusa_state *state = screen->machine().driver_data(); + travrusa_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER1, 0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_LAYER0, 0); return 0; } diff --git a/src/mame/video/triplhnt.c b/src/mame/video/triplhnt.c index 2f31235c294..e9a610d594d 100644 --- a/src/mame/video/triplhnt.c +++ b/src/mame/video/triplhnt.c @@ -120,14 +120,14 @@ static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const recta SCREEN_UPDATE( triplhnt ) { - triplhnt_state *state = screen->machine().driver_data(); - device_t *discrete = screen->machine().device("discrete"); + triplhnt_state *state = screen.machine().driver_data(); + device_t *discrete = screen.machine().device("discrete"); tilemap_mark_all_tiles_dirty(state->m_bg_tilemap); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); discrete_sound_w(discrete, TRIPLHNT_BEAR_ROAR_DATA, state->m_playfield_ram[0xfa] & 15); discrete_sound_w(discrete, TRIPLHNT_SHOT_DATA, state->m_playfield_ram[0xfc] & 15); diff --git a/src/mame/video/truco.c b/src/mame/video/truco.c index c7014b56ee4..0657be73a76 100644 --- a/src/mame/video/truco.c +++ b/src/mame/video/truco.c @@ -33,7 +33,7 @@ PALETTE_INIT( truco ) SCREEN_UPDATE( truco ) { - truco_state *state = screen->machine().driver_data(); + truco_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; UINT8 *vid = videoram; int x, y; diff --git a/src/mame/video/trucocl.c b/src/mame/video/trucocl.c index ad4aac2b396..a4fa2997ac1 100644 --- a/src/mame/video/trucocl.c +++ b/src/mame/video/trucocl.c @@ -81,7 +81,7 @@ VIDEO_START( trucocl ) SCREEN_UPDATE( trucocl ) { - trucocl_state *state = screen->machine().driver_data(); + trucocl_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); return 0; } diff --git a/src/mame/video/tryout.c b/src/mame/video/tryout.c index c91b091a486..c75bce9289d 100644 --- a/src/mame/video/tryout.c +++ b/src/mame/video/tryout.c @@ -235,10 +235,10 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( tryout ) { - tryout_state *state = screen->machine().driver_data(); + tryout_state *state = screen.machine().driver_data(); int scrollx = 0; - if (!flip_screen_get(screen->machine())) + if (!flip_screen_get(screen.machine())) tilemap_set_scrollx(state->m_fg_tilemap, 0, 16); /* Assumed hard-wired */ else tilemap_set_scrollx(state->m_fg_tilemap, 0, -8); /* Assumed hard-wired */ @@ -254,13 +254,13 @@ SCREEN_UPDATE( tryout ) if(!(state->m_gfx_control[0] & 0x8)) // screen disable { /* TODO: Color might be different, needs a video from an original pcb. */ - bitmap_fill(bitmap, cliprect, screen->machine().pens[0x10]); + bitmap_fill(bitmap, cliprect, screen.machine().pens[0x10]); } else { tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); } // popmessage("%02x %02x %02x %02x",state->m_gfx_control[0],state->m_gfx_control[1],state->m_gfx_control[2],scrollx); diff --git a/src/mame/video/tsamurai.c b/src/mame/video/tsamurai.c index 3adce52f30f..a16deb1cf38 100644 --- a/src/mame/video/tsamurai.c +++ b/src/mame/video/tsamurai.c @@ -199,7 +199,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( tsamurai ) { - tsamurai_state *state = screen->machine().driver_data(); + tsamurai_state *state = screen.machine().driver_data(); int i; /* Do the column scroll used for the "660" logo on the title screen */ @@ -220,7 +220,7 @@ SCREEN_UPDATE( tsamurai ) */ bitmap_fill(bitmap,cliprect,state->m_bgcolor); tilemap_draw(bitmap,cliprect,state->m_background,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_foreground,0,0); return 0; } @@ -264,10 +264,10 @@ VIDEO_START( vsgongf ) SCREEN_UPDATE( vsgongf ) { - tsamurai_state *state = screen->machine().driver_data(); + tsamurai_state *state = screen.machine().driver_data(); #ifdef MAME_DEBUG - if( screen->machine().input().code_pressed( KEYCODE_Q ) ){ - while( screen->machine().input().code_pressed( KEYCODE_Q ) ){ + if( screen.machine().input().code_pressed( KEYCODE_Q ) ){ + while( screen.machine().input().code_pressed( KEYCODE_Q ) ){ state->m_key_count++; state->m_vsgongf_color = state->m_key_count; tilemap_mark_all_tiles_dirty( state->m_foreground ); @@ -276,6 +276,6 @@ SCREEN_UPDATE( vsgongf ) #endif tilemap_draw(bitmap,cliprect,state->m_foreground,0,0); - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); return 0; } diff --git a/src/mame/video/tubep.c b/src/mame/video/tubep.c index 49ae9dc8c2a..19d0b278b30 100644 --- a/src/mame/video/tubep.c +++ b/src/mame/video/tubep.c @@ -587,14 +587,14 @@ void tubep_vblank_end(running_machine &machine) SCREEN_UPDATE( tubep ) { - tubep_state *state = screen->machine().driver_data(); + tubep_state *state = screen.machine().driver_data(); int DISP_ = state->m_DISP^1; pen_t pen_base = 32; //change it later UINT32 v; - UINT8 *text_gfx_base = screen->machine().region("gfx1")->base(); - UINT8 *romBxx = screen->machine().region("user1")->base() + 0x2000*state->m_background_romsel; + UINT8 *text_gfx_base = screen.machine().region("gfx1")->base(); + UINT8 *romBxx = screen.machine().region("user1")->base() + 0x2000*state->m_background_romsel; /* logerror(" update: from DISP=%i y_min=%3i y_max=%3i\n", DISP_, cliprect->min_y, cliprect->max_y+1); */ @@ -745,12 +745,12 @@ WRITE8_HANDLER( rjammer_background_page_w ) SCREEN_UPDATE( rjammer ) { - tubep_state *state = screen->machine().driver_data(); + tubep_state *state = screen.machine().driver_data(); int DISP_ = state->m_DISP^1; UINT32 v; - UINT8 *text_gfx_base = screen->machine().region("gfx1")->base(); - UINT8 *rom13D = screen->machine().region("user1")->base(); + UINT8 *text_gfx_base = screen.machine().region("gfx1")->base(); + UINT8 *rom13D = screen.machine().region("user1")->base(); UINT8 *rom11BD = rom13D+0x1000; UINT8 *rom19C = rom13D+0x5000; diff --git a/src/mame/video/tumbleb.c b/src/mame/video/tumbleb.c index 9ffeccf1a9c..c40d2677f60 100644 --- a/src/mame/video/tumbleb.c +++ b/src/mame/video/tumbleb.c @@ -605,11 +605,11 @@ VIDEO_START( suprtrio ) SCREEN_UPDATE( tumblepb ) { - tumbleb_state *state = screen->machine().driver_data(); + tumbleb_state *state = screen.machine().driver_data(); int offs, offs2; state->m_flipscreen = state->m_control_0[0] & 0x80; - tilemap_set_flip_all(screen->machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + tilemap_set_flip_all(screen.machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); if (state->m_flipscreen) offs = 1; @@ -635,17 +635,17 @@ SCREEN_UPDATE( tumblepb ) else tilemap_draw(bitmap, cliprect, state->m_pf1_alt_tilemap, 0, 0); - tumblepb_draw_sprites(screen->machine(), bitmap, cliprect); + tumblepb_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( jumpkids ) { - tumbleb_state *state = screen->machine().driver_data(); + tumbleb_state *state = screen.machine().driver_data(); int offs, offs2; state->m_flipscreen = state->m_control_0[0] & 0x80; - tilemap_set_flip_all(screen->machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + tilemap_set_flip_all(screen.machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); if (state->m_flipscreen) offs = 1; @@ -671,17 +671,17 @@ SCREEN_UPDATE( jumpkids ) else tilemap_draw(bitmap, cliprect, state->m_pf1_alt_tilemap, 0, 0); - jumpkids_draw_sprites(screen->machine(), bitmap, cliprect); + jumpkids_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( semicom ) { - tumbleb_state *state = screen->machine().driver_data(); + tumbleb_state *state = screen.machine().driver_data(); int offs, offs2; state->m_flipscreen = state->m_control_0[0] & 0x80; - tilemap_set_flip_all(screen->machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + tilemap_set_flip_all(screen.machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); if (state->m_flipscreen) offs = 1; @@ -707,13 +707,13 @@ SCREEN_UPDATE( semicom ) else tilemap_draw(bitmap, cliprect, state->m_pf1_alt_tilemap, 0, 0); - jumpkids_draw_sprites(screen->machine(), bitmap, cliprect); + jumpkids_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( semicom_altoffsets ) { - tumbleb_state *state = screen->machine().driver_data(); + tumbleb_state *state = screen.machine().driver_data(); int offsx, offsy, offsx2; state->m_flipscreen = state->m_control_0[0] & 0x80; @@ -736,17 +736,17 @@ SCREEN_UPDATE( semicom_altoffsets ) else tilemap_draw(bitmap, cliprect, state->m_pf1_alt_tilemap, 0, 0); - jumpkids_draw_sprites(screen->machine(), bitmap, cliprect); + jumpkids_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( bcstory ) { - tumbleb_state *state = screen->machine().driver_data(); + tumbleb_state *state = screen.machine().driver_data(); int offs, offs2; state->m_flipscreen = state->m_control_0[0] & 0x80; - tilemap_set_flip_all(screen->machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + tilemap_set_flip_all(screen.machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); /* not sure of this */ if (state->m_flipscreen) @@ -774,17 +774,17 @@ SCREEN_UPDATE( bcstory ) else tilemap_draw(bitmap, cliprect, state->m_pf1_alt_tilemap, 0, 0); - jumpkids_draw_sprites(screen->machine(), bitmap, cliprect); + jumpkids_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( semibase ) { - tumbleb_state *state = screen->machine().driver_data(); + tumbleb_state *state = screen.machine().driver_data(); int offs, offs2; state->m_flipscreen = state->m_control_0[0] & 0x80; - tilemap_set_flip_all(screen->machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + tilemap_set_flip_all(screen.machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); offs = -1; offs2 = -2; @@ -803,17 +803,17 @@ SCREEN_UPDATE( semibase ) else tilemap_draw(bitmap, cliprect, state->m_pf1_alt_tilemap, 0, 0); - jumpkids_draw_sprites(screen->machine(), bitmap, cliprect); + jumpkids_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( sdfight ) { - tumbleb_state *state = screen->machine().driver_data(); + tumbleb_state *state = screen.machine().driver_data(); int offs, offs2; state->m_flipscreen = state->m_control_0[0] & 0x80; - tilemap_set_flip_all(screen->machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + tilemap_set_flip_all(screen.machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); offs = -1; offs2 = -5; // foreground scroll.. @@ -831,7 +831,7 @@ SCREEN_UPDATE( sdfight ) else tilemap_draw(bitmap, cliprect, state->m_pf1_alt_tilemap, 0, 0); - jumpkids_draw_sprites(screen->machine(), bitmap, cliprect); + jumpkids_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } @@ -839,11 +839,11 @@ SCREEN_UPDATE( sdfight ) SCREEN_UPDATE( fncywld ) { - tumbleb_state *state = screen->machine().driver_data(); + tumbleb_state *state = screen.machine().driver_data(); int offs, offs2; state->m_flipscreen = state->m_control_0[0] & 0x80; - tilemap_set_flip_all(screen->machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + tilemap_set_flip_all(screen.machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); if (state->m_flipscreen) offs = 1; @@ -869,16 +869,16 @@ SCREEN_UPDATE( fncywld ) else tilemap_draw(bitmap, cliprect, state->m_pf1_alt_tilemap, 0, 0); - fncywld_draw_sprites(screen->machine(), bitmap, cliprect); + fncywld_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( jumppop ) { - tumbleb_state *state = screen->machine().driver_data(); + tumbleb_state *state = screen.machine().driver_data(); - // bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + // bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); tilemap_set_scrollx(state->m_pf1_tilemap, 0, state->m_control[2] - 0x3a0); tilemap_set_scrolly(state->m_pf1_tilemap, 0, state->m_control[3]); @@ -901,14 +901,14 @@ SCREEN_UPDATE( jumppop ) //popmessage("%04x %04x %04x %04x %04x %04x %04x %04x", state->m_control[0],state->m_control[1],state->m_control[2],state->m_control[3],state->m_control[4],state->m_control[5],state->m_control[6],state->m_control[7]); - jumpkids_draw_sprites(screen->machine(), bitmap, cliprect); + jumpkids_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } SCREEN_UPDATE( suprtrio ) { - tumbleb_state *state = screen->machine().driver_data(); + tumbleb_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_pf1_alt_tilemap, 0, -state->m_control[1] - 6); tilemap_set_scrolly(state->m_pf1_alt_tilemap, 0, -state->m_control[2]); @@ -918,7 +918,7 @@ SCREEN_UPDATE( suprtrio ) tilemap_draw(bitmap, cliprect, state->m_pf2_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, state->m_pf1_alt_tilemap, 0, 0); - jumpkids_draw_sprites(screen->machine(), bitmap, cliprect); + jumpkids_draw_sprites(screen.machine(), bitmap, cliprect); #if 0 popmessage("%04x %04x %04x %04x %04x %04x %04x %04x", state->m_control[0], @@ -936,11 +936,11 @@ popmessage("%04x %04x %04x %04x %04x %04x %04x %04x", SCREEN_UPDATE( pangpang ) { - tumbleb_state *state = screen->machine().driver_data(); + tumbleb_state *state = screen.machine().driver_data(); int offs, offs2; state->m_flipscreen = state->m_control_0[0] & 0x80; - tilemap_set_flip_all(screen->machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + tilemap_set_flip_all(screen.machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); if (state->m_flipscreen) offs = 1; @@ -966,6 +966,6 @@ SCREEN_UPDATE( pangpang ) else tilemap_draw(bitmap, cliprect, state->m_pf1_alt_tilemap, 0, 0); - jumpkids_draw_sprites(screen->machine(), bitmap, cliprect); + jumpkids_draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/tumblep.c b/src/mame/video/tumblep.c index 616a4be7164..3a4b91034b7 100644 --- a/src/mame/video/tumblep.c +++ b/src/mame/video/tumblep.c @@ -21,10 +21,10 @@ to switch between 8*8 tiles and 16*16 tiles. SCREEN_UPDATE( tumblep ) { - tumblep_state *state = screen->machine().driver_data(); + tumblep_state *state = screen.machine().driver_data(); UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); - flip_screen_set(screen->machine(), BIT(flip, 7)); + flip_screen_set(screen.machine(), BIT(flip, 7)); deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); bitmap_fill(bitmap, cliprect, 256); /* not verified */ @@ -32,6 +32,6 @@ SCREEN_UPDATE( tumblep ) deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram, 0x400); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0x400); return 0; } diff --git a/src/mame/video/tunhunt.c b/src/mame/video/tunhunt.c index 61d7b6911f9..c4ce8c3399e 100644 --- a/src/mame/video/tunhunt.c +++ b/src/mame/video/tunhunt.c @@ -378,14 +378,14 @@ static void draw_shell(running_machine &machine, SCREEN_UPDATE( tunhunt ) { - tunhunt_state *state = screen->machine().driver_data(); - set_pens(screen->machine()); + tunhunt_state *state = screen.machine().driver_data(); + set_pens(screen.machine()); - draw_box(screen->machine(), bitmap, cliprect); + draw_box(screen.machine(), bitmap, cliprect); - draw_motion_object(screen->machine(), bitmap, cliprect); + draw_motion_object(screen.machine(), bitmap, cliprect); - draw_shell(screen->machine(), bitmap, cliprect, + draw_shell(screen.machine(), bitmap, cliprect, state->m_workram[SHL0PC], /* picture code */ state->m_workram[SHEL0H], /* hposition */ state->m_workram[SHL0V], /* vstart */ @@ -393,7 +393,7 @@ SCREEN_UPDATE( tunhunt ) state->m_workram[SHL0ST], /* vstretch */ state->m_control&0x08 ); /* hstretch */ - draw_shell(screen->machine(), bitmap, cliprect, + draw_shell(screen.machine(), bitmap, cliprect, state->m_workram[SHL1PC], /* picture code */ state->m_workram[SHEL1H], /* hposition */ state->m_workram[SHL1V], /* vstart */ diff --git a/src/mame/video/turbo.c b/src/mame/video/turbo.c index 8fae41b2236..e078b779ad1 100644 --- a/src/mame/video/turbo.c +++ b/src/mame/video/turbo.c @@ -406,10 +406,10 @@ static UINT32 turbo_get_sprite_bits(running_machine &machine, UINT8 road, sprite SCREEN_UPDATE( turbo ) { - turbo_state *state = screen->machine().driver_data(); + turbo_state *state = screen.machine().driver_data(); bitmap_t *fgpixmap = tilemap_get_pixmap(state->m_fg_tilemap); - const UINT8 *road_gfxdata = screen->machine().region("gfx3")->base(); - const UINT8 *prom_base = screen->machine().region("proms")->base(); + const UINT8 *road_gfxdata = screen.machine().region("gfx3")->base(); + const UINT8 *prom_base = screen.machine().region("proms")->base(); const UINT8 *pr1114 = prom_base + 0x000; const UINT8 *pr1115 = prom_base + 0x020; const UINT8 *pr1116 = prom_base + 0x040; @@ -437,7 +437,7 @@ SCREEN_UPDATE( turbo ) /* compute the sprite information; we use y-1 since this info was computed during HBLANK */ /* on the previous scanline */ - turbo_prepare_sprites(screen->machine(), state, y, &sprinfo); + turbo_prepare_sprites(screen.machine(), state, y, &sprinfo); /* loop over columns */ for (x = 0; x <= cliprect->max_x; x += TURBO_X_SCALE) @@ -533,7 +533,7 @@ SCREEN_UPDATE( turbo ) /* CDG0-7 = D8 -D15 */ /* CDR0-7 = D16-D23 */ /* PLB0-7 = D24-D31 */ - sprbits = turbo_get_sprite_bits(screen->machine(), road, &sprinfo); + sprbits = turbo_get_sprite_bits(screen.machine(), road, &sprinfo); /* perform collision detection here via lookup in IC20/PR1116 (p. 144) */ state->m_turbo_collision |= pr1116[((sprbits >> 24) & 7) | (slipar_acciar >> 1)]; @@ -761,9 +761,9 @@ static UINT32 subroc3d_get_sprite_bits(running_machine &machine, sprite_info *sp SCREEN_UPDATE( subroc3d ) { - turbo_state *state = screen->machine().driver_data(); + turbo_state *state = screen.machine().driver_data(); bitmap_t *fgpixmap = tilemap_get_pixmap(state->m_fg_tilemap); - const UINT8 *prom_base = screen->machine().region("proms")->base(); + const UINT8 *prom_base = screen.machine().region("proms")->base(); const UINT8 *pr1419 = prom_base + 0x000; const UINT8 *pr1620 = prom_base + 0x200; const UINT8 *pr1450 = prom_base + 0x500; @@ -779,7 +779,7 @@ SCREEN_UPDATE( subroc3d ) /* compute the sprite information; we use y-1 since this info was computed during HBLANK */ /* on the previous scanline */ - subroc3d_prepare_sprites(screen->machine(), state, y, &sprinfo); + subroc3d_prepare_sprites(screen.machine(), state, y, &sprinfo); /* loop over columns */ for (x = 0; x <= cliprect->max_x; x += TURBO_X_SCALE) @@ -819,7 +819,7 @@ SCREEN_UPDATE( subroc3d ) /* CDB0-7 = D8 -D15 */ /* CDC0-7 = D16-D23 */ /* CDD0-7 = D24-D31 */ - sprbits = subroc3d_get_sprite_bits(screen->machine(), &sprinfo, &plb); + sprbits = subroc3d_get_sprite_bits(screen.machine(), &sprinfo, &plb); /* MUX0-3 is selected by PLY0-3 and the sprite enable bits, and is the output */ /* of IC21/PR1450 (p. 141), unless MPLB = 0, in which case the values are grounded (p. 141) */ @@ -981,10 +981,10 @@ static UINT32 buckrog_get_sprite_bits(running_machine &machine, sprite_info *spr SCREEN_UPDATE( buckrog ) { - turbo_state *state = screen->machine().driver_data(); + turbo_state *state = screen.machine().driver_data(); bitmap_t *fgpixmap = tilemap_get_pixmap(state->m_fg_tilemap); - const UINT8 *bgcolor = screen->machine().region("gfx3")->base(); - const UINT8 *prom_base = screen->machine().region("proms")->base(); + const UINT8 *bgcolor = screen.machine().region("gfx3")->base(); + const UINT8 *prom_base = screen.machine().region("proms")->base(); const UINT8 *pr5194 = prom_base + 0x000; const UINT8 *pr5198 = prom_base + 0x500; const UINT8 *pr5199 = prom_base + 0x700; @@ -999,7 +999,7 @@ SCREEN_UPDATE( buckrog ) /* compute the sprite information; we use y-1 since this info was computed during HBLANK */ /* on the previous scanline */ - buckrog_prepare_sprites(screen->machine(), state, y, &sprinfo); + buckrog_prepare_sprites(screen.machine(), state, y, &sprinfo); /* loop over columns */ for (x = 0; x <= cliprect->max_x; x += TURBO_X_SCALE) @@ -1036,7 +1036,7 @@ SCREEN_UPDATE( buckrog ) /* CDB0-7 = D8 -D15 */ /* CDC0-7 = D16-D23 */ /* CDD0-7 = D24-D31 */ - sprbits = buckrog_get_sprite_bits(screen->machine(), &sprinfo, &plb); + sprbits = buckrog_get_sprite_bits(screen.machine(), &sprinfo, &plb); /* the PLB bits go into an LS148 8-to-1 decoder and become MUX0-3 (PROM board SH 2/10) */ if (plb == 0) diff --git a/src/mame/video/tutankhm.c b/src/mame/video/tutankhm.c index 0a6932ad353..2082d7c085b 100644 --- a/src/mame/video/tutankhm.c +++ b/src/mame/video/tutankhm.c @@ -61,13 +61,13 @@ static void get_pens( running_machine &machine, pen_t *pens ) SCREEN_UPDATE( tutankhm ) { - tutankhm_state *state = screen->machine().driver_data(); + tutankhm_state *state = screen.machine().driver_data(); int xorx = state->m_flip_x ? 255 : 0; int xory = state->m_flip_y ? 255 : 0; pen_t pens[NUM_PENS]; int x, y; - get_pens(screen->machine(), pens); + get_pens(screen.machine(), pens); for (y = cliprect->min_y; y <= cliprect->max_y; y++) { diff --git a/src/mame/video/twin16.c b/src/mame/video/twin16.c index caf46c6e03c..52ecf193d8c 100644 --- a/src/mame/video/twin16.c +++ b/src/mame/video/twin16.c @@ -522,15 +522,15 @@ VIDEO_START( twin16 ) SCREEN_UPDATE( twin16 ) { - twin16_state *state = screen->machine().driver_data(); + twin16_state *state = screen.machine().driver_data(); int text_flip=0; if (state->m_video_register&TWIN16_SCREEN_FLIPX) text_flip|=TILEMAP_FLIPX; if (state->m_video_register&TWIN16_SCREEN_FLIPY) text_flip|=TILEMAP_FLIPY; - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); - draw_layer( screen->machine(), bitmap, 1 ); - draw_layer( screen->machine(), bitmap, 0 ); - draw_sprites( screen->machine(), bitmap ); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); + draw_layer( screen.machine(), bitmap, 1 ); + draw_layer( screen.machine(), bitmap, 0 ); + draw_sprites( screen.machine(), bitmap ); if (text_flip) tilemap_set_flip(state->m_text_tilemap, text_flip); tilemap_draw(bitmap, cliprect, state->m_text_tilemap, 0, 0); @@ -539,21 +539,21 @@ SCREEN_UPDATE( twin16 ) SCREEN_EOF( twin16 ) { - twin16_state *state = machine.driver_data(); - twin16_set_sprite_timer(machine); + twin16_state *state = screen.machine().driver_data(); + twin16_set_sprite_timer(screen.machine()); - if (twin16_spriteram_process_enable(machine)) { - if (state->m_need_process_spriteram) twin16_spriteram_process(machine); + if (twin16_spriteram_process_enable(screen.machine())) { + if (state->m_need_process_spriteram) twin16_spriteram_process(screen.machine()); state->m_need_process_spriteram = 1; /* if the sprite preprocessor is used, sprite ram is copied to an external buffer first, as evidenced by 1-frame sprite lag in gradius2 and devilw otherwise, though there's probably more to it than that */ - memcpy(&machine.generic.buffered_spriteram.u16[0x1800],state->m_sprite_buffer,0x800*sizeof(UINT16)); - memcpy(state->m_sprite_buffer,&machine.generic.spriteram.u16[0x1800],0x800*sizeof(UINT16)); + memcpy(&screen.machine().generic.buffered_spriteram.u16[0x1800],state->m_sprite_buffer,0x800*sizeof(UINT16)); + memcpy(state->m_sprite_buffer,&screen.machine().generic.spriteram.u16[0x1800],0x800*sizeof(UINT16)); } else { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); buffer_spriteram16_w(space,0,0,0xffff); } } diff --git a/src/mame/video/twincobr.c b/src/mame/video/twincobr.c index 9c6ea23229d..fbe94286c72 100644 --- a/src/mame/video/twincobr.c +++ b/src/mame/video/twincobr.c @@ -499,26 +499,26 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( toaplan0 ) { - twincobr_state *state = screen->machine().driver_data(); - twincobr_log_vram(screen->machine()); + twincobr_state *state = screen.machine().driver_data(); + twincobr_log_vram(screen.machine()); - if (state->m_wardner_sprite_hack) wardner_sprite_priority_hack(screen->machine()); + if (state->m_wardner_sprite_hack) wardner_sprite_priority_hack(screen.machine()); bitmap_fill(bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,TILEMAP_DRAW_OPAQUE,0); - draw_sprites(screen->machine(), bitmap,cliprect,0x0400); + draw_sprites(screen.machine(), bitmap,cliprect,0x0400); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect,0x0800); + draw_sprites(screen.machine(), bitmap,cliprect,0x0800); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect,0x0c00); + draw_sprites(screen.machine(), bitmap,cliprect,0x0c00); return 0; } SCREEN_EOF( toaplan0 ) { - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM); /* Spriteram is always 1 frame ahead, suggesting spriteram buffering. There are no CPU output registers that control this so we diff --git a/src/mame/video/tx1.c b/src/mame/video/tx1.c index 4991221e77a..f08f1828589 100644 --- a/src/mame/video/tx1.c +++ b/src/mame/video/tx1.c @@ -1126,7 +1126,7 @@ VIDEO_START( tx1 ) SCREEN_EOF( tx1 ) { - tx1_state *state = machine.driver_data(); + tx1_state *state = screen.machine().driver_data(); /* /VSYNC: Update TZ113 */ state->m_vregs.slin_val += state->m_vregs.slin_inc; } @@ -1182,32 +1182,29 @@ static void tx1_combine_layers(running_machine &machine, bitmap_t *bitmap, int s } } -SCREEN_UPDATE( tx1 ) +SCREEN_UPDATE( tx1_left ) { - tx1_state *state = screen->machine().driver_data(); - device_t *left_screen = screen->machine().device("lscreen"); - device_t *centre_screen = screen->machine().device("cscreen"); - device_t *right_screen = screen->machine().device("rscreen"); + tx1_state *state = screen.machine().driver_data(); - if (screen == left_screen) - { - memset(state->m_obj_bmp, 0, 768*240); + memset(state->m_obj_bmp, 0, 768*240); - tx1_draw_char(screen->machine(), state->m_chr_bmp); - tx1_draw_road(screen->machine(), state->m_rod_bmp); - tx1_draw_objects(screen->machine(), state->m_obj_bmp); + tx1_draw_char(screen.machine(), state->m_chr_bmp); + tx1_draw_road(screen.machine(), state->m_rod_bmp); + tx1_draw_objects(screen.machine(), state->m_obj_bmp); - tx1_combine_layers(screen->machine(), bitmap, 0); - } - else if (screen == centre_screen) - { - tx1_combine_layers(screen->machine(), bitmap, 1); - } - else if (screen == right_screen) - { - tx1_combine_layers(screen->machine(), bitmap, 2); - } + tx1_combine_layers(screen.machine(), bitmap, 0); + return 0; +} +SCREEN_UPDATE( tx1_middle ) +{ + tx1_combine_layers(screen.machine(), bitmap, 1); + return 0; +} + +SCREEN_UPDATE( tx1_right ) +{ + tx1_combine_layers(screen.machine(), bitmap, 2); return 0; } @@ -3032,7 +3029,7 @@ VIDEO_START( buggybjr ) SCREEN_EOF( buggyboy ) { - tx1_state *state = machine.driver_data(); + tx1_state *state = screen.machine().driver_data(); /* /VSYNC: Update TZ113 @ 219 */ state->m_vregs.slin_val += state->m_vregs.slin_inc; @@ -3042,46 +3039,42 @@ SCREEN_EOF( buggyboy ) } -SCREEN_UPDATE( buggyboy ) +SCREEN_UPDATE( buggyboy_left ) { - tx1_state *state = screen->machine().driver_data(); - device_t *left_screen = screen->machine().device("lscreen"); - device_t *center_screen = screen->machine().device("cscreen"); - device_t *right_screen = screen->machine().device("rscreen"); + tx1_state *state = screen.machine().driver_data(); + + memset(state->m_obj_bmp, 0, 768*240); + memset(state->m_rod_bmp, 0, 768*240); - if (screen == left_screen) - { - memset(state->m_obj_bmp, 0, 768*240); - memset(state->m_rod_bmp, 0, 768*240); - - buggyboy_draw_char(screen->machine(), state->m_chr_bmp, 1); - buggyboy_draw_road(screen->machine(), state->m_rod_bmp); - buggyboy_draw_objs(screen->machine(), state->m_obj_bmp, 1); - - bb_combine_layers(screen->machine(), bitmap, 0); - } - else if (screen == center_screen) - { - bb_combine_layers(screen->machine(), bitmap, 1); - } - else if (screen == right_screen) - { - bb_combine_layers(screen->machine(), bitmap, 2); - } + buggyboy_draw_char(screen.machine(), state->m_chr_bmp, 1); + buggyboy_draw_road(screen.machine(), state->m_rod_bmp); + buggyboy_draw_objs(screen.machine(), state->m_obj_bmp, 1); + bb_combine_layers(screen.machine(), bitmap, 0); return 0; +} +SCREEN_UPDATE( buggyboy_middle ) +{ + bb_combine_layers(screen.machine(), bitmap, 1); + return 0; +} + +SCREEN_UPDATE( buggyboy_right ) +{ + bb_combine_layers(screen.machine(), bitmap, 2); + return 0; } SCREEN_UPDATE( buggybjr ) { - tx1_state *state = screen->machine().driver_data(); + tx1_state *state = screen.machine().driver_data(); memset(state->m_obj_bmp, 0, 256*240); - buggyboy_draw_char(screen->machine(), state->m_chr_bmp, 0); - buggybjr_draw_road(screen->machine(), state->m_rod_bmp, 0); - buggyboy_draw_objs(screen->machine(), state->m_obj_bmp, 0); + buggyboy_draw_char(screen.machine(), state->m_chr_bmp, 0); + buggybjr_draw_road(screen.machine(), state->m_rod_bmp, 0); + buggyboy_draw_objs(screen.machine(), state->m_obj_bmp, 0); - bb_combine_layers(screen->machine(), bitmap, -1); + bb_combine_layers(screen.machine(), bitmap, -1); return 0; } diff --git a/src/mame/video/ultraman.c b/src/mame/video/ultraman.c index 3d2328f9163..a9eae153925 100644 --- a/src/mame/video/ultraman.c +++ b/src/mame/video/ultraman.c @@ -124,7 +124,7 @@ WRITE16_HANDLER( ultraman_gfxctrl_w ) SCREEN_UPDATE( ultraman ) { - ultraman_state *state = screen->machine().driver_data(); + ultraman_state *state = screen.machine().driver_data(); k051316_zoom_draw(state->m_k051316_3, bitmap, cliprect, 0, 0); k051316_zoom_draw(state->m_k051316_2, bitmap, cliprect, 0, 0); diff --git a/src/mame/video/ultratnk.c b/src/mame/video/ultratnk.c index 5caae7d5019..505616f595d 100644 --- a/src/mame/video/ultratnk.c +++ b/src/mame/video/ultratnk.c @@ -57,7 +57,7 @@ VIDEO_START( ultratnk ) SCREEN_UPDATE( ultratnk ) { - ultratnk_state *state = screen->machine().driver_data(); + ultratnk_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; int i; @@ -77,7 +77,7 @@ SCREEN_UPDATE( ultratnk ) if (!(attr & 0x80)) { - drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], + drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], (code >> 3) | bank, i, 0, 0, @@ -92,10 +92,10 @@ SCREEN_UPDATE( ultratnk ) SCREEN_EOF( ultratnk ) { - ultratnk_state *state = machine.driver_data(); + ultratnk_state *state = screen.machine().driver_data(); int i; - UINT16 BG = colortable_entry_get_value(machine.colortable, 0); - device_t *discrete = machine.device("discrete"); + UINT16 BG = colortable_entry_get_value(screen.machine().colortable, 0); + device_t *discrete = screen.machine().device("discrete"); UINT8 *videoram = state->m_videoram; /* check for sprite-playfield collisions */ @@ -115,17 +115,17 @@ SCREEN_EOF( ultratnk ) rect.min_x = horz - 15; rect.min_y = vert - 15; - rect.max_x = horz - 15 + machine.gfx[1]->width - 1; - rect.max_y = vert - 15 + machine.gfx[1]->height - 1; + rect.max_x = horz - 15 + screen.machine().gfx[1]->width - 1; + rect.max_y = vert - 15 + screen.machine().gfx[1]->height - 1; - sect_rect(&rect, &machine.primary_screen->visible_area()); + sect_rect(&rect, &screen.machine().primary_screen->visible_area()); tilemap_draw(state->m_helper, &rect, state->m_playfield, 0, 0); if (code & 4) bank = 32; - drawgfx_transpen(state->m_helper, &rect, machine.gfx[1], + drawgfx_transpen(state->m_helper, &rect, screen.machine().gfx[1], (code >> 3) | bank, 4, 0, 0, @@ -134,7 +134,7 @@ SCREEN_EOF( ultratnk ) for (y = rect.min_y; y <= rect.max_y; y++) for (x = rect.min_x; x <= rect.max_x; x++) - if (colortable_entry_get_value(machine.colortable, *BITMAP_ADDR16(state->m_helper, y, x)) != BG) + if (colortable_entry_get_value(screen.machine().colortable, *BITMAP_ADDR16(state->m_helper, y, x)) != BG) state->m_collision[i] = 1; } diff --git a/src/mame/video/undrfire.c b/src/mame/video/undrfire.c index a8b4d2c6e16..1a68821ce8c 100644 --- a/src/mame/video/undrfire.c +++ b/src/mame/video/undrfire.c @@ -349,44 +349,44 @@ static void draw_sprites_cbombers(running_machine &machine, bitmap_t *bitmap,con SCREEN_UPDATE( undrfire ) { - device_t *tc0100scn = screen->machine().device("tc0100scn"); - device_t *tc0480scp = screen->machine().device("tc0480scp"); + device_t *tc0100scn = screen.machine().device("tc0100scn"); + device_t *tc0480scp = screen.machine().device("tc0480scp"); UINT8 layer[5]; UINT8 pivlayer[3]; UINT16 priority; #ifdef MAME_DEBUG - undrfire_state *state = screen->machine().driver_data(); - if (screen->machine().input().code_pressed_once (KEYCODE_X)) + undrfire_state *state = screen.machine().driver_data(); + if (screen.machine().input().code_pressed_once (KEYCODE_X)) { state->m_dislayer[5] ^= 1; popmessage("piv text: %01x",state->m_dislayer[5]); } - if (screen->machine().input().code_pressed_once (KEYCODE_C)) + if (screen.machine().input().code_pressed_once (KEYCODE_C)) { state->m_dislayer[0] ^= 1; popmessage("bg0: %01x",state->m_dislayer[0]); } - if (screen->machine().input().code_pressed_once (KEYCODE_V)) + if (screen.machine().input().code_pressed_once (KEYCODE_V)) { state->m_dislayer[1] ^= 1; popmessage("bg1: %01x",state->m_dislayer[1]); } - if (screen->machine().input().code_pressed_once (KEYCODE_B)) + if (screen.machine().input().code_pressed_once (KEYCODE_B)) { state->m_dislayer[2] ^= 1; popmessage("bg2: %01x",state->m_dislayer[2]); } - if (screen->machine().input().code_pressed_once (KEYCODE_N)) + if (screen.machine().input().code_pressed_once (KEYCODE_N)) { state->m_dislayer[3] ^= 1; popmessage("bg3: %01x",state->m_dislayer[3]); } - if (screen->machine().input().code_pressed_once (KEYCODE_M)) + if (screen.machine().input().code_pressed_once (KEYCODE_M)) { state->m_dislayer[4] ^= 1; popmessage("sprites: %01x",state->m_dislayer[4]); @@ -408,7 +408,7 @@ SCREEN_UPDATE( undrfire ) pivlayer[1] = pivlayer[0] ^ 1; pivlayer[2] = 2; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); /* wrong color? */ @@ -449,12 +449,12 @@ SCREEN_UPDATE( undrfire ) if ((tc0480scp_pri_reg_r(tc0480scp, 0) & 0x3) == 3) /* on road levels kludge sprites up 1 priority */ { static const int primasks[4] = {0xfff0, 0xff00, 0x0, 0x0}; - draw_sprites(screen->machine(), bitmap, cliprect, primasks, 44, -574); + draw_sprites(screen.machine(), bitmap, cliprect, primasks, 44, -574); } else { static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0}; - draw_sprites(screen->machine(), bitmap, cliprect, primasks, 44, -574); + draw_sprites(screen.machine(), bitmap, cliprect, primasks, 44, -574); } } @@ -468,7 +468,7 @@ SCREEN_UPDATE( undrfire ) /* See if we should draw artificial gun targets */ /* (not yet implemented...) */ - if (input_port_read(screen->machine(), "FAKE") & 0x1) /* Fake DSW */ + if (input_port_read(screen.machine(), "FAKE") & 0x1) /* Fake DSW */ { popmessage("Gunsights on"); } @@ -492,44 +492,44 @@ SCREEN_UPDATE( undrfire ) SCREEN_UPDATE( cbombers ) { - device_t *tc0100scn = screen->machine().device("tc0100scn"); - device_t *tc0480scp = screen->machine().device("tc0480scp"); + device_t *tc0100scn = screen.machine().device("tc0100scn"); + device_t *tc0480scp = screen.machine().device("tc0480scp"); UINT8 layer[5]; UINT8 pivlayer[3]; UINT16 priority; #ifdef MAME_DEBUG - undrfire_state *state = screen->machine().driver_data(); - if (screen->machine().input().code_pressed_once (KEYCODE_X)) + undrfire_state *state = screen.machine().driver_data(); + if (screen.machine().input().code_pressed_once (KEYCODE_X)) { state->m_dislayer[5] ^= 1; popmessage("piv text: %01x",state->m_dislayer[5]); } - if (screen->machine().input().code_pressed_once (KEYCODE_C)) + if (screen.machine().input().code_pressed_once (KEYCODE_C)) { state->m_dislayer[0] ^= 1; popmessage("bg0: %01x",state->m_dislayer[0]); } - if (screen->machine().input().code_pressed_once (KEYCODE_V)) + if (screen.machine().input().code_pressed_once (KEYCODE_V)) { state->m_dislayer[1] ^= 1; popmessage("bg1: %01x",state->m_dislayer[1]); } - if (screen->machine().input().code_pressed_once (KEYCODE_B)) + if (screen.machine().input().code_pressed_once (KEYCODE_B)) { state->m_dislayer[2] ^= 1; popmessage("bg2: %01x",state->m_dislayer[2]); } - if (screen->machine().input().code_pressed_once (KEYCODE_N)) + if (screen.machine().input().code_pressed_once (KEYCODE_N)) { state->m_dislayer[3] ^= 1; popmessage("bg3: %01x",state->m_dislayer[3]); } - if (screen->machine().input().code_pressed_once (KEYCODE_M)) + if (screen.machine().input().code_pressed_once (KEYCODE_M)) { state->m_dislayer[4] ^= 1; popmessage("sprites: %01x",state->m_dislayer[4]); @@ -551,7 +551,7 @@ SCREEN_UPDATE( cbombers ) pivlayer[1] = pivlayer[0] ^ 1; pivlayer[2] = 2; - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); bitmap_fill(bitmap, cliprect, 0); /* wrong color? */ @@ -592,12 +592,12 @@ SCREEN_UPDATE( cbombers ) if ((tc0480scp_pri_reg_r(tc0480scp, 0) & 0x3) == 3) /* on road levels kludge sprites up 1 priority */ { static const int primasks[4] = {0xfff0, 0xff00, 0x0, 0x0}; - draw_sprites_cbombers(screen->machine(), bitmap, cliprect, primasks, 80, -208); + draw_sprites_cbombers(screen.machine(), bitmap, cliprect, primasks, 80, -208); } else { static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0}; - draw_sprites_cbombers(screen->machine(), bitmap, cliprect, primasks, 80, -208); + draw_sprites_cbombers(screen.machine(), bitmap, cliprect, primasks, 80, -208); } } diff --git a/src/mame/video/unico.c b/src/mame/video/unico.c index aa28b20f83d..9df5982bea8 100644 --- a/src/mame/video/unico.c +++ b/src/mame/video/unico.c @@ -343,7 +343,7 @@ static void zeropnt2_draw_sprites(running_machine &machine, bitmap_t *bitmap,con SCREEN_UPDATE( unico ) { - unico_state *state = screen->machine().driver_data(); + unico_state *state = screen.machine().driver_data(); int layers_ctrl = -1; tilemap_set_scrollx(state->m_tilemap[0], 0, state->m_scroll[0x00]); @@ -356,34 +356,34 @@ SCREEN_UPDATE( unico ) tilemap_set_scrolly(state->m_tilemap[2], 0, state->m_scroll[0x02]); #ifdef MAME_DEBUG -if ( screen->machine().input().code_pressed(KEYCODE_Z) || screen->machine().input().code_pressed(KEYCODE_X) ) +if ( screen.machine().input().code_pressed(KEYCODE_Z) || screen.machine().input().code_pressed(KEYCODE_X) ) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= 2; - if (screen->machine().input().code_pressed(KEYCODE_E)) msk |= 4; - if (screen->machine().input().code_pressed(KEYCODE_A)) msk |= 8; + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (screen.machine().input().code_pressed(KEYCODE_E)) msk |= 4; + if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= 8; if (msk != 0) layers_ctrl &= msk; } #endif /* The background color is the first of the last palette */ bitmap_fill(bitmap,cliprect,0x1f00); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect,state->m_tilemap[0],0,1); if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect,state->m_tilemap[1],0,2); if (layers_ctrl & 4) tilemap_draw(bitmap,cliprect,state->m_tilemap[2],0,4); /* Sprites are drawn last, using pdrawgfx */ - if (layers_ctrl & 8) unico_draw_sprites(screen->machine(), bitmap,cliprect); + if (layers_ctrl & 8) unico_draw_sprites(screen.machine(), bitmap,cliprect); return 0; } SCREEN_UPDATE( zeropnt2 ) { - unico_state *state = screen->machine().driver_data(); + unico_state *state = screen.machine().driver_data(); int layers_ctrl = -1; tilemap_set_scrollx(state->m_tilemap[0], 0, state->m_scroll32[0] >> 16); @@ -396,27 +396,27 @@ SCREEN_UPDATE( zeropnt2 ) tilemap_set_scrolly(state->m_tilemap[2], 0, state->m_scroll32[1] >> 16); #ifdef MAME_DEBUG -if ( screen->machine().input().code_pressed(KEYCODE_Z) || screen->machine().input().code_pressed(KEYCODE_X) ) +if ( screen.machine().input().code_pressed(KEYCODE_Z) || screen.machine().input().code_pressed(KEYCODE_X) ) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= 2; - if (screen->machine().input().code_pressed(KEYCODE_E)) msk |= 4; - if (screen->machine().input().code_pressed(KEYCODE_A)) msk |= 8; + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (screen.machine().input().code_pressed(KEYCODE_E)) msk |= 4; + if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= 8; if (msk != 0) layers_ctrl &= msk; } #endif /* The background color is the first of the last palette */ bitmap_fill(bitmap,cliprect,0x1f00); - bitmap_fill(screen->machine().priority_bitmap,cliprect,0); + bitmap_fill(screen.machine().priority_bitmap,cliprect,0); if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect,state->m_tilemap[0],0,1); if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect,state->m_tilemap[1],0,2); if (layers_ctrl & 4) tilemap_draw(bitmap,cliprect,state->m_tilemap[2],0,4); /* Sprites are drawn last, using pdrawgfx */ - if (layers_ctrl & 8) zeropnt2_draw_sprites(screen->machine(), bitmap,cliprect); + if (layers_ctrl & 8) zeropnt2_draw_sprites(screen.machine(), bitmap,cliprect); return 0; } diff --git a/src/mame/video/usgames.c b/src/mame/video/usgames.c index 15f793c99e0..be057d62fab 100644 --- a/src/mame/video/usgames.c +++ b/src/mame/video/usgames.c @@ -67,7 +67,7 @@ WRITE8_HANDLER( usgames_charram_w ) SCREEN_UPDATE(usgames) { - usgames_state *state = screen->machine().driver_data(); + usgames_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_tilemap,0,0); return 0; } diff --git a/src/mame/video/vaportra.c b/src/mame/video/vaportra.c index 67123aa94ac..d2ecb72d8a7 100644 --- a/src/mame/video/vaportra.c +++ b/src/mame/video/vaportra.c @@ -52,47 +52,47 @@ WRITE16_HANDLER( vaportra_palette_24bit_b_w ) SCREEN_UPDATE( vaportra ) { - vaportra_state *state = screen->machine().driver_data(); + vaportra_state *state = screen.machine().driver_data(); UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); int pri = state->m_priority[0] & 0x03; - flip_screen_set(screen->machine(), !BIT(flip, 7)); + flip_screen_set(screen.machine(), !BIT(flip, 7)); deco16ic_pf_update(state->m_deco_tilegen1, 0, 0); deco16ic_pf_update(state->m_deco_tilegen2, 0, 0); - screen->machine().device("spritegen")->set_pri_type(1); // force priorities to be handled in a different way for this driver for now + screen.machine().device("spritegen")->set_pri_type(1); // force priorities to be handled in a different way for this driver for now /* Draw playfields */ if (pri == 0) { deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 0); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0, state->m_priority[1], 0x0f); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u16, 0, state->m_priority[1], 0x0f); deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); } else if (pri == 1) { deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 0); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0, state->m_priority[1], 0x0f); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u16, 0, state->m_priority[1], 0x0f); deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); } else if (pri == 2) { deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0, state->m_priority[1], 0x0f); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u16, 0, state->m_priority[1], 0x0f); deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 0); } else { deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0, state->m_priority[1], 0x0f); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u16, 0, state->m_priority[1], 0x0f); deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 0); } - screen->machine().device("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 1, state->m_priority[1], 0x0f); + screen.machine().device("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u16, 1, state->m_priority[1], 0x0f); deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); return 0; } diff --git a/src/mame/video/vastar.c b/src/mame/video/vastar.c index 80350234e3b..9b04165edc0 100644 --- a/src/mame/video/vastar.c +++ b/src/mame/video/vastar.c @@ -198,7 +198,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( vastar ) { - vastar_state *state = screen->machine().driver_data(); + vastar_state *state = screen.machine().driver_data(); int i; @@ -212,14 +212,14 @@ SCREEN_UPDATE( vastar ) { case 0: tilemap_draw(bitmap,cliprect, state->m_bg1_tilemap, TILEMAP_DRAW_OPAQUE,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect, state->m_bg2_tilemap, 0,0); tilemap_draw(bitmap,cliprect, state->m_fg_tilemap, 0,0); break; case 2: tilemap_draw(bitmap,cliprect, state->m_bg1_tilemap, TILEMAP_DRAW_OPAQUE,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect, state->m_bg1_tilemap, 0,0); tilemap_draw(bitmap,cliprect, state->m_bg2_tilemap, 0,0); tilemap_draw(bitmap,cliprect, state->m_fg_tilemap, 0,0); @@ -229,7 +229,7 @@ SCREEN_UPDATE( vastar ) tilemap_draw(bitmap,cliprect, state->m_bg1_tilemap, TILEMAP_DRAW_OPAQUE,0); tilemap_draw(bitmap,cliprect, state->m_bg2_tilemap, 0,0); tilemap_draw(bitmap,cliprect, state->m_fg_tilemap, 0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); break; default: diff --git a/src/mame/video/vball.c b/src/mame/video/vball.c index 9e485cb66a1..01cd2908454 100644 --- a/src/mame/video/vball.c +++ b/src/mame/video/vball.c @@ -163,7 +163,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( vb ) { - vball_state *state = screen->machine().driver_data(); + vball_state *state = screen.machine().driver_data(); int i; tilemap_set_scrolly(state->m_bg_tilemap,0,state->m_vb_scrolly_hi + *state->m_vb_scrolly_lo); @@ -174,6 +174,6 @@ SCREEN_UPDATE( vb ) //logerror("scrollx[%d] = %d\n",i,state->m_vb_scrollx[i]); } tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); return 0; } diff --git a/src/mame/video/vectrex.c b/src/mame/video/vectrex.c index 4630ad72c97..968ac72d99b 100644 --- a/src/mame/video/vectrex.c +++ b/src/mame/video/vectrex.c @@ -161,13 +161,13 @@ static TIMER_CALLBACK(vectrex_refresh) SCREEN_UPDATE(vectrex) { - vectrex_state *state = screen->machine().driver_data(); + vectrex_state *state = screen.machine().driver_data(); int i; - vectrex_configuration(screen->machine()); + vectrex_configuration(screen.machine()); /* start black */ - vector_add_point(screen->machine(), + vector_add_point(screen.machine(), state->m_points[state->m_display_start].x, state->m_points[state->m_display_start].y, state->m_points[state->m_display_start].col, @@ -175,7 +175,7 @@ SCREEN_UPDATE(vectrex) for (i = state->m_display_start; i != state->m_display_end; i = (i + 1) % NVECT) { - vector_add_point(screen->machine(), + vector_add_point(screen.machine(), state->m_points[i].x, state->m_points[i].y, state->m_points[i].col, diff --git a/src/mame/video/vendetta.c b/src/mame/video/vendetta.c index 7ea9b902c95..ea56d70d91d 100644 --- a/src/mame/video/vendetta.c +++ b/src/mame/video/vendetta.c @@ -54,7 +54,7 @@ void vendetta_sprite_callback( running_machine &machine, int *code, int *color, SCREEN_UPDATE( vendetta ) { - vendetta_state *state = screen->machine().driver_data(); + vendetta_state *state = screen.machine().driver_data(); int layer[3]; state->m_sprite_colorbase = k053251_get_palette_index(state->m_k053251, K053251_CI1); @@ -73,7 +73,7 @@ SCREEN_UPDATE( vendetta ) konami_sortlayers3(layer, state->m_layerpri); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[1], 0, 2); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[2], 0, 4); diff --git a/src/mame/video/vicdual.c b/src/mame/video/vicdual.c index c6d621510f8..78f29bc4543 100644 --- a/src/mame/video/vicdual.c +++ b/src/mame/video/vicdual.c @@ -31,7 +31,7 @@ WRITE8_HANDLER( vicdual_palette_bank_w ) SCREEN_UPDATE( vicdual_bw ) { - vicdual_state *state = screen->machine().driver_data(); + vicdual_state *state = screen.machine().driver_data(); UINT8 x = 0; UINT8 y = cliprect->min_y; UINT8 video_data = 0; @@ -82,8 +82,8 @@ SCREEN_UPDATE( vicdual_bw ) SCREEN_UPDATE( vicdual_color ) { - vicdual_state *state = screen->machine().driver_data(); - UINT8 *color_prom = (UINT8 *)screen->machine().region("proms")->base(); + vicdual_state *state = screen.machine().driver_data(); + UINT8 *color_prom = (UINT8 *)screen.machine().region("proms")->base(); UINT8 x = 0; UINT8 y = cliprect->min_y; UINT8 video_data = 0; @@ -141,7 +141,7 @@ SCREEN_UPDATE( vicdual_color ) SCREEN_UPDATE( vicdual_bw_or_color ) { - if (vicdual_is_cabinet_color(screen->machine())) + if (vicdual_is_cabinet_color(screen.machine())) SCREEN_UPDATE_CALL(vicdual_color); else SCREEN_UPDATE_CALL(vicdual_bw); diff --git a/src/mame/video/victory.c b/src/mame/video/victory.c index 8573b8276a4..e5e11f3dba1 100644 --- a/src/mame/video/victory.c +++ b/src/mame/video/victory.c @@ -1092,17 +1092,17 @@ static TIMER_CALLBACK( bgcoll_irq_callback ) SCREEN_UPDATE( victory ) { - victory_state *state = screen->machine().driver_data(); + victory_state *state = screen.machine().driver_data(); int bgcollmask = (state->m_video_control & 4) ? 4 : 7; int count = 0; int x, y; /* copy the palette from palette RAM */ - set_palette(screen->machine()); + set_palette(screen.machine()); /* update the foreground & background */ - update_foreground(screen->machine()); - update_background(screen->machine()); + update_foreground(screen.machine()); + update_background(screen.machine()); /* blend the bitmaps and do collision detection */ for (y = 0; y < 256; y++) @@ -1119,7 +1119,7 @@ SCREEN_UPDATE( victory ) int bpix = bg[(x + state->m_scrollx) & 255]; scanline[x] = bpix | (fpix << 3); if (fpix && (bpix & bgcollmask) && count++ < 128) - screen->machine().scheduler().timer_set(screen->time_until_pos(y, x), FUNC(bgcoll_irq_callback), x | (y << 8)); + screen.machine().scheduler().timer_set(screen.time_until_pos(y, x), FUNC(bgcoll_irq_callback), x | (y << 8)); } } diff --git a/src/mame/video/videopin.c b/src/mame/video/videopin.c index 8b0774e1c09..c0cad5af595 100644 --- a/src/mame/video/videopin.c +++ b/src/mame/video/videopin.c @@ -35,7 +35,7 @@ VIDEO_START( videopin ) SCREEN_UPDATE( videopin ) { - videopin_state *state = screen->machine().driver_data(); + videopin_state *state = screen.machine().driver_data(); int col; int row; @@ -84,7 +84,7 @@ SCREEN_UPDATE( videopin ) { for (j = 0; j < 2; j++) { - drawgfx_transpen(bitmap, &rect, screen->machine().gfx[1], + drawgfx_transpen(bitmap, &rect, screen.machine().gfx[1], 0, 0, 0, 0, x + 16 * i, diff --git a/src/mame/video/vigilant.c b/src/mame/video/vigilant.c index 21d2d67ba35..243da23dd21 100644 --- a/src/mame/video/vigilant.c +++ b/src/mame/video/vigilant.c @@ -276,7 +276,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( kikcubic ) { - vigilant_state *state = screen->machine().driver_data(); + vigilant_state *state = screen.machine().driver_data(); UINT8 *videoram = state->m_videoram; int offs; @@ -288,20 +288,20 @@ SCREEN_UPDATE( kikcubic ) int color = (attributes & 0xF0) >> 4; int tile_number = videoram[offs] | ((attributes & 0x0F) << 8); - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0], tile_number, color, 0,0, sx,sy); } - draw_sprites(screen->machine(),bitmap,cliprect); + draw_sprites(screen.machine(),bitmap,cliprect); return 0; } SCREEN_UPDATE( vigilant ) { - vigilant_state *state = screen->machine().driver_data(); + vigilant_state *state = screen.machine().driver_data(); int i; /* copy the background palette */ @@ -310,31 +310,31 @@ SCREEN_UPDATE( vigilant ) int r,g,b; - r = (screen->machine().generic.paletteram.u8[0x400 + 16 * state->m_rear_color + i] << 3) & 0xFF; - g = (screen->machine().generic.paletteram.u8[0x500 + 16 * state->m_rear_color + i] << 3) & 0xFF; - b = (screen->machine().generic.paletteram.u8[0x600 + 16 * state->m_rear_color + i] << 3) & 0xFF; + r = (screen.machine().generic.paletteram.u8[0x400 + 16 * state->m_rear_color + i] << 3) & 0xFF; + g = (screen.machine().generic.paletteram.u8[0x500 + 16 * state->m_rear_color + i] << 3) & 0xFF; + b = (screen.machine().generic.paletteram.u8[0x600 + 16 * state->m_rear_color + i] << 3) & 0xFF; - palette_set_color(screen->machine(),512 + i,MAKE_RGB(r,g,b)); + palette_set_color(screen.machine(),512 + i,MAKE_RGB(r,g,b)); - r = (screen->machine().generic.paletteram.u8[0x400 + 16 * state->m_rear_color + 32 + i] << 3) & 0xFF; - g = (screen->machine().generic.paletteram.u8[0x500 + 16 * state->m_rear_color + 32 + i] << 3) & 0xFF; - b = (screen->machine().generic.paletteram.u8[0x600 + 16 * state->m_rear_color + 32 + i] << 3) & 0xFF; + r = (screen.machine().generic.paletteram.u8[0x400 + 16 * state->m_rear_color + 32 + i] << 3) & 0xFF; + g = (screen.machine().generic.paletteram.u8[0x500 + 16 * state->m_rear_color + 32 + i] << 3) & 0xFF; + b = (screen.machine().generic.paletteram.u8[0x600 + 16 * state->m_rear_color + 32 + i] << 3) & 0xFF; - palette_set_color(screen->machine(),512 + 16 + i,MAKE_RGB(r,g,b)); + palette_set_color(screen.machine(),512 + 16 + i,MAKE_RGB(r,g,b)); } if (state->m_rear_disable) /* opaque foreground */ { - draw_foreground(screen->machine(),bitmap,cliprect,0,1); - draw_sprites(screen->machine(),bitmap,&bottomvisiblearea); - draw_foreground(screen->machine(),bitmap,cliprect,1,0); + draw_foreground(screen.machine(),bitmap,cliprect,0,1); + draw_sprites(screen.machine(),bitmap,&bottomvisiblearea); + draw_foreground(screen.machine(),bitmap,cliprect,1,0); } else { - draw_background(screen->machine(),bitmap,cliprect); - draw_foreground(screen->machine(),bitmap,cliprect,0,0); - draw_sprites(screen->machine(),bitmap,&bottomvisiblearea); - draw_foreground(screen->machine(),bitmap,cliprect,1,0); // priority tiles + draw_background(screen.machine(),bitmap,cliprect); + draw_foreground(screen.machine(),bitmap,cliprect,0,0); + draw_sprites(screen.machine(),bitmap,&bottomvisiblearea); + draw_foreground(screen.machine(),bitmap,cliprect,1,0); // priority tiles } return 0; } diff --git a/src/mame/video/vindictr.c b/src/mame/video/vindictr.c index eb5d75b6ab7..c24c640b0da 100644 --- a/src/mame/video/vindictr.c +++ b/src/mame/video/vindictr.c @@ -220,7 +220,7 @@ void vindictr_scanline_update(screen_device &screen, int scanline) SCREEN_UPDATE( vindictr ) { - vindictr_state *state = screen->machine().driver_data(); + vindictr_state *state = screen.machine().driver_data(); atarimo_rect_list rectlist; bitmap_t *mobitmap; int x, y, r; diff --git a/src/mame/video/volfied.c b/src/mame/video/volfied.c index d1b9ae137a7..2157b3e0044 100644 --- a/src/mame/video/volfied.c +++ b/src/mame/video/volfied.c @@ -130,10 +130,10 @@ static void refresh_pixel_layer( running_machine &machine, bitmap_t *bitmap ) SCREEN_UPDATE( volfied ) { - volfied_state *state = screen->machine().driver_data(); + volfied_state *state = screen.machine().driver_data(); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); - refresh_pixel_layer(screen->machine(), bitmap); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); + refresh_pixel_layer(screen.machine(), bitmap); pc090oj_draw_sprites(state->m_pc090oj, bitmap, cliprect, 0); return 0; } diff --git a/src/mame/video/vsnes.c b/src/mame/video/vsnes.c index 6bfbd86a64c..408bd622846 100644 --- a/src/mame/video/vsnes.c +++ b/src/mame/video/vsnes.c @@ -58,13 +58,13 @@ VIDEO_START( vsdual ) SCREEN_UPDATE( vsnes ) { /* render the ppu */ - ppu2c0x_render( screen->machine().device("ppu1"), bitmap, 0, 0, 0, 0 ); + ppu2c0x_render( screen.machine().device("ppu1"), bitmap, 0, 0, 0, 0 ); return 0; } SCREEN_UPDATE( vsnes_bottom ) { - ppu2c0x_render(screen->machine().device("ppu2"), bitmap, 0, 0, 0, 0); + ppu2c0x_render(screen.machine().device("ppu2"), bitmap, 0, 0, 0, 0); return 0; } diff --git a/src/mame/video/vulgus.c b/src/mame/video/vulgus.c index c121b50c780..e928c89beab 100644 --- a/src/mame/video/vulgus.c +++ b/src/mame/video/vulgus.c @@ -219,12 +219,12 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( vulgus ) { - vulgus_state *state = screen->machine().driver_data(); + vulgus_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_scroll_low[1] + 256 * state->m_scroll_high[1]); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_scroll_low[0] + 256 * state->m_scroll_high[0]); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); return 0; } diff --git a/src/mame/video/warpwarp.c b/src/mame/video/warpwarp.c index 86ab56d3375..c56463235ed 100644 --- a/src/mame/video/warpwarp.c +++ b/src/mame/video/warpwarp.c @@ -245,9 +245,9 @@ static void draw_ball(running_machine &machine, bitmap_t *bitmap, const rectangl SCREEN_UPDATE( geebee ) { - warpwarp_state *state = screen->machine().driver_data(); + warpwarp_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - draw_ball(screen->machine(), bitmap, cliprect, state->m_ball_pen); + draw_ball(screen.machine(), bitmap, cliprect, state->m_ball_pen); return 0; } diff --git a/src/mame/video/warriorb.c b/src/mame/video/warriorb.c index da74e59b5d7..3b48ad3be9e 100644 --- a/src/mame/video/warriorb.c +++ b/src/mame/video/warriorb.c @@ -84,23 +84,9 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN REFRESH **************************************************************/ -SCREEN_UPDATE( warriorb ) +static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int xoffs, device_t *tc0100scn) { - warriorb_state *state = screen->machine().driver_data(); - int xoffs = 0; UINT8 layer[3], nodraw; - device_t *tc0100scn = NULL; - - if (screen == state->m_lscreen) - { - xoffs = 40 * 8 * 0; - tc0100scn = state->m_tc0100scn_1; - } - else if (screen == state->m_rscreen) - { - xoffs = 40 * 8 * 1; - tc0100scn = state->m_tc0100scn_2; - } tc0100scn_tilemap_update(tc0100scn); @@ -109,7 +95,7 @@ SCREEN_UPDATE( warriorb ) layer[2] = 2; /* Clear priority bitmap */ - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); /* chip 0 does tilemaps on the left, chip 1 does the ones on the right */ // draw bottom layer @@ -117,15 +103,18 @@ SCREEN_UPDATE( warriorb ) /* Ensure screen blanked even when bottom layers not drawn due to disable bit */ if (nodraw) - bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); + bitmap_fill(bitmap, cliprect, get_black_pen(screen.machine())); // draw middle layer tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[1], 0, 1); /* Sprites can be under/over the layer below text layer */ - draw_sprites(screen->machine(), bitmap, cliprect, xoffs, 8); // draw sprites + draw_sprites(screen.machine(), bitmap, cliprect, xoffs, 8); // draw sprites // draw top(text) layer tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[2], 0, 0); return 0; } + +SCREEN_UPDATE( warriorb_left ) { return update_screen(screen, bitmap, cliprect, 40 * 8 * 0, screen.machine().driver_data()->m_tc0100scn_1); } +SCREEN_UPDATE( warriorb_right ) { return update_screen(screen, bitmap, cliprect, 40 * 8 * 1, screen.machine().driver_data()->m_tc0100scn_2); } diff --git a/src/mame/video/wc90.c b/src/mame/video/wc90.c index ea1a53c66ad..c66e9cc8fe9 100644 --- a/src/mame/video/wc90.c +++ b/src/mame/video/wc90.c @@ -347,7 +347,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( wc90 ) { - wc90_state *state = screen->machine().driver_data(); + wc90_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap,0,state->m_scroll2xlo[0] + 256 * state->m_scroll2xhi[0]); tilemap_set_scrolly(state->m_bg_tilemap,0,state->m_scroll2ylo[0] + 256 * state->m_scroll2yhi[0]); tilemap_set_scrollx(state->m_fg_tilemap,0,state->m_scroll1xlo[0] + 256 * state->m_scroll1xhi[0]); @@ -355,12 +355,12 @@ SCREEN_UPDATE( wc90 ) tilemap_set_scrollx(state->m_tx_tilemap,0,state->m_scroll0xlo[0] + 256 * state->m_scroll0xhi[0]); tilemap_set_scrolly(state->m_tx_tilemap,0,state->m_scroll0ylo[0] + 256 * state->m_scroll0yhi[0]); -// draw_sprites(screen->machine(), bitmap,cliprect, 3 ); +// draw_sprites(screen.machine(), bitmap,cliprect, 3 ); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect, 2 ); + draw_sprites(screen.machine(), bitmap,cliprect, 2 ); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect, 1 ); + draw_sprites(screen.machine(), bitmap,cliprect, 1 ); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect, 0 ); + draw_sprites(screen.machine(), bitmap,cliprect, 0 ); return 0; } diff --git a/src/mame/video/wc90b.c b/src/mame/video/wc90b.c index 064a0890cc8..42c6d8148cd 100644 --- a/src/mame/video/wc90b.c +++ b/src/mame/video/wc90b.c @@ -134,7 +134,7 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( wc90b ) { - wc90b_state *state = screen->machine().driver_data(); + wc90b_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_bg_tilemap,0,8 * (state->m_scroll2x[0] & 0x7f) + 256 - 4 + (state->m_scroll_x_lo[0] & 0x07)); tilemap_set_scrolly(state->m_bg_tilemap,0,state->m_scroll2y[0] + 1 + ((state->m_scroll2x[0] & 0x80) ? 256 : 0)); tilemap_set_scrollx(state->m_fg_tilemap,0,8 * (state->m_scroll1x[0] & 0x7f) + 256 - 6 + ((state->m_scroll_x_lo[0] & 0x38) >> 3)); @@ -142,8 +142,8 @@ SCREEN_UPDATE( wc90b ) tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect, 1 ); + draw_sprites(screen.machine(), bitmap,cliprect, 1 ); tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect, 0 ); + draw_sprites(screen.machine(), bitmap,cliprect, 0 ); return 0; } diff --git a/src/mame/video/wecleman.c b/src/mame/video/wecleman.c index 21007bcee9c..f44b41b5b45 100644 --- a/src/mame/video/wecleman.c +++ b/src/mame/video/wecleman.c @@ -1024,18 +1024,18 @@ VIDEO_START( hotchase ) SCREEN_UPDATE( wecleman ) { - wecleman_state *state = screen->machine().driver_data(); + wecleman_state *state = screen.machine().driver_data(); const pen_t *mrct; int video_on; int fg_x, bg_x, fg_y, bg_y; int cloud_sx, cloud_sy; int i, j, k; - mrct = screen->machine().pens; + mrct = screen.machine().pens; video_on = state->m_irqctrl & 0x40; - set_led_status(screen->machine(), 0, state->m_selected_ip & 0x04); // Start lamp + set_led_status(screen.machine(), 0, state->m_selected_ip & 0x04); // Start lamp fg_y = (state->m_txtram[0x0f24>>1] & (TILEMAP_DIMY - 1)); bg_y = (state->m_txtram[0x0f26>>1] & (TILEMAP_DIMY - 1)); @@ -1063,12 +1063,12 @@ SCREEN_UPDATE( wecleman ) /* palette hacks! */ ((pen_t *)mrct)[0x27] = mrct[0x24]; - get_sprite_info(screen->machine()); + get_sprite_info(screen.machine()); bitmap_fill(bitmap, cliprect, state->m_black_pen); /* Draw the road (lines which have priority 0x02) */ - if (video_on) wecleman_draw_road(screen->machine(), bitmap, cliprect, 0x02); + if (video_on) wecleman_draw_road(screen.machine(), bitmap, cliprect, 0x02); /* Draw the background */ if (video_on) tilemap_draw(bitmap,cliprect, state->m_bg_tilemap, 0, 0); @@ -1082,7 +1082,7 @@ SCREEN_UPDATE( wecleman ) if (video_on) draw_cloud( bitmap, - screen->machine().gfx[0], + screen.machine().gfx[0], state->m_pageram+0x1800, BMP_PAD, BMP_PAD, 41, 20, @@ -1102,10 +1102,10 @@ SCREEN_UPDATE( wecleman ) if (video_on) tilemap_draw(bitmap,cliprect, state->m_fg_tilemap, 0, 0); /* Draw the road (lines which have priority 0x04) */ - if (video_on) wecleman_draw_road(screen->machine(), bitmap,cliprect, 0x04); + if (video_on) wecleman_draw_road(screen.machine(), bitmap,cliprect, 0x04); /* Draw the sprites */ - if (video_on) sprite_draw(screen->machine(), bitmap,cliprect); + if (video_on) sprite_draw(screen.machine(), bitmap,cliprect); /* Draw the text layer */ if (video_on) tilemap_draw(bitmap,cliprect, state->m_txt_tilemap, 0, 0); @@ -1118,16 +1118,16 @@ SCREEN_UPDATE( wecleman ) SCREEN_UPDATE( hotchase ) { - wecleman_state *state = screen->machine().driver_data(); - device_t *k051316_1 = screen->machine().device("k051316_1"); - device_t *k051316_2 = screen->machine().device("k051316_2"); + wecleman_state *state = screen.machine().driver_data(); + device_t *k051316_1 = screen.machine().device("k051316_1"); + device_t *k051316_2 = screen.machine().device("k051316_2"); int video_on; video_on = state->m_irqctrl & 0x40; - set_led_status(screen->machine(), 0, state->m_selected_ip & 0x04); // Start lamp + set_led_status(screen.machine(), 0, state->m_selected_ip & 0x04); // Start lamp - get_sprite_info(screen->machine()); + get_sprite_info(screen.machine()); bitmap_fill(bitmap, cliprect, state->m_black_pen); @@ -1137,11 +1137,11 @@ SCREEN_UPDATE( hotchase ) /* Draw the road */ if (video_on) - hotchase_draw_road(screen->machine(), bitmap, cliprect); + hotchase_draw_road(screen.machine(), bitmap, cliprect); /* Draw the sprites */ if (video_on) - sprite_draw(screen->machine(), bitmap,cliprect); + sprite_draw(screen.machine(), bitmap,cliprect); /* Draw the foreground (text) */ if (video_on) diff --git a/src/mame/video/welltris.c b/src/mame/video/welltris.c index 640eb773ffd..c8387709c94 100644 --- a/src/mame/video/welltris.c +++ b/src/mame/video/welltris.c @@ -242,12 +242,12 @@ static void draw_background(running_machine &machine, bitmap_t *bitmap, const re SCREEN_UPDATE( welltris ) { - welltris_state *state = screen->machine().driver_data(); + welltris_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_char_tilemap, 0, state->m_scrollx); tilemap_set_scrolly(state->m_char_tilemap, 0, state->m_scrolly); - draw_background(screen->machine(), bitmap, cliprect); + draw_background(screen.machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->m_char_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/wgp.c b/src/mame/video/wgp.c index e532e9dda1f..6bbe06acf62 100644 --- a/src/mame/video/wgp.c +++ b/src/mame/video/wgp.c @@ -645,30 +645,30 @@ static void wgp_piv_layer_draw( running_machine &machine, bitmap_t *bitmap, cons SCREEN_UPDATE( wgp ) { - wgp_state *state = screen->machine().driver_data(); + wgp_state *state = screen.machine().driver_data(); int i; UINT8 layer[3]; #ifdef MAME_DEBUG - if (screen->machine().input().code_pressed_once (KEYCODE_V)) + if (screen.machine().input().code_pressed_once (KEYCODE_V)) { state->m_dislayer[0] ^= 1; popmessage("piv0: %01x",state->m_dislayer[0]); } - if (screen->machine().input().code_pressed_once (KEYCODE_B)) + if (screen.machine().input().code_pressed_once (KEYCODE_B)) { state->m_dislayer[1] ^= 1; popmessage("piv1: %01x",state->m_dislayer[1]); } - if (screen->machine().input().code_pressed_once (KEYCODE_N)) + if (screen.machine().input().code_pressed_once (KEYCODE_N)) { state->m_dislayer[2] ^= 1; popmessage("piv2: %01x",state->m_dislayer[2]); } - if (screen->machine().input().code_pressed_once (KEYCODE_M)) + if (screen.machine().input().code_pressed_once (KEYCODE_M)) { state->m_dislayer[3] ^= 1; popmessage("TC0100SCN top bg layer: %01x",state->m_dislayer[3]); @@ -700,19 +700,19 @@ SCREEN_UPDATE( wgp ) #ifdef MAME_DEBUG if (state->m_dislayer[layer[0]] == 0) #endif - wgp_piv_layer_draw(screen->machine(), bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); + wgp_piv_layer_draw(screen.machine(), bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); #ifdef MAME_DEBUG if (state->m_dislayer[layer[1]] == 0) #endif - wgp_piv_layer_draw(screen->machine(), bitmap, cliprect, layer[1], 0, 2); + wgp_piv_layer_draw(screen.machine(), bitmap, cliprect, layer[1], 0, 2); #ifdef MAME_DEBUG if (state->m_dislayer[layer[2]] == 0) #endif - wgp_piv_layer_draw(screen->machine(), bitmap, cliprect, layer[2], 0, 4); + wgp_piv_layer_draw(screen.machine(), bitmap, cliprect, layer[2], 0, 4); - draw_sprites(screen->machine(), bitmap, cliprect, 16); + draw_sprites(screen.machine(), bitmap, cliprect, 16); /* ... then here we should apply rotation from wgp_sate_ctrl[] to the bitmap before we draw the TC0100SCN layers on it */ layer[0] = tc0100scn_bottomlayer(state->m_tc0100scn); diff --git a/src/mame/video/williams.c b/src/mame/video/williams.c index bc9f22e8c64..6bccb12502b 100644 --- a/src/mame/video/williams.c +++ b/src/mame/video/williams.c @@ -174,13 +174,13 @@ VIDEO_START( williams2 ) SCREEN_UPDATE( williams ) { - williams_state *state = screen->machine().driver_data(); + williams_state *state = screen.machine().driver_data(); rgb_t pens[16]; int x, y; /* precompute the palette */ for (x = 0; x < 16; x++) - pens[x] = state->m_palette_lookup[screen->machine().generic.paletteram.u8[x]]; + pens[x] = state->m_palette_lookup[screen.machine().generic.paletteram.u8[x]]; /* loop over rows */ for (y = cliprect->min_y; y <= cliprect->max_y; y++) @@ -202,16 +202,16 @@ SCREEN_UPDATE( williams ) SCREEN_UPDATE( blaster ) { - williams_state *state = screen->machine().driver_data(); + williams_state *state = screen.machine().driver_data(); rgb_t pens[16]; int x, y; /* precompute the palette */ for (x = 0; x < 16; x++) - pens[x] = state->m_palette_lookup[screen->machine().generic.paletteram.u8[x]]; + pens[x] = state->m_palette_lookup[screen.machine().generic.paletteram.u8[x]]; /* if we're blitting from the top, start with a 0 for color 0 */ - if (cliprect->min_y == screen->visible_area().min_y || !(state->m_blaster_video_control & 1)) + if (cliprect->min_y == screen.visible_area().min_y || !(state->m_blaster_video_control & 1)) state->m_blaster_color0 = state->m_palette_lookup[state->m_blaster_palette_0[0] ^ 0xff]; /* loop over rows */ @@ -245,7 +245,7 @@ SCREEN_UPDATE( blaster ) SCREEN_UPDATE( williams2 ) { - williams_state *state = screen->machine().driver_data(); + williams_state *state = screen.machine().driver_data(); rgb_t pens[16]; int x, y; @@ -254,7 +254,7 @@ SCREEN_UPDATE( williams2 ) /* fetch the relevant pens */ for (x = 1; x < 16; x++) - pens[x] = palette_get_color(screen->machine(), state->m_williams2_fg_color * 16 + x); + pens[x] = palette_get_color(screen.machine(), state->m_williams2_fg_color * 16 + x); /* loop over rows */ for (y = cliprect->min_y; y <= cliprect->max_y; y++) diff --git a/src/mame/video/wiping.c b/src/mame/video/wiping.c index 718b9c91b85..a4862a5dc28 100644 --- a/src/mame/video/wiping.c +++ b/src/mame/video/wiping.c @@ -88,7 +88,7 @@ WRITE8_HANDLER( wiping_flipscreen_w ) SCREEN_UPDATE( wiping ) { - wiping_state *state = screen->machine().driver_data(); + wiping_state *state = screen.machine().driver_data(); UINT8 *spriteram = state->m_spriteram; int offs; @@ -121,7 +121,7 @@ SCREEN_UPDATE( wiping ) sy = 27 - sy; } - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0], state->m_videoram[offs], state->m_colorram[offs] & 0x3f, state->m_flipscreen,state->m_flipscreen, @@ -149,12 +149,12 @@ SCREEN_UPDATE( wiping ) flipy = !flipy; } - drawgfx_transmask(bitmap,cliprect,screen->machine().gfx[1], + drawgfx_transmask(bitmap,cliprect,screen.machine().gfx[1], (spriteram[offs] & 0x3f) + 64 * otherbank, color, flipx,flipy, sx,sy, - colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[1], color, 0x1f)); + colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color, 0x1f)); } /* redraw high priority chars */ @@ -189,7 +189,7 @@ SCREEN_UPDATE( wiping ) sy = 27 - sy; } - drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0], + drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0], state->m_videoram[offs], state->m_colorram[offs] & 0x3f, state->m_flipscreen,state->m_flipscreen, diff --git a/src/mame/video/wiz.c b/src/mame/video/wiz.c index 30140b16956..5d5a1cf20ee 100644 --- a/src/mame/video/wiz.c +++ b/src/mame/video/wiz.c @@ -221,42 +221,42 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, SCREEN_UPDATE( kungfut ) { - wiz_state *state = screen->machine().driver_data(); + wiz_state *state = screen.machine().driver_data(); bitmap_fill(bitmap,cliprect,state->m_bgpen); - draw_background(screen->machine(), bitmap, cliprect, 2 + state->m_char_bank[0] , 0); - draw_foreground(screen->machine(), bitmap, cliprect, 0); - draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram2, 4); - draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram , 5); + draw_background(screen.machine(), bitmap, cliprect, 2 + state->m_char_bank[0] , 0); + draw_foreground(screen.machine(), bitmap, cliprect, 0); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram2, 4); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram , 5); return 0; } SCREEN_UPDATE( wiz ) { - wiz_state *state = screen->machine().driver_data(); + wiz_state *state = screen.machine().driver_data(); int bank; const rectangle* visible_area; bitmap_fill(bitmap,cliprect,state->m_bgpen); - draw_background(screen->machine(), bitmap, cliprect, 2 + ((state->m_char_bank[0] << 1) | state->m_char_bank[1]), 0); - draw_foreground(screen->machine(), bitmap, cliprect, 0); + draw_background(screen.machine(), bitmap, cliprect, 2 + ((state->m_char_bank[0] << 1) | state->m_char_bank[1]), 0); + draw_foreground(screen.machine(), bitmap, cliprect, 0); visible_area = state->m_flipx ? &spritevisibleareaflipx : &spritevisiblearea; bank = 7 + *state->m_sprite_bank; - draw_sprites(screen->machine(), bitmap, visible_area, state->m_spriteram2, 6); - draw_sprites(screen->machine(), bitmap, visible_area, state->m_spriteram , bank); + draw_sprites(screen.machine(), bitmap, visible_area, state->m_spriteram2, 6); + draw_sprites(screen.machine(), bitmap, visible_area, state->m_spriteram , bank); return 0; } SCREEN_UPDATE( stinger ) { - wiz_state *state = screen->machine().driver_data(); + wiz_state *state = screen.machine().driver_data(); bitmap_fill(bitmap,cliprect,state->m_bgpen); - draw_background(screen->machine(), bitmap, cliprect, 2 + state->m_char_bank[0], 1); - draw_foreground(screen->machine(), bitmap, cliprect, 1); - draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram2, 4); - draw_sprites(screen->machine(), bitmap, cliprect, state->m_spriteram , 5); + draw_background(screen.machine(), bitmap, cliprect, 2 + state->m_char_bank[0], 1); + draw_foreground(screen.machine(), bitmap, cliprect, 1); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram2, 4); + draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram , 5); return 0; } diff --git a/src/mame/video/wolfpack.c b/src/mame/video/wolfpack.c index eef9e199275..ea02b5961d0 100644 --- a/src/mame/video/wolfpack.c +++ b/src/mame/video/wolfpack.c @@ -252,7 +252,7 @@ static void draw_water(colortable_t *colortable, bitmap_t* bitmap, const rectang SCREEN_UPDATE( wolfpack ) { - wolfpack_state *state = screen->machine().driver_data(); + wolfpack_state *state = screen.machine().driver_data(); int i; int j; @@ -262,8 +262,8 @@ SCREEN_UPDATE( wolfpack ) if (state->m_ship_size & 0x40) color += 0x3a; if (state->m_ship_size & 0x80) color += 0x48; - colortable_palette_set_color(screen->machine().colortable, 3, MAKE_RGB(color,color,color)); - colortable_palette_set_color(screen->machine().colortable, 7, MAKE_RGB(color < 0xb8 ? color + 0x48 : 0xff, + colortable_palette_set_color(screen.machine().colortable, 3, MAKE_RGB(color,color,color)); + colortable_palette_set_color(screen.machine().colortable, 7, MAKE_RGB(color < 0xb8 ? color + 0x48 : 0xff, color < 0xb8 ? color + 0x48 : 0xff, color < 0xb8 ? color + 0x48 : 0xff)); @@ -275,7 +275,7 @@ SCREEN_UPDATE( wolfpack ) int code = state->m_alpha_num_ram[32 * i + j]; drawgfx_opaque(bitmap, cliprect, - screen->machine().gfx[0], + screen.machine().gfx[0], code, state->m_video_invert, 0, 0, @@ -283,17 +283,17 @@ SCREEN_UPDATE( wolfpack ) 192 + 8 * i); } - draw_pt(screen->machine(), bitmap, cliprect); - draw_ship(screen->machine(), bitmap, cliprect); - draw_torpedo(screen->machine(), bitmap, cliprect); - draw_water(screen->machine().colortable, bitmap, cliprect); + draw_pt(screen.machine(), bitmap, cliprect); + draw_ship(screen.machine(), bitmap, cliprect); + draw_torpedo(screen.machine(), bitmap, cliprect); + draw_water(screen.machine().colortable, bitmap, cliprect); return 0; } SCREEN_EOF( wolfpack ) { - wolfpack_state *state = machine.driver_data(); + wolfpack_state *state = screen.machine().driver_data(); rectangle rect; int x; @@ -306,7 +306,7 @@ SCREEN_EOF( wolfpack ) bitmap_fill(state->m_helper, &rect, 0); - draw_ship(machine, state->m_helper, &rect); + draw_ship(screen.machine(), state->m_helper, &rect); for (y = 128; y < 224 - state->m_torpedo_v; y++) { diff --git a/src/mame/video/wrally.c b/src/mame/video/wrally.c index 361b64e87a2..a9daf15e47b 100644 --- a/src/mame/video/wrally.c +++ b/src/mame/video/wrally.c @@ -178,9 +178,9 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( wrally ) { - wrally_state *state = screen->machine().driver_data(); + wrally_state *state = screen.machine().driver_data(); /* set scroll registers */ - if (!flip_screen_get(screen->machine())) { + if (!flip_screen_get(screen.machine())) { tilemap_set_scrolly(state->m_pant[0], 0, state->m_vregs[0]); tilemap_set_scrollx(state->m_pant[0], 0, state->m_vregs[1]+4); tilemap_set_scrolly(state->m_pant[1], 0, state->m_vregs[2]); @@ -200,11 +200,11 @@ SCREEN_UPDATE( wrally ) tilemap_draw(bitmap,cliprect,state->m_pant[1],TILEMAP_DRAW_CATEGORY(1),0); tilemap_draw(bitmap,cliprect,state->m_pant[0],TILEMAP_DRAW_CATEGORY(1) | TILEMAP_DRAW_LAYER0,0); - draw_sprites(screen->machine(),bitmap,cliprect,0); + draw_sprites(screen.machine(),bitmap,cliprect,0); tilemap_draw(bitmap,cliprect,state->m_pant[0],TILEMAP_DRAW_CATEGORY(1) | TILEMAP_DRAW_LAYER1,0); - draw_sprites(screen->machine(),bitmap,cliprect,1); + draw_sprites(screen.machine(),bitmap,cliprect,1); return 0; } diff --git a/src/mame/video/wwfsstar.c b/src/mame/video/wwfsstar.c index 7bb26b03e0e..ca387a3892a 100644 --- a/src/mame/video/wwfsstar.c +++ b/src/mame/video/wwfsstar.c @@ -222,13 +222,13 @@ VIDEO_START( wwfsstar ) SCREEN_UPDATE( wwfsstar ) { - wwfsstar_state *state = screen->machine().driver_data(); + wwfsstar_state *state = screen.machine().driver_data(); tilemap_set_scrolly( state->m_bg0_tilemap, 0, state->m_scrolly ); tilemap_set_scrollx( state->m_bg0_tilemap, 0, state->m_scrollx ); tilemap_draw(bitmap,cliprect,state->m_bg0_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect ); + draw_sprites(screen.machine(), bitmap,cliprect ); tilemap_draw(bitmap,cliprect,state->m_fg0_tilemap,0,0); return 0; diff --git a/src/mame/video/wwfwfest.c b/src/mame/video/wwfwfest.c index e4acab8351b..7a4e3f42371 100644 --- a/src/mame/video/wwfwfest.c +++ b/src/mame/video/wwfwfest.c @@ -257,7 +257,7 @@ VIDEO_START( wwfwfstb ) SCREEN_UPDATE( wwfwfest ) { - wwfwfest_state *state = screen->machine().driver_data(); + wwfwfest_state *state = screen.machine().driver_data(); if (state->m_pri == 0x0078) { tilemap_set_scrolly( state->m_bg0_tilemap, 0, state->m_bg0_scrolly ); tilemap_set_scrollx( state->m_bg0_tilemap, 0, state->m_bg0_scrollx + state->m_bg0_dx); @@ -275,13 +275,13 @@ SCREEN_UPDATE( wwfwfest ) if (state->m_pri == 0x007b) { tilemap_draw(bitmap,cliprect,state->m_bg0_tilemap,TILEMAP_DRAW_OPAQUE,0); tilemap_draw(bitmap,cliprect,state->m_bg1_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_fg0_tilemap,0,0); } if (state->m_pri == 0x007c) { tilemap_draw(bitmap,cliprect,state->m_bg0_tilemap,TILEMAP_DRAW_OPAQUE,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_bg1_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_fg0_tilemap,0,0); } @@ -289,7 +289,7 @@ SCREEN_UPDATE( wwfwfest ) if (state->m_pri == 0x0078) { tilemap_draw(bitmap,cliprect,state->m_bg1_tilemap,TILEMAP_DRAW_OPAQUE,0); tilemap_draw(bitmap,cliprect,state->m_bg0_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_fg0_tilemap,0,0); } return 0; diff --git a/src/mame/video/xain.c b/src/mame/video/xain.c index adc699e3fa2..c14285408db 100644 --- a/src/mame/video/xain.c +++ b/src/mame/video/xain.c @@ -225,54 +225,54 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( xain ) { - xain_state *state = screen->machine().driver_data(); + xain_state *state = screen.machine().driver_data(); switch (state->m_pri&0x7) { case 0: tilemap_draw(bitmap,cliprect,state->m_bgram0_tilemap,TILEMAP_DRAW_OPAQUE,0); tilemap_draw(bitmap,cliprect,state->m_bgram1_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_char_tilemap,0,0); break; case 1: tilemap_draw(bitmap,cliprect,state->m_bgram1_tilemap,TILEMAP_DRAW_OPAQUE,0); tilemap_draw(bitmap,cliprect,state->m_bgram0_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_char_tilemap,0,0); break; case 2: tilemap_draw(bitmap,cliprect,state->m_char_tilemap,TILEMAP_DRAW_OPAQUE,0); tilemap_draw(bitmap,cliprect,state->m_bgram0_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_bgram1_tilemap,0,0); break; case 3: tilemap_draw(bitmap,cliprect,state->m_char_tilemap,TILEMAP_DRAW_OPAQUE,0); tilemap_draw(bitmap,cliprect,state->m_bgram1_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_bgram0_tilemap,0,0); break; case 4: tilemap_draw(bitmap,cliprect,state->m_bgram0_tilemap,TILEMAP_DRAW_OPAQUE,0); tilemap_draw(bitmap,cliprect,state->m_char_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_bgram1_tilemap,0,0); break; case 5: tilemap_draw(bitmap,cliprect,state->m_bgram1_tilemap,TILEMAP_DRAW_OPAQUE,0); tilemap_draw(bitmap,cliprect,state->m_char_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_bgram0_tilemap,0,0); break; case 6: tilemap_draw(bitmap,cliprect,state->m_bgram0_tilemap,TILEMAP_DRAW_OPAQUE,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_bgram1_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_char_tilemap,0,0); break; case 7: tilemap_draw(bitmap,cliprect,state->m_bgram1_tilemap,TILEMAP_DRAW_OPAQUE,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_bgram0_tilemap,0,0); tilemap_draw(bitmap,cliprect,state->m_char_tilemap,0,0); break; diff --git a/src/mame/video/xevious.c b/src/mame/video/xevious.c index 707a0fada3b..b06ddeeebb6 100644 --- a/src/mame/video/xevious.c +++ b/src/mame/video/xevious.c @@ -500,10 +500,10 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( xevious ) { - xevious_state *state = screen->machine().driver_data(); + xevious_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); - draw_sprites(screen->machine(), bitmap,cliprect); + draw_sprites(screen.machine(), bitmap,cliprect); tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); return 0; } diff --git a/src/mame/video/xexex.c b/src/mame/video/xexex.c index bbe27fbd835..bb0e1f499fa 100644 --- a/src/mame/video/xexex.c +++ b/src/mame/video/xexex.c @@ -49,7 +49,7 @@ VIDEO_START( xexex ) SCREEN_UPDATE( xexex ) { static const int K053251_CI[4] = { K053251_CI1, K053251_CI2, K053251_CI3, K053251_CI4 }; - xexex_state *state = screen->machine().driver_data(); + xexex_state *state = screen.machine().driver_data(); int layer[4]; int bg_colorbase, new_colorbase, plane, alpha; @@ -81,7 +81,7 @@ SCREEN_UPDATE( xexex ) k054338_update_all_shadows(state->m_k054338, 0); k054338_fill_backcolor(state->m_k054338, bitmap, 0); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); for (plane = 0; plane < 4; plane++) { diff --git a/src/mame/video/xmen.c b/src/mame/video/xmen.c index ff6e05be1e9..80e5c9b3a0a 100644 --- a/src/mame/video/xmen.c +++ b/src/mame/video/xmen.c @@ -73,7 +73,7 @@ VIDEO_START( xmen6p ) SCREEN_UPDATE( xmen ) { - xmen_state *state = screen->machine().driver_data(); + xmen_state *state = screen.machine().driver_data(); int layer[3], bg_colorbase; bg_colorbase = k053251_get_palette_index(state->m_k053251, K053251_CI4); @@ -93,7 +93,7 @@ SCREEN_UPDATE( xmen ) konami_sortlayers3(layer, state->m_layerpri); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); /* note the '+1' in the background color!!! */ bitmap_fill(bitmap, cliprect, 16 * bg_colorbase + 1); k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[0], 0, 1); @@ -107,29 +107,36 @@ SCREEN_UPDATE( xmen ) } -SCREEN_UPDATE( xmen6p ) +SCREEN_UPDATE( xmen6p_left ) { - xmen_state *state = screen->machine().driver_data(); + xmen_state *state = screen.machine().driver_data(); int x, y; - if (screen == state->m_lscreen) - for(y = 0; y < 32 * 8; y++) - { - UINT16* line_dest = BITMAP_ADDR16(bitmap, y, 0); - UINT16* line_src = BITMAP_ADDR16(state->m_screen_left, y, 0); + for(y = 0; y < 32 * 8; y++) + { + UINT16* line_dest = BITMAP_ADDR16(bitmap, y, 0); + UINT16* line_src = BITMAP_ADDR16(state->m_screen_left, y, 0); - for (x = 12 * 8; x < 52 * 8; x++) - line_dest[x] = line_src[x]; - } - else if (screen == state->m_rscreen) - for(y = 0; y < 32 * 8; y++) - { - UINT16* line_dest = BITMAP_ADDR16(bitmap, y, 0); - UINT16* line_src = BITMAP_ADDR16(state->m_screen_right, y, 0); + for (x = 12 * 8; x < 52 * 8; x++) + line_dest[x] = line_src[x]; + } - for (x = 12 * 8; x < 52 * 8; x++) - line_dest[x] = line_src[x]; - } + return 0; +} + +SCREEN_UPDATE( xmen6p_right ) +{ + xmen_state *state = screen.machine().driver_data(); + int x, y; + + for(y = 0; y < 32 * 8; y++) + { + UINT16* line_dest = BITMAP_ADDR16(bitmap, y, 0); + UINT16* line_src = BITMAP_ADDR16(state->m_screen_right, y, 0); + + for (x = 12 * 8; x < 52 * 8; x++) + line_dest[x] = line_src[x]; + } return 0; } @@ -137,13 +144,13 @@ SCREEN_UPDATE( xmen6p ) /* my lefts and rights are mixed up in several places.. */ SCREEN_EOF( xmen6p ) { - xmen_state *state = machine.driver_data(); + xmen_state *state = screen.machine().driver_data(); int layer[3], bg_colorbase; bitmap_t * renderbitmap; rectangle cliprect; int offset; -// const rectangle *visarea = machine.primary_screen->visible_area(); +// const rectangle *visarea = screen.machine().primary_screen->visible_area(); // cliprect.min_x = visarea->min_x; // cliprect.max_x = visarea->max_x; // cliprect.min_y = visarea->min_y; @@ -155,7 +162,7 @@ SCREEN_EOF( xmen6p ) cliprect.max_y = 30 * 8 - 1; - if (machine.primary_screen->frame_number() & 0x01) + if (screen.machine().primary_screen->frame_number() & 0x01) { /* copy the desired spritelist to the chip */ @@ -212,7 +219,7 @@ SCREEN_EOF( xmen6p ) konami_sortlayers3(layer, state->m_layerpri); - bitmap_fill(machine.priority_bitmap, &cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, &cliprect, 0); /* note the '+1' in the background color!!! */ bitmap_fill(renderbitmap, &cliprect, 16 * bg_colorbase + 1); k052109_tilemap_draw(state->m_k052109, renderbitmap, &cliprect, layer[0], 0, 1); diff --git a/src/mame/video/xorworld.c b/src/mame/video/xorworld.c index 095a74fdd7e..ce48c533025 100644 --- a/src/mame/video/xorworld.c +++ b/src/mame/video/xorworld.c @@ -115,8 +115,8 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( xorworld ) { - xorworld_state *state = screen->machine().driver_data(); + xorworld_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/xxmissio.c b/src/mame/video/xxmissio.c index a375d67ecc0..b854acde677 100644 --- a/src/mame/video/xxmissio.c +++ b/src/mame/video/xxmissio.c @@ -138,15 +138,15 @@ static void draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_ SCREEN_UPDATE( xxmissio ) { - xxmissio_state *state = screen->machine().driver_data(); - tilemap_mark_all_tiles_dirty_all(screen->machine()); - tilemap_set_flip_all(screen->machine(), state->m_flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); + xxmissio_state *state = screen.machine().driver_data(); + tilemap_mark_all_tiles_dirty_all(screen.machine()); + tilemap_set_flip_all(screen.machine(), state->m_flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_xscroll * 2); tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_yscroll); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(bitmap, cliprect, screen->machine().gfx[1]); + draw_sprites(bitmap, cliprect, screen.machine().gfx[1]); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; diff --git a/src/mame/video/xybots.c b/src/mame/video/xybots.c index 6a445f9fb7a..d1bc68670de 100644 --- a/src/mame/video/xybots.c +++ b/src/mame/video/xybots.c @@ -106,7 +106,7 @@ VIDEO_START( xybots ) SCREEN_UPDATE( xybots ) { - xybots_state *state = screen->machine().driver_data(); + xybots_state *state = screen.machine().driver_data(); atarimo_rect_list rectlist; bitmap_t *mobitmap; int x, y, r; diff --git a/src/mame/video/xyonix.c b/src/mame/video/xyonix.c index f319a168931..f2d77b4227d 100644 --- a/src/mame/video/xyonix.c +++ b/src/mame/video/xyonix.c @@ -58,7 +58,7 @@ VIDEO_START(xyonix) SCREEN_UPDATE(xyonix) { - xyonix_state *state = screen->machine().driver_data(); + xyonix_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_tilemap, 0, 0); return 0; diff --git a/src/mame/video/ygv608.c b/src/mame/video/ygv608.c index 8845a696040..9335326a215 100644 --- a/src/mame/video/ygv608.c +++ b/src/mame/video/ygv608.c @@ -744,13 +744,13 @@ SCREEN_UPDATE( ygv608 ) double r, alpha, sin_theta, cos_theta; #endif rectangle finalclip; - const rectangle &visarea = screen->visible_area(); + const rectangle &visarea = screen.visible_area(); // clip to the current bitmap finalclip.min_x = 0; - finalclip.max_x = screen->width() - 1; + finalclip.max_x = screen.width() - 1; finalclip.min_y = 0; - finalclip.max_y = screen->height() - 1; + finalclip.max_y = screen.height() - 1; sect_rect(&finalclip, cliprect); cliprect = &finalclip; @@ -766,12 +766,12 @@ SCREEN_UPDATE( ygv608 ) #ifdef _ENABLE_SCREEN_RESIZE // hdw should be scaled by 16, not 8 // - is it something to do with double dot-clocks??? - screen->set_visible_area(0, ((int)(ygv608.regs.s.hdw)<<3/*4*/)-1, + screen.set_visible_area(0, ((int)(ygv608.regs.s.hdw)<<3/*4*/)-1, 0, ((int)(ygv608.regs.s.vdw)<<3)-1 ); #endif - auto_free( screen->machine(), work_bitmap ); - work_bitmap = screen->alloc_compatible_bitmap(); + auto_free( screen.machine(), work_bitmap ); + work_bitmap = screen.alloc_compatible_bitmap(); // reset resize flag ygv608.screen_resize = 0; @@ -902,7 +902,7 @@ SCREEN_UPDATE( ygv608 ) if ((ygv608.regs.s.r11 & r11_prm) == PRM_ASBDEX || (ygv608.regs.s.r11 & r11_prm) == PRM_ASEBDX ) - draw_sprites(screen->machine(), bitmap,cliprect ); + draw_sprites(screen.machine(), bitmap,cliprect ); tilemap_draw( work_bitmap,cliprect, tilemap_A, 0, 0 ); @@ -919,7 +919,7 @@ SCREEN_UPDATE( ygv608 ) if ((ygv608.regs.s.r11 & r11_prm) == PRM_SABDEX || (ygv608.regs.s.r11 & r11_prm) == PRM_SEABDX) - draw_sprites(screen->machine(), bitmap,cliprect ); + draw_sprites(screen.machine(), bitmap,cliprect ); #ifdef _SHOW_VIDEO_DEBUG diff --git a/src/mame/video/yiear.c b/src/mame/video/yiear.c index cfad5195048..4e0c0fa6a18 100644 --- a/src/mame/video/yiear.c +++ b/src/mame/video/yiear.c @@ -143,9 +143,9 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( yiear ) { - yiear_state *state = screen->machine().driver_data(); + yiear_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/yunsun16.c b/src/mame/video/yunsun16.c index 7a00bddb4b8..7473a3ceec4 100644 --- a/src/mame/video/yunsun16.c +++ b/src/mame/video/yunsun16.c @@ -202,7 +202,7 @@ static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( yunsun16 ) { - yunsun16_state *state = screen->machine().driver_data(); + yunsun16_state *state = screen.machine().driver_data(); tilemap_set_scrollx(state->m_tilemap_0, 0, state->m_scrollram_0[0]); tilemap_set_scrolly(state->m_tilemap_0, 0, state->m_scrollram_0[1]); @@ -212,7 +212,7 @@ SCREEN_UPDATE( yunsun16 ) //popmessage("%04X", *state->m_priorityram); - bitmap_fill(screen->machine().priority_bitmap, cliprect, 0); + bitmap_fill(screen.machine().priority_bitmap, cliprect, 0); if ((*state->m_priorityram & 0x0c) == 4) { @@ -229,6 +229,6 @@ SCREEN_UPDATE( yunsun16 ) tilemap_draw(bitmap, cliprect, state->m_tilemap_0, 0, 2); } - draw_sprites(screen->machine(), bitmap, cliprect); + draw_sprites(screen.machine(), bitmap, cliprect); return 0; } diff --git a/src/mame/video/yunsung8.c b/src/mame/video/yunsung8.c index 375697100be..24b741f0bc5 100644 --- a/src/mame/video/yunsung8.c +++ b/src/mame/video/yunsung8.c @@ -196,15 +196,15 @@ VIDEO_START( yunsung8 ) SCREEN_UPDATE( yunsung8 ) { - yunsung8_state *state = screen->machine().driver_data(); + yunsung8_state *state = screen.machine().driver_data(); int layers_ctrl = (~state->m_layers_ctrl) >> 4; #ifdef MAME_DEBUG -if (screen->machine().input().code_pressed(KEYCODE_Z)) +if (screen.machine().input().code_pressed(KEYCODE_Z)) { int msk = 0; - if (screen->machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (screen->machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 2; if (msk != 0) layers_ctrl &= msk; } #endif diff --git a/src/mame/video/zac2650.c b/src/mame/video/zac2650.c index ef7c6ebe802..83295c7b34f 100644 --- a/src/mame/video/zac2650.c +++ b/src/mame/video/zac2650.c @@ -230,8 +230,8 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap) SCREEN_UPDATE( tinvader ) { - zac2650_state *state = screen->machine().driver_data(); + zac2650_state *state = screen.machine().driver_data(); tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); - draw_sprites(screen->machine(), bitmap); + draw_sprites(screen.machine(), bitmap); return 0; } diff --git a/src/mame/video/zaccaria.c b/src/mame/video/zaccaria.c index a7c4883f1f8..ca3371f9419 100644 --- a/src/mame/video/zaccaria.c +++ b/src/mame/video/zaccaria.c @@ -245,14 +245,14 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectan SCREEN_UPDATE( zaccaria ) { - zaccaria_state *state = screen->machine().driver_data(); + zaccaria_state *state = screen.machine().driver_data(); tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); // 3 layers of sprites, each with their own palette and priorities // Not perfect yet, does spriteram(1) layer have a priority bit somewhere? - draw_sprites(screen->machine(),bitmap,cliprect,state->m_spriteram2,2,1); - draw_sprites(screen->machine(),bitmap,cliprect,state->m_spriteram,1,0); - draw_sprites(screen->machine(),bitmap,cliprect,state->m_spriteram2+0x20,0,1); + draw_sprites(screen.machine(),bitmap,cliprect,state->m_spriteram2,2,1); + draw_sprites(screen.machine(),bitmap,cliprect,state->m_spriteram,1,0); + draw_sprites(screen.machine(),bitmap,cliprect,state->m_spriteram2+0x20,0,1); return 0; } diff --git a/src/mame/video/zaxxon.c b/src/mame/video/zaxxon.c index 8154731bf28..b408989261b 100644 --- a/src/mame/video/zaxxon.c +++ b/src/mame/video/zaxxon.c @@ -477,10 +477,10 @@ static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const recta SCREEN_UPDATE( zaxxon ) { - zaxxon_state *state = screen->machine().driver_data(); + zaxxon_state *state = screen.machine().driver_data(); - draw_background(screen->machine(), bitmap, cliprect, TRUE); - draw_sprites(screen->machine(), bitmap, cliprect, 0x140, 0x180); + draw_background(screen.machine(), bitmap, cliprect, TRUE); + draw_sprites(screen.machine(), bitmap, cliprect, 0x140, 0x180); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } @@ -488,10 +488,10 @@ SCREEN_UPDATE( zaxxon ) SCREEN_UPDATE( futspy ) { - zaxxon_state *state = screen->machine().driver_data(); + zaxxon_state *state = screen.machine().driver_data(); - draw_background(screen->machine(), bitmap, cliprect, TRUE); - draw_sprites(screen->machine(), bitmap, cliprect, 0x180, 0x180); + draw_background(screen.machine(), bitmap, cliprect, TRUE); + draw_sprites(screen.machine(), bitmap, cliprect, 0x180, 0x180); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } @@ -499,10 +499,10 @@ SCREEN_UPDATE( futspy ) SCREEN_UPDATE( razmataz ) { - zaxxon_state *state = screen->machine().driver_data(); + zaxxon_state *state = screen.machine().driver_data(); - draw_background(screen->machine(), bitmap, cliprect, FALSE); - draw_sprites(screen->machine(), bitmap, cliprect, 0x140, 0x180); + draw_background(screen.machine(), bitmap, cliprect, FALSE); + draw_sprites(screen.machine(), bitmap, cliprect, 0x140, 0x180); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; } @@ -510,10 +510,10 @@ SCREEN_UPDATE( razmataz ) SCREEN_UPDATE( congo ) { - zaxxon_state *state = screen->machine().driver_data(); + zaxxon_state *state = screen.machine().driver_data(); - draw_background(screen->machine(), bitmap, cliprect, TRUE); - draw_sprites(screen->machine(), bitmap, cliprect, 0x280, 0x180); + draw_background(screen.machine(), bitmap, cliprect, TRUE); + draw_sprites(screen.machine(), bitmap, cliprect, 0x280, 0x180); tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); return 0; }