[fantzn2] Fantasy Zone II

This forum is for posting M.A.M.E. Work In Progress "Arcade"cheats that are not quite ready for the prime time. If the cheats are buggy or the cheat descriptions are non-standard then please post them here. Help maybe given but there are no guarantees and they will only be added to the cheat file when the cheat file maintainer is happy with them.
Post Reply
jman
Posts: 1129
Joined: Tue Dec 01, 2020 1:24 pm
Been thanked: 8 times

[fantzn2] Fantasy Zone II

Post by jman »

Code: Select all

<cheat desc="no hit">
    <script state="on">
        <!-- main collision check -->
        <action>temp0           =  maincpu.pb@e040</action> <!-- backup bank -->
        <action>maincpu.ib@00f7 =             0x0b</action> <!-- set bank -->
        <action>maincpu.ow@ba04 =             bf90</action>
        <action>maincpu.oq@bf90 = 7efdc807fec0a03a</action>
        <action>maincpu.oq@bf98 = ed000501bfa62100</action>
        <action>maincpu.oq@bfa0 = 1214c9ba82cdc0b1</action>
        <action>maincpu.oq@bfa8 = ffffffffff040611</action>
        <!--
        bf90 | 3a a0 c0 : ld   a,($C0A0)  // check current round
        bf93 | fe 07    : cp   $07
        bf95 | c8       : ret  z
        bf96 | fd 7e 00 : ld   a,(iy+$00)
        bf99 | 21 a6 bf : ld   hl,$BFA6
        bf9c | 01 05 00 : ld   bc,$0005
        bf9f | ed b1    : cpir            // search table
        bfa1 | c0       : ret  nz
        bfa2 | cd 82 ba : call $BA82      // call collision check
        bfa5 | c9       : ret
        bfa6 - bfaa     : target value table
         value  target
           04    coin
           06    paper money
           11    warp
           12    boss warp
           14    shop
        -->
        <action>maincpu.ib@00f7 = temp0</action> <!-- restore bank -->
        <!-- boss -->
        <action>maincpu.ob@12c3 = 18</action>
    </script>
    <script state="off">
        <action>temp0           =  maincpu.pb@e040</action>
        <action>maincpu.ib@00f7 =             0x0b</action>
        <action>maincpu.ow@ba04 =             ba82</action>
        <action>maincpu.oq@bf90 = ffffffffffffffff</action>
        <action>maincpu.oq@bf98 = ffffffffffffffff</action>
        <action>maincpu.oq@bfa0 = ffffffffffffffff</action>
        <action>maincpu.oq@bfa8 = ffffffffffffffff</action>
        <action>maincpu.ib@00f7 =            temp0</action>
        <action>maincpu.ob@12c3 =               28</action>
    </script>
</cheat>

<cheat desc="auto fire">
    <script state="on">
        <action>maincpu.mb@1699 = 00</action> <!-- shot -->
        <action>maincpu.mb@16c0 = 00</action> <!-- bomb -->
    </script>
    <script state="off">
        <action>maincpu.mb@1699 = 0e</action>
        <action>maincpu.mb@16c0 = 06</action>
    </script>
</cheat>

<cheat desc="free price">
    <script state="on">
        <action>maincpu.ob@4b0c =               af</action> <!-- price display -->
        <action>maincpu.ob@4b18 =               af</action> <!-- price display -->
        <action>maincpu.oq@5098 = 00c9772c772c77af</action>
        <!--
        5098 | af : xor a
        5099 | 77 : ld  (hl),a
        509a | 2c : inc l
        509b | 77 : ld  (hl),a
        509c | 2c : inc l
        509d | 77 : ld  (hl),a
        509e | c9 : ret
        -->
    </script>
    <script state="off">
        <action>maincpu.ob@4b0c =               7e</action>
        <action>maincpu.ob@4b18 =               7e</action>
        <action>maincpu.oq@5098 = 1a2c1c961a648611</action>
    </script>
</cheat>

<cheat desc="mark secret shop">
    <script state="on">
        <action>maincpu.mb@4724 = 04</action>
    </script>
    <script state="off">
        <action>maincpu.mb@4724 = 1a</action>
    </script>
</cheat>

<cheat desc="sound test mode">
    <comment>reset the game (F3) to enter sound test mode</comment>
    <script state="on">
        <action>temp0           =  maincpu.pb@e040</action> <!-- backup bank -->
        <action>maincpu.ib@00f7 =               00</action> <!-- set bank -->
        <action>maincpu.mw@00c0 =             b730</action>
        <action>maincpu.oq@b730 = 2847b8e1dbc10021</action>
        <action>maincpu.oq@b738 = f7fe350120fbfefa</action>
        <action>maincpu.oq@b740 = 3e0420fdfe340120</action>
        <action>maincpu.oq@b748 = 3e0620fefe0618f0</action>
        <action>maincpu.oq@b750 = 20effe1118778610</action>
        <action>maincpu.oq@b758 = dffe051880f67e05</action>
        <action>maincpu.oq@b760 = cb18de0232af0420</action>
        <!--
        b730 | 21 00 c1 : ld  hl,$C100 // sound code address
        b733 | db e1    : in  a,($E1)  // read input
        b735 | b8       : cp  b
        b736 | 47       : ld  b,a
        b737 | 28 fa    : jr  z,$B733
        b739 | fe fb    : cp  $FB
        b73b | 20 01    : jr  nz,$B73E
        b73d | 35       : dec (hl)     // decrease code -01
        b73e | fe f7    : cp  $F7
        b740 | 20 01    : jr  nz,$B743
        b742 | 34       : inc (hl)     // increase code +01
        b743 | fe fe    : cp  $FD
        b745 | 20 04    : jr  nz,$B74B
        b747 | 3e 10    : ld  a,$F0    // decrease code -10
        b749 | 18 06    : jr  $B751
        b74b | fe fd    : cp  $FE
        b74d | 20 06    : jr  nz,$B755
        b74f | 3e f0    : ld  a,$10    // increase code +10
        b751 | 86       : add a,(hl)
        b752 | 77       : ld  (hl),a
        b753 | 18 11    : jr  $B766
        b755 | fe ef    : cp  $EF
        b757 | 20 05    : jr  nz,$B75E
        b759 | 7e       : ld  a,(hl)   // play sound
        b75a | f6 80    : or  $80
        b75c | 18 05    : jr  $B763
        b75e | fe df    : cp  $DF
        b760 | 20 04    : jr  nz,$B766
        b762 | af       : xor a         // stop sound
        b763 | 32 02 de : ld  ($DE02),a // send sound code
        b766 | 18 cb    : jr  $B733
        -->
        <action>maincpu.ib@00f7 = temp0</action> <!-- restore bank -->
    </script>
    <script state="run">
        <output format="----- fantasy zone II sound test mode -----" line="10" align="center" />
        <output format="left : decrease code -01"                    line="11" align="center" />
        <output format="right : increase code +01"                   line="12" align="center" />
        <output format="up : increase code +10"                      line="13" align="center" />
        <output format="down : decrease code -10"                    line="14" align="center" />
        <output format="button 1 : play sound"                       line="15" align="center" />
        <output format="button 2 : stop sound"                       line="16" align="center" />
        <output format="----------------------------"                line="17" align="center" />
        <output format="&lt;&lt; sound code %2.2X &gt;&gt;"          line="19" align="center">
            <argument>maincpu.pb@c100</argument>
        </output>
    </script>
    <script state="off">
        <action>temp0           =  maincpu.pb@e040</action>
        <action>maincpu.ib@00f7 =               00</action>
        <action>maincpu.mw@00c0 =             082f</action>
        <action>maincpu.oq@b730 = ffffffffffffffff</action>
        <action>maincpu.oq@b738 = ffffffffffffffff</action>
        <action>maincpu.oq@b740 = ffffffffffffffff</action>
        <action>maincpu.oq@b748 = ffffffffffffffff</action>
        <action>maincpu.oq@b750 = ffffffffffffffff</action>
        <action>maincpu.oq@b758 = ffffffffffffffff</action>
        <action>maincpu.oq@b760 = ffffffffffffffff</action>
        <action>maincpu.ib@00f7 =            temp0</action>
    </script>
</cheat>
I don't know direct memory read/write for "banked opcode" space via expression. Did anyone know it?
jman

my wip cheat database back-up (2024/12/01 ver.)
https://u3.getuploader.com/...../download/47
downloadpass : jman2020
jman
Posts: 1129
Joined: Tue Dec 01, 2020 1:24 pm
Been thanked: 8 times

[fantzn2] Fantasy Zone II

Post by jman »

fantzn2.xml

Code: Select all

<!-- Fantasy Zone II - The Tears of Opa-Opa (MC-8123, 317-0057) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <!-- main collision check -->
            <action>maincpu.ib@00F7 =  B              </action> <!-- set bank -->
            <action>maincpu.ow@BA04 = BF90            </action>
            <action>maincpu.oq@BF90 = 7EFDC807FEC0A03A</action>
            <action>maincpu.oq@BF98 = ED000501BFA62100</action>
            <action>maincpu.oq@BFA0 = 1214C9BA82CDC0B1</action>
            <action>maincpu.oq@BFA8 = FFFFFFFFFF040611</action>
            <!--
            BF90 | 3A A0 C0 : ld   a,($C0A0)  // check current round
            BF93 | FE 07    : cp   $07
            BF95 | C8       : ret  z
            BF96 | FD 7E 00 : ld   a,(iy+$00) // read target status
            BF99 | 21 A6 BF : ld   hl,$BFA6
            BF9C | 01 05 00 : ld   bc,$0005
            BF9F | ED B1    : cpir            // search
            BFA1 | C0       : ret  nz
            BFA2 | CD 82 BA : call $BA82      // call collision check
            BFA5 | C9       : ret
            BFA6 - BFAA     : target value table
             value  target
               04    coin
               06    bill
               11    warp
               12    boss warp
               14    shop
            -->
            <action>maincpu.ib@00F7 = maincpu.pb@E040</action> <!-- restore bank -->
            <!-- boss -->
            <action>maincpu.ob@12C3 = 18</action>
        </script>
        <script state="off">
            <action>maincpu.ib@00F7 =  B              </action>
            <action>maincpu.ow@BA04 = BA82            </action>
            <action>maincpu.oq@BF90 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.oq@BF98 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.oq@BFA0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.oq@BFA8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.ib@00F7 = maincpu.pb@E040 </action>
            <action>maincpu.ob@12C3 = 28              </action>
        </script>
    </cheat>

    <cheat desc="rapid fire">
        <script state="on">
            <action>maincpu.mb@1699 = 00</action> <!-- shot -->
            <action>maincpu.mb@16C0 = 00</action> <!-- bomb -->
        </script>
        <script state="off">
            <action>maincpu.mb@1699 = 0E</action>
            <action>maincpu.mb@16C0 = 06</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter>
            <item value="0x0080">01 (slow)</item>
            <item value="0x0180">02 (slow)</item>
            <item value="0x0280">03 (slow)</item>
            <item value="0x0480">04 (slow)</item>
            <item value="0x0680">05 (slow)</item>
        </parameter>
        <script state="on">
            <action>maincpu.ib@00F7 = 02              </action> <!-- set bank -->
            <action>maincpu.od@10D0 = 00FFFFCD        </action>
            <action>maincpu.mw@10D1 = BDE0            </action>
            <action>maincpu.oq@BDE0 = EDC20953ED000011</action>
            <action>maincpu.oq@BDE8 = FFFFFFFFC9C0B353</action>
            <!--
            BDE0 | 11 xx xx    : ld   de,$xx
            BDE3 | ED 53 09 C2 : ld   ($C209),de
            BDE7 | ED 53 B3 C0 : ld   ($C0B3),de
            BDEB | C9          : ret
            -->
            <action>maincpu.ib@00F7 = maincpu.pb@E040 </action> <!-- restore bank -->
        </script>
        <script state="change">
            <action>maincpu.ib@00F7 = 02             </action>
            <action>maincpu.ow@BDE1 = param          </action>
            <action>maincpu.ib@00F7 = maincpu.pb@E040</action>
        </script>
        <script state="off">
            <action>maincpu.ib@00F7 = 02              </action>
            <action>maincpu.od@10D0 = D2FE5BED        </action>
            <action>maincpu.mw@10D1 = B360            </action>
            <action>maincpu.oq@BDE0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.oq@BDE8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.ib@00F7 = maincpu.pb@E040 </action>
        </script>
    </cheat>

    <cheat desc="energy speed">
        <parameter>
            <item value="0xff">01 (slow)</item>
            <item value="0x80">02       </item>
            <item value="0x40">03       </item>
            <item value="0x20">04       </item>
            <item value="0x01">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.od@1314 = 7700FF3E</action>
            <action>maincpu.od@1DD4 = 3200FF3E</action> <!-- round start -->
            <action>maincpu.od@44FF = 3200FF3E</action> <!-- player restart -->
        </script>
        <script state="change">
            <action>maincpu.pb@C053 = param</action> <!-- initialize -->
            <action>maincpu.mb@1315 = param</action>
            <action>maincpu.mb@1DD5 = param</action>
            <action>maincpu.mb@4500 = param</action>
        </script>
        <script state="off">
            <action>maincpu.od@1314 = 772BBD3A</action>
            <action>maincpu.mb@1315 = 58      </action>
            <action>maincpu.od@1DD4 = 327F953A</action>
            <action>maincpu.mb@1DD5 = 58      </action>
            <action>maincpu.od@44FF = 320D253A</action>
            <action>maincpu.mb@4500 = 58      </action>
        </script>
    </cheat>

    <cheat desc="free price">
        <script state="on">
            <action>maincpu.ob@4B0C = AF              </action> <!-- price display -->
            <action>maincpu.ob@4B18 = AF              </action> <!-- price display -->
            <action>maincpu.oq@5098 = 00C9772C772C77AF</action>
            <!--
            5098 | AF : xor  a
            5099 | 77 : ld   (hl),a
            509A | 2C : inc  l
            509B | 77 : ld   (hl),a
            509C | 2C : inc  l
            509D | 77 : ld   (hl),a
            509E | C9 : ret
            -->
        </script>
        <script state="off">
            <action>maincpu.ob@4B0C = 7E              </action>
            <action>maincpu.ob@4B18 = 7E              </action>
            <action>maincpu.oq@5098 = 1A2C1C961A648611</action>
        </script>
    </cheat>

    <cheat desc="short hit mark - bomb">
        <script state="on">
            <action>maincpu.ob@193B = 00</action>
        </script>
        <script state="off">
            <action>maincpu.ob@193B = C0</action>
        </script>
    </cheat>

    <cheat desc="mark secret shop">
        <script state="on">
            <action>maincpu.mb@4724 = 04</action>
        </script>
        <script state="off">
            <action>maincpu.mb@4724 = 1A</action>
        </script>
    </cheat>

    <cheat desc="starting round (test)">
        <comment>selecting round 8 causes the game crash</comment>
        <parameter min="0x01" max="0x08" step="0x01" />
        <script state="on">
            <action>maincpu.ib@00F7 = 01              </action> <!-- set bank -->
            <action>maincpu.ob@1CD0 = CD              </action>
            <action>maincpu.mw@1CD1 = A830            </action>
            <action>maincpu.oq@A830 = C0A232C0A032003E</action>
            <action>maincpu.oq@A838 = FFFFFFFFC9E0433A</action>
            <!--
            A830 | 3E xx    : ld   a,$xx
            A832 | 32 A0 C0 : ld   ($C0A0),a
            A835 | 32 A2 C0 : ld   ($C0A2),a
            A838 | 3A 43 E0 : ld   a,($E043)
            A83B | C9       : ret
            -->
            <action>maincpu.ib@00F7 = maincpu.pb@E040</action> <!-- restore bank -->
        </script>
        <script state="change">
            <action>maincpu.ib@00F7 = 01             </action>
            <action>maincpu.ob@A831 = param - 1      </action>
            <action>maincpu.ib@00F7 = maincpu.pb@E040</action>
        </script>
        <script state="off">
            <action>maincpu.ib@00F7 = 01              </action>
            <action>maincpu.ob@1CD0 = 3A              </action>
            <action>maincpu.mw@1CD1 = E043            </action>
            <action>maincpu.oq@A830 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.oq@A838 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.ib@00F7 = maincpu.pb@E040 </action>
        </script>
    </cheat>

    <cheat desc="sound test mode">
        <comment>reset the game (F3) to enter sound test mode</comment>
        <script state="on">
            <action>maincpu.ib@00F7 = 00              </action> <!-- set bank -->
            <action>maincpu.mw@00C0 = B730            </action>
            <action>maincpu.oq@B730 = 2847B8E1DBC00021</action>
            <action>maincpu.oq@B738 = F7FE350120FBFEFA</action>
            <action>maincpu.oq@B740 = 3E0420FDFE340120</action>
            <action>maincpu.oq@B748 = 3E0520FEFE0618F0</action>
            <action>maincpu.oq@B750 = 0520EFFE78778610</action>
            <action>maincpu.oq@B758 = 20DFFE051880F67E</action>
            <action>maincpu.oq@B760 = FFCC18DE0232AF04</action>
            <!--
            B730 | 21 00 C0 : ld   hl,$C000  // sound code address
            B733 | DB E1    : in   a,($E1)   // read input
            B735 | B8       : cp   b
            B736 | 47       : ld   b,a
            B737 | 28 FA    : jr   z,$B733
            B739 | FE FB    : cp   $FB
            B73B | 20 01    : jr   nz,$B73E
            B73D | 35       : dec  (hl)      // decrease code -01
            B73E | FE F7    : cp   $F7
            B740 | 20 01    : jr   nz,$B743
            B742 | 34       : inc  (hl)      // increase code +01
            B743 | FE FD    : cp   $FD
            B745 | 20 04    : jr   nz,$B74B
            B747 | 3E F0    : ld   a,$F0     // decrease code -10
            B749 | 18 06    : jr   $B751
            B74B | FE FE    : cp   $FE
            B74D | 20 05    : jr   nz,$B754
            B74F | 3E 10    : ld   a,$10     // increase code +10
            B751 | 86       : add  a,(hl)
            B752 | 77       : ld   (hl),a
            B753 | 78       : ld   a,b
            B754 | FE EF    : cp   $EF
            B756 | 20 05    : jr   nz,$B75D
            B758 | 7E       : ld   a,(hl)    // play sound
            B759 | F6 80    : or   $80
            B75B | 18 05    : jr   $B762
            B75D | FE DF    : cp   $DF
            B75F | 20 04    : jr   nz,$B765
            B761 | AF       : xor  a         // stop sound
            B762 | 32 02 DE : ld   ($DE02),a // send sound code
            B765 | 18 CC    : jr   $B733
            -->
            <action>maincpu.ib@00F7 = maincpu.pb@E040</action> <!-- restore bank -->
        </script>
        <script state="run">
            <output format="----- sound test mode -----"       line="10" align="center" />
            <output format="left : decrease code -01"          line="11" align="center" />
            <output format="right : increase code +01"         line="12" align="center" />
            <output format="down : decrease code -10"          line="13" align="center" />
            <output format="up : increase code +10"            line="14" align="center" />
            <output format="button 1 : play sound"             line="15" align="center" />
            <output format="button 2 : stop sound"             line="16" align="center" />
            <output format="----------------------------"      line="17" align="center" />
            <output format="&lt;&lt; sound code %02X &gt;&gt;" line="19" align="center"  >
                <argument>maincpu.pb@C000</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.ib@00F7 = 00              </action>
            <action>maincpu.mw@00C0 = 082F            </action>
            <action>maincpu.oq@B730 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.oq@B738 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.oq@B740 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.oq@B748 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.oq@B750 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.oq@B758 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.oq@B760 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.ib@00F7 = maincpu.pb@E040 </action>
        </script>
    </cheat>

</mamecheat>
  • "player speed", "energy speed" and "short hit mark - bomb" : Added new.
  • "starting round" : Added new as test code. The game crashes when you select round 8 (final level).
jman

my wip cheat database back-up (2024/12/01 ver.)
https://u3.getuploader.com/...../download/47
downloadpass : jman2020
Post Reply