Code: Select all
<cheat desc="no hit">
<script state="on">
<action>maincpu.mb@1275 = 18</action> <!-- enemy 1 -->
<action>maincpu.mb@12a0 = 18</action> <!-- enemy 2 -->
<action>maincpu.mb@1635 = 18</action> <!-- elevator -->
<action>maincpu.mb@1de5 = 18</action> <!-- trolley -->
<action>maincpu.mb@1e47 = 00</action> <!-- fall down -->
<action>maincpu.mb@1e63 = 00</action> <!-- fall down in elevator -->
</script>
<script state="off">
<action>maincpu.mb@1275 = 28</action>
<action>maincpu.mb@12a0 = 28</action>
<action>maincpu.mb@1635 = 20</action>
<action>maincpu.mb@1de5 = 30</action>
<action>maincpu.mb@1e47 = 01</action>
<action>maincpu.mb@1e63 = 0c</action>
</script>
</cheat>
<cheat desc="player speed">
<parameter min="0x01" max="0x05" step="0x01" />
<script state="on">
<action>maincpu.md@01f2 = 3a5f10cd</action>
<action>maincpu.md@0218 = 3a5f1acd</action>
<action>maincpu.mq@5f10 = 10c10dc7cdc50006</action>
<action>maincpu.mq@5f18 = 0b6dcdc50006c9f9</action>
<action>maincpu.mq@5f20 = ffffffffc9f910c1</action>
<!--
5f10 | 06 xx : ld b,$xx
5f12 | c5 : push bc
5f13 | cd c7 0d : call $0dc7
5f16 | c1 : pop bc
5f17 | 10 f9 : djnz $5f12
5f19 | c9 : ret
5f1a | 06 xx : ld b,$xx
5f1c | c5 : push bc
5f1d | cd 6d 0b : call $0b6d
5f20 | c1 : pop bc
5f21 | 10 f9 : djnz $5f1c
5f23 | c9 : ret
-->
</script>
<script state="change">
<action>maincpu.mb@5f11 = param</action>
<action>maincpu.mb@5f1b = param</action>
</script>
<script state="off">
<action>maincpu.md@01f2 = 3a0dc7cc</action>
<action>maincpu.md@0218 = 3a0b6dcd</action>
<action>maincpu.mq@5f10 = ffffffffffffffff</action>
<action>maincpu.mq@5f18 = ffffffffffffffff</action>
<action>maincpu.mq@5f20 = ffffffffffffffff</action>
</script>
</cheat>
<cheat desc="invisible ladder">
<script state="on">
<action>maincpu.mb@0de4 = 00</action> <!-- up -->
<action>maincpu.mb@0df0 = 00</action> <!-- down -->
<action>maincpu.md@0b37 = c05f30cd</action>
<action>maincpu.md@2617 = 065f37cd</action>
<action>maincpu.mq@5f30 = cdc900fe795f3ecd</action>
<action>maincpu.mq@5f38 = e5ddc925f4115f3e</action>
<action>maincpu.mq@5f40 = 60263ac080fe7de1</action>
<action>maincpu.mq@5f48 = ffffc9f1f1c860e6</action>
<!--
5f30 | cd 3e 5f : call $5f3e // up
5f33 | 79 : ld a,c
5f34 | fe 00 : cp $00
5f36 | c9 : ret
5f37 | cd 3e 5f : call $5f3e // down
5f3a | 11 f4 25 : ld de,$25f4
5f3d | c9 : ret
5f3e | dd e5 : push ix
5f40 | e1 : pop hl
5f41 | 7d : ld a,l
5f42 | fe 80 : cp $80
5f44 | c0 : ret nz
5f45 | 3a 26 60 : ld a,($6026)
5f48 | e6 60 : and $60
5f4a | c8 : ret z
5f4b | f1 : pop af
5f4c | f1 : pop af
5f4d | c9 : ret
-->
</script>
<script state="off">
<action>maincpu.mb@0de4 = c0</action>
<action>maincpu.mb@0df0 = c0</action>
<action>maincpu.md@0b37 = c000fe79</action>
<action>maincpu.md@2617 = 0625f411</action>
<action>maincpu.mq@5f30 = ffffffffffffffff</action>
<action>maincpu.mq@5f38 = ffffffffffffffff</action>
<action>maincpu.mq@5f40 = ffffffffffffffff</action>
<action>maincpu.mq@5f48 = 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.mb@0067 = cd</action> <!-- enable sound -->
<action>maincpu.mw@24a2 = 5f50</action>
<action>maincpu.mq@5f50 = 21614022513c21ff</action>
<action>maincpu.mq@5f58 = 60263a6100220000</action>
<action>maincpu.mq@5f60 = 012008fef6286fbd</action>
<action>maincpu.mq@5f68 = 80fe24012010fe25</action>
<action>maincpu.mq@5f70 = 2020fe05187c0320</action>
<action>maincpu.mq@5f78 = e5db185f7fcdaf04</action>
<action>maincpu.mq@5f80 = 235e6f85875f8f21</action>
<action>maincpu.mq@5f88 = 3cc9e1614022eb56</action>
<action>maincpu.mq@5f90 = 3850005ba85b7851</action>
<action>maincpu.mq@5f98 = ff5b945b6852005b</action>
<!--
5f50 | ff : rst $38
5f51 | 21 3c 51 : ld hl,$513c
5f54 | 22 40 61 : ld ($6140),hl
5f57 | 21 00 00 : ld hl,$0000 // initialize sound and input values
5f5a | 22 00 61 : ld ($6100),hl
5f5d | 3a 26 60 : ld a,($6026) // read input
5f60 | bd : cp l
5f61 | 6f : ld l,a
5f62 | 28 f6 : jr z,$5f5a
5f64 | fe 08 : cp $08
5f66 | 20 01 : jr nz,$5f69
5f68 | 25 : dec h // decrease code
5f69 | fe 10 : cp $10
5f6b | 20 01 : jr nz,$5f6e
5f6d | 24 : inc h // increase code
5f6e | fe 80 : cp $80
5f70 | 20 03 : jr nz,$5f75
5f72 | 7c : ld a,h // play sound
5f73 | 18 05 : jr $5f7a
5f75 | fe 20 : cp $20
5f77 | 20 04 : jr nz,$5f7d
5f79 | af : xor a // stop sound
5f7a | cd 7f 5f : call $5f7f
5f7d | 18 db : jr $5f5a
5f7f | e5 : push hl // read sound code from table
5f80 | 21 8f 5f : ld hl,$5f8f
5f83 | 87 : add a,a
5f84 | 85 : add a,l
5f85 | 6f : ld l,a
5f86 | 5e : ld e,(hl)
5f87 | 23 : inc hl
5f88 | 56 : ld d,(hl)
5f89 | eb : ex de,hl
5f8a | 22 40 61 : ld ($6140),hl // set sound code
5f8d | e1 : pop hl
5f8e | c9 : ret
5f8f - 5f9f : sound code table
-->
</script>
<script state="run">
<output format="----- bagman sound test mode (PSG only) -----" 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="<< sound code %2.2X >>" line="17" align="center">
<argument>maincpu.pb@6101</argument>
</output>
</script>
<script state="off">
<action>maincpu.mb@0067 = cc</action>
<action>maincpu.mw@24a2 = 121c</action>
<action>maincpu.mq@5f50 = ffffffffffffffff</action>
<action>maincpu.mq@5f58 = ffffffffffffffff</action>
<action>maincpu.mq@5f60 = ffffffffffffffff</action>
<action>maincpu.mq@5f68 = ffffffffffffffff</action>
<action>maincpu.mq@5f70 = ffffffffffffffff</action>
<action>maincpu.mq@5f78 = ffffffffffffffff</action>
<action>maincpu.mq@5f80 = ffffffffffffffff</action>
<action>maincpu.mq@5f88 = ffffffffffffffff</action>
<action>maincpu.mq@5f90 = ffffffffffffffff</action>
<action>maincpu.mq@5f98 = ffffffffffffffff</action>
</script>
</cheat>
"sound test mode" has restriction and requires more test.
- buggy gfx on the screen
- wait with 3 seconds to play sound after pressed button 1
- PSG sound only. No play any speech
- effective sound code is between 0x01 and 0x07. You need to add sound code into table if other sound is found