a little help

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
etabeta78
Posts: 32
Joined: Tue Dec 05, 2006 9:46 pm
Location: Trondheim, Norway

a little help

Post by etabeta78 »

can anyone point me to a doc explaining the way write-if-match cheats work in MAME (if they do)?
alternatively, is there anyone willing to spend 5 min to write here the explaination?

I tried with the search option but with no luck...
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:

Post by Pugsy »

It's quite straightforward, basically it PEEKs a location and if what it peeks matches a value then it pokes a new value in it's place.

Code: Select all

:ufosensb:00081000:C031:00000041:00000011:Start on Stage 4
In the above example it pokes C031 with 0x41 ONLY when C031 contains 0x11

pseudo code:

while (game_running && cheat_active)
{
if (peek c031=0x11)
{
poke c031,0x41;
}
else
{
//do nothing
}
}
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)
Post Reply