mirror of
https://github.com/holub/mame
synced 2025-07-03 00:56:03 +03:00
vblank_state_changed_func now has a device_config argument
This commit is contained in:
parent
553d92bcb5
commit
9c172be162
@ -785,21 +785,12 @@ int cpu_getiloops(void)
|
||||
for this screen
|
||||
-------------------------------------------------*/
|
||||
|
||||
static void on_vblank(running_machine *machine, screen_state *screen, int vblank_state)
|
||||
static void on_vblank(running_machine *machine, const device_config *device, int vblank_state)
|
||||
{
|
||||
/* VBLANK starting */
|
||||
if (vblank_state)
|
||||
{
|
||||
int cpunum;
|
||||
const char *screen_tag = NULL;
|
||||
const device_config *device;
|
||||
|
||||
/* get the screen's tag */
|
||||
for (device = video_screen_first(machine->config); device != NULL; device = video_screen_next(device))
|
||||
if (device->token == screen)
|
||||
screen_tag = device->tag;
|
||||
|
||||
assert(screen_tag != NULL);
|
||||
|
||||
/* find any CPUs that have this screen as their VBLANK interrupt source */
|
||||
for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++)
|
||||
@ -813,13 +804,13 @@ static void on_vblank(running_machine *machine, screen_state *screen, int vblank
|
||||
else
|
||||
cpu[cpunum].iloops = -1;
|
||||
|
||||
/* the hack style VBLANK decleration uses the first screen always */
|
||||
/* the hack style VBLANK decleration always uses the first screen */
|
||||
if (config->vblank_interrupts_per_frame > 1)
|
||||
cpu_interested = TRUE;
|
||||
|
||||
/* for new style decleration, we need to compare the tags */
|
||||
else if (config->vblank_interrupts_per_frame == 1)
|
||||
cpu_interested = (strcmp(config->vblank_interrupt_screen, screen_tag) == 0);
|
||||
cpu_interested = (strcmp(config->vblank_interrupt_screen, device->tag) == 0);
|
||||
|
||||
/* no VBLANK interrupt, not interested */
|
||||
else
|
||||
|
@ -1032,7 +1032,7 @@ static int default_ports_lookup[__ipt_max][MAX_PLAYERS];
|
||||
FUNCTION PROTOTYPES
|
||||
***************************************************************************/
|
||||
|
||||
static void on_vblank(running_machine *machine, screen_state *screen, int vblank_state);
|
||||
static void on_vblank(running_machine *machine, const device_config *device, int vblank_state);
|
||||
static void setup_playback(running_machine *machine);
|
||||
static void setup_record(running_machine *machine);
|
||||
static void input_port_exit(running_machine *machine);
|
||||
@ -1153,7 +1153,7 @@ void input_port_post_init(running_machine *machine)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static void on_vblank(running_machine *machine, screen_state *screen, int vblank_state)
|
||||
static void on_vblank(running_machine *machine, const device_config *device, int vblank_state)
|
||||
{
|
||||
/* VBLANK starting - read keyboard & update the status of the input ports */
|
||||
if (vblank_state)
|
||||
|
@ -50,7 +50,7 @@ struct _internal_screen_info
|
||||
{
|
||||
/* pointers to screen configuration and state */
|
||||
int scrnum; /* the screen index */
|
||||
const screen_config * config; /* pointer to the configuration in the Machine->config */
|
||||
const device_config * device; /* pointer to screen device configuration */
|
||||
screen_state * state; /* pointer to visible state in Machine structure */
|
||||
|
||||
/* textures and bitmaps */
|
||||
@ -75,7 +75,7 @@ struct _internal_screen_info
|
||||
|
||||
/* VBLANK callbacks */
|
||||
int vbl_cb_count; /* # of callbacks installed */
|
||||
vblank_state_changed_func vbl_cbs[MAX_VBL_CB]; /* the array of callbacks */
|
||||
vblank_state_changed_func vbl_cbs[MAX_VBL_CB]; /* the array of callbacks */
|
||||
|
||||
/* movie recording */
|
||||
mame_file * movie_file; /* handle to the open movie file */
|
||||
@ -313,6 +313,7 @@ void video_init(running_machine *machine)
|
||||
int scrnum = device_list_index(machine->config->devicelist, VIDEO_SCREEN, device->tag);
|
||||
render_container *container = render_container_get_screen(scrnum);
|
||||
internal_screen_info *info = &viddata->scrinfo[scrnum];
|
||||
screen_config *config = device->inline_config;
|
||||
|
||||
/* allocate the VBLANK timers */
|
||||
info->vblank_begin_timer = timer_alloc(vblank_begin_callback, info);
|
||||
@ -323,21 +324,21 @@ void video_init(running_machine *machine)
|
||||
|
||||
/* make pointers back to the config and state */
|
||||
info->scrnum = scrnum;
|
||||
info->config = device->inline_config;
|
||||
info->device = device;
|
||||
info->state = &machine->screen[scrnum];
|
||||
|
||||
/* configure the screen with the default parameters */
|
||||
video_screen_configure(scrnum, info->state->width, info->state->height, &info->state->visarea, info->state->refresh);
|
||||
|
||||
/* configure the default cliparea */
|
||||
if (info->config->xoffset != 0)
|
||||
render_container_set_xoffset(container, info->config->xoffset);
|
||||
if (info->config->yoffset != 0)
|
||||
render_container_set_yoffset(container, info->config->yoffset);
|
||||
if (info->config->xscale != 0)
|
||||
render_container_set_xscale(container, info->config->xscale);
|
||||
if (info->config->yscale != 0)
|
||||
render_container_set_yscale(container, info->config->yscale);
|
||||
if (config->xoffset != 0)
|
||||
render_container_set_xoffset(container, config->xoffset);
|
||||
if (config->yoffset != 0)
|
||||
render_container_set_yoffset(container, config->yoffset);
|
||||
if (config->xscale != 0)
|
||||
render_container_set_xscale(container, config->xscale);
|
||||
if (config->yscale != 0)
|
||||
render_container_set_yscale(container, config->yscale);
|
||||
|
||||
/* reset VBLANK timing */
|
||||
info->vblank_time = attotime_zero;
|
||||
@ -1223,7 +1224,7 @@ static void call_vb_callbacks(running_machine *machine, internal_screen_info *sc
|
||||
scrinfo->vblank_state = vblank_state;
|
||||
|
||||
for (i = 0; i < scrinfo->vbl_cb_count; i++)
|
||||
scrinfo->vbl_cbs[i](machine, scrinfo->state, vblank_state);
|
||||
scrinfo->vbl_cbs[i](machine, scrinfo->device, vblank_state);
|
||||
}
|
||||
|
||||
|
||||
|
@ -94,7 +94,7 @@ struct _screen_config
|
||||
the VBLANK state
|
||||
-------------------------------------------------*/
|
||||
|
||||
typedef void (*vblank_state_changed_func)(running_machine *machine, screen_state *screen, int vblank_state);
|
||||
typedef void (*vblank_state_changed_func)(running_machine *machine, const device_config *device, int vblank_state);
|
||||
|
||||
|
||||
|
||||
|
@ -83,7 +83,7 @@ static TIMER_CALLBACK( watchdog_callback )
|
||||
timers
|
||||
-------------------------------------------------*/
|
||||
|
||||
static void on_vblank(running_machine *machine, screen_state *screen, int vblank_state)
|
||||
static void on_vblank(running_machine *machine, const device_config *device, int vblank_state)
|
||||
{
|
||||
/* VBLANK starting */
|
||||
if (vblank_state && watchdog_enabled)
|
||||
|
Loading…
Reference in New Issue
Block a user