Code: Select all
<cheat desc="no hit - player">
<script state="on">
<action>maincpu.mw@e8f3 = 2290</action> <!-- bullet -->
</script>
<script state="off">
<action>maincpu.mw@e8f3 = 33a9</action>
</script>
</cheat>
<cheat desc="no hit - headquarter">
<script state="on">
<action>maincpu.mb@e853 = 60</action>
</script>
<script state="off">
<action>maincpu.mb@e853 = a9</action>
</script>
</cheat>
<cheat desc="auto fire">
<script state="on">
<action>maincpu.mb@e1e5 = 06</action>
</script>
<script state="off">
<action>maincpu.mb@e1e5 = 08</action>
</script>
</cheat>
<cheat desc="walk through wall">
<script state="on">
<action>maincpu.mq@dd86 = f03830a620205aa5</action>
<action>maincpu.mq@ddab = f01330a620205aa5</action>
<action>maincpu.mq@a620 = 206000a903b002c9</action>
<action>maincpu.mq@a628 = ffffff6011b1d726</action>
<!--
dd86 | a5 5a : lda $5a
dd88 | 20 20 a6 : jsr $a620
ddab | a5 5a : lda $5a
ddad | 20 20 a6 : jsr $a620
a620 | c9 02 : cmp #$02
a622 | b0 03 : bcs $a627
a624 | a9 00 : lda #$00
a626 | 60 : rts
a627 | 20 26 d7 : jsr $d726
a62a | b1 11 : lda ($11),y
a62c | 60 : rts
-->
</script>
<script state="off">
<action>maincpu.mq@dd86 = f0383011b1d72620</action>
<action>maincpu.mq@ddab = f0133011b1d72620</action>
<action>maincpu.mq@a620 = ffffffffffffffff</action>
<action>maincpu.mq@a628 = ffffffffffffffff</action>
</script>
</cheat>
<cheat desc="player speed">
<parameter min="0x01" max="0x05" step="0x01" />
<script state="on">
<action>maincpu.md@dd58 = 18a5b020</action> <!-- y position -->
<action>maincpu.md@dd68 = 18a5bf20</action> <!-- x position -->
<action>maincpu.mq@a5b0 = 20e52db907b002e0</action>
<action>maincpu.mq@a5b8 = e060e52db960a5ce</action>
<action>maincpu.mq@a5c0 = ce20e529b907b002</action>
<action>maincpu.mq@a5c8 = 04f060e529b960a5</action>
<action>maincpu.mq@a5d0 = 6000a96000a90330</action>
<!--
a5b0 | e0 02 : cpx #$02 // y position
a5b2 | b0 07 : bcs $a5bb
a5b4 | b9 2d e5 : lda $e52d,y
a5b7 | 20 ce a5 : jsr $a5ce
a5ba | 60 : rts
a5bb | b9 2d e5 : lda $e52d,y
a5be | 60 : rts
a5bf | e0 02 : cpx #$02 // x position
a5c1 | b0 07 : bcs $a5ca
a5c3 | b9 29 e5 : lda $e529,y
a5c6 | 20 ce a5 : jsr $a5ce
a5c9 | 60 : rts
a5ca | b9 29 e5 : lda $e529,y
a5cd | 60 : rts
a5ce | f0 04 : beq $a5d4
a5d0 | 30 03 : bmi $a5d5
a5d2 | a9 xx : lda #$xx
a5d4 | 60 : rts
a5d5 | a9 xx : lda #$xx
a5d7 | 60 : rts
-->
</script>
<script state="change">
<action>maincpu.mb@a5d3 = param</action>
<action>maincpu.mb@a5d6 = -param</action>
</script>
<script state="off">
<action>maincpu.md@dd58 = 18e52db9</action>
<action>maincpu.md@dd68 = 18e529b9</action>
<action>maincpu.mq@a5b0 = ffffffffffffffff</action>
<action>maincpu.mq@a5b8 = ffffffffffffffff</action>
<action>maincpu.mq@a5c0 = ffffffffffffffff</action>
<action>maincpu.mq@a5c8 = ffffffffffffffff</action>
<action>maincpu.mq@a5d0 = ffffffffffffffff</action>
</script>
</cheat>
<cheat desc="bullet speed">
<parameter min="0x01" max="0x05" step="0x01" />
<script state="on">
<action>maincpu.md@e117 = 0aa5e020</action> <!-- x position -->
<action>maincpu.md@e120 = 0aa5f020</action> <!-- y position -->
<action>maincpu.mq@a5e0 = e529b907f0a60020</action>
<action>maincpu.mq@a5e8 = 60e529b960a61620</action>
<action>maincpu.mq@a5f0 = e52db907f0a60020</action>
<action>maincpu.mq@a5f8 = 60e52db960a61620</action>
<action>maincpu.mq@a600 = 0bf001e00ff000e0</action>
<action>maincpu.mq@a608 = 03f009e007f008e0</action>
<action>maincpu.mq@a610 = 04f06001a96000a9</action>
<action>maincpu.mq@a618 = 6000a96000a90330</action>
<!--
a5e0 | 20 00 a6 : jsr $a600 // x position
a5e3 | f0 07 : beq $a5ec
a5e5 | b9 29 e5 : lda $e529,y
a5e8 | 20 16 a6 : jsr $a616
a5eb | 60 : rts
a5ec | b9 29 e5 : lda $e529,y
a5ef | 60 : rts
a5f0 | 20 00 a6 : jsr $a600 // y position
a5f3 | f0 07 : beq $a5fc
a5f5 | b9 2d e5 : lda $e52d,y
a5f8 | 20 16 a6 : jsr $a616
a5fb | 60 : rts
a5fc | b9 2d e5 : lda $e52d,y
a5ff | 60 : rts
a600 | e0 00 : cpx #$00
a602 | f0 0f : beq $a613
a604 | e0 01 : cpx #$01
a606 | f0 0b : beq $a613
a608 | e0 08 : cpx #$08
a60a | f0 07 : beq $a613
a60c | e0 09 : cpx #$09
a60e | f0 03 : beq $a613
a610 | a9 00 : lda #$00
a612 | 60 : rts
a613 | a9 01 : lda #$01
a615 | 60 : rts
a616 | f0 04 : beq $a61c
a618 | 30 03 : bmi $a61d
a61a | a9 xx : lda #$xx
a61c | 60 : rts
a61d | a9 xx : lda #$xx
a61f | 60 : rts
-->
</script>
<script state="change">
<action>maincpu.mb@a61b = param</action>
<action>maincpu.mb@a61e = -param</action>
</script>
<script state="off">
<action>maincpu.md@e117 = 0ae529b9</action>
<action>maincpu.md@e120 = 0ae52db9</action>
<action>maincpu.mq@a5e0 = ffffffffffffffff</action>
<action>maincpu.mq@a5e8 = ffffffffffffffff</action>
<action>maincpu.mq@a5f0 = ffffffffffffffff</action>
<action>maincpu.mq@a5f8 = ffffffffffffffff</action>
<action>maincpu.mq@a600 = ffffffffffffffff</action>
<action>maincpu.mq@a608 = ffffffffffffffff</action>
<action>maincpu.mq@a610 = ffffffffffffffff</action>
<action>maincpu.mq@a618 = 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.mw@c0ad = a4e0</action>
<action>maincpu.mq@a4e0 = 82858185808500a9</action>
<action>maincpu.mq@a4e8 = 818506a5828581a5</action>
<action>maincpu.mq@a4f0 = 02d040c9f4f082c5</action>
<action>maincpu.mq@a4f8 = 80e602d080c980c6</action>
<action>maincpu.mq@a500 = a513204805d002c9</action>
<action>maincpu.mq@a508 = ebf62003d001c968</action>
<action>maincpu.mq@a510 = a530bc80a6a4e84c</action>
<action>maincpu.mq@a518 = 838503a9c8a550be</action>
<action>maincpu.mq@a520 = c8e803009da550b9</action>
<action>maincpu.mq@a528 = ffffff60f4d083c6</action>
<action>maincpu.mq@a530 = 1c1814100c080400</action>
<action>maincpu.mq@a538 = 3c3834302c282420</action>
<action>maincpu.mq@a540 = 5c5854504c484440</action>
<action>maincpu.mq@a548 = ffffff706c686460</action>
<action>maincpu.mq@a550 = 0101010100000100</action>
<action>maincpu.mq@a558 = 0000010600010104</action>
<action>maincpu.mq@a560 = 0000010800000107</action>
<action>maincpu.mq@a568 = 0000010a00000109</action>
<action>maincpu.mq@a570 = 0000010c0000010b</action>
<action>maincpu.mq@a578 = 0000010e0000010d</action>
<action>maincpu.mq@a580 = 000001100000010f</action>
<action>maincpu.mq@a588 = 0000011200000111</action>
<action>maincpu.mq@a590 = 0000011400000113</action>
<action>maincpu.mq@a598 = 0000011700010115</action>
<action>maincpu.mq@a5a0 = 0000011b01010118</action>
<action>maincpu.mq@a5a8 = ffffffff0000011c</action>
<!--
c0ac | 20 e0 a4 : jsr $a4e0
a4e0 | a9 00 : lda #$00
a4e2 | 85 80 : sta $80
a4e4 | 85 81 : sta $81
a4e6 | 85 82 : sta $82
a4e8 | a5 81 : lda $81
a4ea | 85 82 : sta $82
a4ec | a5 06 : lda $06 // read input
a4ee | 85 81 : sta $81
a4f0 | c5 82 : cmp $82
a4f2 | f0 f4 : beq $a4e8
a4f4 | c9 40 : cmp #$40
a4f6 | d0 02 : bne $a4fa
a4f8 | c6 80 : dec $80 // decrease code
a4fa | c9 80 : cmp #$80
a4fc | d0 02 : bne $a500
a4fe | e6 80 : inc $80 // increase code
a500 | c9 02 : cmp #$02
a502 | d0 05 : bne $a509
a504 | 48 : pha
a505 | 20 13 a5 : jsr $a513 // play sound
a508 | 68 : pla
a509 | c9 01 : cmp #$01
a50b | d0 03 : bne $a510
a50d | 20 f6 eb : jsr $ebf6 // stop sound
a510 | 4c e8 a4 : jmp $a4e8
a513 | a6 80 : ldx $80 // convert sound code to address
a515 | bc 30 a5 : ldy $a530,x
a518 | be 50 a5 : ldx $a550,y
a51b | c8 : iny
a51c | a9 03 : lda #$03
a51e | 85 83 : sta $83
a520 | b9 50 a5 : lda $a550,y
a523 | 9d 00 03 : sta $0300,x
a526 | e8 : inx
a527 | c8 : iny
a528 | c6 83 : dec $83
a52a | d0 f4 : bne $a520
a52c | 60 : rts
a530 - a540 : table 1
a550 - a5b0 : table 2
-->
</script>
<script state="run">
<output format="----- battle city sound test mode -----" line="10" align="center" />
<output format="left : code decrement" line="11" align="center" />
<output format="right : code increment" line="12" align="center" />
<output format="button 1 : play sound" line="13" align="center" />
<output format="button 2 : stop sound" line="14" align="center" />
<output format="----------------------------" line="15" align="center" />
<output format="<< sound code %2.2X >>" line="17" align="center">
<argument>maincpu.pb@0080</argument>
</output>
</script>
<script state="off">
<action>maincpu.mw@c0ad = c65c</action>
<action>maincpu.mq@a4e0 = ffffffffffffffff</action>
<action>maincpu.mq@a4e8 = ffffffffffffffff</action>
<action>maincpu.mq@a4f0 = ffffffffffffffff</action>
<action>maincpu.mq@a4f8 = ffffffffffffffff</action>
<action>maincpu.mq@a500 = ffffffffffffffff</action>
<action>maincpu.mq@a508 = ffffffffffffffff</action>
<action>maincpu.mq@a510 = ffffffffffffffff</action>
<action>maincpu.mq@a518 = ffffffffffffffff</action>
<action>maincpu.mq@a520 = ffffffffffffffff</action>
<action>maincpu.mq@a528 = ffffffffffffffff</action>
<action>maincpu.mq@a530 = ffffffffffffffff</action>
<action>maincpu.mq@a538 = ffffffffffffffff</action>
<action>maincpu.mq@a540 = ffffffffffffffff</action>
<action>maincpu.mq@a548 = ffffffffffffffff</action>
<action>maincpu.mq@a550 = ffffffffffffffff</action>
<action>maincpu.mq@a558 = ffffffffffffffff</action>
<action>maincpu.mq@a560 = ffffffffffffffff</action>
<action>maincpu.mq@a568 = ffffffffffffffff</action>
<action>maincpu.mq@a570 = ffffffffffffffff</action>
<action>maincpu.mq@a578 = ffffffffffffffff</action>
<action>maincpu.mq@a580 = ffffffffffffffff</action>
<action>maincpu.mq@a588 = ffffffffffffffff</action>
<action>maincpu.mq@a590 = ffffffffffffffff</action>
<action>maincpu.mq@a598 = ffffffffffffffff</action>
<action>maincpu.mq@a5a0 = ffffffffffffffff</action>
<action>maincpu.mq@a5a8 = ffffffffffffffff</action>
</script>
</cheat>
I force to convert "address" to "code" by two tables so that some sound code may be wrong (eg 0x14).