When a RAM cheat isn't enough?

If you are having problems finding or using cheats for an Emulator (particularly MAME/MESS) or have found a trick that you wish to share this is the place to do it. But please read the Cheat FAQ first.
Post Reply
dranore
Posts: 4
Joined: Sat Dec 25, 2010 3:56 am

When a RAM cheat isn't enough?

Post by dranore »

Can someone help me with process?

So I came up with what I thought would be an interesting Windjammers cheat: A play to target points, where I just disable the timer.

Code: Select all

  <cheat desc="Point Match">
    <comment>Select the score that you would like to play to. The match will end when a player reaches the total.</comment>
    <parameter min="5" max="95" step="5"/>
    <script state="run">
      <action>maincpu.pb@10008D=99</action>
      <action condition="maincpu.pb@100873>=tobcd(param)">maincpu.pb@10008D=00</action><!-- P1 Hit Score Set the timer to 00 -->
      <action condition="maincpu.pb@1008F3>=tobcd(param)">maincpu.pb@10008D=00</action><!-- P2 Hit Score Set the timer to 00 -->
    </script>
  </cheat>
Locking the timer is already done for me, but oh wait, I forgot that the game uses a 30 seconds limit OR 12 points. Which means I need to alter the number that it's comparing against!

I assume this is going to be a ROM hack... and while I've seen Pugsy's explanation of how to start searching for RAM hacks... how do you go about looking for that? I want to be able to alter both values truthfully. And I can think of a bunch of possibilities from playing with them.

Some pointers would be appreciated!
User avatar
Pugsy
Posts: 3675
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Has thanked: 1 time
Been thanked: 15 times
Contact:

Re: When a RAM cheat isn't enough?

Post by Pugsy »

In the debugger you will need to watchpoint the address {wp 1008F3,1,w} and then look at the code from there.

I had a quick look and the compare value seems to be held in 1000FF, so something like this should work (not tested though - lack of time):-

Code: Select all

  <cheat desc="Select Points to Win Match"> <comment>Select the score that you would like to play to. The match will end when a player reaches the total or the time is up - so use in conjunction with Infinite Time for the Best Effect.</comment>
    <parameter min="6" max="99" step="3"/>
    <script state="run">
      <action>maincpu.pb@1000FF=tobcd(param)</action>
    </script>
  </cheat>
Pugsy

Servicing your cheating needs since 1985 8)

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)
dranore
Posts: 4
Joined: Sat Dec 25, 2010 3:56 am

Re: When a RAM cheat isn't enough?

Post by dranore »

Thanks for that, good sir. You were right on the money. I've posted up 4 new cheats for Windjammers (including the one you solved above with some edits for phrasing consistency) in the cheats forums.

There is one last thing I'm having trouble with, if you don't mind taking a look. I'd like to change the number of rounds you need to win to win the set. I was sniffing using the second player's values.

Code: Select all

maincpu.pb@100097
maincpu.pb@10fd88
maincpu.pb@1008F2
The first address seems to be what is ACTUALLY used to see if enough sets have been won. I can't seem to figure out WHEN the comparison is happening and accordingly where the value it's testing against is. I have a notion based on a line where it's matching against $2, but I'm not sure?

The other two seem to be for display purposes only, though none appear to be dependent on each other.

As side note on another cheat I was playing with, is there a way to detect when a user has pressed a button? Just curious how that works. I assumed it would be something to do with the latch memory, but I didn't see any activity there at all.
User avatar
NotAGoodName
Posts: 331
Joined: Wed Feb 18, 2009 7:09 am
Location: MO, USA
Contact:

Re: When a RAM cheat isn't enough?

Post by NotAGoodName »

dranore wrote:As side note on another cheat I was playing with, is there a way to detect when a user has pressed a button? Just curious how that works. I assumed it would be something to do with the latch memory, but I didn't see any activity there at all.
Most games save button activity somewhere in RAM as a couple of bytes or so per player. It can be hard to find exactly, so just hold a direction or button and pause emulation to search. Each direction and button will be represented by a bit.
Aww yeah. AMD A10-7850K givin' MAME and MESS systems what for.
dranore
Posts: 4
Joined: Sat Dec 25, 2010 3:56 am

Re: When a RAM cheat isn't enough?

Post by dranore »

I found a couple bytes that I think might be it, but I was trying to fake a button press. The problem is that the positions that I found are being forced to another value constantly since it's key presses. Having trouble backtracing to where it's actually being set. Tricky business.

One of the things I was working on was detecting whether or not the user had selected vs. CPU or 2 player... problem is that there is a screen transition when the selection is made... so there are well over a hundred values that change when the selection is made... any tips on isolating changes made with a screen transition?
User avatar
NotAGoodName
Posts: 331
Joined: Wed Feb 18, 2009 7:09 am
Location: MO, USA
Contact:

Re: When a RAM cheat isn't enough?

Post by NotAGoodName »

If I think it's something I can determine in one byte and it's like that, I just play the game both ways over a long period until I can start taking guesses. Ton of equal searches, a not equal when I change it, and then more equals.
Aww yeah. AMD A10-7850K givin' MAME and MESS systems what for.
User avatar
Pugsy
Posts: 3675
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Has thanked: 1 time
Been thanked: 15 times
Contact:

Re: When a RAM cheat isn't enough?

Post by Pugsy »

For the button press thing, for this game you need to do something like this

ci
cn eq,0
play game hold in button 1 and whilst holding in press ' to open the debugger
cn ne
play game hold in button 2 and whilst holding in press ' to open the debugger
cn ne
play game hold in button 3 and whilst holding in press ' to open the debugger
cn ne
play game hold in button 4 and whilst holding in press ' to open the debugger
cn ne
play game release all buttons and press ' to open the debugger
cn ne
cnf eq


10085C = PL1 address & 1008DC = PL2 address
0x0101 = UP
0x0202 = DOWN
0x0404 = LEFT
0x0808 = RIGHT
0x1010 = B1
0x2020 = B2
0x4040 = B3
0x8080 = B4

Bear in mid these are the addresses used during play...the addresses are likely to be different when not actually playing
Pugsy

Servicing your cheating needs since 1985 8)

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)
Post Reply