Can't read an address with cheat engine in mk

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
User avatar
megaman_exe
Posts: 39
Joined: Mon Nov 05, 2007 2:12 am

Can't read an address with cheat engine in mk

Post by megaman_exe »

Hi, in the previous cheat engine I found that in address 28021d (or somewhat close) there was the credits inserted in the machine. Probably they are stored in nvram since the machine starts with the previous credits not spent.

The thing is that I cannot write a cheat to read that address with either maincpu.pb or maincpu.rb. In maincpu.pb it just reads a different value which is always 0 and with rb it reads 0xff. It's like the value being read comes from a different place.

If you examine the memory viewer of the mame debugger and choose the memory/:maincpu/0/00200000-0028ffff (from the dropdown you must scroll up to the last region and then up a little) and write down the 8021d in the offset textbox you can see the value changing when you insert credits (I recall that the address was not exactly 8021d but something like 8021b or 8021c. Well the thing is somewhat close).

Then what I did is to write an output cheat to print the suspicious addresses values

Code: Select all

  <cheat desc="Watch coin address">
    <script state="run">
		<output format="%02X %02X %02X">
			<argument>maincpu.rb@28021b</argument>
			<argument>maincpu.rb@28021c</argument>
			<argument>maincpu.rb@28021d</argument>
		</output>
    </script>
  </cheat>
I've tried with maincpu.rb, maincpu.pb but to no avail.

Anyone knows how can I write the code to show the current credits inserted based on this information?. The credits inserted seem to be stored in nvram. Anyone have fiddled with cheats reading values from nvram or their respective RAM mapping?

I hope anyone can give me a shed of light.
Help is greatly appreciated!

Greets!
User avatar
Pugsy
Posts: 3638
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Has thanked: 1 time
Been thanked: 12 times
Contact:

Re: Can't read an address with cheat engine in mk

Post by Pugsy »

The address you are interested in is:-

maincpu.pb@14010e0

or to put it another way

maincpu.pb@(28021C*8)
Pugsy

Servicing your cheating needs since 1985 8)

Grab the latest cheat collection:
MAME 0.259 XML cheat collection (6 OCTOBER 2023) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/q4dHGZ6K#i-EUiqIjH ... KMz7hnbTfw (ZIP Archive 3.76MB)
User avatar
megaman_exe
Posts: 39
Joined: Mon Nov 05, 2007 2:12 am

Re: Can't read an address with cheat engine in mk

Post by megaman_exe »

Thanks a lot. I'll try as soon as I get home.

Greets.

EDIT: It worked, thanks a lot my friend!
Post Reply