diff options
author | Aaron Giles <aaron@aarongiles.com> | 2008-01-03 05:33:59 +0000 |
---|---|---|
committer | Aaron Giles <aaron@aarongiles.com> | 2008-01-03 05:33:59 +0000 |
commit | 25eee632f605f5e80ba5b076566b39e46078b4a9 (patch) | |
tree | f8340a94d026ca50c74f9486f694023d934f6d09 /src/emu | |
parent | 75ba20112c81d68e5da74896e05e1fdfba2459bb (diff) |
(inspired by Firewave)
Removed ui_popup(). Drivers should always be using popmessage() instead (has been this way for a while).
Augmented popmessage() so that you can pass NULL to immediately dismiss any messages.
Diffstat (limited to 'src/emu')
-rw-r--r-- | src/emu/cpu/mips/psx.c | 2 | ||||
-rw-r--r-- | src/emu/mame.c | 36 | ||||
-rw-r--r-- | src/emu/mame.h | 4 | ||||
-rw-r--r-- | src/emu/sound/k054539.c | 2 | ||||
-rw-r--r-- | src/emu/ui.c | 22 |
5 files changed, 26 insertions, 40 deletions
diff --git a/src/emu/cpu/mips/psx.c b/src/emu/cpu/mips/psx.c index 06a5eedd49d..1860b606f49 100644 --- a/src/emu/cpu/mips/psx.c +++ b/src/emu/cpu/mips/psx.c @@ -3126,7 +3126,7 @@ static void docop2( int gteop ) } break; } - ui_popup_time( 1, "unknown GTE op %08x", gteop ); + popmessage( "unknown GTE op %08x", gteop ); logerror( "%08x: unknown GTE op %08x\n", mipscpu.pc, gteop ); mips_stop(); } diff --git a/src/emu/mame.c b/src/emu/mame.c index 0934fa3ff4f..f83789e7a1d 100644 --- a/src/emu/mame.c +++ b/src/emu/mame.c @@ -1153,18 +1153,26 @@ void CLIB_DECL fatalerror_exitcode(int exitcode, const char *text, ...) popmessage - pop up a user-visible message -------------------------------------------------*/ -void CLIB_DECL popmessage(const char *text, ...) +void CLIB_DECL popmessage(const char *format, ...) { - extern void CLIB_DECL ui_popup(const char *text, ...) ATTR_PRINTF(1,2); - va_list arg; - - /* dump to the buffer */ - va_start(arg, text); - vsnprintf(giant_string_buffer, GIANT_STRING_BUFFER_SIZE, text, arg); - va_end(arg); - - /* pop it in the UI */ - ui_popup("%s", giant_string_buffer); + /* if the format is NULL, it is a signal to clear the popmessage */ + if (format == NULL) + ui_popup_time(0, " "); + + /* otherwise, generate the buffer and call the UI to display the message */ + else + { + extern void CLIB_DECL ui_popup(const char *format, ...) ATTR_PRINTF(1,2); + va_list arg; + + /* dump to the buffer */ + va_start(arg, format); + vsnprintf(giant_string_buffer, GIANT_STRING_BUFFER_SIZE, format, arg); + va_end(arg); + + /* pop it in the UI */ + ui_popup_time((int)strlen(giant_string_buffer) / 40 + 2, "%s", giant_string_buffer); + } } @@ -1173,7 +1181,7 @@ void CLIB_DECL popmessage(const char *text, ...) OSD-defined output streams -------------------------------------------------*/ -void CLIB_DECL logerror(const char *text, ...) +void CLIB_DECL logerror(const char *format, ...) { running_machine *machine = Machine; @@ -1191,8 +1199,8 @@ void CLIB_DECL logerror(const char *text, ...) profiler_mark(PROFILER_LOGERROR); /* dump to the buffer */ - va_start(arg, text); - vsnprintf(giant_string_buffer, GIANT_STRING_BUFFER_SIZE, text, arg); + va_start(arg, format); + vsnprintf(giant_string_buffer, GIANT_STRING_BUFFER_SIZE, format, arg); va_end(arg); /* log to all callbacks */ diff --git a/src/emu/mame.h b/src/emu/mame.h index 5264d7794a5..ed6485c1e0d 100644 --- a/src/emu/mame.h +++ b/src/emu/mame.h @@ -369,10 +369,10 @@ void mame_printf_debug(const char *format, ...) ATTR_PRINTF(1,2); /* ----- miscellaneous bits & pieces ----- */ /* pop-up a user visible message */ -void CLIB_DECL popmessage(const char *text,...) ATTR_PRINTF(1,2); +void CLIB_DECL popmessage(const char *format,...) ATTR_PRINTF(1,2); /* log to the standard error.log file */ -void CLIB_DECL logerror(const char *text,...) ATTR_PRINTF(1,2); +void CLIB_DECL logerror(const char *format,...) ATTR_PRINTF(1,2); /* adds a callback to be called on logerror() */ void add_logerror_callback(running_machine *machine, void (*callback)(running_machine *, const char *)); diff --git a/src/emu/sound/k054539.c b/src/emu/sound/k054539.c index 9900c06912c..fe50e0d1f3f 100644 --- a/src/emu/sound/k054539.c +++ b/src/emu/sound/k054539.c @@ -377,7 +377,7 @@ else if (input_code_pressed_once(KEYCODE_DEL_PAD)) { gc_active ^= 1; - if (!gc_active) ui_popup_time(0, " "); + if (!gc_active) popmessage(NULL); } if (gc_active) diff --git a/src/emu/ui.c b/src/emu/ui.c index 2f6a630b09f..4cf4eef848d 100644 --- a/src/emu/ui.c +++ b/src/emu/ui.c @@ -807,28 +807,6 @@ void ui_draw_text_box(const char *text, int justify, float xpos, float ypos, rgb /*------------------------------------------------- - ui_popup - popup a message for a standard - amount of time --------------------------------------------------*/ - -void CLIB_DECL ui_popup(const char *text, ...) -{ - int seconds; - va_list arg; - - /* extract the text */ - va_start(arg,text); - vsprintf(messagebox_text, text, arg); - messagebox_backcolor = UI_FILLCOLOR; - va_end(arg); - - /* set a timer */ - seconds = (int)strlen(messagebox_text) / 40 + 2; - popup_text_end = osd_ticks() + osd_ticks_per_second() * seconds; -} - - -/*------------------------------------------------- ui_popup_time - popup a message for a specific amount of time -------------------------------------------------*/ |