[pesadelo] Pesadelo

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

[pesadelo] Pesadelo

Post by jman »

pesadelo is bootleg of konami's "knightmare/majou densetsu" for MSX.

Code: Select all

<cheat desc="no hit">
    <script state="on">
        <!-- player -->
        <action>maincpu.mb@5faf =   00</action> <!-- boss -->
        <action>maincpu.mw@620c = c9af</action> <!-- background -->
        <action>maincpu.mb@7484 =   c9</action> <!-- enemy -->
        <action>maincpu.mb@8328 =   18</action> <!-- bullet -->
        <action>maincpu.mb@8d84 =   c9</action> <!-- earthquake (boss 6) -->
        <action>maincpu.mb@9094 =   18</action> <!-- boss -->
        <!-- shield -->
        <action>maincpu.mb@8363 = c9</action>
    </script>
    <script state="off">
        <action>maincpu.mb@5faf =   0b</action>
        <action>maincpu.mw@620c = 43d6</action>
        <action>maincpu.mb@7484 =   cd</action>
        <action>maincpu.mb@8328 =   38</action>
        <action>maincpu.mb@8d84 =   c3</action>
        <action>maincpu.mb@9094 =   20</action>
        <action>maincpu.mb@8363 =   3e</action>
    </script>
</cheat>

<cheat desc="auto fire">
    <script state="on">
        <action>maincpu.mb@5d1f = 09</action> <!-- input -->
        <action>maincpu.mb@5d3b = cd</action> <!-- fire timer -->
    </script>
    <script state="off">
        <action>maincpu.mb@5d1f = 08</action>
        <action>maincpu.mb@5d3b = cc</action>
    </script>
</cheat>

<cheat desc="player speed">
    <parameter>
        <item value="0x0808">01 (slow)</item>
        <item value="0x1010">02       </item>
        <item value="0x2020">03       </item>
        <item value="0x3030">04       </item>
        <item value="0x4040">05 (fast)</item>
    </parameter>
    <script state="on">
        <action>maincpu.md@5f12 = 0e185f16</action>
    </script>
    <script state="change">
        <action>maincpu.mw@5f16 = param</action>
    </script>
    <script state="off">
        <action>maincpu.mq@5f12 = dd03fe0c7edd62e2</action>
    </script>
</cheat>

<cheat desc="bullet speed">
    <parameter min="0x01" max="0x04" step="0x01" />
    <script state="on">
        <action>maincpu.mw@585a =             2200</action>
        <action>maincpu.mq@2200 = 10c162eccdc50006</action>
        <action>maincpu.mq@2208 = 000000000000c9f9</action>
        <!--
        2200 | 06 xx    : ld   b,$xx
        2202 | c5       : push bc
        2203 | cd ec 62 : call $62EC
        2206 | c1       : pop  bc
        2207 | 10 f9    : djnz $2202
        2209 | c9       : ret
        -->
    </script>
    <script state="change">
        <action>maincpu.mb@2201 = param</action>
    </script>
    <script state="off">
        <action>maincpu.mw@585A =             62ec</action>
        <action>maincpu.mq@2200 = 0000000000000000</action>
        <action>maincpu.mq@2208 = 0000000000000000</action>
    </script>
</cheat>

<cheat desc="unlock hidden panel">
    <script state="on">
        <action>maincpu.md@6a38 =         dd2210cd</action>
        <action>maincpu.mq@2210 = 0000c90077ddffcb</action>
        <!--
        2210 | cb ff    : set 7,a
        2212 | dd 77 00 : ld  (ix+$00),a
        2215 | c9       : ret
        -->
    </script>
    <script state="off">
        <action>maincpu.md@6a38 =         dd0077dd</action>
        <action>maincpu.mq@2210 = 0000000000000000</action>
    </script>
</cheat>

<cheat desc="sound test mode">
    <comment>reset the game (F3) then insert a coin to enter sound test mode</comment>
    <script state="on">
        <action>maincpu.mb@4168 =               00</action> <!-- disable next sequence -->
        <action>maincpu.mb@426c =               c9</action> <!-- disable title screen -->
        <action>maincpu.mw@4121 =             2220</action>
        <action>maincpu.mq@2220 = 77bee0093ac10121</action>
        <action>maincpu.mq@2228 = fe35012004fe2bc8</action>
        <action>maincpu.mq@2230 = 032010fe34012008</action>
        <action>maincpu.mq@2238 = 3d3ec001fe05187e</action>
        <action>maincpu.mq@2240 = 00000000c9490ccd</action>
        <!--
        2220 | 21 01 c1 : ld   hl,$C101  // $c101 = input
        2223 | 3a 09 e0 : ld   a,($E009) // read input
        2226 | be       : cp   (hl)
        2227 | 77       : ld   (hl),a
        2228 | c8       : ret  z
        2229 | 2b       : dec  hl        // $c100 = sound code
        222a | fe 04    : cp   $04
        222c | 20 01    : jr   nz,$222F
        222e | 35       : dec  (hl)      // decrease code
        222f | fe 08    : cp   $08
        2231 | 20 01    : jr   nz,$2234
        2233 | 34       : inc  (hl)      // increase code
        2234 | fe 10    : cp   $10
        2236 | 20 03    : jr   nz,$223B
        2238 | 7e       : ld   a,(hl)    // play sound
        2239 | 18 05    : jr   $2240
        223b | fe 01    : cp   $01
        223d | c0       : ret  nz
        223e | 3e 3d    : ld   a,$3D     // stop sound
        2240 | cd 0c 49 : call $490C     // send sound code
        2243 | c9       : ret
        -->
    </script>
    <script state="run">
        <output format="----- pesadelo sound test mode -----" 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="&lt;&lt; sound code %2.2X &gt;&gt;"   line="17" align="center">
            <argument>maincpu.pb@c100</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.mb@4168 =               34</action>
        <action>maincpu.mb@426c =               c8</action>
        <action>maincpu.mw@4121 =             44b4</action>
        <action>maincpu.mq@2220 = 77bee0093ac10121</action>
        <action>maincpu.mq@2228 = fe35012004fe2bc8</action>
        <action>maincpu.mq@2230 = 032010fe34012008</action>
        <action>maincpu.mq@2238 = 3d3ec001fe05187e</action>
        <action>maincpu.mq@2240 = 00000000c9490ccd</action>
    </script>
</cheat>

<cheat desc="reverse some hacks">
    <script state="on">
        <action>maincpu.mw@4106 = 46f1</action> <!-- konami logo -->
        <action>maincpu.mw@4202 = 490c</action> <!-- game over sound? -->
        <action>maincpu.mb@42ab =   00</action> <!-- starting stage -->
        <action>maincpu.mb@430d =   01</action> <!-- extra character -->
        <action>maincpu.mb@5fe1 =   01</action> <!-- invincibility timer -->
        <!-- message -->
        <action>maincpu.mq@4520 = 1d231b2d25272224</action>
        <action>maincpu.mq@452b = 1b21251f1e202a28</action>
        <action>maincpu.mq@4533 = 22281a398afe1d23</action>
        <action>maincpu.mq@453b = 1819110020211b2a</action>
        <action>maincpu.mq@4543 = 1f242c2b3a09fe16</action>
        <action>maincpu.mq@454b = 28001d1c1b2b2400</action>
        <action>maincpu.mw@4553 =             2e1d</action>
        <action>maincpu.md@455a =         2e1b292b</action>
        <action>maincpu.mq@4560 = caff000025231b25</action>
        <action>maincpu.mq@458a = 262200001d211b1e</action>
        <action>maincpu.mw@4592 =              231d</action>
        <action>maincpu.mq@4619 = 3c4299a1a199423c</action>
        <action>maincpu.mq@4650 = 0063636b7f7f7763</action>
    </script>
    <script state="off">
        <action>maincpu.mw@4106 =             4710</action>
        <action>maincpu.mw@4202 =             21b7</action>
        <action>maincpu.mb@42ab =               01</action>
        <action>maincpu.mb@430d =               00</action>
        <action>maincpu.mb@5fe1 =               03</action>
        <action>maincpu.mq@4520 = 2020002523222700</action>
        <action>maincpu.mq@452b = 1d1a1b241d2b0000</action>
        <action>maincpu.mq@4533 = 233200398afe2229</action>
        <action>maincpu.mq@453b = 181911002920241b</action>
        <action>maincpu.mq@4543 = 320000003a09fe19</action>
        <action>maincpu.mq@454b = 1d25232224001b22</action>
        <action>maincpu.mw@4553 =             0031</action>
        <action>maincpu.md@455a =         1b223200</action>
        <action>maincpu.mq@4560 = caff00311d252322</action>
        <action>maincpu.mq@458a = 00211b1f1c250000</action>
        <action>maincpu.mw@4592 =             0000</action>
        <action>maincpu.mq@4619 = 7c7e6363637e7c00</action>
        <action>maincpu.mq@4650 = 0039444545454545</action>
    </script>
</cheat>
"reverse some hacks" restores original program code (konami logo, message etc) but incomplete.
jman
Posts: 843
Joined: Tue Dec 01, 2020 1:24 pm

[pesadelo] Pesadelo

Post by jman »

Code: Select all

<!-- Pesadelo (bootleg of Konami Knightmare) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <!-- player -->
            <action>maincpu.mw@5FAE = 0030</action> <!-- boss -->
            <action>maincpu.mw@620C = C9AF</action> <!-- background -->
            <action>maincpu.mw@747E = 1938</action> <!-- enemy -->
            <action>maincpu.mw@8328 = 5E18</action> <!-- bullet -->
            <action>maincpu.mb@8D6D = C9  </action> <!-- earthquake (boss 6) -->
            <action>maincpu.mw@9094 = 0618</action> <!-- boss -->
            <!-- shield -->
            <action>maincpu.mw@8361 = C218</action>
        </script>
        <script state="off">
            <action>maincpu.mb@5FAE = 0b30</action>
            <action>maincpu.mw@620C = 43D6</action>
            <action>maincpu.mw@747E = 0438</action>
            <action>maincpu.mw@8328 = 5E38</action>
            <action>maincpu.mb@8d84 = C3  </action>
            <action>maincpu.mw@9094 = 0620</action>
            <action>maincpu.mw@8361 = C238</action>
        </script>
    </cheat>

    <cheat desc="rapid fire">
        <script state="on">
            <action>maincpu.mb@5D1F = 09</action> <!-- button -->
            <action>maincpu.mb@5D3B = CD</action> <!-- fire timer -->
        </script>
        <script state="off">
            <action>maincpu.mb@5D1F = 08</action>
            <action>maincpu.mb@5D3B = CC</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter>
            <item value="0x0808">01 (slow)</item>
            <item value="0x1010">02       </item>
            <item value="0x2020">03       </item>
            <item value="0x3030">04       </item>
            <item value="0x4040">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.md@5F12 = 0E185F16</action>
        </script>
        <script state="change">
            <action>maincpu.mw@5F16 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mq@5F12 = DD03FE0C7EDD62E2</action>
        </script>
    </cheat>

    <cheat desc="bullet speed">
        <parameter min="0x01" max="0x05" step="0x01" />
        <script state="on">
            <action>maincpu.mw@585A = 2200            </action>
            <action>maincpu.mq@2200 = 10C162ECCDC50006</action>
            <action>maincpu.mq@2208 = 000000000000C9F9</action>
            <!--
            2200 | 06 xx    : ld   b,$xx
            2202 | C5       : push bc
            2203 | CD EC 62 : call $62EC
            2206 | C1       : pop  bc
            2207 | 10 F9    : djnz $2202
            2209 | C9       : ret
            -->
        </script>
        <script state="change">
            <action>maincpu.mb@2201 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mw@585A = 62EC            </action>
            <action>maincpu.mq@2200 = 0000000000000000</action>
            <action>maincpu.mq@2208 = 0000000000000000</action>
        </script>
    </cheat>

    <cheat desc="hidden panel finder">
        <script state="on">
            <action>maincpu.md@6A38 = DD2210CD        </action>
            <action>maincpu.mq@2210 = 0000C90077DDFFCB</action>
            <!--
            2210 | CB FF    : set  7,a
            2212 | DD 77 00 : ld   (ix+$00),a
            2215 | C9       : ret
            -->
        </script>
        <script state="off">
            <action>maincpu.md@6A38 = DD0077DD        </action>
            <action>maincpu.mq@2210 = 0000000000000000</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@036C = AF              </action> <!-- initialize sound address -->
            <action>maincpu.mb@4168 = 00              </action> <!-- disable next sequence -->
            <action>maincpu.mb@426C = C9              </action> <!-- disable title screen -->
            <action>maincpu.mw@4121 = 2220            </action>
            <action>maincpu.mq@2220 = A1D3003EA0D30F3E</action>
            <action>maincpu.mq@2228 = 77BEE0093AEF0121</action>
            <action>maincpu.mq@2230 = FE35012004FE2BC8</action>
            <action>maincpu.mq@2238 = 042002FE34012008</action>
            <action>maincpu.mq@2240 = 052001FE0618F03E</action>
            <action>maincpu.mq@2248 = 2010FEC97786103E</action>
            <action>maincpu.mq@2250 = 3EC020FE05187E03</action>
            <action>maincpu.mq@2258 = 000000C9490CCD3D</action>
            <!--
            2220 | 3E 0F    : ld   a,$0F     // enable input
            2222 | D3 A0    : out  ($A0),a
            2224 | 3E 00    : ld   a,$00
            2226 | D3 A1    : out  ($A1),a
            2228 | 21 01 EF : ld   hl,$EF01  // input comparison address
            222B | 3A 09 E0 : ld   a,($E009) // read input
            222E | BE       : cp   (hl)
            222F | 77       : ld   (hl),a
            2230 | C8       : ret  z
            2231 | 2B       : dec  hl        // sound code address ($ef00)
            2232 | FE 04    : cp   $04
            2234 | 20 01    : jr   nz,$2237
            2236 | 35       : dec  (hl)      // decrease code -01
            2237 | FE 08    : cp   $08
            2239 | 20 01    : jr   nz,$223C
            223B | 34       : inc  (hl)      // increase code +01
            223C | FE 02    : cp   $02
            223E | 20 04    : jr   nz,$2244
            2240 | 3E F0    : ld   a,$F0     // decrease code -10
            2242 | 18 06    : jr   $224A
            2244 | FE 01    : cp   $01
            2246 | 20 05    : jr   nz,$224D
            2248 | 3E 10    : ld   a,$10     // increase code +10
            224A | 86       : add  a,(hl)
            224B | 77       : ld   (hl),a
            224C | C9       : ret
            224D | FE 10    : cp   $10
            224F | 20 03    : jr   nz,$2254
            2251 | 7E       : ld   a,(hl)    // play sound
            2252 | 18 05    : jr   $2259
            2254 | FE 20    : cp   $20
            2256 | C0       : ret  nz
            2257 | 3E 3D    : ld   a,$3D     // stop sound
            2259 | CD 0C 49 : call $490C     // send sound code
            225C | C9       : ret
            -->
        </script>
        <script state="run">
            <output format="----- pesadelo 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 : 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@EF00</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mb@036C = 2F              </action>
            <action>maincpu.mb@4168 = 34              </action>
            <action>maincpu.mb@426C = C8              </action>
            <action>maincpu.mw@4121 = 44B4            </action>
            <action>maincpu.mq@2220 = 0000000000000000</action>
            <action>maincpu.mq@2228 = 0000000000000000</action>
            <action>maincpu.mq@2230 = 0000000000000000</action>
            <action>maincpu.mq@2238 = 0000000000000000</action>
            <action>maincpu.mq@2240 = 0000000000000000</action>
            <action>maincpu.mq@2248 = 0000000000000000</action>
            <action>maincpu.mq@2250 = 0000000000000000</action>
            <action>maincpu.mq@2258 = 0000000000000000</action>
        </script>
    </cheat>

    <cheat desc="reverse some hacks">
        <script state="on">
            <action>maincpu.mw@4106 = 46F1</action> <!-- konami logo -->
            <action>maincpu.mw@4202 = 490C</action> <!-- game over sound? -->
            <action>maincpu.mb@42AB = 00  </action> <!-- starting stage -->
            <action>maincpu.mb@430D = 01  </action> <!-- extra character -->
            <action>maincpu.mb@5FE1 = 01  </action> <!-- flicker timer -->
            <!-- message -->
            <action>maincpu.mq@4520 = 1D231B2D25272224</action>
            <action>maincpu.mq@452B = 1B21251F1E202A28</action>
            <action>maincpu.mq@4533 = 22281A398AFE1D23</action>
            <action>maincpu.mq@453B = 1819110020211B2A</action>
            <action>maincpu.mq@4543 = 1F242C2B3A09FE16</action>
            <action>maincpu.mq@454B = 28001D1C1B2B2400</action>
            <action>maincpu.mw@4553 = 2E1D            </action>
            <action>maincpu.md@455A = 2E1B292B        </action>
            <action>maincpu.mq@4560 = CAFF000025231B25</action>
            <action>maincpu.mq@458A = 262200001D211B1E</action>
            <action>maincpu.mw@4592 = 231D            </action>
            <action>maincpu.mq@4619 = 3C4299A1A199423C</action>
            <action>maincpu.mq@4650 = 0063636B7F7F7763</action>
        </script>
        <script state="off">
            <action>maincpu.mw@4106 = 4710            </action>
            <action>maincpu.mw@4202 = 21B7            </action>
            <action>maincpu.mb@42AB = 01              </action>
            <action>maincpu.mb@430D = 00              </action>
            <action>maincpu.mb@5FE1 = 03              </action>
            <action>maincpu.mq@4520 = 2020002523222700</action>
            <action>maincpu.mq@452B = 1D1A1B241D2B0000</action>
            <action>maincpu.mq@4533 = 233200398AFE2229</action>
            <action>maincpu.mq@453B = 181911002920241B</action>
            <action>maincpu.mq@4543 = 320000003A09FE19</action>
            <action>maincpu.mq@454B = 1D25232224001B22</action>
            <action>maincpu.mw@4553 = 0031            </action>
            <action>maincpu.md@455A = 1B223200        </action>
            <action>maincpu.mq@4560 = CAFF00311D252322</action>
            <action>maincpu.mq@458A = 00211B1F1C250000</action>
            <action>maincpu.mw@4592 = 0000            </action>
            <action>maincpu.mq@4619 = 7C7E6363637E7C00</action>
            <action>maincpu.mq@4650 = 0039444545454545</action>
        </script>
    </cheat>

</mamecheat>
"sound test mode" : Improved. New code no longer needs to insert a credit after soft reset.
Post Reply