diff -Nru old/emu/cheat.c src/emu/cheat.c --- old/emu/cheat.c 2008-04-02 22:21:52.000000000 -0500 +++ src/emu/cheat.c 2008-05-05 09:14:55.000000000 -0500 @@ -525,6 +525,8 @@ EXPORTED VARIABLES ***************************************************************************/ +// MKCHAMP - ADD VARIABLE SO HIGH SCORES AREN'T SAVED IF CHEAT IS ENABLED +int he_did_cheat = 0; static const char * cheatfile = NULL; /*************************************************************************** @@ -1461,6 +1463,8 @@ void cheat_init(running_machine *machine) { /* ----- initialize lists ----- */ + //MKCHAMP - DEFAULTING he_did_cheat to 0 + he_did_cheat = 0; cheatList = NULL; cheatListLength = 0; @@ -11153,6 +11157,8 @@ } entry->flags |= kCheatFlag_Active; + //MKCHAMP - CHEATS ARE ACTIVATED...SETTING he_did_cheat to 1 SO HIGH SCORES AREN'T SAVED + he_did_cheat = 1; } /*-------------------------------------------------------------------------------------- diff -Nru old/emu/cheat.h src/emu/cheat.h --- old/emu/cheat.h 2008-01-24 02:12:04.000000000 -0600 +++ src/emu/cheat.h 2008-05-05 09:14:55.000000000 -0500 @@ -16,6 +16,9 @@ #include "mamecore.h" +//MKCHAMP - DECLARING he_did_cheat SO HIGH SCORES AREN'T SAVED IF CHEATS ARE ENABLED +extern int he_did_cheat; + void cheat_init(running_machine *machine); int cheat_menu(running_machine *machine, int selection); diff -Nru old/emu/crsshair.c src/emu/crsshair.c --- old/emu/crsshair.c 2008-03-17 05:47:24.000000000 -0500 +++ src/emu/crsshair.c 2008-05-05 09:14:55.000000000 -0500 @@ -200,7 +200,9 @@ /* mark as used and visible */ global.used[player] = TRUE; - global.visible[player] = TRUE; + /*MKCHAMP - DISABLING CROSSHAIRS BY DEFAULT + global.visible[player] = TRUE;*/ + global.visible[player] = FALSE; /* 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-04-20 17:00:56.000000000 -0500 +++ src/emu/emu.mak 2008-05-05 09:14:55.000000000 -0500 @@ -33,6 +33,7 @@ #------------------------------------------------- # emulator core objects +# MKCHAMP - ADDED hiscore.o TO LIST TO COMPILE THE HISCORE PIECE #------------------------------------------------- EMUOBJS = \ @@ -52,6 +53,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-04-20 17:05:56.000000000 -0500 +++ src/emu/emuopts.c 2008-05-05 09:14:55.000000000 -0500 @@ -57,6 +57,8 @@ /* filename options */ { NULL, NULL, OPTION_HEADER, "CORE FILENAME OPTIONS" }, { "cheat_file", "cheat.dat", 0, "cheat filename" }, + //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" }, diff -Nru old/emu/emuopts.h src/emu/emuopts.h --- old/emu/emuopts.h 2008-01-05 17:47:42.000000000 -0600 +++ src/emu/emuopts.h 2008-05-05 09:14:55.000000000 -0500 @@ -57,6 +57,8 @@ /* core filename options */ #define OPTION_CHEAT_FILE "cheat_file" +//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" diff -Nru old/emu/fileio.h src/emu/fileio.h --- old/emu/fileio.h 2008-01-05 17:47:42.000000000 -0600 +++ src/emu/fileio.h 2008-05-05 09:14:55.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-05-05 09:14:55.000000000 -0500 @@ -0,0 +1,390 @@ +/*************************************************************************** + + hiscore.c + + Manages the hiscore system. + + Copyright (c) 1996-2006, 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; + + /* disable high score when cheats are used */ + if (he_did_cheat != 0) + 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->gamedrv->name, ".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->gamedrv->name, ".hi"); + filerr = mame_fopen(FILETYPE_HIGHSCORE, astring_c(fname), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &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 void hiscore_periodic (int param) +{ + if (state.mem_range) + { + if (!state.hiscores_have_been_loaded) + { + if (safe_to_load()) + { + hiscore_load(); + timer_enable(timer, FALSE); + } + } + } +} + +static TIMER_CALLBACK( hiscore_periodic_callback ) +{ + hiscore_periodic(param); +} + + +/* 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) +{ + file_error filerr; + const char *name = machine->gamedrv->name; + memory_range *mem_range = state.mem_range; + mame_file *f; + 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_callback, NULL); + timer_adjust_periodic(timer, ATTOTIME_IN_HZ(60), 0, ATTOTIME_IN_HZ(60)); + 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-05-05 09:14:55.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-04-05 23:03:02.000000000 -0500 +++ src/emu/mame.c 2008-05-05 09:14:55.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" @@ -375,7 +377,8 @@ nvram_load(); /* display the startup screens */ - ui_display_startup_screens(machine, firstrun, !settingsloaded); + //MKCHAMP - CHANGING !settingsloaded to !1 SO STARTUP SCREENS ARE BYPASSED + ui_display_startup_screens(machine, firstrun, !1); firstrun = FALSE; /* start resource tracking; note that soft_reset assumes it can */ @@ -1609,6 +1612,8 @@ /* initialize miscellaneous systems */ saveload_init(machine); + //MKCHAMP - INITIALIZING THE HISCORE ENGINE + 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-05-05 09:14:55.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-05-05 09:14:55.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-05-01 07:02:14.000000000 -0500 +++ src/emu/romload.c 2008-05-05 09:14:55.000000000 -0500 @@ -398,14 +398,15 @@ 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 +/* char buffer[200]; if (name != NULL) sprintf(buffer, "Loading (%d%%)", 100 * romdata->romsloaded / romdata->romstotal); else sprintf(buffer, "Loading Complete"); - ui_set_startup_text(Machine, buffer, FALSE); + ui_set_startup_text(Machine, buffer, FALSE);*/ } diff -Nru old/emu/ui.c src/emu/ui.c --- old/emu/ui.c 2008-05-03 10:56:42.000000000 -0500 +++ src/emu/ui.c 2008-05-05 09:14:55.000000000 -0500 @@ -333,11 +333,15 @@ switch (state) { case 0: + //MKCHAMP - BREAKING OUT SO DISCLAIMERS AREN'T SHOWN + break; if (show_disclaimer && sprintf_disclaimer(machine, messagebox_text)) ui_set_handler(handler_messagebox_ok, 0); break; case 1: + //MKCHAMP - BREAKING OUT SO WARNINGS AREN'T SHOWN + break; if (show_warnings && sprintf_warnings(machine, messagebox_text)) { ui_set_handler(handler_messagebox_ok, 0); @@ -347,6 +351,8 @@ break; case 2: + //MKCHAMP - BREAKING OUT SO GAME INFO ISN'T SHOWN + break; if (show_gameinfo && sprintf_game_info(machine, messagebox_text)) ui_set_handler(handler_messagebox_anykey, 0); break; @@ -362,11 +368,13 @@ /* 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 - NOT UPDATING THE VIDEO FRAME FOR MESSAGES/WHITE BOXES -- NO NEED TO + /*video_frame_update(machine, FALSE);*/ /* clear the handler and force an update */ ui_set_handler(handler_ingame, 0); - video_frame_update(machine, FALSE); + //MKCHAMP - NOT UPDATING THE VIDEO FRAME FOR MESSAGES/WHITE BOXES -- NO NEED TO + /*video_frame_update(machine, FALSE);*/ } /* if we're the empty driver, force the menus on */ @@ -395,11 +403,12 @@ 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 + video_frame_update(machine, FALSE); */ + video_frame_update_hi(machine, FALSE); } } - /*------------------------------------------------- ui_update_and_render - update the UI and render it; called by video.c @@ -436,7 +445,8 @@ 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 + /*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-04-23 22:32:58.000000000 -0500 +++ src/emu/video.c 2008-05-05 09:14:55.000000000 -0500 @@ -564,7 +564,8 @@ static void decode_graphics(running_machine *machine, const gfx_decode_entry *gfxdecodeinfo) { int totalgfx = 0, curgfx = 0; - char buffer[200]; + //MKCHAMP - NO LONGER USING THIS VARIABLE, SO NOT GOING TO DECLARE IT + /*char buffer[200];*/ int i; /* count total graphics elements */ @@ -591,8 +592,9 @@ 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 + /*sprintf(buffer, "Decoding (%d%%)", curgfx * 100 / totalgfx); + ui_set_startup_text(machine, buffer, FALSE);*/ } } @@ -1461,6 +1463,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 || mame_debug_is_active())) + { + 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-04-05 23:03:02.000000000 -0500 +++ src/emu/video.h 2008-05-05 09:14:55.000000000 -0500 @@ -223,6 +223,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-04-30 00:51:54.000000000 -0500 +++ src/mame/machine/cps2crpt.c 2008-05-05 09:14:55.000000000 -0500 @@ -672,9 +672,10 @@ if ((i & 0xff) == 0) { - char loadingMessage[256]; // for displaying with UI + //MKCHAMP - DISABLING THE DECRYPING MESSAGE + /*char loadingMessage[256]; // for displaying with UI sprintf(loadingMessage, "Decrypting %d%%", i*100/0x10000); - ui_set_startup_text(Machine, loadingMessage,FALSE); + ui_set_startup_text(Machine, loadingMessage,FALSE);*/ } diff -Nru old/osd/osdepend.h src/osd/osdepend.h --- old/osd/osdepend.h 2008-02-23 10:46:54.000000000 -0600 +++ src/osd/osdepend.h 2008-05-05 09:14:55.000000000 -0500 @@ -108,6 +108,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-04-11 07:05:26.000000000 -0500 +++ src/osd/windows/video.c 2008-05-05 09:14:55.000000000 -0500 @@ -214,6 +214,27 @@ check_osd_inputs(); } +//============================================================ +// 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(); +} + //============================================================ diff -Nru old/osd/windows/window.c src/osd/windows/window.c --- old/osd/windows/window.c 2008-04-11 07:05:26.000000000 -0500 +++ src/osd/windows/window.c 2008-05-05 09:14:55.000000000 -0500 @@ -769,6 +769,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-04-11 07:05:26.000000000 -0500 +++ src/osd/windows/window.h 2008-05-05 09:14:55.000000000 -0500 @@ -111,6 +111,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);