Page 1 of 1

[daikaiju] Daikaiju no Gyakushu

Posted: Fri Jul 23, 2021 9:03 am
by jman
First of all, this game has in-game rom check so that the following codes cause game crash unless you use together with "skip rom check" code.

Code: Select all

<cheat desc="no hit">
    <script state="on">
        <action>maincpu.mb@6aaf =   00</action> <!-- bullet -->
        <action>maincpu.mw@55cc = 55ce</action> <!-- enemy -->
    </script>
    <script state="off">
        <action>maincpu.mb@6aaf =   0f</action>
        <action>maincpu.mw@55cc = 5696</action>
    </script>
</cheat>

<cheat desc="auto fire - shot">
    <script state="on">
        <action>maincpu.md@42b3 =         0e0020c3</action>
        <action>maincpu.mq@0020 = beff323cbeff3a4f</action>
        <action>maincpu.mq@0028 = 0042b6c379c84fcb</action>
        <!--
        0020 | 4f       : ld  c,a
        0021 | 3a ff be : ld  a,($beff)
        0024 | 3c       : inc a
        0025 | 32 ff be : ld  ($beff),a
        0028 | cb 4f    : bit 1,a
        002a | c8       : ret z
        002b | 79       : ld  a,c
        002c | c3 b6 42 : jp  $42b6
        -->
    </script>
    <script state="off">
        <action>maincpu.md@42b3 =         0ec877cb</action>
        <action>maincpu.mq@0020 = 0000000000000000</action>
        <action>maincpu.mq@0020 = 0000000000000000</action>
    </script>
</cheat>

<cheat desc="walk through wall">
    <script state="on">
        <action>maincpu.mb@433f = 00</action>
    </script>
    <script state="off">
        <action>maincpu.mb@433f = b1</action>
    </script>
</cheat>

<cheat desc="player speed">
    <parameter min="0x01" max="0x06" step="0x01" />
    <script state="on">
        <action>maincpu.md@04378 =         dd9f30cd</action>
        <action>maincpu.md@04382 =         dd9f30cd</action>
        <action>maincpu.mq@17f30 = 003ec8a77a56235e</action>
        <action>maincpu.mq@17f38 = ffc95744ed9f3df2</action>
        <!--
        9f30 | 5e       : ld  e,(hl)
        9f31 | 23       : inc hl
        9f32 | 56       : ld  d,(hl)
        9f33 | 7a       : ld  a,d
        9f34 | a7       : and a
        9f35 | c8       : ret z
        9f36 | 3e xx    : ld  a,$xx
        9f38 | f2 3d 9f : jp  p,$9f3d
        9f3b | ed 44    : neg
        9f3d | 57       : ld  d,a
        9f3e | c9       : ret
        -->
    </script>
    <script state="change">
        <action>maincpu.mb@17f37 = param</action>
    </script>
    <script state="off">
        <action>maincpu.md@04378 =         dd56235e</action>
        <action>maincpu.md@04382 =         dd56235e</action>
        <action>maincpu.mq@17f30 = ffffffffffffffff</action>
        <action>maincpu.mq@17f38 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="direct turn">
    <script state="on">
        <action>maincpu.mb@4326 = 32</action>
    </script>
    <script state="off">
        <action>maincpu.mb@4326 = 3a</action>
    </script>
</cheat>

<cheat desc="sound test mode">
    <comment>set rom check skip code then reset the game (F3)</comment>
    <script state="on">
        <action>maincpu.mq@000b0 = 9b80c3ea0032063e</action>
        <action>maincpu.mq@15b80 = 22d59b8311000021</action>
        <action>maincpu.mq@15b88 = c86fbde8043aa100</action>
        <action>maincpu.mq@15b90 = 20fdfe250120fefe</action>
        <action>maincpu.mq@15b98 = 187c0320effe2401</action>
        <action>maincpu.mq@15ba0 = 0032fe3ec0dffe05</action>
        <action>maincpu.mq@15ba8 = ffffffffffffc9ec</action>
        <!--
        00b0 | 3e 06    : ld   a,$06
        00b2 | 32 00 ea : ld   ($ea00),a  // set bank
        00b5 | c3 80 9b : jp   $9b80
        9b80 | 21 00 00 : ld   hl,$0000   // initialize sound and input values
        9b83 | 11 83 9b : ld   de,$9b83
        9b86 | d5       : push de
        9b87 | 22 00 a1 : ld   ($a100),hl
        9b8a | 3a 04 e8 : ld   a,($e804)  // read input
        9b8d | bd       : cp   l
        9b8e | 6f       : ld   l,a
        9b8f | c8       : ret  z
        9b90 | fe fe    : cp   $fe
        9b92 | 20 01    : jr   nz,$9b95
        9b94 | 25       : dec  h          // decrease code
        9b95 | fe fd    : cp   $fd
        9b97 | 20 01    : jr   nz,$9b9a
        9b99 | 24       : inc  h          // increase code
        9b9a | fe ef    : cp   $ef
        9b9c | 20 03    : jr   nz,$9ba1
        9b9e | 7c       : ld   a,h        // play sound
        9b9f | 18 05    : jr   $9ba6
        9ba1 | fe df    : cp   $df
        9ba3 | c0       : ret  nz
        9ba4 | 3e fe    : ld   a,$fe      // stop sound
        9ba6 | 32 00 ec : ld   ($ec00),a  // send sound code
        9ba9 | c9       : ret
        -->
    </script>
    <script state="run">
        <output format="----- daikaiju no gyakushu 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@a101</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.mq@000b0 = 86cba020210406c3</action>
        <action>maincpu.mq@15b80 = ffffffffffffffff</action>
        <action>maincpu.mq@15b88 = ffffffffffffffff</action>
        <action>maincpu.mq@15b90 = ffffffffffffffff</action>
        <action>maincpu.mq@15b98 = ffffffffffffffff</action>
        <action>maincpu.mq@15ba0 = ffffffffffffffff</action>
        <action>maincpu.mq@15ba8 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="skip rom check">
    <script state="on">
        <action>maincpu.mb@07b6 = c9</action> <!-- boot -->
        <action>maincpu.mb@01cb = c9</action> <!-- ingame -->
        <action>maincpu.mb@4055 = c9</action> <!-- ingame -->
        <action>maincpu.mb@4203 = c9</action> <!-- ingame -->
        <action>maincpu.mb@4721 = c9</action> <!-- ingame -->
        <action>maincpu.mb@4c66 = c9</action> <!-- ingame -->
        <action>maincpu.mb@4fca = c9</action> <!-- ingame -->
    </script>
    <script state="off">
        <action>maincpu.mb@07b6 = 21</action>
        <action>maincpu.mb@01cb = 2a</action>
        <action>maincpu.mb@4055 = 2a</action>
        <action>maincpu.mb@4203 = 2a</action>
        <action>maincpu.mb@4721 = 2a</action>
        <action>maincpu.mb@4c66 = 2a</action>
        <action>maincpu.mb@4fca = 2a</action>
    </script>
</cheat>
"direct turn" is unique. Player character doesn't turn to a certain direction quickly in this game. For example, when you want to turn to right from left, character's face turns to left → lower-left → down → lower-right → right. "direct turn" (left → right) will be implemented by this code.

[daikaiju] Daikaiju no Gyakushu (update)

Posted: Sat Nov 26, 2022 8:27 am
by jman

Code: Select all

<cheat desc="auto fire - shot">
    <script state="on">
        <action>maincpu.md@42b3 =         0e0020cd</action>
        <action>maincpu.mq@0020 = c051cb344ebeff21</action>
        <action>maincpu.mq@0028 = 000000000000c9c1</action>
        <!--
        0020 | 21 ff be : ld  hl,$BEFF
        0023 | 4e       : ld  c,(hl)
        0024 | 34       : inc (hl)
        0025 | cb 51    : bit 2,c
        0027 | c0       : ret nz
        0028 | c1       : pop bc
        0029 | c9       : ret
        -->
    </script>
    <script state="off">
        <action>maincpu.md@42b3 =         0ec877cb</action>
        <action>maincpu.mq@0020 = 0000000000000000</action>
        <action>maincpu.mq@0028 = 0000000000000000</action>
    </script>
</cheat>
"auto fire" : rewrite routine.

Code: Select all

<cheat desc="player speed">
    <parameter>
        <item value="0x00d0">01 (slow)</item>
        <item value="0x02d0">02       </item>
        <item value="0x0400">03       </item>
        <item value="0x0600">04       </item>
        <item value="0x0800">05 (fast)</item>
    </parameter>
    <script state="on">
        <action>maincpu.md@04378 =         dd9f30cd</action> <!-- y position -->
        <action>maincpu.md@04382 =         dd9f30cd</action> <!-- x position -->
        <action>maincpu.mq@17f30 = a77ac8b37a56235e</action>
        <action>maincpu.mq@17f38 = c9000011f0000011</action>
        <!--
        9f30 | 5e       : ld  e,(hl)
        9f31 | 23       : inc hl
        9f32 | 56       : ld  d,(hl)
        9f33 | 7a       : ld  a,d
        9f34 | b3       : or  e
        9f35 | c8       : ret z
        9f36 | 7a       : ld  a,d
        9f37 | a7       : and a
        9f38 | 11 xx xx : ld  de,$xxxx
        9f3b | f0       : ret p
        9f3c | 11 xx xx : ld  de,$xxxx
        9f3f | c9       : ret
        -->
    </script>
    <script state="change">
        <action>maincpu.mw@17f39 =  param</action>
        <action>maincpu.mw@17f3d = -param</action>
    </script>
    <script state="off">
        <action>maincpu.md@04378 =         dd56235e</action>
        <action>maincpu.md@04382 =         dd56235e</action>
        <action>maincpu.mq@17f30 = ffffffffffffffff</action>
        <action>maincpu.mq@17f38 = ffffffffffffffff</action>
    </script>
</cheat>
"player speed" : rewrite routine. change parameter from value to item.

Code: Select all

<cheat desc="sound test mode">
    <comment>set &quot;skip rom check&quot; then reset the game (F3)</comment>
    <script state="on">
        <action>maincpu.mq@000b0 = 9b80c3ea0032063e</action>
        <action>maincpu.mq@15b80 = 47b8e8043aa10021</action>
        <action>maincpu.mq@15b88 = fe350120fefef928</action>
        <action>maincpu.mq@15b90 = 0420fbfe340120fd</action>
        <action>maincpu.mq@15b98 = 0520f7fe0618f03e</action>
        <action>maincpu.mq@15ba0 = 20effe787786103e</action>
        <action>maincpu.mq@15ba8 = 0520dffe06187e03</action>
        <action>maincpu.mq@15bb0 = ffcc18ec0032fe3e</action>
        <!--
        00b0 | 3e 06    : ld  a,$06
        00b2 | 32 00 ea : ld  ($EA00),a // set rom bank
        00b5 | c3 80 9b : jp  $9B80
        ===============================
        9b80 | 21 00 a1 : ld  hl,$A100  // sound code address
        9b83 | 3a 04 e8 : ld  a,($E804) // read input
        9b86 | b8       : cp  b
        9b87 | 47       : ld  b,a
        9b88 | 28 f9    : jr  z,$9B83
        9b8a | fe fe    : cp  $FE
        9b8c | 20 01    : jr  nz,$9B8F
        9b8e | 35       : dec (hl)      // decrease code -01
        9b8f | fe fd    : cp  $FD
        9b91 | 20 01    : jr  nz,$9B94
        9b93 | 34       : inc (hl)      // increase code +01
        9b94 | fe fb    : cp  $FB
        9b96 | 20 04    : jr  nz,$9B9C
        9b98 | 3e f0    : ld  a,$F0     // decrease code -10
        9b9a | 18 06    : jr  $9BA2
        9b9c | fe f7    : cp  $F7
        9b9e | 20 05    : jr  nz,$9BA5
        9ba0 | 3e 10    : ld  a,$10     // increase code +10
        9ba2 | 86       : add a,(hl)
        9ba3 | 77       : ld  (hl),a
        9ba4 | 78       : ld  a,b
        9ba5 | fe ef    : cp  $EF
        9ba7 | 20 03    : jr  nz,$9BAC
        9ba9 | 7e       : ld  a,(hl)    // play sound
        9baa | 18 06    : jr  $9BB2
        9bac | fe df    : cp  $DF
        9bae | 20 05    : jr  nz,$9BB5
        9bb0 | 3e fe    : ld  a,$FE     // stop sound
        9bb2 | 32 00 ec : ld  ($EC00),a // send sound code
        9bb5 | 18 cc    : jr  $9B83
        -->
    </script>
    <script state="run">
        <output format="----- daikaiju no gyakushu 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@a100</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.mq@000b0 = 86cba020210406c3</action>
        <action>maincpu.mq@15b80 = ffffffffffffffff</action>
        <action>maincpu.mq@15b88 = ffffffffffffffff</action>
        <action>maincpu.mq@15b90 = ffffffffffffffff</action>
        <action>maincpu.mq@15b98 = ffffffffffffffff</action>
        <action>maincpu.mq@15ba0 = ffffffffffffffff</action>
        <action>maincpu.mq@15ba8 = ffffffffffffffff</action>
        <action>maincpu.mq@15bb0 = ffffffffffffffff</action>
    </script>
</cheat>
"sound test mode" : rewrite routine. add up/down key (code ±10).

[daikaiju] Daikaiju no Gyakushu

Posted: Tue Nov 19, 2024 10:27 am
by jman
daikaiju.xml

Code: Select all

<!-- Daikaiju no Gyakushu (rev 1) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>maincpu.mw@55CC = 55CE</action> <!-- enemy -->
            <action>maincpu.mw@6AAE = 0028</action> <!-- bullet -->
        </script>
        <script state="off">
            <action>maincpu.mw@55CC = 5696</action>
            <action>maincpu.mw@6AAE = 0F28</action>
        </script>
    </cheat>

    <cheat desc="walk through wall">
        <script state="on">
            <action>maincpu.mb@433F = 00</action>
        </script>
        <script state="off">
            <action>maincpu.mb@433F = B1</action>
        </script>
    </cheat>

    <cheat desc="rapid fire">
        <script state="on">
            <!-- shot -->
            <action>maincpu.md@42B3 = 0E0020CD        </action>
            <action>maincpu.mq@0020 = C1C051CB4EA00021</action>
            <action>maincpu.mq@0028 = 00000000000000C9</action>
            <!--
            0020 | 21 FF BE : ld   hl,$A000
            0023 | 4E       : ld   c,(hl)
            0024 | CB 51    : bit  2,c
            0026 | C0       : ret  nz
            0027 | C1       : pop  bc
            0028 | C9       : ret
            -->
            <!-- fire -->
            <action>maincpu.mb@46D8 = 08</action>
        </script>
        <script state="off">
            <action>maincpu.md@42B3 = 0EC877CB        </action>
            <action>maincpu.mq@0020 = 0000000000000000</action>
            <action>maincpu.mq@0028 = 0000000000000000</action>
            <action>maincpu.mb@46D8 = 0F              </action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter>
            <item value="0x0080">01 (slow)</item>
            <item value="0x0200">02       </item>
            <item value="0x0400">03       </item>
            <item value="0x0600">04       </item>
            <item value="0x0800">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.md@04378 = DD9F30CD        </action> <!-- y position -->
            <action>maincpu.md@04382 = DD9F30CD        </action> <!-- x position -->
            <action>maincpu.mq@17F30 = A77AC8B37A56235E</action>
            <action>maincpu.mq@17F38 = C9000011F0000011</action>
            <!--
            9F30 | 5E       : ld   e,(hl)
            9F31 | 23       : inc  hl
            9F32 | 56       : ld   d,(hl)
            9F33 | 7A       : ld   a,d
            9F34 | B3       : or   e
            9F35 | C8       : ret  z
            9F36 | 7A       : ld   a,d
            9F37 | A7       : and  a
            9F38 | 11 xx xx : ld   de,$xxxx
            9F3B | F0       : ret  p
            9F3C | 11 xx xx : ld   de,$xxxx
            9F3F | C9       : ret
            -->
        </script>
        <script state="change">
            <action>maincpu.mw@17F39 =  param</action>
            <action>maincpu.mw@17F3D = -param</action>
        </script>
        <script state="off">
            <action>maincpu.md@04378 = DD56235E        </action>
            <action>maincpu.md@04382 = DD56235E        </action>
            <action>maincpu.mq@17F30 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@17F38 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="fast fire recovery">
        <script state="on">
            <action>maincpu.mb@4249 = 01</action>
        </script>
        <script state="off">
            <action>maincpu.mb@4249 = 1E</action>
        </script>
    </cheat>

    <cheat desc="direct turn">
        <script state="on">
            <action>maincpu.mb@4326 = 32</action>
        </script>
        <script state="off">
            <action>maincpu.mb@4326 = 3A</action>
        </script>
    </cheat>

    <cheat desc="sound test mode">
        <comment>set &quot;skip rom check&quot; then reset the game (F3)</comment>
        <script state="on">
            <action>maincpu.mq@000B0 = 9B80C3EA0032063E</action>
            <action>maincpu.mq@15B80 = 47B8E8043AA10021</action>
            <action>maincpu.mq@15B88 = FE350120FEFEF928</action>
            <action>maincpu.mq@15B90 = 0420FBFE340120FD</action>
            <action>maincpu.mq@15B98 = 0520F7FE0618F03E</action>
            <action>maincpu.mq@15BA0 = 20EFFE787786103E</action>
            <action>maincpu.mq@15BA8 = 0520DFFE06187E03</action>
            <action>maincpu.mq@15BB0 = FFCC18EC0032FE3E</action>
            <!--
            00B0 | 3E 06    : ld   a,$06     // set bank
            00B2 | 32 00 EA : ld   ($EA00),a
            00B5 | C3 80 9B : jp   $9B80
            ================================
            9B80 | 21 00 A1 : ld   hl,$A100  // sound code address
            9B83 | 3A 04 E8 : ld   a,($E804) // read input
            9B86 | B8       : cp   b
            9B87 | 47       : ld   b,a
            9B88 | 28 F9    : jr   z,$9B83
            9B8A | FE FE    : cp   $FE
            9B8C | 20 01    : jr   nz,$9B8F
            9B8E | 35       : dec  (hl)      // decrease code -01
            9B8F | FE FD    : cp   $FD
            9B91 | 20 01    : jr   nz,$9B94
            9B93 | 34       : inc  (hl)      // increase code +01
            9B94 | FE FB    : cp   $FB
            9B96 | 20 04    : jr   nz,$9B9C
            9B98 | 3E F0    : ld   a,$F0     // decrease code -10
            9B9A | 18 06    : jr   $9BA2
            9B9C | FE F7    : cp   $F7
            9B9E | 20 05    : jr   nz,$9BA5
            9BA0 | 3E 10    : ld   a,$10     // increase code +10
            9BA2 | 86       : add  a,(hl)
            9BA3 | 77       : ld   (hl),a
            9BA4 | 78       : ld   a,b
            9BA5 | FE EF    : cp   $EF
            9BA7 | 20 03    : jr   nz,$9BAC
            9BA9 | 7E       : ld   a,(hl)    // play sound
            9BAA | 18 06    : jr   $9BB2
            9BAC | FE DF    : cp   $DF
            9BAE | 20 05    : jr   nz,$9BB5
            9BB0 | 3E FE    : ld   a,$FE     // stop sound
            9BB2 | 32 00 EC : ld   ($EC00),a // send sound code
            9BB5 | 18 CC    : jr   $9B83
            -->
        </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@A100</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mq@000B0 = 86CBA020210406C3</action>
            <action>maincpu.mq@15B80 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@15B88 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@15B90 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@15B98 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@15BA0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@15BA8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@15BB0 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="skip rom check">
        <script state="on">
            <action>maincpu.mb@07B6 = C9</action> <!-- boot -->
            <action>maincpu.mb@01CB = C9</action> <!-- ingame -->
            <action>maincpu.mb@4055 = C9</action> <!-- ingame -->
            <action>maincpu.mb@4203 = C9</action> <!-- ingame -->
            <action>maincpu.mb@4721 = C9</action> <!-- ingame -->
            <action>maincpu.mb@4C66 = C9</action> <!-- ingame -->
            <action>maincpu.mb@4FCA = C9</action> <!-- ingame -->
        </script>
        <script state="off">
            <action>maincpu.mb@07B6 = 21</action>
            <action>maincpu.mb@01CB = 2A</action>
            <action>maincpu.mb@4055 = 2A</action>
            <action>maincpu.mb@4203 = 2A</action>
            <action>maincpu.mb@4721 = 2A</action>
            <action>maincpu.mb@4C66 = 2A</action>
            <action>maincpu.mb@4FCA = 2A</action>
        </script>
    </cheat>

</mamecheat>
  • "rapid fire" : Merged "rapid fire - fire". Reduced size for custom routine.
  • "fast fire recovery" : Added new.