[sraider] Space Raider

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

[sraider] Space Raider

Post by jman »

Code: Select all

<!-- Space Raider -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>maincpu.mb@4E11 = 18</action> <!-- enemy -->
            <action>maincpu.mb@505C = 18</action> <!-- bullet -->
            <action>maincpu.mb@5804 = 18</action> <!-- enemy -->
        </script>
        <script state="off">
            <action>maincpu.mb@4E11 = 38</action>
            <action>maincpu.mb@505C = 38</action>
            <action>maincpu.mb@5804 = 38</action>
        </script>
    </cheat>

    <cheat desc="auto fire">
        <script state="on">
            <action>maincpu.mb@3D47 = 00</action>
        </script>
        <script state="off">
            <action>maincpu.mb@3D47 = FF</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter min="0x01" max="0x05" step="0x01" />
        <script state="on">
            <action>maincpu.mw@396E = 5FE0            </action>
            <action>maincpu.mw@3994 = 5FE0            </action>
            <action>maincpu.mw@39D2 = 5FE0            </action>
            <action>maincpu.mw@39F5 = 5FE0            </action>
            <action>maincpu.mq@5FE0 = 10C13C1FCDC50006</action>
            <action>maincpu.mq@5FE8 = 000000000000C9F9</action>
            <!--
            5FE0 | 06 xx    : ld   b,$xx
            5FE2 | C5       : push bc
            5FE3 | CD 1F 3C : call $3C1F
            5FE6 | C1       : pop  bc
            5FE7 | 10 F9    : djnz $5FE2
            5FE9 | C9       : ret
            -->
        </script>
        <script state="change">
            <action>maincpu.mb@5FE1 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mw@396E = 3C1F            </action>
            <action>maincpu.mw@3994 = 3C1F            </action>
            <action>maincpu.mw@39D2 = 3C1F            </action>
            <action>maincpu.mw@39F5 = 3C1F            </action>
            <action>maincpu.mq@5FE0 = 4800000000000003</action>
            <action>maincpu.mq@5FE8 = 2800000000000341</action>
        </script>
    </cheat>

    <cheat desc="bullet speed">
        <parameter min="0x01" max="0x05" step="0x01" />
        <script state="on">
            <action>maincpu.mw@3997 = 5FF0            </action>
            <action>maincpu.mw@39B6 = 5FF0            </action>
            <action>maincpu.mw@39F8 = 5FF0            </action>
            <action>maincpu.mw@3A14 = 5FF0            </action>
            <action>maincpu.mq@5FF0 = 10C13DCDCDC50006</action>
            <action>maincpu.mq@5FF8 = 000000000000C9F9</action>
            <!--
            5FF0 | 06 xx    : ld   b,$xx
            5FF2 | C5       : push bc
            5FF3 | CD CD 3D : call $3DCD
            5FF6 | C1       : pop  bc
            5FF7 | 10 F9    : djnz 5FF2
            5FF9 | C9       : ret
            -->
        </script>
        <script state="change">
            <action>maincpu.mb@5FF1 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mw@396E = 3DCD            </action>
            <action>maincpu.mw@3994 = 3DCD            </action>
            <action>maincpu.mw@39D2 = 3DCD            </action>
            <action>maincpu.mw@39F5 = 3DCD            </action>
            <action>maincpu.mq@5FF0 = 3800040000000202</action>
            <action>maincpu.mq@5FF8 = 6900000000000000</action>
        </script>
    </cheat>

    <cheat desc="sound test mode (test)">
        <!-- missing some sounds -->
        <comment>reset the game (F3) to enter sound test mode</comment>
        <script state="on">
            <action>maincpu.mb@0051 = 1F              </action> <!-- check sound code -->
            <action>maincpu.mb@0082 = 00              </action> <!-- prevent from no sound response -->
            <action>maincpu.md@02B2 = A70440C3        </action>
            <action>maincpu.mq@0440 = 47B880003A610021</action>
            <action>maincpu.mq@0448 = FE350120FEFEF928</action>
            <action>maincpu.mq@0450 = 0420FDFE340120FB</action>
            <action>maincpu.mq@0458 = 0520F7FE0618F03E</action>
            <action>maincpu.mq@0460 = 20EFFE787786103E</action>
            <action>maincpu.mq@0468 = 0520DFFE06187E03</action>
            <action>maincpu.mq@0470 = 00CC18680332F03E</action>
            <!--
            0440 | 21 00 61 : ld  hl,$6100  // sound code address
            0443 | 3A 00 80 : ld  a,($8000) // read input
            0446 | B8       : cp  b
            0447 | 47       : ld  b,a
            0448 | 28 F9    : jr  z,$0443
            044A | FE FE    : cp  $FE
            044C | 20 01    : jr  nz,$044F
            044E | 35       : dec (hl)      // decreae code -01
            044F | FE FB    : cp  $FB
            0451 | 20 01    : jr  nz,$0454
            0453 | 34       : inc (hl)      // increase code +01
            0454 | FE FD    : cp  $FD
            0456 | 20 04    : jr  nz,$045C
            0458 | 3E F0    : ld  a,$F0     // decrease code -10
            045A | 18 06    : jr  $0462
            045C | FE F7    : cp  $F7
            045E | 20 05    : jr  nz,$0465
            0460 | 3E 10    : ld  a,$10     // increase code +10
            0462 | 86       : add a,(hl)
            0463 | 77       : ld  (hl),a
            0464 | 78       : ld  a,b
            0465 | FE EF    : cp  $EF
            0467 | 20 03    : jr  nz,$046C
            0469 | 7E       : ld  a,(hl)    // play sound
            046A | 18 06    : jr  $0472
            046C | FE DF    : cp  $DF
            046E | 20 05    : jr  nz,$0475
            0470 | 3E F0    : ld  a,$F0     // stop sound
            0472 | 32 03 68 : ld  ($6803),a // send sound code
            0475 | 18 CC    : jr  $0443
            -->
            <action>sub.mq@01FB = 000136DD000036DD</action> <!-- prevent from no sound repeat -->
            <action>sub.md@00F4 = BC3BC0CD        </action> <!-- reset subcpu in case of sound code 0xf0 -->
            <action>sub.mq@3BC0 = 0000CAF0FEA0003A</action>
            <action>sub.mq@3BC8 = 00000000000000C9</action>
            <!--
            3BC0 | 3A 00 A0 : ld  a,($A000)
            3BC3 | FE F0    : cp  $F0
            3BC5 | CA 00 00 : jp  z,$0000
            3BC8 | C9       : ret
            -->
        </script>
        <script state="run">
            <output format="----- space raider 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="start 1 : 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@6100</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mb@0051 = 42              </action>
            <action>maincpu.mb@0082 = 48              </action>
            <action>maincpu.md@02B2 = A760073A        </action>
            <action>maincpu.mq@0440 = 0000000000000000</action>
            <action>maincpu.mq@0448 = 0000000000000000</action>
            <action>maincpu.mq@0450 = 0000000000000000</action>
            <action>maincpu.mq@0458 = 0000000000000000</action>
            <action>maincpu.mq@0460 = 0000000000000000</action>
            <action>maincpu.mq@0468 = 0000000000000000</action>
            <action>maincpu.mq@0470 = 0000000000000000</action>
            <action>    sub.mq@01FB = BE01CBDDAE00CBDD</action>
            <action>    sub.md@00F4 = BCA0003A        </action>
            <action>    sub.mq@3BC0 = 0000000000000000</action>
            <action>    sub.mq@3BC8 = 0000000000000000</action>
        </script>
    </cheat>

</mamecheat>
"sound test mode" : Missing some sounds. Perhaps I need to write value into $6804.
Post Reply