[gunnail] GunNail

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: 842
Joined: Tue Dec 01, 2020 1:24 pm

[gunnail] GunNail

Post by jman »

Code: Select all

<cheat desc="no hit">
    <script state="on">
        <action>maincpu.mb@a47c = 60</action> <!-- bullet -->
        <action>maincpu.mb@b2fe = 60</action> <!-- enemy -->
    </script>
    <script state="off">
        <action>maincpu.mb@a47c = 66</action>
        <action>maincpu.mb@b2fe = 66</action>
    </script>
</cheat>

<cheat desc="auto fire">
    <script state="on">
        <!-- main shot -->
        <action>maincpu.mw@7e4c = 08ae</action> <!-- button -->
        <action>maincpu.mw@7e9a = 0002</action> <!-- fire speed -->
        <!-- red -->
        <action>maincpu.mb@8339 =   00</action> <!-- timer -->
        <action>maincpu.mw@837c = 0002</action> <!-- fire speed -->
        <!-- blue -->
        <action>maincpu.mw@8746 = 0002</action> <!-- fire speed -->
        <!-- purple -->
        <action>maincpu.mb@88af =   00</action> <!-- timer -->
        <action>maincpu.mw@88f0 = 0002</action> <!-- fire speed -->
    </script>
    <script state="off">
        <action>maincpu.mw@7e4c = 08ee</action>
        <action>maincpu.mw@7e9a = 00c2</action>
        <action>maincpu.mb@8339 =   30</action>
        <action>maincpu.mw@837c = 024a</action>
        <action>maincpu.mw@8746 = 029e</action>
        <action>maincpu.mb@88af =   30</action>
        <action>maincpu.mw@88f0 = 00f4</action>
    </script>
</cheat>

<cheat desc="player speed">
    <parameter>
        <item value="0x01">01 (slow)</item>
        <item value="0x03">02       </item>
        <item value="0x06">03       </item>
        <item value="0x09">04       </item>
        <item value="0x0c">05 (fast)</item>
    </parameter>
    <script state="on">
        <action>maincpu.mq@077de = 4eb9000267004e71</action>
        <action>maincpu.mq@26700 = 24300000610c2202</action>
        <action>maincpu.mq@26708 = 2430000461042002</action>
        <action>maincpu.mq@26710 = 4e75760848434a82</action>
        <action>maincpu.mq@26718 = 67066a0244832403</action>
        <action>maincpu.mq@26720 = 4e75000000000000</action>
        <!--
        26700 | 2430 0000 : move.l (A0,D0.w),D2
        26704 | 610c      : bsr    $26712
        26706 | 2202      : move.l D2,D1
        26708 | 2430 0004 : move.l ($4,A0,D0.w),D2
        2670c | 6104      : bsr    $26712
        2670e | 2002      : move.l D2,D0
        26710 | 4e75      : rts
        26712 | 76xx      : moveq  #$xx,D3
        26714 | 4843      : swap   D3
        26716 | 4a82      : tst.l  D2
        26718 | 6706      : beq    $26720
        2671a | 6a02      : bpl    $2671e
        2671c | 4483      : neg.l  D3
        2671e | 2403      : move.l D3,D2
        26720 | 4e75      : rts
        -->
    </script>
    <script state ="change">
        <action>maincpu.mb@26713 = param</action>
    </script>
    <script state="off">
        <action>maincpu.mq@077de = 2230000020300004</action>
        <action>maincpu.mq@26700 = 0000000000000000</action>
        <action>maincpu.mq@26708 = 0000000000000000</action>
        <action>maincpu.mq@26710 = 0000000000000000</action>
        <action>maincpu.mq@26718 = 0000000000000000</action>
        <action>maincpu.mq@26720 = 0000000000000000</action>
    </script>
</cheat>

<cheat desc="bullet speed - main shot">
    <parameter>
        <item value="0x09">01 (slow)</item>
        <item value="0x12">02       </item>
        <item value="0x1b">03       </item>
        <item value="0x24">04       </item>
        <item value="0x2d">05 (fast)</item>
    </parameter>
    <script state="on">
        <action>maincpu.mq@07f26 = 4eb9000266e04e71</action>
        <action>maincpu.mq@266e0 = 297c000000000020</action>
        <action>maincpu.mq@266e8 = 584b295b00244e75</action>
        <!--
        266e0 | 297c 00xx 0000 0020 : move.l #$xx0000,($20,A4)
        266e8 | 584b                : addq.w #4,A3
        266ea | 295b 0024           : move.l (A3)+,($24,A4)
        266ee | 4e75                : rts
        -->
    </script>
    <script state="change">
        <action>maincpu.mb@266e3 = param</action>
    </script>
    <script state="off">
        <action>maincpu.mq@07f26 = 295b0020295b0024</action>
        <action>maincpu.mq@266e0 = 0000000000000000</action>
        <action>maincpu.mq@266e8 = 0000000000000000</action>
    </script>
</cheat>

<cheat desc="max bullets up - main shot">
    <script state="on">
        <action>maincpu.mb@7ea9 = 20</action>
    </script>
    <script state="off">
        <action>maincpu.mb@7ea9 = 03</action>
    </script>
</cheat>

<cheat desc="unlock test mode">
    <comment>reset the game (F3) to enter test mode</comment>
    <script state="on">
        <action>maincpu.md@65c6 = 60000046</action>
    </script>
    <script state="off">
        <action>maincpu.md@65c6 = 66000056</action>
    </script>
</cheat>

<cheat desc="sound test mode">
    <comment>reset the game (F3) to enter sound test mode</comment>
    <script state="on">
        <action>maincpu.mq@0db6a = 4ef9000266e06100</action>
        <action>maincpu.mq@266e0 = 41f9000f100043f9</action>
        <action>maincpu.mq@266e8 = 0008001f12001039</action>
        <action>maincpu.mq@266f0 = 00080003b20067f4</action>
        <action>maincpu.mq@266f8 = 0c0000fd66025310</action>
        <action>maincpu.mq@26700 = 0c0000fe66025210</action>
        <action>maincpu.mq@26708 = 0c0000fb66040410</action>
        <action>maincpu.mq@26710 = 00100c0000f76604</action>
        <action>maincpu.mq@26718 = 061000100c0000ef</action>
        <action>maincpu.mq@26720 = 660212900c0000df</action>
        <action>maincpu.mq@26728 = 6602421160be0000</action>
        <!--
        266e0 | 41f9 000f 1000 : lea    $f1000.l,A0 // sound code address
        266e6 | 43f9 0008 001f : lea    $8001f.l,A1 // sound latch address
        266ec | 1200           : move.b D0,D1
        266ee | 1039 0008 0003 : move.b $80003.l,D0 // read input
        266f4 | b200           : cmp.b  D0,D1
        266f6 | 67f4           : beq    $266ec
        266f8 | 0c00 00fd      : cmpi.b #-$3,D0
        266fc | 6602           : bne    $26700
        266fe | 5310           : subq.b #1,(A0)     // decrease code -01
        26700 | 0c00 00fe      : cmpi.b #-$2,D0
        26704 | 6602           : bne    $26708
        26706 | 5210           : addq.b #1,(A0)     // increase code +01
        26708 | 0c00 00fb      : cmpi.b #-$5,D0
        2670c | 6604           : bne    $26712
        2670e | 0410 0010      : subi.b #$10,(A0)   // decrease code -10
        26712 | 0c00 00f7      : cmpi.b #-$9,D0
        26716 | 6604           : bne    $2671c
        26718 | 0610 0010      : addi.b #$10,(A0)   // increase code +10
        2671c | 0c00 00ef      : cmpi.b #-$11,D0
        26720 | 6602           : bne    $26724
        26722 | 1290           : move.b (A0),(A1)   // play sound
        26724 | 0c00 00df      : cmpi.b #-$21,D0
        26728 | 6602           : bne    $2672c
        2672a | 4211           : clr.b  (A1)        // stop sound
        2672c | 60be           : bra    $266ec
        -->
    </script>
    <script state="run">
        <output format="----- gunnail 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@f1000</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.mq@0db6a = 4279000f90626100</action>
        <action>maincpu.mq@266e0 = 0000000000000000</action>
        <action>maincpu.mq@266e8 = 0000000000000000</action>
        <action>maincpu.mq@266f0 = 0000000000000000</action>
        <action>maincpu.mq@266f8 = 0000000000000000</action>
        <action>maincpu.mq@26700 = 0000000000000000</action>
        <action>maincpu.mq@26708 = 0000000000000000</action>
        <action>maincpu.mq@26710 = 0000000000000000</action>
        <action>maincpu.mq@26718 = 0000000000000000</action>
        <action>maincpu.mq@26720 = 0000000000000000</action>
        <action>maincpu.mq@26728 = 0000000000000000</action>
    </script>
</cheat>
"test mode" is preferred when you set "unlock test mode" and "sound test mode" at the same time.

The following is test codes.

Code: Select all

<cheat desc="highest multiplying factor (test)">
    <script state="on">
        <action>maincpu.md@73dc =         323c0014</action> <!-- enemy (x20) -->
        <action>maincpu.mq@deae = 323c00644e7133c1</action> <!-- boss (x100) -->
    </script>
    <script state="off">
        <action>maincpu.md@73dc =         32350000</action>
        <action>maincpu.mq@deae = 6504c2fc000a33c1</action>
    </script>
</cheat>
Image
Display for multiplying factor is incorrect in stage 3 and 6 though.
jman
Posts: 842
Joined: Tue Dec 01, 2020 1:24 pm

[gunnail]+ GunNail

Post by jman »

gunnail.xml

Code: Select all

<!-- GunNail (28th May. 1992) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>maincpu.mb@A47C = 60</action> <!-- bullet -->
            <action>maincpu.mb@B2FE = 60</action> <!-- enemy -->
        </script>
        <script state="off">
            <action>maincpu.mb@A47C = 66</action>
            <action>maincpu.mb@B2FE = 66</action>
        </script>
    </cheat>

    <cheat desc="auto fire">
        <script state="on">
            <!-- main shot -->
            <action>maincpu.mw@7E4C = 08AE</action> <!-- button -->
            <action>maincpu.mw@7E9A = 0002</action> <!-- interval -->
            <!-- red -->
            <action>maincpu.mw@8338 = 0000</action> <!-- timer -->
            <action>maincpu.mw@837C = 0002</action> <!-- interval -->
            <!-- blue -->
            <action>maincpu.mw@8746 = 0002</action> <!-- interval -->
            <!-- purple -->
            <action>maincpu.mw@88AE = 0000</action> <!-- timer -->
            <action>maincpu.mw@88F0 = 0002</action> <!-- interval -->
        </script>
        <script state="off">
            <action>maincpu.mw@7E4C = 08EE</action>
            <action>maincpu.mw@7E9A = 00C2</action>
            <action>maincpu.mw@8338 = 0030</action>
            <action>maincpu.mw@837C = 024A</action>
            <action>maincpu.mw@8746 = 029E</action>
            <action>maincpu.mw@88AE = 0030</action>
            <action>maincpu.mw@88F0 = 00F4</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter>
            <item value="0x00010000">01 (slow)</item>
            <item value="0x00028000">02       </item>
            <item value="0x00050000">03       </item>
            <item value="0x00078000">04       </item>
            <item value="0x000a0000">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.mq@077DE = 4EB9000266E04E71</action>
            <action>maincpu.mq@266E0 = 243C000000002230</action>
            <action>maincpu.mq@266E8 = 000067066A024482</action>
            <action>maincpu.mq@266F0 = 2202243C00000000</action>
            <action>maincpu.mq@266F8 = 2030000467066A02</action>
            <action>maincpu.mq@26700 = 448220024E750000</action>
            <!--
            266E0 | 243C xxxx xxxx : move.l  #$xxxx, D2       // y-position
            266E6 | 2230 0000      : move.l  (A0,D0.w), D1
            266EA | 6706           : beq     $266f2
            266EC | 6A02           : bpl     $266f0
            266EE | 4482           : neg.l   D2
            266F0 | 2202           : move.l  D2, D1
            266F2 | 243C xxxx xxxx : move.l  #$xxxx, D2
            266F8 | 2030 0004      : move.l  ($4,A0,D0.w), D0 // x-position
            266FC | 6706           : beq     $26704
            266FE | 6A02           : bpl     $26702
            26700 | 4482           : neg.l   D2
            26702 | 2002           : move.l  D2, D0
            26704 | 4E75           : rts
            -->
        </script>
        <script state ="change">
            <action>maincpu.md@266E2 = param</action>
            <action>maincpu.md@266F4 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mq@077DE = 2230000020300004</action>
            <action>maincpu.mq@266E0 = 0000000000000000</action>
            <action>maincpu.mq@266E8 = 0000000000000000</action>
            <action>maincpu.mq@266F0 = 0000000000000000</action>
            <action>maincpu.mq@266F8 = 0000000000000000</action>
            <action>maincpu.mq@26700 = 0000000000000000</action>
        </script>
    </cheat>

    <cheat desc="bullet speed - main shot">
        <parameter>
            <item value="0x00090000">01 (slow)</item>
            <item value="0x00120000">02       </item>
            <item value="0x001b0000">03       </item>
            <item value="0x00240000">04       </item>
            <item value="0x002d0000">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.mq@07F26 = 4EB9000267104E71</action>
            <action>maincpu.mq@26710 = 297C000000000020</action>
            <action>maincpu.mq@26718 = 584B295B00244E75</action>
            <!--
            26710 | 297C xxxx xxxx 0020 : move.l  #$xxxx, ($20,A4)
            26718 | 584B                : addq.w  #4, A3
            2671A | 295B 0024           : move.l  (A3)+, ($24,A4)
            2671E | 4E75                : rts
            -->
        </script>
        <script state="change">
            <action>maincpu.md@26712 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mq@07F26 = 295B0020295B0024</action>
            <action>maincpu.mq@26710 = 0000000000000000</action>
            <action>maincpu.mq@26718 = 0000000000000000</action>
        </script>
    </cheat>

    <cheat desc="max bullets up - main shot">
        <script state="on">
            <action>maincpu.mb@7EA9 = 20</action>
        </script>
        <script state="off">
            <action>maincpu.mb@7EA9 = 03</action>
        </script>
    </cheat>

    <cheat desc="highest multiplying factor (test)">
        <!-- multiplying factor display is buggy in high-speed scroll mode at level 3 and 6 -->
        <script state="on">
            <action>maincpu.md@73DC = 323C0014        </action> <!-- enemy (x20) -->
            <action>maincpu.mq@DEAE = 323C00644E7133C1</action> <!-- boss (x100) -->
        </script>
        <script state="off">
            <action>maincpu.md@73DC = 32350000        </action>
            <action>maincpu.mq@DEAE = 6504C2FC000A33C1</action>
        </script>
    </cheat>

    <cheat desc="unlock test mode">
        <comment>reset the game (F3) to enter test mode</comment>
        <script state="on">
            <action>maincpu.md@65C6 = 60000046</action>
        </script>
        <script state="off">
            <action>maincpu.md@65C6 = 66000056</action>
        </script>
    </cheat>

    <cheat desc="sound test mode">
        <comment>reset the game (F3) to enter sound test mode</comment>
        <script state="on">
            <action>maincpu.mq@0DB6A = 4EF9000267206100</action>
            <action>maincpu.mq@26720 = 41F9000F000043F9</action>
            <action>maincpu.mq@26728 = 0008001F12001029</action>
            <action>maincpu.mq@26730 = FFE4B20067F60C00</action>
            <action>maincpu.mq@26738 = 00FD660253100C00</action>
            <action>maincpu.mq@26740 = 00FE660252100C00</action>
            <action>maincpu.mq@26748 = 00FB660404100010</action>
            <action>maincpu.mq@26750 = 0C0000F766040610</action>
            <action>maincpu.mq@26758 = 00100C0000EF6602</action>
            <action>maincpu.mq@26760 = 12900C0000DF6602</action>
            <action>maincpu.mq@26768 = 421160C000000000</action>
            <!--
            26720 | 41F9 000F 0000 : lea     $f0000.l, A0  // sound code address
            26726 | 43F9 0008 001F : lea     $8001f.l, A1  // sound latch address
            2672C | 1200           : move.b  D0, D1
            2672E | 1029 FFE4      : move.b  (-$1c,A1), D0 // read input ($80003)
            26732 | B200           : cmp.b   D0, D1
            26734 | 67F6           : beq     $2672c
            26736 | 0C00 00FD      : cmpi.b  #-$3, D0
            2673A | 6602           : bne     $2673e
            2673C | 5310           : subq.b  #1, (A0)      // decrease code -01
            2673E | 0C00 00FE      : cmpi.b  #-$2, D0
            26742 | 6602           : bne     $26746
            26744 | 5210           : addq.b  #1, (A0)      // increase code +01
            26746 | 0C00 00FB      : cmpi.b  #-$5, D0
            2674A | 6604           : bne     $26750
            2674C | 0410 0010      : subi.b  #$10, (A0)    // decrease code -10
            26750 | 0C00 00F7      : cmpi.b  #-$9, D0
            26754 | 6604           : bne     $2675a
            26756 | 0610 0010      : addi.b  #$10, (A0)    // increase code +10
            2675A | 0C00 00EF      : cmpi.b  #-$11, D0
            2675E | 6602           : bne     $26762
            26760 | 1290           : move.b  (A0), (A1)    // play sound
            26762 | 0C00 00DF      : cmpi.b  #-$21, D0
            26766 | 6602           : bne     $2676a
            26768 | 4211           : clr.b   (A1)          // stop sound
            2676A | 60C0           : bra     $2672c
            -->
        </script>
        <script state="run">
            <output format="----- gunnail 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@F0000</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mq@0DB6A = 4279000F90626100</action>
            <action>maincpu.mq@26720 = 0000000000000000</action>
            <action>maincpu.mq@26728 = 0000000000000000</action>
            <action>maincpu.mq@26730 = 0000000000000000</action>
            <action>maincpu.mq@26738 = 0000000000000000</action>
            <action>maincpu.mq@26740 = 0000000000000000</action>
            <action>maincpu.mq@26748 = 0000000000000000</action>
            <action>maincpu.mq@26750 = 0000000000000000</action>
            <action>maincpu.mq@26758 = 0000000000000000</action>
            <action>maincpu.mq@26760 = 0000000000000000</action>
            <action>maincpu.mq@26768 = 0000000000000000</action>
        </script>
    </cheat>

</mamecheat>
gunnailp.xml

Code: Select all

<!-- GunNail (location test) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>maincpu.mb@9FA2 = 60</action> <!-- bullet -->
            <action>maincpu.mb@ADEC = 60</action> <!-- enemy -->
        </script>
        <script state="off">
            <action>maincpu.mb@9FA2 = 66</action>
            <action>maincpu.mb@ADEC = 66</action>
        </script>
    </cheat>

    <cheat desc="auto fire">
        <script state="on">
            <!-- main shot -->
            <action>maincpu.mw@797E = 08AE</action> <!-- button -->
            <action>maincpu.mw@79CC = 0002</action> <!-- interval -->
            <!-- red -->
            <action>maincpu.mw@7E6E = 0000</action> <!-- timer -->
            <action>maincpu.mw@7EB2 = 0002</action> <!-- interval -->
            <!-- blue -->
            <action>maincpu.mw@827C = 0002</action> <!-- interval -->
            <!-- purple -->
            <action>maincpu.mw@83E4 = 0000</action> <!-- timer -->
            <action>maincpu.mw@8426 = 0002</action> <!-- interval -->
        </script>
        <script state="off">
            <action>maincpu.mw@797E = 08EE</action>
            <action>maincpu.mw@79CC = 00C2</action>
            <action>maincpu.mw@7E6E = 0030</action>
            <action>maincpu.mw@7EB2 = 024A</action>
            <action>maincpu.mw@827C = 029E</action>
            <action>maincpu.mw@83E4 = 0030</action>
            <action>maincpu.mw@8426 = 00F4</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter>
            <item value="0x00010000">01 (slow)</item>
            <item value="0x00028000">02       </item>
            <item value="0x00050000">03       </item>
            <item value="0x00078000">04       </item>
            <item value="0x000a0000">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.mq@07304 = 4EB9000266A04E71</action>
            <action>maincpu.mq@266A0 = 243C000000002230</action>
            <action>maincpu.mq@266A8 = 000067066A024482</action>
            <action>maincpu.mq@266B0 = 2202243C00000000</action>
            <action>maincpu.mq@266B8 = 2030000467066A02</action>
            <action>maincpu.mq@266C0 = 448220024E750000</action>
            <!--
            266A0 | 243C xxxx xxxx : move.l  #$xxxx, D2       // y-position
            266A6 | 2230 0000      : move.l  (A0,D0.w), D1
            266AA | 6706           : beq     $266b2
            266AC | 6A02           : bpl     $266b0
            266AE | 4482           : neg.l   D2
            266B0 | 2202           : move.l  D2, D1
            266B2 | 243C xxxx xxxx : move.l  #$xxxx, D2
            266B8 | 2030 0004      : move.l  ($4,A0,D0.w), D0 // x-position
            266BC | 6706           : beq     $266c4
            266BE | 6A02           : bpl     $266c2
            266C0 | 4482           : neg.l   D2
            266C2 | 2002           : move.l  D2, D0
            266C4 | 4E75           : rts
            -->
        </script>
        <script state ="change">
            <action>maincpu.md@266A2 = param</action>
            <action>maincpu.md@266B4 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mq@07304 = 2230000020300004</action>
            <action>maincpu.mq@266A0 = 0000000000000000</action>
            <action>maincpu.mq@266A8 = 0000000000000000</action>
            <action>maincpu.mq@266B0 = 0000000000000000</action>
            <action>maincpu.mq@266B8 = 0000000000000000</action>
            <action>maincpu.mq@266C0 = 0000000000000000</action>
        </script>
    </cheat>

    <cheat desc="bullet speed - main shot">
        <parameter>
            <item value="0x00090000">01 (slow)</item>
            <item value="0x00120000">02       </item>
            <item value="0x001b0000">03       </item>
            <item value="0x00240000">04       </item>
            <item value="0x002d0000">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.mq@07A58 = 4EB9000266D04E71</action>
            <action>maincpu.mq@266D0 = 297C000000000020</action>
            <action>maincpu.mq@266D8 = 584B295B00244E75</action>
            <!--
            266D0 | 297C xxxx xxxx 0020 : move.l  #$xxxx, ($20,A4)
            266D8 | 584B                : addq.w  #4, A3
            266DA | 295B 0024           : move.l  (A3)+, ($24,A4)
            266DE | 4E75                : rts
            -->
        </script>
        <script state="change">
            <action>maincpu.md@266D2 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mq@07A58 = 295B0020295B0024</action>
            <action>maincpu.mq@266D0 = 0000000000000000</action>
            <action>maincpu.mq@266D8 = 0000000000000000</action>
        </script>
    </cheat>

    <cheat desc="max bullets up - main shot">
        <script state="on">
            <action>maincpu.mb@79DB = 20</action>
        </script>
        <script state="off">
            <action>maincpu.mb@79DB = 03</action>
        </script>
    </cheat>

    <cheat desc="highest multiplying factor (test)">
        <!-- multiplying factor display is buggy in high-speed scroll mode at level 3 and 6 -->
        <script state="on">
            <action>maincpu.md@6ED8 = 323C0014        </action> <!-- enemy (x20) -->
            <action>maincpu.mq@D91A = 323C00644E7133C1</action> <!-- boss (x100) -->
        </script>
        <script state="off">
            <action>maincpu.md@6ED8 = 32350000        </action>
            <action>maincpu.mq@D91A = 6504C2FC000A33C1</action>
        </script>
    </cheat>

    <cheat desc="unlock test mode">
        <comment>reset the game (F3) to enter test mode</comment>
        <script state="on">
            <action>maincpu.md@60E0 = 60000046</action>
        </script>
        <script state="off">
            <action>maincpu.md@60E0 = 66000056</action>
        </script>
    </cheat>

    <cheat desc="sound test mode">
        <comment>reset the game (F3) to enter sound test mode</comment>
        <script state="on">
            <action>maincpu.mq@0D5EC = 4EF9000266E06100</action>
            <action>maincpu.mq@266E0 = 41F9000F000043F9</action>
            <action>maincpu.mq@266E8 = 0008001F12001029</action>
            <action>maincpu.mq@266F0 = FFE4B20067F60C00</action>
            <action>maincpu.mq@266F8 = 00FD660253100C00</action>
            <action>maincpu.mq@26700 = 00FE660252100C00</action>
            <action>maincpu.mq@26708 = 00FB660404100010</action>
            <action>maincpu.mq@26710 = 0C0000F766040610</action>
            <action>maincpu.mq@26718 = 00100C0000EF6602</action>
            <action>maincpu.mq@26720 = 12900C0000DF6602</action>
            <action>maincpu.mq@26728 = 421160C000000000</action>
            <!--
            266E0 | 41F9 000F 0000 : lea     $f0000.l, A0  // sound code address
            266E6 | 43F9 0008 001F : lea     $8001f.l, A1  // sound latch address
            266EC | 1200           : move.b  D0, D1
            266EE | 1029 FFE4      : move.b  (-$1c,A1), D0 // read input ($80003)
            266F2 | B200           : cmp.b   D0, D1
            266F4 | 67F6           : beq     $2672c
            266F6 | 0C00 00FD      : cmpi.b  #-$3, D0
            266FA | 6602           : bne     $2673e
            266FC | 5310           : subq.b  #1, (A0)      // decrease code -01
            266FE | 0C00 00FE      : cmpi.b  #-$2, D0
            26702 | 6602           : bne     $26746
            26704 | 5210           : addq.b  #1, (A0)      // increase code +01
            26706 | 0C00 00FB      : cmpi.b  #-$5, D0
            2670A | 6604           : bne     $26750
            2670C | 0410 0010      : subi.b  #$10, (A0)    // decrease code -10
            26710 | 0C00 00F7      : cmpi.b  #-$9, D0
            26714 | 6604           : bne     $2675a
            26716 | 0610 0010      : addi.b  #$10, (A0)    // increase code +10
            2671A | 0C00 00EF      : cmpi.b  #-$11, D0
            2671E | 6602           : bne     $26762
            26720 | 1290           : move.b  (A0), (A1)    // play sound
            26722 | 0C00 00DF      : cmpi.b  #-$21, D0
            26726 | 6602           : bne     $2676a
            26728 | 4211           : clr.b   (A1)          // stop sound
            2672A | 60C0           : bra     $2672c
            -->
        </script>
        <script state="run">
            <output format="----- gunnail 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@F0000</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mq@0D5EC = 4279000F90626100</action>
            <action>maincpu.mq@266E0 = 0000000000000000</action>
            <action>maincpu.mq@266E8 = 0000000000000000</action>
            <action>maincpu.mq@266F0 = 0000000000000000</action>
            <action>maincpu.mq@266F8 = 0000000000000000</action>
            <action>maincpu.mq@26700 = 0000000000000000</action>
            <action>maincpu.mq@26708 = 0000000000000000</action>
            <action>maincpu.mq@26710 = 0000000000000000</action>
            <action>maincpu.mq@26718 = 0000000000000000</action>
            <action>maincpu.mq@26720 = 0000000000000000</action>
            <action>maincpu.mq@26728 = 0000000000000000</action>
        </script>
    </cheat>

</mamecheat>
gunnailb.xml

Code: Select all

<!-- GunNail (bootleg) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>maincpu.mb@A47C = 60</action> <!-- bullet -->
            <action>maincpu.mb@B2FE = 60</action> <!-- enemy -->
        </script>
        <script state="off">
            <action>maincpu.mb@A47C = 66</action>
            <action>maincpu.mb@B2FE = 66</action>
        </script>
    </cheat>

    <cheat desc="auto fire">
        <script state="on">
            <!-- main shot -->
            <action>maincpu.mw@7E4C = 08AE</action> <!-- button -->
            <action>maincpu.mw@7E9A = 0002</action> <!-- interval -->
            <!-- red -->
            <action>maincpu.mw@8338 = 0000</action> <!-- timer -->
            <action>maincpu.mw@837C = 0002</action> <!-- interval -->
            <!-- blue -->
            <action>maincpu.mw@8746 = 0002</action> <!-- interval -->
            <!-- purple -->
            <action>maincpu.mw@88AE = 0000</action> <!-- timer -->
            <action>maincpu.mw@88F0 = 0002</action> <!-- interval -->
        </script>
        <script state="off">
            <action>maincpu.mw@7E4C = 08EE</action>
            <action>maincpu.mw@7E9A = 00C2</action>
            <action>maincpu.mw@8338 = 0030</action>
            <action>maincpu.mw@837C = 024A</action>
            <action>maincpu.mw@8746 = 029E</action>
            <action>maincpu.mw@88AE = 0030</action>
            <action>maincpu.mw@88F0 = 00F4</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter>
            <item value="0x00010000">01 (slow)</item>
            <item value="0x00028000">02       </item>
            <item value="0x00050000">03       </item>
            <item value="0x00078000">04       </item>
            <item value="0x000a0000">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.mq@077DE = 4EB9000266E04E71</action>
            <action>maincpu.mq@266E0 = 243C000000002230</action>
            <action>maincpu.mq@266E8 = 000067066A024482</action>
            <action>maincpu.mq@266F0 = 2202243C00000000</action>
            <action>maincpu.mq@266F8 = 2030000467066A02</action>
            <action>maincpu.mq@26700 = 448220024E750000</action>
            <!--
            266E0 | 243C xxxx xxxx : move.l  #$xxxx, D2       // y-position
            266E6 | 2230 0000      : move.l  (A0,D0.w), D1
            266EA | 6706           : beq     $266f2
            266EC | 6A02           : bpl     $266f0
            266EE | 4482           : neg.l   D2
            266F0 | 2202           : move.l  D2, D1
            266F2 | 243C xxxx xxxx : move.l  #$xxxx, D2
            266F8 | 2030 0004      : move.l  ($4,A0,D0.w), D0 // x-position
            266FC | 6706           : beq     $26704
            266FE | 6A02           : bpl     $26702
            26700 | 4482           : neg.l   D2
            26702 | 2002           : move.l  D2, D0
            26704 | 4E75           : rts
            -->
        </script>
        <script state ="change">
            <action>maincpu.md@266E2 = param</action>
            <action>maincpu.md@266F4 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mq@077DE = 2230000020300004</action>
            <action>maincpu.mq@266E0 = 0000000000000000</action>
            <action>maincpu.mq@266E8 = 0000000000000000</action>
            <action>maincpu.mq@266F0 = 0000000000000000</action>
            <action>maincpu.mq@266F8 = 0000000000000000</action>
            <action>maincpu.mq@26700 = 0000000000000000</action>
        </script>
    </cheat>

    <cheat desc="bullet speed - main shot">
        <parameter>
            <item value="0x00090000">01 (slow)</item>
            <item value="0x00120000">02       </item>
            <item value="0x001b0000">03       </item>
            <item value="0x00240000">04       </item>
            <item value="0x002d0000">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.mq@07F26 = 4EB9000267104E71</action>
            <action>maincpu.mq@26710 = 297C000000000020</action>
            <action>maincpu.mq@26718 = 584B295B00244E75</action>
            <!--
            26710 | 297C xxxx xxxx 0020 : move.l  #$xxxx, ($20,A4)
            26718 | 584B                : addq.w  #4, A3
            2671A | 295B 0024           : move.l  (A3)+, ($24,A4)
            2671E | 4E75                : rts
            -->
        </script>
        <script state="change">
            <action>maincpu.md@26712 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mq@07F26 = 295B0020295B0024</action>
            <action>maincpu.mq@26710 = 0000000000000000</action>
            <action>maincpu.mq@26718 = 0000000000000000</action>
        </script>
    </cheat>

    <cheat desc="max bullets up - main shot">
        <script state="on">
            <action>maincpu.mb@7EA9 = 20</action>
        </script>
        <script state="off">
            <action>maincpu.mb@7EA9 = 03</action>
        </script>
    </cheat>

    <cheat desc="highest multiplying factor (test)">
        <!-- multiplying factor display is buggy in high-speed scroll mode at level 3 and 6 -->
        <script state="on">
            <action>maincpu.md@73DC = 323C0014        </action> <!-- enemy (x20) -->
            <action>maincpu.mq@DEAE = 323C00644E7133C1</action> <!-- boss (x100) -->
        </script>
        <script state="off">
            <action>maincpu.md@73DC = 32350000        </action>
            <action>maincpu.mq@DEAE = 6504C2FC000A33C1</action>
        </script>
    </cheat>

    <cheat desc="unlock test mode">
        <comment>reset the game (F3) to enter test mode</comment>
        <script state="on">
            <action>maincpu.md@65C6 = 60000046</action>
        </script>
        <script state="off">
            <action>maincpu.md@65C6 = 66000056</action>
        </script>
    </cheat>

    <cheat desc="sound test mode (test)">
        <!-- is it correct 0x80 at $2677c? -->
        <comment>reset the game (F3) to enter sound test mode</comment>
        <script state="on">
            <action>maincpu.mq@0DB6A = 4EF9000267206100</action>
            <action>maincpu.mq@26720 = 41F9000F000043F9</action>
            <action>maincpu.mq@26728 = 0008001F45F90019</action>
            <action>maincpu.mq@26730 = 400112001029FFE4</action>
            <action>maincpu.mq@26738 = B20067F60C0000FD</action>
            <action>maincpu.mq@26740 = 660253100C0000FE</action>
            <action>maincpu.mq@26748 = 660252100C0000FB</action>
            <action>maincpu.mq@26750 = 6604041000100C00</action>
            <action>maincpu.mq@26758 = 00F7660406100010</action>
            <action>maincpu.mq@26760 = 0C0000EF661A1410</action>
            <action>maincpu.mq@26768 = 0C02008064041282</action>
            <action>maincpu.mq@26770 = 600E1482343C0100</action>
            <action>maincpu.mq@26778 = 51CAFFFE14BC0080</action>
            <action>maincpu.mq@26780 = 0C0000DF66064211</action>
            <action>maincpu.mq@26788 = 14BC007F60A40000</action>
            <!--
            26720 | 41F9 000F 0000 : lea     $f0000.l, A0  // sound code address
            26726 | 43F9 0008 001F : lea     $8001f.l, A1  // music latch address
            2672C | 45F9 0019 4001 : lea     $194001.l, A2 // sfx latch address
            26732 | 1200           : move.b  D0, D1
            26734 | 1029 FFE4      : move.b  (-$1c,A1), D0 // read input ($80003)
            26738 | B200           : cmp.b   D0, D1
            2673A | 67F6           : beq     $26732
            2673C | 0C00 00FD      : cmpi.b  #-$3, D0
            26740 | 6602           : bne     $26744
            26742 | 5310           : subq.b  #1, (A0)      // decrease code -01
            26744 | 0C00 00FE      : cmpi.b  #-$2, D0
            26748 | 6602           : bne     $2674c
            2674A | 5210           : addq.b  #1, (A0)      // increase code +01
            2674C | 0C00 00FB      : cmpi.b  #-$5, D0
            26750 | 6604           : bne     $26756
            26752 | 0410 0010      : subi.b  #$10, (A0)    // decrease code -10
            26756 | 0C00 00F7      : cmpi.b  #-$9, D0
            2675A | 6604           : bne     $26760
            2675C | 0610 0010      : addi.b  #$10, (A0)    // increase code +10
            26760 | 0C00 00EF      : cmpi.b  #-$11, D0
            26764 | 661A           : bne     $26780
            26766 | 1410           : move.b  (A0), D2      // play sound
            26768 | 0C02 0080      : cmpi.b  #-$80, D2
            2676C | 6404           : bcc     $26772
            2676E | 1282           : move.b  D2, (A1)      // music
            26770 | 600E           : bra     $26780
            26772 | 1482           : move.b  D2, (A2)      // sfx
            26774 | 343C 0100      : move.w  #$100, D2
            26778 | 51CA FFFE      : dbra    D2, $26778
            2677C | 14BC 0080      : move.b  #$80, (A2)
            26780 | 0C00 00DF      : cmpi.b  #-$21, D0
            26784 | 6606           : bne     $2678c
            26786 | 4211           : clr.b   (A1)          // stop sound
            26788 | 14BC 007F      : move.b  #$7f, (A2)
            2678C | 60A4           : bra     $26732
            -->
        </script>
        <script state="run">
            <output format="----- gunnail 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@F0000</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mq@0DB6A = 4279000F90626100</action>
            <action>maincpu.mq@26720 = 0000000000000000</action>
            <action>maincpu.mq@26728 = 0000000000000000</action>
            <action>maincpu.mq@26730 = 0000000000000000</action>
            <action>maincpu.mq@26738 = 0000000000000000</action>
            <action>maincpu.mq@26740 = 0000000000000000</action>
            <action>maincpu.mq@26748 = 0000000000000000</action>
            <action>maincpu.mq@26750 = 0000000000000000</action>
            <action>maincpu.mq@26758 = 0000000000000000</action>
            <action>maincpu.mq@26760 = 0000000000000000</action>
            <action>maincpu.mq@26768 = 0000000000000000</action>
            <action>maincpu.mq@26770 = 0000000000000000</action>
            <action>maincpu.mq@26778 = 0000000000000000</action>
            <action>maincpu.mq@26780 = 0000000000000000</action>
            <action>maincpu.mq@26788 = 0000000000000000</action>
        </script>
    </cheat>

</mamecheat>
  • "player speed" : Rewritten routine.
  • "sound test mode" : gunnailb has different routine because sound hardware is based on airbustr and sample is controlled by main cpu.
    I think some sfxs will be missing. So I marks this code for gunnailb with "test".
Post Reply