mamedev / mame

MAME
https://www.mamedev.org/
Other
8.06k stars 2.01k forks source link

Lua Cheatfinder plugin with UNSP CPU #4560

Open ghost opened 5 years ago

ghost commented 5 years ago

The cheatfinder plugin does not appear to work with the UNSP CPU at least.

I was trying to find where in memory the 'next piece' data is stored in "jak_disf stenfcha" Riches of Agrabah game, using the 'eq' and 'ne' logic, but after the initial narrowing of the search I end up with more results on subsequent calls.

The only thing noteworthy about this is that the CPU has 16-bit bytes, not 8-bit, so maybe that is causing issues? it also seems to cause an issue with the debugger cheat finder reporting reporting the incorrect address.

cracyc commented 5 years ago

Pushed a change to hopefully deal with this.

cracyc commented 5 years ago

BTW, pugsy has made significant revisions to the cheat finder and he's looking to merge some/all of it. Since you've been using it your feedback would be useful IMO. See here, http://www.mamecheat.co.uk/forums/viewtopic.php?f=10&t=12237&start=60#p24967

cuavas commented 5 years ago

Well the proper thing for Pugsy to do is make a PR if he wants something merged. Then it can be reviewed/discussed conveniently.

cracyc commented 5 years ago

Right, for the moment though I'm just looking to get Haze's overall opinion on the functionality of his changes.

ghost commented 5 years ago

I'll see how the functionality has changed.

The cheatfinder can be useful for development, forcing specific case to happen, or in the case of what I'm doing here with the unsp, trying to track down the code for piece generation in the game, because I'm pretty sure there's a CPU bug related to it.

ghost commented 5 years ago

I'm not convinced, it feels a bit clunky, requiring 2 steps each time, I guess it comes down to work patterns, but I found myself making more mistakes this way.

Also some of the important functionality of the old engine, like being able to hit 'w' to put an onscreen watch, or 's' to actually save out the cheat to an xml file, or even the ability to edit the test cheat values, still seems to be missing and requires things to be written down, entered into a file, and edited before reloading.

there are definitely still ways in which the cheat finder can be improved, even if it is does remain one of the most useful debugging features MAME has.

ghost commented 5 years ago

I'm using Pugsy's file (so need to check baseline), but there does seem to be a bug when testing the cheats for the UNSP after finding them and adding them to the cheat menu with 'test' it writes the value to the wrong half of the byte, even after finding it in the correct part.

cracyc commented 5 years ago

Also some of the important functionality of the old engine, like being able to hit 'w' to put an onscreen watch, or 's' to actually save out the cheat to an xml file, or even the ability to edit the test cheat values, still seems to be missing and requires things to be written down, entered into a file, and edited before reloading.

Most keypresses don't get passed to the menu so those would take some work to the ui core (unless you mean watch and save are missing entirely because both are there if you press left and right on "Test").

ghost commented 5 years ago

I wasn't aware of them being there as an alternative to 'test'

I guess that's part of the problem, some of the functionality of this cheat finder is rather hidden, I knew the old shortcuts, which no longer work, but it wasn't obvious that the functionality you describe exists, there's no hint that you can even press left or right on those selections from what I remember