Page 1 of 1

[failgate] Fail Gate

Posted: Sat Feb 26, 2022 8:30 am
by jman
failgate was added on 0.241.

Code: Select all

<cheat desc="no hit">
    <script state="on">
        <action>maincpu.mb@5fb1 = 18</action>
    </script>
    <script state="off">
        <action>maincpu.mb@5fb1 = 30</action>
    </script>
</cheat>

<cheat desc="skip ram/rom check">
    <script state="on">
        <action>maincpu.mw@005d = 2618</action> <!-- ram -->
        <action>maincpu.mw@00a8 = 2518</action> <!-- rom -->
    </script>
    <script state="off">
        <action>maincpu.mw@005d = 0021</action>
        <action>maincpu.mw@00a8 = 0021</action>
    </script>
</cheat>

[failgate] sound test mode

Posted: Sun Apr 03, 2022 1:34 pm
by jman

Code: Select all

<cheat desc="sound test mode">
    <comment>reset the game (F3) to enter sound test mode</comment>
    <script state="on">
        <action>maincpu.md@0117 =         cd7de0c3</action>
        <action>maincpu.mq@7de0 = 47b8c0003ae20021</action>
        <action>maincpu.mq@7de8 = fe350120fbfef628</action>
        <action>maincpu.mq@7df0 = 0520effe340120f7</action>
        <action>maincpu.mq@7df8 = 20dffe07185e8016</action>
        <action>maincpu.mq@7e00 = 18020bcd82ff1106</action>
        <action>maincpu.mq@7e08 = 00000000000000d7</action>
        <!--
        7de0 | 21 00 e2 : ld   hl,$E200  // sound code address
        7de3 | 3a 00 c0 : ld   a,($C000) // read input
        7de6 | b8       : cp   b
        7de7 | 47       : ld   b,a
        7de8 | 28 f6    : jr   z,$7DE0
        7dea | fe fb    : cp   $FB
        7dec | 20 01    : jr   nz,$7DEF
        7dee | 35       : dec  (hl)      // decrease code
        7def | fe f7    : cp   $F7
        7df1 | 20 01    : jr   nz,$7DF4
        7df3 | 34       : inc  (hl)      // increase code
        7df4 | fe ef    : cp   $EF
        7df6 | 20 05    : jr   nz,$7DFD
        7df8 | 16 80    : ld   d,$80     // play sound
        7dfa | 5e       : ld   e,(hl)
        7dfb | 18 07    : jr   $7E04
        7dfd | fe df    : cp   $DF
        7dff | 20 06    : jr   nz,$7E07
        7e01 | 11 ff 82 : ld   de,$82FF  // stop sound
        7e04 | cd 0b 02 : call $020B     // send sound code
        7e07 | 18 d7    : jr   $7DE0
        -->
    </script>
    <script state="run">
        <output format="----- fail gate 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="button 2 : 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@e200</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.md@0117 =         cd82ff11</action>
        <action>maincpu.mq@7de0 = 0000000000000000</action>
        <action>maincpu.mq@7de8 = 0000000000000000</action>
        <action>maincpu.mq@7df0 = 0000000000000000</action>
        <action>maincpu.mq@7df8 = 0000000000000000</action>
        <action>maincpu.mq@7e00 = 0000000000000000</action>
        <action>maincpu.mq@7e08 = 0000000000000000</action>
    </script>
</cheat>

[failgate] Fail Gate (update)

Posted: Fri Dec 23, 2022 10:06 am
by jman

Code: Select all

<cheat desc="no inertia (test)">
    <script state="on">
        <action> maincpu.md@315e =         ddb780cd</action>
        <action> maincpu.md@3165 =         afb780cd</action>
        <action>maindata.mq@3780 = cd04206fcbeb633a</action>
        <action>maindata.mq@3788 = dd0077ddafc9051c</action>
        <action>maindata.mq@3790 = ffffc90277dd0177</action>
        <!--
        b780 | 3a 63 eb : ld   a,($EB63)
        b783 | cb 6f    : bit  5,a
        b785 | 20 04    : jr   nz,$B78B
        b787 | cd 1c 05 : call $051C
        b78a | c9       : ret
        b78b | af       : xor  a
        b78c | dd 77 00 : ld   (ix+$00),a
        b78f | dd 77 01 : ld   (ix+$01),a
        b792 | dd 77 02 : ld   (ix+$02),a
        b795 | c9       : ret
        -->
    </script>
    <script state="off">
        <action> maincpu.md@315e =         dd051ccd</action>
        <action> maincpu.md@3165 =         af051ccd</action>
        <action>maindata.mq@3780 = ffffffffffffffff</action>
        <action>maindata.mq@3788 = ffffffffffffffff</action>
        <action>maindata.mq@3790 = ffffffffffffffff</action>
    </script>
</cheat>
"no inertia" : add new as test code because inertia works during holding button 2.

Code: Select all

<cheat desc="direct turn">
    <script state="on">
        <action> maincpu.md@3154 =         01b760cd</action>
        <action>maindata.mq@3760 = e62feb633ab77121</action>
        <action>maindata.mq@3768 = c9eaf0327e6f850f</action>
        <action>maindata.mq@3770 = 0a0e0cff0800ffff</action>
        <action>maindata.mq@3778 = ffffffff060204ff</action>
        <!--
        b760 | 21 71 b7 : ld  hl,$B771
        b763 | 3a 63 eb : ld  a,($EB63)
        b766 | 2f       : cpl
        b767 | e6 0f    : and $0F
        b769 | 85       : add a,l
        b76a | 6f       : ld  l,a
        b76b | 7e       : ld  a,(hl)
        b76c | 32 f0 ea : ld  ($EAF0),a
        b76f | c9       : ret
        b770 - b7bb     : input/direction conversion table
         input direction
          01    00      : up
          02    08      : down
          04    0c      : left
          05    0e      : upper-left
          06    0a      : lower-left
          08    04      : right
          09    02      : upper-right
          0a    06      : lower-right
        -->
    </script>
    <script state="off">
        <action> maincpu.md@3154 =         01eaf032</action>
        <action>maindata.mq@3760 = ffffffffffffffff</action>
        <action>maindata.mq@3768 = ffffffffffffffff</action>
        <action>maindata.mq@3770 = ffffffffffffffff</action>
        <action>maindata.mq@3778 = ffffffffffffffff</action>
    </script>
</cheat>
"direct turn" : add new.

Code: Select all

<cheat desc="sound test mode">
    <comment>reset the game (F3) to enter sound test mode</comment>
    <script state="on">
        <action>maincpu.md@0117 =         cd7de0c3</action>
        <action>maincpu.mq@7de0 = 47b8c0003ae20021</action>
        <action>maincpu.mq@7de8 = fe350120fbfef928</action>
        <action>maincpu.mq@7df0 = 0420fdfe340120f7</action>
        <action>maincpu.mq@7df8 = 0520fefe0618f03e</action>
        <action>maincpu.mq@7e00 = 20effe787786103e</action>
        <action>maincpu.mq@7e08 = dffe07185e801605</action>
        <action>maincpu.mq@7e10 = 020bcd82ff110620</action>
        <action>maincpu.mq@7e18 = 000000000000c618</action>
        <!--
        7de0 | 21 00 e2 : ld   hl,$E200  // sound code address
        7de3 | 3a 00 c0 : ld   a,($C000) // read input
        7de6 | b8       : cp   b
        7de7 | 47       : ld   b,a
        7de8 | 28 f9    : jr   z,$7DE3
        7dea | fe fb    : cp   $FB
        7dec | 20 01    : jr   nz,$7DEF
        7dee | 35       : dec  (hl)      // decrease code -01
        7def | fe f7    : cp   $F7
        7df1 | 20 01    : jr   nz,$7DF4
        7df3 | 34       : inc  (hl)      // increase code +01
        7df4 | fe fd    : cp   $FD
        7df6 | 20 04    : jr   nz,$7DFC
        7df8 | 3e f0    : ld   a,$F0     // decrease code -10
        7dfa | 18 06    : jr   $7E02
        7dfc | fe fe    : cp   $FE
        7dfe | 20 05    : jr   nz,$7E05
        7e00 | 3e 10    : ld   a,$10     // increase code +10
        7e02 | 86       : add  a,(hl)
        7e03 | 77       : ld   (hl),a
        7e04 | 78       : ld   a,b
        7e05 | fe ef    : cp   $EF
        7e07 | 20 05    : jr   nz,$7E0E
        7e09 | 16 80    : ld   d,$80     // play sound
        7e0b | 5e       : ld   e,(hl)
        7e0c | 18 07    : jr   $7E15
        7e0e | fe df    : cp   $DF
        7e10 | 20 06    : jr   nz,$7E18
        7e12 | 11 ff 82 : ld   de,$82FF  // stop sound
        7e15 | cd 0b 02 : call $020B     // send sound code
        7e18 | 18 c6    : jr   $7DE0
        -->
    </script>
    <script state="run">
        <output format="----- fail gate 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@e200</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.md@0117 =         cd82ff11</action>
        <action>maincpu.mq@7de0 = 0000000000000000</action>
        <action>maincpu.mq@7de8 = 0000000000000000</action>
        <action>maincpu.mq@7df0 = 0000000000000000</action>
        <action>maincpu.mq@7df8 = 0000000000000000</action>
        <action>maincpu.mq@7e00 = 0000000000000000</action>
        <action>maincpu.mq@7e08 = 0000000000000000</action>
        <action>maincpu.mq@7e10 = 0000000000000000</action>
        <action>maincpu.mq@7e18 = 0000000000000000</action>
    </script>
</cheat>
"sound test mode" : rewrite routine. add up/down key (code ±10).

[failgate] Fail Gate

Posted: Sun Dec 08, 2024 4:27 pm
by jman
failgate.xml

Code: Select all

<!-- Fail Gate -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>maincpu.mb@5FB1 = 18</action>
        </script>
        <script state="off">
            <action>maincpu.mb@5FB1 = 30</action>
        </script>
    </cheat>

    <cheat desc="energy speed">
        <parameter>
            <item value="0x0f">01 (slow)</item>
            <item value="0x07">02       </item>
            <item value="0x03">03       </item>
            <item value="0x01">04       </item>
            <item value="0x00">05 (fast)</item>
        </parameter>
        <script state="on">
            <action> maincpu.md@21A7 = 00B7A0CD        </action>
            <action>maindata.mq@37A0 = EAA02A00E6E1163A</action>
            <action>maindata.mq@37A8 = FFFFFFFFFFC923C0</action>
            <!--
            B7A0 | 3A 16 E1 : ld   a,($E116)  // check internal timer
            B7A3 | E6 xx    : and  $xx
            B7A5 | 2A A0 EA : ld   hl,($EAA0)
            B7A8 | C0       : ret  nz
            B7A9 | 23       : inc  hl
            B7AA | C9       : ret
            -->
        </script>
        <script state="change">
            <action>maindata.mb@37A4 = param</action>
        </script>
        <script state="off">
            <action> maincpu.md@21A7 = 23EAA02A        </action>
            <action>maindata.mq@37A0 = FFFFFFFFFFFFFFFF</action>
            <action>maindata.mq@37A8 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="no inertia (test)">
        <comment>inertia works during holding button 2</comment>
        <script state="on">
            <action> maincpu.mw@315F = B780            </action>
            <action> maincpu.mw@3166 = B780            </action>
            <action>maindata.mq@3780 = CD04206FCBEB633A</action>
            <action>maindata.mq@3788 = DD0077DDAFC9051C</action>
            <action>maindata.mq@3790 = FFFFC90277DD0177</action>
            <!--
            B780 | 3A 63 EB : ld   a,($EB63)
            B783 | CB 6F    : bit  5,a
            B785 | 20 04    : jr   nz,$B78B
            B787 | CD 1C 05 : call $051C
            B78A | C9       : ret
            B78B | AF       : xor  a
            B78C | DD 77 00 : ld   (ix+$00),a
            B78F | DD 77 01 : ld   (ix+$01),a
            B792 | DD 77 02 : ld   (ix+$02),a
            B795 | C9       : ret
            -->
        </script>
        <script state="off">
            <action> maincpu.mw@315F = 051C            </action>
            <action> maincpu.mw@3166 = 051C            </action>
            <action>maindata.mq@3780 = FFFFFFFFFFFFFFFF</action>
            <action>maindata.mq@3788 = FFFFFFFFFFFFFFFF</action>
            <action>maindata.mq@3790 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="direct turn">
        <script state="on">
            <action> maincpu.md@3154 = 01B760CD        </action>
            <action>maindata.mq@3760 = E62FEB633AB77121</action>
            <action>maindata.mq@3768 = C9EAF0327E6F850F</action>
            <action>maindata.mq@3770 = 0A0E0CFF0800FFFF</action>
            <action>maindata.mq@3778 = FFFFFFFF060204FF</action>
            <!--
            B760 | 21 71 B7 : ld   hl,$B771
            B763 | 3A 63 EB : ld   a,($EB63)
            B766 | 2F       : cpl
            B767 | E6 0F    : and  $0F
            B769 | 85       : add  a,l
            B76A | 6F       : ld   l,a
            B76B | 7E       : ld   a,(hl)
            B76C | 32 F0 EA : ld   ($EAF0),a
            B76F | C9       : ret
            B770 - B77B     : input/direction conversion table
             input direction
              01    00      : up
              02    08      : down
              04    0c      : left
              05    0e      : upper-left
              06    0a      : lower-left
              08    04      : right
              09    02      : upper-right
              0a    06      : lower-right
            -->
        </script>
        <script state="off">
            <action> maincpu.md@3154 = 01EAF032        </action>
            <action>maindata.mq@3760 = FFFFFFFFFFFFFFFF</action>
            <action>maindata.mq@3768 = FFFFFFFFFFFFFFFF</action>
            <action>maindata.mq@3770 = FFFFFFFFFFFFFFFF</action>
            <action>maindata.mq@3778 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="easy round finish (test)">
        <!-- sometimes 1P changes 2P character in result screen -->
        <comment>this code doesn't work in bonus stage</comment>
        <script state="on">
            <action> maincpu.md@231E = E6B7B0CD        </action>
            <action>maindata.mq@37B0 = EB043A67CBC0023A</action>
            <action>maindata.mq@37B8 = EB2032EAF532AFC0</action>
            <action>maindata.mq@37C0 = EB2F32EB0432083E</action>
            <action>maindata.mq@37C8 = FFFFFFFFFFFFFFC9</action>
            <!--
            B7B0 | 3A 02 C0 : ld   a,($C002)
            B7B3 | CB 67    : bit  4,a       // check 1P start button
            B7B5 | 3A 04 EB : ld   a,($EB04)
            B7B8 | C0       : ret  nz
            B7B9 | AF       : xor  a
            B7BA | 32 F5 EA : ld   ($EAF5),a
            B7BD | 32 20 EB : ld   ($EB20),a
            B7C0 | 3E 08    : ld   a,$08
            B7C2 | 32 04 EB : ld   ($EB04),a
            B7C5 | 32 2F EB : ld   ($EB2F),a
            B7C8 | C9       : ret
            -->
        </script>
        <script state="off">
            <action> maincpu.md@231E = E6EB043A        </action>
            <action>maindata.mq@37B0 = FFFFFFFFFFFFFFFF</action>
            <action>maindata.mq@37B8 = FFFFFFFFFFFFFFFF</action>
            <action>maindata.mq@37C0 = 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.md@0117 = CD7DE0C3        </action>
            <action>maincpu.mq@7DE0 = 47B8C0003AE10021</action>
            <action>maincpu.mq@7DE8 = FE350120FBFEF928</action>
            <action>maincpu.mq@7DF0 = 0420FDFE340120F7</action>
            <action>maincpu.mq@7DF8 = 0520FEFE0618F03E</action>
            <action>maincpu.mq@7E00 = 20EFFE787786103E</action>
            <action>maincpu.mq@7E08 = DFFE07185E801605</action>
            <action>maincpu.mq@7E10 = 020BCD82FF110620</action>
            <action>maincpu.mq@7E18 = 000000000000C618</action>
            <!--
            7DE0 | 21 00 E1 : ld   hl,$E100  // sound code address
            7DE3 | 3A 00 C0 : ld   a,($C000) // read input
            7DE6 | B8       : cp   b
            7DE7 | 47       : ld   b,a
            7DE8 | 28 F9    : jr   z,$7DE3
            7DEA | FE FB    : cp   $FB
            7DEC | 20 01    : jr   nz,$7DEF
            7DEE | 35       : dec  (hl)      // decrease code -01
            7DEF | FE F7    : cp   $F7
            7DF1 | 20 01    : jr   nz,$7DF4
            7DF3 | 34       : inc  (hl)      // increase code +01
            7DF4 | FE FD    : cp   $FD
            7DF6 | 20 04    : jr   nz,$7DFC
            7DF8 | 3E F0    : ld   a,$F0     // decrease code -10
            7DFA | 18 06    : jr   $7E02
            7DFC | FE FE    : cp   $FE
            7DFE | 20 05    : jr   nz,$7E05
            7E00 | 3E 10    : ld   a,$10     // increase code +10
            7E02 | 86       : add  a,(hl)
            7E03 | 77       : ld   (hl),a
            7E04 | 78       : ld   a,b
            7E05 | FE EF    : cp   $EF
            7E07 | 20 05    : jr   nz,$7E0E
            7E09 | 16 80    : ld   d,$80     // play sound
            7E0B | 5E       : ld   e,(hl)
            7E0C | 18 07    : jr   $7E15
            7E0E | FE DF    : cp   $DF
            7E10 | 20 06    : jr   nz,$7E18
            7E12 | 11 FF 82 : ld   de,$82FF // stop sound
            7E15 | CD 0B 02 : call $020B    // send sound code
            7E18 | 18 C6    : jr   $7DE0
            -->
        </script>
        <script state="run">
            <output format="----- 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 %02X &gt;&gt;" line="19" align="center"  >
                <argument>maincpu.pb@E100</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.md@0117 = CD82FF11        </action>
            <action>maincpu.mq@7DE0 = 0000000000000000</action>
            <action>maincpu.mq@7DE8 = 0000000000000000</action>
            <action>maincpu.mq@7DF0 = 0000000000000000</action>
            <action>maincpu.mq@7DF8 = 0000000000000000</action>
            <action>maincpu.mq@7E00 = 0000000000000000</action>
            <action>maincpu.mq@7E08 = 0000000000000000</action>
            <action>maincpu.mq@7E10 = 0000000000000000</action>
            <action>maincpu.mq@7E18 = 0000000000000000</action>
        </script>
    </cheat>

    <cheat desc="skip ram/rom check">
        <script state="on">
            <action>maincpu.mw@005D = 2618</action> <!-- ram -->
            <action>maincpu.mw@00A8 = 2518</action> <!-- rom -->
        </script>
        <script state="off">
            <action>maincpu.mw@005D = 0021</action>
            <action>maincpu.mw@00A8 = 0021</action>
        </script>
    </cheat>

</mamecheat>
  • "energy speed" : Added new.
  • "easy round finish" : Added new as test code. Sometimes 1P character changes 2P character in result screen.