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.
NotAGoodName
Posts: 331 Joined: Wed Feb 18, 2009 7:09 am
Location: MO, USA
Contact:
Post
by NotAGoodName » Wed May 13, 2009 5:07 am
Ok. I'm almost done with Shining Force 2. All 1MB+ of it. I've run into a problem, however. I want to make a cheat where you can toggle a bit value using a change value cheat. This cheat surprisingly half way works, and it works on the part I didn't think would work. The problem is that it isn't detecting the set value properly to perform the disable half.
Example:
Code: Select all
<cheat desc="Force Status Toggle (Group 1)">
<parameter>
<item value="0x80">Bowie (avoid)</item>
<item value="0x40">Sarah</item>
<item value="0x20">Chester</item>
<item value="0x10">Jaha</item>
<item value="0x08">Kazin</item>
<item value="0x04">Slade</item>
<item value="0x02">Kiwi</item>
<item value="0x01">Peter</item>
</parameter>
<script state="change">
<action condition="maincpu.pb@FFF68A==param|(maincpu.pb@FFF68A BAND ~param)">maincpu.pb@FFF68A=00|(maincpu.pb@FFF68A BAND ~param)</action>
<action condition="maincpu.pb@FFF68A==00|(maincpu.pb@FFF68A BAND ~param)">maincpu.pb@FFF68A=param|(maincpu.pb@FFF68A BAND ~param)</action>
</script>
</cheat>
Detecting that the bit at the parameter is 00 works (second action). First action fails.
Aww yeah. AMD A10-7850K givin' MAME and MESS systems what for.
Pugsy
Posts: 3675 Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Has thanked: 1 time
Been thanked: 15 times
Contact:
Post
by Pugsy » Wed May 13, 2009 7:19 pm
Bit of over-engineering there me thinks...
A simple binary Exclusive OR should do the trick.
Code: Select all
<cheat desc="Force Status Toggle (Group 1)">
<parameter>
<item value="0x80">Bowie (avoid)</item>
<item value="0x40">Sarah</item>
<item value="0x20">Chester</item>
<item value="0x10">Jaha</item>
<item value="0x08">Kazin</item>
<item value="0x04">Slade</item>
<item value="0x02">Kiwi</item>
<item value="0x01">Peter</item>
</parameter>
<script state="change">
<action>maincpu.pb@FFF68A=(maincpu.pb@FFF68A ^ param)</action>
</script>
</cheat>
NotAGoodName
Posts: 331 Joined: Wed Feb 18, 2009 7:09 am
Location: MO, USA
Contact:
Post
by NotAGoodName » Thu May 14, 2009 12:11 am
That did the trick. Thanks again.
I should learn C. Then I could do MATLAB. Err...I mean make genesis.c suck less.
Aww yeah. AMD A10-7850K givin' MAME and MESS systems what for.