Page 1 of 1

[cterrani] Terranean

Posted: Sat Feb 25, 2023 11:56 am
by jman

Code: Select all

<cheat desc="no hit">
    <script state="run">
        <action>maincpu.pw@1c27 = 1390</action> <!-- bullet -->
        <action>maincpu.pw@2865 = d490</action> <!-- enemy -->
    </script>
    <script state="off">
        <action>maincpu.pw@1c27 = 01c9</action>
        <action>maincpu.pw@2865 = 01c9</action>
    </script>
</cheat>

<cheat desc="auto fire">
    <script state="run">
        <action>maincpu.pb@1ed4 = 00</action>
    </script>
    <script state="off">
        <action>maincpu.pb@1ed4 = 01</action>
    </script>
</cheat>

<cheat desc="player speed">
    <parameter min="0x01" max="0x05" step="0x01" />
    <script state="run">
        <action>maincpu.pw@066e =             4fc0</action>
        <action>maincpu.pq@4fc0 = ca681d24402800c9</action>
        <action>maincpu.pq@4fc8 = 00000060f6b08aaa</action>
        <!--
        4fc0 | a9 xx    : lda #$xx
        4fc2 | 48       : pha
        4fc3 | 20 44 1d : jsr $1d24
        4fc6 | 68       : pla
        4fc7 | aa       : tax
        4fc8 | ca       : dex
        4fc9 | 8a       : txa
        4fca | d0 f6    : bne $4fc2
        4fcc | 60       : rts
        -->
        <action>maincpu.pb@4fc1 = param</action>
    </script>
    <script state="off">
        <action>maincpu.pw@066e =             1d24</action>
        <action>maincpu.pq@4fc0 = 0000000000000000</action>
        <action>maincpu.pq@4fc8 = 0000000000000000</action>
    </script>
</cheat>

<cheat desc="bullet speed">
    <parameter>
        <item value="0x01">01 (slow)</item>
        <item value="0x04">02       </item>
        <item value="0x08">03       </item>
        <item value="0x0c">04       </item>
        <item value="0x10">05 (fast)</item>
    </parameter>
    <script state="run">
        <action>maincpu.pb@1feb = param</action> <!-- range -->
        <action>maincpu.pb@2024 = param</action> <!-- speed -->
        <action>maincpu.pb@2026 = param</action> <!-- speed -->
        <action>maincpu.pb@2028 = param</action> <!-- speed -->
        <action>maincpu.pb@202a = param</action> <!-- speed -->
    </script>
    <script state="off">
        <action>maincpu.pb@1feb = 08</action>
        <action>maincpu.pb@2024 = 05</action>
        <action>maincpu.pb@2026 = 05</action>
        <action>maincpu.pb@2028 = 05</action>
        <action>maincpu.pb@202a = 05</action>
    </script>
</cheat>

<cheat desc="sound test mode">
    <comment>reset the game (F3) then wait data load to enter sound test mode</comment>
    <script state="run">
        <!-- routine -->
        <action>maincpu.pw@05e5 =             4fd0</action>
        <action>maincpu.pq@4fd0 = f011a5e600cd1185</action>
        <action>maincpu.pq@4fd8 = 01b002a910c6c8f7</action>
        <action>maincpu.pq@4fe0 = 08a9e801b001a9aa</action>
        <action>maincpu.pq@4fe8 = 98ca10e9588a06b0</action>
        <action>maincpu.pq@4ff0 = 1069188a06b004a9</action>
        <action>maincpu.pq@4ff8 = 06f010a9108698ca</action>
        <action>maincpu.pq@5000 = 148e00c205b020a9</action>
        <action>maincpu.pq@5008 = 000000004fd02ce4</action>
        <!--
        4fd0 | 85 11    : sta $11
        4fd2 | ad 00 e6 : lda $e600 // read input
        4fd5 | c5 11    : cmp $11
        4fd7 | f0 f7    : beq $4fd0
        4fd9 | a8       : tay
        4fda | a6 10    : ldx $10
        4fdc | c9 02    : cmp #$02
        4fde | d0 01    : bne $4fe1
        4fe0 | ca       : dex       // decrease code -01
        4fe1 | c9 01    : cmp #$01
        4fe3 | d0 01    : bne $4fe6
        4fe5 | e8       : inx       // increase code +01
        4fe6 | c9 08    : cmp #$08
        4fe8 | d0 06    : bne $4ff0
        4fea | 8a       : txa       // decrease code -10
        4feb | 38       : sec
        4fec | e9 10    : sbc #$10
        4fee | aa       : tax
        4fef | 98       : tya
        4ff0 | c9 04    : cmp #$04
        4ff2 | d0 06    : bne $4ffa
        4ff4 | 8a       : txa       // increase code +10
        4ff5 | 18       : clc
        4ff6 | 69 10    : adc #$10
        4ff8 | aa       : tax
        4ff9 | 98       : tya
        4ffa | 86 10    : stx $10
        4ffc | c9 10    : cmp #$10
        4ffe | f0 06    : beq $5006
        4500 | c9 40    : cmp #$20
        4502 | d0 05    : bne $5009
        4504 | a2 00    : ldx #$00  // stop sound
        4506 | 8e 14 e4 : stx $e414 // send sound code
        4509 | 4c d0 4f : jmp $4fd0
        -->
        <action>audiocpu.pb@0bb8 = 58</action> <!-- enable interrupt in playing music (0x41-0x42) to stop sound -->
        <!-- display -->
        <output format="----- terranean 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@0010</argument>
        </output>
    </script>
    <script state="off">
        <action> maincpu.pw@05e5 =             072a</action>
        <action> maincpu.pq@4fd0 = 0000000000000000</action>
        <action> maincpu.pq@4fd8 = 0000000000000000</action>
        <action> maincpu.pq@4fe0 = 0000000000000000</action>
        <action> maincpu.pq@4fe8 = 0000000000000000</action>
        <action> maincpu.pq@4ff0 = 0000000000000000</action>
        <action> maincpu.pq@4ff8 = 0000000000000000</action>
        <action> maincpu.pq@4500 = 0000000000000000</action>
        <action> maincpu.pq@4508 = 0000000000000000</action>
        <action>audiocpu.pb@0bb8 =               78</action>
    </script>
</cheat>