[mspacman+] Always have Banana on Random Fruit Levels

This forum is for posting M.A.M.E. arcade cheats. Requests will be fulfilled here....but please keep the requests to the requests forum.
Post Reply
pac_man_fan2
Posts: 66
Joined: Fri Dec 06, 2019 1:49 pm

[mspacman+] Always have Banana on Random Fruit Levels

Post by pac_man_fan2 »

Code: Select all

  
  <cheat desc="Banana for All Random Fruit Boards">
    <script state="run">
      <action>maincpu.mb@2B32=06</action>	<!-- 06=Banana, 05=Pear ... 00=Cherry -->
      <action>maincpu.md@8768=002B323A</action>
      <action>maincpu.md@876C=00000000</action>
    </script>
  </cheat>
jman
Posts: 1311
Joined: Tue Dec 01, 2020 1:24 pm
Been thanked: 9 times

Re: [mspacman+] Always have Banana on Random Fruit Levels

Post by jman »

This code doesn't work for me. Random fruit is always random even when I set this code.
jman

my wip cheat database back-up (06/01/2025 ver.)
https://u3.getuploader.com/...../download/58
downloadpass : jman2020
pac_man_fan2
Posts: 66
Joined: Fri Dec 06, 2019 1:49 pm

Re: [mspacman+] Always have Banana on Random Fruit Levels

Post by pac_man_fan2 »

I missed that the encrypted versions of mspacman need an extra leading '1' bit to the memory address.
The above is perfect for the unencrypted/bootlegs (mspacmab, ...)

Updated for the encrypted sets and finished to restore original code when on/off is used.
<cheat desc="Banana for All Random Fruit Boards">
<script state="on">
<action>temp0 =maincpu.mb@12B32</action>
<action>temp1 =maincpu.md@18768</action>
<action>temp2 =maincpu.md@1876C</action>
</script>
<script state="run">
<action>maincpu.mb@12B32=06</action> <!-- 06=Banana, 05=Pear ... 00=Cherry -->
<action>maincpu.md@18768=002B323A</action>
<action>maincpu.md@1876C=00000000</action>
</script>
<script state="off">
<action>maincpu.mb@12B32=temp0</action>
<action>maincpu.md@18768=temp1</action>
<action>maincpu.md@1876C=temp2</action>
</script>
</cheat>
jman
Posts: 1311
Joined: Tue Dec 01, 2020 1:24 pm
Been thanked: 9 times

Re: [mspacman+] Always have Banana on Random Fruit Levels

Post by jman »

It works in mspacman. But I don't understand why do you read $2b32.

Code: Select all

8768 | ED 5F    : ld  a,r
876A | E6 1F    : and $1F
876C | 90       : sub b
876D | 30 FD    : jr  nc,$876C
876F | 80       : add a,b
8770 | 21 9D 87 : ld  hl,$879D
8773 | 47       : ld  b,a
8774 | 87       : add a,a
8775 | 80       : add a,b
8776 | D7       : rst $10
In $8768, read "r" register so that $2b32 seems to be unneeded.

Simplified code is the following.

Code: Select all

<cheat desc="banana for all random fruit boards">
    <script state="on">
        <action>maincpu.mw@18768 = 063e</action> <!-- 06=Banana, 05=Pear ... 00=Cherry -->
    </script>
    <script state="off">
        <action>maincpu.mw@18768 = 5fed</action>
    </script>
</cheat>
jman

my wip cheat database back-up (06/01/2025 ver.)
https://u3.getuploader.com/...../download/58
downloadpass : jman2020
pac_man_fan2
Posts: 66
Joined: Fri Dec 06, 2019 1:49 pm

Re: [mspacman+] Always have Banana on Random Fruit Levels

Post by pac_man_fan2 »

2B32 is part of the score table for the 8th fruit, which is unused.
I'm putting the desired "random" fruit number (06=banana) in there, to then be read after the board level check of 1-7.

Basically, I dont know what i'm doing and came up with this! I'll check your simplified code out today.
thanks for sharing.
Post Reply