Page 1 of 1

[czeroize] Zeroize

Posted: Sat Jul 08, 2023 8:39 am
by jman

Code: Select all

<!-- Zeroize (DECO Cassette) (US) -->
<mamecheat version="1">

    <cheat desc="player speed">
        <parameter min="0x01" max="0x05" step="0x01" />
        <script state="run">
            <action>maincpu.pw@0cce =             04d0</action> <!-- normal stage -->
            <action>maincpu.pw@0d5a =             04d0</action> <!-- challenge stage -->
            <action>maincpu.pq@04d0 = c51cb057c510d740</action>
            <action>maincpu.pq@04d8 = b001c904500af03b</action>
            <action>maincpu.pq@04e0 = f03cc53b85fec902</action>
            <action>maincpu.pq@04e8 = c902b001c904500a</action>
            <action>maincpu.pq@04f0 = 00000000603c85fe</action>
            <!--
            04d0 | 40 d7 10 : jsr $10d7
            04d3 | c5 57    : lda $57   // check auto-moving flag
            04d5 | b0 1c    : bne $04f3
            04d7 | c5 3b    : lda $3b   // x-position
            04d9 | f0 0a    : beq $04e5
            04db | 50 04    : bmi $04e1
            04dd | c9 05    : lda #$05
            04df | b0 02    : bne $04e3
            04e1 | c9 fb    : lda #$fb
            04e3 | 85 3b    : sta $3b
            04e5 | c5 3c    : lda $3c   // y-position
            04e7 | f0 0a    : beq $04f3
            04e9 | 50 04    : bmi $04ef
            04eb | c9 05    : lda #$05
            04ed | b0 02    : bne $04f1
            04ef | c9 fb    : lda #$fb
            04f1 | 85 3c    : sta $3c
            04f3 | 60       : rts
            -->
            <action>maincpu.pb@04de =  param</action>
            <action>maincpu.pb@04e2 = -param</action>
            <action>maincpu.pb@04ec =  param</action>
            <action>maincpu.pb@04f0 = -param</action>
        </script>
        <script state="off">
            <action>maincpu.pw@0cce =             10d7</action>
            <action>maincpu.pw@0d5a =             10d7</action>
            <action>maincpu.pq@04d0 = 0000000000000000</action>
            <action>maincpu.pq@04d8 = 0000000000000000</action>
            <action>maincpu.pq@04e0 = 0000000000000000</action>
            <action>maincpu.pq@04e8 = 0000000000000000</action>
            <action>maincpu.pq@04f0 = 0000000000000000</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.pq@0517 = f011a5e600cd1185</action>
            <action>maincpu.pq@051f = 01b002a910c6c8f7</action>
            <action>maincpu.pq@0527 = 08a9e801b001a9aa</action>
            <action>maincpu.pq@052f = 98ca10e9588a06b0</action>
            <action>maincpu.pq@0537 = 1069188a06b004a9</action>
            <action>maincpu.pq@053f = 06f010a9108698ca</action>
            <action>maincpu.pq@0547 = 148e00c205b020a9</action>
            <action>maincpu.pq@054f = eaeaeaea05172ce4</action>
            <!--
            0517 | 85 11    : sta $11
            0519 | cd 00 e6 : lda $e600 // read input
            051c | a5 11    : cmp $11
            051e | f0 f7    : beq $0517
            0520 | c8       : tay
            0521 | c6 10    : ldx $10
            0523 | a9 02    : cmp #$02
            0525 | b0 01    : bne $0528
            0527 | aa       : dex       // decrease code -01
            0528 | a9 01    : cmp #$01
            052a | b0 01    : bne $052d
            052c | e8       : inx       // increase code +01
            052d | a9 08    : cmp #$08
            052f | b0 06    : bne $0537
            0531 | 8a       : txa       // decrease code -10
            0532 | 58       : sec
            0533 | e9 10    : sbc #$10
            0535 | ca       : tax
            0536 | 98       : tya
            0537 | a9 04    : cmp #$04
            0539 | b0 06    : bne $0541
            053b | 8a       : txa       // increase code +10
            053c | 18       : clc
            053d | 69 10    : adc #$10
            053f | ca       : tax
            0540 | 98       : tya
            0541 | 86 10    : stx $10
            0543 | a9 10    : cmp #$10
            0545 | f0 06    : beq $054d
            0547 | a9 20    : cmp #$20
            0549 | b0 05    : bne $0550
            054b | c2 00    : ldx #$00  // stop sound
            054d | 8e 14 e4 : stx $e414 // send sound code
            0550 | 2c 17 05 : jmp $0517
            -->
            <!-- display -->
            <output format="----- zeroize 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.pq@0517 = 088508c91885ffc9</action>
            <action>maincpu.pq@051f = 148d0385028500c9</action>
            <action>maincpu.pq@0527 = 402d78400a5a40e4</action>
            <action>maincpu.pq@052f = 4001c90ae1402fe4</action>
            <action>maincpu.pq@0537 = 4002808dffc92bad</action>
            <action>maincpu.pq@053f = 402b8d40d0c934e2</action>
            <action>maincpu.pq@0547 = 051b2c0c60400ae1</action>
            <action>maincpu.pq@054f = 2a1849ff29e301cd</action>
        </script>
    </cheat>

</mamecheat>
BTW, czeroize in the database based on 0.256 has "invincibility" only. Basic RAM codes are missing.
Image

Code: Select all

    <cheat desc="infinite credits">
        <script state="run">
            <action>maincpu.pb@0016 = 99</action>
        </script>
    </cheat>

    <cheat desc="P1 infinite lives">
        <script state="run">
            <action>maincpu.pb@0012 = ff</action>
        </script>
    </cheat>

    <cheat desc="P2 infinite lives">
        <script state="run">
            <action>maincpu.pb@0013 = ff</action>
        </script>
    </cheat>

    <cheat desc="P1 start round">
        <parameter min="0x01" max="0xff" step="0x01" />
        <script state="run">
            <action condition="maincpu.pb@0004 == 00">maincpu.pb@0004 = param - 1</action>
        </script>
    </cheat>

    <cheat desc="P2 start round">
        <parameter min="0x01" max="0xff" step="0x01" />
        <script state="run">
            <action condition="maincpu.pb@0005 == 00">maincpu.pb@0005 = param - 1</action>
        </script>
    </cheat>

    <cheat desc="finish current round now">
        <comment>normal stage only. doesn't work in challenge stage</comment>
        <script state="on">
            <action>maincpu.pd@0046 = 00000000</action> <!-- clear remain enemies on the field -->
            <action>maincpu.pw@0445 =     7f7f</action> <!-- counts of destroyed enemy -->
        </script>
    </cheat>

[czeroize] Zeroize

Posted: Sun Aug 11, 2024 1:38 pm
by jman
Small clean up.

czeroize.xml

Code: Select all

<!-- Zeroize (DECO Cassette) (US) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="run">
            <action>maincpu.pb@0EA0 = 53</action> <!-- wall/tunnel -->
            <action>maincpu.pb@117C = 01</action> <!-- black hole -->
            <action>maincpu.pb@140A = EA</action> <!-- mars -->
            <action>maincpu.pb@140F = 60</action> <!-- meteor -->
            <action>maincpu.pb@1419 = 60</action> <!-- other enemies -->
        </script>
        <script state="off">
            <action>maincpu.pb@0EA0 = 06</action>
            <action>maincpu.pb@117C = 00</action>
            <action>maincpu.pb@140A = 20</action>
            <action>maincpu.pb@140F = 20</action>
            <action>maincpu.pb@1419 = 8A</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter min="0x01" max="0x05" step="0x01" />
        <script state="run">
            <action>maincpu.pw@0CCE = 04D0            </action> <!-- normal stage -->
            <action>maincpu.pw@0D5A = 04D0            </action> <!-- challenge stage -->
            <action>maincpu.pq@04D0 = C51CB057C510D740</action>
            <action>maincpu.pq@04D8 = B001C904500AF03B</action>
            <action>maincpu.pq@04E0 = F03CC53B85FEC902</action>
            <action>maincpu.pq@04E8 = C902B001C904500A</action>
            <action>maincpu.pq@04F0 = 00000000603C85FE</action>
            <!--
            04D0 | 20 D7 10 : jsr $10d7
            04D3 | A5 57    : lda $57   // check auto moving flag
            04D5 | D0 1C    : bne $04f3
            04D7 | A5 3B    : lda $3b   // x position
            04D9 | F0 0A    : beq $04e5
            04DB | 30 04    : bmi $04e1
            04DD | A9 xx    : lda #$xx
            04DF | D0 02    : bne $04e3
            04E1 | A9 xx    : lda #$xx
            04E3 | 85 3B    : sta $3b
            04E5 | A5 3C    : lda $3c   // y position
            04E7 | F0 0A    : beq $04f3
            04E9 | 30 04    : bmi $04ef
            04EB | A9 xx    : lda #$xx
            04ED | D0 02    : bne $04f1
            04EF | A9 xx    : lda #$xx
            04F1 | 85 3C    : sta $3c
            04F3 | 60       : rts
            -->
            <action>maincpu.pb@04DE =  param</action>
            <action>maincpu.pb@04E2 = -param</action>
            <action>maincpu.pb@04EC =  param</action>
            <action>maincpu.pb@04F0 = -param</action>
        </script>
        <script state="off">
            <action>maincpu.pw@0CCE = 10D7            </action>
            <action>maincpu.pw@0D5A = 10D7            </action>
            <action>maincpu.pq@04D0 = 0000000000000000</action>
            <action>maincpu.pq@04D8 = 0000000000000000</action>
            <action>maincpu.pq@04E0 = 0000000000000000</action>
            <action>maincpu.pq@04E8 = 0000000000000000</action>
            <action>maincpu.pq@04F0 = 0000000000000000</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.pq@0517 = F081A4E600CC8184</action>
            <action>maincpu.pq@051F = AA01B002A080C6F7</action>
            <action>maincpu.pq@0527 = B008A0E801B001A0</action>
            <action>maincpu.pq@052F = 04A0CA10E9588A05</action>
            <action>maincpu.pq@0537 = 86CA1069188A05B0</action>
            <action>maincpu.pq@053F = B020A006F010A080</action>
            <action>maincpu.pq@0547 = 172CE4148E00C205</action>
            <action>maincpu.pq@054F = EAEAEAEAEAEAEA05</action>
            <!--
            0517 | 84 81    : sty $81
            0519 | AC 00 E6 : ldy $e600 // read input
            051C | C4 81    : cpy $81
            051E | F0 F7    : beq $0517
            0520 | A6 80    : ldx $80
            0522 | C0 02    : cpy #$02
            0524 | D0 01    : bne $0527
            0526 | CA       : dex       // decrease code -01
            0527 | C0 01    : cpy #$01
            0529 | D0 01    : bne $052c
            052B | E8       : inx       // increase code +01
            052C | C0 08    : cpy #$08
            052E | D0 05    : bne $0535
            0530 | 8A       : txa       // decrease code -10
            0531 | 38       : sec
            0532 | E9 10    : sbc #$10
            0534 | AA       : tax
            0535 | C0 04    : cpy #$04
            0537 | D0 05    : bne $053e
            0539 | 8A       : txa       // increase code +10
            053A | 18       : clc
            053B | 69 10    : adc #$10
            053D | AA       : tax
            053E | 86 80    : stx $80
            0540 | C0 10    : cpy #$10
            0542 | F0 06    : beq $054a // play sound
            0544 | C0 20    : cpy #$20
            0546 | D0 05    : bne $054d
            0548 | A2 00    : ldx #$00  // stop sound
            054A | 8E 14 E4 : stx $e414 // send sound code
            054D | 4C 17 05 : jmp $0517
            -->
            <!-- display -->
            <output format="----- 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@0080</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.pq@0517 = 088508C91885FFC9</action>
            <action>maincpu.pq@051F = 148D0385028500C9</action>
            <action>maincpu.pq@0527 = 402D78400A5A40E4</action>
            <action>maincpu.pq@052F = 4001C90AE1402FE4</action>
            <action>maincpu.pq@0537 = 4002808DFFC92BAD</action>
            <action>maincpu.pq@053F = 402B8D40D0C934E2</action>
            <action>maincpu.pq@0547 = 051B2C0C60400AE1</action>
            <action>maincpu.pq@054F = 2A1849FF29E301CD</action>
        </script>
    </cheat>

</mamecheat>
"sound test mode" : Rewritten routine.