cheat lua plugins

This forum is for making announcements about updated cheat files (for any emulator), updated web pages and of course about improvements to the MAME/MESS cheat engine.
crazyc
CheatFinder Private
Posts: 8
Joined: Sat Apr 30, 2016 4:49 pm

Re: cheat lua plugins

Postby crazyc » Tue Jun 20, 2017 3:20 pm

Based on some lists I could easily convert, here's the giant game genie code list, https://gist.github.com/cracyc/8d29ec0a ... 1ac5206d3a. There are probably some errors but they should mostly work. Just put it in your mame cheat dir and enable the lua cheat plugin.

User avatar
Pugsy
CheatFinder General
CheatFinder General
Posts: 3125
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Contact:

Re: cheat lua plugins

Postby Pugsy » Fri Jun 30, 2017 9:46 am

Just made some game genie codes for the NES game Elevator Action, but they all fail to load with "rom cheat compare value not found" . I know the compare value is good...

Code: Select all

nes/elevator,gg,SXOIYNGK,Bullet Invincibility 1/7
nes/elevator,gg,SZNSNOGK,Bullet Invincibility 2/7
nes/elevator,gg,SZVISXGK,Bullet Invincibility 3/7
nes/elevator,gg,SXNSNXGK,Bullet Invincibility 4/7
nes/elevator,gg,SXSSVKGK,Bullet Invincibility 5/7
nes/elevator,gg,SZSSXSGK,Bullet Invincibility 6/7
nes/elevator,gg,SXOTZEGK,Bullet Invincibility 7/7
nes/elevator,gg,AAKIUILA,Don't Fall down elevator shafts


which equate to these XML cheats (I've simplified the == expression to just use the part 1 expression)

Code: Select all

  <cheat desc="Invincibility">
    <script state="run">
      <action condition="(maincpu.rb@D797==4C)">
        maincpu.rb@D797=AD,
        maincpu.rb@D97F=AD,
        maincpu.rb@DA65=AD,
        maincpu.rb@DAFF=AD,
        maincpu.rb@DCDE=AD,
        maincpu.rb@DD5A=AD,
        maincpu.rb@E092=AD
      </action>
    </script>
    <script state="off">
      <action condition="(maincpu.rb@D797==AD)">
        maincpu.rb@D797=4C,
        maincpu.rb@D97F=4C,
        maincpu.rb@DA65=4C,
        maincpu.rb@DAFF=4C,
        maincpu.rb@DCDE=4C,
        maincpu.rb@DD5A=4C,
        maincpu.rb@E092=4C
      </action>
    </script>
  </cheat>

  <cheat desc="Don't Fall down elevator shafts">
    <script state="run">
      <action condition="(maincpu.rb@DD43==03)">maincpu.rb@DD43=00</action>
    </script>
    <script state="off">
      <action condition="(maincpu.rb@DD43==00)">maincpu.rb@DD43=03</action>
    </script>
  </cheat>


Some of the other GG codes for elevator action in the cheat.simple file also fail.
Pugsy

Servicing your cheating needs since 1985 ;-)

Grab the latest cheat collection:
MAME 0.187 XML cheat collection 7 JULY 2017) from http://www.mamecheat.co.uk or direct from:-
http://www.mediafire.com/file/0dvubha3b ... at0187.zip (ZIP Archive 1826 KB)

crazyc
CheatFinder Private
Posts: 8
Joined: Sat Apr 30, 2016 4:49 pm

Re: cheat lua plugins

Postby crazyc » Fri Jun 30, 2017 6:49 pm

Made a one bit error, fixed now. Also added the ability to link cheats by replacing the description with a ^.

TheCimmerian
CheatFinder Private
Posts: 2
Joined: Sat Jul 08, 2017 8:57 am

Re: cheat lua plugins

Postby TheCimmerian » Sat Jul 08, 2017 9:09 am

crazyc wrote:I've added support for cheat toggle keys. They can be set using the Set Hotkeys option from the plugin-cheat menu. The keys are saved in a json file in the cheat dir. The menu only allows setting a number plus a modifier for the hotkey but any combination can be added to the json file.


Hi there. Newbie here.

I am using MameUI 64 0.187 and I don't see where to set the keys in the cheat menu option (when you pres TAB while the game is running) and the plugin options menu is empty.
You can only press the "set" option as always in the cheat menu, but there is no option to assign a key like in the controls menu.

What am I missing?
Do you have to use the plugin options menu; and if so? Why is it empty for me?

Any help would be greatly appreciated.

User avatar
Pugsy
CheatFinder General
CheatFinder General
Posts: 3125
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Contact:

Re: cheat lua plugins

Postby Pugsy » Sat Jul 08, 2017 1:58 pm

Just looked at MAMEUI (I use standard MAME commandline here). I can spot the problem, if you run "mameui64.exe -cc" from the commandline it will create the plugin.ini file in the same directory but it only looks for it in the ini dir. You can create the ini file manually, just make a plugin.ini file in the ini folder (eg. C:\MAMEUI64\ini\plugin.ini ) and put this text in it:-

Code: Select all

#
# PLUGINS OPTIONS
#
cheat                     1
cheatfind                 1
console                   0
data                      1
dummy                     0
hiscore                   0
layout                    0
timer                     0
Pugsy

Servicing your cheating needs since 1985 ;-)

Grab the latest cheat collection:
MAME 0.187 XML cheat collection 7 JULY 2017) from http://www.mamecheat.co.uk or direct from:-
http://www.mediafire.com/file/0dvubha3b ... at0187.zip (ZIP Archive 1826 KB)

TheCimmerian
CheatFinder Private
Posts: 2
Joined: Sat Jul 08, 2017 8:57 am

Re: cheat lua plugins

Postby TheCimmerian » Sat Jul 08, 2017 7:23 pm

[quote="Pugsy"]Just looked at MAMEUI (I use standard MAME commandline here). I can spot the problem, if you run "mameui64.exe -cc" from the commandline it will create the plugin.ini file in the same directory but it only looks for it in the ini dir. You can create the ini file manually, just make a plugin.ini file in the ini folder (eg. C:\MAMEUI64\ini\plugin.ini ) and put this text in it:-

[code]#
# PLUGINS OPTIONS
#
cheat 1
cheatfind 1
console 0
data 1
dummy 0
hiscore 0
layout 0
timer 0[/code][/quote]

That did the trick.
Thank you very much!
I can't believe that after so many years using MAME, I can now set the hotkeys for the cheats... It's like a dream come true.
P.S. sorry for the double post, I'm not a spammer or anything, I just wasn't sure where tu post.

TheCimmerian
CheatFinder Private
Posts: 2
Joined: Sat Jul 08, 2017 8:57 am

Re: cheat lua plugins

Postby TheCimmerian » Sun Jul 09, 2017 11:09 pm

The new cheat plugin is great, but is missing the ability to set the hotkeys to the controller buttons or stick.
I hope that in the future MAME would let you assign any button, just like when you are setting the controller for the games.
This is specially needed in games like Killer Instinct where an automatic combo breaker could be asigned to R3 for example, because you need it in the moment, no time to change to the keyboard to perform the two button combination.

crazyc
CheatFinder Private
Posts: 8
Joined: Sat Apr 30, 2016 4:49 pm

Re: cheat lua plugins

Postby crazyc » Mon Jul 10, 2017 2:20 am

You can set it to a stick by editing the hotkey json file directly. JOYCODE_1_BUTTON1 is the first stick first button, I'll think about how to work that into the UI but it'll currently not be possible to set a key or button by pressing it like the input config.

crazyc
CheatFinder Private
Posts: 8
Joined: Sat Apr 30, 2016 4:49 pm

Re: cheat lua plugins

Postby crazyc » Wed Jul 12, 2017 4:04 am

Added to the ui joystick hotkey binding.

crazyc
CheatFinder Private
Posts: 8
Joined: Sat Apr 30, 2016 4:49 pm

Re: cheat lua plugins

Postby crazyc » Fri Jul 14, 2017 3:33 am

Now you can set hotkeys similarly to how the input menu works. It doesn't let you set multiple mappings for one cheat (which wouldn't make much sense IMO) [strike]and doesn't currently give feedback when polling except the game freezes for a second[/strike]. Added a popmessage when to press the hotkey to set.

TheCimmerian
CheatFinder Private
Posts: 2
Joined: Sat Jul 08, 2017 8:57 am

Re: cheat lua plugins

Postby TheCimmerian » Sat Jul 15, 2017 5:35 pm

[quote="crazyc"]Now you can set hotkeys similarly to how the input menu works. It doesn't let you set multiple mappings for one cheat (which wouldn't make much sense IMO) [strike]and doesn't currently give feedback when polling except the game freezes for a second[/strike]. Added a popmessage when to press the hotkey to set.[/quote]
WOW That was crazy fast. I thought It won't be available that soon.
Where can I download the new cheat.zip with this upgrade?

crazyc
CheatFinder Private
Posts: 8
Joined: Sat Apr 30, 2016 4:49 pm

Re: cheat lua plugins

Postby crazyc » Sat Jul 15, 2017 8:12 pm

There are changes to cheat/init.lua and luaengine.cpp so unless you can build mame yourself or get a recent build from someone you'll have to wait until the next release.

TheCimmerian
CheatFinder Private
Posts: 2
Joined: Sat Jul 08, 2017 8:57 am

Re: cheat lua plugins

Postby TheCimmerian » Sat Jul 15, 2017 9:23 pm

[quote="crazyc"]There are changes to cheat/init.lua and luaengine.cpp so unless you can build mame yourself or get a recent build from someone you'll have to wait until the next release.[/quote]
Ok gotcha.
Thanks.

crazyc
CheatFinder Private
Posts: 8
Joined: Sat Apr 30, 2016 4:49 pm

Re: cheat lua plugins

Postby crazyc » Mon Jul 24, 2017 4:06 pm

Added very untested break/watchpoint support (in head right now but won't be part of .188 but .189 instead). If anyone actually uses it, be sure to let me know about problems.

User avatar
Pugsy
CheatFinder General
CheatFinder General
Posts: 3125
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Contact:

Re: cheat lua plugins

Postby Pugsy » Sun Jul 30, 2017 5:09 pm

crazyc wrote:Added very untested break/watchpoint support (in head right now but won't be part of .188 but .189 instead). If anyone actually uses it, be sure to let me know about problems.



What sort of wp/bp support? Currently the cheat engine is based on the fact that it pokes every frame, if there was a way of poking RAM and diverting the PC address on an instruction basis it would certainly make various cheats a lot easier to implement - definitely a nice capability to have...

Eg instead of changing

1234 BEQ 1280
to
1234 BRA 1280

you go do something like
bp 1234,1,{pc=1280;g}

or
wp deadbeef,1,w,(A==90||A=00)&&pc=1234,{pc=1280;g}


Have you got any examples...
Pugsy

Servicing your cheating needs since 1985 ;-)

Grab the latest cheat collection:
MAME 0.187 XML cheat collection 7 JULY 2017) from http://www.mamecheat.co.uk or direct from:-
http://www.mediafire.com/file/0dvubha3b ... at0187.zip (ZIP Archive 1826 KB)

crazyc
CheatFinder Private
Posts: 8
Joined: Sat Apr 30, 2016 4:49 pm

Re: cheat lua plugins

Postby crazyc » Sun Jul 30, 2017 7:12 pm

You want to be able to access registers too? That's doable, I'll get to it when I have a chance. Edit: added as cpu.regs[reg].value

Anyway, bp 1234,1,{pc=1280;g} would be like

cpu:bpset(0x1234, function() --[[do something here]] end)

and wp deadbeef,1,w,(A==90||A=00)&&pc=1234,{pc=1280;g} would be like

cpu:wpset(cpu_program_space, "w", 0xdeadbeef, 1, function() --[[do something here]] end)

The conditional and action would be part of the function parameter.


Return to “Cheat Related Announcements”

Who is online

Users browsing this forum: No registered users and 2 guests