summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Zsolt Vasvari <zsoltvas@mamedev.org>2008-03-11 16:16:30 +0000
committer Zsolt Vasvari <zsoltvas@mamedev.org>2008-03-11 16:16:30 +0000
commit86b798b37a6cbdb875df3dae4a2d0c3256951d32 (patch)
tree6635a7a0c49eda53647faf835f7897377fb4e995
parent706d9f408f97c9b428b7e263b643505dbeaf1623 (diff)
- More machine->screen removal
- Hooked up swapped videoram in Karnov properly -- same idea as Burger Time
-rw-r--r--src/emu/debug/debugcmd.c3
-rw-r--r--src/emu/mame.c2
-rw-r--r--src/emu/render.c19
-rw-r--r--src/emu/render.h4
-rw-r--r--src/emu/video.c78
-rw-r--r--src/mame/drivers/karnov.c5
-rw-r--r--src/mame/video/40love.c4
-rw-r--r--src/mame/video/airbustr.c9
-rw-r--r--src/mame/video/argus.c8
-rw-r--r--src/mame/video/atarimo.c2
-rw-r--r--src/mame/video/battlera.c4
-rw-r--r--src/mame/video/bigevglf.c8
-rw-r--r--src/mame/video/bishi.c2
-rw-r--r--src/mame/video/bking.c4
-rw-r--r--src/mame/video/blockout.c2
-rw-r--r--src/mame/video/btime.c5
-rw-r--r--src/mame/video/buggychl.c4
-rw-r--r--src/mame/video/carpolo.c12
-rw-r--r--src/mame/video/ccastles.c2
-rw-r--r--src/mame/video/changela.c8
-rw-r--r--src/mame/video/cloud9.c2
-rw-r--r--src/mame/video/cvs.c6
-rw-r--r--src/mame/video/dcheese.c2
-rw-r--r--src/mame/video/dday.c2
-rw-r--r--src/mame/video/dkong.c4
-rw-r--r--src/mame/video/dogfgt.c2
-rw-r--r--src/mame/video/eolith.c4
-rw-r--r--src/mame/video/equites.c4
-rw-r--r--src/mame/video/exidy.c10
-rw-r--r--src/mame/video/fgoal.c4
-rw-r--r--src/mame/video/finalizr.c2
-rw-r--r--src/mame/video/firetrk.c12
-rw-r--r--src/mame/video/gaelco3d.c2
-rw-r--r--src/mame/video/galaxian.c2
-rw-r--r--src/mame/video/galpanic.c4
-rw-r--r--src/mame/video/glass.c2
-rw-r--r--src/mame/video/goldstar.c8
-rw-r--r--src/mame/video/gomoku.c2
-rw-r--r--src/mame/video/grchamp.c2
-rw-r--r--src/mame/video/gticlub.c4
-rw-r--r--src/mame/video/hyhoo.c2
-rw-r--r--src/mame/video/ikki.c2
-rw-r--r--src/mame/video/kan_pand.c2
-rw-r--r--src/mame/video/kaneko16.c2
-rw-r--r--src/mame/video/karnov.c44
-rw-r--r--src/mame/video/mappy.c2
-rw-r--r--src/mame/video/model3.c2
-rw-r--r--src/mame/video/nbmj8891.c6
-rw-r--r--src/mame/video/nbmj8991.c2
-rw-r--r--src/mame/video/nbmj9195.c10
-rw-r--r--src/mame/video/ninjakd2.c2
-rw-r--r--src/mame/video/niyanpai.c6
-rw-r--r--src/mame/video/ojankohs.c2
-rw-r--r--src/mame/video/pacland.c2
-rw-r--r--src/mame/video/paradise.c13
-rw-r--r--src/mame/video/quasar.c2
-rw-r--r--src/mame/video/shangha3.c2
-rw-r--r--src/mame/video/sprint2.c4
-rw-r--r--src/mame/video/sprint4.c4
-rw-r--r--src/mame/video/sprint8.c8
-rw-r--r--src/mame/video/starshp1.c2
-rw-r--r--src/mame/video/system1.c4
-rw-r--r--src/mame/video/taitojc.c2
-rw-r--r--src/mame/video/taitosj.c4
-rw-r--r--src/mame/video/tank8.c6
-rw-r--r--src/mame/video/tceptor.c2
-rw-r--r--src/mame/video/triplhnt.c2
-rw-r--r--src/mame/video/ultratnk.c4
-rw-r--r--src/mame/video/vdc.c2
-rw-r--r--src/mame/video/wolfpack.c2
-rw-r--r--src/mame/video/zac2650.c4
71 files changed, 188 insertions, 230 deletions
diff --git a/src/emu/debug/debugcmd.c b/src/emu/debug/debugcmd.c
index d281370b5cc..7fee281f50a 100644
--- a/src/emu/debug/debugcmd.c
+++ b/src/emu/debug/debugcmd.c
@@ -2006,12 +2006,11 @@ static void execute_snap(int ref, int params, const char *param[])
mame_file *fp;
const char *filename = param[0];
int scrnum = (params > 1) ? atoi(param[1]) : 0;
- UINT32 mask = render_get_live_screens_mask();
astring *fname;
const device_config *screen = device_list_find_by_index(Machine->config->devicelist, VIDEO_SCREEN, scrnum);
- if ((screen == NULL) || !(mask & (1 << scrnum)))
+ if ((screen == NULL) || !render_is_live_screen(screen))
{
debug_console_printf("Invalid screen number '%d'\n", scrnum);
return;
diff --git a/src/emu/mame.c b/src/emu/mame.c
index aa811ba4bd1..805ab371cd5 100644
--- a/src/emu/mame.c
+++ b/src/emu/mame.c
@@ -51,6 +51,7 @@
- calls the driver's DRIVER_INIT callback
- calls device_list_start() [devintrf.c] to start any devices
- calls video_init() [video.c] to start the video system
+ - calls tilemap_init() [tilemap.c] to start the tilemap system
- calls crosshair_init() [crsshair.c] to configure the crosshairs
- calls sound_init() [sound.c] to start the audio system
- calls mame_debug_init() [debugcpu.c] to set up the debugger
@@ -1580,6 +1581,7 @@ static void init_machine(running_machine *machine)
/* start the video and audio hardware */
video_init(machine);
+ tilemap_init(machine);
crosshair_init(machine);
sound_init(machine);
diff --git a/src/emu/render.c b/src/emu/render.c
index a72358df5f3..0018b2fc073 100644
--- a/src/emu/render.c
+++ b/src/emu/render.c
@@ -898,20 +898,31 @@ void render_set_rescale_notify(running_machine *machine, int (*notifier)(running
/*-------------------------------------------------
- render_get_live_screens_mask - return a
- bitmask indicating the live screens
+ render_is_live_screen - return if the screen
+ is 'live'
-------------------------------------------------*/
-UINT32 render_get_live_screens_mask(void)
+int render_is_live_screen(const device_config *screen)
{
render_target *target;
+ int screen_index;
UINT32 bitmask = 0;
+ assert(screen != NULL);
+ assert(screen->machine != NULL);
+ assert(screen->machine->config != NULL);
+ assert(screen->machine->config->devicelist != NULL);
+ assert(screen->tag != NULL);
+
+ screen_index = device_list_index(screen->machine->config->devicelist, VIDEO_SCREEN, screen->tag);
+
+ assert(screen_index != -1);
+
/* iterate over all live targets and or together their screen masks */
for (target = targetlist; target != NULL; target = target->next)
bitmask |= target->curview->screens;
- return bitmask;
+ return (bitmask & (1 << screen_index)) ? TRUE : FALSE;
}
diff --git a/src/emu/render.h b/src/emu/render.h
index def4516e058..840d6ef891d 100644
--- a/src/emu/render.h
+++ b/src/emu/render.h
@@ -308,8 +308,8 @@ void render_init(running_machine *machine);
/* set a notifier that we call before doing long scaling operations */
void render_set_rescale_notify(running_machine *machine, int (*notifier)(running_machine *, int, int));
-/* return a bitmask indicating the live screens */
-UINT32 render_get_live_screens_mask(void);
+/* return a boolean indicating if the screen is live */
+int render_is_live_screen(const device_config *screen);
/* return the smallest maximum update rate across all targets */
float render_get_max_update_rate(void);
diff --git a/src/emu/video.c b/src/emu/video.c
index 231aca3b838..5e9ef67d0da 100644
--- a/src/emu/video.c
+++ b/src/emu/video.c
@@ -48,9 +48,6 @@
typedef struct _internal_screen_state internal_screen_state;
struct _internal_screen_state
{
- /* basic information about this screen */
- int scrnum; /* the screen index */
-
/* textures and bitmaps */
render_texture * texture[2]; /* 2x textures for the screen bitmap */
bitmap_t * bitmap[2]; /* 2x bitmaps for rendering */
@@ -324,9 +321,6 @@ void video_init(running_machine *machine)
/* allocate a timer to reset partial updates */
internal_state->scanline0_timer = timer_alloc(scanline0_callback, (void *)screen);
- /* save some cross-reference information that makes our life easier */
- internal_state->scrnum = scrnum;
-
/* configure the screen with the default parameters */
state->format = config->format;
video_screen_configure(screen, config->width, config->height, &config->visarea, config->refresh);
@@ -379,17 +373,6 @@ void video_init(running_machine *machine)
/* reset video statics and get out of here */
pdrawgfx_shadow_lowpri = 0;
- /* initialize tilemaps */
- tilemap_init(machine);
-
- /* create a render target for snapshots */
- if (machine->screen[0].private_data != NULL)
- {
- global.snap_target = render_target_alloc(layout_snap, RENDER_CREATE_SINGLE_FILE | RENDER_CREATE_HIDDEN);
- assert(global.snap_target != NULL);
- render_target_set_layer_config(global.snap_target, 0);
- }
-
/* start recording movie if specified */
filename = options_get_string(mame_options(), OPTION_MNGWRITE);
if ((filename[0] != 0) && (machine->primary_screen != NULL))
@@ -828,7 +811,7 @@ void video_screen_update_partial(const device_config *screen, int scanline)
}
/* skip if this screen is not visible anywhere */
- if (!(render_get_live_screens_mask() & (1 << internal_state->scrnum)))
+ if (!render_is_live_screen(screen))
{
LOG_PARTIAL_UPDATES(("skipped because screen not live\n"));
return;
@@ -1458,21 +1441,19 @@ static int finish_screen_updates(running_machine *machine)
{
const device_config *screen;
int anything_changed = FALSE;
- int livemask;
/* finish updating the screens */
for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen))
video_screen_update_partial(screen, video_screen_get_visible_area(screen)->max_y);
/* now add the quads for all the screens */
- livemask = render_get_live_screens_mask();
for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen))
{
screen_state *state = get_safe_token(screen);
internal_screen_state *internal_state = (internal_screen_state *)state->private_data;
/* only update if live */
- if (livemask & (1 << internal_state->scrnum))
+ if (render_is_live_screen(screen))
{
const screen_config *config = screen->inline_config;
@@ -2062,19 +2043,16 @@ void video_screen_save_snapshot(const device_config *screen, mame_file *fp)
void video_save_active_screen_snapshots(running_machine *machine)
{
- UINT32 screenmask = render_get_live_screens_mask();
mame_file *fp;
const device_config *screen;
- int scrnum;
/* write one snapshot per visible screen */
- for (screen = video_screen_first(machine->config), scrnum = 0; screen != NULL; screen = video_screen_next(screen), scrnum++)
- if (screenmask & (1 << scrnum))
+ for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen))
+ if (render_is_live_screen(screen))
{
file_error filerr = mame_fopen_next(machine, SEARCHPATH_SCREENSHOT, "png", &fp);
if (filerr == FILERR_NONE)
{
- const device_config *screen = device_list_find_by_index(machine->config->devicelist, VIDEO_SCREEN, scrnum);
video_screen_save_snapshot(screen, fp);
mame_fclose(fp);
}
@@ -2090,36 +2068,40 @@ void video_save_active_screen_snapshots(running_machine *machine)
static void create_snapshot_bitmap(const device_config *screen)
{
- screen_state *state = get_safe_token(screen);
- internal_screen_state *internal_state = (internal_screen_state *)state->private_data;
const render_primitive_list *primlist;
INT32 width, height;
+ int view_index;
- /* only do it, if there is at least one screen */
- if (global.snap_target != NULL)
+ /* lazy create snap target */
+ if (global.snap_target == NULL)
{
- /* select the appropriate view in our dummy target */
- render_target_set_view(global.snap_target, internal_state->scrnum);
+ global.snap_target = render_target_alloc(layout_snap, RENDER_CREATE_SINGLE_FILE | RENDER_CREATE_HIDDEN);
+ assert(global.snap_target != NULL);
+ render_target_set_layer_config(global.snap_target, 0);
+ }
- /* get the minimum width/height and set it on the target */
- render_target_get_minimum_size(global.snap_target, &width, &height);
- render_target_set_bounds(global.snap_target, width, height, 0);
+ /* select the appropriate view in our dummy target */
+ view_index = device_list_index(screen->machine->config->devicelist, VIDEO_SCREEN, screen->tag);
+ render_target_set_view(global.snap_target, view_index);
- /* if we don't have a bitmap, or if it's not the right size, allocate a new one */
- if (global.snap_bitmap == NULL || width != global.snap_bitmap->width || height != global.snap_bitmap->height)
- {
- if (global.snap_bitmap != NULL)
- bitmap_free(global.snap_bitmap);
- global.snap_bitmap = bitmap_alloc(width, height, BITMAP_FORMAT_RGB32);
- assert(global.snap_bitmap != NULL);
- }
+ /* get the minimum width/height and set it on the target */
+ render_target_get_minimum_size(global.snap_target, &width, &height);
+ render_target_set_bounds(global.snap_target, width, height, 0);
- /* render the screen there */
- primlist = render_target_get_primitives(global.snap_target);
- osd_lock_acquire(primlist->lock);
- rgb888_draw_primitives(primlist->head, global.snap_bitmap->base, width, height, global.snap_bitmap->rowpixels);
- osd_lock_release(primlist->lock);
+ /* if we don't have a bitmap, or if it's not the right size, allocate a new one */
+ if ((global.snap_bitmap == NULL) || (width != global.snap_bitmap->width) || (height != global.snap_bitmap->height))
+ {
+ if (global.snap_bitmap != NULL)
+ bitmap_free(global.snap_bitmap);
+ global.snap_bitmap = bitmap_alloc(width, height, BITMAP_FORMAT_RGB32);
+ assert(global.snap_bitmap != NULL);
}
+
+ /* render the screen there */
+ primlist = render_target_get_primitives(global.snap_target);
+ osd_lock_acquire(primlist->lock);
+ rgb888_draw_primitives(primlist->head, global.snap_bitmap->base, width, height, global.snap_bitmap->rowpixels);
+ osd_lock_release(primlist->lock);
}
diff --git a/src/mame/drivers/karnov.c b/src/mame/drivers/karnov.c
index 5df6258db1b..b6fa68a4740 100644
--- a/src/mame/drivers/karnov.c
+++ b/src/mame/drivers/karnov.c
@@ -44,7 +44,7 @@
PALETTE_INIT( karnov );
VIDEO_UPDATE( karnov );
-WRITE16_HANDLER( karnov_playfield_w );
+WRITE16_HANDLER( karnov_playfield_swap_w );
WRITE16_HANDLER( karnov_videoram_w );
void karnov_flipscreen_w(int data);
@@ -354,7 +354,8 @@ static ADDRESS_MAP_START( karnov_writemem, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x080000, 0x080fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
AM_RANGE(0x0a0000, 0x0a07ff) AM_WRITE(karnov_videoram_w) AM_BASE(&videoram16)
AM_RANGE(0x0a0800, 0x0a0fff) AM_WRITE(karnov_videoram_w) /* Wndrplnt Mirror */
- AM_RANGE(0x0a1000, 0x0a1fff) AM_WRITE(karnov_playfield_w) AM_BASE(&karnov_pf_data)
+ AM_RANGE(0x0a1000, 0x0a17ff) AM_WRITE(SMH_RAM) AM_BASE(&karnov_pf_data)
+ AM_RANGE(0x0a1800, 0x0a1fff) AM_WRITE(karnov_playfield_swap_w)
AM_RANGE(0x0c0000, 0x0c000f) AM_WRITE(karnov_control_w)
ADDRESS_MAP_END
diff --git a/src/mame/video/40love.c b/src/mame/video/40love.c
index d6a07e89d3f..3be3263c1dc 100644
--- a/src/mame/video/40love.c
+++ b/src/mame/video/40love.c
@@ -107,8 +107,8 @@ VIDEO_START( fortyl )
fortyl_pixram1 = auto_malloc(0x4000);
fortyl_pixram2 = auto_malloc(0x4000);
- pixel_bitmap1 = auto_bitmap_alloc(256,256,machine->screen[0].format);
- pixel_bitmap2 = auto_bitmap_alloc(256,256,machine->screen[0].format);
+ pixel_bitmap1 = auto_bitmap_alloc(256,256,video_screen_get_format(machine->primary_screen));
+ pixel_bitmap2 = auto_bitmap_alloc(256,256,video_screen_get_format(machine->primary_screen));
background = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8,8,64,32);
diff --git a/src/mame/video/airbustr.c b/src/mame/video/airbustr.c
index c4d25c5f507..ec101d96b44 100644
--- a/src/mame/video/airbustr.c
+++ b/src/mame/video/airbustr.c
@@ -115,13 +115,10 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( airbustr )
{
- bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
- 16, 16, 32, 32);
+ bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
+ fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
- fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
- 16, 16, 32, 32);
-
- sprites_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
+ sprites_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
tilemap_set_transparent_pen(fg_tilemap, 0);
pandora_start(1,0,0);
diff --git a/src/mame/video/argus.c b/src/mame/video/argus.c
index 6cfcab8b4e6..c3e8d87c240 100644
--- a/src/mame/video/argus.c
+++ b/src/mame/video/argus.c
@@ -327,13 +327,13 @@ VIDEO_START( argus )
VIDEO_START( valtric )
{
- /* info offset type w h col row */
- bg1_tilemap = tilemap_create(valtric_get_bg_tile_info, tilemap_scan_cols, 16, 16, 32, 32);
- tx_tilemap = tilemap_create(valtric_get_tx_tile_info, tilemap_scan_cols, 8, 8, 32, 32);
+ /* info offset w h col row */
+ bg1_tilemap = tilemap_create(valtric_get_bg_tile_info, tilemap_scan_cols, 16, 16, 32, 32);
+ tx_tilemap = tilemap_create(valtric_get_tx_tile_info, tilemap_scan_cols, 8, 8, 32, 32);
tilemap_set_transparent_pen( bg1_tilemap, 15 );
tilemap_set_transparent_pen( tx_tilemap, 15 );
- mosaicbitmap=auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
+ mosaicbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
jal_blend_table = auto_malloc(0xc00);
memset(jal_blend_table,0,0xc00) ;
}
diff --git a/src/mame/video/atarimo.c b/src/mame/video/atarimo.c
index a818e793754..4082d444bcb 100644
--- a/src/mame/video/atarimo.c
+++ b/src/mame/video/atarimo.c
@@ -405,7 +405,7 @@ void atarimo_init(running_machine *machine, int map, const struct atarimo_desc *
mo->last_link = -1;
/* allocate the temp bitmap */
- mo->bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ mo->bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
fillbitmap(mo->bitmap, desc->transpen, NULL);
/* allocate the spriteram */
diff --git a/src/mame/video/battlera.c b/src/mame/video/battlera.c
index cd03b838fc7..a95dbf09a9e 100644
--- a/src/mame/video/battlera.c
+++ b/src/mame/video/battlera.c
@@ -35,8 +35,8 @@ VIDEO_START( battlera )
memset(sprite_dirty,1,0x400);
memset(vram_dirty,1,0x1000);
- tile_bitmap=auto_bitmap_alloc(512,512,machine->screen[0].format);
- front_bitmap=auto_bitmap_alloc(512,512,machine->screen[0].format);
+ tile_bitmap=auto_bitmap_alloc(512,512,video_screen_get_format(machine->primary_screen));
+ front_bitmap=auto_bitmap_alloc(512,512,video_screen_get_format(machine->primary_screen));
vram_ptr=0;
inc_value=1;
diff --git a/src/mame/video/bigevglf.c b/src/mame/video/bigevglf.c
index c7837e20d46..d0e86340788 100644
--- a/src/mame/video/bigevglf.c
+++ b/src/mame/video/bigevglf.c
@@ -62,10 +62,10 @@ READ8_HANDLER( bigevglf_vidram_r )
VIDEO_START( bigevglf )
{
- tmp_bitmap[0] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
- tmp_bitmap[1] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
- tmp_bitmap[2] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
- tmp_bitmap[3] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
+ tmp_bitmap[0] = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ tmp_bitmap[1] = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ tmp_bitmap[2] = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ tmp_bitmap[3] = video_screen_auto_bitmap_alloc(machine->primary_screen);
vidram = auto_malloc(0x100*0x100 * 4);
}
diff --git a/src/mame/video/bishi.c b/src/mame/video/bishi.c
index 4b7bd47b816..5bb23d55b0c 100644
--- a/src/mame/video/bishi.c
+++ b/src/mame/video/bishi.c
@@ -25,7 +25,7 @@ static void bishi_tile_callback(int layer, int *code, int *color, int *flags)
VIDEO_START(bishi)
{
- assert(machine->screen[0].format == BITMAP_FORMAT_RGB32);
+ assert(video_screen_get_format(machine->primary_screen) == BITMAP_FORMAT_RGB32);
K055555_vh_start();
K054338_vh_start();
diff --git a/src/mame/video/bking.c b/src/mame/video/bking.c
index c1237da3683..bd4bb61d776 100644
--- a/src/mame/video/bking.c
+++ b/src/mame/video/bking.c
@@ -247,8 +247,8 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( bking )
{
bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
- helper0 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
- helper1 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ helper0 = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ helper1 = video_screen_auto_bitmap_alloc(machine->primary_screen);
}
diff --git a/src/mame/video/blockout.c b/src/mame/video/blockout.c
index 8ad71826823..aa60deb7069 100644
--- a/src/mame/video/blockout.c
+++ b/src/mame/video/blockout.c
@@ -62,7 +62,7 @@ WRITE16_HANDLER( blockout_frontcolor_w )
VIDEO_START( blockout )
{
/* Allocate temporary bitmaps */
- tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
+ tmpbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
}
diff --git a/src/mame/video/btime.c b/src/mame/video/btime.c
index 74cc496e4d3..3f424b6739a 100644
--- a/src/mame/video/btime.c
+++ b/src/mame/video/btime.c
@@ -147,7 +147,10 @@ VIDEO_START( btime )
VIDEO_START( bnj )
{
/* the background area is twice as wide as the screen */
- background_bitmap = auto_bitmap_alloc(2*machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
+ int width = video_screen_get_width(machine->primary_screen);
+ int height = video_screen_get_height(machine->primary_screen);
+ bitmap_format format = video_screen_get_format(machine->primary_screen);
+ background_bitmap = auto_bitmap_alloc(2*width, height, format);
VIDEO_START_CALL(btime);
}
diff --git a/src/mame/video/buggychl.c b/src/mame/video/buggychl.c
index 7e654a28e2f..ea23960edc3 100644
--- a/src/mame/video/buggychl.c
+++ b/src/mame/video/buggychl.c
@@ -29,8 +29,8 @@ PALETTE_INIT( buggychl )
VIDEO_START( buggychl )
{
dirtychar = auto_malloc(256 * sizeof(*dirtychar));
- tmpbitmap1 = auto_bitmap_alloc(256,256,machine->screen[0].format);
- tmpbitmap2 = auto_bitmap_alloc(256,256,machine->screen[0].format);
+ tmpbitmap1 = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ tmpbitmap2 = video_screen_auto_bitmap_alloc(machine->primary_screen);
memset(dirtychar,0xff,256 * sizeof(*dirtychar));
}
diff --git a/src/mame/video/carpolo.c b/src/mame/video/carpolo.c
index 7131f4f93d4..f704b83fa1c 100644
--- a/src/mame/video/carpolo.c
+++ b/src/mame/video/carpolo.c
@@ -160,13 +160,15 @@ PALETTE_INIT( carpolo )
VIDEO_START( carpolo )
{
- sprite_sprite_collision_bitmap1 = auto_bitmap_alloc(SPRITE_WIDTH*2,SPRITE_HEIGHT*2,machine->screen[0].format);
- sprite_sprite_collision_bitmap2 = auto_bitmap_alloc(SPRITE_WIDTH*2,SPRITE_HEIGHT*2,machine->screen[0].format);
+ bitmap_format format = video_screen_get_format(machine->primary_screen);
- sprite_goal_collision_bitmap1 = auto_bitmap_alloc(SPRITE_WIDTH+GOAL_WIDTH,SPRITE_HEIGHT+GOAL_HEIGHT,machine->screen[0].format);
- sprite_goal_collision_bitmap2 = auto_bitmap_alloc(SPRITE_WIDTH+GOAL_WIDTH,SPRITE_HEIGHT+GOAL_HEIGHT,machine->screen[0].format);
+ sprite_sprite_collision_bitmap1 = auto_bitmap_alloc(SPRITE_WIDTH*2, SPRITE_HEIGHT*2, format);
+ sprite_sprite_collision_bitmap2 = auto_bitmap_alloc(SPRITE_WIDTH*2, SPRITE_HEIGHT*2, format);
- sprite_border_collision_bitmap = auto_bitmap_alloc(SPRITE_WIDTH,SPRITE_HEIGHT,machine->screen[0].format);
+ sprite_goal_collision_bitmap1 = auto_bitmap_alloc(SPRITE_WIDTH+GOAL_WIDTH, SPRITE_HEIGHT+GOAL_HEIGHT, format);
+ sprite_goal_collision_bitmap2 = auto_bitmap_alloc(SPRITE_WIDTH+GOAL_WIDTH, SPRITE_HEIGHT+GOAL_HEIGHT, format);
+
+ sprite_border_collision_bitmap = auto_bitmap_alloc(SPRITE_WIDTH, SPRITE_HEIGHT, format);
}
diff --git a/src/mame/video/ccastles.c b/src/mame/video/ccastles.c
index 5dd5af523ae..128627926a2 100644
--- a/src/mame/video/ccastles.c
+++ b/src/mame/video/ccastles.c
@@ -53,7 +53,7 @@ VIDEO_START( ccastles )
3, resistances, bweights, 1000, 0);
/* allocate a bitmap for drawing sprites */
- spritebitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ spritebitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
/* register for savestates */
state_save_register_global_array(video_control);
diff --git a/src/mame/video/changela.c b/src/mame/video/changela.c
index 59b77d16d0d..d7edba1fe61 100644
--- a/src/mame/video/changela.c
+++ b/src/mame/video/changela.c
@@ -42,10 +42,10 @@ VIDEO_START( changela )
memory_devices = auto_malloc(4 * 0x800); /* 0 - not connected, 1,2,3 - RAMs*/
tree_ram = auto_malloc(2 * 0x20);
- obj0_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
- river_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
- tree0_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
- tree1_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ obj0_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ river_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ tree0_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ tree1_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
changela_scanline_timer = timer_alloc(changela_scanline_callback, NULL);
timer_adjust_oneshot(changela_scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, 30, 0), 30);
diff --git a/src/mame/video/cloud9.c b/src/mame/video/cloud9.c
index b8c8d320fd0..30b57f7ce53 100644
--- a/src/mame/video/cloud9.c
+++ b/src/mame/video/cloud9.c
@@ -54,7 +54,7 @@ VIDEO_START( cloud9 )
3, resistances, bweights, 1000, 0);
/* allocate a bitmap for drawing sprites */
- spritebitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ spritebitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
/* register for savestates */
state_save_register_global_pointer(videoram, 0x8000);
diff --git a/src/mame/video/cvs.c b/src/mame/video/cvs.c
index f49028830e4..6de325c03c7 100644
--- a/src/mame/video/cvs.c
+++ b/src/mame/video/cvs.c
@@ -189,9 +189,9 @@ VIDEO_START( cvs )
s2636_2 = s2636_config(cvs_s2636_2_ram, machine->screen[0].height, machine->screen[0].width, CVS_S2636_Y_OFFSET, CVS_S2636_X_OFFSET);
/* create helper bitmaps */
- background_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
- cvs_collision_background = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
- scrolled_collision_background = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ background_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ cvs_collision_background = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ scrolled_collision_background = video_screen_auto_bitmap_alloc(machine->primary_screen);
}
diff --git a/src/mame/video/dcheese.c b/src/mame/video/dcheese.c
index 7dab419e70a..de30e7c9e0a 100644
--- a/src/mame/video/dcheese.c
+++ b/src/mame/video/dcheese.c
@@ -108,7 +108,7 @@ static TIMER_CALLBACK( dcheese_signal_irq_callback )
VIDEO_START( dcheese )
{
/* the destination bitmap is not directly accessible to the CPU */
- dstbitmap = auto_bitmap_alloc(DSTBITMAP_WIDTH, DSTBITMAP_HEIGHT, machine->screen[0].format);
+ dstbitmap = auto_bitmap_alloc(DSTBITMAP_WIDTH, DSTBITMAP_HEIGHT, video_screen_get_format(machine->primary_screen));
/* create a timer */
blitter_timer = timer_alloc(blitter_scanline_callback, NULL);
diff --git a/src/mame/video/dday.c b/src/mame/video/dday.c
index e69594ffda8..6d73f0b7202 100644
--- a/src/mame/video/dday.c
+++ b/src/mame/video/dday.c
@@ -221,7 +221,7 @@ VIDEO_START( dday )
text_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_rows,8,8,32,32);
sl_tilemap = tilemap_create(get_sl_tile_info, tilemap_scan_rows,8,8,32,32);
- main_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
+ main_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
tilemap_set_transmask(bg_tilemap,0,0x00f0,0xff0f); /* pens 0-3 have priority over the foreground layer */
diff --git a/src/mame/video/dkong.c b/src/mame/video/dkong.c
index d9519333535..97a2bd608ec 100644
--- a/src/mame/video/dkong.c
+++ b/src/mame/video/dkong.c
@@ -894,7 +894,7 @@ VIDEO_START( dkong )
switch (state->hardware_type)
{
case HARDWARE_TRS02:
- state->bg_bits = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ state->bg_bits = video_screen_auto_bitmap_alloc(machine->primary_screen);
state->scanline_timer = timer_alloc(scanline_callback, NULL);
timer_adjust_oneshot(state->scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0);
/* fall through */
@@ -907,7 +907,7 @@ VIDEO_START( dkong )
state->bg_tilemap = tilemap_create(radarsc1_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_scrolldx(state->bg_tilemap, 0, 128);
- state->bg_bits = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ state->bg_bits = video_screen_auto_bitmap_alloc(machine->primary_screen);
state->scanline_timer = timer_alloc(scanline_callback, NULL);
timer_adjust_oneshot(state->scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0);
diff --git a/src/mame/video/dogfgt.c b/src/mame/video/dogfgt.c
index 3be26e9c6eb..715fdd8e2a0 100644
--- a/src/mame/video/dogfgt.c
+++ b/src/mame/video/dogfgt.c
@@ -85,7 +85,7 @@ VIDEO_START( dogfgt )
bitmapram = auto_malloc(BITMAPRAM_SIZE);
- pixbitmap = auto_bitmap_alloc(256,256,machine->screen[0].format);
+ pixbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
}
diff --git a/src/mame/video/eolith.c b/src/mame/video/eolith.c
index 06e0e2a8e32..9ee022a5696 100644
--- a/src/mame/video/eolith.c
+++ b/src/mame/video/eolith.c
@@ -63,8 +63,8 @@ READ32_HANDLER( eolith_vram_r )
VIDEO_START( eolith )
{
eo_vram = auto_malloc(0x40000*2);
- bitmaps[0] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
- bitmaps[1] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
+ bitmaps[0] = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ bitmaps[1] = video_screen_auto_bitmap_alloc(machine->primary_screen);
}
VIDEO_UPDATE( eolith )
diff --git a/src/mame/video/equites.c b/src/mame/video/equites.c
index 519a8f8cb4a..e268ddfc8c2 100644
--- a/src/mame/video/equites.c
+++ b/src/mame/video/equites.c
@@ -224,13 +224,13 @@ VIDEO_START( splndrbt )
UINT8 *buf8ptr;
int i;
- assert(machine->screen[0].format == BITMAP_FORMAT_INDEXED16);
+ assert(video_screen_get_format(machine->primary_screen) == BITMAP_FORMAT_INDEXED16);
halfclip = machine->screen[0].visarea;
i = halfclip.max_y - halfclip.min_y + 1;
halfclip.max_y = halfclip.min_y + (i >> 1) - 1;
- tmpbitmap = auto_bitmap_alloc(BMW, BMW, machine->screen[0].format);
+ tmpbitmap = auto_bitmap_alloc(BMW, BMW, video_screen_get_format(machine->primary_screen));
charmap0 = tilemap_create(splndrbt_char0info, tilemap_scan_cols, 8, 8, 32, 32);
tilemap_set_transparent_pen(charmap0, 0);
diff --git a/src/mame/video/exidy.c b/src/mame/video/exidy.c
index 1743f733c01..95b21b2b4b8 100644
--- a/src/mame/video/exidy.c
+++ b/src/mame/video/exidy.c
@@ -54,10 +54,12 @@ void exidy_video_config(UINT8 _collision_mask, UINT8 _collision_invert, int _is_
VIDEO_START( exidy )
{
- background_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
- motion_object_1_vid = auto_bitmap_alloc(16, 16, machine->screen[0].format);
- motion_object_2_vid = auto_bitmap_alloc(16, 16, machine->screen[0].format);
- motion_object_2_clip = auto_bitmap_alloc(16, 16, machine->screen[0].format);
+ bitmap_format format = video_screen_get_format(machine->primary_screen);
+
+ background_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ motion_object_1_vid = auto_bitmap_alloc(16, 16, format);
+ motion_object_2_vid = auto_bitmap_alloc(16, 16, format);
+ motion_object_2_clip = auto_bitmap_alloc(16, 16, format);
}
diff --git a/src/mame/video/fgoal.c b/src/mame/video/fgoal.c
index eb3d58df5f3..654f0f98df7 100644
--- a/src/mame/video/fgoal.c
+++ b/src/mame/video/fgoal.c
@@ -36,8 +36,8 @@ WRITE8_HANDLER( fgoal_xpos_w )
VIDEO_START( fgoal )
{
- fgbitmap = auto_bitmap_alloc(256, 256, machine->screen[0].format);
- bgbitmap = auto_bitmap_alloc(256, 256, machine->screen[0].format);
+ fgbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ bgbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
}
diff --git a/src/mame/video/finalizr.c b/src/mame/video/finalizr.c
index ebc4be8df83..ec8bce47aea 100644
--- a/src/mame/video/finalizr.c
+++ b/src/mame/video/finalizr.c
@@ -51,7 +51,7 @@ PALETTE_INIT( finalizr )
VIDEO_START( finalizr )
{
- tmpbitmap = auto_bitmap_alloc(256,256,machine->screen[0].format);
+ tmpbitmap = auto_bitmap_alloc(256,256,video_screen_get_format(machine->primary_screen));
}
diff --git a/src/mame/video/firetrk.c b/src/mame/video/firetrk.c
index 66219e4304c..3bab5001162 100644
--- a/src/mame/video/firetrk.c
+++ b/src/mame/video/firetrk.c
@@ -234,8 +234,8 @@ static TILE_GET_INFO( montecar_get_tile_info2 )
VIDEO_START( firetrk )
{
- helper1 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
- helper2 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ helper1 = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ helper2 = video_screen_auto_bitmap_alloc(machine->primary_screen);
tilemap1 = tilemap_create(firetrk_get_tile_info1, tilemap_scan_rows, 16, 16, 16, 16);
tilemap2 = tilemap_create(firetrk_get_tile_info2, tilemap_scan_rows, 16, 16, 16, 16);
@@ -244,8 +244,8 @@ VIDEO_START( firetrk )
VIDEO_START( superbug )
{
- helper1 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
- helper2 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ helper1 = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ helper2 = video_screen_auto_bitmap_alloc(machine->primary_screen);
tilemap1 = tilemap_create(superbug_get_tile_info1, tilemap_scan_rows, 16, 16, 16, 16);
tilemap2 = tilemap_create(superbug_get_tile_info2, tilemap_scan_rows, 16, 16, 16, 16);
@@ -254,8 +254,8 @@ VIDEO_START( superbug )
VIDEO_START( montecar )
{
- helper1 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
- helper2 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ helper1 = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ helper2 = video_screen_auto_bitmap_alloc(machine->primary_screen);
tilemap1 = tilemap_create(montecar_get_tile_info1, tilemap_scan_rows, 16, 16, 16, 16);
tilemap2 = tilemap_create(montecar_get_tile_info2, tilemap_scan_rows, 16, 16, 16, 16);
diff --git a/src/mame/video/gaelco3d.c b/src/mame/video/gaelco3d.c
index 1a3efdbc218..61409eced15 100644
--- a/src/mame/video/gaelco3d.c
+++ b/src/mame/video/gaelco3d.c
@@ -78,7 +78,7 @@ VIDEO_START( gaelco3d )
poly = poly_alloc(2000, sizeof(poly_extra_data), 0);
add_exit_callback(machine, gaelco3d_exit);
- screenbits = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ screenbits = video_screen_auto_bitmap_alloc(machine->primary_screen);
zbuffer = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16);
diff --git a/src/mame/video/galaxian.c b/src/mame/video/galaxian.c
index 317782d59d3..8da42e0d065 100644
--- a/src/mame/video/galaxian.c
+++ b/src/mame/video/galaxian.c
@@ -1019,7 +1019,7 @@ VIDEO_START( dambustr )
draw_bullets = dambustr_draw_bullets;
/* allocate the temporary bitmap for the background priority */
- dambustr_tmpbitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ dambustr_tmpbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
/* make a copy of the tilemap to emulate background priority */
dambustr_videoram2 = auto_malloc(0x0400);
diff --git a/src/mame/video/galpanic.c b/src/mame/video/galpanic.c
index c3ba9f4a6bf..a23fb915fab 100644
--- a/src/mame/video/galpanic.c
+++ b/src/mame/video/galpanic.c
@@ -9,8 +9,8 @@ static bitmap_t *sprites_bitmap;
VIDEO_START( galpanic )
{
- tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
- sprites_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
+ tmpbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ sprites_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
pandora_start(0,0, -16);
}
diff --git a/src/mame/video/glass.c b/src/mame/video/glass.c
index 9e006412f8d..5eef51fe533 100644
--- a/src/mame/video/glass.c
+++ b/src/mame/video/glass.c
@@ -133,7 +133,7 @@ VIDEO_START( glass )
{
pant[0] = tilemap_create(get_tile_info_glass_screen0,tilemap_scan_rows,16,16,32,32);
pant[1] = tilemap_create(get_tile_info_glass_screen1,tilemap_scan_rows,16,16,32,32);
- screen_bitmap = auto_bitmap_alloc (320, 200, machine->screen[0].format);
+ screen_bitmap = auto_bitmap_alloc (320, 200, video_screen_get_format(machine->primary_screen));
tilemap_set_transparent_pen(pant[0],0);
tilemap_set_transparent_pen(pant[1],0);
diff --git a/src/mame/video/goldstar.c b/src/mame/video/goldstar.c
index 54c9f4bdcfe..92f3ddb87de 100644
--- a/src/mame/video/goldstar.c
+++ b/src/mame/video/goldstar.c
@@ -29,10 +29,10 @@ VIDEO_START( goldstar )
// int i;
/* the background area is half as high as the screen */
- tmpbitmap1 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
- tmpbitmap2 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
- tmpbitmap3 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
- tmpbitmap4 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
+ tmpbitmap1 = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ tmpbitmap2 = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ tmpbitmap3 = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ tmpbitmap4 = video_screen_auto_bitmap_alloc(machine->primary_screen);
}
diff --git a/src/mame/video/gomoku.c b/src/mame/video/gomoku.c
index 042e866cf46..c8a93e8cbbb 100644
--- a/src/mame/video/gomoku.c
+++ b/src/mame/video/gomoku.c
@@ -119,7 +119,7 @@ VIDEO_START( gomoku )
int bgdata;
int color;
- gomoku_bg_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ gomoku_bg_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,32, 32);
diff --git a/src/mame/video/grchamp.c b/src/mame/video/grchamp.c
index b68b74783c9..af9ec1107c7 100644
--- a/src/mame/video/grchamp.c
+++ b/src/mame/video/grchamp.c
@@ -108,7 +108,7 @@ VIDEO_START( grchamp )
{
grchamp_state *state = machine->driver_data;
- state->work_bitmap = auto_bitmap_alloc(32,32,machine->screen[0].format);
+ state->work_bitmap = auto_bitmap_alloc(32,32,video_screen_get_format(machine->primary_screen));
/* allocate tilemaps for each of the three sections */
state->text_tilemap = tilemap_create(get_text_tile_info, tilemap_scan_rows, 8,8, 32,32);
diff --git a/src/mame/video/gticlub.c b/src/mame/video/gticlub.c
index 12e9a5358b9..87bf9895e87 100644
--- a/src/mame/video/gticlub.c
+++ b/src/mame/video/gticlub.c
@@ -181,8 +181,8 @@ void K001005_swap_buffers(void);
void K001005_init(void)
{
int i;
- K001005_bitmap[0] = auto_bitmap_alloc(Machine->screen[0].width, Machine->screen[0].height, Machine->screen[0].format);
- K001005_bitmap[1] = auto_bitmap_alloc(Machine->screen[0].width, Machine->screen[0].height, Machine->screen[0].format);
+ K001005_bitmap[0] = video_screen_auto_bitmap_alloc(Machine->primary_screen);
+ K001005_bitmap[1] = video_screen_auto_bitmap_alloc(Machine->primary_screen);
K001005_zbuffer = auto_bitmap_alloc(Machine->screen[0].width, Machine->screen[0].height, BITMAP_FORMAT_INDEXED32);
diff --git a/src/mame/video/hyhoo.c b/src/mame/video/hyhoo.c
index 7c92c47f6df..1a25248e5ee 100644
--- a/src/mame/video/hyhoo.c
+++ b/src/mame/video/hyhoo.c
@@ -232,7 +232,7 @@ void hyhoo_gfxdraw(void)
VIDEO_START( hyhoo )
{
- hyhoo_tmpbitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ hyhoo_tmpbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
}
diff --git a/src/mame/video/ikki.c b/src/mame/video/ikki.c
index 5a1b0f15509..d33028c8789 100644
--- a/src/mame/video/ikki.c
+++ b/src/mame/video/ikki.c
@@ -120,7 +120,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
VIDEO_START( ikki )
{
- sprite_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ sprite_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
}
diff --git a/src/mame/video/kan_pand.c b/src/mame/video/kan_pand.c
index d953bc6b012..3d023882308 100644
--- a/src/mame/video/kan_pand.c
+++ b/src/mame/video/kan_pand.c
@@ -182,7 +182,7 @@ void pandora_start(UINT8 region, int x, int y)
pandora_spriteram = auto_malloc(0x1000);
memset(pandora_spriteram,0x00, 0x1000);
- pandora_sprites_bitmap = auto_bitmap_alloc(Machine->screen[0].width,Machine->screen[0].height,Machine->screen[0].format);
+ pandora_sprites_bitmap = video_screen_auto_bitmap_alloc(Machine->primary_screen);
pandora_clear_bitmap = 1;
}
diff --git a/src/mame/video/kaneko16.c b/src/mame/video/kaneko16.c
index 502405cacd1..21d094b131c 100644
--- a/src/mame/video/kaneko16.c
+++ b/src/mame/video/kaneko16.c
@@ -141,7 +141,7 @@ VIDEO_START( kaneko16_1xVIEW2 )
kaneko16_tmap_3 = 0;
- sprites_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
+ sprites_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
{
int dx, xdim = machine->screen[0].width;
diff --git a/src/mame/video/karnov.c b/src/mame/video/karnov.c
index fb83256e418..4bae3bb7a33 100644
--- a/src/mame/video/karnov.c
+++ b/src/mame/video/karnov.c
@@ -6,7 +6,6 @@
#include "driver.h"
-static UINT8 *dirty_f;
static bitmap_t *bitmap_f;
UINT16 karnov_scroll[2], *karnov_pf_data;
static tilemap *fix_tilemap;
@@ -70,11 +69,7 @@ PALETTE_INIT( karnov )
void karnov_flipscreen_w(int data)
{
- static int last_flip;
flipscreen=data;
- if (flipscreen!=last_flip)
- memset(dirty_f,1,0x800);
- last_flip=flipscreen;
tilemap_set_flip(ALL_TILEMAPS,flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
}
@@ -86,14 +81,11 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
if (flipscreen) fx=fy=1; else fx=fy=0;
- /* 1st area is stored along X-axis... */
mx=-1; my=0;
for (offs = 0;offs < 0x400; offs ++) {
mx++;
if (mx==32) {mx=0; my++;}
- if (!dirty_f[offs]) continue; else dirty_f[offs]=0;
-
tile=karnov_pf_data[offs];
color = tile >> 12;
tile = tile&0x7ff;
@@ -107,28 +99,6 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
0,TRANSPARENCY_NONE,0);
}
- /* 2nd area is stored along Y-axis... */
- mx=0; my=-1;
- for (offs = 0x400 ;offs < 0x800; offs ++) {
- my++;
- if (my==32) {my=0; mx++;}
-
- if (!dirty_f[offs]) continue; else dirty_f[offs]=0;
-
- tile=karnov_pf_data[offs];
- color = tile >> 12;
- tile=tile&0x7ff;
-
- if (flipscreen)
- drawgfx(bitmap_f,machine->gfx[1],tile,
- color, fx, fy, 496-16*mx,496-16*my,
- 0,TRANSPARENCY_NONE,0);
- else
- drawgfx(bitmap_f,machine->gfx[1],tile,
- color, fx, fy, 16*mx,16*my,
- 0,TRANSPARENCY_NONE,0);
- }
-
if (!flipscreen) {
scrolly=-scrolly;
scrollx=-scrollx;
@@ -224,10 +194,10 @@ WRITE16_HANDLER( karnov_videoram_w )
tilemap_mark_tile_dirty(fix_tilemap,offset);
}
-WRITE16_HANDLER( karnov_playfield_w )
+WRITE16_HANDLER( karnov_playfield_swap_w )
{
+ offset = ((offset & 0x1f) << 5) | ((offset & 0x3e0) >> 5);
COMBINE_DATA(&karnov_pf_data[offset]);
- dirty_f[offset] = 1;
}
/******************************************************************************/
@@ -235,10 +205,7 @@ WRITE16_HANDLER( karnov_playfield_w )
VIDEO_START( karnov )
{
/* Allocate bitmaps */
- bitmap_f = auto_bitmap_alloc(512,512,machine->screen[0].format);
-
- dirty_f=auto_malloc(0x800);
- memset(dirty_f,1,0x800);
+ bitmap_f = auto_bitmap_alloc(512,512,video_screen_get_format(machine->primary_screen));
fix_tilemap=tilemap_create(get_fix_tile_info,tilemap_scan_rows,8,8,32,32);
@@ -248,10 +215,7 @@ VIDEO_START( karnov )
VIDEO_START( wndrplnt )
{
/* Allocate bitmaps */
- bitmap_f = auto_bitmap_alloc(512,512,machine->screen[0].format);
-
- dirty_f=auto_malloc(0x800);
- memset(dirty_f,1,0x800);
+ bitmap_f = auto_bitmap_alloc(512,512,video_screen_get_format(machine->primary_screen));
fix_tilemap=tilemap_create(get_fix_tile_info,tilemap_scan_cols,8,8,32,32);
diff --git a/src/mame/video/mappy.c b/src/mame/video/mappy.c
index ec4f696cf91..a404c2228f8 100644
--- a/src/mame/video/mappy.c
+++ b/src/mame/video/mappy.c
@@ -323,7 +323,7 @@ static TILE_GET_INFO( mappy_get_tile_info )
VIDEO_START( superpac )
{
bg_tilemap = tilemap_create(superpac_get_tile_info,superpac_tilemap_scan,8,8,36,28);
- sprite_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
+ sprite_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
colortable_configure_tilemap_groups(machine->colortable, bg_tilemap, machine->gfx[0], 31);
diff --git a/src/mame/video/model3.c b/src/mame/video/model3.c
index b071b2f7308..1236888d8af 100644
--- a/src/mame/video/model3.c
+++ b/src/mame/video/model3.c
@@ -145,7 +145,7 @@ VIDEO_START( model3 )
poly = poly_alloc(4000, sizeof(poly_extra_data), 0);
add_exit_callback(machine, model3_exit);
- bitmap3d = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ bitmap3d = video_screen_auto_bitmap_alloc(machine->primary_screen);
zbuffer = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED32);
m3_char_ram = auto_malloc(0x100000);
diff --git a/src/mame/video/nbmj8891.c b/src/mame/video/nbmj8891.c
index 7a17ef22c46..e4b805c19bb 100644
--- a/src/mame/video/nbmj8891.c
+++ b/src/mame/video/nbmj8891.c
@@ -492,7 +492,7 @@ VIDEO_START( nbmj8891_1layer )
UINT8 *CLUT = memory_region(REGION_USER1);
int i;
- nbmj8891_tmpbitmap0 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ nbmj8891_tmpbitmap0 = video_screen_auto_bitmap_alloc(machine->primary_screen);
nbmj8891_videoram0 = auto_malloc(machine->screen[0].width * machine->screen[0].height * sizeof(char));
nbmj8891_palette = auto_malloc(0x200 * sizeof(char));
nbmj8891_clut = auto_malloc(0x800 * sizeof(char));
@@ -505,8 +505,8 @@ VIDEO_START( nbmj8891_1layer )
VIDEO_START( nbmj8891_2layer )
{
- nbmj8891_tmpbitmap0 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
- nbmj8891_tmpbitmap1 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ nbmj8891_tmpbitmap0 = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ nbmj8891_tmpbitmap1 = video_screen_auto_bitmap_alloc(machine->primary_screen);
nbmj8891_videoram0 = auto_malloc(machine->screen[0].width * machine->screen[0].height * sizeof(UINT8));
nbmj8891_videoram1 = auto_malloc(machine->screen[0].width * machine->screen[0].height * sizeof(UINT8));
nbmj8891_palette = auto_malloc(0x200 * sizeof(UINT8));
diff --git a/src/mame/video/nbmj8991.c b/src/mame/video/nbmj8991.c
index 63b7835d93b..7d5b303cc75 100644
--- a/src/mame/video/nbmj8991.c
+++ b/src/mame/video/nbmj8991.c
@@ -297,7 +297,7 @@ static void nbmj8991_gfxdraw(void)
******************************************************************************/
VIDEO_START( nbmj8991 )
{
- nbmj8991_tmpbitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ nbmj8991_tmpbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
nbmj8991_videoram = auto_malloc(machine->screen[0].width * machine->screen[0].height * sizeof(UINT8));
nbmj8991_clut = auto_malloc(0x800 * sizeof(UINT8));
memset(nbmj8991_videoram, 0x00, (machine->screen[0].width * machine->screen[0].height * sizeof(UINT8)));
diff --git a/src/mame/video/nbmj9195.c b/src/mame/video/nbmj9195.c
index a049de9db75..1a2c67be47a 100644
--- a/src/mame/video/nbmj9195.c
+++ b/src/mame/video/nbmj9195.c
@@ -405,7 +405,7 @@ WRITE8_HANDLER( nbmj9195_clut_1_w ) { nbmj9195_clut_w(1, offset, data); }
******************************************************************************/
VIDEO_START( nbmj9195_1layer )
{
- nbmj9195_tmpbitmap[0] = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ nbmj9195_tmpbitmap[0] = video_screen_auto_bitmap_alloc(machine->primary_screen);
nbmj9195_videoram[0] = auto_malloc(machine->screen[0].width * machine->screen[0].height * sizeof(UINT16));
nbmj9195_palette = auto_malloc(0x200 * sizeof(UINT8));
nbmj9195_clut[0] = auto_malloc(0x1000 * sizeof(UINT8));
@@ -417,8 +417,8 @@ VIDEO_START( nbmj9195_1layer )
VIDEO_START( nbmj9195_2layer )
{
- nbmj9195_tmpbitmap[0] = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
- nbmj9195_tmpbitmap[1] = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ nbmj9195_tmpbitmap[0] = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ nbmj9195_tmpbitmap[1] = video_screen_auto_bitmap_alloc(machine->primary_screen);
nbmj9195_videoram[0] = auto_malloc(machine->screen[0].width * machine->screen[0].height * sizeof(UINT16));
nbmj9195_videoram[1] = auto_malloc(machine->screen[0].width * machine->screen[0].height * sizeof(UINT16));
nbmj9195_palette = auto_malloc(0x200 * sizeof(UINT8));
@@ -433,8 +433,8 @@ VIDEO_START( nbmj9195_2layer )
VIDEO_START( nbmj9195_nb22090 )
{
- nbmj9195_tmpbitmap[0] = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
- nbmj9195_tmpbitmap[1] = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ nbmj9195_tmpbitmap[0] = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ nbmj9195_tmpbitmap[1] = video_screen_auto_bitmap_alloc(machine->primary_screen);
nbmj9195_videoram[0] = auto_malloc(machine->screen[0].width * machine->screen[0].height * sizeof(UINT16));
nbmj9195_videoram[1] = auto_malloc(machine->screen[0].width * machine->screen[0].height * sizeof(UINT16));
nbmj9195_videoworkram[0] = auto_malloc(machine->screen[0].width * machine->screen[0].height * sizeof(UINT16));
diff --git a/src/mame/video/ninjakd2.c b/src/mame/video/ninjakd2.c
index 45de542fc40..ca97273c0e3 100644
--- a/src/mame/video/ninjakd2.c
+++ b/src/mame/video/ninjakd2.c
@@ -140,7 +140,7 @@ static void videoram_alloc(const running_machine* const machine, int const size)
memset(robokid_bg2_videoram, 0x00, size);
}
- sp_bitmap = auto_bitmap_alloc (machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ sp_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
}
VIDEO_START( ninjakd2 )
diff --git a/src/mame/video/niyanpai.c b/src/mame/video/niyanpai.c
index 365ee33d431..96369d6407e 100644
--- a/src/mame/video/niyanpai.c
+++ b/src/mame/video/niyanpai.c
@@ -372,9 +372,9 @@ WRITE16_HANDLER( niyanpai_clutsel_2_w ) { niyanpai_clutsel_w(2, data); }
******************************************************************************/
VIDEO_START( niyanpai )
{
- niyanpai_tmpbitmap[0] = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
- niyanpai_tmpbitmap[1] = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
- niyanpai_tmpbitmap[2] = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ niyanpai_tmpbitmap[0] = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ niyanpai_tmpbitmap[1] = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ niyanpai_tmpbitmap[2] = video_screen_auto_bitmap_alloc(machine->primary_screen);
niyanpai_videoram[0] = auto_malloc(machine->screen[0].width * machine->screen[0].height * sizeof(short));
niyanpai_videoram[1] = auto_malloc(machine->screen[0].width * machine->screen[0].height * sizeof(short));
niyanpai_videoram[2] = auto_malloc(machine->screen[0].width * machine->screen[0].height * sizeof(short));
diff --git a/src/mame/video/ojankohs.c b/src/mame/video/ojankohs.c
index 229d01d23f5..6c28b70b24e 100644
--- a/src/mame/video/ojankohs.c
+++ b/src/mame/video/ojankohs.c
@@ -295,7 +295,7 @@ VIDEO_START( ojankoy )
VIDEO_START( ojankoc )
{
- ojankoc_tmpbitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ ojankoc_tmpbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
ojankohs_videoram = auto_malloc(0x8000);
ojankohs_paletteram = auto_malloc(0x20);
}
diff --git a/src/mame/video/pacland.c b/src/mame/video/pacland.c
index 5d7eb44c6dd..45ed2b60602 100644
--- a/src/mame/video/pacland.c
+++ b/src/mame/video/pacland.c
@@ -203,7 +203,7 @@ VIDEO_START( pacland )
{
int color;
- fg_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
+ fg_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
fillbitmap(fg_bitmap, 0xffff, NULL);
bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,8,8,64,32);
diff --git a/src/mame/video/paradise.c b/src/mame/video/paradise.c
index becc920927a..9643d4ef666 100644
--- a/src/mame/video/paradise.c
+++ b/src/mame/video/paradise.c
@@ -155,17 +155,12 @@ WRITE8_HANDLER( paradise_pixmap_w )
VIDEO_START( paradise )
{
- tilemap_0 = tilemap_create( get_tile_info_0, tilemap_scan_rows,
- 8,8, 0x20,0x20 );
-
- tilemap_1 = tilemap_create( get_tile_info_1, tilemap_scan_rows,
- 8,8, 0x20,0x20 );
-
- tilemap_2 = tilemap_create( get_tile_info_2, tilemap_scan_rows,
- 8,8, 0x20,0x20 );
+ tilemap_0 = tilemap_create( get_tile_info_0, tilemap_scan_rows, 8,8, 0x20,0x20 );
+ tilemap_1 = tilemap_create( get_tile_info_1, tilemap_scan_rows, 8,8, 0x20,0x20 );
+ tilemap_2 = tilemap_create( get_tile_info_2, tilemap_scan_rows, 8,8, 0x20,0x20 );
/* pixmap */
- tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
+ tmpbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
tilemap_set_transparent_pen(tilemap_0,0x0f);
tilemap_set_transparent_pen(tilemap_1,0xff);
diff --git a/src/mame/video/quasar.c b/src/mame/video/quasar.c
index 3ba5a178d36..d95221adfd6 100644
--- a/src/mame/video/quasar.c
+++ b/src/mame/video/quasar.c
@@ -106,7 +106,7 @@ VIDEO_START( quasar )
s2636_2 = s2636_config(cvs_s2636_2_ram, machine->screen[0].height, machine->screen[0].width, CVS_S2636_Y_OFFSET, CVS_S2636_X_OFFSET);
/* create helper bitmaps */
- cvs_collision_background = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ cvs_collision_background = video_screen_auto_bitmap_alloc(machine->primary_screen);
}
VIDEO_UPDATE( quasar )
diff --git a/src/mame/video/shangha3.c b/src/mame/video/shangha3.c
index 2cef9755641..0ca4f4367fc 100644
--- a/src/mame/video/shangha3.c
+++ b/src/mame/video/shangha3.c
@@ -75,7 +75,7 @@ static bitmap_t *rawbitmap;
VIDEO_START( shangha3 )
{
- rawbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
+ rawbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
if (shangha3_do_shadows)
{
diff --git a/src/mame/video/sprint2.c b/src/mame/video/sprint2.c
index 69cfbb7f532..4fe2db8e1c5 100644
--- a/src/mame/video/sprint2.c
+++ b/src/mame/video/sprint2.c
@@ -51,9 +51,9 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( sprint2 )
{
- helper = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ helper = video_screen_auto_bitmap_alloc(machine->primary_screen);
- bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 16, 8, 32, 32);
+ bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 16, 8, 32, 32);
}
diff --git a/src/mame/video/sprint4.c b/src/mame/video/sprint4.c
index 464ee157ed9..212a32dc504 100644
--- a/src/mame/video/sprint4.c
+++ b/src/mame/video/sprint4.c
@@ -53,9 +53,9 @@ static TILE_GET_INFO( sprint4_tile_info )
VIDEO_START( sprint4 )
{
- helper = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ helper = video_screen_auto_bitmap_alloc(machine->primary_screen);
- playfield = tilemap_create(sprint4_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
+ playfield = tilemap_create(sprint4_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
diff --git a/src/mame/video/sprint8.c b/src/mame/video/sprint8.c
index dda2b9e68e9..e0646d8fbd6 100644
--- a/src/mame/video/sprint8.c
+++ b/src/mame/video/sprint8.c
@@ -125,11 +125,11 @@ WRITE8_HANDLER( sprint8_video_ram_w )
VIDEO_START( sprint8 )
{
- helper1 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
- helper2 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ helper1 = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ helper2 = video_screen_auto_bitmap_alloc(machine->primary_screen);
- tilemap1 = tilemap_create(get_tile_info1, tilemap_scan_rows, 16, 8, 32, 32);
- tilemap2 = tilemap_create(get_tile_info2, tilemap_scan_rows, 16, 8, 32, 32);
+ tilemap1 = tilemap_create(get_tile_info1, tilemap_scan_rows, 16, 8, 32, 32);
+ tilemap2 = tilemap_create(get_tile_info2, tilemap_scan_rows, 16, 8, 32, 32);
tilemap_set_scrolly(tilemap1, 0, +24);
tilemap_set_scrolly(tilemap2, 0, +24);
diff --git a/src/mame/video/starshp1.c b/src/mame/video/starshp1.c
index d39f483ac56..cc7706d93b3 100644
--- a/src/mame/video/starshp1.c
+++ b/src/mame/video/starshp1.c
@@ -109,7 +109,7 @@ VIDEO_START( starshp1 )
val = (val << 1) | (bit & 1);
}
- helper = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ helper = video_screen_auto_bitmap_alloc(machine->primary_screen);
}
diff --git a/src/mame/video/system1.c b/src/mame/video/system1.c
index 14eebc8f175..a6c4233f974 100644
--- a/src/mame/video/system1.c
+++ b/src/mame/video/system1.c
@@ -122,7 +122,7 @@ VIDEO_START( system1 )
bg_dirtybuffer = auto_malloc(1024);
memset(bg_dirtybuffer,1,1024);
- tmp_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
+ tmp_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
state_save_register_func_postload(system1_postload);
state_save_register_global(system1_background_memory);
@@ -141,7 +141,7 @@ VIDEO_START( wbml )
wbml_paged_videoram = auto_malloc(0x4000); /* Allocate 16k for background banked ram */
memset(wbml_paged_videoram,0,0x4000);
- tmp_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
+ tmp_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
system1_sprite_xoffset = 1+7*2;
diff --git a/src/mame/video/taitojc.c b/src/mame/video/taitojc.c
index b5919623477..a23797a27e1 100644
--- a/src/mame/video/taitojc.c
+++ b/src/mame/video/taitojc.c
@@ -224,7 +224,7 @@ VIDEO_START( taitojc )
taitojc_texture = auto_malloc(0x400000);
- framebuffer = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ framebuffer = video_screen_auto_bitmap_alloc(machine->primary_screen);
zbuffer = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16);
}
diff --git a/src/mame/video/taitosj.c b/src/mame/video/taitosj.c
index cfa73209768..72f8dd4ed1f 100644
--- a/src/mame/video/taitosj.c
+++ b/src/mame/video/taitosj.c
@@ -207,8 +207,8 @@ VIDEO_START( taitosj )
for (i = 0; i < 3; i++)
{
- taitosj_layer_bitmap[i] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
- sprite_layer_collbitmap2[i] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
+ taitosj_layer_bitmap[i] = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ sprite_layer_collbitmap2[i] = video_screen_auto_bitmap_alloc(machine->primary_screen);
}
sprite_sprite_collbitmap1 = auto_bitmap_alloc(32,32,machine->screen[0].format);
diff --git a/src/mame/video/tank8.c b/src/mame/video/tank8.c
index 0cad5b3db1b..97de080cd97 100644
--- a/src/mame/video/tank8.c
+++ b/src/mame/video/tank8.c
@@ -115,9 +115,9 @@ static TILE_GET_INFO( tank8_get_tile_info )
VIDEO_START( tank8 )
{
- helper1 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
- helper2 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
- helper3 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ helper1 = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ helper2 = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ helper3 = video_screen_auto_bitmap_alloc(machine->primary_screen);
tank8_tilemap = tilemap_create(tank8_get_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
diff --git a/src/mame/video/tceptor.c b/src/mame/video/tceptor.c
index 48687eed647..953dce73278 100644
--- a/src/mame/video/tceptor.c
+++ b/src/mame/video/tceptor.c
@@ -425,7 +425,7 @@ VIDEO_START( tceptor )
decode_sprite32(machine, REGION_GFX4);
/* allocate temp bitmaps */
- temp_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ temp_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
namco_road_init(machine, gfx_index);
diff --git a/src/mame/video/triplhnt.c b/src/mame/video/triplhnt.c
index 4f9515a4db1..62bf2c6c94c 100644
--- a/src/mame/video/triplhnt.c
+++ b/src/mame/video/triplhnt.c
@@ -31,7 +31,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( triplhnt )
{
- helper = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ helper = video_screen_auto_bitmap_alloc(machine->primary_screen);
bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 16, 16, 16, 16);
}
diff --git a/src/mame/video/ultratnk.c b/src/mame/video/ultratnk.c
index 009d851726b..e23b39cd7ad 100644
--- a/src/mame/video/ultratnk.c
+++ b/src/mame/video/ultratnk.c
@@ -52,9 +52,9 @@ static TILE_GET_INFO( ultratnk_tile_info )
VIDEO_START( ultratnk )
{
- helper = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ helper = video_screen_auto_bitmap_alloc(machine->primary_screen);
- playfield = tilemap_create(ultratnk_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
+ playfield = tilemap_create(ultratnk_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
diff --git a/src/mame/video/vdc.c b/src/mame/video/vdc.c
index 6cd45d48dc7..f90a8d77fe3 100644
--- a/src/mame/video/vdc.c
+++ b/src/mame/video/vdc.c
@@ -361,7 +361,7 @@ VIDEO_START( pce )
memset(vdc[1].vram, 0, 0x10000);
/* create display bitmap */
- vce.bmp = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ vce.bmp = video_screen_auto_bitmap_alloc(machine->primary_screen);
vdc[0].inc = 1;
vdc[1].inc = 1;
diff --git a/src/mame/video/wolfpack.c b/src/mame/video/wolfpack.c
index fe8061fd22f..8a642dea6c1 100644
--- a/src/mame/video/wolfpack.c
+++ b/src/mame/video/wolfpack.c
@@ -125,7 +125,7 @@ VIDEO_START( wolfpack )
LFSR = auto_malloc(0x8000);
- helper = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
+ helper = video_screen_auto_bitmap_alloc(machine->primary_screen);
for (i = 0; i < 0x8000; i++)
{
diff --git a/src/mame/video/zac2650.c b/src/mame/video/zac2650.c
index 7f983f61264..0cc9999a602 100644
--- a/src/mame/video/zac2650.c
+++ b/src/mame/video/zac2650.c
@@ -134,8 +134,8 @@ VIDEO_START( tinvader )
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
24, 24, 32, 32);
- spritebitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
- tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
+ spritebitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
+ tmpbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
}
static void draw_sprites(running_machine *machine, bitmap_t *bitmap)