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: MAME cheat button?  (Read 4334 times)

0 Members and 1 Guest are viewing this topic.

DJMattB241

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 29
  • Last login:August 26, 2014, 06:39:56 pm
  • I want to build my own arcade controls!
MAME cheat button?
« on: January 26, 2014, 11:47:59 pm »
Hey all,

Is there any way to bind a key to just bring up the cheat menu? I know you can bring up the menu and go to cheats, but I'd rather not expose all the control remapping options and video options and stuff, but allow for the cheats.

Alternatively, is there any way to make all of that read-only except the cheats? Or have it not save once you leave the game?

Basically I have a cheat button, but I don't want people to be able to jack up the controls and stuff.

DeLuSioNal29

  • Global Moderator
  • Trade Count: (+6)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 4779
  • Last login:May 11, 2025, 09:21:55 pm
  • Build the impossible -"There is no Spoon"
    • DeLuSioNaL's YouTube Videos
Re: MAME cheat button?
« Reply #1 on: January 27, 2014, 01:33:19 pm »
I don't think there's a hotkey specifically programmed to do this right out of the box with MAME.  However, there are other software solutions that you could look into to do what you want in the background while MAME is running.  Autohotkey is such a utility that can be set to execute keypresses.  For example:  You could write a script that when tab is pressed, Autohotkey will automatically send keyboard commands to go to the cheat menu with that single keypress.  (Down 3 or 4 times and the enter key to get to the cheat menu).  If you have Hyperspin as your frontend, you can integrate this by using Hyperlaunch which has Autohotkey support - not sure which Front end you are using).

Read more here:  http://www.autohotkey.com/docs/Hotkeys.htm

In the meantime, you could always back up your CFG folder so that if the controls get jacked up, you can just restore the folder from your back-up.

DeLuSioNaL29
Stop by my Youtube channel and leave a comment:

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19422
  • Last login:May 21, 2025, 04:54:33 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAME cheat button?
« Reply #2 on: January 27, 2014, 01:44:45 pm »
Simulated keypresses don't work on mame, remember? 

You'd have to use v-joy or similar joystick trickery. 

Probably your most realistic bet is to try to get the feature added to HBMAME or a similar build.

jelwell

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 460
  • Last login:December 24, 2014, 03:47:21 pm
  • I'm a llama!
Re: MAME cheat button?
« Reply #3 on: March 02, 2014, 01:04:16 am »
Make your config files not writeable.
I use an IceBox to do this.
http://www.gizmag.com/usb-windows-icebox-freezes-hard-disk/12880/

Then users can do whatever they want, but a reboot restores everything back the way it was.
Joseph Elwell.

SGT

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1146
  • Last login:December 05, 2024, 12:19:43 am
Re: MAME cheat button?
« Reply #4 on: March 02, 2014, 02:46:08 pm »
Simulated keypresses don't work on mame, remember? 

You'd have to use v-joy or similar joystick trickery. 

Probably your most realistic bet is to try to get the feature added to HBMAME or a similar build.

Am I correct in assuming simulated keypresses do work if Mame is compiled with Force_DirectInput enabled?

jelwell

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 460
  • Last login:December 24, 2014, 03:47:21 pm
  • I'm a llama!
Re: MAME cheat button?
« Reply #5 on: March 05, 2014, 09:30:08 pm »
I didn't address the single key cheat button in my original reply because the last time I setup my cabinet the version of MAME I was using supported pressing a single button and displaying ONLY the cheat portion of the menu with no way to get into the rest of the menu system. Not sure when this was removed.

I can see in my old default.cfg

Quote
         <port type="UI_CHEAT">
            <defseq type="standard">KEYCODE_HOME</defseq>
            <newseq type="standard">KEYCODE_W</newseq>
         </port>
I don't see an option to configure this in .149.
Joseph Elwell.

p1mrx

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 3
  • Last login:May 04, 2025, 04:14:03 pm
  • I want to build my own arcade controls!
Re: MAME cheat button?
« Reply #6 on: March 04, 2025, 12:32:07 am »
I got this working in Lua.  Note that this uses the cheat plugin, not the -cheat command line flag.

Code: [Select]
-- mame -autoboot_script cheat_button.lua
--
-- This script opens the "Plugin Options" > "Cheat" menu when a button is pressed.
-- You must enable "cheat" in plugin.ini, or the menu will be blank.

frame_sub = emu.add_machine_frame_notifier(function()
    local input = manager.machine.input
    local ui = manager.ui
    -- example buttons:
    local seq = input:seq_from_tokens("KEYCODE_F12 or JOYCODE_BUTTON1")
    if not ui.menu_active and input:seq_pressed(seq) then
        emu.show_menu("Cheat")
    end
end)
« Last Edit: March 04, 2025, 12:38:47 am by p1mrx »