Page 1 of 1

[headonch] Head On Channel

Posted: Wed Sep 29, 2021 9:24 am
by jman
headonch is added in 0.236.

Code: Select all

<cheat desc="no hit">
    <script state="on">
        <action>maincpu.mw@102e2 = 0002</action> <!-- enemy -->
        <action>maincpu.mw@11340 = 6000</action> <!-- bullet -->
    </script>
    <script state="off">
        <action>maincpu.mw@102e2 = 0296</action>
        <action>maincpu.mw@11340 = 6600</action>
    </script>
</cheat>

<cheat desc="player speed">
    <parameter>
        <item value="0x0080">01 (slow)</item>
        <item value="0x0180">02       </item>
        <item value="0x0280">03       </item>
        <item value="0x0380">04       </item>
        <item value="0x0480">05 (fast)</item>
    </parameter>
    <script state="on">
        <action>maincpu.mq@10664 = 4eb90001e2504e71</action>
        <action>maincpu.mq@1e250 = 303c00004a436706</action>
        <action>maincpu.mq@1e258 = 6a0244403600303c</action>
        <action>maincpu.mq@1e260 = 00004a4467066a02</action>
        <action>maincpu.mq@1e268 = 444038003d430020</action>
        <action>maincpu.mq@1e270 = 3d4400224e75ffff</action>
        <!--
        1e250 | 303c xxxx : move.w #$xxxx,D0   // x position
        1e254 | 4a43      : tst.w  D3
        1e256 | 6706      : beq    $1e25e
        1e258 | 6a02      : bpl    $1e25c
        1e25a | 4440      : neg.w  D0
        1e25c | 3600      : move.w D0,D3
        1e25e | 303c xxxx : move.w #$xxxx,D0   // y position
        1e262 | 4a44      : tst.w  D4
        1e264 | 6706      : beq    $1e26c
        1e266 | 6a02      : bpl    $1e26a
        1e268 | 4440      : neg.w  D0
        1e26a | 3800      : move.w D0,D4
        1e26c | 3d43 0020 : move.w D3,($20,A6)
        1e270 | 3d44 0022 : move.w D4,($22,A6)
        1e274 | 4e75      : rts
        -->
    </script>
    <script state="change">
        <action>maincpu.mw@1e252 = param</action>
        <action>maincpu.mw@1e260 = param</action>
    </script>
    <script state="off">
        <action>maincpu.mq@10664 = 3d4300203d440022</action>
        <action>maincpu.mq@1e250 = ffffffffffffffff</action>
        <action>maincpu.mq@1e258 = ffffffffffffffff</action>
        <action>maincpu.mq@1e260 = ffffffffffffffff</action>
        <action>maincpu.mq@1e268 = ffffffffffffffff</action>
        <action>maincpu.mq@1e270 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="enemy speed">
    <parameter>
        <item value="0x0080">01 (slow)</item>
        <item value="0x0180">02       </item>
        <item value="0x0280">03       </item>
        <item value="0x0380">04       </item>
        <item value="0x0480">05 (fast)</item>
    </parameter>
    <script state="on">
        <action>maincpu.mq@0da64 = 4eb90001e2804e71</action>
        <action>maincpu.mq@1e280 = 303c00004a436706</action>
        <action>maincpu.mq@1e288 = 6a0244403600303c</action>
        <action>maincpu.mq@1e290 = 00004a4467066a02</action>
        <action>maincpu.mq@1e298 = 444038003d430020</action>
        <action>maincpu.mq@1e2a0 = 3d4400224e75ffff</action>
        <!--
        1e280 | 303c xxxx : move.w #$xxxx,D0   // x position
        1e284 | 4a43      : tst.w  D3
        1e286 | 6706      : beq    $1e28e
        1e288 | 6a02      : bpl    $1e28c
        1e28a | 4440      : neg.w  D0
        1e28c | 3600      : move.w D0,D3
        1e28e | 303c xxxx : move.w #$xxxx,D0   // y position
        1e292 | 4a44      : tst.w  D4
        1e294 | 6706      : beq    $1e29c
        1e296 | 6a02      : bpl    $1e29a
        1e298 | 4440      : neg.w  D0
        1e29a | 3800      : move.w D0,D4
        1e29c | 3d43 0020 : move.w D3,($20,A6)
        1e2a0 | 3d44 0022 : move.w D4,($22,A6)
        1e2a4 | 4e75      : rts
        -->
    </script>
    <script state="change">
        <action>maincpu.mw@1e282 = param</action>
        <action>maincpu.mw@1e290 = param</action>
    </script>
    <script state="off">
        <action>maincpu.mq@0da64 = 3d4300203d440022</action>
        <action>maincpu.mq@1e280 = ffffffffffffffff</action>
        <action>maincpu.mq@1e288 = ffffffffffffffff</action>
        <action>maincpu.mq@1e290 = ffffffffffffffff</action>
        <action>maincpu.mq@1e298 = ffffffffffffffff</action>
        <action>maincpu.mq@1e2a0 = 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.md@00324 =         0001e2b0</action>
        <action>maincpu.mq@1e2b0 = 41f8900010bc0080</action>
        <action>maincpu.mq@1e2b8 = 1200103900840001</action>
        <action>maincpu.mq@1e2c0 = b20067f40c00007f</action>
        <action>maincpu.mq@1e2c8 = 660253100c0000bf</action>
        <action>maincpu.mq@1e2d0 = 660252100c0000fe</action>
        <action>maincpu.mq@1e2d8 = 66041e10600a0c00</action>
        <action>maincpu.mq@1e2e0 = 00df660a1e3c009f</action>
        <action>maincpu.mq@1e2e8 = 4eb90000421c60c8</action>
        <!--
        1e2b0 | 41f8 9000      : lea    $9000.w,A0   // sound code address
        1e2b4 | 10bc 0080      : move.b #$80,(A0)    // intialize sound code
        1e2b8 | 1200           : move.b D0,D1
        1e2ba | 1039 0084 0001 : move.b $840001.l,D0 // read input
        1e2c0 | b200           : cmp.b  D0,D1
        1e2c2 | 67f4           : beq    $1e2b8
        1e2c4 | 0c00 007f      : cmpi.b #$7f,D0
        1e2c8 | 6602           : bne    $1e2cc
        1e2ca | 5310           : subq.b #1,(A0)      // decrease code
        1e2cc | 0c00 00bf      : cmpi.b #-$41,D0
        1e2d0 | 6602           : bne    $1e2d4
        1e2d2 | 5210           : addq.b #1,(A0)      // increase code
        1e2d4 | 0c00 00fe      : cmpi.b #-$2,D0
        1e2d8 | 6604           : bne    $1e2de
        1e2da | 1e10           : move.b (A0),D7      // play sound
        1e2dc | 600a           : bra    $1e2e8
        1e2de | 0c00 00df      : cmpi.b #-$21,D0
        1e2e2 | 660a           : bne    $1e2ee
        1e2e4 | 1e3c 009f      : move.b #$9f,D7      // stop sound
        1e2e8 | 4eb9 0000 421c : jsr    $421c.l      // send sound code
        1e2ee | 60c8           : bra    $1e2b8
        -->
    </script>
    <script state="run">
        <output format="----- head on channel 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@ff9000</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.md@00324 =         00004278</action>
        <action>maincpu.mq@1e2b0 = ffffffffffffffff</action>
        <action>maincpu.mq@1e2b8 = ffffffffffffffff</action>
        <action>maincpu.mq@1e2c0 = ffffffffffffffff</action>
        <action>maincpu.mq@1e2c8 = ffffffffffffffff</action>
        <action>maincpu.mq@1e2d0 = ffffffffffffffff</action>
        <action>maincpu.mq@1e2d8 = ffffffffffffffff</action>
        <action>maincpu.mq@1e2e0 = ffffffffffffffff</action>
        <action>maincpu.mq@1e2e8 = ffffffffffffffff</action>
    </script>
</cheat>

[headonch] Head On Channel (update)

Posted: Sat Dec 24, 2022 8:10 am
by jman

Code: Select all

<cheat desc="sound test mode">
    <comment>reset the game (F3) to enter sound test mode</comment>
    <script state="on">
        <action>maincpu.md@00324 =         0001e2b0</action>
        <action>maincpu.mq@1e2b0 = 41f8900012001439</action>
        <action>maincpu.mq@1e2b8 = 0084000946020202</action>
        <action>maincpu.mq@1e2c0 = 0010e20210390084</action>
        <action>maincpu.mq@1e2c8 = 000146008002b200</action>
        <action>maincpu.mq@1e2d0 = 67e20c0000806602</action>
        <action>maincpu.mq@1e2d8 = 53100c0000406602</action>
        <action>maincpu.mq@1e2e0 = 52100c0000106604</action>
        <action>maincpu.mq@1e2e8 = 041000100c000020</action>
        <action>maincpu.mq@1e2f0 = 6604061000100c00</action>
        <action>maincpu.mq@1e2f8 = 000166081e100007</action>
        <action>maincpu.mq@1e300 = 0080600a0c000008</action>
        <action>maincpu.mq@1e308 = 66081e3c009f4eb8</action>
        <action>maincpu.mq@1e310 = 425c60a0ffffffff</action>
        <!--
        1e2b0 | 41f8 9000      : lea    $9000.w,A0   // $ff9000 : sound code address
        1e2b4 | 1200           : move.b D0,D1
        1e2b6 | 1439 0084 0009 : move.b $840009.l,D2 // read start button
        1e2bc | 4602           : not.b  D2
        1e2be | 0202 0010      : andi.b #$10,D2
        1e2c2 | e202           : asr.b  #1,D2
        1e2c4 | 1039 0084 0001 : move.b $840001.l,D0 // read other inputs
        1e2ca | 4600           : not.b  D0
        1e2cc | 8002           : or.b   D2,D0
        1e2ce | b200           : cmp.b  D0,D1
        1e2d0 | 67e2           : beq    $1e2b4
        1e2d2 | 0c00 0080      : cmpi.b #-$80,D0
        1e2d6 | 6602           : bne    $1e2da
        1e2d8 | 5310           : subq.b #1,(A0)      // decrease code -01
        1e2da | 0c00 0040      : cmpi.b #$40,D0
        1e2de | 6602           : bne    $1e2e2
        1e2e0 | 5210           : addq.b #1,(A0)      // increase code +01
        1e2e2 | 0c00 0010      : cmpi.b #$10,D0
        1e2e6 | 6604           : bne    $1e2ec
        1e2e8 | 0410 0010      : subi.b #$10,(A0)    // decrease code -10
        1e2ec | 0c00 0020      : cmpi.b #$20,D0
        1e2f0 | 6604           : bne    $1e2f6
        1e2f2 | 0610 0010      : addi.b #$10,(A0)    // increase code +10
        1e2f6 | 0c00 0001      : cmpi.b #$1,D0
        1e2fa | 6608           : bne    $1e304
        1e2fc | 1e10           : move.b (A0),D7      // play sound
        1e2fe | 0007 0080      : ori.b  #$80,D7
        1e302 | 600a           : bra    $1e30e
        1e304 | 0c00 0008      : cmpi.b #$8,D0
        1e308 | 6608           : bne    $1e312
        1e30a | 1e3c 009f      : move.b #$9f,D7      // stop sound
        1e30e | 4eb8 425c      : jsr    $425c.w
        1e312 | 60a0           : bra    $1e2b4
        -->
    </script>
    <script state="run">
        <output format="----- head on channel 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@ff9000</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.md@00324 =         00004278</action>
        <action>maincpu.mq@1e2b0 = ffffffffffffffff</action>
        <action>maincpu.mq@1e2b8 = ffffffffffffffff</action>
        <action>maincpu.mq@1e2c0 = ffffffffffffffff</action>
        <action>maincpu.mq@1e2c8 = ffffffffffffffff</action>
        <action>maincpu.mq@1e2d0 = ffffffffffffffff</action>
        <action>maincpu.mq@1e2d8 = ffffffffffffffff</action>
        <action>maincpu.mq@1e2e0 = ffffffffffffffff</action>
        <action>maincpu.mq@1e2e8 = ffffffffffffffff</action>
        <action>maincpu.mq@1e2f0 = ffffffffffffffff</action>
        <action>maincpu.mq@1e2f8 = ffffffffffffffff</action>
        <action>maincpu.mq@1e300 = ffffffffffffffff</action>
        <action>maincpu.mq@1e308 = ffffffffffffffff</action>
        <action>maincpu.mq@1e310 = ffffffffffffffff</action>
    </script>
</cheat>
"sound test mode" : rewrite routine. add up/down key (code ±10).