[tnk3j] T.N.K III/T.A.N.K

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

[tnk3j] T.N.K III/T.A.N.K

Post by jman »

Code: Select all

<cheat desc="no hit">
    <script state="on">
        <action>sub.md@023d =         2608e0cd</action>
        <action>sub.mq@08e0 = 0a3820fe7d016efd</action>
        <action>sub.mq@08e8 = fe03382dfed826fe</action>
        <action>sub.mq@08f0 = ffffffffc9f1d83f</action>
        <!--
        08e0 | fd 6e 01 : ld  l,(iy+$01)
        08e3 | 7d       : ld  a,l
        08e4 | fe 20    : cp  $20
        08e6 | 38 0a    : jr  c,$08f2
        08e8 | fe 26    : cp  $26
        08ea | d8       : ret c
        08eb | fe 2d    : cp  $2d
        08ed | 38 03    : jr  c,$08f2
        08ef | fe 3f    : cp  $3f
        08f1 | d8       : ret c
        08f2 | f1       : pop af
        08f3 | c9       : ret
        -->
    </script>
    <script state="off">
        <action>sub.md@023d =         26016efd</action>
        <action>sub.mq@08e0 = ffffffffffffffff</action>
        <action>sub.mq@08e8 = ffffffffffffffff</action>
        <action>sub.mq@08f0 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="walk through wall">
    <script state="on">
        <action>maincpu.mb@345c = c9</action>
    </script>
    <script state="off">
        <action>maincpu.mb@345c = c0</action>
    </script>
</cheat>

<cheat desc="player speed">
    <parameter min="0x01" max="0x05" step="0x01" />
    <script state="on">
        <action>maincpu.md@24c8 =             61e0</action>
        <action>maincpu.mq@61e0 = 10c12bbccdc50006</action>
        <action>maincpu.mq@61e8 = ffffffffffffc9f9</action>
        <!--
        61e0 | 06 05    : ld   b,$05
        61e2 | c5       : push bc
        61e3 | cd bc 2b : call $2bbc
        61e6 | c1       : pop  bc
        61e7 | 10 f9    : djnz $61e2
        61e9 | c9       : ret
        -->
    </script>
    <script state="change">
        <action>maincpu.mb@61e1 = param</action>
    </script>
    <script state="off">
        <action>maincpu.md@24c8 =             2bbc</action>
        <action>maincpu.mq@61e0 = ffffffffffffffff</action>
        <action>maincpu.mq@61e8 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="joystick hack">
    <script state="on">
        <action>maincpu.mw@2d14 = 0f7e</action>
    </script>
    <script state="off">
        <action>maincpu.mw@2d14 = 1086</action>
    </script>
</cheat>

<cheat desc="sound test mode">
    <comment>set ram/rom check skip then reset the game (F3)</comment>
    <script state="on">
        <action>maincpu.mw@009e =             61f0</action>
        <action>maincpu.mq@61f0 = 003afd0022000021</action>
        <action>maincpu.mq@61f8 = 5fcb25012057cbc1</action>
        <action>maincpu.mq@6200 = 08cd004601240120</action>
        <action>maincpu.mq@6208 = 18286fbdc3003a1f</action>
        <action>maincpu.mq@6210 = 0a9ecd7c062047cb</action>
        <action>maincpu.mq@6218 = 3f3e0a204fcb0e18</action>
        <action>maincpu.mq@6220 = 0a9ecdfe3e0a9ecd</action>
        <action>maincpu.mq@6228 = ffffffffffffc918</action>
        <!--
        61f0 | 21 00 00 : ld   hl,$0000   // initialize input and sound values
        61f3 | 22 00 fd : ld   ($fd00),hl
        61f6 | 3a 00 c1 : ld   a,($c100)  // read joystick input
        61f9 | cb 57    : bit  2,a
        61fb | 20 01    : jr   nz,$61fe
        61fd | 25       : dec  h          // decrease code
        61fe | cb 5f    : bit  3,a
        6200 | 20 01    : jr   nz,$6203
        6202 | 24       : inc  h          // increase code
        6203 | 01 46 00 : ld   bc,$0046
        6206 | cd 08 1f : call $1f08      // wait input
        6209 | 3a 00 c3 : ld   a,($c300)  // read button input
        620c | bd       : cp   l
        620d | 6f       : ld   l,a
        620e | 28 18    : jr   z,$6228
        6210 | cb 47    : bit  0,a
        6212 | 20 06    : jr   nz,$621a
        6214 | 7c       : ld   a,h        // play sound
        6215 | cd 9e 0a : call $0a9e
        6218 | 18 0e    : jr   $6228
        621a | cb 4f    : bit  1,a
        621c | 20 0a    : jr   nz,$6228
        621e | 3e 3f    : ld   a,$3f      // stop sound
        6220 | cd 9e 0a : call $0a9e
        6223 | 3e fe    : ld   a,$fe
        6225 | cd 9e 0a : call $0a9e
        6228 | 18 c9    : jr   $61f3
        -->
    </script>
    <script state="run">
        <output format="----- t.a.n.k 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@fd01</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.mw@009e =             05ee</action>
        <action>maincpu.mq@61f0 = ffffffffffffffff</action>
        <action>maincpu.mq@61f8 = ffffffffffffffff</action>
        <action>maincpu.mq@6200 = ffffffffffffffff</action>
        <action>maincpu.mq@6208 = ffffffffffffffff</action>
        <action>maincpu.mq@6210 = ffffffffffffffff</action>
        <action>maincpu.mq@6218 = ffffffffffffffff</action>
        <action>maincpu.mq@6220 = ffffffffffffffff</action>
        <action>maincpu.mq@6228 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="skip ram/rom check">
    <script state="on">
        <action>maincpu.md@0da6 = 110e44c3</action> <!-- maincpu : ram -->
        <action>    sub.md@0734 = 1107e0c3</action> <!-- subcpu : ram -->
        <action>maincpu.mb@0e51 =       01</action> <!-- disable wait for subcpu -->
        <action>maincpu.mb@0f31 =       c9</action> <!-- maincpu : rom -->
        <action>    sub.mb@0815 =       c9</action> <!-- subcpu : rom -->
    </script>
    <script state="off">
        <action>maincpu.md@0da6 = 11d00021</action>
        <action>    sub.md@0734 = 11c80021</action>
        <action>maincpu.mb@0e51 =       10</action>
        <action>maincpu.mb@0f31 =       cd</action>
        <action>    sub.mb@0815 =       3e</action>
    </script>
</cheat>
"joystick hack" enables direct turret turn without rotary stick like bootleg.
jman
Posts: 843
Joined: Tue Dec 01, 2020 1:24 pm

[tnk3j] T.N.K III/T.A.N.K (update)

Post by jman »

Code: Select all

<!-- T.A.N.K (Japan) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>sub.md@023d =         2608e0cd</action>
            <action>sub.mq@08e0 = 0a3820fe7d016efd</action>
            <action>sub.mq@08e8 = fe03382dfed826fe</action>
            <action>sub.mq@08f0 = ffffffffc9f1d83f</action>
            <!--
            08e0 | fd 6e 01 : ld  l,(iy+$01)
            08e3 | 7d       : ld  a,l
            08e4 | fe 20    : cp  $20
            08e6 | 38 0a    : jr  c,$08f2
            08e8 | fe 26    : cp  $26
            08ea | d8       : ret c
            08eb | fe 2d    : cp  $2d
            08ed | 38 03    : jr  c,$08f2
            08ef | fe 3f    : cp  $3f
            08f1 | d8       : ret c
            08f2 | f1       : pop af
            08f3 | c9       : ret
            -->
        </script>
        <script state="off">
            <action>sub.md@023d =         26016efd</action>
            <action>sub.mq@08e0 = ffffffffffffffff</action>
            <action>sub.mq@08e8 = ffffffffffffffff</action>
            <action>sub.mq@08f0 = ffffffffffffffff</action>
        </script>
    </cheat>

    <cheat desc="walk through wall">
        <script state="on">
            <action>maincpu.mb@345c = c9</action>
        </script>
        <script state="off">
            <action>maincpu.mb@345c = c0</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter min="0x01" max="0x05" step="0x01" />
        <script state="on">
            <action>maincpu.md@24c8 =             61e0</action>
            <action>maincpu.mq@61e0 = 10c12bbccdc50006</action>
            <action>maincpu.mq@61e8 = ffffffffffffc9f9</action>
            <!--
            61e0 | 06 xx    : ld   b,$xx
            61e2 | c5       : push bc
            61e3 | cd bc 2b : call $2bbc
            61e6 | c1       : pop  bc
            61e7 | 10 f9    : djnz $61e2
            61e9 | c9       : ret
            -->
        </script>
        <script state="change">
            <action>maincpu.mb@61e1 = param</action>
        </script>
        <script state="off">
            <action>maincpu.md@24c8 =             2bbc</action>
            <action>maincpu.mq@61e0 = ffffffffffffffff</action>
            <action>maincpu.mq@61e8 = ffffffffffffffff</action>
        </script>
    </cheat>

    <cheat desc="joystick hack">
        <script state="on">
            <action>maincpu.mw@2d14 = 0f7e</action>
        </script>
        <script state="off">
            <action>maincpu.mw@2d14 = 1086</action>
        </script>
    </cheat>

    <cheat desc="sound test mode">
        <comment>set &quot;skip ram/rom check&quot; then reset the game (F3)</comment>
        <script state="on">
            <action>maincpu.mw@009e =             61f0</action>
            <action>maincpu.mq@61f0 = e62fc1003ad10021</action>
            <action>maincpu.mq@61f8 = 03e62fc3003a4f0f</action>
            <action>maincpu.mq@6200 = 2847b8b107070707</action>
            <action>maincpu.mq@6208 = 08fe35012004feea</action>
            <action>maincpu.mq@6210 = 3e042002fe340120</action>
            <action>maincpu.mq@6218 = 3e052001fe0618f0</action>
            <action>maincpu.mq@6220 = 032010fe78778610</action>
            <action>maincpu.mq@6228 = 3e052020fe06187e</action>
            <action>maincpu.mq@6230 = ffffbd18c400323f</action>
            <!--
            61f0 | 21 00 d1 : ld   hl,$D100  // sound code address
            61f3 | 3a 00 c1 : ld   a,($C100) // read joystick
            61f6 | 2f       : cpl
            61f7 | e6 0f    : and  $0F
            61f9 | 4f       : ld   c,a
            61fa | 3a 00 c3 : ld   a,($C300) // read buttons
            61fd | 2f       : cpl
            61fe | e6 03    : and  $03
            6200 | 07       : rlca
            6201 | 07       : rlca
            6202 | 07       : rlca
            6203 | 07       : rlca
            6204 | b1       : or   c
            6205 | b8       : cp   b
            6206 | 47       : ld   b,a
            6207 | 28 ea    : jr   z,$61F3
            6209 | fe 04    : cp   $04
            620b | 20 01    : jr   nz,$620E
            620d | 35       : dec  (hl)      // decrease code -01
            620e | fe 08    : cp   $08
            6210 | 20 01    : jr   nz,$6213
            6212 | 34       : inc  (hl)      // increase code +01
            6213 | fe 02    : cp   $02
            6215 | 20 04    : jr   nz,$621B
            6217 | 3e f0    : ld   a,$F0     // decrease code -10
            6219 | 18 06    : jr   $6221
            621b | fe 01    : cp   $01
            621d | 20 05    : jr   nz,$6224
            621f | 3e 10    : ld   a,$10     // increase code +10
            6221 | 86       : add  a,(hl)
            6222 | 77       : ld   (hl),a
            6223 | 78       : ld   a,b
            6224 | fe 10    : cp   $10
            6226 | 20 03    : jr   nz,$622B
            6228 | 7e       : ld   a,(hl)    // play sound
            6229 | 18 06    : jr   $6231
            622b | fe 20    : cp   $20
            622d | 20 05    : jr   nz,$6234
            622f | 3e 3f    : ld   a,$3F     // stop sound
            6231 | 32 00 c4 : ld   ($C400),a // send sound code
            6234 | 18 bd    : jr   $61F3
            -->
            <action>audiocpu.mb@01a0 = a2</action> <!-- force to play music -->
            <action>audiocpu.mb@094e = 50</action> <!-- force to play sfx -->
        </script>
        <script state="run">
            <output format="----- t.a.n.k 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@d100</argument>
            </output>
        </script>
        <script state="off">
            <action> maincpu.mw@009e =             05ee</action>
            <action> maincpu.mq@61f0 = ffffffffffffffff</action>
            <action> maincpu.mq@61f8 = ffffffffffffffff</action>
            <action> maincpu.mq@6200 = ffffffffffffffff</action>
            <action> maincpu.mq@6208 = ffffffffffffffff</action>
            <action> maincpu.mq@6210 = ffffffffffffffff</action>
            <action> maincpu.mq@6218 = ffffffffffffffff</action>
            <action> maincpu.mq@6220 = ffffffffffffffff</action>
            <action> maincpu.mq@6228 = ffffffffffffffff</action>
            <action> maincpu.mq@6230 = ffffffffffffffff</action>
            <action>audiocpu.mb@01a0 =               b6</action>
            <action>audiocpu.mb@094e =               64</action>
        </script>
    </cheat>

    <cheat desc="skip ram/rom check">
        <script state="on">
            <action>maincpu.md@0da6 = 110e44c3</action> <!-- ram -->
            <action>maincpu.mb@0e51 =       01</action> <!-- quick wait for subcpu -->
            <action>maincpu.mb@0f31 =       c9</action> <!-- rom -->
            <action>    sub.md@0734 = 1107e0c3</action> <!-- ram -->
            <action>    sub.mb@0815 =       c9</action> <!-- rom -->
        </script>
        <script state="off">
            <action>maincpu.md@0da6 = 11d00021</action>
            <action>maincpu.mb@0e51 =       10</action>
            <action>maincpu.mb@0f31 =       cd</action>
            <action>    sub.md@0734 = 11c80021</action>
            <action>    sub.mb@0815 =       3e</action>
        </script>
    </cheat>

</mamecheat>
"sound test mode" : rewrite routine. add up/down key (code ±10).
jman
Posts: 843
Joined: Tue Dec 01, 2020 1:24 pm

[tnk3]+ T.N.K III/T.A.N.K

Post by jman »

tnk3.xml

Code: Select all

<!-- T.N.K III (US) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>sub.md@023D = 2608E0CD        </action>
            <action>sub.mq@08E0 = 0A3820FE7D016EFD</action>
            <action>sub.mq@08E8 = FE03382DFED826FE</action>
            <action>sub.mq@08F0 = FFFFFFFFC9F1D83F</action>
            <!--
            08E0 | FD 6E 01 : ld   l,(iy+$01)
            08E3 | 7D       : ld   a,l
            08E4 | FE 20    : cp   $20
            08E6 | 38 0A    : jr   c,$08F2
            08E8 | FE 26    : cp   $26
            08EA | D8       : ret  c
            08EB | FE 2D    : cp   $2D
            08ED | 38 03    : jr   c,$08F2
            08EF | FE 3F    : cp   $3F
            08F1 | D8       : ret  c
            08F2 | F1       : pop  af
            08F3 | C9       : ret
            -->
        </script>
        <script state="off">
            <action>sub.md@023D = 26016EFD        </action>
            <action>sub.mq@08E0 = FFFFFFFFFFFFFFFF</action>
            <action>sub.mq@08E8 = FFFFFFFFFFFFFFFF</action>
            <action>sub.mq@08F0 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="walk through wall">
        <script state="on">
            <action>maincpu.mb@345C = C9</action>
        </script>
        <script state="off">
            <action>maincpu.mb@345C = C0</action>
        </script>
    </cheat>

    <cheat desc="auto fire">
        <script state="on">
            <action>maincpu.mb@2D30 = 18</action> <!-- cannon (timer) -->
            <action>maincpu.mb@2D47 = 18</action> <!-- cannon (ammo) -->
            <action>maincpu.mb@3109 = 18</action> <!-- vulcan (timer) -->
        </script>
        <script state="off">
            <action>maincpu.mb@2D30 = 28</action>
            <action>maincpu.mb@2D47 = 20</action>
            <action>maincpu.mb@3109 = 28</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter min="0x01" max="0x05" step="0x01" />
        <script state="on">
            <action>maincpu.md@24C8 = 61E0            </action>
            <action>maincpu.mq@61E0 = 10C12BBCCDC50006</action>
            <action>maincpu.mq@61E8 = FFFFFFFFFFFFC9F9</action>
            <!--
            61E0 | 06 xx    : ld   b,$xx
            61E2 | C5       : push bc
            61E3 | CD BC 2B : call $2BBC
            61E6 | C1       : pop  bc
            61E7 | 10 F9    : djnz $61E2
            61E9 | C9       : ret
            -->
        </script>
        <script state="change">
            <action>maincpu.mb@61E1 = param</action>
        </script>
        <script state="off">
            <action>maincpu.md@24C8 = 2BBC            </action>
            <action>maincpu.mq@61E0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@61E8 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="joystick hack">
        <script state="on">
            <action>maincpu.mw@2D14 = 0F7E</action>
        </script>
        <script state="off">
            <action>maincpu.mw@2D14 = 1086</action>
        </script>
    </cheat>

    <cheat desc="sound test mode">
        <comment>set &quot;skip ram/rom check&quot; then reset the game (F3)</comment>
        <script state="on">
            <action>maincpu.mw@009E = 61F0            </action>
            <action>maincpu.mq@61F0 = E62FC1003AD10021</action>
            <action>maincpu.mq@61F8 = 03E62FC3003A4F0F</action>
            <action>maincpu.mq@6200 = 2847B8B107070707</action>
            <action>maincpu.mq@6208 = 08FE35012004FEEA</action>
            <action>maincpu.mq@6210 = 3E042002FE340120</action>
            <action>maincpu.mq@6218 = 3E052001FE0618F0</action>
            <action>maincpu.mq@6220 = 032010FE78778610</action>
            <action>maincpu.mq@6228 = 3E052020FE06187E</action>
            <action>maincpu.mq@6230 = FFFFBD18C400323F</action>
            <!--
            61F0 | 21 00 D1 : ld   hl,$D100  // sound code address
            61F3 | 3A 00 C1 : ld   a,($C100) // read joystick
            61F6 | 2F       : cpl
            61F7 | E6 0F    : and  $0F
            61F9 | 4F       : ld   c,a
            61FA | 3A 00 C3 : ld   a,($C300) // read ohter inputs
            61FD | 2F       : cpl
            61FE | E6 03    : and  $03
            6200 | 07       : rlca
            6201 | 07       : rlca
            6202 | 07       : rlca
            6203 | 07       : rlca
            6204 | B1       : or   c
            6205 | B8       : cp   b
            6206 | 47       : ld   b,a
            6207 | 28 EA    : jr   z,$61F3
            6209 | FE 04    : cp   $04
            620B | 20 01    : jr   nz,$620E
            620D | 35       : dec  (hl)      // decrease code -01
            620E | FE 08    : cp   $08
            6210 | 20 01    : jr   nz,$6213
            6212 | 34       : inc  (hl)      // increase code +01
            6213 | FE 02    : cp   $02
            6215 | 20 04    : jr   nz,$621B
            6217 | 3E F0    : ld   a,$F0     // decrease code -10
            6219 | 18 06    : jr   $6221
            621B | FE 01    : cp   $01
            621D | 20 05    : jr   nz,$6224
            621F | 3E 10    : ld   a,$10     // increase code +10
            6221 | 86       : add  a,(hl)
            6222 | 77       : ld   (hl),a
            6223 | 78       : ld   a,b
            6224 | FE 10    : cp   $10
            6226 | 20 03    : jr   nz,$622B
            6228 | 7E       : ld   a,(hl)    // play sound
            6229 | 18 06    : jr   $6231
            622B | FE 20    : cp   $20
            622D | 20 05    : jr   nz,$6234
            622F | 3E 3F    : ld   a,$3F     // stop sound
            6231 | 32 00 C4 : ld   ($C400),a // send sound code
            6234 | 18 BD    : jr   $61F3
            -->
            <action>audiocpu.mb@01A0 = A2</action> <!-- force to play music -->
            <action>audiocpu.mb@094E = 50</action> <!-- force to play sfx -->
        </script>
        <script state="run">
            <output format="----- t.n.k III 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@D100</argument>
            </output>
        </script>
        <script state="off">
            <action> maincpu.mw@009E = 05EE            </action>
            <action> maincpu.mq@61F0 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@61F8 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6200 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6208 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6210 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6218 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6220 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6228 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6230 = FFFFFFFFFFFFFFFF</action>
            <action>audiocpu.mb@01A0 = B6              </action>
            <action>audiocpu.mb@094E = 64              </action>
        </script>
    </cheat>

    <cheat desc="skip ram/rom check">
        <script state="on">
            <action>maincpu.md@0DA6 = 110E44C3</action> <!-- ram -->
            <action>maincpu.mb@0E51 = 01      </action> <!-- quick wait for subcpu -->
            <action>maincpu.mb@0F31 = C9      </action> <!-- rom -->
            <action>    sub.md@0734 = 1107E0C3</action> <!-- ram -->
            <action>    sub.mb@0815 = C9      </action> <!-- rom -->
        </script>
        <script state="off">
            <action>maincpu.md@0DA6 = 11D00021</action>
            <action>maincpu.mb@0E51 = 10      </action>
            <action>maincpu.mb@0F31 = CD      </action>
            <action>    sub.md@0734 = 11C80021</action>
            <action>    sub.mb@0815 = 3E      </action>
        </script>
    </cheat>

</mamecheat>
tnk3j.xml

Code: Select all

<!-- T.A.N.K (Japan) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>sub.md@023D = 2608E0CD        </action>
            <action>sub.mq@08E0 = 0A3820FE7D016EFD</action>
            <action>sub.mq@08E8 = FE03382DFED826FE</action>
            <action>sub.mq@08F0 = FFFFFFFFC9F1D83F</action>
            <!--
            08E0 | FD 6E 01 : ld   l,(iy+$01)
            08E3 | 7D       : ld   a,l
            08E4 | FE 20    : cp   $20
            08E6 | 38 0A    : jr   c,$08F2
            08E8 | FE 26    : cp   $26
            08EA | D8       : ret  c
            08EB | FE 2D    : cp   $2D
            08ED | 38 03    : jr   c,$08F2
            08EF | FE 3F    : cp   $3F
            08F1 | D8       : ret  c
            08F2 | F1       : pop  af
            08F3 | C9       : ret
            -->
        </script>
        <script state="off">
            <action>sub.md@023D = 26016EFD        </action>
            <action>sub.mq@08E0 = FFFFFFFFFFFFFFFF</action>
            <action>sub.mq@08E8 = FFFFFFFFFFFFFFFF</action>
            <action>sub.mq@08F0 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="walk through wall">
        <script state="on">
            <action>maincpu.mb@345C = C9</action>
        </script>
        <script state="off">
            <action>maincpu.mb@345C = C0</action>
        </script>
    </cheat>

    <cheat desc="auto fire">
        <script state="on">
            <action>maincpu.mb@2D30 = 18</action> <!-- cannon (timer) -->
            <action>maincpu.mb@2D47 = 18</action> <!-- cannon (ammo) -->
            <action>maincpu.mb@3109 = 18</action> <!-- vulcan (timer) -->
        </script>
        <script state="off">
            <action>maincpu.mb@2D30 = 28</action>
            <action>maincpu.mb@2D47 = 20</action>
            <action>maincpu.mb@3109 = 28</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter min="0x01" max="0x05" step="0x01" />
        <script state="on">
            <action>maincpu.md@24C8 = 61E0            </action>
            <action>maincpu.mq@61E0 = 10C12BBCCDC50006</action>
            <action>maincpu.mq@61E8 = FFFFFFFFFFFFC9F9</action>
            <!--
            61E0 | 06 xx    : ld   b,$xx
            61E2 | C5       : push bc
            61E3 | CD BC 2B : call $2BBC
            61E6 | C1       : pop  bc
            61E7 | 10 F9    : djnz $61E2
            61E9 | C9       : ret
            -->
        </script>
        <script state="change">
            <action>maincpu.mb@61E1 = param</action>
        </script>
        <script state="off">
            <action>maincpu.md@24C8 = 2BBC            </action>
            <action>maincpu.mq@61E0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@61E8 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="joystick hack">
        <script state="on">
            <action>maincpu.mw@2D14 = 0F7E</action>
        </script>
        <script state="off">
            <action>maincpu.mw@2D14 = 1086</action>
        </script>
    </cheat>

    <cheat desc="sound test mode">
        <comment>set &quot;skip ram/rom check&quot; then reset the game (F3)</comment>
        <script state="on">
            <action>maincpu.mw@009E = 61F0            </action>
            <action>maincpu.mq@61F0 = E62FC1003AD10021</action>
            <action>maincpu.mq@61F8 = 03E62FC3003A4F0F</action>
            <action>maincpu.mq@6200 = 2847B8B107070707</action>
            <action>maincpu.mq@6208 = 08FE35012004FEEA</action>
            <action>maincpu.mq@6210 = 3E042002FE340120</action>
            <action>maincpu.mq@6218 = 3E052001FE0618F0</action>
            <action>maincpu.mq@6220 = 032010FE78778610</action>
            <action>maincpu.mq@6228 = 3E052020FE06187E</action>
            <action>maincpu.mq@6230 = FFFFBD18C400323F</action>
            <!--
            61F0 | 21 00 D1 : ld   hl,$D100  // sound code address
            61F3 | 3A 00 C1 : ld   a,($C100) // read joystick
            61F6 | 2F       : cpl
            61F7 | E6 0F    : and  $0F
            61F9 | 4F       : ld   c,a
            61FA | 3A 00 C3 : ld   a,($C300) // read ohter inputs
            61FD | 2F       : cpl
            61FE | E6 03    : and  $03
            6200 | 07       : rlca
            6201 | 07       : rlca
            6202 | 07       : rlca
            6203 | 07       : rlca
            6204 | B1       : or   c
            6205 | B8       : cp   b
            6206 | 47       : ld   b,a
            6207 | 28 EA    : jr   z,$61F3
            6209 | FE 04    : cp   $04
            620B | 20 01    : jr   nz,$620E
            620D | 35       : dec  (hl)      // decrease code -01
            620E | FE 08    : cp   $08
            6210 | 20 01    : jr   nz,$6213
            6212 | 34       : inc  (hl)      // increase code +01
            6213 | FE 02    : cp   $02
            6215 | 20 04    : jr   nz,$621B
            6217 | 3E F0    : ld   a,$F0     // decrease code -10
            6219 | 18 06    : jr   $6221
            621B | FE 01    : cp   $01
            621D | 20 05    : jr   nz,$6224
            621F | 3E 10    : ld   a,$10     // increase code +10
            6221 | 86       : add  a,(hl)
            6222 | 77       : ld   (hl),a
            6223 | 78       : ld   a,b
            6224 | FE 10    : cp   $10
            6226 | 20 03    : jr   nz,$622B
            6228 | 7E       : ld   a,(hl)    // play sound
            6229 | 18 06    : jr   $6231
            622B | FE 20    : cp   $20
            622D | 20 05    : jr   nz,$6234
            622F | 3E 3F    : ld   a,$3F     // stop sound
            6231 | 32 00 C4 : ld   ($C400),a // send sound code
            6234 | 18 BD    : jr   $61F3
            -->
            <action>audiocpu.mb@01A0 = A2</action> <!-- force to play music -->
            <action>audiocpu.mb@094E = 50</action> <!-- force to play sfx -->
        </script>
        <script state="run">
            <output format="----- t.a.n.k 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@D100</argument>
            </output>
        </script>
        <script state="off">
            <action> maincpu.mw@009E = 05EE            </action>
            <action> maincpu.mq@61F0 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@61F8 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6200 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6208 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6210 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6218 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6220 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6228 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6230 = FFFFFFFFFFFFFFFF</action>
            <action>audiocpu.mb@01A0 = B6              </action>
            <action>audiocpu.mb@094E = 64              </action>
        </script>
    </cheat>

    <cheat desc="skip ram/rom check">
        <script state="on">
            <action>maincpu.md@0DA6 = 110E44C3</action> <!-- ram -->
            <action>maincpu.mb@0E51 = 01      </action> <!-- quick wait for subcpu -->
            <action>maincpu.mb@0F31 = C9      </action> <!-- rom -->
            <action>    sub.md@0734 = 1107E0C3</action> <!-- ram -->
            <action>    sub.mb@0815 = C9      </action> <!-- rom -->
        </script>
        <script state="off">
            <action>maincpu.md@0DA6 = 11D00021</action>
            <action>maincpu.mb@0E51 = 10      </action>
            <action>maincpu.mb@0F31 = CD      </action>
            <action>    sub.md@0734 = 11C80021</action>
            <action>    sub.mb@0815 = 3E      </action>
        </script>
    </cheat>

</mamecheat>
tnk3b.xml

Code: Select all

<!-- T.A.N.K (bootleg, 8-way joystick) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>sub.md@023D = 2608E0CD        </action>
            <action>sub.mq@08E0 = 0A3820FE7D016EFD</action>
            <action>sub.mq@08E8 = FE03382DFED826FE</action>
            <action>sub.mq@08F0 = FFFFFFFFC9F1D83F</action>
            <!--
            08E0 | FD 6E 01 : ld   l,(iy+$01)
            08E3 | 7D       : ld   a,l
            08E4 | FE 20    : cp   $20
            08E6 | 38 0A    : jr   c,$08F2
            08E8 | FE 26    : cp   $26
            08EA | D8       : ret  c
            08EB | FE 2D    : cp   $2D
            08ED | 38 03    : jr   c,$08F2
            08EF | FE 3F    : cp   $3F
            08F1 | D8       : ret  c
            08F2 | F1       : pop  af
            08F3 | C9       : ret
            -->
        </script>
        <script state="off">
            <action>sub.md@023D = 26016EFD        </action>
            <action>sub.mq@08E0 = FFFFFFFFFFFFFFFF</action>
            <action>sub.mq@08E8 = FFFFFFFFFFFFFFFF</action>
            <action>sub.mq@08F0 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="walk through wall">
        <script state="on">
            <action>maincpu.mb@345C = C9</action>
        </script>
        <script state="off">
            <action>maincpu.mb@345C = C0</action>
        </script>
    </cheat>

    <cheat desc="auto fire">
        <script state="on">
            <action>maincpu.mb@2D30 = 18</action> <!-- cannon (timer) -->
            <action>maincpu.mb@2D47 = 18</action> <!-- cannon (ammo) -->
            <action>maincpu.mb@3109 = 18</action> <!-- vulcan (timer) -->
        </script>
        <script state="off">
            <action>maincpu.mb@2D30 = 28</action>
            <action>maincpu.mb@2D47 = 20</action>
            <action>maincpu.mb@3109 = 28</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter min="0x01" max="0x05" step="0x01" />
        <script state="on">
            <action>maincpu.md@24C8 = 61E0            </action>
            <action>maincpu.mq@61E0 = 10C12BBCCDC50006</action>
            <action>maincpu.mq@61E8 = FFFFFFFFFFFFC9F9</action>
            <!--
            61E0 | 06 xx    : ld   b,$xx
            61E2 | C5       : push bc
            61E3 | CD BC 2B : call $2BBC
            61E6 | C1       : pop  bc
            61E7 | 10 F9    : djnz $61E2
            61E9 | C9       : ret
            -->
        </script>
        <script state="change">
            <action>maincpu.mb@61E1 = param</action>
        </script>
        <script state="off">
            <action>maincpu.md@24C8 = 2BBC            </action>
            <action>maincpu.mq@61E0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@61E8 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="sound test mode">
        <comment>set &quot;skip ram/rom check&quot; then reset the game (F3)</comment>
        <script state="on">
            <action>maincpu.mw@009E = 61F0            </action>
            <action>maincpu.mq@61F0 = E62FC1003AD10021</action>
            <action>maincpu.mq@61F8 = 03E62FC3003A4F0F</action>
            <action>maincpu.mq@6200 = 2847B8B107070707</action>
            <action>maincpu.mq@6208 = 08FE35012004FEEA</action>
            <action>maincpu.mq@6210 = 3E042002FE340120</action>
            <action>maincpu.mq@6218 = 3E052001FE0618F0</action>
            <action>maincpu.mq@6220 = 032010FE78778610</action>
            <action>maincpu.mq@6228 = 3E052020FE06187E</action>
            <action>maincpu.mq@6230 = FFFFBD18C400323F</action>
            <!--
            61F0 | 21 00 D1 : ld   hl,$D100  // sound code address
            61F3 | 3A 00 C1 : ld   a,($C100) // read joystick
            61F6 | 2F       : cpl
            61F7 | E6 0F    : and  $0F
            61F9 | 4F       : ld   c,a
            61FA | 3A 00 C3 : ld   a,($C300) // read ohter inputs
            61FD | 2F       : cpl
            61FE | E6 03    : and  $03
            6200 | 07       : rlca
            6201 | 07       : rlca
            6202 | 07       : rlca
            6203 | 07       : rlca
            6204 | B1       : or   c
            6205 | B8       : cp   b
            6206 | 47       : ld   b,a
            6207 | 28 EA    : jr   z,$61F3
            6209 | FE 04    : cp   $04
            620B | 20 01    : jr   nz,$620E
            620D | 35       : dec  (hl)      // decrease code -01
            620E | FE 08    : cp   $08
            6210 | 20 01    : jr   nz,$6213
            6212 | 34       : inc  (hl)      // increase code +01
            6213 | FE 02    : cp   $02
            6215 | 20 04    : jr   nz,$621B
            6217 | 3E F0    : ld   a,$F0     // decrease code -10
            6219 | 18 06    : jr   $6221
            621B | FE 01    : cp   $01
            621D | 20 05    : jr   nz,$6224
            621F | 3E 10    : ld   a,$10     // increase code +10
            6221 | 86       : add  a,(hl)
            6222 | 77       : ld   (hl),a
            6223 | 78       : ld   a,b
            6224 | FE 10    : cp   $10
            6226 | 20 03    : jr   nz,$622B
            6228 | 7E       : ld   a,(hl)    // play sound
            6229 | 18 06    : jr   $6231
            622B | FE 20    : cp   $20
            622D | 20 05    : jr   nz,$6234
            622F | 3E 3F    : ld   a,$3F     // stop sound
            6231 | 32 00 C4 : ld   ($C400),a // send sound code
            6234 | 18 BD    : jr   $61F3
            -->
            <action>audiocpu.mb@01A0 = A2</action> <!-- force to play music -->
            <action>audiocpu.mb@094E = 50</action> <!-- force to play sfx -->
        </script>
        <script state="run">
            <output format="----- t.a.n.k 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@D100</argument>
            </output>
        </script>
        <script state="off">
            <action> maincpu.mw@009E = 05EE            </action>
            <action> maincpu.mq@61F0 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@61F8 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6200 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6208 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6210 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6218 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6220 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6228 = FFFFFFFFFFFFFFFF</action>
            <action> maincpu.mq@6230 = FFFFFFFFFFFFFFFF</action>
            <action>audiocpu.mb@01A0 = B6              </action>
            <action>audiocpu.mb@094E = 64              </action>
        </script>
    </cheat>

    <cheat desc="skip ram/rom check">
        <script state="on">
            <action>maincpu.md@0DA6 = 110E44C3</action> <!-- ram -->
            <action>maincpu.mb@0E51 = 01      </action> <!-- quick wait for subcpu -->
            <action>maincpu.mb@0F31 = C9      </action> <!-- rom -->
            <action>    sub.md@0734 = 1107E0C3</action> <!-- ram -->
            <action>    sub.mb@0815 = C9      </action> <!-- rom -->
        </script>
        <script state="off">
            <action>maincpu.md@0DA6 = 11D00021</action>
            <action>maincpu.mb@0E51 = 10      </action>
            <action>maincpu.mb@0F31 = CD      </action>
            <action>    sub.md@0734 = 11C80021</action>
            <action>    sub.mb@0815 = 3E      </action>
        </script>
    </cheat>

</mamecheat>
  • "auto fire" : Added new.
  • "joystick hack" : Removed from tnk3b because this set has "joystick hack" from the beginning.
Post Reply