cheat lua plugins
- Pugsy
- Posts: 3677
- Joined: Fri Aug 17, 2001 12:59 am
- Location: North Wales, UK.
- Has thanked: 1 time
- Been thanked: 18 times
- Contact:
cheat lua plugins
Just a quickie...
If you compile your own MAME on a regular basis you might have noticed there's now an alternative way of enabling and finding cheats thanks to crazyc...using a lua replacement for the cheat menus and a new cheat finder tool which is similar to the old cheat finder tool. Thankfully the cheat xml format is unaffected
To try it out, compile the latest MAME from git and make sure you set plugin.ini file:-
cheat 1
cheatfind 1
Then just skip the existing CHEAT option and go to the PLUGINS option on the menu to see the new menus, you should notice few differences when compared to the old menus for enabling cheats but for finding cheats you can now do it without having to use the debugger. This is still a WIP so if you spot any issues/suggestions please post them in this thread....
NOTE: plugin.ini should normally exist in the ini folder if you haven't changed the default address with the mame.ini 'inipath' variable.
If you compile your own MAME on a regular basis you might have noticed there's now an alternative way of enabling and finding cheats thanks to crazyc...using a lua replacement for the cheat menus and a new cheat finder tool which is similar to the old cheat finder tool. Thankfully the cheat xml format is unaffected
To try it out, compile the latest MAME from git and make sure you set plugin.ini file:-
cheat 1
cheatfind 1
Then just skip the existing CHEAT option and go to the PLUGINS option on the menu to see the new menus, you should notice few differences when compared to the old menus for enabling cheats but for finding cheats you can now do it without having to use the debugger. This is still a WIP so if you spot any issues/suggestions please post them in this thread....
NOTE: plugin.ini should normally exist in the ini folder if you haven't changed the default address with the mame.ini 'inipath' variable.
Pugsy
Servicing your cheating needs since 1985
Grab the latest cheat collection:
MAME 0.264 XML cheat collection (3 APRIL 2024) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/SxsQUJoT#jBdz6GLm_ ... QzFGSMms2c (ZIP Archive 3.8 MB)
Servicing your cheating needs since 1985
Grab the latest cheat collection:
MAME 0.264 XML cheat collection (3 APRIL 2024) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/SxsQUJoT#jBdz6GLm_ ... QzFGSMms2c (ZIP Archive 3.8 MB)
-
- Posts: 41
- Joined: Fri Dec 28, 2001 1:00 am
Re: cheat lua plugins
nice plugin!
but I need a manual... I can't understand it at all. What's bcd? How to compare?
but I need a manual... I can't understand it at all. What's bcd? How to compare?
Re: cheat lua plugins
hi!
i can't seem to get this working. i'm using mame v0.173. i admit i'm a bit of a newbie here - i don't even know what a "cheat finder helper library" is... google brought me here when i looked for documentation.
does the cheat option in mame.ini still need to be set? does the cheat.7z still need to be present? i've tried with & without these and it doesn't work.
setting "cheat plugin" and "cheat finder helper library" to "on" in the plugins menu in the mame ui works, but after exiting mame and reloading, they are reset back to "off" (looking at plugin.ini, i see all 0 zeroes).
in a game (mspacman), there is a "plugin options", but selecting it gives an empty list, with only the "return to previous menu" option. the cheat menu (if cheat in mame.ini is on) still works as expected.
i've also noticed changing the pluginspath in mame.ini breaks things (ie, [LUA ERROR] ...boot.lua:7: module 'json' not found:, even though the files are in the directory i'm pointing to). (another frustrating aspect of mame is trying to set it up to run properly from any directory in linux, but that's another topic.)
please let me know what i'm missing
thanks,
ryan
i can't seem to get this working. i'm using mame v0.173. i admit i'm a bit of a newbie here - i don't even know what a "cheat finder helper library" is... google brought me here when i looked for documentation.
does the cheat option in mame.ini still need to be set? does the cheat.7z still need to be present? i've tried with & without these and it doesn't work.
setting "cheat plugin" and "cheat finder helper library" to "on" in the plugins menu in the mame ui works, but after exiting mame and reloading, they are reset back to "off" (looking at plugin.ini, i see all 0 zeroes).
in a game (mspacman), there is a "plugin options", but selecting it gives an empty list, with only the "return to previous menu" option. the cheat menu (if cheat in mame.ini is on) still works as expected.
i've also noticed changing the pluginspath in mame.ini breaks things (ie, [LUA ERROR] ...boot.lua:7: module 'json' not found:, even though the files are in the directory i'm pointing to). (another frustrating aspect of mame is trying to set it up to run properly from any directory in linux, but that's another topic.)
please let me know what i'm missing
thanks,
ryan
Re: cheat lua plugins
When more than one cheatpass are used (cheatpath cheat;cheat_wayder etc.),
cheat data isn't displayed by the cheat menu.
(use 4/29 ver.(git))
error log(run):
init.lua:480: attempt to index a nil value (local 'file')
error log(use cheat menu):
init.lua:309: attempt to index a nil value (field '?')
cheat data isn't displayed by the cheat menu.
(use 4/29 ver.(git))
error log(run):
init.lua:480: attempt to index a nil value (local 'file')
error log(use cheat menu):
init.lua:309: attempt to index a nil value (field '?')
Re: cheat lua plugins
Fixed this, you don't need to recompile you only have to get the plugin/cheat/init.lua file.wayder wrote:error log(run):
init.lua:480: attempt to index a nil value (local 'file')
error log(use cheat menu):
init.lua:309: attempt to index a nil value (field '?')
This is pretty new so the documentation is a W(not quite yet)IP.rsarson wrote:google brought me here when i looked for documentation.
No except you need the plugin enabled in the ini or the ui and yes you need the cheat.7z.rsarson wrote:does the cheat option in mame.ini still need to be set? does the cheat.7z still need to be present?
There'll be nothing in plugin options if there is no plugin that has a menu enabled. You can also use "-plugin cheat" on the command line to enable it.rsarson wrote:in a game (mspacman), there is a "plugin options", but selecting it gives an empty list, with only the "return to previous menu" option. the cheat menu (if cheat in mame.ini is on) still works as expected.
- Pugsy
- Posts: 3677
- Joined: Fri Aug 17, 2001 12:59 am
- Location: North Wales, UK.
- Has thanked: 1 time
- Been thanked: 18 times
- Contact:
Re: cheat lua plugins
Thanks, for those and the earlier quick fixes. Sorry I'd not responded to the last email (all sounds ok to me)...RL stuff so only just done a 0.173 build.crazyc wrote:Fixed this, you don't need to recompile you only have to get the plugin/cheat/init.lua file.
I know this was working before, but wayder is correct its broken now.wayder wrote:When more than one cheatpass are used (cheatpath cheat;cheat_wayder etc.),
cheat data isn't displayed by the cheat menu.
with
cheatpath cheat;cheat_wayder
if you run mame 19xx the plugin will display no cheats.
Pugsy
Servicing your cheating needs since 1985
Grab the latest cheat collection:
MAME 0.264 XML cheat collection (3 APRIL 2024) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/SxsQUJoT#jBdz6GLm_ ... QzFGSMms2c (ZIP Archive 3.8 MB)
Servicing your cheating needs since 1985
Grab the latest cheat collection:
MAME 0.264 XML cheat collection (3 APRIL 2024) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/SxsQUJoT#jBdz6GLm_ ... QzFGSMms2c (ZIP Archive 3.8 MB)
Re: cheat lua plugins
crazyc,
thanks for the reply! with a little trial and error, i was able to get it working :)
ryan
thanks for the reply! with a little trial and error, i was able to get it working :)
ryan
- Pugsy
- Posts: 3677
- Joined: Fri Aug 17, 2001 12:59 am
- Location: North Wales, UK.
- Has thanked: 1 time
- Been thanked: 18 times
- Contact:
Re: cheat lua plugins
It's not actually that difficult to use, I've knocked up a quick simple example...but remember that the cheat plugin is still in development so this is just an example using the current cheat finder script and may well change:-invincibility wrote:nice plugin!
but I need a manual... I can't understand it at all. What's bcd? How to compare?
Use the game "targ"
Start the game and pause it
Go to the the Cheat Finder plugin:
Select "Start new search"
unpause the game and lose a life, then pause the game again
Select "Save current #2"
Select "Left operand 2"
Select "Operator lt"
Select "Right operand 1"
Select "Value 1"
Hit Return on "Compare"
- Basically you are saying search for memory addresses where the current memory snapshot (2) is less than the first memory snapshot (1) by 1 (value 1)
on the Bottom of the screen you will notice "Match Block 1", if you press left and right on that you will notice that it cycles through some possibilities under each "Block"
By default it will have "Test" next to each one, just press Return on each and it will add that cheat to the plugins cheat selection menu
You can then just enable that cheat to see if you have found the lives location by enabling the cheats one by one and losing a life and seeing if the number of lives decreases.
BCD is Binary Coded Decimal, simple example from a cheating perspective:- if you have a TIMER that starts at "99" this can be represented by 0x63 (99 decimal, 63 hex) or it can be represented in BCD as 0x99 (99 hex, 153 decimal). BCD is actually really common for things like time and scores.
Pugsy
Servicing your cheating needs since 1985
Grab the latest cheat collection:
MAME 0.264 XML cheat collection (3 APRIL 2024) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/SxsQUJoT#jBdz6GLm_ ... QzFGSMms2c (ZIP Archive 3.8 MB)
Servicing your cheating needs since 1985
Grab the latest cheat collection:
MAME 0.264 XML cheat collection (3 APRIL 2024) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/SxsQUJoT#jBdz6GLm_ ... QzFGSMms2c (ZIP Archive 3.8 MB)
Re: cheat lua plugins
Cool, should only take a few minutes to do those changes.Pugsy wrote: Thanks, for those and the earlier quick fixes. Sorry I'd not responded to the last email (all sounds ok to me)...RL stuff so only just done a 0.173 build.
It works for me now. Did you get the latest version? BTW, I've got a cheat for a board (Dungeons and Dragons Computer Labyrinth Game) game that doesn't fit in any of your forums and only works with the development tree. Should I post it here and if so should I wait until next release?Pugsy wrote: I know this was working before, but wayder is correct its broken now.
with
cheatpath cheat;cheat_wayder
if you run mame 19xx the plugin will display no cheats.
- Pugsy
- Posts: 3677
- Joined: Fri Aug 17, 2001 12:59 am
- Location: North Wales, UK.
- Has thanked: 1 time
- Been thanked: 18 times
- Contact:
Re: cheat lua plugins
Thanks, looking good. Being able to search by value will save a few iterations of cheat searching.crazyc wrote:Cool, should only take a few minutes to do those changes.
Couple of suggestions
1. If possible can you make it so that when you do a SAVE CURRENT it will update the Left Operand so if Left Operand was previously = Current it will stay as "Current"
2. In a similar manner if the Right Operand was previously "Current - 1" when you hit SAVE CURRENT can you make it so that it autopopulates with "Current - 1"
3. Can COMPARE and SAVE CURRENT be moved in the same text block as the comparison operations (will save some arrow presses)
4. Is it possible to do a pop-up when COMPARE is executed that will have text similar to "1789 Possibilities" so that you instantly know if you are ready to test some cheat possibilities.
5. Is it possible to change "Blocks match" selection at the bottom to just automatically show all possibilities or a larger number of possibilities?
Yes and thanks, it works now.crazyc wrote: It works for me now. Did you get the latest version?
Ah, I see the problem it's neither an arcade game or a softwarelist game......I've changed the description for the softwarelist forum to cover any non-arcade game. It doesn't matter if the game is in MAME yet or will be added later...the earlier the better:)crazyc wrote:BTW, I've got a cheat for a board (Dungeons and Dragons Computer Labyrinth Game) game that doesn't fit in any of your forums and only works with the development tree. Should I post it here and if so should I wait until next release?
Pugsy
Servicing your cheating needs since 1985
Grab the latest cheat collection:
MAME 0.264 XML cheat collection (3 APRIL 2024) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/SxsQUJoT#jBdz6GLm_ ... QzFGSMms2c (ZIP Archive 3.8 MB)
Servicing your cheating needs since 1985
Grab the latest cheat collection:
MAME 0.264 XML cheat collection (3 APRIL 2024) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/SxsQUJoT#jBdz6GLm_ ... QzFGSMms2c (ZIP Archive 3.8 MB)
Re: cheat lua plugins
when I run mame in command line, after leaving the game it tells me this message:
X:\Mame/plugins/cheat/init.lua:479: attempt to index a nil value (local 'file')
if
plugin.ini
#
# PLUGINS OPTIONS
#
cheat 1
is actived (and also actived in mame.ini).
Does he need to disable the option in one of the two files?
X:\Mame/plugins/cheat/init.lua:479: attempt to index a nil value (local 'file')
if
plugin.ini
#
# PLUGINS OPTIONS
#
cheat 1
is actived (and also actived in mame.ini).
Does he need to disable the option in one of the two files?
- Pugsy
- Posts: 3677
- Joined: Fri Aug 17, 2001 12:59 am
- Location: North Wales, UK.
- Has thanked: 1 time
- Been thanked: 18 times
- Contact:
Re: cheat lua plugins
I can't replicate that problem - I have no problems enabling cheats in the either cheat menu system. Bear in mind this is WIP, are you using the latest version from git?pmc wrote:Does he need to disable the option in one of the two files?
Pugsy
Servicing your cheating needs since 1985
Grab the latest cheat collection:
MAME 0.264 XML cheat collection (3 APRIL 2024) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/SxsQUJoT#jBdz6GLm_ ... QzFGSMms2c (ZIP Archive 3.8 MB)
Servicing your cheating needs since 1985
Grab the latest cheat collection:
MAME 0.264 XML cheat collection (3 APRIL 2024) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/SxsQUJoT#jBdz6GLm_ ... QzFGSMms2c (ZIP Archive 3.8 MB)
Re: cheat lua plugins
crazyc,
> Fixed this, you don't need to recompile you only have to get the
> plugin/cheat/init.lua file.
I'm thankful for plugin fixed.
All data was displayed right.
> Fixed this, you don't need to recompile you only have to get the
> plugin/cheat/init.lua file.
I'm thankful for plugin fixed.
All data was displayed right.
Re: cheat lua plugins
They are, aren't they? If not I must be missing what you mean.Pugsy wrote:1. If possible can you make it so that when you do a SAVE CURRENT it will update the Left Operand so if Left Operand was previously = Current it will stay as "Current"
2. In a similar manner if the Right Operand was previously "Current - 1" when you hit SAVE CURRENT can you make it so that it autopopulates with "Current - 1"
3. Can COMPARE and SAVE CURRENT be moved in the same text block as the comparison operations (will save some arrow presses)
It shows 50 currently. I'm not sure what the reasonable limit is and I can't currently do submenus so maybe a "Show next" option at the bottom?Pugsy wrote:4. Is it possible to do a pop-up when COMPARE is executed that will have text similar to "1789 Possibilities" so that you instantly know if you are ready to test some cheat possibilities.
5. Is it possible to change "Blocks match" selection at the bottom to just automatically show all possibilities or a larger number of possibilities?
Like Pugsy says, just replace the plugin/cheat/init.lua file with https://github.com/mamedev/mame/blob/ma ... t/init.luapmc wrote:when I run mame in command line, after leaving the game it tells me this message:
X:\Mame/plugins/cheat/init.lua:479: attempt to index a nil value (local 'file')
- Pugsy
- Posts: 3677
- Joined: Fri Aug 17, 2001 12:59 am
- Location: North Wales, UK.
- Has thanked: 1 time
- Been thanked: 18 times
- Contact:
Re: cheat lua plugins
This is what I mean (and currently see):-crazyc wrote:They are, aren't they? If not I must be missing what you mean.Pugsy wrote:1. If possible can you make it so that when you do a SAVE CURRENT it will update the Left Operand so if Left Operand was previously = Current it will stay as "Current"
2. In a similar manner if the Right Operand was previously "Current - 1" when you hit SAVE CURRENT can you make it so that it autopopulates with "Current - 1"
3. Can COMPARE and SAVE CURRENT be moved in the same text block as the comparison operations (will save some arrow presses)
I think a Show next option would be better than having "Blocks match" as I've done some searches and there was nothing showing under Blocks match 1 but there where under Block match 2, which may confuse people enough just to give up. I think showing 100 results per page would more than suffice. 50 would probably be fine at a pinch.crazyc wrote:It shows 50 currently. I'm not sure what the reasonable limit is and I can't currently do submenus so maybe a "Show next" option at the bottom?Pugsy wrote:4. Is it possible to do a pop-up when COMPARE is executed that will have text similar to "1789 Possibilities" so that you instantly know if you are ready to test some cheat possibilities.
5. Is it possible to change "Blocks match" selection at the bottom to just automatically show all possibilities or a larger number of possibilities?
Pugsy
Servicing your cheating needs since 1985
Grab the latest cheat collection:
MAME 0.264 XML cheat collection (3 APRIL 2024) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/SxsQUJoT#jBdz6GLm_ ... QzFGSMms2c (ZIP Archive 3.8 MB)
Servicing your cheating needs since 1985
Grab the latest cheat collection:
MAME 0.264 XML cheat collection (3 APRIL 2024) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/SxsQUJoT#jBdz6GLm_ ... QzFGSMms2c (ZIP Archive 3.8 MB)
Re: cheat lua plugins
Okay, now it looks like that.
Oh, you want to show the matches from all the regions right? Now it defaults to "All" which does that. A specific region can still be chosen too.Pugsy wrote:I think a Show next option would be better than having "Blocks match" as I've done some searches and there was nothing showing under Blocks match 1 but there where under Block match 2, which may confuse people enough just to give up. I think showing 100 results per page would more than suffice. 50 would probably be fine at a pinch.
- Pugsy
- Posts: 3677
- Joined: Fri Aug 17, 2001 12:59 am
- Location: North Wales, UK.
- Has thanked: 1 time
- Been thanked: 18 times
- Contact:
Re: cheat lua plugins
Thanks, looking good and yes show matches from all regions is ideal. A "show next" way of paging through all the results could be handy.
EDIT: Just noticed something has gone slightly skew whiff with LT/GT. If you do a search for the time address in mslug (106E93) by
doing Current LT Previous by 1 every time it reduces it won't find the address
It will find the address as the time decreases by one if you do a Current GT Previous by 1 which is the wrong way.
EDIT: Just noticed something has gone slightly skew whiff with LT/GT. If you do a search for the time address in mslug (106E93) by
doing Current LT Previous by 1 every time it reduces it won't find the address
It will find the address as the time decreases by one if you do a Current GT Previous by 1 which is the wrong way.
Pugsy
Servicing your cheating needs since 1985
Grab the latest cheat collection:
MAME 0.264 XML cheat collection (3 APRIL 2024) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/SxsQUJoT#jBdz6GLm_ ... QzFGSMms2c (ZIP Archive 3.8 MB)
Servicing your cheating needs since 1985
Grab the latest cheat collection:
MAME 0.264 XML cheat collection (3 APRIL 2024) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/SxsQUJoT#jBdz6GLm_ ... QzFGSMms2c (ZIP Archive 3.8 MB)
Re: cheat lua plugins
Okay, fixed the first, did a large refactor then added the second. The refactor will make further changes much easier, let me know if I broke anything in the process.
-
- Posts: 41
- Joined: Fri Dec 28, 2001 1:00 am
Re: cheat lua plugins
Very thanks and report a bug, I use mame 0.174 with cheat lua plugins, try to search some cheats with game kov2, but when I press the test botton, the address don't show in the cheat column. I think it's a bug?
And a little request, may the cheat lua plugins add an option to search the d00000-d0ffff address range of game kov2? This game use the address range to store some useful infomations, e.g. hp and invincibility of players and enemies, etc.
And a little request, may the cheat lua plugins add an option to search the d00000-d0ffff address range of game kov2? This game use the address range to store some useful infomations, e.g. hp and invincibility of players and enemies, etc.
Re: cheat lua plugins
It won't show in the builtin cheat engine only in the cheat plugin (and it does work, just tested it).
I added the ability to search shared ram regions of which that range is one (https://github.com/mamedev/mame/blob/59 ... 2.cpp#L110). It'll be called ":arm7_shareram". Note you can't currently use it directly with the cheat engine as the addresses are different, you'd have to add 0xd0000 if applied on the 68000 or 0x48000000 with the arm.
I added the ability to search shared ram regions of which that range is one (https://github.com/mamedev/mame/blob/59 ... 2.cpp#L110). It'll be called ":arm7_shareram". Note you can't currently use it directly with the cheat engine as the addresses are different, you'd have to add 0xd0000 if applied on the 68000 or 0x48000000 with the arm.