Page 1 of 1

[bcruzm12] Battle Cruiser M-12

Posted: Fri Jul 30, 2021 11:29 am
by jman

Code: Select all

<cheat desc="auto fire">
    <script state="on">
        <action>maincpu.mw@3f01 =             5a30</action>
        <action>maincpu.mq@5a30 = aecb8077211157cd</action>
        <action>maincpu.mq@5a38 = ffffffffffffffc9</action>
        <!--
        5a30 | cd 57 11 : call $1157
        5a33 | 21 77 80 : ld   hl,$8077
        5a36 | cb ae    : res  5,(hl)
        5a38 | c9       : ret
        -->
    </script>
    <script state="off">
        <action>maincpu.mw@3f01 =             1157</action>
        <action>maincpu.mq@5a30 = ffffffffffffffff</action>
        <action>maincpu.mq@5a38 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="player speed">
    <parameter min="0x01" max="0x05" step="0x01" />
    <script state="change">
        <action>maincpu.mb@3fea = -param</action> <!-- left -->
        <action>maincpu.mb@3fec =  param</action> <!-- right -->
    </script>
    <script state="off">
        <action>maincpu.mb@3fea = ff</action>
        <action>maincpu.mb@3fec = 01</action>
    </script>
</cheat>

<cheat desc="bullet speed">
    <parameter min="0x01" max="0x08" step="0x01" />
    <script state="change">
        <action>maincpu.mb@20f3 = param</action>
    </script>
    <script state="off">
        <action>maincpu.mb@20f3 = 02</action>
    </script>
</cheat>

<cheat desc="sound test mode">
    <comment>set ram/rom check skip then reset the game (F3)</comment>
    <script state="on">
        <action>maincpu.mw@51de =             5a40</action>
        <action>maincpu.mq@5a40 = 810021800032ff3e</action>
        <action>maincpu.mq@5a48 = 23c877b8a8003a46</action>
        <action>maincpu.mq@5a50 = 20c2fe350120c1fe</action>
        <action>maincpu.mq@5a58 = 187e0320e0fe3401</action>
        <action>maincpu.mq@5a60 = b6cdf23ec0c8fe05</action>
        <action>maincpu.mq@5a68 = ffffffffffffc905</action>
        <!--
        5a40 | 3e ff    : ld   a,$ff
        5a42 | 32 00 80 : ld   ($8000),a
        5a45 | 21 00 81 : ld   hl,$8100
        5a48 | 46       : ld   b,(hl)
        5a49 | 3a 00 a8 : ld   a,($a800) // read input
        5a4c | b8       : cp   b
        5a4d | 77       : ld   (hl),a
        5a4e | c8       : ret  z
        5a4f | 23       : inc  hl
        5a50 | fe c1    : cp   $c1
        5a52 | 20 01    : jr   nz,$5a55
        5a54 | 35       : dec  (hl)      // decrease code
        5a55 | fe c2    : cp   $c2
        5a57 | 20 01    : jr   nz,$5a5a
        5a59 | 34       : inc  (hl)      // increase code
        5a5a | fe e0    : cp   $e0
        5a5c | 20 03    : jr   nz,$5a61
        5a5e | 7e       : ld   a,(hl)    // play sound
        5a5f | 18 05    : jr   $5a66
        5a61 | fe c8    : cp   $c8
        5a63 | c0       : ret  nz
        5a64 | 3e f2    : ld   a,$f2     // stop sound
        5a66 | cd b6 05 : call $05b6
        5a69 | c9       : ret
        -->
    </script>
    <script state="run">
        <output format="----- battle cruiser M-12 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="up : 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@8101</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.mw@51de =             0d48</action>
        <action>maincpu.mq@5a40 = ffffffffffffffff</action>
        <action>maincpu.mq@5a48 = ffffffffffffffff</action>
        <action>maincpu.mq@5a50 = ffffffffffffffff</action>
        <action>maincpu.mq@5a58 = ffffffffffffffff</action>
        <action>maincpu.mq@5a60 = ffffffffffffffff</action>
        <action>maincpu.mq@5a68 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="skip ram/rom check">
    <script state="on">
        <action>maincpu.mw@0006 = 0a7c</action>
    </script>
    <script state="off">
        <action>maincpu.mw@0006 = 0170</action>
    </script>
</cheat>

[bcruzm12] Battle Cruiser M-12 (update)

Posted: Sun Nov 06, 2022 10:13 am
by jman

Code: Select all

<cheat desc="sound test mode">
    <!-- playing code 0x13 causes the game reset -->
    <comment>set &quot;skip ram/rom check&quot; then reset the game (F3)</comment>
    <script state="on">
        <action>maincpu.mb@007b =               00</action> <!-- enable sound in interrupt -->
        <action>maincpu.mw@51de =             5a40</action>
        <action>maincpu.mq@5a40 = 80e6a0003a810121</action>
        <action>maincpu.mq@5a48 = beb02fe6a8003a47</action>
        <action>maincpu.mq@5a50 = 35012001fe2bc877</action>
        <action>maincpu.mq@5a58 = 2004fe34012002fe</action>
        <action>maincpu.mq@5a60 = 2008fe0618f03e04</action>
        <action>maincpu.mq@5a68 = 20fec97786103e05</action>
        <action>maincpu.mq@5a70 = c080fe05187e0320</action>
        <action>maincpu.mq@5a78 = ffffc905b6cdf23e</action>
        <!--
        5a40 | 21 01 81 : ld   hl,$8101  // $8100 = sound code, $8101 = temporary input
        5a43 | 3a 00 a0 : ld   a,($A000) // read start button
        5a46 | e6 80    : and  $80
        5a48 | 47       : ld   b,a
        5a49 | 3a 00 a8 : ld   a,($A800) // read other inputs
        5a4c | e6 2f    : and  $2F
        5a4e | b0       : or   b
        5a4f | be       : cp   (hl)
        5a50 | 77       : ld   (hl),a
        5a51 | c8       : ret  z
        5a52 | 2b       : dec  hl
        5a53 | fe 01    : cp   $01
        5a55 | 20 01    : jr   nz,$5A58
        5a57 | 35       : dec  (hl)      // decrease code -01
        5a58 | fe 02    : cp   $02
        5a5a | 20 01    : jr   nz,$5A5D
        5a5c | 34       : inc  (hl)      // increase code +01
        5a5d | fe 04    : cp   $04
        5a5f | 20 04    : jr   nz,$5A65
        5a61 | 3e f0    : ld   a,$F0     // decrease code -10
        5a63 | 18 06    : jr   $5A6B
        5a65 | fe 08    : cp   $08
        5a67 | 20 05    : jr   nz,$5A6E
        5a69 | 3e 10    : ld   a,$10     // increase code +10
        5a6b | 86       : add  a,(hl)
        5a6c | 77       : ld   (hl),a
        5a6d | c9       : ret
        5a6e | fe 20    : cp   $20
        5a70 | 20 03    : jr   nz,$5A75
        5a72 | 7e       : ld   a,(hl)    // play sound
        5a73 | 18 05    : jr   $5A7A
        5a75 | fe 80    : cp   $80
        5a77 | c0       : ret  nz
        5a78 | 3e f2    : ld   a,$F2     // stop sound
        5a7a | cd b6 05 : call $05B6     // send sound code
        5a7d | c9       : ret
        -->
    </script>
    <script state="run">
        <output format="----- battle cruiser m-12 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="start : 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@8100</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.mb@007b =               69</action>
        <action>maincpu.mw@51de =             0d48</action>
        <action>maincpu.mq@5a40 = ffffffffffffffff</action>
        <action>maincpu.mq@5a48 = ffffffffffffffff</action>
        <action>maincpu.mq@5a50 = ffffffffffffffff</action>
        <action>maincpu.mq@5a58 = ffffffffffffffff</action>
        <action>maincpu.mq@5a60 = ffffffffffffffff</action>
        <action>maincpu.mq@5a68 = ffffffffffffffff</action>
        <action>maincpu.mq@5a70 = ffffffffffffffff</action>
        <action>maincpu.mq@5a78 = ffffffffffffffff</action>
    </script>
</cheat>
"sound test mode" : rewrite routine. add up/down key (code ±10). change sound stop button from up to start.