Page 1 of 1

[alphaxz] Mission 660/The Alphax Z

Posted: Thu Dec 02, 2021 9:28 am
by jman

Code: Select all

<cheat desc="no hit">
    <script state="on">
        <action>maincpu.mw@23b3 =             9740</action>
        <action>maincpu.mq@9740 = 7efd092010fe7ddd</action>
        <action>maincpu.mq@9748 = cdd01dfed817fe01</action>
        <action>maincpu.mq@9750 = ffffffffffc923b9</action>
        <!--
        9740 | dd 7d    : ld   a,ixl
        9742 | fe 10    : cp   $10
        9744 | 20 09    : jr   nz,$974F
        9746 | fd 7e 01 : ld   a,(iy+$01)
        9749 | fe 17    : cp   $17
        974b | d8       : ret  c
        974c | fe 1d    : cp   $1D
        974e | d0       : ret  nc
        974f | cd b9 23 : call $23B9
        9752 | c9       : ret
        -->
    </script>
    <script state="off">
        <action>maincpu.mw@23b3 =             23b9</action>
        <action>maincpu.mq@9740 = ffffffffffffffff</action>
        <action>maincpu.mq@9748 = ffffffffffffffff</action>
        <action>maincpu.mq@9750 = ffffffffffffffff</action>
    </script>
</cheat>

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

<cheat desc="player speed">
    <parameter min="0x01" max="0x08" step="0x01" />
    <script state="change">
        <action>maincpu.mb@206d = -param</action>
        <action>maincpu.mb@2074 = -param</action>
        <action>maincpu.mb@207b = -param</action>
        <action>maincpu.mb@2089 =  param</action>
        <action>maincpu.mb@2090 =  param</action>
        <action>maincpu.mb@2097 =  param</action>
    </script>
    <script state="off">
        <action>maincpu.mb@206d = fe</action>
        <action>maincpu.mb@2074 = ff</action>
        <action>maincpu.mb@207b = ff</action>
        <action>maincpu.mb@2089 = 01</action>
        <action>maincpu.mb@2090 = 01</action>
        <action>maincpu.mb@2097 = 02</action>
    </script>
</cheat>

<cheat desc="bullet speed">
    <parameter>
        <item value="0x01">01 (slow)</item>
        <item value="0x05">02       </item>
        <item value="0x0a">03       </item>
        <item value="0x0f">04       </item>
        <item value="0x14">05 (fast)</item>
    </parameter>
    <script state="change">
        <action>maincpu.mb@2116 =     -param</action> <!-- speed -->
        <action>maincpu.mb@2133 = f0 - param</action> <!-- range -->
    </script>
    <script state="off">
        <action>maincpu.mb@2116 = fb</action>
        <action>maincpu.mb@2133 = f0</action>
    </script>
</cheat>

<cheat desc="move manually">
    <script state="on">
        <action>maincpu.md@1fb6 =         e69760cd</action> <!-- x position -->
        <action>maincpu.md@1fd1 =         e6976ecd</action> <!-- y position -->
        <action>maincpu.mq@9760 = 3ec003e647c4013a</action>
        <action>maincpu.mq@9768 = 013ac9780777dd80</action>
        <action>maincpu.mq@9770 = dd803ec00ce647c4</action>
        <action>maincpu.mq@9778 = ffffffffc9780977</action>
        <!--
        9760 | 3a 01 c4 : ld   a,($C401)  // x position
        9763 | 47       : ld   b,a
        9764 | e6 03    : and  $03
        9766 | c0       : ret  nz
        9767 | 3e 80    : ld   a,$80
        9769 | dd 77 07 : ld   (ix+$07),a
        976c | 78       : ld   a,b
        976d | c9       : ret
        976e | 3a 01 c4 : ld   a,($C401)  // y position
        9771 | 47       : ld   b,a
        9772 | e6 0c    : and  $0C
        9774 | c0       : ret  nz
        9775 | 3e 80    : ld   a,$80
        9777 | dd 77 09 : ld   (ix+$09),a
        977a | 78       : ld   a,b
        977b | c9       : ret
        -->
    </script>
    <script state="off">
        <action>maincpu.md@1fb6 =         e6c4013a</action>
        <action>maincpu.md@1fd1 =         e6c4013a</action>
        <action>maincpu.mq@9760 = ffffffffffffffff</action>
        <action>maincpu.mq@9768 = ffffffffffffffff</action>
        <action>maincpu.mq@9770 = ffffffffffffffff</action>
        <action>maincpu.mq@9778 = 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.mw@0086 =             9780</action>
        <action>maincpu.mq@9780 = 47b8f8003ac10021</action>
        <action>maincpu.mq@9788 = fe35012002fef928</action>
        <action>maincpu.mq@9790 = a0cc10fe34012001</action>
        <action>maincpu.mq@9798 = e31897b8cc20fe97</action>
        <action>maincpu.mq@97a0 = 3808fef403117ef5</action>
        <action>maincpu.mq@97a8 = 1808d6043012fe0c</action>
        <action>maincpu.mq@97b0 = c9f1121b1b6ec603</action>
        <action>maincpu.mq@97b8 = ffffc912f40111af</action>
        <!--
        9780 | 21 00 c1 : ld   hl,$C100  // sound code address
        9783 | 3a 00 f8 : ld   a,($F800) // read input
        9786 | b8       : cp   b
        9787 | 47       : ld   b,a
        9788 | 28 f9    : jr   z,$9783
        978a | fe 02    : cp   $02
        978c | 20 01    : jr   nz,$978F
        978e | 35       : dec  (hl)      // decrease code
        978f | fe 01    : cp   $01
        9791 | 20 01    : jr   nz,$9794
        9793 | 34       : inc  (hl)      // increase code
        9794 | fe 10    : cp   $10
        9796 | cc a0 97 : call z,$97A0   // play sound
        9799 | fe 20    : cp   $20
        979b | cc b8 97 : call z,$97B8   // stop sound
        979e | 18 e3    : jr   $9783
        97a0 | f5       : push af        // sound play routine
        97a1 | 7e       : ld   a,(hl)
        97a2 | 11 03 f4 : ld   de,$F403  // $f402 and $f403 are sfx, $f401 is music
        97a5 | fe 08    : cp   $08
        97a7 | 38 0c    : jr   c,$97B5
        97a9 | fe 12    : cp   $12
        97ab | 30 04    : jr   nc,$97B1
        97ad | d6 08    : sub  $08
        97af | 18 03    : jr   $97B4
        97b1 | c6 6e    : add  a,$6E
        97b3 | 1b       : dec  de
        97b4 | 1b       : dec  de
        97b5 | 12       : ld   (de),a
        97b6 | f1       : pop  af
        97b7 | c9       : ret
        97b8 | af       : xor  a         // soud stop routine
        97b9 | 11 01 f4 : ld   de,$F401
        97bc | 12       : ld   (de),a
        97bd | c9       : ret
        -->
    </script>
    <script state="run">
        <output format="----- alphax z sound test mode -----" line="10" align="center" />
        <output format="left : decrease code"                 line="11" align="center" />
        <output format="right : increase code"                line="12" align="center" />
        <output format="button 1 : play sound"                line="13" align="center" />
        <output format="button 2 : stop sound"                line="14" align="center" />
        <output format="----------------------------"         line="15" align="center" />
        <output format="&lt;&lt; sound code %2.2X &gt;&gt;"   line="17" align="center">
            <argument>maincpu.pb@c100</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.mw@0086 =             02d9</action>
        <action>maincpu.mq@9780 = ffffffffffffffff</action>
        <action>maincpu.mq@9788 = ffffffffffffffff</action>
        <action>maincpu.mq@9790 = ffffffffffffffff</action>
        <action>maincpu.mq@9798 = ffffffffffffffff</action>
        <action>maincpu.mq@97a0 = ffffffffffffffff</action>
        <action>maincpu.mq@97a8 = ffffffffffffffff</action>
        <action>maincpu.mq@97b0 = ffffffffffffffff</action>
        <action>maincpu.mq@97b8 = ffffffffffffffff</action>
    </script>
</cheat>

[alphaxz] Mission 660/The Alphax Z (update)

Posted: Mon Dec 12, 2022 9:19 am
by jman

Code: Select all

<cheat desc="sound test mode">
    <!-- you can't stop sfx (code 0x01 - 0x11) by stop button -->
    <comment>reset the game (F3) to enter sound test mode</comment>
    <script state="on">
        <action>maincpu.mw@0086 =             9780</action>
        <action>maincpu.mq@9780 = 47b8f8003ac10021</action>
        <action>maincpu.mq@9788 = fe35012002fef928</action>
        <action>maincpu.mq@9790 = 042008fe34012001</action>
        <action>maincpu.mq@9798 = 052004fe0618f03e</action>
        <action>maincpu.mq@97a0 = 2010fe787786103e</action>
        <action>maincpu.mq@97a8 = 3808fef403117e16</action>
        <action>maincpu.mq@97b0 = 1808d6043012fe0c</action>
        <action>maincpu.mq@97b8 = fe78121b1b6ec603</action>
        <action>maincpu.mq@97c0 = 18f40132af042020</action>
        <action>maincpu.mq@97c8 = ffffffffffffffba</action>
        <!--
        9780 | 21 00 c1 : ld  hl,$C100  // sound code address
        9783 | 3a 00 f8 : ld  a,($F800) // read input
        9786 | b8       : cp  b
        9787 | 47       : ld  b,a
        9788 | 28 f9    : jr  z,$9783
        978a | fe 02    : cp  $02
        978c | 20 01    : jr  nz,$978F
        978e | 35       : dec (hl)      // decrease code -01
        978f | fe 01    : cp  $01
        9791 | 20 01    : jr  nz,$9794
        9793 | 34       : inc (hl)      // increase code +01
        9794 | fe 08    : cp  $08
        9796 | 20 04    : jr  nz,$979C
        9798 | 3e f0    : ld  a,$F0     // decrease code -10
        979a | 18 06    : jr  $97A2
        979c | fe 04    : cp  $04
        979e | 20 05    : jr  nz,$97A5
        97a0 | 3e 10    : ld  a,$10     // increase code +10
        97a2 | 86       : add a,(hl)
        97a3 | 77       : ld  (hl),a
        97a4 | 78       : ld  a,b
        97a5 | fe 10    : cp  $10
        97a7 | 20 16    : jr  nz,$97BF
        97a9 | 7e       : ld  a,(hl)    // play sound
        97aa | 11 03 f4 : ld  de,$F403  // $f402 and $f403 are sfx, $f401 is music
        97ad | fe 08    : cp  $08
        97af | 38 0c    : jr  c,$97BD
        97b1 | fe 12    : cp  $12
        97b3 | 30 04    : jr  nc,$97B9
        97b5 | d6 08    : sub $08
        97b7 | 18 03    : jr  $97BC
        97b9 | c6 6e    : add a,$6E
        97bb | 1b       : dec de
        97bc | 1b       : dec de
        97bd | 12       : ld  (de),a
        97be | 78       : ld  a,b
        97bf | fe 20    : cp  $20
        97c1 | 20 04    : jr  nz,$97C7
        97c3 | af       : xor a         // stop music
        97c4 | 32 01 f4 : ld  ($F401),a
        97c7 | 18 ba    : jr  $9783
        -->
    </script>
    <script state="run">
        <output format="----- alphax z 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 music"                line="16" align="center" />
        <output format="----------------------------"         line="17" align="center" />
        <output format="&lt;&lt; sound code %2.2X &gt;&gt;"   line="19" align="center"  >
            <argument>maincpu.pb@c100</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.mw@0086 =             02d9</action>
        <action>maincpu.mq@9780 = ffffffffffffffff</action>
        <action>maincpu.mq@9788 = ffffffffffffffff</action>
        <action>maincpu.mq@9790 = ffffffffffffffff</action>
        <action>maincpu.mq@9798 = ffffffffffffffff</action>
        <action>maincpu.mq@97a0 = ffffffffffffffff</action>
        <action>maincpu.mq@97a8 = ffffffffffffffff</action>
        <action>maincpu.mq@97b0 = ffffffffffffffff</action>
        <action>maincpu.mq@97b8 = ffffffffffffffff</action>
        <action>maincpu.mq@97c0 = ffffffffffffffff</action>
        <action>maincpu.mq@97c8 = ffffffffffffffff</action>
    </script>
</cheat>
"sound test mode" : rewrite routine. add up/down key (code ±10).

[m660]+ Mission 660/The Alphax Z

Posted: Thu Feb 15, 2024 11:42 am
by jman
m660.xml

Code: Select all

<!-- Mission 660 (US) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>maincpu.mw@2FBB = 9EF0            </action>
            <action>maincpu.mq@9EF0 = 7EFD092010FE7DDD</action>
            <action>maincpu.mq@9EF8 = CDD01DFED817FE01</action>
            <action>maincpu.mq@9F00 = FFFFFFFFFFC92FC1</action>
            <!--
            9EF0 | DD 7D    : ld   a,ixl
            9EF2 | FE 10    : cp   $10
            9EF4 | 20 09    : jr   nz,$974F
            9EF6 | FD 7E 01 : ld   a,(iy+$01)
            9EF9 | FE 17    : cp   $17
            9EFB | D8       : ret  c
            9EFC | FE 1D    : cp   $1D
            9EFE | D0       : ret  nc
            9EFF | CD C1 2F : call $2FC1
            9F02 | C9       : ret
            -->
        </script>
        <script state="off">
            <action>maincpu.mw@23B3 = 2FC1            </action>
            <action>maincpu.mq@9EF0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9EF8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F00 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

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

    <cheat desc="player speed">
        <parameter>
            <item value="0x01">01 (slow)</item>
            <item value="0x02">02       </item>
            <item value="0x04">03       </item>
            <item value="0x06">04       </item>
            <item value="0x08">05 (fast)</item>
        </parameter>
        <script state="change">
            <action>maincpu.mb@2328 = -param</action>
            <action>maincpu.mb@232F = -param</action>
            <action>maincpu.mb@2336 = -param</action>
            <action>maincpu.mb@2344 =  param</action>
            <action>maincpu.mb@234B =  param</action>
            <action>maincpu.mb@2352 =  param</action>
        </script>
        <script state="off">
            <action>maincpu.mb@2328 = FE</action>
            <action>maincpu.mb@232F = FF</action>
            <action>maincpu.mb@2336 = FF</action>
            <action>maincpu.mb@2344 = 01</action>
            <action>maincpu.mb@234B = 01</action>
            <action>maincpu.mb@2352 = 02</action>
        </script>
    </cheat>

    <cheat desc="bullet speed">
        <parameter>
            <item value="0x01">01 (slow)</item>
            <item value="0x05">02       </item>
            <item value="0x0a">03       </item>
            <item value="0x0f">04       </item>
            <item value="0x14">05 (fast)</item>
        </parameter>
        <script state="change">
            <action>maincpu.mb@23DB =     -param</action> <!-- speed -->
            <action>maincpu.mb@23F8 = F0 - param</action> <!-- range -->
        </script>
        <script state="off">
            <action>maincpu.mb@23DB = FA</action>
            <action>maincpu.mb@23F8 = F0</action>
        </script>
    </cheat>

    <cheat desc="no inertia">
        <script state="on">
            <action>maincpu.md@2270 = E69F10CD        </action> <!-- x position -->
            <action>maincpu.md@228B = E69F1ECD        </action> <!-- y position -->
            <action>maincpu.mq@9F10 = 3EC003E647C4013A</action>
            <action>maincpu.mq@9F18 = 013AC9780777DD80</action>
            <action>maincpu.mq@9F20 = DD803EC00CE647C4</action>
            <action>maincpu.mq@9F28 = FFFFFFFFC9780977</action>
            <!--
            9F10 | 3A 01 C4 : ld   a,($C401)  // x position
            9F13 | 47       : ld   b,a
            9F14 | E6 03    : and  $03
            9F16 | C0       : ret  nz
            9F17 | 3E 80    : ld   a,$80
            9F19 | DD 77 07 : ld   (ix+$07),a
            9F1C | 78       : ld   a,b
            9F1D | C9       : ret
            9F1E | 3A 01 C4 : ld   a,($C401)  // y position
            9F21 | 47       : ld   b,a
            9F22 | E6 0C    : and  $0C
            9F24 | C0       : ret  nz
            9F25 | 3E 80    : ld   a,$80
            9F27 | DD 77 09 : ld   (ix+$09),a
            9F2A | 78       : ld   a,b
            9F2B | C9       : ret
            -->
        </script>
        <script state="off">
            <action>maincpu.md@2270 = E6C4013A        </action>
            <action>maincpu.md@228B = E6C4013A        </action>
            <action>maincpu.mq@9F10 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F18 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F20 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F28 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="sound test mode">
        <!-- you can't stop sfx (code 0x01 - 0x11) by sound stop button -->
        <comment>reset the game (F3) to enter sound test mode</comment>
        <script state="on">
            <action>maincpu.mw@0086 = 9F30            </action>
            <action>maincpu.mq@9F30 = 47B8F8003AC00021</action>
            <action>maincpu.mq@9F38 = FE35012002FEF928</action>
            <action>maincpu.mq@9F40 = 042008FE34012001</action>
            <action>maincpu.mq@9F48 = 052004FE0618F03E</action>
            <action>maincpu.mq@9F50 = 2010FE787786103E</action>
            <action>maincpu.mq@9F58 = 3808FEF403117E16</action>
            <action>maincpu.mq@9F60 = 1808D6043012FE0C</action>
            <action>maincpu.mq@9F68 = FE78121B1B6EC603</action>
            <action>maincpu.mq@9F70 = 18F40132AF042020</action>
            <action>maincpu.mq@9F78 = FFFFFFFFFFFFFFBA</action>
            <!--
            9F30 | 21 00 C0 : ld   hl,$C000  // sound code address
            9F33 | 3A 00 F8 : ld   a,($F800) // read input
            9F36 | B8       : cp   b
            9F37 | 47       : ld   b,a
            9F38 | 28 F9    : jr   z,$9F33
            9F3A | FE 02    : cp   $02
            9F3C | 20 01    : jr   nz,$9F3F
            9F3E | 35       : dec  (hl)      // decrease code -01
            9F3F | FE 01    : cp   $01
            9F41 | 20 01    : jr   nz,$9F44
            9F43 | 34       : inc  (hl)      // increase code +01
            9F44 | FE 08    : cp   $08
            9F46 | 20 04    : jr   nz,$9F4C
            9F48 | 3E F0    : ld   a,$F0     // decrease code -10
            9F4A | 18 06    : jr   $9F52
            9F4C | FE 04    : cp   $04
            9F4E | 20 05    : jr   nz,$9F55
            9F50 | 3E 10    : ld   a,$10     // increase code +10
            9F52 | 86       : add  a,(hl)
            9F53 | 77       : ld   (hl),a
            9F54 | 78       : ld   a,b
            9F55 | FE 10    : cp   $10
            9F57 | 20 16    : jr   nz,$9F6F
            9F59 | 7E       : ld   a,(hl)    // play sound
            9F5A | 11 03 F4 : ld   de,$F403  // $f403 and $f402 are sfx, $f401 is music
            9F5D | FE 08    : cp   $08
            9F5F | 38 0C    : jr   c,$9F6D
            9F61 | FE 12    : cp   $12
            9F63 | 30 04    : jr   nc,$9F69
            9F65 | D6 08    : sub  $08
            9F67 | 18 03    : jr   $9F6C
            9F69 | C6 6E    : add  a,$6E
            9F6B | 1B       : dec  de
            9F6C | 1B       : dec  de
            9F6D | 12       : ld   (de),a
            9F6E | 78       : ld   a,b
            9F6F | FE 20    : cp   $20
            9F71 | 20 04    : jr   nz,$9F77
            9F73 | AF       : xor  a         // stop music
            9F74 | 32 01 F4 : ld   ($F401),a
            9F77 | 18 BA    : jr   $9F33
            -->
        </script>
        <script state="run">
            <output format="----- mission 660 sound test mode -----" line="10" align="center" />
            <output format="left : decrease code -01"                line="11" align="center" />
            <output format="right : increase code +01"               line="12" align="center" />
            <output format="down : decrease code -10"                line="13" align="center" />
            <output format="up : increase code +10"                  line="14" align="center" />
            <output format="button 1 : play sound"                   line="15" align="center" />
            <output format="button 2 : stop sound"                   line="16" align="center" />
            <output format="----------------------------"            line="17" align="center" />
            <output format="&lt;&lt; sound code %02X &gt;&gt;"       line="19" align="center"  >
                <argument>maincpu.pb@C000</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mw@0086 = 01AB            </action>
            <action>maincpu.mq@9F30 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F38 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F40 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F48 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F50 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F58 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F60 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F68 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F70 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F78 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

</mamecheat>
m660j.xml

Code: Select all

<!-- Mission 660 (Japan) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>maincpu.mw@2FB4 = 9EF0            </action>
            <action>maincpu.mq@9EF0 = 7EFD092010FE7DDD</action>
            <action>maincpu.mq@9EF8 = CDD01DFED817FE01</action>
            <action>maincpu.mq@9F00 = FFFFFFFFFFC92FBA</action>
            <!--
            9EF0 | DD 7D    : ld   a,ixl
            9EF2 | FE 10    : cp   $10
            9EF4 | 20 09    : jr   nz,$9EFF
            9EF6 | FD 7E 01 : ld   a,(iy+$01)
            9EF9 | FE 17    : cp   $17
            9EFB | D8       : ret  c
            9EFC | FE 1D    : cp   $1D
            9EFE | D0       : ret  nc
            9EFF | CD BA 2F : call $2FBA
            9F02 | C9       : ret
            -->
        </script>
        <script state="off">
            <action>maincpu.mw@2FB4 = 2FBA            </action>
            <action>maincpu.mq@9EF0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9EF8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F00 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="auto fire">
        <script state="on">
            <action>maincpu.mb@244B = 01</action>
        </script>
        <script state="off">
            <action>maincpu.mb@244B = 14</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter>
            <item value="0x01">01 (slow)</item>
            <item value="0x02">02       </item>
            <item value="0x04">03       </item>
            <item value="0x06">04       </item>
            <item value="0x08">05 (fast)</item>
        </parameter>
        <script state="change">
            <action>maincpu.mb@2321 = -param</action>
            <action>maincpu.mb@2328 = -param</action>
            <action>maincpu.mb@232F = -param</action>
            <action>maincpu.mb@233D =  param</action>
            <action>maincpu.mb@2344 =  param</action>
            <action>maincpu.mb@234B =  param</action>
        </script>
        <script state="off">
            <action>maincpu.mb@2321 = FE</action>
            <action>maincpu.mb@2328 = FF</action>
            <action>maincpu.mb@232F = FF</action>
            <action>maincpu.mb@233D = 01</action>
            <action>maincpu.mb@2344 = 01</action>
            <action>maincpu.mb@234B = 02</action>
        </script>
    </cheat>

    <cheat desc="bullet speed">
        <parameter>
            <item value="0x01">01 (slow)</item>
            <item value="0x05">02       </item>
            <item value="0x0a">03       </item>
            <item value="0x0f">04       </item>
            <item value="0x14">05 (fast)</item>
        </parameter>
        <script state="change">
            <action>maincpu.mb@23D4 =     -param</action> <!-- speed -->
            <action>maincpu.mb@23F1 = F0 - param</action> <!-- range -->
        </script>
        <script state="off">
            <action>maincpu.mb@23D4 = FA</action>
            <action>maincpu.mb@23F1 = F0</action>
        </script>
    </cheat>

    <cheat desc="no inertia">
        <script state="on">
            <action>maincpu.md@2269 = E69F10CD        </action> <!-- x position -->
            <action>maincpu.md@2284 = E69F1ECD        </action> <!-- y position -->
            <action>maincpu.mq@9F10 = 3EC003E647C4013A</action>
            <action>maincpu.mq@9F18 = 013AC9780777DD80</action>
            <action>maincpu.mq@9F20 = DD803EC00CE647C4</action>
            <action>maincpu.mq@9F28 = FFFFFFFFC9780977</action>
            <!--
            9F10 | 3A 01 C4 : ld   a,($C401)  // x position
            9F13 | 47       : ld   b,a
            9F14 | E6 03    : and  $03
            9F16 | C0       : ret  nz
            9F17 | 3E 80    : ld   a,$80
            9F19 | DD 77 07 : ld   (ix+$07),a
            9F1C | 78       : ld   a,b
            9F1D | C9       : ret
            9F1E | 3A 01 C4 : ld   a,($C401)  // y position
            9F21 | 47       : ld   b,a
            9F22 | E6 0C    : and  $0C
            9F24 | C0       : ret  nz
            9F25 | 3E 80    : ld   a,$80
            9F27 | DD 77 09 : ld   (ix+$09),a
            9F2A | 78       : ld   a,b
            9F2B | C9       : ret
            -->
        </script>
        <script state="off">
            <action>maincpu.md@2269 = E6C4013A        </action>
            <action>maincpu.md@2284 = E6C4013A        </action>
            <action>maincpu.mq@9F10 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F18 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F20 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F28 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="sound test mode">
        <!-- you can't stop sfx (code 0x01 - 0x11) by sound stop button -->
        <comment>reset the game (F3) to enter sound test mode</comment>
        <script state="on">
            <action>maincpu.mw@0086 = 9F30            </action>
            <action>maincpu.mq@9F30 = 47B8F8003AC00021</action>
            <action>maincpu.mq@9F38 = FE35012002FEF928</action>
            <action>maincpu.mq@9F40 = 042008FE34012001</action>
            <action>maincpu.mq@9F48 = 052004FE0618F03E</action>
            <action>maincpu.mq@9F50 = 2010FE787786103E</action>
            <action>maincpu.mq@9F58 = 3808FEF403117E16</action>
            <action>maincpu.mq@9F60 = 1808D6043012FE0C</action>
            <action>maincpu.mq@9F68 = FE78121B1B6EC603</action>
            <action>maincpu.mq@9F70 = 18F40132AF042020</action>
            <action>maincpu.mq@9F78 = FFFFFFFFFFFFFFBA</action>
            <!--
            9F30 | 21 00 C0 : ld   hl,$C000  // sound code address
            9F33 | 3A 00 F8 : ld   a,($F800) // read input
            9F36 | B8       : cp   b
            9F37 | 47       : ld   b,a
            9F38 | 28 F9    : jr   z,$9F33
            9F3A | FE 02    : cp   $02
            9F3C | 20 01    : jr   nz,$9F3F
            9F3E | 35       : dec  (hl)      // decrease code -01
            9F3F | FE 01    : cp   $01
            9F41 | 20 01    : jr   nz,$9F44
            9F43 | 34       : inc  (hl)      // increase code +01
            9F44 | FE 08    : cp   $08
            9F46 | 20 04    : jr   nz,$9F4C
            9F48 | 3E F0    : ld   a,$F0     // decrease code -10
            9F4A | 18 06    : jr   $9F52
            9F4C | FE 04    : cp   $04
            9F4E | 20 05    : jr   nz,$9F55
            9F50 | 3E 10    : ld   a,$10     // increase code +10
            9F52 | 86       : add  a,(hl)
            9F53 | 77       : ld   (hl),a
            9F54 | 78       : ld   a,b
            9F55 | FE 10    : cp   $10
            9F57 | 20 16    : jr   nz,$9F6F
            9F59 | 7E       : ld   a,(hl)    // play sound
            9F5A | 11 03 F4 : ld   de,$F403  // $f403 and $f402 are sfx, $f401 is music
            9F5D | FE 08    : cp   $08
            9F5F | 38 0C    : jr   c,$9F6D
            9F61 | FE 12    : cp   $12
            9F63 | 30 04    : jr   nc,$9F69
            9F65 | D6 08    : sub  $08
            9F67 | 18 03    : jr   $9F6C
            9F69 | C6 6E    : add  a,$6E
            9F6B | 1B       : dec  de
            9F6C | 1B       : dec  de
            9F6D | 12       : ld   (de),a
            9F6E | 78       : ld   a,b
            9F6F | FE 20    : cp   $20
            9F71 | 20 04    : jr   nz,$9F77
            9F73 | AF       : xor  a         // stop music
            9F74 | 32 01 F4 : ld   ($F401),a
            9F77 | 18 BA    : jr   $9F33
            -->
        </script>
        <script state="run">
            <output format="----- mission 660 sound test mode -----" line="10" align="center" />
            <output format="left : decrease code -01"                line="11" align="center" />
            <output format="right : increase code +01"               line="12" align="center" />
            <output format="down : decrease code -10"                line="13" align="center" />
            <output format="up : increase code +10"                  line="14" align="center" />
            <output format="button 1 : play sound"                   line="15" align="center" />
            <output format="button 2 : stop sound"                   line="16" align="center" />
            <output format="----------------------------"            line="17" align="center" />
            <output format="&lt;&lt; sound code %02X &gt;&gt;"       line="19" align="center"  >
                <argument>maincpu.pb@C000</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mw@0086 = 01AB            </action>
            <action>maincpu.mq@9F30 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F38 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F40 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F48 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F50 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F58 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F60 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F68 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F70 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F78 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

</mamecheat>
m660b.xml

Code: Select all

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

    <cheat desc="no hit">
        <script state="on">
            <action>maincpu.mw@2FB4 = 9EF0            </action>
            <action>maincpu.mq@9EF0 = 7EFD092010FE7DDD</action>
            <action>maincpu.mq@9EF8 = CDD01DFED817FE01</action>
            <action>maincpu.mq@9F00 = FFFFFFFFFFC92FBA</action>
            <!--
            9EF0 | DD 7D    : ld   a,ixl
            9EF2 | FE 10    : cp   $10
            9EF4 | 20 09    : jr   nz,$9EFF
            9EF6 | FD 7E 01 : ld   a,(iy+$01)
            9EF9 | FE 17    : cp   $17
            9EFB | D8       : ret  c
            9EFC | FE 1D    : cp   $1D
            9EFE | D0       : ret  nc
            9EFF | CD BA 2F : call $2FBA
            9F02 | C9       : ret
            -->
        </script>
        <script state="off">
            <action>maincpu.mw@2FB4 = 2FBA            </action>
            <action>maincpu.mq@9EF0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9EF8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F00 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="auto fire">
        <script state="on">
            <action>maincpu.mb@244B = 01</action>
        </script>
        <script state="off">
            <action>maincpu.mb@244B = 14</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter>
            <item value="0x01">01 (slow)</item>
            <item value="0x02">02       </item>
            <item value="0x04">03       </item>
            <item value="0x06">04       </item>
            <item value="0x08">05 (fast)</item>
        </parameter>
        <script state="change">
            <action>maincpu.mb@2321 = -param</action>
            <action>maincpu.mb@2328 = -param</action>
            <action>maincpu.mb@232F = -param</action>
            <action>maincpu.mb@233D =  param</action>
            <action>maincpu.mb@2344 =  param</action>
            <action>maincpu.mb@234B =  param</action>
        </script>
        <script state="off">
            <action>maincpu.mb@2321 = FE</action>
            <action>maincpu.mb@2328 = FF</action>
            <action>maincpu.mb@232F = FF</action>
            <action>maincpu.mb@233D = 01</action>
            <action>maincpu.mb@2344 = 01</action>
            <action>maincpu.mb@234B = 02</action>
        </script>
    </cheat>

    <cheat desc="bullet speed">
        <parameter>
            <item value="0x01">01 (slow)</item>
            <item value="0x05">02       </item>
            <item value="0x0a">03       </item>
            <item value="0x0f">04       </item>
            <item value="0x14">05 (fast)</item>
        </parameter>
        <script state="change">
            <action>maincpu.mb@23D4 =     -param</action> <!-- speed -->
            <action>maincpu.mb@23F1 = F0 - param</action> <!-- range -->
        </script>
        <script state="off">
            <action>maincpu.mb@23D4 = FA</action>
            <action>maincpu.mb@23F1 = F0</action>
        </script>
    </cheat>

    <cheat desc="no inertia">
        <script state="on">
            <action>maincpu.md@2269 = E69F10CD        </action> <!-- x position -->
            <action>maincpu.md@2284 = E69F1ECD        </action> <!-- y position -->
            <action>maincpu.mq@9F10 = 3EC003E647C4013A</action>
            <action>maincpu.mq@9F18 = 013AC9780777DD80</action>
            <action>maincpu.mq@9F20 = DD803EC00CE647C4</action>
            <action>maincpu.mq@9F28 = FFFFFFFFC9780977</action>
            <!--
            9F10 | 3A 01 C4 : ld   a,($C401)  // x position
            9F13 | 47       : ld   b,a
            9F14 | E6 03    : and  $03
            9F16 | C0       : ret  nz
            9F17 | 3E 80    : ld   a,$80
            9F19 | DD 77 07 : ld   (ix+$07),a
            9F1C | 78       : ld   a,b
            9F1D | C9       : ret
            9F1E | 3A 01 C4 : ld   a,($C401)  // y position
            9F21 | 47       : ld   b,a
            9F22 | E6 0C    : and  $0C
            9F24 | C0       : ret  nz
            9F25 | 3E 80    : ld   a,$80
            9F27 | DD 77 09 : ld   (ix+$09),a
            9F2A | 78       : ld   a,b
            9F2B | C9       : ret
            -->
        </script>
        <script state="off">
            <action>maincpu.md@2269 = E6C4013A        </action>
            <action>maincpu.md@2284 = E6C4013A        </action>
            <action>maincpu.mq@9F10 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F18 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F20 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F28 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="sound test mode">
        <!-- you can't stop sfx (code 0x01 - 0x11) by sound stop button -->
        <comment>reset the game (F3) to enter sound test mode</comment>
        <script state="on">
            <action>maincpu.mw@0086 = 9EF0            </action>
            <action>maincpu.mq@9EF0 = 47B8F8003AC00021</action>
            <action>maincpu.mq@9EF8 = FE35012002FEF928</action>
            <action>maincpu.mq@9F00 = 042008FE34012001</action>
            <action>maincpu.mq@9F08 = 052004FE0618F03E</action>
            <action>maincpu.mq@9F10 = 2010FE787786103E</action>
            <action>maincpu.mq@9F18 = 3808FEF403117E16</action>
            <action>maincpu.mq@9F20 = 1808D6043012FE0C</action>
            <action>maincpu.mq@9F28 = FE78121B1B6EC603</action>
            <action>maincpu.mq@9F30 = 18F40132AF042020</action>
            <action>maincpu.mq@9F38 = FFFFFFFFFFFFFFBA</action>
            <!--
            9EF0 | 21 00 C0 : ld   hl,$C000  // sound code address
            9EF3 | 3A 00 F8 : ld   a,($F800) // read input
            9EF6 | B8       : cp   b
            9EF7 | 47       : ld   b,a
            9EF8 | 28 F9    : jr   z,$9EF3
            9EFA | FE 02    : cp   $02
            9EFC | 20 01    : jr   nz,$9EFF
            9EFE | 35       : dec  (hl)      // decrease code -01
            9EFF | FE 01    : cp   $01
            9F01 | 20 01    : jr   nz,$9F04
            9F03 | 34       : inc  (hl)      // increase code +01
            9F04 | FE 08    : cp   $08
            9F06 | 20 04    : jr   nz,$9F0C
            9F08 | 3E F0    : ld   a,$F0     // decrease code -10
            9F0A | 18 06    : jr   $9F12
            9F0C | FE 04    : cp   $04
            9F0E | 20 05    : jr   nz,$9F15
            9F10 | 3E 10    : ld   a,$10     // increase code +10
            9F12 | 86       : add  a,(hl)
            9F13 | 77       : ld   (hl),a
            9F14 | 78       : ld   a,b
            9F15 | FE 10    : cp   $10
            9F17 | 20 16    : jr   nz,$9F2F
            9F19 | 7E       : ld   a,(hl)    // play sound
            9F1A | 11 03 F4 : ld   de,$F403  // $f403 and $f402 are sfx, $f401 is music
            9F1D | FE 08    : cp   $08
            9F1F | 38 0C    : jr   c,$9F2D
            9F21 | FE 12    : cp   $12
            9F23 | 30 04    : jr   nc,$9F29
            9F25 | D6 08    : sub  $08
            9F27 | 18 03    : jr   $9F2C
            9F29 | C6 6E    : add  a,$6E
            9F2B | 1B       : dec  de
            9F2C | 1B       : dec  de
            9F2D | 12       : ld   (de),a
            9F2E | 78       : ld   a,b
            9F2F | FE 20    : cp   $20
            9F31 | 20 04    : jr   nz,$9F37
            9F33 | AF       : xor  a         // stop music
            9F34 | 32 01 F4 : ld   ($F401),a
            9F37 | 18 BA    : jr   $9EF3
            -->
        </script>
        <script state="run">
            <output format="----- mission 660 sound test mode -----" line="10" align="center" />
            <output format="left : decrease code -01"                line="11" align="center" />
            <output format="right : increase code +01"               line="12" align="center" />
            <output format="down : decrease code -10"                line="13" align="center" />
            <output format="up : increase code +10"                  line="14" align="center" />
            <output format="button 1 : play sound"                   line="15" align="center" />
            <output format="button 2 : stop sound"                   line="16" align="center" />
            <output format="----------------------------"            line="17" align="center" />
            <output format="&lt;&lt; sound code %02X &gt;&gt;"       line="19" align="center"  >
                <argument>maincpu.pb@C000</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mw@0086 = 01AB            </action>
            <action>maincpu.mq@9EF0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9EF8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F00 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F08 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F10 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F18 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F20 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F28 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F30 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9F38 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

</mamecheat>
alphaxz.xml

Code: Select all

<!-- The Alphax Z (Japan) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>maincpu.mw@23B3 = 9740            </action>
            <action>maincpu.mq@9740 = 7EFD092010FE7DDD</action>
            <action>maincpu.mq@9748 = CDD01DFED817FE01</action>
            <action>maincpu.mq@9750 = FFFFFFFFFFC923B9</action>
            <!--
            9740 | DD 7D    : ld   a,ixl
            9742 | FE 10    : cp   $10
            9744 | 20 09    : jr   nz,$974F
            9746 | FD 7E 01 : ld   a,(iy+$01)
            9749 | FE 17    : cp   $17
            974B | D8       : ret  c
            974C | FE 1D    : cp   $1D
            974E | D0       : ret  nc
            974F | CD B9 23 : call $23B9
            9752 | C9       : ret
            -->
        </script>
        <script state="off">
            <action>maincpu.mw@23B3 = 23B9            </action>
            <action>maincpu.mq@9740 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9748 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9750 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

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

    <cheat desc="player speed">
        <parameter>
            <item value="0x01">01 (slow)</item>
            <item value="0x02">02       </item>
            <item value="0x04">03       </item>
            <item value="0x06">04       </item>
            <item value="0x08">05 (fast)</item>
        </parameter>
        <script state="change">
            <action>maincpu.mb@206D = -param</action>
            <action>maincpu.mb@2074 = -param</action>
            <action>maincpu.mb@207B = -param</action>
            <action>maincpu.mb@2089 =  param</action>
            <action>maincpu.mb@2090 =  param</action>
            <action>maincpu.mb@2097 =  param</action>
        </script>
        <script state="off">
            <action>maincpu.mb@206D = FE</action>
            <action>maincpu.mb@2074 = FF</action>
            <action>maincpu.mb@207B = FF</action>
            <action>maincpu.mb@2089 = 01</action>
            <action>maincpu.mb@2090 = 01</action>
            <action>maincpu.mb@2097 = 02</action>
        </script>
    </cheat>

    <cheat desc="bullet speed">
        <parameter>
            <item value="0x01">01 (slow)</item>
            <item value="0x05">02       </item>
            <item value="0x0a">03       </item>
            <item value="0x0f">04       </item>
            <item value="0x14">05 (fast)</item>
        </parameter>
        <script state="change">
            <action>maincpu.mb@2116 =     -param</action> <!-- speed -->
            <action>maincpu.mb@2133 = F0 - param</action> <!-- range -->
        </script>
        <script state="off">
            <action>maincpu.mb@2116 = FB</action>
            <action>maincpu.mb@2133 = F0</action>
        </script>
    </cheat>

    <cheat desc="no inertia">
        <script state="on">
            <action>maincpu.md@1FB6 = E69760CD        </action> <!-- x position -->
            <action>maincpu.md@1FD1 = E6976ECD        </action> <!-- y position -->
            <action>maincpu.mq@9760 = 3EC003E647C4013A</action>
            <action>maincpu.mq@9768 = 013AC9780777DD80</action>
            <action>maincpu.mq@9770 = DD803EC00CE647C4</action>
            <action>maincpu.mq@9778 = FFFFFFFFC9780977</action>
            <!--
            9760 | 3A 01 C4 : ld   a,($C401)  // x position
            9763 | 47       : ld   b,a
            9764 | E6 03    : and  $03
            9766 | C0       : ret  nz
            9767 | 3E 80    : ld   a,$80
            9769 | DD 77 07 : ld   (ix+$07),a
            976C | 78       : ld   a,b
            976D | C9       : ret
            976E | 3A 01 C4 : ld   a,($C401)  // y position
            9771 | 47       : ld   b,a
            9772 | E6 0C    : and  $0C
            9774 | C0       : ret  nz
            9775 | 3E 80    : ld   a,$80
            9777 | DD 77 09 : ld   (ix+$09),a
            977A | 78       : ld   a,b
            977B | C9       : ret
            -->
        </script>
        <script state="off">
            <action>maincpu.md@1FB6 = E6C4013A        </action>
            <action>maincpu.md@1FD1 = E6C4013A        </action>
            <action>maincpu.mq@9760 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9768 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9770 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9778 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="sound test mode">
        <!-- you can't stop sfx (code 0x01 - 0x11) by sound stop button -->
        <comment>reset the game (F3) to enter sound test mode</comment>
        <script state="on">
            <action>maincpu.mw@0086 = 9780            </action>
            <action>maincpu.mq@9780 = 47B8F8003AC00021</action>
            <action>maincpu.mq@9788 = FE35012002FEF928</action>
            <action>maincpu.mq@9790 = 042008FE34012001</action>
            <action>maincpu.mq@9798 = 052004FE0618F03E</action>
            <action>maincpu.mq@97A0 = 2010FE787786103E</action>
            <action>maincpu.mq@97A8 = 3808FEF403117E16</action>
            <action>maincpu.mq@97B0 = 1808D6043012FE0C</action>
            <action>maincpu.mq@97B8 = FE78121B1B6EC603</action>
            <action>maincpu.mq@97C0 = 18F40132AF042020</action>
            <action>maincpu.mq@97C8 = FFFFFFFFFFFFFFBA</action>
            <!--
            9780 | 21 00 C0 : ld   hl,$C000  // sound code address
            9783 | 3A 00 F8 : ld   a,($F800) // read input
            9786 | B8       : cp   b
            9787 | 47       : ld   b,a
            9788 | 28 F9    : jr   z,$9783
            978A | FE 02    : cp   $02
            978C | 20 01    : jr   nz,$978F
            978E | 35       : dec  (hl)      // decrease code -01
            978F | FE 01    : cp   $01
            9791 | 20 01    : jr   nz,$9794
            9793 | 34       : inc  (hl)      // increase code +01
            9794 | FE 08    : cp   $08
            9796 | 20 04    : jr   nz,$979C
            9798 | 3E F0    : ld   a,$F0     // decrease code -10
            979A | 18 06    : jr   $97A2
            979C | FE 04    : cp   $04
            979E | 20 05    : jr   nz,$97A5
            97A0 | 3E 10    : ld   a,$10     // increase code +10
            97A2 | 86       : add  a,(hl)
            97A3 | 77       : ld   (hl),a
            97A4 | 78       : ld   a,b
            97A5 | FE 10    : cp   $10
            97A7 | 20 16    : jr   nz,$97BF
            97A9 | 7E       : ld   a,(hl)    // play sound
            97AA | 11 03 F4 : ld   de,$F403  // $f403 and $f402 are sfx, $f401 is music
            97AD | FE 08    : cp   $08
            97AF | 38 0C    : jr   c,$97BD
            97B1 | FE 12    : cp   $12
            97B3 | 30 04    : jr   nc,$97B9
            97B5 | D6 08    : sub  $08
            97B7 | 18 03    : jr   $97BC
            97B9 | C6 6E    : add  a,$6E
            97BB | 1B       : dec  de
            97BC | 1B       : dec  de
            97BD | 12       : ld   (de),a
            97BE | 78       : ld   a,b
            97BF | FE 20    : cp   $20
            97C1 | 20 04    : jr   nz,$97C7
            97C3 | AF       : xor  a         // stop music
            97C4 | 32 01 F4 : ld   ($F401),a
            97C7 | 18 BA    : jr   $9783
            -->
        </script>
        <script state="run">
            <output format="----- the alphax z sound test mode -----" line="10" align="center" />
            <output format="left : decrease code -01"                 line="11" align="center" />
            <output format="right : increase code +01"                line="12" align="center" />
            <output format="down : decrease code -10"                 line="13" align="center" />
            <output format="up : increase code +10"                   line="14" align="center" />
            <output format="button 1 : play sound"                    line="15" align="center" />
            <output format="button 2 : stop sound"                    line="16" align="center" />
            <output format="----------------------------"             line="17" align="center" />
            <output format="&lt;&lt; sound code %02X &gt;&gt;"        line="19" align="center"  >
                <argument>maincpu.pb@C000</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mw@0086 = 02D9            </action>
            <action>maincpu.mq@9780 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9788 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9790 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@9798 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@97A0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@97A8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@97B0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@97B8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@97C0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@97C8 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

</mamecheat>
the26thz.xml

Code: Select all

<!-- The 26th Z (Japan, location test) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>maincpu.mw@239C = 8C00            </action>
            <action>maincpu.mq@8C00 = 7EFD092010FE7DDD</action>
            <action>maincpu.mq@8C08 = CDD01DFED817FE01</action>
            <action>maincpu.mq@8C10 = FFFFFFFFFFC923A2</action>
            <!--
            8C00 | DD 7D    : ld   a,ixl
            8C02 | FE 10    : cp   $10
            8C04 | 20 09    : jr   nz,$8C0F
            8C06 | FD 7E 01 : ld   a,(iy+$01)
            8C09 | FE 17    : cp   $17
            8C0B | D8       : ret  c
            8C0C | FE 1D    : cp   $1D
            8C0E | D0       : ret  nc
            8C0F | CD A2 23 : call $23A2
            8C12 | C9       : ret
            -->
        </script>
        <script state="off">
            <action>maincpu.mw@239C = 23A2            </action>
            <action>maincpu.mq@8C00 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@8C08 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@8C10 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

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

    <cheat desc="player speed">
        <parameter>
            <item value="0x01">01 (slow)</item>
            <item value="0x02">02       </item>
            <item value="0x04">03       </item>
            <item value="0x06">04       </item>
            <item value="0x08">05 (fast)</item>
        </parameter>
        <script state="change">
            <action>maincpu.mb@2056 = -param</action>
            <action>maincpu.mb@205D = -param</action>
            <action>maincpu.mb@2064 = -param</action>
            <action>maincpu.mb@2072 =  param</action>
            <action>maincpu.mb@2079 =  param</action>
            <action>maincpu.mb@2080 =  param</action>
        </script>
        <script state="off">
            <action>maincpu.mb@2056 = FE</action>
            <action>maincpu.mb@205D = FF</action>
            <action>maincpu.mb@2064 = FF</action>
            <action>maincpu.mb@2072 = 01</action>
            <action>maincpu.mb@2079 = 01</action>
            <action>maincpu.mb@2080 = 02</action>
        </script>
    </cheat>

    <cheat desc="bullet speed">
        <parameter>
            <item value="0x01">01 (slow)</item>
            <item value="0x05">02       </item>
            <item value="0x0a">03       </item>
            <item value="0x0f">04       </item>
            <item value="0x14">05 (fast)</item>
        </parameter>
        <script state="change">
            <action>maincpu.mb@20FF =     -param</action> <!-- speed -->
            <action>maincpu.mb@211C = F0 - param</action> <!-- range -->
        </script>
        <script state="off">
            <action>maincpu.mb@20FF = FB</action>
            <action>maincpu.mb@211C = F0</action>
        </script>
    </cheat>

    <cheat desc="no inertia">
        <script state="on">
            <action>maincpu.md@1F9F = E68C20CD        </action> <!-- x position -->
            <action>maincpu.md@1FBA = E68C2ECD        </action> <!-- y position -->
            <action>maincpu.mq@8C20 = 3EC003E647C4013A</action>
            <action>maincpu.mq@8C28 = 013AC9780777DD80</action>
            <action>maincpu.mq@8C30 = DD803EC00CE647C4</action>
            <action>maincpu.mq@8C38 = FFFFFFFFC9780977</action>
            <!--
            8C20 | 3A 01 C4 : ld   a,($C401)  // x position
            8C23 | 47       : ld   b,a
            8C24 | E6 03    : and  $03
            8C26 | C0       : ret  nz
            8C27 | 3E 80    : ld   a,$80
            8C29 | DD 77 07 : ld   (ix+$07),a
            8C2C | 78       : ld   a,b
            8C2D | C9       : ret
            8C2E | 3A 01 C4 : ld   a,($C401)  // y position
            8C31 | 47       : ld   b,a
            8C32 | E6 0C    : and  $0C
            8C34 | C0       : ret  nz
            8C35 | 3E 80    : ld   a,$80
            8C37 | DD 77 09 : ld   (ix+$09),a
            8C3A | 78       : ld   a,b
            8C3B | C9       : ret
            -->
        </script>
        <script state="off">
            <action>maincpu.md@1F9F = E6C4013A        </action>
            <action>maincpu.md@1FBA = E6C4013A        </action>
            <action>maincpu.mq@8C20 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@8C28 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@8C30 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@8C38 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="sound test mode">
        <!-- you can't stop sfx (code 0x01 - 0x11) by sound stop button -->
        <comment>reset the game (F3) to enter sound test mode</comment>
        <script state="on">
            <action>maincpu.mw@0086 = 8C40            </action>
            <action>maincpu.mq@8C40 = 47B8F8003AC00021</action>
            <action>maincpu.mq@8C48 = FE35012002FEF928</action>
            <action>maincpu.mq@8C50 = 042008FE34012001</action>
            <action>maincpu.mq@8C58 = 052004FE0618F03E</action>
            <action>maincpu.mq@8C60 = 2010FE787786103E</action>
            <action>maincpu.mq@8C68 = 3808FEF403117E16</action>
            <action>maincpu.mq@8C70 = 1808D6043012FE0C</action>
            <action>maincpu.mq@8C78 = FE78121B1B6EC603</action>
            <action>maincpu.mq@8C80 = 18F40132AF042020</action>
            <action>maincpu.mq@8C88 = FFFFFFFFFFFFFFBA</action>
            <!--
            8C40 | 21 00 C0 : ld   hl,$C000  // sound code address
            8C43 | 3A 00 F8 : ld   a,($F800) // read input
            8C46 | B8       : cp   b
            8C47 | 47       : ld   b,a
            8C48 | 28 F9    : jr   z,$8C43
            8C4A | FE 02    : cp   $02
            8C4C | 20 01    : jr   nz,$8C4F
            8C4E | 35       : dec  (hl)      // decrease code -01
            8C4F | FE 01    : cp   $01
            8C51 | 20 01    : jr   nz,$8C54
            8C53 | 34       : inc  (hl)      // increase code +01
            8C54 | FE 08    : cp   $08
            8C56 | 20 04    : jr   nz,$8C5C
            8C58 | 3E F0    : ld   a,$F0     // decrease code -10
            8C5A | 18 06    : jr   $8C62
            8C5C | FE 04    : cp   $04
            8C5E | 20 05    : jr   nz,$8C65
            8C60 | 3E 10    : ld   a,$10     // increase code +10
            8C62 | 86       : add  a,(hl)
            8C63 | 77       : ld   (hl),a
            8C64 | 78       : ld   a,b
            8C65 | FE 10    : cp   $10
            8C67 | 20 16    : jr   nz,$8C7F
            8C69 | 7E       : ld   a,(hl)    // play sound
            8C6A | 11 03 F4 : ld   de,$F403  // $f403 and $f402 are sfx, $f401 is music
            8C6D | FE 08    : cp   $08
            8C6F | 38 0C    : jr   c,$8C7D
            8C71 | FE 12    : cp   $12
            8C73 | 30 04    : jr   nc,$8C79
            8C75 | D6 08    : sub  $08
            8C77 | 18 03    : jr   $8C7C
            8C79 | C6 6E    : add  a,$6E
            8C7B | 1B       : dec  de
            8C7C | 1B       : dec  de
            8C7D | 12       : ld   (de),a
            8C7E | 78       : ld   a,b
            8C7F | FE 20    : cp   $20
            8C81 | 20 04    : jr   nz,$8C87
            8C83 | AF       : xor  a         // stop music
            8C84 | 32 01 F4 : ld   ($F401),a
            8C87 | 18 BA    : jr   $8C43
            -->
        </script>
        <script state="run">
            <output format="----- the 26th z sound test mode -----" line="10" align="center" />
            <output format="left : decrease code -01"               line="11" align="center" />
            <output format="right : increase code +01"              line="12" align="center" />
            <output format="down : decrease code -10"               line="13" align="center" />
            <output format="up : increase code +10"                 line="14" align="center" />
            <output format="button 1 : play sound"                  line="15" align="center" />
            <output format="button 2 : stop sound"                  line="16" align="center" />
            <output format="----------------------------"           line="17" align="center" />
            <output format="&lt;&lt; sound code %02X &gt;&gt;"      line="19" align="center"  >
                <argument>maincpu.pb@C000</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mw@0086 = 02DC            </action>
            <action>maincpu.mq@8C40 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@8C48 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@8C50 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@8C58 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@8C60 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@8C68 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@8C70 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@8C78 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@8C80 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@8C88 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

</mamecheat>