Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Change MAME source code to show "GAME PAUSED" when pausing game?  (Read 809 times)

0 Members and 1 Guest are viewing this topic.

johnye_pt

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:August 22, 2024, 09:12:08 am
  • I want to build my own arcade controls!
I'm using MAME 0.170 because it's the last version that supports DirectDraw for XP. I've modded my version to include HISCORE.DAT support and to skip game's info/warnings by using this topic's patches, plus I changed #define FORCE_DIRECTINPUT from 0 to 1 so I can use an AutoHotKey script to insert 3 credits by pressing 5 x3 times when the number 6 is pressed, because that's how it worked back in my time ;)

I found this diff that adds one key save (avoids requiring to press a key to select a save slot position), but I think I can do that with the AutoHotKey script. The one thing I can't do is add the "GAME PAUSED" text to the code, since the diff is from March 2005 and seems to be based on MAME 0.94 source code, which is completely different from 0.170. For one, it modifies the src\usrintrf.c which doesn't exist in 0.170, but I believe its counterpart is src\emu\ui\ui.cpp. Secondly, it adds the text by using UI_TEXT, which doesn't exist in 0.170.

Could someone help me find out how to add the "GAME PAUSED" message when MAME is paused? 0.170 and current 0.268 code seems similar, so the modifications for 0.268 might be applicable to 0.170.

EDIT: Forgot to mention that the diff was posted 19 years ago and the user hasn't been active in 10 years...
« Last Edit: August 11, 2024, 11:04:54 am by johnye_pt »

johnye_pt

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:August 22, 2024, 09:12:08 am
  • I want to build my own arcade controls!
Re: Change MAME source code to show "GAME PAUSED" when pausing game?
« Reply #1 on: August 11, 2024, 03:59:26 pm »
Ok, instead of editing the 1st post, I'll add a new post with the answer.

After a LOT of trial and error, here is the modification to add the "GAME PAUSED" message. In src\emu\ui\ui.cpp, replace...
Code: [Select]
container->add_rect(0.0f, 0.0f, 1.0f, 1.0f, rgb_t(alpha,0x00,0x00,0x00), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
}
... with...
Code: [Select]
container->add_rect(0.0f, 0.0f, 1.0f, 1.0f, rgb_t(alpha,0x00,0x00,0x00), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
//PATCH - add "GAME PAUSED" message
draw_message_window(container, "GAME PAUSED");
}

And here is the VERY CRUDE modifications for the one-key load/save. In src\emu\ui\ui.cpp, replace...
Code: [Select]
if (state == LOADSAVE_NONE)
return 0;

// okay, we're waiting for a key to select a slot; display a message
... with...
Code: [Select]
if (state == LOADSAVE_NONE)
return 0;

//PATCH - skip user input and jump directly to load/save code
goto PATCH_jump;

// okay, we're waiting for a key to select a slot; display a message

And also replace...
Code: [Select]
if (file == 0)
return state;

// display a popup indicating that the save will proceed
... with...
Code: [Select]
if (file == 0)
return state;

//PATCH - set key pressed to be always "0" and proceed with save/load
PATCH_jump:
file = '0';

// display a popup indicating that the save will proceed

I would make a DIFF but I don't know how to.
« Last Edit: August 11, 2024, 04:30:48 pm by johnye_pt »

abispac

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1611
  • Last login:October 02, 2024, 01:21:32 pm
Re: Change MAME source code to show "GAME PAUSED" when pausing game?
« Reply #2 on: August 12, 2024, 01:18:33 pm »
You can also achieve what you looking for with AHK, I'm not sure how to be honest, but back in the days I had an ahk script that would add time to console games everytime you added a coin to make them coin op. And it would display the time on screen, it would also add a sound for the time almost being gone so you could add more coins, the script would also pause the games for a few seconds after the time was gone to give you some more time to add coins, so yeah,its possible with ahk to pause the game and display a message. But unfurtunily, I don't have that script anymore. Ima a look for it to see if I can find it.  I don't promise anything.

johnye_pt

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:August 22, 2024, 09:12:08 am
  • I want to build my own arcade controls!
Re: Change MAME source code to show "GAME PAUSED" when pausing game?
« Reply #3 on: August 14, 2024, 08:19:53 pm »
Thanks for the offer. but the pause message is simply to actually see that the game is paused, I don't like that it just darkens the screen, it makes it look like the computer is frozen to some people that don't know better. I'm also interested in including the External DAT support that was added to 0.171 but that's a much bigger endeavor than just adding a new line of code or commenting a few lines.

By the way, here's all the DIFFs I used in my custom build (so far) in case anyone is interested. I figured out how to create DIFFs, I also found a simpler way for the One Key Load/Save patch by commenting the unneeded code with /* */ instead of using the ugly GoTo command.