[ctower] The Tower

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

[ctower] The Tower

Post by jman »

ctower will be added on 0.241.

Code: Select all

<cheat desc="no hit">
    <script state="run">
        <action>maincpu.pb@1057 = 60</action> <!-- objects -->
        <action>maincpu.pb@112e = 60</action> <!-- window (both arms) -->
        <action>maincpu.pb@4b27 = 60</action> <!-- kong -->
        <action>maincpu.pb@4bf0 = 60</action> <!-- fire -->
    </script>
    <script state="off">
        <action>maincpu.pb@1057 = a9</action>
        <action>maincpu.pb@112e = a9</action>
        <action>maincpu.pb@4b27 = a9</action>
        <action>maincpu.pb@4bf0 = a9</action>
    </script>
</cheat>

<cheat desc="sound test mode">
    <comment>reset the game (F3) to enter sound test mode</comment>
    <script state="run">
        <action>maincpu.pw@3e29 =             5000</action>
        <action>maincpu.pq@5000 = f011e4e600ce1186</action>
        <action>maincpu.pq@5008 = e010a602b020e0f7</action>
        <action>maincpu.pq@5010 = b040e010e602b010</action>
        <action>maincpu.pq@5018 = 80e050242c10c505</action>
        <action>maincpu.pq@5020 = 2ce4148d00c905b0</action>
        <action>maincpu.pq@5028 = 0000000000005000</action>
        <!--
        5000 | 86 11    : stx $11
        5002 | ce 00 e6 : ldx $e600 // read input
        5005 | e4 11    : cpx $11
        5007 | f0 f7    : beq $5000
        5009 | e0 20    : cpx #$20
        500b | b0 02    : bne $500f
        500d | a6 10    : dec $10   // decrease code
        500f | e0 10    : cpx #$10
        5011 | b0 02    : bne $5015
        5013 | e6 10    : inc $10   // increase code
        5015 | e0 40    : cpx #$40
        5017 | b0 05    : bne $501e
        5019 | c5 10    : lda $10   // play sound
        501b | 2c 50 24 : jmp $5024
        501e | e0 80    : cpx #$80
        5020 | b0 05    : bne $5027
        5022 | c9 00    : lda #$00  // stop sound
        5024 | 8d 14 e4 : sta $e414 // send sound code
        5027 | 2c 00 50 : jmp $5000
        -->
        <output format="----- the tower sound test mode -----" line="10" align="center" />
        <output format="left/left : decrease code"             line="11" align="center" />
        <output format="left/right : increase code"            line="12" align="center" />
        <output format="left/up : play sound"                  line="13" align="center" />
        <output format="left/down : 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@0010</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.pw@3e29 =             1b59</action>
        <action>maincpu.pq@5000 = 0000000000000000</action>
        <action>maincpu.pq@5008 = 0000000000000000</action>
        <action>maincpu.pq@5010 = 0000000000000000</action>
        <action>maincpu.pq@5018 = 0000000000000000</action>
        <action>maincpu.pq@5020 = 0000000000000000</action>
        <action>maincpu.pq@5028 = 0000000000000000</action>
    </script>
</cheat>
Start music (0x41) and clear music (0x42) don't stop when you press "stop sound" (down key on left stick) though.
jman
Posts: 844
Joined: Tue Dec 01, 2020 1:24 pm

[ctower] The Tower (update)

Post by jman »

Code: Select all

<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@3e29 =             5000</action>
        <action>maincpu.pq@5000 = f011a5e600cd1185</action>
        <action>maincpu.pq@5008 = 01b020a910c6c8f7</action>
        <action>maincpu.pq@5010 = 80a9e801b010a9aa</action>
        <action>maincpu.pq@5018 = 98ca10e9588a06b0</action>
        <action>maincpu.pq@5020 = 1069188a06b040a9</action>
        <action>maincpu.pq@5028 = 06f004a9108698ca</action>
        <action>maincpu.pq@5030 = 148e00c205b008a9</action>
        <action>maincpu.pq@5038 = 0000000050002ce4</action>
        <!--
        5000 | 85 11    : sta $11
        5002 | ad 00 e6 : lda $e600 // read input
        5005 | c5 11    : cmp $11
        5007 | f0 f7    : beq $5000
        5009 | a8       : tay
        500a | a6 10    : ldx $10
        500c | c9 40    : cmp #$20
        500e | d0 01    : bne $5011
        5010 | ca       : dex       // decrease code -01
        5011 | c9 10    : cmp #$10
        5013 | d0 01    : bne $5016
        5015 | e8       : inx       // increase code +01
        5016 | c9 80    : cmp #$80
        5018 | d0 06    : bne $5020
        501a | 8a       : txa       // decrease code -10
        501b | 38       : sec
        501c | e9 10    : sbc #$10
        501e | aa       : tax
        501f | 98       : tya
        5020 | c9 20    : cmp #$40
        5022 | d0 06    : bne $502a
        5024 | 8a       : txa       // increase code +10
        5025 | 18       : clc
        5026 | 69 10    : adc #$10 
        5028 | aa       : tax
        5029 | 98       : tya
        502a | 86 10    : stx $10
        502c | c9 04    : cmp #$04
        502e | f0 06    : beq $5036
        5030 | c9 08    : cmp #$08
        5032 | d0 05    : bne $5039
        5034 | a2 00    : ldx #$00  // stop sound
        5036 | 8e 14 e4 : stx $e414 // send sound code
        5039 | 4c 00 50 : jmp $5000
        -->
        <action>audiocpu.pb@0c98 = 58</action> <!-- enable interrupt in playing music to stop sound -->
        <!-- display -->
        <output format="----- the tower sound test mode -----" line="10" align="center" />
        <output format="left/left : decrease code -01"         line="11" align="center" />
        <output format="left/right : increase code +01"        line="12" align="center" />
        <output format="left/down : decrease code -10"         line="13" align="center" />
        <output format="left/up : increase code +10"           line="14" align="center" />
        <output format="right/up : play sound"                 line="15" align="center" />
        <output format="right/down : 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@3e29 =             1b59</action>
        <action> maincpu.pq@5000 = 0000000000000000</action>
        <action> maincpu.pq@5008 = 0000000000000000</action>
        <action> maincpu.pq@5010 = 0000000000000000</action>
        <action> maincpu.pq@5018 = 0000000000000000</action>
        <action> maincpu.pq@5020 = 0000000000000000</action>
        <action> maincpu.pq@5028 = 0000000000000000</action>
        <action> maincpu.pq@5030 = 0000000000000000</action>
        <action> maincpu.pq@5038 = 0000000000000000</action>
        <action>audiocpu.pb@0c98 =               78</action>
    </script>
</cheat>
"sound test mode" : rewrite routine. add up/down key (code ±10). fix music (code 0x41 and 0x42) stop problem.
Post Reply