[backfirt] Back Fire (Tecmo)

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

[backfirt] Back Fire (Tecmo)

Post by jman »

Code: Select all

<cheat desc="no hit">
    <script state="on">
        <action>maincpu.mb@1a0e = c3</action> <!-- enemy -->
        <action>maincpu.mb@196c = c3</action> <!-- bullet -->
        <action>maincpu.mb@2f18 = c3</action> <!-- boss -->
        <action>maincpu.mb@9a65 = 8e</action> <!-- scenery -->
        <action>maincpu.mb@1c66 = c3</action> <!-- enemy in cave 1 -->
        <action>maincpu.mb@1c40 = c3</action> <!-- enemy in cave 2 -->
        <action>maincpu.mb@1f57 = 8e</action> <!-- block in cave -->
        <action>maincpu.mb@2e03 = 8e</action> <!-- boss 2 -->
        <action>maincpu.mb@2cf9 = 8e</action> <!-- boss 3 -->
        <action>maincpu.mb@2bde = 8e</action> <!-- boss 4 -->
    </script>
    <script state="off">
        <action>maincpu.mb@1a0e = d2</action>
        <action>maincpu.mb@196c = d2</action>
        <action>maincpu.mb@2f18 = d2</action>
        <action>maincpu.mb@9a65 = ce</action>
        <action>maincpu.mb@1c66 = d2</action>
        <action>maincpu.mb@1c40 = d2</action>
        <action>maincpu.mb@1f57 = ce</action>
        <action>maincpu.mb@2e03 = ce</action>
    </script>
</cheat>

<cheat desc="auto fire">
    <script state="on">
        <action>maincpu.md@0a21 = 003e0038</action> <!-- normal shot -->
        <action>maincpu.mb@0bba =       01</action> <!-- 3-way -->
    </script>
    <script state="off">
        <action>maincpu.md@0a21 = 0e3e0238</action>
        <action>maincpu.mb@0bba =       20</action>
    </script>
</cheat>

<cheat desc="move manually">
    <script state="on">
        <!-- up/down -->
        <action>maincpu.md@8ff3 =         cbb9d0cd</action> <!-- down -->
        <action>maincpu.md@9cef =         c9b9d0cd</action> <!-- up -->
        <action>maincpu.mq@b9d0 = 2103200ce6c02d3a</action>
        <action>maincpu.mq@b9d8 = ffffc9c0d2220000</action>
        <!--
        b9d0 | 3a 2d c0 : ld  a,($c02d)
        b9d3 | e6 0c    : and $0c
        b9d5 | 20 03    : jr  nz,$89da
        b9d7 | 21 00 00 : ld  hl,$0000
        b9da | 22 d2 c0 : ld  ($c0d2),hl
        b9dd | c9       : ret
        -->
        <!-- left/right -->
        <action>maincpu.md@9d39 =         c9b9e0cd</action>
        <action>maincpu.mq@b9e0 = 21032003e6c02d3a</action>
        <action>maincpu.mq@b9e8 = ffffc9c0c2220000</action>
        <!--
        b9e0 | 3a 2d c0 : ld  a,($c02d)
        b9e3 | e6 03    : and $03
        b9e5 | 20 03    : jr  nz,$89ea
        b9e7 | 21 00 00 : ld  hl,$0000
        b9ea | 22 c2 c0 : ld  ($c0c2),hl
        b9ed | c9       : ret
        -->
    </script>
    <script state="off">
        <action>maincpu.md@8ff3 =         cbc0d222</action>
        <action>maincpu.md@9cef =         c9c0d222</action>
        <action>maincpu.mq@b9d0 = ffffffffffffffff</action>
        <action>maincpu.mq@b9d8 = ffffffffffffffff</action>
        <action>maincpu.md@9d39 =         c9c0c222</action>
        <action>maincpu.mq@b9e0 = ffffffffffffffff</action>
        <action>maincpu.mq@b9e8 = 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@73f5 =         16b9a0c3</action>
        <action>maincpu.mq@b9a0 = 003ac10022010021</action>
        <action>maincpu.mq@b9a8 = b0f8013a470707f8</action>
        <action>maincpu.mq@b9b0 = 012008feef286fbd</action>
        <action>maincpu.mq@b9b8 = 02fe25012004fe24</action>
        <action>maincpu.mq@b9c0 = 2001fe06187c0320</action>
        <action>maincpu.mq@b9c8 = d318f80632ff3e05</action>
        <!--
        b9a0 | 21 00 01 : ld   hl,$0100   // initialize sound and input values
        b9a3 | 22 00 c1 : ld   ($c100),hl
        b9a6 | 3a 00 f8 : ld   a,($f800)  // read joystick input
        b9a9 | 07       : rlca
        b9aa | 07       : rlca
        b9ab | 47       : ld   b,a
        b9ac | 3a 01 f8 : ld   a,($f801)  // read button input
        b9af | b0       : or   b
        b9b0 | bd       : cp   l
        b9b1 | 6f       : ld   l,a
        b9b2 | 28 ef    : jr   z,$b9a3
        b9b4 | fe 08    : cp   $08
        b9b6 | 20 01    : jr   nz,$b9b9
        b9b8 | 24       : inc  h          // increase code
        b9b9 | fe 04    : cp   $04
        b9bb | 20 01    : jr   nz,$b9be
        b9bd | 25       : dec  h          // decrease code
        b9be | fe 01    : cp   $01
        b9c0 | 20 03    : jr   nz,$b9c5
        b9c2 | 7c       : ld   a,h        // play sound
        b9c3 | 18 06    : jr   $b9cb
        b9c5 | fe 02    : cp   $02
        b9c7 | 20 05    : jr   nz,$b9ce
        b9c9 | 3e 00    : ld   a,$ff      // stop sound
        b9cb | 32 06 f8 : ld   ($f806),a  // send sound code
        b9ce | 18 d3    : jr   $b9a3
        -->
        <action>soundcpu.mb@007a = 00</action> <!-- accept sound stop code -->
    </script>
    <script state="run">
        <output format="----- backfire 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@c101</argument>
        </output>
    </script>
    <script state="off">
        <action> maincpu.md@73f5 =         16f0cde5</action>
        <action> maincpu.mq@b9a0 = ffffffffffffffff</action>
        <action> maincpu.mq@b9a8 = ffffffffffffffff</action>
        <action> maincpu.mq@b9b0 = ffffffffffffffff</action>
        <action> maincpu.mq@b9b8 = ffffffffffffffff</action>
        <action> maincpu.mq@b9c0 = ffffffffffffffff</action>
        <action> maincpu.mq@b9c8 = ffffffffffffffff</action>
        <action>soundcpu.mb@007a =               01</action>
    </script>
</cheat>
"move manually" requires enough test. This code causes background gfx buggy in scrolling.
jman
Posts: 843
Joined: Tue Dec 01, 2020 1:24 pm

[backfirt] Back Fire (Tecmo) (update)

Post by jman »

Code: Select all

<cheat desc="no inertia (test)">
    <script state="on">
        <!-- up/down -->
        <action>maincpu.md@8ff3 =         cbb9a0cd</action> <!-- down -->
        <action>maincpu.md@9cef =         c9b9a0cd</action> <!-- up -->
        <action>maincpu.mq@b9a0 = 2103200ce6c02d3a</action>
        <action>maincpu.mq@b9a8 = ffffc9c0d2220000</action>
        <!--
        b9a0 | 3a 2d c0 : ld  a,($C02D)
        b9a3 | e6 0c    : and $0C
        b9a5 | 20 03    : jr  nz,$B9AA
        b9a7 | 21 00 00 : ld  hl,$0000
        b9aa | 22 d2 c0 : ld  ($C0D2),hl
        b9ad | c9       : ret
        -->
        <!-- left/right -->
        <action>maincpu.md@9d39 =         c9b9b0cd</action>
        <action>maincpu.mq@b9b0 = 21032003e6c02d3a</action>
        <action>maincpu.mq@b9b8 = ffffc9c0c2220000</action>
        <!--
        b9b0 | 3a 2d c0 : ld  a,($C02D)
        b9b3 | e6 03    : and $03
        b9b5 | 20 03    : jr  nz,$B9BA
        b9b7 | 21 00 00 : ld  hl,$0000
        b9ba | 22 c2 c0 : ld  ($C0C2),hl
        b9bd | c9       : ret
        -->
    </script>
    <script state="off">
        <action>maincpu.md@8ff3 =         cbc0d222</action>
        <action>maincpu.md@9cef =         c9c0d222</action>
        <action>maincpu.mq@b9a0 = ffffffffffffffff</action>
        <action>maincpu.mq@b9a8 = ffffffffffffffff</action>
        <action>maincpu.md@9d39 =         c9c0c222</action>
        <action>maincpu.mq@b9b0 = ffffffffffffffff</action>
        <action>maincpu.mq@b9b8 = ffffffffffffffff</action>
    </script>
</cheat>
"move manually" : reallocate address. rename to "no inertia". downgrade to "test" code because of background scroll problem.

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@73f5 =         16b9c0c3</action>
        <action>maincpu.mq@b9c0 = 03e6f8013ac10021</action>
        <action>maincpu.mq@b9c8 = f8003a4f07070707</action>
        <action>maincpu.mq@b9d0 = 2001feee2847b8b1</action>
        <action>maincpu.mq@b9d8 = fe34012002fe3501</action>
        <action>maincpu.mq@b9e0 = fe0618f03e042004</action>
        <action>maincpu.mq@b9e8 = 787786103e052008</action>
        <action>maincpu.mq@b9f0 = fe06187e032020fe</action>
        <action>maincpu.mq@b9f8 = f80632ff3e052010</action>
        <action>maincpu.mq@ba00 = ffffffffffffc118</action>
        <!--
        b9c0 | 21 00 c1 : ld   hl,$C100  // sound code address
        b9c3 | 3a 01 f8 : ld   a,($F801) // read button inputs
        b9c6 | e6 03    : and  $03
        b9c8 | 07       : rlca
        b9c9 | 07       : rlca
        b9ca | 07       : rlca
        b9cb | 07       : rlca
        b9cc | 4f       : ld   c,a
        b9cd | 3a 00 f8 : ld   a,($F800) // read joystick inputs
        b9d0 | b1       : or   c
        b9d1 | b8       : cp   b
        b9d2 | 47       : ld   b,a
        b9d3 | 28 ee    : jr   z,$B9C3
        b9d5 | fe 01    : cp   $01
        b9d7 | 20 01    : jr   nz,$B9DA
        b9d9 | 35       : dec  (hl)      // decrease code -01
        b9da | fe 02    : cp   $02
        b9dc | 20 01    : jr   nz,$B9DF
        b9de | 34       : inc  (hl)      // increase code +01
        b9df | fe 04    : cp   $04
        b9e1 | 20 04    : jr   nz,$B9E7
        b9e3 | 3e f0    : ld   a,$F0     // decrease code -10
        b9e5 | 18 06    : jr   $B9ED
        b9e7 | fe 08    : cp   $08
        b9e9 | 20 05    : jr   nz,$B9F0
        b9eb | 3e 10    : ld   a,$10     // increase code +10
        b9ed | 86       : add  a,(hl)
        b9ee | 77       : ld   (hl),a
        b9ef | 78       : ld   a,b
        b9f0 | fe 20    : cp   $20
        b9f2 | 20 03    : jr   nz,$B9F7
        b9f4 | 7e       : ld   a,(hl)    // play sound
        b9f5 | 18 06    : jr   $B9FD
        b9f7 | fe 10    : cp   $10
        b9f9 | 20 05    : jr   nz,$BA00
        b9fb | 3e ff    : ld   a,$FF     // stop sound
        b9fd | 32 06 f8 : ld   ($F806),a // send sound code
        ba00 | 18 c1    : jr   $B9C3
        -->
        <action>soundcpu.mb@007a = 00</action> <!-- accept sound stop code -->
    </script>
    <script state="run">
        <output format="----- back fire 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@c100</argument>
        </output>
    </script>
    <script state="off">
        <action> maincpu.md@73f5 =         16f0cde5</action>
        <action> maincpu.mq@b9c0 = ffffffffffffffff</action>
        <action> maincpu.mq@b9c8 = ffffffffffffffff</action>
        <action> maincpu.mq@b9d0 = ffffffffffffffff</action>
        <action> maincpu.mq@b9d8 = ffffffffffffffff</action>
        <action> maincpu.mq@b9e0 = ffffffffffffffff</action>
        <action> maincpu.mq@b9e8 = ffffffffffffffff</action>
        <action> maincpu.mq@b9f0 = ffffffffffffffff</action>
        <action> maincpu.mq@b9f8 = ffffffffffffffff</action>
        <action> maincpu.mq@ba00 = ffffffffffffffff</action>
        <action>soundcpu.mb@007a =               01</action>
    </script>
</cheat>
"sound test mode" : rewrite routine. reallocate address. add up/down key (code ±10).
Post Reply