Minor cleanup and simplification. Removed palette_config().

This commit is contained in:
Aaron Giles 2008-03-28 18:59:31 +00:00
parent c5335ee5d4
commit 6350ab3302
3 changed files with 12 additions and 36 deletions

View File

@ -157,26 +157,6 @@ void palette_init(running_machine *machine)
}
/*-------------------------------------------------
palette_config - palette initialization that
takes place after the display is created
-------------------------------------------------*/
void palette_config(running_machine *machine)
{
int i;
/* now let the driver modify the initial palette and colortable */
if (machine->config->init_palette)
(*machine->config->init_palette)(machine, memory_region(REGION_PROMS));
/* set the color table base for each graphics element */
for (i = 0; i < MAX_GFX_ELEMENTS; i++)
if (machine->gfx[i] != NULL)
machine->gfx[i]->color_base = machine->config->gfxdecodeinfo[i].color_codes_start;
}
/***************************************************************************
SHADOW/HIGHLIGHT CONFIGURATION

View File

@ -126,9 +126,6 @@ typedef struct _colortable_t colortable_t;
/* palette initialization that takes place before the display is created */
void palette_init(running_machine *machine);
/* palette initialization that takes place after the display is created */
void palette_config(running_machine *machine);
/* ----- shadow/hilight configuration ----- */

View File

@ -109,13 +109,11 @@ struct _video_global
UINT32 overall_valid_counter; /* number of consecutive valid time periods */
/* configuration */
UINT8 sleep; /* flag: TRUE if we're allowed to sleep */
UINT8 throttle; /* flag: TRUE if we're currently throttled */
UINT8 fastforward; /* flag: TRUE if we're currently fast-forwarding */
UINT32 seconds_to_run; /* number of seconds to run before quitting */
UINT8 auto_frameskip; /* flag: TRUE if we're automatically frameskipping */
UINT32 speed; /* overall speed (*100) */
UINT8 update_in_pause; /* flag: TRUE if video is updated while in pause */
/* frameskipping */
UINT8 empty_skip_count; /* number of empty frames we have skipped */
@ -305,14 +303,12 @@ void video_init(running_machine *machine)
memset(&global, 0, sizeof(global));
global.speed_percent = 1.0;
/* extract global configuration settings */
global.sleep = options_get_bool(mame_options(), OPTION_SLEEP);
/* extract initial execution state from global configuration settings */
global.speed = original_speed_setting();
global.throttle = options_get_bool(mame_options(), OPTION_THROTTLE);
global.auto_frameskip = options_get_bool(mame_options(), OPTION_AUTOFRAMESKIP);
global.frameskip_level = options_get_int(mame_options(), OPTION_FRAMESKIP);
global.seconds_to_run = options_get_int(mame_options(), OPTION_SECONDS_TO_RUN);
global.speed = original_speed_setting();
global.update_in_pause = options_get_bool(mame_options(), OPTION_UPDATEINPAUSE);
/* set the first screen device as the primary - this will set NULL if screenless */
machine->primary_screen = video_screen_first(machine->config);
@ -326,8 +322,9 @@ void video_init(running_machine *machine)
if (machine->config->gfxdecodeinfo != NULL)
allocate_graphics(machine, machine->config->gfxdecodeinfo);
/* configure the palette */
palette_config(machine);
/* call the PALETTE_INIT function */
if (machine->config->init_palette != NULL)
(*machine->config->init_palette)(machine, memory_region(REGION_PROMS));
/* actually decode the graphics */
if (machine->config->gfxdecodeinfo != NULL)
@ -570,7 +567,7 @@ static void decode_graphics(running_machine *machine, const gfx_decode_entry *gf
/* count total graphics elements */
for (i = 0; i < MAX_GFX_ELEMENTS; i++)
if (machine->gfx[i])
if (machine->gfx[i] != NULL)
totalgfx += machine->gfx[i]->total_elements;
/* loop over all elements */
@ -1420,7 +1417,7 @@ void video_frame_update(running_machine *machine, int debug)
assert(machine->config != NULL);
/* only render sound and video if we're in the running phase */
if (phase == MAME_PHASE_RUNNING && (!mame_is_paused(machine) || global.update_in_pause))
if (phase == MAME_PHASE_RUNNING && (!mame_is_paused(machine) || options_get_bool(mame_options(), OPTION_UPDATEINPAUSE)))
{
int anything_changed = finish_screen_updates(machine);
@ -1870,12 +1867,14 @@ static osd_ticks_t throttle_until_ticks(running_machine *machine, osd_ticks_t ta
osd_ticks_t minimum_sleep = osd_ticks_per_second() / 1000;
osd_ticks_t current_ticks = osd_ticks();
osd_ticks_t new_ticks;
int allowed_to_sleep;
int allowed_to_sleep = FALSE;
/* we're allowed to sleep via the OSD code only if we're configured to do so
and we're not frameskipping due to autoframeskip, or if we're paused */
allowed_to_sleep = mame_is_paused(machine) ||
(global.sleep && (!effective_autoframeskip(machine) || effective_frameskip() == 0));
if (options_get_bool(mame_options(), OPTION_SLEEP) && (!effective_autoframeskip(machine) || effective_frameskip() == 0))
allowed_to_sleep = TRUE;
if (mame_is_paused(machine))
allowed_to_sleep = TRUE;
/* loop until we reach our target */
profiler_mark(PROFILER_IDLE);