summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Zsolt Vasvari <zsoltvas@mamedev.org>2008-03-10 00:39:20 +0000
committer Zsolt Vasvari <zsoltvas@mamedev.org>2008-03-10 00:39:20 +0000
commit9b3ac2606efb11fe7dcbd5df687d9e7547170a48 (patch)
tree4b134d4acb359a39282445f459d7cf5ac67b4a6a
parent84a1d99c678490bcf907554335736595f8dc7b8c (diff)
Voodoo now takes a device_config for the screen
Added video_screen_get_visible_area()
-rw-r--r--src/emu/debug/debugcmd.c6
-rw-r--r--src/emu/video.c66
-rw-r--r--src/emu/video.h6
-rw-r--r--src/emu/video/vooddefs.h2
-rw-r--r--src/emu/video/voodoo.c39
-rw-r--r--src/emu/video/voodoo.h5
-rw-r--r--src/mame/drivers/gticlub.c7
-rw-r--r--src/mame/drivers/hornet.c17
-rw-r--r--src/mame/drivers/nwk-tr.c2
-rw-r--r--src/mame/drivers/seattle.c4
-rw-r--r--src/mame/drivers/vegas.c6
-rw-r--r--src/mame/drivers/viper.c2
12 files changed, 97 insertions, 65 deletions
diff --git a/src/emu/debug/debugcmd.c b/src/emu/debug/debugcmd.c
index 316e1331f76..d281370b5cc 100644
--- a/src/emu/debug/debugcmd.c
+++ b/src/emu/debug/debugcmd.c
@@ -2009,7 +2009,9 @@ static void execute_snap(int ref, int params, const char *param[])
UINT32 mask = render_get_live_screens_mask();
astring *fname;
- if (scrnum < 0 || scrnum >= MAX_SCREENS || !(mask & (1 << scrnum)))
+ const device_config *screen = device_list_find_by_index(Machine->config->devicelist, VIDEO_SCREEN, scrnum);
+
+ if ((screen == NULL) || !(mask & (1 << scrnum)))
{
debug_console_printf("Invalid screen number '%d'\n", scrnum);
return;
@@ -2027,7 +2029,7 @@ static void execute_snap(int ref, int params, const char *param[])
return;
}
- video_screen_save_snapshot(Machine, fp, scrnum);
+ video_screen_save_snapshot(screen, fp);
mame_fclose(fp);
debug_console_printf("Saved screen #%d snapshot as '%s'\n", scrnum, filename);
}
diff --git a/src/emu/video.c b/src/emu/video.c
index 94f76009962..70a9e9d20a5 100644
--- a/src/emu/video.c
+++ b/src/emu/video.c
@@ -193,7 +193,7 @@ static void update_frameskip(running_machine *machine);
static void recompute_speed(running_machine *machine, attotime emutime);
/* screen snapshots */
-static void create_snapshot_bitmap(running_machine *machine, int scrnum);
+static void create_snapshot_bitmap(const device_config *screen);
static file_error mame_fopen_next(running_machine *machine, const char *pathoption, const char *extension, mame_file **file);
/* movie recording */
@@ -830,12 +830,6 @@ void video_screen_set_visarea(const device_config *screen, int min_x, int max_x,
video_screen_configure(screen, state->width, state->height, &visarea, internal_state->frame_period);
}
-void video_screen_set_visarea_scrnum(int scrnum, int min_x, int max_x, int min_y, int max_y)
-{
- internal_screen_state *internal_state = get_internal_state(Machine, scrnum);
- video_screen_set_visarea(internal_state->device, min_x, max_x, min_y, max_y);
-}
-
/*-------------------------------------------------
get_internal_state - accessor function to get
@@ -1040,6 +1034,17 @@ int video_screen_get_hblank(const device_config *screen)
/*-------------------------------------------------
+ video_screen_get_visible_area - returns the
+ visible area a given screen
+-------------------------------------------------*/
+const rectangle *video_screen_get_visible_area(const device_config *screen)
+{
+ screen_state *state = get_safe_token(screen);
+ return &state->visarea;
+}
+
+
+/*-------------------------------------------------
video_screen_get_time_until_pos - returns the
amount of time remaining until the beam is
at the given hpos,vpos
@@ -2043,18 +2048,21 @@ static void recompute_speed(running_machine *machine, attotime emutime)
/* if we're past the "time-to-execute" requested, signal an exit */
if (global.seconds_to_run != 0 && emutime.seconds >= global.seconds_to_run)
{
- astring *fname = astring_assemble_2(astring_alloc(), machine->basename, PATH_SEPARATOR "final.png");
- file_error filerr;
- mame_file *file;
-
- /* create a final screenshot */
- filerr = mame_fopen(SEARCHPATH_SCREENSHOT, astring_c(fname), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS, &file);
- if (filerr == FILERR_NONE)
+ if (machine->primary_screen != NULL)
{
- video_screen_save_snapshot(machine, file, 0);
- mame_fclose(file);
+ astring *fname = astring_assemble_2(astring_alloc(), machine->basename, PATH_SEPARATOR "final.png");
+ file_error filerr;
+ mame_file *file;
+
+ /* create a final screenshot */
+ filerr = mame_fopen(SEARCHPATH_SCREENSHOT, astring_c(fname), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS, &file);
+ if (filerr == FILERR_NONE)
+ {
+ video_screen_save_snapshot(machine->primary_screen, file);
+ mame_fclose(file);
+ }
+ astring_free(fname);
}
- astring_free(fname);
/* schedule our demise */
mame_schedule_exit(machine);
@@ -2072,24 +2080,25 @@ static void recompute_speed(running_machine *machine, attotime emutime)
to the given file handle
-------------------------------------------------*/
-void video_screen_save_snapshot(running_machine *machine, mame_file *fp, int scrnum)
+void video_screen_save_snapshot(const device_config *screen, mame_file *fp)
{
- const rgb_t *palette = (machine->palette != NULL) ? palette_entry_list_adjusted(machine->palette) : NULL;
+ const rgb_t *palette;
png_info pnginfo = { 0 };
png_error error;
char text[256];
/* create the bitmap to pass in */
- create_snapshot_bitmap(machine, scrnum);
+ create_snapshot_bitmap(screen);
/* add two text entries describing the image */
sprintf(text, APPNAME " %s", build_version);
png_add_text(&pnginfo, "Software", text);
- sprintf(text, "%s %s", machine->gamedrv->manufacturer, machine->gamedrv->description);
+ sprintf(text, "%s %s", screen->machine->gamedrv->manufacturer, screen->machine->gamedrv->description);
png_add_text(&pnginfo, "System", text);
/* now do the actual work */
- error = png_write_bitmap(mame_core_file(fp), &pnginfo, global.snap_bitmap, machine->config->total_colors, palette);
+ palette = (screen->machine->palette != NULL) ? palette_entry_list_adjusted(screen->machine->palette) : NULL;
+ error = png_write_bitmap(mame_core_file(fp), &pnginfo, global.snap_bitmap, screen->machine->config->total_colors, palette);
/* free any data allocated */
png_free(&pnginfo);
@@ -2114,7 +2123,8 @@ void video_save_active_screen_snapshots(running_machine *machine)
file_error filerr = mame_fopen_next(machine, SEARCHPATH_SCREENSHOT, "png", &fp);
if (filerr == FILERR_NONE)
{
- video_screen_save_snapshot(machine, fp, scrnum);
+ const device_config *screen = device_list_find_by_index(machine->config->devicelist, VIDEO_SCREEN, scrnum);
+ video_screen_save_snapshot(screen, fp);
mame_fclose(fp);
}
}
@@ -2127,18 +2137,18 @@ void video_save_active_screen_snapshots(running_machine *machine)
given screen number
-------------------------------------------------*/
-static void create_snapshot_bitmap(running_machine *machine, int scrnum)
+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;
- assert(scrnum >= 0 && scrnum < MAX_SCREENS);
-
/* only do it, if there is at least one screen */
if (global.snap_target != NULL)
{
/* select the appropriate view in our dummy target */
- render_target_set_view(global.snap_target, scrnum);
+ render_target_set_view(global.snap_target, internal_state->scrnum);
/* get the minimum width/height and set it on the target */
render_target_get_minimum_size(global.snap_target, &width, &height);
@@ -2279,7 +2289,7 @@ static void movie_record_frame(const device_config *screen)
profiler_mark(PROFILER_MOVIE_REC);
/* create the bitmap */
- create_snapshot_bitmap(screen->machine, internal_state->scrnum);
+ create_snapshot_bitmap(screen);
/* track frames */
if (internal_state->movie_frame++ == 0)
diff --git a/src/emu/video.h b/src/emu/video.h
index 8e8c96ccf32..27cd94270b3 100644
--- a/src/emu/video.h
+++ b/src/emu/video.h
@@ -121,7 +121,6 @@ void video_screen_configure_scrnum(int scrnum, int width, int height, const rect
/* set the visible area of a screen; this is a subset of video_screen_configure */
void video_screen_set_visarea(const device_config *screen, int min_x, int max_x, int min_y, int max_y);
-void video_screen_set_visarea_scrnum(int scrnum, int min_x, int max_x, int min_y, int max_y);
/* force a partial update of the screen up to and including the requested scanline */
void video_screen_update_partial(const device_config *screen, int scanline);
@@ -140,6 +139,9 @@ int video_screen_get_hpos_scrnum(int scrnum);
int video_screen_get_vblank(const device_config *screen);
int video_screen_get_hblank(const device_config *screen);
+/* return the current visible area for a screen */
+const rectangle *video_screen_get_visible_area(const device_config *screen);
+
/* return the time when the beam will reach a particular H,V position */
attotime video_screen_get_time_until_pos(const device_config *screen, int vpos, int hpos);
attotime video_screen_get_time_until_pos_scrnum(int scrnum, int vpos, int hpos);
@@ -211,7 +213,7 @@ void video_set_fastforward(int fastforward);
/* ----- snapshots ----- */
/* save a snapshot of a given screen */
-void video_screen_save_snapshot(running_machine *machine, mame_file *fp, int scrnum);
+void video_screen_save_snapshot(const device_config *screen, mame_file *fp);
/* save a snapshot of all the active screens */
void video_save_active_screen_snapshots(running_machine *machine);
diff --git a/src/emu/video/vooddefs.h b/src/emu/video/vooddefs.h
index fa22b51c98a..c56b3bfc6dc 100644
--- a/src/emu/video/vooddefs.h
+++ b/src/emu/video/vooddefs.h
@@ -1671,7 +1671,7 @@ struct _banshee_info
struct _voodoo_state
{
UINT8 index; /* index of board */
- UINT8 scrnum; /* the screen we are acting on */
+ const device_config *screen; /* the screen we are acting on */
UINT8 type; /* type of system */
UINT8 chipmask; /* mask for which chips are available */
UINT32 freq; /* operating frequency */
diff --git a/src/emu/video/voodoo.c b/src/emu/video/voodoo.c
index 3c751463eee..eb259536d42 100644
--- a/src/emu/video/voodoo.c
+++ b/src/emu/video/voodoo.c
@@ -142,7 +142,6 @@ bits(7:4) and bit(24)), X, and Y:
#include "voodoo.h"
#include "vooddefs.h"
#include "ui.h"
-#include "deprecat.h"
/*************************************
@@ -279,13 +278,21 @@ static const raster_info predef_raster_table[] =
*
*************************************/
-void voodoo_start(int which, int scrnum, int type, int fbmem_in_mb, int tmem0_in_mb, int tmem1_in_mb)
+void voodoo_start(int which, const device_config *screen, int type, int fbmem_in_mb, int tmem0_in_mb, int tmem1_in_mb)
{
const raster_info *info;
void *fbmem, *tmumem[2];
voodoo_state *v;
int val;
+ /* validate */
+ assert((which >= 0) && (which < MAX_VOODOO));
+ assert(screen != NULL);
+ assert((type >= 0) && (type < MAX_VOODOO_TYPES));
+ assert(fbmem_in_mb >= 0);
+ assert(tmem0_in_mb >= 0);
+ assert(tmem1_in_mb >= 0);
+
/* allocate memory */
v = auto_malloc(sizeof(*v));
memset(v, 0, sizeof(*v));
@@ -366,6 +373,7 @@ void voodoo_start(int which, int scrnum, int type, int fbmem_in_mb, int tmem0_in
/* set the type, and initialize the chip mask */
v->index = which;
+ v->screen = screen;
v->type = type;
v->chipmask = 0x01;
v->attoseconds_per_cycle = ATTOSECONDS_PER_SECOND / v->freq;
@@ -969,10 +977,10 @@ static void swap_buffers(voodoo_state *v)
{
int count;
- if (LOG_VBLANK_SWAP) logerror("--- swap_buffers @ %d\n", video_screen_get_vpos_scrnum(v->scrnum));
+ if (LOG_VBLANK_SWAP) logerror("--- swap_buffers @ %d\n", video_screen_get_vpos(v->screen));
/* force a partial update */
- video_screen_update_partial_scrnum(v->scrnum, video_screen_get_vpos_scrnum(v->scrnum));
+ video_screen_update_partial(v->screen, video_screen_get_vpos(v->screen));
v->fbi.video_changed = TRUE;
/* keep a history of swap intervals */
@@ -1019,7 +1027,7 @@ static void swap_buffers(voodoo_state *v)
/* we may be able to unstall now */
if (v->pci.stall_state != NOT_STALLED)
- check_stalled_cpu(Machine, v, timer_get_time());
+ check_stalled_cpu(v->screen->machine, v, timer_get_time());
/* periodically log rasterizer info */
v->stats.swaps++;
@@ -1029,7 +1037,8 @@ static void swap_buffers(voodoo_state *v)
/* update the statistics (debug) */
if (v->stats.display)
{
- int screen_area = (Machine->screen[v->scrnum].visarea.max_x - Machine->screen[v->scrnum].visarea.min_x + 1) * (Machine->screen[v->scrnum].visarea.max_y - Machine->screen[v->scrnum].visarea.min_y + 1);
+ const rectangle *visible_area = video_screen_get_visible_area(v->screen);
+ int screen_area = (visible_area->max_x - visible_area->min_x + 1) * (visible_area->max_y - visible_area->min_y + 1);
char *statsptr = v->stats.buffer;
int pixelcount;
int i;
@@ -1082,11 +1091,11 @@ static void swap_buffers(voodoo_state *v)
static void adjust_vblank_timer(voodoo_state *v)
{
- attotime vblank_period = video_screen_get_time_until_pos_scrnum(v->scrnum, v->fbi.vsyncscan, 0);
+ attotime vblank_period = video_screen_get_time_until_pos(v->screen, v->fbi.vsyncscan, 0);
/* if zero, adjust to next frame, otherwise we may get stuck in an infinite loop */
if (attotime_compare(vblank_period, attotime_zero) == 0)
- vblank_period = video_screen_get_frame_period_scrnum(v->scrnum);
+ vblank_period = video_screen_get_frame_period(v->screen);
timer_adjust_oneshot(v->fbi.vblank_timer, vblank_period, 0);
}
@@ -1135,7 +1144,7 @@ static TIMER_CALLBACK( vblank_callback )
swap_buffers(v);
/* set a timer for the next off state */
- timer_set(video_screen_get_time_until_pos_scrnum(v->scrnum, 0, 0), v, 0, vblank_off_callback);
+ timer_set(video_screen_get_time_until_pos(v->screen, 0, 0), v, 0, vblank_off_callback);
/* set internal state and call the client */
v->fbi.vblank = TRUE;
@@ -2610,7 +2619,7 @@ static INT32 register_w(voodoo_state *v, offs_t offset, UINT32 data)
int vvis = (v->reg[videoDimensions].u >> 16) & 0x3ff;
int hbp = (v->reg[backPorch].u & 0xff) + 2;
int vbp = (v->reg[backPorch].u >> 16) & 0xff;
- attoseconds_t refresh = video_screen_get_frame_period_scrnum(v->scrnum).attoseconds;
+ attoseconds_t refresh = video_screen_get_frame_period(v->screen).attoseconds;
attoseconds_t stdperiod, medperiod, vgaperiod;
attoseconds_t stddiff, meddiff, vgadiff;
rectangle visarea;
@@ -2645,17 +2654,17 @@ static INT32 register_w(voodoo_state *v, offs_t offset, UINT32 data)
/* configure the screen based on which one matches the closest */
if (stddiff < meddiff && stddiff < vgadiff)
{
- video_screen_configure_scrnum(v->scrnum, htotal, vtotal, &visarea, stdperiod);
+ video_screen_configure(v->screen, htotal, vtotal, &visarea, stdperiod);
mame_printf_debug("Standard resolution, %f Hz\n", ATTOSECONDS_TO_HZ(stdperiod));
}
else if (meddiff < vgadiff)
{
- video_screen_configure_scrnum(v->scrnum, htotal, vtotal, &visarea, medperiod);
+ video_screen_configure(v->screen, htotal, vtotal, &visarea, medperiod);
mame_printf_debug("Medium resolution, %f Hz\n", ATTOSECONDS_TO_HZ(medperiod));
}
else
{
- video_screen_configure_scrnum(v->scrnum, htotal, vtotal, &visarea, vgaperiod);
+ video_screen_configure(v->screen, htotal, vtotal, &visarea, vgaperiod);
mame_printf_debug("VGA resolution, %f Hz\n", ATTOSECONDS_TO_HZ(vgaperiod));
}
@@ -3851,7 +3860,7 @@ static UINT32 register_r(voodoo_state *v, offs_t offset)
/* return the current scanline for now */
case vRetrace:
- result = video_screen_get_vpos_scrnum(v->scrnum);
+ result = video_screen_get_vpos(v->screen);
break;
/* reserved area in the TMU read by the Vegas startup sequence */
@@ -4538,7 +4547,7 @@ static void banshee_io_w(voodoo_state *v, offs_t offset, UINT32 data, UINT32 mem
v->fbi.width = data & 0xfff;
if (data & 0xfff000)
v->fbi.height = (data >> 12) & 0xfff;
- video_screen_set_visarea_scrnum(v->scrnum, 0, v->fbi.width - 1, 0, v->fbi.height - 1);
+ video_screen_set_visarea(v->screen, 0, v->fbi.width - 1, 0, v->fbi.height - 1);
adjust_vblank_timer(v);
if (LOG_REGISTERS)
logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", activecpu_get_pc(), banshee_io_reg_name[offset], data, ~mem_mask);
diff --git a/src/emu/video/voodoo.h b/src/emu/video/voodoo.h
index 393072f57a8..0d51bdae7c6 100644
--- a/src/emu/video/voodoo.h
+++ b/src/emu/video/voodoo.h
@@ -14,10 +14,11 @@ enum
VOODOO_1,
VOODOO_2,
VOODOO_BANSHEE,
- VOODOO_3
+ VOODOO_3,
+ MAX_VOODOO_TYPES
};
-void voodoo_start(int which, int scrnum, int type, int fbmem_in_mb, int tmem0_in_mb, int tmem1_in_mb);
+void voodoo_start(int which, const device_config *screen, int type, int fbmem_in_mb, int tmem0_in_mb, int tmem1_in_mb);
int voodoo_update(int which, bitmap_t *bitmap, const rectangle *cliprect);
void voodoo_reset(int which);
void voodoo_exit(int which);
diff --git a/src/mame/drivers/gticlub.c b/src/mame/drivers/gticlub.c
index c529bbf2c50..6eebe194aaf 100644
--- a/src/mame/drivers/gticlub.c
+++ b/src/mame/drivers/gticlub.c
@@ -89,8 +89,11 @@ static void voodoo_vblank_1(int param)
static VIDEO_START( hangplt )
{
- voodoo_start(0, 0, VOODOO_1, 2, 4, 4);
- voodoo_start(1, 1, VOODOO_1, 2, 4, 4);
+ const device_config *left_screen = device_list_find_by_tag(machine->config->devicelist, VIDEO_SCREEN, "left");
+ const device_config *right_screen = device_list_find_by_tag(machine->config->devicelist, VIDEO_SCREEN, "right");
+
+ voodoo_start(0, left_screen, VOODOO_1, 2, 4, 4);
+ voodoo_start(1, right_screen, VOODOO_1, 2, 4, 4);
voodoo_set_vblank_callback(0, voodoo_vblank_0);
voodoo_set_vblank_callback(1, voodoo_vblank_1);
diff --git a/src/mame/drivers/hornet.c b/src/mame/drivers/hornet.c
index 62e492b70b7..5194708a6d6 100644
--- a/src/mame/drivers/hornet.c
+++ b/src/mame/drivers/hornet.c
@@ -510,9 +510,9 @@ static VIDEO_START( hornet )
add_exit_callback(machine, hornet_exit);
if (voodoo_version == 0)
- voodoo_start(0, 0, VOODOO_1, 2, 4, 0);
+ voodoo_start(0, machine->primary_screen, VOODOO_1, 2, 4, 0);
else
- voodoo_start(0, 0, VOODOO_2, 2, 4, 0);
+ voodoo_start(0, machine->primary_screen, VOODOO_2, 2, 4, 0);
voodoo_set_vblank_callback(0, voodoo_vblank_0);
@@ -521,17 +521,20 @@ static VIDEO_START( hornet )
static VIDEO_START( hornet_2board )
{
+ const device_config *left_screen = device_list_find_by_tag(machine->config->devicelist, VIDEO_SCREEN, "left");
+ const device_config *right_screen = device_list_find_by_tag(machine->config->devicelist, VIDEO_SCREEN, "right");
+
add_exit_callback(machine, hornet_2board_exit);
if (voodoo_version == 0)
{
- voodoo_start(0, 0, VOODOO_1, 2, 4, 0);
- voodoo_start(1, 1, VOODOO_1, 2, 4, 0);
+ voodoo_start(0, left_screen, VOODOO_1, 2, 4, 0);
+ voodoo_start(1, right_screen, VOODOO_1, 2, 4, 0);
}
else
{
- voodoo_start(0, 0, VOODOO_2, 2, 4, 0);
- voodoo_start(1, 1, VOODOO_2, 2, 4, 0);
+ voodoo_start(0, left_screen, VOODOO_2, 2, 4, 0);
+ voodoo_start(1, right_screen, VOODOO_2, 2, 4, 0);
}
voodoo_set_vblank_callback(0, voodoo_vblank_0);
@@ -946,6 +949,8 @@ static MACHINE_DRIVER_START( hornet_2board )
/* video hardware */
MDRV_PALETTE_LENGTH(65536)
+ MDRV_SCREEN_REMOVE("main")
+
MDRV_SCREEN_ADD("left", RASTER)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
MDRV_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/nwk-tr.c b/src/mame/drivers/nwk-tr.c
index ed9882e7e76..63a1a2565b1 100644
--- a/src/mame/drivers/nwk-tr.c
+++ b/src/mame/drivers/nwk-tr.c
@@ -528,7 +528,7 @@ static void voodoo_vblank_0(int param)
static VIDEO_START( nwktr )
{
- voodoo_start(0, 0, VOODOO_1, 2, 2, 2);
+ voodoo_start(0, machine->primary_screen, VOODOO_1, 2, 2, 2);
voodoo_set_vblank_callback(0, voodoo_vblank_0);
K001604_vh_start(machine, 0);
diff --git a/src/mame/drivers/seattle.c b/src/mame/drivers/seattle.c
index bb33fbd490e..6dc99c9cd4d 100644
--- a/src/mame/drivers/seattle.c
+++ b/src/mame/drivers/seattle.c
@@ -492,7 +492,7 @@ static VIDEO_START( seattle )
{
add_exit_callback(machine, seattle_exit);
- voodoo_start(0, 0, VOODOO_1, 2, 4, 0);
+ voodoo_start(0, machine->primary_screen, VOODOO_1, 2, 4, 0);
voodoo_set_vblank_callback(0, vblank_assert);
voodoo_set_stall_callback(0, voodoo_stall);
@@ -503,7 +503,7 @@ static VIDEO_START( flagstaff )
{
add_exit_callback(machine, seattle_exit);
- voodoo_start(0, 0, VOODOO_1, 2, 4, 4);
+ voodoo_start(0, machine->primary_screen, VOODOO_1, 2, 4, 4);
voodoo_set_vblank_callback(0, vblank_assert);
voodoo_set_stall_callback(0, voodoo_stall);
diff --git a/src/mame/drivers/vegas.c b/src/mame/drivers/vegas.c
index b0b2db94db8..db1a2aafce0 100644
--- a/src/mame/drivers/vegas.c
+++ b/src/mame/drivers/vegas.c
@@ -522,7 +522,7 @@ static VIDEO_START( vegas_voodoo2 )
{
add_exit_callback(machine, vegas_exit);
- voodoo_start(0, 0, VOODOO_2, 2, 4, 4);
+ voodoo_start(0, machine->primary_screen, VOODOO_2, 2, 4, 4);
voodoo_set_vblank_callback(0, vblank_assert);
}
@@ -531,7 +531,7 @@ static VIDEO_START( vegas_voodoo_banshee )
{
add_exit_callback(machine, vegas_exit);
- voodoo_start(0, 0, VOODOO_BANSHEE, 16, 16, 0);
+ voodoo_start(0, machine->primary_screen, VOODOO_BANSHEE, 16, 16, 0);
voodoo_set_vblank_callback(0, vblank_assert);
}
@@ -540,7 +540,7 @@ static VIDEO_START( vegas_voodoo3 )
{
add_exit_callback(machine, vegas_exit);
- voodoo_start(0, 0, VOODOO_3, 16, 16, 16);
+ voodoo_start(0, machine->primary_screen, VOODOO_3, 16, 16, 16);
voodoo_set_vblank_callback(0, vblank_assert);
}
diff --git a/src/mame/drivers/viper.c b/src/mame/drivers/viper.c
index 7d7a7574d42..28132f7d20a 100644
--- a/src/mame/drivers/viper.c
+++ b/src/mame/drivers/viper.c
@@ -48,7 +48,7 @@ static VIDEO_START(viper)
{
add_exit_callback(machine, viper_exit);
- voodoo_start(0, 0, VOODOO_3, 16, 16, 16);
+ voodoo_start(0, machine->primary_screen, VOODOO_3, 16, 16, 16);
}
static VIDEO_UPDATE(viper)