diff -Nru old/emu/crsshair.c src/emu/crsshair.c --- old/emu/crsshair.c 2008-05-15 09:25:04.000000000 -0500 +++ src/emu/crsshair.c 2008-08-24 14:33:46.000000000 -0500 @@ -202,7 +202,11 @@ /* mark as used and visible */ global.used[player] = TRUE; - global.visible[player] = TRUE; + /*MKCHAMP - DISABLING CROSSHAIRS BY DEFAULT */ + if (!options_get_bool(mame_options(), OPTION_DISABLE_CROSSHAIR_PATCH)) + global.visible[player] = FALSE; + else + global.visible[player] = TRUE; /* for now, use the main screen */ global.screen[player] = machine->primary_screen; diff -Nru old/emu/emu.mak src/emu/emu.mak --- old/emu/emu.mak 2008-07-31 01:19:54.000000000 -0500 +++ src/emu/emu.mak 2008-08-23 20:17:40.000000000 -0500 @@ -33,6 +33,7 @@ #------------------------------------------------- # emulator core objects +# MKCHAMP - ADDED hiscore.o TO LIST TO COMPILE THE HISCORE PIECE #------------------------------------------------- EMUOBJS = \ @@ -53,6 +54,7 @@ $(EMUOBJ)/emupal.o \ $(EMUOBJ)/fileio.o \ $(EMUOBJ)/hash.o \ + $(EMUOBJ)/hiscore.o \ $(EMUOBJ)/info.o \ $(EMUOBJ)/input.o \ $(EMUOBJ)/inputseq.o \ diff -Nru old/emu/emuopts.c src/emu/emuopts.c --- old/emu/emuopts.c 2008-07-31 01:19:54.000000000 -0500 +++ src/emu/emuopts.c 2008-08-24 19:28:08.000000000 -0500 @@ -54,6 +54,8 @@ { "snapshot_directory", "snap", 0, "directory to save screenshots" }, { "diff_directory", "diff", 0, "directory to save hard drive image difference files" }, { "comment_directory", "comments", 0, "directory to save debugger comments" }, + //MKCHAMP - ADDING CFG OPTION TO SPECIFY HISCORE DIRECTORY..."hi" BY DEFAULT + { "hiscore_directory", "hi", 0, "directory to save hiscores" }, /* state/playback options */ { NULL, NULL, OPTION_HEADER, "CORE STATE/PLAYBACK OPTIONS" }, @@ -155,6 +157,13 @@ { "cheat;c", "0", OPTION_BOOLEAN, "enable cheat subsystem" }, { "skip_gameinfo", "0", OPTION_BOOLEAN, "skip displaying the information screen at startup" }, + /* MKChamp Hiscore Diff options */ + { NULL, NULL, OPTION_HEADER, "CORE MKChamp OPTIONS" }, + { "disable_hiscore_patch", "0", OPTION_BOOLEAN, "disable hiscore saving" }, + { "disable_crosshair_patch", "0", OPTION_BOOLEAN, "disable crosshairs off by default" }, + { "disable_nagscreen_patch", "0", OPTION_BOOLEAN, "disable suppression of nagscreens" }, + { "disable_loading_patch", "0", OPTION_BOOLEAN, "disable suppression of loading screens /white box" }, + { NULL } }; diff -Nru old/emu/emuopts.h src/emu/emuopts.h --- old/emu/emuopts.h 2008-07-31 01:19:54.000000000 -0500 +++ src/emu/emuopts.h 2008-08-24 14:16:47.000000000 -0500 @@ -55,6 +55,8 @@ #define OPTION_SNAPSHOT_DIRECTORY "snapshot_directory" #define OPTION_DIFF_DIRECTORY "diff_directory" #define OPTION_COMMENT_DIRECTORY "comment_directory" +//MKCHAMP - DECLARING THE DIRECTORY OPTION FOR HIGH SCORES TO BE SAVED TO +#define OPTION_HISCORE_DIRECTORY "hiscore_directory" /* core state/playback options */ #define OPTION_STATE "state" @@ -143,6 +145,12 @@ #define OPTION_CHEAT "cheat" #define OPTION_SKIP_GAMEINFO "skip_gameinfo" +/* MKChamp Hiscore Diff Options */ +#define OPTION_DISABLE_HISCORE_PATCH "disable_hiscore_patch" +#define OPTION_DISABLE_CROSSHAIR_PATCH "disable_crosshair_patch" +#define OPTION_DISABLE_NAGSCREEN_PATCH "disable_nagscreen_patch" +#define OPTION_DISABLE_LOADING_PATCH "disable_loading_patch" + /*************************************************************************** diff -Nru old/emu/fileio.h src/emu/fileio.h --- old/emu/fileio.h 2008-07-31 01:19:54.000000000 -0500 +++ src/emu/fileio.h 2008-08-23 20:17:40.000000000 -0500 @@ -55,6 +55,8 @@ #define SEARCHPATH_SCREENSHOT OPTION_SNAPSHOT_DIRECTORY #define SEARCHPATH_MOVIE OPTION_SNAPSHOT_DIRECTORY #define SEARCHPATH_COMMENT OPTION_COMMENT_DIRECTORY +//MKCHAMP - DEFINING THE HIGHSCORE DIRECTORY OPTION +#define FILETYPE_HIGHSCORE OPTION_HISCORE_DIRECTORY diff -Nru old/emu/hiscore.c src/emu/hiscore.c --- old/emu/hiscore.c 1969-12-31 18:00:00.000000000 -0600 +++ src/emu/hiscore.c 2008-08-23 20:31:44.000000000 -0500 @@ -0,0 +1,382 @@ +/*************************************************************************** + + hiscore.c + + Manages the hiscore system. + + Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team. + Visit http://mamedev.org for licensing and usage restrictions. + +***************************************************************************/ + +#include "driver.h" +#include "hiscore.h" +#include "cheat.h" +#include "deprecat.h" + +#define MAX_CONFIG_LINE_SIZE 48 + +#define VERBOSE 0 + +static emu_timer *timer; + +#if VERBOSE +#define LOG(x) logerror x +#else +#define LOG(x) +#endif + +const char *db_filename = "hiscore.dat"; /* high score definition file */ + + +struct _memory_range +{ + UINT32 cpu, addr, num_bytes, start_value, end_value; + struct _memory_range *next; +}; +typedef struct _memory_range memory_range; + + +static struct +{ + int hiscores_have_been_loaded; + memory_range *mem_range; +} state; + + +static int is_highscore_enabled(void) +{ + /* disable high score when record/playback is on */ + /*if (Machine->record_file != NULL || Machine->playback_file != NULL) + return FALSE;*/ + + return TRUE; +} + + + +/*****************************************************************************/ + +static void copy_to_memory (int cpu, int addr, const UINT8 *source, int num_bytes) +{ + int i; + for (i=0; i='0' && c<='9') + { + digit = c-'0'; + } + else if (c>='a' && c<='f') + { + digit = 10+c-'a'; + } + else if (c>='A' && c<='F') + { + digit = 10+c-'A'; + } + else + { + /* not a hexadecimal digit */ + /* safety check for premature EOL */ + if (!c) string = NULL; + break; + } + result = result*16 + digit; + } + *pString = string; + } + return result; +} + +/* given a line in the hiscore.dat file, determine if it encodes a + memory range (or a game name). + For now we assume that CPU number is always a decimal digit, and + that no game name starts with a decimal digit. +*/ +static int is_mem_range (const char *pBuf) +{ + char c; + for(;;) + { + c = *pBuf++; + if (c == 0) return 0; /* premature EOL */ + if (c == ':') break; + } + c = *pBuf; /* character following first ':' */ + + return (c>='0' && c<='9') || + (c>='a' && c<='f') || + (c>='A' && c<='F'); +} + +/* matching_game_name is used to skip over lines until we find : */ +static int matching_game_name (const char *pBuf, const char *name) +{ + while (*name) + { + if (*name++ != *pBuf++) return 0; + } + return (*pBuf == ':'); +} + +/*****************************************************************************/ + +/* safe_to_load checks the start and end values of each memory range */ +static int safe_to_load (void) +{ + memory_range *mem_range = state.mem_range; + while (mem_range) + { + if (cpunum_read_byte (mem_range->cpu, mem_range->addr) != + mem_range->start_value) + { + return 0; + } + if (cpunum_read_byte (mem_range->cpu, mem_range->addr + mem_range->num_bytes - 1) != + mem_range->end_value) + { + return 0; + } + mem_range = mem_range->next; + } + return 1; +} + +/* hiscore_free disposes of the mem_range linked list */ +static void hiscore_free (void) +{ + memory_range *mem_range = state.mem_range; + while (mem_range) + { + memory_range *next = mem_range->next; + free (mem_range); + mem_range = next; + } + state.mem_range = NULL; +} + +static void hiscore_load (void) +{ + file_error filerr; + mame_file *f; + astring *fname; + if (is_highscore_enabled()) + { + fname = astring_assemble_2(astring_alloc(), Machine->basename, ".hi"); + filerr = mame_fopen(FILETYPE_HIGHSCORE, astring_c(fname), OPEN_FLAG_READ, &f); + astring_free(fname); + state.hiscores_have_been_loaded = 1; + LOG(("hiscore_load\n")); + if (filerr == FILERR_NONE) + { + memory_range *mem_range = state.mem_range; + LOG(("loading...\n")); + while (mem_range) + { + UINT8 *data = malloc (mem_range->num_bytes); + if (data) + { + /* this buffer will almost certainly be small + enough to be dynamically allocated, but let's + avoid memory trashing just in case + */ + mame_fread (f, data, mem_range->num_bytes); + copy_to_memory (mem_range->cpu, mem_range->addr, data, mem_range->num_bytes); + free (data); + } + mem_range = mem_range->next; + } + mame_fclose (f); + } + } +} + +static void hiscore_save (void) +{ + file_error filerr; + mame_file *f; + astring *fname; + if (is_highscore_enabled()) + { + fname = astring_assemble_2(astring_alloc(), Machine->basename, ".hi"); + filerr = mame_fopen(FILETYPE_HIGHSCORE, astring_c(fname), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS, &f); + astring_free(fname); + LOG(("hiscore_save\n")); + if (filerr == FILERR_NONE) + { + memory_range *mem_range = state.mem_range; + LOG(("saving...\n")); + while (mem_range) + { + UINT8 *data = malloc (mem_range->num_bytes); + if (data) + { + /* this buffer will almost certainly be small + enough to be dynamically allocated, but let's + avoid memory trashing just in case + */ + copy_from_memory (mem_range->cpu, mem_range->addr, data, mem_range->num_bytes); + mame_fwrite(f, data, mem_range->num_bytes); + free (data); + } + mem_range = mem_range->next; + } + mame_fclose(f); + } + } +} + + +/* call hiscore_update periodically (i.e. once per frame) */ +static TIMER_CALLBACK( hiscore_periodic ) +{ + if (state.mem_range) + { + if (!state.hiscores_have_been_loaded) + { + if (safe_to_load()) + { + hiscore_load(); + timer_enable(timer, FALSE); + } + } + } +} + + +/* call hiscore_close when done playing game */ +void hiscore_close (running_machine *machine) +{ + if (state.hiscores_have_been_loaded) hiscore_save(); + hiscore_free(); +} + + +/*****************************************************************************/ +/* public API */ + +/* call hiscore_open once after loading a game */ +void hiscore_init (running_machine *machine) +{ + memory_range *mem_range = state.mem_range; + file_error filerr; + mame_file *f; + const char *name = machine->gamedrv->name; + state.hiscores_have_been_loaded = 0; + + while (mem_range) + { + cpunum_write_byte( + mem_range->cpu, + mem_range->addr, + ~mem_range->start_value + ); + + cpunum_write_byte( + mem_range->cpu, + mem_range->addr + mem_range->num_bytes-1, + ~mem_range->end_value + ); + mem_range = mem_range->next; + } + + state.mem_range = NULL; + filerr = mame_fopen(NULL, db_filename, OPEN_FLAG_READ, &f); + if(filerr == FILERR_NONE) + { + char buffer[MAX_CONFIG_LINE_SIZE]; + enum { FIND_NAME, FIND_DATA, FETCH_DATA } mode; + mode = FIND_NAME; + + while (mame_fgets (buffer, MAX_CONFIG_LINE_SIZE, f)) + { + if (mode==FIND_NAME) + { + if (matching_game_name (buffer, name)) + { + mode = FIND_DATA; + LOG(("hs config found!\n")); + } + } + else if (is_mem_range (buffer)) + { + const char *pBuf = buffer; + memory_range *mem_range = malloc(sizeof(memory_range)); + if (mem_range) + { + mem_range->cpu = hexstr2num (&pBuf); + mem_range->addr = hexstr2num (&pBuf); + mem_range->num_bytes = hexstr2num (&pBuf); + mem_range->start_value = hexstr2num (&pBuf); + mem_range->end_value = hexstr2num (&pBuf); + + mem_range->next = NULL; + { + memory_range *last = state.mem_range; + while (last && last->next) last = last->next; + if (last == NULL) + { + state.mem_range = mem_range; + } + else + { + last->next = mem_range; + } + } + + mode = FETCH_DATA; + } + else + { + hiscore_free(); + break; + } + } + else + { + /* line is a game name */ + if (mode == FETCH_DATA) break; + } + } + mame_fclose (f); + } + + timer = timer_alloc(hiscore_periodic, NULL); + timer_adjust_periodic(timer, video_screen_get_frame_period(machine->primary_screen), 0, video_screen_get_frame_period(machine->primary_screen)); + + add_exit_callback(machine, hiscore_close); +} diff -Nru old/emu/hiscore.h src/emu/hiscore.h --- old/emu/hiscore.h 1969-12-31 18:00:00.000000000 -0600 +++ src/emu/hiscore.h 2008-08-23 20:17:40.000000000 -0500 @@ -0,0 +1,19 @@ +/*************************************************************************** + + hiscore.h + + Manages the hiscore system. + + Copyright (c) 1996-2006, Nicola Salmoria and the MAME Team. + Visit http://mamedev.org for licensing and usage restrictions. + +***************************************************************************/ + +#pragma once + +#ifndef __HISCORE_H__ +#define __HISCORE_H__ + +void hiscore_init( running_machine *machine ); + +#endif /* __HISCORE_H__ */ diff -Nru old/emu/mame.c src/emu/mame.c --- old/emu/mame.c 2008-07-31 02:00:14.000000000 -0500 +++ src/emu/mame.c 2008-08-24 14:29:08.000000000 -0500 @@ -83,6 +83,8 @@ #include "driver.h" #include "config.h" #include "cheat.h" +//MKCHAMP - ADDING HEADER FILE HISCORE FOR INCLUSION +#include "hiscore.h" #include "debugger.h" #include "profiler.h" #include "render.h" @@ -323,7 +325,11 @@ nvram_load(machine); /* display the startup screens */ - ui_display_startup_screens(machine, firstrun, !settingsloaded); + //MKCHAMP - CHANGING !settingsloaded to !1 SO STARTUP SCREENS ARE BYPASSED + if (!options_get_bool(mame_options(), OPTION_DISABLE_NAGSCREEN_PATCH)) + ui_display_startup_screens(machine, firstrun, !1); + else + ui_display_startup_screens(machine, firstrun, !settingsloaded); firstrun = FALSE; /* start resource tracking; note that soft_reset assumes it can */ @@ -1594,6 +1600,9 @@ /* initialize miscellaneous systems */ saveload_init(machine); + //MKCHAMP - INITIALIZING THE HISCORE ENGINE + if (!options_get_bool(mame_options(), OPTION_DISABLE_HISCORE_PATCH)) + hiscore_init(machine); if (options_get_bool(mame_options(), OPTION_CHEAT)) cheat_init(machine); } diff -Nru old/emu/profiler.c src/emu/profiler.c --- old/emu/profiler.c 2008-03-09 08:41:18.000000000 -0500 +++ src/emu/profiler.c 2008-08-23 20:17:40.000000000 -0500 @@ -126,6 +126,8 @@ "Sound ", "Mixer ", "Callbck", + //MKCHAMP - ADDED HISCORE ENGINE TO THE PROFILER + "Hiscore", "Input ", "Movie ", "Logerr ", diff -Nru old/emu/profiler.h src/emu/profiler.h --- old/emu/profiler.h 2008-01-05 17:47:42.000000000 -0600 +++ src/emu/profiler.h 2008-08-23 20:17:40.000000000 -0500 @@ -39,6 +39,8 @@ PROFILER_SOUND, PROFILER_MIXER, PROFILER_TIMER_CALLBACK, + //MKCHAMP - INCLUDING THE HISCORE ENGINE TO THE PROFILER + PROFILER_HISCORE, PROFILER_INPUT, /* input.c and inptport.c */ PROFILER_MOVIE_REC, /* movie recording */ PROFILER_LOGERROR, /* logerror */ diff -Nru old/emu/romload.c src/emu/romload.c --- old/emu/romload.c 2008-08-17 21:31:10.000000000 -0500 +++ src/emu/romload.c 2008-08-24 14:30:10.000000000 -0500 @@ -415,7 +415,9 @@ static void display_loading_rom_message(const char *name, rom_load_data *romdata) { char buffer[200]; - + //MKCHAMP - DISABLING WHOLE SUB ROUTINE TO ELIMINATE LOADING MESSAGES + if (!options_get_bool(mame_options(), OPTION_DISABLE_LOADING_PATCH)) + return; if (name != NULL) sprintf(buffer, "Loading (%d%%)", 100 * romdata->romsloaded / romdata->romstotal); else diff -Nru old/emu/ui.c src/emu/ui.c --- old/emu/ui.c 2008-08-19 00:31:56.000000000 -0500 +++ src/emu/ui.c 2008-08-24 20:09:19.000000000 -0500 @@ -347,11 +347,17 @@ switch (state) { case 0: + //MKCHAMP - BREAKING OUT SO DISCLAIMERS AREN'T SHOWN + if (!options_get_bool(mame_options(), OPTION_DISABLE_NAGSCREEN_PATCH)) + break; if (show_disclaimer && astring_len(disclaimer_string(machine, messagebox_text)) > 0) ui_set_handler(handler_messagebox_ok, 0); break; case 1: + //MKCHAMP - BREAKING OUT SO WARNINGS AREN'T SHOWN + if (!options_get_bool(mame_options(), OPTION_DISABLE_NAGSCREEN_PATCH)) + break; if (show_warnings && astring_len(warnings_string(machine, messagebox_text)) > 0) { ui_set_handler(handler_messagebox_ok, 0); @@ -361,6 +367,9 @@ break; case 2: + //MKCHAMP - BREAKING OUT SO GAME INFO ISN'T SHOWN + if (!options_get_bool(mame_options(), OPTION_DISABLE_NAGSCREEN_PATCH)) + break; if (show_gameinfo && astring_len(game_info_astring(machine, messagebox_text)) > 0) ui_set_handler(handler_messagebox_anykey, 0); break; @@ -375,12 +384,17 @@ while (input_code_poll_switches(FALSE) != INPUT_CODE_INVALID) ; /* loop while we have a handler */ - while (ui_handler_callback != handler_ingame && !mame_is_scheduled_event_pending(machine) && !ui_menu_is_force_game_select()) - video_frame_update(machine, FALSE); - + //MKChamp Disabling of whitebox + if (options_get_bool(mame_options(), OPTION_DISABLE_NAGSCREEN_PATCH)) + { + while (ui_handler_callback != handler_ingame && !mame_is_scheduled_event_pending(machine) && !ui_menu_is_force_game_select()) + video_frame_update(machine, FALSE); + } /* clear the handler and force an update */ ui_set_handler(handler_ingame, 0); - video_frame_update(machine, FALSE); + //MKChamp Disabling of whitebox + if (options_get_bool(mame_options(), OPTION_DISABLE_NAGSCREEN_PATCH)) + video_frame_update(machine, FALSE); } /* if we're the empty driver, force the menus on */ @@ -409,11 +423,14 @@ if (force || (curtime - lastupdatetime) > osd_ticks_per_second() / 4) { lastupdatetime = curtime; - video_frame_update(machine, FALSE); + //MKCHAMP - CALLING NEW SUB CALLED video_frame_update_hi SO WHITE BOX DOES NOT SHOW BUT REFRESHSPEED IS STILL CALCULATED + if (!options_get_bool(mame_options(), OPTION_DISABLE_LOADING_PATCH)) + video_frame_update_hi(machine, FALSE); + else + video_frame_update(machine, FALSE); } } - /*------------------------------------------------- ui_update_and_render - update the UI and render it; called by video.c @@ -459,7 +476,9 @@ display_rescale_message = FALSE; if (allow_rescale == 0) allow_rescale = 2; - ui_draw_text_box("Updating Artwork...", JUSTIFY_CENTER, 0.5f, 0.5f, messagebox_backcolor); + //MKCHAMP - DISABLING THE UPDATING ARTWORK MESSAGE + if (options_get_bool(mame_options(), OPTION_DISABLE_LOADING_PATCH)) + ui_draw_text_box("Updating Artwork...", JUSTIFY_CENTER, 0.5f, 0.5f, messagebox_backcolor); } /* decrement the frame counter if it is non-zero */ diff -Nru old/emu/video.c src/emu/video.c --- old/emu/video.c 2008-07-28 09:22:22.000000000 -0500 +++ src/emu/video.c 2008-08-24 20:09:44.000000000 -0500 @@ -623,10 +623,13 @@ int num_to_decode = (j + 1024 < gfx->total_elements) ? 1024 : (gfx->total_elements - j); decodegfx(gfx, region_base + gfxdecodeinfo[i].start, j, num_to_decode); curgfx += num_to_decode; - /* display some startup text */ - sprintf(buffer, "Decoding (%d%%)", curgfx * 100 / totalgfx); - ui_set_startup_text(machine, buffer, FALSE); + //MKCHAMP - DISABLING THE DECODING MESSAGES + if (options_get_bool(mame_options(), OPTION_DISABLE_LOADING_PATCH)) + { + sprintf(buffer, "Decoding (%d%%)", curgfx * 100 / totalgfx); + ui_set_startup_text(machine, buffer, FALSE); + } } } @@ -1533,6 +1536,79 @@ } } +/*------------------------------------------------- + MKCHAMP - BELOW IS THE NEW SUB CALLED FROM UI.C. ONLY DIFFERENCE BETWEEN THIS SUB AND + video_frame_update IS IT CALLS NEW SUB CALLED osd_update_hi INSTEAD OF osd_update (located + in osd/windows/video.c) +-------------------------------------------------*/ + +void video_frame_update_hi(running_machine *machine, int debug) +{ + attotime current_time = timer_get_time(); + int skipped_it = global.skipping_this_frame; + int phase = mame_get_phase(machine); + + /* validate */ + assert(machine != NULL); + 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) || options_get_bool(mame_options(), OPTION_UPDATEINPAUSE))) + { + int anything_changed = finish_screen_updates(machine); + + /* if none of the screens changed and we haven't skipped too many frames in a row, + mark this frame as skipped to prevent throttling; this helps for games that + don't update their screen at the monitor refresh rate */ + if (!anything_changed && !global.auto_frameskip && global.frameskip_level == 0 && global.empty_skip_count++ < 3) + skipped_it = TRUE; + else + global.empty_skip_count = 0; + } + + /* draw the user interface */ + ui_update_and_render(machine); + + /* if we're throttling, synchronize before rendering */ + if (!debug && !skipped_it && effective_throttle(machine)) + update_throttle(machine, current_time); + + /* ask the OSD to update */ + profiler_mark(PROFILER_BLIT); + osd_update_hi(machine, !debug && skipped_it); + profiler_mark(PROFILER_END); + + /* perform tasks for this frame */ + if (!debug) + mame_frame_update(machine); + + /* update frameskipping */ + if (!debug) + update_frameskip(machine); + + /* update speed computations */ + if (!debug && !skipped_it) + recompute_speed(machine, current_time); + + /* call the end-of-frame callback */ + if (phase == MAME_PHASE_RUNNING) + { + /* reset partial updates if we're paused or if the debugger is active */ + if (machine->primary_screen != NULL && (mame_is_paused(machine) || debug || debugger_within_instruction_hook(machine))) + { + void *param = (void *)machine->primary_screen; + scanline0_callback(machine, param, 0); + } + + /* otherwise, call the video EOF callback */ + else if (machine->config->video_eof != NULL) + { + profiler_mark(PROFILER_VIDEO); + (*machine->config->video_eof)(machine); + profiler_mark(PROFILER_END); + } + } +} /*------------------------------------------------- finish_screen_updates - finish updating all diff -Nru old/emu/video.h src/emu/video.h --- old/emu/video.h 2008-06-16 10:05:46.000000000 -0500 +++ src/emu/video.h 2008-08-23 20:17:40.000000000 -0500 @@ -224,6 +224,9 @@ /* update the screen, handling frame skipping and rendering */ void video_frame_update(running_machine *machine, int debug); +// MKCHAMP - DECLARING THE NEW video_frame_update_hi SUB +void video_frame_update_hi(running_machine *machine, int debug); + /* ----- throttling/frameskipping/performance ----- */ diff -Nru old/mame/machine/cps2crpt.c src/mame/machine/cps2crpt.c --- old/mame/machine/cps2crpt.c 2008-07-28 09:22:22.000000000 -0500 +++ src/mame/machine/cps2crpt.c 2008-08-24 20:10:00.000000000 -0500 @@ -671,9 +671,13 @@ if ((i & 0xff) == 0) { - char loadingMessage[256]; // for displaying with UI - sprintf(loadingMessage, "Decrypting %d%%", i*100/0x10000); - ui_set_startup_text(machine, loadingMessage,FALSE); + //MKCHAMP - DISABLING THE DECRYPING MESSAGE + if (options_get_bool(mame_options(), OPTION_DISABLE_LOADING_PATCH)) + { + char loadingMessage[256]; // for displaying with UI + sprintf(loadingMessage, "Decrypting %d%%", i*100/0x10000); + ui_set_startup_text(machine, loadingMessage,FALSE); + } } diff -Nru old/osd/osdepend.h src/osd/osdepend.h --- old/osd/osdepend.h 2008-07-17 09:09:54.000000000 -0500 +++ src/osd/osdepend.h 2008-08-23 20:17:40.000000000 -0500 @@ -109,6 +109,8 @@ void osd_update(running_machine *machine, int skip_redraw); +//MKCHAMP - DECLARING THE NEW osd_update_hi SUB +void osd_update_hi(running_machine *machine, int skip_redraw); diff -Nru old/osd/windows/video.c src/osd/windows/video.c --- old/osd/windows/video.c 2008-08-18 23:13:28.000000000 -0500 +++ src/osd/windows/video.c 2008-08-23 20:17:40.000000000 -0500 @@ -206,6 +206,27 @@ check_osd_inputs(machine); } +//============================================================ +// MKCHAMP - BELOW IS THE NEW SUB CALLED FROM emu/video.c. ONLY +// DIFFERENCE BETWEEN THIS SUB AND osd_update IS IT CALLS NEW SUB CALLED winwindow_video_window_update_hi +// INSTEAD OF winwindow_video_window_update (located in osd/windows/window.c) +//============================================================ + +void osd_update_hi(running_machine *machine, int skip_redraw) +{ + win_window_info *window; + + // if we're not skipping this redraw, update all windows + if (!skip_redraw) + for (window = win_window_list; window != NULL; window = window->next) + winwindow_video_window_update_hi(window); + + // poll the joystick values here + winwindow_process_events(machine, TRUE); + wininput_poll(machine); + check_osd_inputs(machine); +} + //============================================================ diff -Nru old/osd/windows/window.c src/osd/windows/window.c --- old/osd/windows/window.c 2008-07-26 07:24:12.000000000 -0500 +++ src/osd/windows/window.c 2008-08-23 20:17:40.000000000 -0500 @@ -756,6 +756,84 @@ mtlog_add("winwindow_video_window_update: end"); } +//============================================================ +// MKCHAMP - LAST OF THE NEW SUB CHAIN. FOR THOSE FOLLOWING, THE PATH IS: +// emu/ui.c->ui_set_startup_text CALLS emu/video.c->video_frame_update_hi WHICH CALLS +// osd/windows/video.c->osd_update_hi WHICH CALLS THIS SUB. +// THE ONLY DIFFERENCE BETWEEN THIS SUB AND winwindow_video_window_update IS IT DOES NOT +// perform PostMessage(window->hwnd, WM_USER_REDRAW, 0, (LPARAM)primlist) OR +// SendMessage(window->hwnd, WM_USER_REDRAW, 0, (LPARAM)primlist) +// ALL THIS DOES IS ALLOW MAME TO PROPERLY RUN TO CALCULATE THE REFRESHSPEED/ETC. WITHOUT +// GIVING THE WHITE BOX THAT SEEMS TO ANNOY SOME PEOPLE! +//============================================================ + +void winwindow_video_window_update_hi(win_window_info *window) +{ + int targetview, targetorient, targetlayerconfig; + + assert(GetCurrentThreadId() == main_threadid); + + mtlog_add("winwindow_video_window_update: begin"); + + // see if the target has changed significantly in window mode + targetview = render_target_get_view(window->target); + targetorient = render_target_get_orientation(window->target); + targetlayerconfig = render_target_get_layer_config(window->target); + if (targetview != window->targetview || targetorient != window->targetorient || targetlayerconfig != window->targetlayerconfig) + { + window->targetview = targetview; + window->targetorient = targetorient; + window->targetlayerconfig = targetlayerconfig; + + // in window mode, reminimize/maximize + if (!window->fullscreen) + { + if (window->isminimized) + SendMessage(window->hwnd, WM_USER_SET_MINSIZE, 0, 0); + if (window->ismaximized) + SendMessage(window->hwnd, WM_USER_SET_MAXSIZE, 0, 0); + } + } + + // if we're visible and running and not in the middle of a resize, draw + if (window->hwnd != NULL && window->target != NULL) + { + int got_lock = TRUE; + + mtlog_add("winwindow_video_window_update: try lock"); + + // only block if we're throttled + if (video_get_throttle() || timeGetTime() - last_update_time > 250) + osd_lock_acquire(window->render_lock); + else + got_lock = osd_lock_try(window->render_lock); + + // only render if we were able to get the lock + if (got_lock) + { + const render_primitive_list *primlist; + + mtlog_add("winwindow_video_window_update: got lock"); + + // don't hold the lock; we just used it to see if rendering was still happening + osd_lock_release(window->render_lock); + + // ensure the target bounds are up-to-date, and then get the primitives + primlist = (*draw.window_get_primitives)(window); + + // post a redraw request with the primitive list as a parameter + last_update_time = timeGetTime(); + mtlog_add("winwindow_video_window_update: PostMessage start"); + //if (multithreading_enabled) + // PostMessage(window->hwnd, WM_USER_REDRAW, 0, (LPARAM)primlist); + //else + // SendMessage(window->hwnd, WM_USER_REDRAW, 0, (LPARAM)primlist); + mtlog_add("winwindow_video_window_update: PostMessage end"); + } + } + + mtlog_add("winwindow_video_window_update: end"); +} //============================================================ diff -Nru old/osd/windows/window.h src/osd/windows/window.h --- old/osd/windows/window.h 2008-07-17 01:09:54.000000000 -0500 +++ src/osd/windows/window.h 2008-08-23 20:17:40.000000000 -0500 @@ -116,6 +116,8 @@ BOOL winwindow_has_focus(void); void winwindow_update_cursor_state(running_machine *machine); void winwindow_video_window_update(win_window_info *window); +//MKCHAMP - DECLARING THE NEW SUB winwindow_video_window_update_hi +void winwindow_video_window_update_hi(win_window_info *window); win_monitor_info *winwindow_video_window_monitor(win_window_info *window, const RECT *proposed); LRESULT CALLBACK winwindow_video_window_proc(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam);