Build Your Own Arcade Controls Forum

Main => Software Forum => Topic started by: Farmboy90 on February 07, 2006, 10:12:11 pm

Title: Want to display "Game Paused" on your screen?
Post by: Farmboy90 on February 07, 2006, 10:12:11 pm
Real quick if anyone is interested.  When you pause your game, mame will darken the screen to indicate that it is paused.  This isn't enough for me so I wanted to display the words "Game Paused" in the center of the screen.

I realize this problem has been solved before in a older thread but that code change was for an ancient build of mame.

For anyone running something this century you need only add this one line of code.  I am using v0.102 of mame.  So anything within a few builds of this should apply.

Open cpuexec.c.  At around line 482 you see this code:

/* otherwise, just pump video updates through */
else
{
   ui_draw_message_window("GAME PAUSED");       
        time_to_quit |= updatescreen();      
        reset_partial_updates();
}


Just add the line in bold and recompile.  All done.
Title: Re: Want to display "Game Paused" on your screen?
Post by: Necro on February 08, 2006, 10:33:44 am
Very nice...thanks!
Title: Re: Want to display "Game Paused" on your screen?
Post by: hnugz on February 08, 2006, 11:11:59 am
that is good to know, i need to look into compiling my own eventually.
Title: Re: Want to display "Game Paused" on your screen?
Post by: jelwell on February 08, 2006, 04:51:56 pm
I realize this problem has been solved before in a older thread but that code change was for an ancient build of mame.

For anyone running something this century

*sigh* I'm officially ancient. It's worst then the time I realized that a girl I dated was born in a different decade.
Joseph Elwell.
Title: Re: Want to display "Game Paused" on your screen?
Post by: Farmboy90 on February 09, 2006, 10:42:09 am
No worries.  The old post may work for you.  Not sure where to find it though.  Let me see if I can search for it....

I couldn't find it, however I do have the code change that needed to be made.  Not sure if this aligns with your version.

diff -c -r ..\/src/usrintrf.c ./src/usrintrf.c
*** ..\/src/usrintrf.c   Tue Nov 23 18:05:00 2004
--- ./src/usrintrf.c   Thu Dec 16 22:33:16 2004
***************
*** 3940,3946 ****
        if (input_ui_pressed(IPT_UI_CANCEL))
           break;
 
!       code = code_read_async();
        if (code != CODE_NONE)
        {
           if (code >= KEYCODE_A && code <= KEYCODE_Z)
--- 3940,3947 ----
        if (input_ui_pressed(IPT_UI_CANCEL))
           break;
 
!       //JOEY
!        code = KEYCODE_A; //code_read_async();
        if (code != CODE_NONE)
        {
           if (code >= KEYCODE_A && code <= KEYCODE_Z)
***************
*** 4153,4166 ****
--- 4154,4173 ----
        if (single_step == 0)
           mame_pause(1);
 
+       // JOEY ADD PAUSE text
+       ui_text(bitmap, "GAME PAUSED", 100, 100);
+
        while (!input_ui_pressed(IPT_UI_PAUSE))
        {
+
           profiler_mark(PROFILER_VIDEO);
           if (osd_skip_this_frame() == 0)
           {
              /* keep calling vh_screenrefresh() while paused so we can stuff */
              /* debug code in there */
              draw_screen();
+             // JOEY ADD PAUSE text
+             ui_text(bitmap, "GAME PAUSED", 100, 100);
           }
           profiler_mark(PROFILER_END);
 
***************
*** 4206,4211 ****
--- 4213,4221 ----
              }
           if (osd_selected != 0) osd_selected = on_screen_display(bitmap, osd_selected);
 
+          // JOEY ADD PAUSE text
+ //         ui_text(bitmap, "GAME PAUSED", 100, 100);
+
           if (options.cheat) DisplayWatches(bitmap);
 
           /* show popup message if any */
***************
*** 4220,4225 ****
--- 4230,4238 ----
           update_video_and_audio();
           reset_partial_updates();
 
+          // JOEY ADD PAUSE text
+ //         ui_text(bitmap, "GAME PAUSED", 100, 100);
+
  #ifdef MESS
           if (!setup_selected && mess_pause_for_ui)
           {
***************
*** 4238,4243 ****
--- 4251,4258 ----
        }
 
        schedule_full_refresh();
+       // JOEY ADD PAUSE text
+       ui_text(bitmap, "GAME PAUSED", 100, 100);
     }
 
  #if defined(__sgi) && !defined(MESS)


Title: Re: Want to display "Game Paused" on your screen?
Post by: jelwell on February 09, 2006, 03:56:38 pm
No worries.  The old post may work for you.  Not sure where to find it though.  Let me see if I can search for it....

I couldn't find it, however I do have the code change that needed to be made.  Not sure if this aligns with your version.
Haha. Sorry, I should have been more clear. Your code changes say JOEY, cause that's my name, and I posted the code for the ancient build. Once my LCDTopguns arrive I'll think about upgrading from (I think .92) to .104 :)
Joseph Elwell.
Title: Re: Want to display "Game Paused" on your screen?
Post by: hulkster on February 09, 2006, 04:40:06 pm
Real quick if anyone is interested.  When you pause your game, mame will darken the screen to indicate that it is paused.  This isn't enough for me so I wanted to display the words "Game Paused" in the center of the screen.

I realize this problem has been solved before in a older thread but that code change was for an ancient build of mame.

For anyone running something this century you need only add this one line of code.  I am using v0.102 of mame.  So anything within a few builds of this should apply.

Open cpuexec.c.  At around line 482 you see this code:

/* otherwise, just pump video updates through */
else
{
   ui_draw_message_window("GAME PAUSED");       
        time_to_quit |= updatescreen();      
        reset_partial_updates();
}


Just add the line in bold and recompile.  All done.

ehhhhhhh.....how do i recompile mame?  i dont think i ever compiled it in the first place.  i just downloaded, extracted into a folder, and played games.  ive seen a compiler util. on mame.net i think but how do i use that and will that mess up my mame.exe or .ini?
Title: Re: Want to display "Game Paused" on your screen?
Post by: jelwell on February 09, 2006, 07:13:27 pm

ehhhhhhh.....how do i recompile mame?  i dont think i ever compiled it in the first place.  i just downloaded, extracted into a folder, and played games.  ive seen a compiler util. on mame.net i think but how do i use that and will that mess up my mame.exe or .ini?

Compiling is not for the feint of heart. If you insist (http://www.mame.net/compile061win.html). It looks like the instructions have been touched up since I did it, so maybe it's easier now.

good luck,
Joseph Elwell.
Title: Re: Want to display "Game Paused" on your screen?
Post by: Brad on February 09, 2006, 07:43:27 pm
Actually compiling Mame is a piece of cake. Check our Mr Do's destructions < -- =P here.

http://www.mameworld.net/mrdo/compile.html

Brad
Title: Re: Want to display "Game Paused" on your screen?
Post by: Necro on February 09, 2006, 08:13:33 pm
Yeah use Mr. Do's instructions.  ANy others I found on the net were totally crap and didnt work. :)
Title: Re: Want to display "Game Paused" on your screen?
Post by: Farmboy90 on February 09, 2006, 11:26:07 pm
No worries.  The old post may work for you.  Not sure where to find it though.  Let me see if I can search for it....

I couldn't find it, however I do have the code change that needed to be made.  Not sure if this aligns with your version.
Haha. Sorry, I should have been more clear. Your code changes say JOEY, cause that's my name, and I posted the code for the ancient build. Once my LCDTopguns arrive I'll think about upgrading from (I think .92) to .104 :)
Joseph Elwell.


LOL!  Yeah sorry I didn't notice you when I replied.  Yes this is your code.  :)  You inspired me to fix it in the new versions.  :)