Page 1 of 1

[pprobe] Planet Probe

Posted: Wed Sep 27, 2023 2:17 pm
by jman

Code: Select all

<!-- Planet Probe (prototype?) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>maincpu.mb@0324 = 6b</action>
        </script>
        <script state="off">
            <action>maincpu.mb@0324 = 6c</action>
        </script>
    </cheat>

    <cheat desc="auto fire - shot">
        <script state="on">
            <action>maincpu.mb@18f9 = 04</action>
        </script>
        <script state="off">
            <action>maincpu.mb@18f9 = 28</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter min="0x01" max="0x05" step="0x01" />
        <script state="change">
            <action>maincpu.mb@1873 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mb@1873 = 01</action>
        </script>
    </cheat>

    <cheat desc="bullet speed - shot">
        <parameter>
            <item value="0x01">01 (slow)</item>
            <item value="0x04">02       </item>
            <item value="0x08">03       </item>
            <item value="0x0c">04       </item>
            <item value="0x10">05 (fast)</item>
        </parameter>
        <script state="change">
            <action>maincpu.mb@1ae6 =      param</action> <!-- speed -->
            <action>maincpu.mb@1aeb = fa - param</action> <!-- range -->
        </script>
        <script state="off">
            <action>maincpu.mb@1ae6 = 05</action>
            <action>maincpu.mb@1aeb = fa</action>
        </script>
    </cheat>

    <cheat desc="fast bomb">
        <script state="on">
            <action>maincpu.mb@1ace =               1e</action> <!-- timer -->
            <action>maincpu.mw@18da =             7fd0</action> <!-- set x/y position -->
            <action>maincpu.mq@7fd0 = 77f4bb3a2323e036</action>
            <action>maincpu.mq@7fd8 = 0000c977f4bc3a23</action>
            <!--
            7fd0 | 36 e0    : ld  (hl),$E0
            7fd2 | 23       : inc hl
            7fd3 | 23       : inc hl
            7fd4 | 3a bb f4 : ld  a,($F4BB)
            7fd7 | 77       : ld  (hl),a
            7fd8 | 23       : inc hl
            7fd9 | 3a bc f4 : ld  a,($F4BC)
            7fdc | 77       : ld  (hl),a
            7fdd | c9       : ret
            -->
        </script>
        <script state="off">
            <action>maincpu.mb@1ace =               00</action>
            <action>maincpu.mw@18da =             190e</action>
            <action>maincpu.mq@7fd0 = 0017191c15190015</action>
            <action>maincpu.mq@7fd8 = 151900150d0f120d</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@7f21 =             6e80</action>
            <action>maincpu.mq@6e80 = 093ae00032f10021</action>
            <action>maincpu.mq@6e88 = 2001fef62847b8f0</action>
            <action>maincpu.mq@6e90 = fe34012002fe3501</action>
            <action>maincpu.mq@6e98 = fe0618f03e042008</action>
            <action>maincpu.mq@6ea0 = 787786103e052004</action>
            <action>maincpu.mq@6ea8 = fe06187e032010fe</action>
            <action>maincpu.mq@6eb0 = f00032fe3e052020</action>
            <action>maincpu.mq@6eb8 = 000000000000c918</action>
            <!--
            6e80 | 21 00 f1 : ld  hl,$F100  // sound code address
            6e83 | 32 00 e0 : ld  ($E000),a // watchdog
            6e86 | 3a 09 f0 : ld  a,($F009) // read input
            6e89 | b8       : cp  b
            6e8a | 47       : ld  b,a
            6e8b | 28 f6    : jr  z,$6E83
            6e8d | fe 01    : cp  $01
            6e8f | 20 01    : jr  nz,$6E92
            6e91 | 35       : dec (hl)      // decrease code -01
            6e92 | fe 02    : cp  $02
            6e94 | 20 01    : jr  nz,$6E97
            6e96 | 34       : inc (hl)      // increase code +01
            6e97 | fe 08    : cp  $08
            6e99 | 20 04    : jr  nz,$6E9F
            6e9b | 3e f0    : ld  a,$F0     // decrease code -10
            6e9d | 18 06    : jr  $6EA5
            6e9f | fe 04    : cp  $04
            6ea1 | 20 05    : jr  nz,$6EA8
            6ea3 | 3e 10    : ld  a,$10     // increase code +10
            6ea5 | 86       : add a,(hl)
            6ea6 | 77       : ld  (hl),a
            6ea7 | 78       : ld  a,b
            6ea8 | fe 10    : cp  $10
            6eaa | 20 03    : jr  nz,$6EAF
            6eac | 7e       : ld  a,(hl)    // play sound
            6ead | 18 06    : jr  $6EB5
            6eaf | fe 20    : cp  $20
            6eb1 | 20 05    : jr  nz,$6EB8
            6eb3 | 3e fe    : ld  a,$FE     // stop sound
            6eb5 | 32 00 f0 : ld  ($F000),a // send sound code
            6eb8 | 18 c9    : jr  $6E83
            -->
        </script>
        <script state="run">
            <output format="----- planet probe 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@f100</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mw@7f21 =             7fb8</action>
            <action>maincpu.mq@6e80 = 0000000000000000</action>
            <action>maincpu.mq@6e88 = 0000000000000000</action>
            <action>maincpu.mq@6e90 = 0000000000000000</action>
            <action>maincpu.mq@6e98 = 0000000000000000</action>
            <action>maincpu.mq@6ea0 = 0000000000000000</action>
            <action>maincpu.mq@6ea8 = 0000000000000000</action>
            <action>maincpu.mq@6eb0 = 0000000000000000</action>
            <action>maincpu.mq@6eb8 = 0000000000000000</action>
        </script>
    </cheat>

</mamecheat>