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).