[earthjkr] U.N. Defense Force: Earth Joker

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

[earthjkr] U.N. Defense Force: Earth Joker

Post by jman »

Code: Select all

<cheat desc="P1 no hit">
    <script state="on">
        <action>maincpu.mb@4fc8 = 60</action> <!-- bullet -->
        <action>maincpu.mb@4468 = 60</action> <!-- enemy -->
        <action>maincpu.mb@456c = 60</action> <!-- thunder -->
        <action>maincpu.mb@46d8 = 60</action> <!-- wall -->
    </script>
    <script state="off">
        <action>maincpu.mb@4fc8 = 67</action>
        <action>maincpu.mb@4468 = 6e</action>
        <action>maincpu.mb@456c = 6e</action>
        <action>maincpu.mb@46d8 = 6e</action>
    </script>
</cheat>

<cheat desc="P2 no hit">
    <script state="on">
        <action>maincpu.mb@5016 = 60</action> <!-- bullet -->
        <action>maincpu.mb@44ea = 60</action> <!-- enemy -->
        <action>maincpu.mb@45be = 60</action> <!-- thunder -->
        <action>maincpu.mb@4746 = 60</action> <!-- wall -->
    </script>
    <script state="off">
        <action>maincpu.mb@5016 = 67</action>
        <action>maincpu.mb@44ea = 6e</action>
        <action>maincpu.mb@45be = 6e</action>
        <action>maincpu.mb@4746 = 6e</action>
    </script>
</cheat>

<cheat desc="auto fire">
    <script state="on">
        <action>maincpu.mb@2455 = 14</action>
    </script>
    <script state="off">
        <action>maincpu.mb@2455 = 20</action>
    </script>
</cheat>

<cheat desc="player speed">
    <parameter min="0x01" max="0x07" step="0x01" />
    <script state="on">
        <action>maincpu.mq@01b7a = 4eb90003f2504e71</action>
        <action>maincpu.mq@3f250 = 3228000e363c0000</action>
        <action>maincpu.mq@3f258 = 4a4167066a024443</action>
        <action>maincpu.mq@3f260 = 320334280012363c</action>
        <action>maincpu.mq@3f268 = 00004a4267066a02</action>
        <action>maincpu.mq@3f270 = 444334034e75ffff</action>
        <!--
        3f250 | 3228 000e : move.w ($e,A0),D1  // y position
        3f254 | 363c 00xx : move.w #$xx,D3
        3f258 | 4a41      : tst.w  D1
        3f25a | 6706      : beq    $3f262
        3f25c | 6a02      : bpl    $3f260
        3f25e | 4443      : neg.w  D3
        3f260 | 3203      : move.w D3,D1
        3f262 | 3428 0012 : move.w ($12,A0),D2 // x position
        3f266 | 363c 00xx : move.w #$xx,D3
        3f26a | 4a42      : tst.w  D2
        3f26c | 6706      : beq    $3f274
        3f26e | 6a02      : bpl    $3f272
        3f270 | 4443      : neg.w  D3
        3f272 | 3403      : move.w D3,D2
        3f274 | 4e75      : rts
        -->
    </script>
    <script state="change">
        <action>maincpu.mb@3f257 = param</action>
        <action>maincpu.mb@3f269 = param</action>
    </script>
    <script state="off">
        <action>maincpu.mq@01b7a = 3228000e34280012</action>
        <action>maincpu.mq@3f250 = ffffffffffffffff</action>
        <action>maincpu.mq@3f258 = ffffffffffffffff</action>
        <action>maincpu.mq@3f260 = ffffffffffffffff</action>
        <action>maincpu.mq@3f268 = ffffffffffffffff</action>
        <action>maincpu.mq@3f270 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="bullet speed">
    <comment>mainshot, around luncher and front missile</comment>
    <parameter>
        <item value="0x06">01 (slow)</item>
        <item value="0x0c">02       </item>
        <item value="0x12">03       </item>
        <item value="0x18">04       </item>
        <item value="0x1e">05 (fast)</item>
    </parameter>
    <script state="on">
        <action>maincpu.mq@02854 = 4eb90003f2304e71</action>
        <action>maincpu.mq@3f230 = 222a0004242a0008</action>
        <action>maincpu.mq@3f238 = 760048434a816704</action>
        <action>maincpu.mq@3f240 = 6b0222034e75ffff</action>
        <!--
        3f230 | 222a 0004 : move.l ($4,A2),D1
        3f234 | 242a 0008 : move.l ($8,A2),D2
        3f238 | 76xx      : moveq  #$xx,D3
        3f23a | 4843      : swap   D3
        3f23c | 4a81      : tst.l  D1
        3f23e | 6704      : beq    $3f244
        3f240 | 6b02      : bmi    $3f244
        3f242 | 2203      : move.l D3,D1
        3f244 | 4e75      : rts
        -->
    </script>
    <script state="change">
        <action>maincpu.mb@3f239 = param</action>
    </script>
    <script state="off">
        <action>maincpu.mq@02854 = 222a0004242a0008</action>
        <action>maincpu.mq@3f230 = ffffffffffffffff</action>
        <action>maincpu.mq@3f238 = ffffffffffffffff</action>
        <action>maincpu.mq@3f240 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="sound test mode">
    <comment>reset the game (F3) to enter sound test mode</comment>
    <script state="on">
        <action>maincpu.mb@00b6e =               60</action> <!-- accept sound code -->
        <action>maincpu.mq@0bcf8 = 4ef90003f250303c</action>
        <action>maincpu.mq@3f250 = 41f90010010033c0</action>
        <action>maincpu.mq@3f258 = 0040000014011239</action>
        <action>maincpu.mq@3f260 = 00400005b40167ee</action>
        <action>maincpu.mq@3f268 = 0c0100fb66025310</action>
        <action>maincpu.mq@3f270 = 0c0100f766025210</action>
        <action>maincpu.mq@3f278 = 0c0100fd66040410</action>
        <action>maincpu.mq@3f280 = 00100c0100fe6604</action>
        <action>maincpu.mq@3f288 = 061000100c0100ef</action>
        <action>maincpu.mq@3f290 = 66041c1060080c01</action>
        <action>maincpu.mq@3f298 = 00df660842064eb9</action>
        <action>maincpu.mq@3f2a0 = 0000e36460b0ffff</action>
        <!--
        3f250 | 41f9 0010 0100 : lea    $100100.l,A0 // sound code address
        3f256 | 33c0 0040 0000 : move.w D0,$400000.l // watchdog
        3f25c | 1401           : move.b D1,D2
        3f25e | 1239 0040 0005 : move.b $400005.l,D1 // read input
        3f264 | b401           : cmp.b  D1,D2
        3f266 | 67ee           : beq    $3f256
        3f268 | 0c01 00fb      : cmpi.b #-$5,D1
        3f26c | 6602           : bne    $3f270
        3f26e | 5310           : subq.b #1,(A0)      // decrease code -01
        3f270 | 0c01 00f7      : cmpi.b #-$9,D1
        3f274 | 6602           : bne    $3f278
        3f276 | 5210           : addq.b #1,(A0)      // increase code +01
        3f278 | 0c01 00fd      : cmpi.b #-$3,D1
        3f27c | 6604           : bne    $3f282
        3f27e | 0410 0010      : subi.b #$10,(A0)    // decrease code -10
        3f282 | 0c01 00fe      : cmpi.b #-$2,D1
        3f286 | 6604           : bne    $3f28c
        3f288 | 0610 0010      : addi.b #$10,(A0)    // increase code +10
        3f28c | 0c01 00ef      : cmpi.b #-$11,D1
        3f290 | 6604           : bne    $3f296
        3f292 | 1c10           : move.b (A0),D6      // play sound
        3f294 | 6008           : bra    $3f29e
        3f296 | 0c01 00df      : cmpi.b #-$21,D1
        3f29a | 6608           : bne    $3f2a4
        3f29c | 4206           : clr.b  D6           // stop sound
        3f29e | 4eb9 0000 e364 : jsr    $e364.l      // send sound code
        3f2a4 | 60b0           : bra    $3f256
        -->
    </script>
    <script state="run">
        <output format="----- earth joker 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@100100</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.mb@00b6e =               67</action>
        <action>maincpu.mq@0bcf8 = 41f9001031c4303c</action>
        <action>maincpu.mq@3f250 = ffffffffffffffff</action>
        <action>maincpu.mq@3f258 = ffffffffffffffff</action>
        <action>maincpu.mq@3f260 = ffffffffffffffff</action>
        <action>maincpu.mq@3f268 = ffffffffffffffff</action>
        <action>maincpu.mq@3f270 = ffffffffffffffff</action>
        <action>maincpu.mq@3f278 = ffffffffffffffff</action>
        <action>maincpu.mq@3f280 = ffffffffffffffff</action>
        <action>maincpu.mq@3f288 = ffffffffffffffff</action>
        <action>maincpu.mq@3f290 = ffffffffffffffff</action>
        <action>maincpu.mq@3f298 = ffffffffffffffff</action>
        <action>maincpu.mq@3f2a0 = ffffffffffffffff</action>
    </script>
</cheat>
The following codes are test. Sometimes the game is broken.

Code: Select all

<cheat desc="P1 fire speed up">
    <comment>sometimes crash the game</comment>
    <script state="on">
        <action>maincpu.mw@256c = 4e71</action>
    </script>
    <script state="off">
        <action>maincpu.mw@256c = 6646</action>
    </script>
</cheat>

<cheat desc="P2 fire speed up">
    <comment>sometimes crash the game</comment>
    <script state="on">
        <action>maincpu.mw@25e8 = 4e71</action>
    </script>
    <script state="off">
        <action>maincpu.mw@25e8 = 6644</action>
    </script>
</cheat>
jman
Posts: 843
Joined: Tue Dec 01, 2020 1:24 pm

[earthjkr]+ U.N. Defense Force: Earth Joker

Post by jman »

earthjkr.xml

Code: Select all

<!-- U.N. Defense Force: Earth Joker (US / Japan, set 1) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <!-- P1 -->
            <action>maincpu.mb@4468 = 60</action> <!-- enemy -->
            <action>maincpu.mb@456C = 60</action> <!-- thunder -->
            <action>maincpu.mb@46D8 = 60</action> <!-- wall -->
            <action>maincpu.mb@4FC8 = 60</action> <!-- bullet -->
            <!-- P2 -->
            <action>maincpu.mb@44EA = 60</action> <!-- enemy -->
            <action>maincpu.mb@45BE = 60</action> <!-- thunder -->
            <action>maincpu.mb@4746 = 60</action> <!-- wall -->
            <action>maincpu.mb@5016 = 60</action> <!-- bullet -->
        </script>
        <script state="off">
            <action>maincpu.mb@4468 = 6E</action>
            <action>maincpu.mb@456C = 6E</action>
            <action>maincpu.mb@46D8 = 6E</action>
            <action>maincpu.mb@4FC8 = 67</action>
            <action>maincpu.mb@44EA = 6E</action>
            <action>maincpu.mb@45BE = 6E</action>
            <action>maincpu.mb@4746 = 6E</action>
            <action>maincpu.mb@5016 = 67</action>
        </script>
    </cheat>

    <cheat desc="auto fire">
        <comment>you can't shoot charge shot</comment>
        <script state="on">
            <action>maincpu.mw@23C4 = 4E71</action> <!-- interval (charge shot) -->
            <action>maincpu.mw@2436 = 4E71</action> <!-- interval (normal shot) -->
            <action>maincpu.mw@2454 = 6E14</action> <!-- button -->
        </script>
        <script state="off">
            <action>maincpu.mw@23C4 = 660C</action>
            <action>maincpu.mw@2436 = 663E</action>
            <action>maincpu.mw@2454 = 6E20</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter>
            <item value="0x0001">01 (slow)</item>
            <item value="0x0003">02       </item>
            <item value="0x0006">03       </item>
            <item value="0x0009">04       </item>
            <item value="0x000c">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.mq@01B7A = 4EB90003F2304E71</action> <!-- calculate position (normal) -->
            <action>maincpu.mq@01BAA = 4EB90003F2304E71</action> <!-- calculate position (charge shot) -->
            <action>maincpu.mq@01BF6 = 4EB90003F2304E71</action> <!-- calculate position (flicker) -->
            <action>maincpu.mq@024DE = 4EB90003F2304E71</action> <!-- check moving range -->
            <action>maincpu.mq@3F230 = 3228000E363C0000</action>
            <action>maincpu.mq@3F238 = 4A4167066A024443</action>
            <action>maincpu.mq@3F240 = 320334280012363C</action>
            <action>maincpu.mq@3F248 = 00004A4267066A02</action>
            <action>maincpu.mq@3F250 = 444334034E75FFFF</action>
            <!--
            3F230 | 3228 000E : move.w  ($e,A0), D1
            3F234 | 363C xxxx : move.w  #$xx D3
            3F238 | 4A41      : tst.w   D1
            3F23A | 670A      : beq     $3f242
            3F23C | 6A02      : bpl     $3f240
            3F23E | 4443      : neg.w   D3
            3F240 | 3203      : move.w  D3, D1
            3F242 | 3428 0012 : move.w  ($12,A0), D2
            3F246 | 363C xxxx : move.w  #xx, D3
            3F24A | 4A42      : tst.w   D2
            3F24C | 670A      : beq     $3f254
            3F24E | 6A02      : bpl     $3f252
            3F250 | 4443      : neg.w   D3
            3F252 | 3403      : move.w  D3, D2
            3F254 | 4E75      : rts
            -->
        </script>
        <script state="change">
            <action>maincpu.mw@3F236 = param</action>
            <action>maincpu.mw@3F248 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mq@01B7A = 3228000E34280012</action>
            <action>maincpu.mq@01BAA = 3228000E34280012</action>
            <action>maincpu.mq@01BF6 = 3228000E34280012</action>
            <action>maincpu.mq@024DE = 3228000E34280012</action>
            <action>maincpu.mq@3F230 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F238 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F240 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F248 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F250 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="bullet speed (test)">
        <comment>mainshot, around luncher and front missile</comment>
        <parameter>
            <item value="0x06">01 (slow)</item>
            <item value="0x0c">02       </item>
            <item value="0x12">03       </item>
            <item value="0x18">04       </item>
            <item value="0x1e">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.mq@02854 = 4EB90003F2604E71</action>
            <action>maincpu.mq@3F260 = 222A0004242A0008</action>
            <action>maincpu.mq@3F268 = 760048434A816704</action>
            <action>maincpu.mq@3F270 = 6B0222034E75FFFF</action>
            <!--
            3F260 | 222A 0004 : move.l  ($4,A2), D1
            3F264 | 242A 0008 : move.l  ($8,A2), D2
            3F268 | 76xx      : moveq   #$xx, D3
            3F26A | 4843      : swap    D3
            3F26C | 4A81      : tst.l   D1
            3F26E | 6704      : beq     $3f274
            3F270 | 6B02      : bmi     $3f274
            3F272 | 2203      : move.l  D3, D1
            3F274 | 4E75      : rts
            -->
        </script>
        <script state="change">
            <action>maincpu.mb@3F269 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mq@02854 = 222A0004242A0008</action>
            <action>maincpu.mq@3F260 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F268 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F270 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="fire speed up (buggy)">
        <comment>sometimes crash the game</comment>
        <script state="on">
            <action>maincpu.mw@256C = 4E71</action> <!-- P1 -->
            <action>maincpu.mw@25E8 = 4E71</action> <!-- P2 -->
        </script>
        <script state="off">
            <action>maincpu.mw@256C = 6646</action>
            <action>maincpu.mw@25E8 = 6644</action>
        </script>
    </cheat>

    <cheat desc="sound test mode">
        <comment>reset the game (F3) to enter sound test mode</comment>
        <script state="on">
            <action>maincpu.mb@00B6E = 60              </action> <!-- enable sound code check in interrupt -->
            <action>maincpu.mq@0BC08 = 4EF90003F280303C</action>
            <action>maincpu.mq@3F280 = 41F90010000043F9</action>
            <action>maincpu.mq@3F288 = 0040000032801200</action>
            <action>maincpu.mq@3F290 = 10290005B20067F4</action>
            <action>maincpu.mq@3F298 = 0C0000FB66025310</action>
            <action>maincpu.mq@3F2A0 = 0C0000F766025210</action>
            <action>maincpu.mq@3F2A8 = 0C0000FD66040410</action>
            <action>maincpu.mq@3F2B0 = 00100C0000FE6604</action>
            <action>maincpu.mq@3F2B8 = 061000100C0000EF</action>
            <action>maincpu.mq@3F2C0 = 66041C1060080C00</action>
            <action>maincpu.mq@3F2C8 = 00DF660842064EB9</action>
            <action>maincpu.mq@3F2D0 = 0000E36460B6FFFF</action>
            <!--
            3F280 | 41F9 0010 0000 : lea     $100000.l, A0 // sound code address
            3F286 | 43F9 0040 0000 : lea     $400000.l, A1 // watchdog address
            3F28C | 3280           : move.w  D0, (A1)
            3F28E | 1200           : move.b  D0, D1
            3F290 | 1029 0005      : move.b  ($5,A1), D0   // read input ($400005)
            3F294 | B200           : cmp.b   D0, D1
            3F296 | 67F4           : beq     $3f28c
            3F298 | 0C00 00FB      : cmpi.b  #-$5, D0
            3F29C | 6602           : bne     $3f2a0
            3F29E | 5310           : subq.b  #1, (A0)      // decrease code -01
            3F2A0 | 0C00 00F7      : cmpi.b  #-$9, D0
            3F2A4 | 6602           : bne     $3f2a8
            3F2A6 | 5210           : addq.b  #1, (A0)      // increase code +01
            3F2A8 | 0C00 00FD      : cmpi.b  #-$3, D0
            3F2AC | 6604           : bne     $3f2b2
            3F2AE | 0410 0010      : subi.b  #$10, (A0)    // decrease code -10
            3F2B2 | 0C00 00FE      : cmpi.b  #-$2, D0
            3F2B6 | 6604           : bne     $3f2bc
            3F2B8 | 0610 0010      : addi.b  #$10, (A0)    // increase code +10
            3F2BC | 0C00 00EF      : cmpi.b  #-$11, D0
            3F2C0 | 6604           : bne     $3f2c6
            3F2C2 | 1C10           : move.b  (A0), D6      // play sound
            3F2C4 | 6008           : bra     $3f2ce
            3F2C6 | 0C00 00DF      : cmpi.b  #-$21, D0
            3F2CA | 6608           : bne     $3f2d4
            3F2CC | 4206           : clr.b   D6            // stop sound
            3F2CE | 4EB9 0000 E364 : jsr     $e364.l       // send sound code
            3F2D4 | 60B6           : bra     $3f28c
            -->
        </script>
        <script state="run">
            <output format="----- earth joker 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 %2.2X &gt;&gt;"      line="19" align="center"  >
                <argument>maincpu.pb@100000</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mb@00B6E = 67              </action>
            <action>maincpu.mq@0BC08 = 41F9001031C4303C</action>
            <action>maincpu.mq@3F280 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F288 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F290 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F298 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F2A0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F2A8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F2B0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F2B8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F2C0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F2C8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F2D0 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

</mamecheat>
earthjkra.xml

Code: Select all

<!-- U.N. Defense Force: Earth Joker (US / Japan, set 2) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <!-- P1 -->
            <action>maincpu.mb@4468 = 60</action> <!-- enemy -->
            <action>maincpu.mb@456C = 60</action> <!-- thunder -->
            <action>maincpu.mb@46D8 = 60</action> <!-- wall -->
            <action>maincpu.mb@4FC8 = 60</action> <!-- bullet -->
            <!-- P2 -->
            <action>maincpu.mb@44EA = 60</action> <!-- enemy -->
            <action>maincpu.mb@45BE = 60</action> <!-- thunder -->
            <action>maincpu.mb@4746 = 60</action> <!-- wall -->
            <action>maincpu.mb@5016 = 60</action> <!-- bullet -->
        </script>
        <script state="off">
            <action>maincpu.mb@4468 = 6E</action>
            <action>maincpu.mb@456C = 6E</action>
            <action>maincpu.mb@46D8 = 6E</action>
            <action>maincpu.mb@4FC8 = 67</action>
            <action>maincpu.mb@44EA = 6E</action>
            <action>maincpu.mb@45BE = 6E</action>
            <action>maincpu.mb@4746 = 6E</action>
            <action>maincpu.mb@5016 = 67</action>
        </script>
    </cheat>

    <cheat desc="auto fire">
        <comment>you can't shoot charge shot</comment>
        <script state="on">
            <action>maincpu.mw@23C4 = 4E71</action> <!-- interval (charge shot) -->
            <action>maincpu.mw@2436 = 4E71</action> <!-- interval (normal shot) -->
            <action>maincpu.mw@2454 = 6E14</action> <!-- button -->
        </script>
        <script state="off">
            <action>maincpu.mw@23C4 = 660C</action>
            <action>maincpu.mw@2436 = 663E</action>
            <action>maincpu.mw@2454 = 6E20</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter>
            <item value="0x0001">01 (slow)</item>
            <item value="0x0003">02       </item>
            <item value="0x0006">03       </item>
            <item value="0x0009">04       </item>
            <item value="0x000c">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.mq@01B7A = 4EB90003F1A04E71</action> <!-- calculate position (normal) -->
            <action>maincpu.mq@01BAA = 4EB90003F1A04E71</action> <!-- calculate position (charge shot) -->
            <action>maincpu.mq@01BF6 = 4EB90003F1A04E71</action> <!-- calculate position (flicker) -->
            <action>maincpu.mq@024DE = 4EB90003F1A04E71</action> <!-- check moving range -->
            <action>maincpu.mq@3F1A0 = 3228000E363C0000</action>
            <action>maincpu.mq@3F1A8 = 4A4167066A024443</action>
            <action>maincpu.mq@3F1B0 = 320334280012363C</action>
            <action>maincpu.mq@3F1B8 = 00004A4267066A02</action>
            <action>maincpu.mq@3F1C0 = 444334034E75FFFF</action>
            <!--
            3F1A0 | 3228 000E : move.w  ($e,A0), D1
            3F1A4 | 363C xxxx : move.w  #$xx D3
            3F1A8 | 4A41      : tst.w   D1
            3F1AA | 6706      : beq     $3f1b2
            3F1AC | 6A02      : bpl     $3f1b0
            3F1AE | 4443      : neg.w   D3
            3F1B0 | 3203      : move.w  D3, D1
            3F1B2 | 3428 0012 : move.w  ($12,A0), D2
            3F1B6 | 363C xxxx : move.w  #xx, D3
            3F1BA | 4A42      : tst.w   D2
            3F1BC | 6706      : beq     $3f1c4
            3F1BE | 6A02      : bpl     $3f1c2
            3F1C0 | 4443      : neg.w   D3
            3F1C2 | 3403      : move.w  D3, D2
            3F1C4 | 4E75      : rts
            -->
        </script>
        <script state="change">
            <action>maincpu.mw@3F1A6 = param</action>
            <action>maincpu.mw@3F1B8 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mq@01B7A = 3228000E34280012</action>
            <action>maincpu.mq@01BAA = 3228000E34280012</action>
            <action>maincpu.mq@01BF6 = 3228000E34280012</action>
            <action>maincpu.mq@024DE = 3228000E34280012</action>
            <action>maincpu.mq@3F1A0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F1A8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F1B0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F1B8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F1C0 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="bullet speed (test)">
        <comment>mainshot, around luncher and front missile</comment>
        <parameter>
            <item value="0x06">01 (slow)</item>
            <item value="0x0c">02       </item>
            <item value="0x12">03       </item>
            <item value="0x18">04       </item>
            <item value="0x1e">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.mq@02854 = 4EB90003F1D04E71</action>
            <action>maincpu.mq@3F1D0 = 222A0004242A0008</action>
            <action>maincpu.mq@3F1D8 = 760048434A816704</action>
            <action>maincpu.mq@3F1E0 = 6B0222034E75FFFF</action>
            <!--
            3F1D0 | 222A 0004 : move.l  ($4,A2), D1
            3F1D4 | 242A 0008 : move.l  ($8,A2), D2
            3F1D8 | 76xx      : moveq   #$xx, D3
            3F1DA | 4843      : swap    D3
            3F1DC | 4A81      : tst.l   D1
            3F1DE | 6704      : beq     $3f1e4
            3F1E0 | 6B02      : bmi     $3f1e4
            3F1E2 | 2203      : move.l  D3, D1
            3F1E4 | 4E75      : rts
            -->
        </script>
        <script state="change">
            <action>maincpu.mb@3F1D9 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mq@02854 = 222A0004242A0008</action>
            <action>maincpu.mq@3F1D0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F1D8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F1E0 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="fire speed up (buggy)">
        <comment>sometimes crash the game</comment>
        <script state="on">
            <action>maincpu.mw@256C = 4E71</action> <!-- P1 -->
            <action>maincpu.mw@25E8 = 4E71</action> <!-- P2 -->
        </script>
        <script state="off">
            <action>maincpu.mw@256C = 6646</action>
            <action>maincpu.mw@25E8 = 6644</action>
        </script>
    </cheat>

    <cheat desc="sound test mode">
        <comment>reset the game (F3) to enter sound test mode</comment>
        <script state="on">
            <action>maincpu.mb@00B6E = 60              </action> <!-- enable sound code check in interrupt -->
            <action>maincpu.mq@0BC08 = 4EF90003F1F0303C</action>
            <action>maincpu.mq@3F1F0 = 41F90010000043F9</action>
            <action>maincpu.mq@3F1F8 = 0040000032801200</action>
            <action>maincpu.mq@3F200 = 10290005B20067F4</action>
            <action>maincpu.mq@3F208 = 0C0000FB66025310</action>
            <action>maincpu.mq@3F210 = 0C0000F766025210</action>
            <action>maincpu.mq@3F218 = 0C0000FD66040410</action>
            <action>maincpu.mq@3F220 = 00100C0000FE6604</action>
            <action>maincpu.mq@3F228 = 061000100C0000EF</action>
            <action>maincpu.mq@3F230 = 66041C1060080C00</action>
            <action>maincpu.mq@3F238 = 00DF660842064EB9</action>
            <action>maincpu.mq@3F240 = 0000E36460B6FFFF</action>
            <!--
            3F1F0 | 41F9 0010 0000 : lea     $100000.l, A0 // sound code address
            3F1F6 | 43F9 0040 0000 : lea     $400000.l, A1 // watchdog address
            3F1FC | 3280           : move.w  D0, (A1)
            3F1FE | 1200           : move.b  D0, D1
            3F200 | 1029 0005      : move.b  ($5,A1), D0   // read input ($400005)
            3F204 | B200           : cmp.b   D0, D1
            3F206 | 67F4           : beq     $3f1fc
            3F208 | 0C00 00FB      : cmpi.b  #-$5, D0
            3F20C | 6602           : bne     $3f210
            3F20E | 5310           : subq.b  #1, (A0)      // decrease code -01
            3F210 | 0C00 00F7      : cmpi.b  #-$9, D0
            3F214 | 6602           : bne     $3f218
            3F216 | 5210           : addq.b  #1, (A0)      // increase code +01
            3F218 | 0C00 00FD      : cmpi.b  #-$3, D0
            3F21C | 6604           : bne     $3f222
            3F21E | 0410 0010      : subi.b  #$10, (A0)    // decrease code -10
            3F222 | 0C00 00FE      : cmpi.b  #-$2, D0
            3F226 | 6604           : bne     $3f22c
            3F228 | 0610 0010      : addi.b  #$10, (A0)    // increase code +10
            3F22C | 0C00 00EF      : cmpi.b  #-$11, D0
            3F230 | 6604           : bne     $3f236
            3F232 | 1C10           : move.b  (A0), D6      // play sound
            3F234 | 6008           : bra     $3f23e
            3F236 | 0C00 00DF      : cmpi.b  #-$21, D0
            3F23A | 6608           : bne     $3f244
            3F23C | 4206           : clr.b   D6            // stop sound
            3F24E | 4EB9 0000 E364 : jsr     $e364.l       // send sound code
            3F244 | 60B6           : bra     $3f1fc
            -->
        </script>
        <script state="run">
            <output format="----- earth joker 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 %2.2X &gt;&gt;"      line="19" align="center"  >
                <argument>maincpu.pb@100000</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mb@00B6E = 67              </action>
            <action>maincpu.mq@0BC08 = 41F9001031C4303C</action>
            <action>maincpu.mq@3F1F0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F1F8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F200 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F208 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F210 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F218 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F220 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F228 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F230 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F238 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F240 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

</mamecheat>
earthjkrb.xml

Code: Select all

<!-- U.N. Defense Force: Earth Joker (US / Japan, set 3) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <!-- P1 -->
            <action>maincpu.mb@4468 = 60</action> <!-- enemy -->
            <action>maincpu.mb@456C = 60</action> <!-- thunder -->
            <action>maincpu.mb@46D8 = 60</action> <!-- wall -->
            <action>maincpu.mb@4FC8 = 60</action> <!-- bullet -->
            <!-- P2 -->
            <action>maincpu.mb@44EA = 60</action> <!-- enemy -->
            <action>maincpu.mb@45BE = 60</action> <!-- thunder -->
            <action>maincpu.mb@4746 = 60</action> <!-- wall -->
            <action>maincpu.mb@5016 = 60</action> <!-- bullet -->
        </script>
        <script state="off">
            <action>maincpu.mb@4468 = 6E</action>
            <action>maincpu.mb@456C = 6E</action>
            <action>maincpu.mb@46D8 = 6E</action>
            <action>maincpu.mb@4FC8 = 67</action>
            <action>maincpu.mb@44EA = 6E</action>
            <action>maincpu.mb@45BE = 6E</action>
            <action>maincpu.mb@4746 = 6E</action>
            <action>maincpu.mb@5016 = 67</action>
        </script>
    </cheat>

    <cheat desc="auto fire">
        <comment>you can't shoot charge shot</comment>
        <script state="on">
            <action>maincpu.mw@23C4 = 4E71</action> <!-- interval (charge shot) -->
            <action>maincpu.mw@2436 = 4E71</action> <!-- interval (normal shot) -->
            <action>maincpu.mw@2454 = 6E14</action> <!-- button -->
        </script>
        <script state="off">
            <action>maincpu.mw@23C4 = 660C</action>
            <action>maincpu.mw@2436 = 663E</action>
            <action>maincpu.mw@2454 = 6E20</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter>
            <item value="0x0001">01 (slow)</item>
            <item value="0x0003">02       </item>
            <item value="0x0006">03       </item>
            <item value="0x0009">04       </item>
            <item value="0x000c">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.mq@01B7A = 4EB90003F1604E71</action> <!-- calculate position (normal) -->
            <action>maincpu.mq@01BAA = 4EB90003F1604E71</action> <!-- calculate position (charge shot) -->
            <action>maincpu.mq@01BF6 = 4EB90003F1604E71</action> <!-- calculate position (flicker) -->
            <action>maincpu.mq@024DE = 4EB90003F1604E71</action> <!-- check moving range -->
            <action>maincpu.mq@3F160 = 3228000E363C0000</action>
            <action>maincpu.mq@3F168 = 4A4167066A024443</action>
            <action>maincpu.mq@3F170 = 320334280012363C</action>
            <action>maincpu.mq@3F178 = 00004A4267066A02</action>
            <action>maincpu.mq@3F180 = 444334034E75FFFF</action>
            <!--
            3F160 | 3228 000E : move.w  ($e,A0), D1
            3F164 | 363C xxxx : move.w  #$xx D3
            3F168 | 4A41      : tst.w   D1
            3F16A | 670A      : beq     $3f172
            3F16C | 6A02      : bpl     $3f170
            3F16E | 4443      : neg.w   D3
            3F170 | 3203      : move.w  D3, D1
            3F172 | 3428 0012 : move.w  ($12,A0), D2
            3F176 | 363C xxxx : move.w  #xx, D3
            3F17A | 4A42      : tst.w   D2
            3F17C | 670A      : beq     $3f184
            3F17E | 6A02      : bpl     $3f182
            3F180 | 4443      : neg.w   D3
            3F182 | 3403      : move.w  D3, D2
            3F184 | 4E75      : rts
            -->
        </script>
        <script state="change">
            <action>maincpu.mw@3F166 = param</action>
            <action>maincpu.mw@3F178 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mq@01B7A = 3228000E34280012</action>
            <action>maincpu.mq@01BAA = 3228000E34280012</action>
            <action>maincpu.mq@01BF6 = 3228000E34280012</action>
            <action>maincpu.mq@024DE = 3228000E34280012</action>
            <action>maincpu.mq@3F160 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F168 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F170 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F178 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F180 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="bullet speed (test)">
        <comment>mainshot, around luncher and front missile</comment>
        <parameter>
            <item value="0x06">01 (slow)</item>
            <item value="0x0c">02       </item>
            <item value="0x12">03       </item>
            <item value="0x18">04       </item>
            <item value="0x1e">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.mq@02854 = 4EB90003F1904E71</action>
            <action>maincpu.mq@3F190 = 222A0004242A0008</action>
            <action>maincpu.mq@3F198 = 760048434A816704</action>
            <action>maincpu.mq@3F1A0 = 6B0222034E75FFFF</action>
            <!--
            3F190 | 222A 0004 : move.l  ($4,A2), D1
            3F194 | 242A 0008 : move.l  ($8,A2), D2
            3F198 | 76xx      : moveq   #$xx, D3
            3F19A | 4843      : swap    D3
            3F19C | 4A81      : tst.l   D1
            3F19E | 6704      : beq     $3f1a4
            3F1A0 | 6B02      : bmi     $3f1a4
            3F1A2 | 2203      : move.l  D3, D1
            3F1A4 | 4E75      : rts
            -->
        </script>
        <script state="change">
            <action>maincpu.mb@3F199 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mq@02854 = 222A0004242A0008</action>
            <action>maincpu.mq@3F190 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F198 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F1A0 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="fire speed up (buggy)">
        <comment>sometimes crash the game</comment>
        <script state="on">
            <action>maincpu.mw@256C = 4E71</action> <!-- P1 -->
            <action>maincpu.mw@25E8 = 4E71</action> <!-- P2 -->
        </script>
        <script state="off">
            <action>maincpu.mw@256C = 6646</action>
            <action>maincpu.mw@25E8 = 6644</action>
        </script>
    </cheat>

    <cheat desc="sound test mode">
        <comment>reset the game (F3) to enter sound test mode</comment>
        <script state="on">
            <action>maincpu.mb@00B6E = 60              </action> <!-- enable sound code check in interrupt -->
            <action>maincpu.mq@0BC08 = 4EF90003F1B0303C</action>
            <action>maincpu.mq@3F1B0 = 41F90010000043F9</action>
            <action>maincpu.mq@3F1B8 = 0040000032801200</action>
            <action>maincpu.mq@3F1C0 = 10290005B20067F4</action>
            <action>maincpu.mq@3F1C8 = 0C0000FB66025310</action>
            <action>maincpu.mq@3F1D0 = 0C0000F766025210</action>
            <action>maincpu.mq@3F1D8 = 0C0000FD66040410</action>
            <action>maincpu.mq@3F1E0 = 00100C0000FE6604</action>
            <action>maincpu.mq@3F1E8 = 061000100C0000EF</action>
            <action>maincpu.mq@3F1F0 = 66041C1060080C00</action>
            <action>maincpu.mq@3F1F8 = 00DF660842064EB9</action>
            <action>maincpu.mq@3F200 = 0000E36460B6FFFF</action>
            <!--
            3F1B0 | 41F9 0010 0000 : lea     $100000.l, A0 // sound code address
            3F1B6 | 43F9 0040 0000 : lea     $400000.l, A1 // watchdog address
            3F1BC | 3280           : move.w  D0, (A1)
            3F1BE | 1200           : move.b  D0, D1
            3F1C0 | 1029 0005      : move.b  ($5,A1), D0   // read input ($400005)
            3F1C4 | B200           : cmp.b   D0, D1
            3F1C6 | 67F4           : beq     $3f1bc
            3F1C8 | 0C00 00FB      : cmpi.b  #-$5, D0
            3F1CC | 6602           : bne     $3f1d0
            3F1CE | 5310           : subq.b  #1, (A0)      // decrease code -01
            3F1D0 | 0C00 00F7      : cmpi.b  #-$9, D0
            3F1D4 | 6602           : bne     $3f1d8
            3F1D6 | 5210           : addq.b  #1, (A0)      // increase code +01
            3F1D8 | 0C00 00FD      : cmpi.b  #-$3, D0
            3F1DC | 6604           : bne     $3f1e2
            3F1DE | 0410 0010      : subi.b  #$10, (A0)    // decrease code -10
            3F1E2 | 0C00 00FE      : cmpi.b  #-$2, D0
            3F1E6 | 6604           : bne     $3f1ec
            3F1E8 | 0610 0010      : addi.b  #$10, (A0)    // increase code +10
            3F1EC | 0C00 00EF      : cmpi.b  #-$11, D0
            3F1F0 | 6604           : bne     $3f1f6
            3F1F2 | 1C10           : move.b  (A0), D6      // play sound
            3F1F4 | 6008           : bra     $3f1fe
            3F1F6 | 0C00 00DF      : cmpi.b  #-$21, D0
            3F1FA | 6608           : bne     $3f204
            3F1FC | 4206           : clr.b   D6            // stop sound
            3F1FE | 4EB9 0000 E364 : jsr     $e364.l       // send sound code
            3F204 | 60B6           : bra     $3f1bc
            -->
        </script>
        <script state="run">
            <output format="----- earth joker 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 %2.2X &gt;&gt;"      line="19" align="center"  >
                <argument>maincpu.pb@100000</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mb@00B6E = 67              </action>
            <action>maincpu.mq@0BC08 = 41F9001031C4303C</action>
            <action>maincpu.mq@3F1B0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F1B8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F1C0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F1C8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F1D0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F1D8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F1E0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F1E8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F1F0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F1F8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3F200 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

</mamecheat>
earthjkrp.xml

Code: Select all

<!-- U.N. Defense Force: Earth Joker (Japan, prototype?) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <!-- P1 -->
            <action>maincpu.mb@4468 = 60</action> <!-- enemy -->
            <action>maincpu.mb@456C = 60</action> <!-- thunder -->
            <action>maincpu.mb@46D8 = 60</action> <!-- wall -->
            <action>maincpu.mb@4FC8 = 60</action> <!-- bullet -->
            <!-- P2 -->
            <action>maincpu.mb@44EA = 60</action> <!-- enemy -->
            <action>maincpu.mb@45BE = 60</action> <!-- thunder -->
            <action>maincpu.mb@4746 = 60</action> <!-- wall -->
            <action>maincpu.mb@5016 = 60</action> <!-- bullet -->
        </script>
        <script state="off">
            <action>maincpu.mb@4468 = 6E</action>
            <action>maincpu.mb@456C = 6E</action>
            <action>maincpu.mb@46D8 = 6E</action>
            <action>maincpu.mb@4FC8 = 67</action>
            <action>maincpu.mb@44EA = 6E</action>
            <action>maincpu.mb@45BE = 6E</action>
            <action>maincpu.mb@4746 = 6E</action>
            <action>maincpu.mb@5016 = 67</action>
        </script>
    </cheat>

    <cheat desc="auto fire">
        <comment>you can't shoot charge shot</comment>
        <script state="on">
            <action>maincpu.mw@23C4 = 4E71</action> <!-- interval (charge shot) -->
            <action>maincpu.mw@2436 = 4E71</action> <!-- interval (normal shot) -->
            <action>maincpu.mw@2454 = 6E14</action> <!-- button -->
        </script>
        <script state="off">
            <action>maincpu.mw@23C4 = 660C</action>
            <action>maincpu.mw@2436 = 663E</action>
            <action>maincpu.mw@2454 = 6E20</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter>
            <item value="0x0001">01 (slow)</item>
            <item value="0x0003">02       </item>
            <item value="0x0006">03       </item>
            <item value="0x0009">04       </item>
            <item value="0x000c">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.mq@01B7A = 4EB90003CF004E71</action> <!-- calculate position (normal) -->
            <action>maincpu.mq@01BAA = 4EB90003CF004E71</action> <!-- calculate position (charge shot) -->
            <action>maincpu.mq@01BF6 = 4EB90003CF004E71</action> <!-- calculate position (flicker) -->
            <action>maincpu.mq@024DE = 4EB90003CF004E71</action> <!-- check moving range -->
            <action>maincpu.mq@3CF00 = 3228000E363C0000</action>
            <action>maincpu.mq@3CF08 = 4A4167066A024443</action>
            <action>maincpu.mq@3CF10 = 320334280012363C</action>
            <action>maincpu.mq@3CF18 = 00004A4267066A02</action>
            <action>maincpu.mq@3CF20 = 444334034E75FFFF</action>
            <!--
            3CF00 | 3228 000E : move.w  ($e,A0), D1
            3CF04 | 363C xxxx : move.w  #$xx D3
            3CF08 | 4A41      : tst.w   D1
            3CF0A | 670A      : beq     $3cf12
            3CF0C | 6A02      : bpl     $3cf10
            3CF0E | 4443      : neg.w   D3
            3CF10 | 3203      : move.w  D3, D1
            3CF12 | 3428 0012 : move.w  ($12,A0), D2
            3CF16 | 363C xxxx : move.w  #xx, D3
            3CF1A | 4A42      : tst.w   D2
            3CF1C | 670A      : beq     $3cf24
            3CF1E | 6A02      : bpl     $3cf22
            3CF20 | 4443      : neg.w   D3
            3CF22 | 3403      : move.w  D3, D2
            3CF24 | 4E75      : rts
            -->
        </script>
        <script state="change">
            <action>maincpu.mw@3CF06 = param</action>
            <action>maincpu.mw@3CF18 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mq@01B7A = 3228000E34280012</action>
            <action>maincpu.mq@01BAA = 3228000E34280012</action>
            <action>maincpu.mq@01BF6 = 3228000E34280012</action>
            <action>maincpu.mq@024DE = 3228000E34280012</action>
            <action>maincpu.mq@3CF00 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3CF08 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3CF10 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3CF18 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3CF20 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="bullet speed (test)">
        <comment>mainshot, around luncher and front missile</comment>
        <parameter>
            <item value="0x06">01 (slow)</item>
            <item value="0x0c">02       </item>
            <item value="0x12">03       </item>
            <item value="0x18">04       </item>
            <item value="0x1e">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.mq@02854 = 4EB90003CF304E71</action>
            <action>maincpu.mq@3CF30 = 222A0004242A0008</action>
            <action>maincpu.mq@3CF38 = 760048434A816704</action>
            <action>maincpu.mq@3CF40 = 6B0222034E75FFFF</action>
            <!--
            3CF30 | 222A 0004 : move.l  ($4,A2), D1
            3CF34 | 242A 0008 : move.l  ($8,A2), D2
            3CF38 | 76xx      : moveq   #$xx, D3
            3CF3A | 4843      : swap    D3
            3CF3C | 4A81      : tst.l   D1
            3CF3E | 6704      : beq     $3cf44
            3CF40 | 6B02      : bmi     $3cf44
            3CF42 | 2203      : move.l  D3, D1
            3CF44 | 4E75      : rts
            -->
        </script>
        <script state="change">
            <action>maincpu.mb@3CF39 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mq@02854 = 222A0004242A0008</action>
            <action>maincpu.mq@3CF30 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3CF38 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3CF40 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="fire speed up (buggy)">
        <comment>sometimes crash the game</comment>
        <script state="on">
            <action>maincpu.mw@256C = 4E71</action> <!-- P1 -->
            <action>maincpu.mw@25E8 = 4E71</action> <!-- P2 -->
        </script>
        <script state="off">
            <action>maincpu.mw@256C = 6646</action>
            <action>maincpu.mw@25E8 = 6644</action>
        </script>
    </cheat>

    <cheat desc="sound test mode">
        <comment>reset the game (F3) to enter sound test mode</comment>
        <script state="on">
            <action>maincpu.mb@00B6E = 60              </action> <!-- enable sound code check in interrupt -->
            <action>maincpu.mq@0BBF6 = 4EF90003CF50303C</action>
            <action>maincpu.mq@3CF50 = 41F90010000043F9</action>
            <action>maincpu.mq@3CF58 = 0040000032801200</action>
            <action>maincpu.mq@3CF60 = 10290005B20067F4</action>
            <action>maincpu.mq@3CF68 = 0C0000FB66025310</action>
            <action>maincpu.mq@3CF70 = 0C0000F766025210</action>
            <action>maincpu.mq@3CF78 = 0C0000FD66040410</action>
            <action>maincpu.mq@3CF80 = 00100C0000FE6604</action>
            <action>maincpu.mq@3CF88 = 061000100C0000EF</action>
            <action>maincpu.mq@3CF90 = 66041C1060080C00</action>
            <action>maincpu.mq@3CF98 = 00DF660842064EB9</action>
            <action>maincpu.mq@3CFA0 = 0000E34060B6FFFF</action>
            <!--
            3CF50 | 41F9 0010 0000 : lea     $100000.l, A0 // sound code address
            3CF56 | 43F9 0040 0000 : lea     $400000.l, A1 // watchdog address
            3CF5C | 3280           : move.w  D0, (A1)
            3CF5E | 1200           : move.b  D0, D1
            3CF60 | 1029 0005      : move.b  ($5,A1), D0   // read input ($400005)
            3CF64 | B200           : cmp.b   D0, D1
            3CF66 | 67F4           : beq     $3cf5c
            3CF68 | 0C00 00FB      : cmpi.b  #-$5, D0
            3CF6C | 6602           : bne     $3cf70
            3CF6E | 5310           : subq.b  #1, (A0)      // decrease code -01
            3CF70 | 0C00 00F7      : cmpi.b  #-$9, D0
            3CF74 | 6602           : bne     $3cf78
            3CF76 | 5210           : addq.b  #1, (A0)      // increase code +01
            3CF78 | 0C00 00FD      : cmpi.b  #-$3, D0
            3CF7C | 6604           : bne     $3cf82
            3CF7E | 0410 0010      : subi.b  #$10, (A0)    // decrease code -10
            3CF82 | 0C00 00FE      : cmpi.b  #-$2, D0
            3CF86 | 6604           : bne     $3cf8c
            3CF88 | 0610 0010      : addi.b  #$10, (A0)    // increase code +10
            3CF8C | 0C00 00EF      : cmpi.b  #-$11, D0
            3CF90 | 6604           : bne     $3cf96
            3CF92 | 1C10           : move.b  (A0), D6      // play sound
            3CF94 | 6008           : bra     $3cf9e
            3CF96 | 0C00 00DF      : cmpi.b  #-$21, D0
            3CF9A | 6608           : bne     $3cfa4
            3CF9C | 4206           : clr.b   D6            // stop sound
            3CF9E | 4EB9 0000 E340 : jsr     $e340.l       // send sound code
            3CFA4 | 60B6           : bra     $3cf5c
            -->
        </script>
        <script state="run">
            <output format="----- earth joker 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 %2.2X &gt;&gt;"      line="19" align="center"  >
                <argument>maincpu.pb@100000</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mb@00B6E = 67              </action>
            <action>maincpu.mq@0BBF6 = 41F9001031C4303C</action>
            <action>maincpu.mq@3CF50 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3CF58 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3CF60 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3CF68 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3CF70 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3CF78 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3CF80 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3CF88 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3CF90 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3CF98 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@3CFA0 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

</mamecheat>
Post Reply