[leprechn] Leprechaun

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

[leprechn] Leprechaun

Post by jman »

Code: Select all

<!-- Leprechaun (set 1) -->
<mamecheat version="1">

    <cheat desc="player speed">
        <parameter>
            <item value="0x02">01 (slow)</item>
            <item value="0x08">02       </item>
            <item value="0x0c">03       </item>
            <item value="0x10">04       </item>
            <item value="0x14">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.mb@8c99 = a9</action> <!-- right -->
            <action>maincpu.mb@8ca4 = a9</action> <!-- upper-right -->
            <action>maincpu.mb@8cb2 = a9</action> <!-- up -->
            <action>maincpu.mb@8cbb = e9</action> <!-- upper-left : left -->
            <action>maincpu.mb@8cc0 = a9</action> <!-- upper-left : up -->
            <action>maincpu.mb@8cc9 = e9</action> <!-- left -->
            <action>maincpu.mb@8cd7 = e9</action> <!-- lower-left -->
            <action>maincpu.mb@8ce8 = e9</action> <!-- down -->
            <action>maincpu.mb@8cee = a9</action> <!-- lower-right : right -->
            <action>maincpu.mb@8cf6 = e9</action> <!-- lower-right : down -->
        </script>
        <script state="change">
            <action>maincpu.mb@8c9a = param</action>
            <action>maincpu.mb@8ca5 = param</action>
            <action>maincpu.mb@8cb3 = param</action>
            <action>maincpu.mb@8cbc = param</action>
            <action>maincpu.mb@8cc1 = param</action>
            <action>maincpu.mb@8cca = param</action>
            <action>maincpu.mb@8cd8 = param</action>
            <action>maincpu.mb@8ce9 = param</action>
            <action>maincpu.mb@8cef = param</action>
            <action>maincpu.mb@8cf7 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mw@8c99 = 13a5</action>
            <action>maincpu.mw@8ca4 = 14a5</action>
            <action>maincpu.mw@8cb2 = 13a5</action>
            <action>maincpu.mw@8cbb = 14e5</action>
            <action>maincpu.mw@8cc0 = 14a5</action>
            <action>maincpu.mw@8cc9 = 13e5</action>
            <action>maincpu.mw@8cd7 = 14e5</action>
            <action>maincpu.mw@8ce8 = 13e5</action>
            <action>maincpu.mw@8cee = 14a5</action>
            <action>maincpu.mw@8cf6 = 14e5</action>
        </script>
    </cheat>

    <cheat desc="sound test mode (test)">
        <!-- you can't stop "no loop" sound by sound stop button -->
        <comment>reset the game (F3) to enter sound test mode</comment>
        <script state="on">
            <action>maincpu.mq@f063 = 4af0ac2002a98184</action>
            <action>maincpu.mq@f06b = 2004a982854a4a4a</action>
            <action>maincpu.mq@f073 = f081c5a88205f0ac</action>
            <action>maincpu.mq@f07b = ca01d010c080a6e7</action>
            <action>maincpu.mq@f083 = d020c0e801d040c0</action>
            <action>maincpu.mq@f08b = 80c0aa10e9388a05</action>
            <action>maincpu.mq@f093 = 86aa1069188a05d0</action>
            <action>maincpu.mq@f09b = d002c006f008c080</action>
            <action>maincpu.mq@f0a3 = 634c30018e00a205</action>
            <action>maincpu.mq@f0ab = adeaea28008d78f0</action>
            <action>maincpu.mq@f0b3 = 85026058ff492801</action>
            <!--
            f065 | a9 02    : lda #$02
            f067 | 20 ac f0 : jsr $f0ac // read start buttons
            f06a | 4a       : lsr a
            f06b | 4a       : lsr a
            f06c | 4a       : lsr a
            f06d | 4a       : lsr a
            f06e | 85 82    : sta $82
            f070 | a9 04    : lda #$04
            f072 | 20 ac f0 : jsr $f0ac // read other inputs
            f075 | 05 82    : ora $82
            f077 | a8       : tay
            f078 | c5 81    : cmp $81
            f07a | f0 e7    : beq $f063
            f07c | a6 80    : ldx $80
            f07e | c0 10    : cpy #$10
            f080 | d0 01    : bne $f083
            f082 | ca       : dex       // decrease code -01
            f083 | c0 40    : cpy #$40
            f085 | d0 01    : bne $f088
            f087 | e8       : inx       // increase code +01
            f088 | c0 20    : cpy #$20
            f08a | d0 05    : bne $f091
            f08c | 8a       : txa       // decrease code -10
            f08d | 38       : sec
            f08e | e9 10    : sbc #$10
            f090 | aa       : tax
            f091 | c0 80    : cpy #$80
            f093 | d0 05    : bne $f09a
            f095 | 8a       : txa       // increase code +10
            f096 | 18       : clc
            f097 | 69 10    : adc #$10
            f099 | aa       : tax
            f09a | 86 80    : stx $80
            f09c | c0 08    : cpy #$08
            f09e | f0 06    : beq $f0a6 // play sound
            f0a0 | c0 02    : cpy #$02
            f0a2 | d0 05    : bne $f0a9
            f0a4 | a2 00    : ldx #$00  // stop sound
            f0a6 | 8e 01 30 : stx $3001
            f0a9 | 4c 63 f0 : jmp $f063
            f0ac | 78       : sei       // input read routine
            f0ad | 8d 00 28 : sta $2800
            f0b0 | ea       : nop
            f0b1 | ea       : nop
            f0b2 | ad 01 28 : lda $2801
            f0b5 | 49 ff    : eor #$ff
            f0b7 | 58       : cli
            f0b8 | 60       : rts
            -->
            <action>audiocpu.mw@e1fe = f047</action> <!-- reset audio cpu when sound code 0x00 is set -->
        </script>
        <script state="run">
            <output format="----- leprechaun 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="start 1 : play sound"                   line="15" align="center" />
            <output format="start 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@0080</argument>
            </output>
        </script>
        <script state="off">
            <action> maincpu.mq@f063 = 0aa9f0eb208b8520</action>
            <action> maincpu.mq@f06b = 02a92085f2a97a85</action>
            <action> maincpu.mq@f073 = 86a92285f4a92185</action>
            <action> maincpu.mq@f07b = e5a92685d1a92385</action>
            <action> maincpu.mq@f083 = 3fa93a85b7a92785</action>
            <action> maincpu.mq@f08b = 383aa58734203985</action>
            <action> maincpu.mq@f093 = 691820a53a8511e9</action>
            <action> maincpu.mq@f09b = 85006921a5208504</action>
            <action> maincpu.mq@f0a3 = 850aa9e1d07ac621</action>
            <action> maincpu.mq@f0ab = 8502a91a85caa97a</action>
            <action> maincpu.mq@f0b3 = 8502a92085ada91b</action>
            <action>audiocpu.mw@e1fe =             f1a5</action>
        </script>
    </cheat>

</mamecheat>
"sound test mode" : you can't stop "no loop" sound by sound stop button. So sound code : 0x01,0x02,0x06,0x07 and 0x08 are stoppable because of "loop" sound.
NOTE : music (0x06,0x07 and 0x08) have problem in 0.257 (see https://mametesters.org/view.php?id=293).
Post Reply