[espial] Espial

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

[espial] Espial

Post by jman »

Code: Select all

<cheat desc="auto fire">
    <script state="on">
        <action>maincpu.mb@280a = 04</action> <!-- shot -->
        <action>maincpu.mb@27f5 = 04</action> <!-- bomb -->
    </script>
    <script state="off">
        <action>maincpu.mb@280a = 18</action>
        <action>maincpu.mb@27f5 = 28</action>
    </script>
</cheat>

<cheat desc="player speed">
    <parameter min="0x01" max="0x08" step="0x01" />
    <script state="on">
        <!-- y position -->
        <action>maincpu.md@272a =         dd4fd0cd</action>
        <action>maincpu.mq@4fd0 = 4fdaf2003e0728a7</action>
        <action>maincpu.mq@4fd8 = 0000c90086dd44ed</action>
        <!--
        4fd0 | a7       : and a
        4fd1 | 28 07    : jr  z,$4fda
        4fd3 | 3e xx    : ld  a,xx
        4fd5 | f2 da 4f : jp  p,$4fda
        4fd8 | ed 44    : neg
        4fda | dd 86 00 : add a,(ix+$00)
        4fdd | c9       : ret
        -->
        <!-- x position -->
        <action>maincpu.md@2732 =         dd4fe0cd</action>
        <action>maincpu.mq@4fe0 = 4feaf2003e0728a7</action>
        <action>maincpu.mq@4fe8 = 0000c90186dd44ed</action>
        <!--
        4fe0 | a7       : and a
        4fe1 | 28 07    : jr  z,$4fea
        4fe3 | 3e xx    : ld  a,xx
        4fe5 | f2 ea 4f : jp  p,$4fea
        4fe8 | ed 44    : neg
        4fea | dd 86 01 : add a,(ix+$01)
        4fed | c9       : ret
        -->
    </script>
    <script state="change">
        <action>maincpu.mb@4fd4 = param</action>
        <action>maincpu.mb@4fe4 = param</action>
    </script>
    <script state="off">
        <action>maincpu.md@272a =         dd0086dd</action>
        <action>maincpu.mq@4fd0 = 31494d4e00000149</action>
        <action>maincpu.mq@4fd8 = 4d58476400003031</action>
        <action>maincpu.md@2732 =         dd0186dd</action>
        <action>maincpu.mq@4fe0 = 55324f435300002e</action>
        <action>maincpu.mq@4fe8 = 2e5258a4644cb050</action>
    </script>
</cheat>

<cheat desc="bullet speed">
    <parameter>
        <item value="0x08">01 (slow)</item>
        <item value="0x10">02       </item>
        <item value="0x18">03       </item>
        <item value="0x20">04       </item>
        <item value="0x28">05 (fast)</item>
    </parameter>
    <script state="change">
        <action>maincpu.mb@2941 =  param</action>
        <action>maincpu.mb@2943 = -param</action>
    </script>
    <script state="off">
        <action>maincpu.mb@2941 = 10</action>
        <action>maincpu.mb@2943 = f0</action>
    </script>
</cheat>

<cheat desc="fast bomb">
    <script state="on">
        <action>maincpu.md@28ba =         184ff0cd</action>
        <action>maincpu.mq@4ff0 = 0077dd6ec6007edd</action>
        <action>maincpu.mb@4ff8 =               c9</action>
        <!--
        4ff0 | dd 7e 00 : ld  a,(ix+$00)
        4ff3 | c6 6e    : add a,$6e
        4ff5 | 00 77 dd : ld  (ix+$00),a
        4ff8 | c9       : ret
        -->
        <action>maincpu.mb@2910 = 08</action>
    </script>
    <script state="off">
        <action>maincpu.md@28ba =         280535dd</action>
        <action>maincpu.mq@4ff0 = 504f544e41520000</action>
        <action>maincpu.mb@4ff8 =               a6</action>
        <action>maincpu.mb@2910 =               20</action>
    </script>
</cheat>

<cheat desc="skip rom check">
    <script state="on">
        <action>maincpu.mw@4c83 = 1f18</action>
    </script>
    <script state="off">
        <action>maincpu.mw@4c83 = 0021</action>
    </script>
</cheat>
0.221 or later, soft reset (F3) causes game freeze at boot sequence. So I test "skip rom check" code with 0.220.
Last edited by jman on Sat Oct 23, 2021 9:15 am, edited 1 time in total.
jman
Posts: 843
Joined: Tue Dec 01, 2020 1:24 pm

[espial] sound test mode

Post by jman »

Code: Select all

<cheat desc="sound test mode">
    <comment>set rom check skip then reset the game (F3)</comment>
    <script state="on">
        <action>maincpu.mq@04af = 3a580022010021fb</action>
        <action>maincpu.mq@04b7 = 023e042877cb6081</action>
        <action>maincpu.mq@04bf = 286fbd60843a0318</action>
        <action>maincpu.mq@04c7 = 08fe25012080feeb</action>
        <action>maincpu.mq@04cf = 7c032040fe240120</action>
        <action>maincpu.mq@04d7 = f23e052002fe0618</action>
        <action>maincpu.mq@04df = 003605cf18609032</action>
        <!--
        04af | fb       : ei
        04b0 | 21 00 00 : ld  hl,$0100   // initialize sound and input values
        04b3 | 22 00 58 : ld  ($5800),hl
        04b6 | 3a 81 60 : ld  a,($6081)  // read input 0 (button 2)
        04b9 | cb 77    : bit 6,a
        04bb | 28 04    : jr  z,$4c1
        04bd | 3e 02    : ld  a,$02
        04bf | 18 03    : jr  $4c4
        04c1 | 3a 84 60 : ld  a,($6084)  // read input 2 (left, right, button 1)
        04c4 | bd       : cp  l
        04c5 | 6f       : ld  l,a
        04c6 | 28 eb    : jr  z,$4b3
        04c8 | fe 80    : cp  $80
        04ca | 20 01    : jr  nz,$4cd
        04cc | 25       : dec h          // pressed left - code decrement
        04cd | fe 08    : cp  $08
        04cf | 20 01    : jr  nz,$4d2
        04d1 | 24       : inc h          // pressed right - code increment
        04d2 | fe 40    : cp  $40
        04d4 | 20 03    : jr  nz,$4d9
        04d6 | 7c       : ld  a,h        // pressed button 1 - play sound
        04d7 | 18 06    : jr  $4df
        04d9 | fe 02    : cp  $02
        04db | 20 05    : jr  nz,$4e2
        04dd | 3e f2    : ld  a,$f2      // pressed button 2 - stop sound
        04df | 32 90 60 : ld  ($6090),a
        04e2 | 18 cf    : jr  $4b3
        -->
    </script>
    <script state="run">
        <output format="----- espial sound test mode -----" line="10" align="center" />
        <output format="left : code decrement"              line="11" align="center" />
        <output format="right : code increment"             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@5801</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.mq@04af = 042001841c11013e</action>
        <action>maincpu.mq@04b7 = 580032ff3e0402cd</action>
        <action>maincpu.mq@04bf = 803e58192258ba21</action>
        <action>maincpu.mq@04c7 = 003ecf113e582332</action>
        <action>maincpu.mq@04cf = 003a0006fb710032</action>
        <action>maincpu.mq@04d7 = 580021eb09100e70</action>
        <action>maincpu.mq@04df = 0036052012fe7e34</action>
    </script>
</cheat>
"sound test mode" works after boot sequence so that you need to set "skip rom check" to avoid rom error.

I find that soft reset via debugger (F3 or "softreset" command) works even in version 0.221 or later.
jman
Posts: 843
Joined: Tue Dec 01, 2020 1:24 pm

[espial] update

Post by jman »

Random maintenance.

Code: Select all

<cheat desc="player speed">
    <parameter>
        <item value="0x01">01 (slow)</item>
        <item value="0x02">02       </item>
        <item value="0x04">03       </item>
        <item value="0x06">04       </item>
        <item value="0x08">05 (fast)</item>
    </parameter>
    <script state="on">
        <action>maincpu.md@272a =         dd4fe0cd</action> <!-- y position -->
        <action>maincpu.md@2732 =         dd4fe7cd</action> <!-- x position -->
        <action>maincpu.mq@4fe0 = cdc90086dd4feecd</action>
        <action>maincpu.mq@4fe8 = c8a7c90186dd4fee</action>
        <action>maincpu.mq@4ff0 = 0000c944edf0003e</action>
        <!--
        4fe0 | cd ee 4f : call $4FEE      // y position
        4fe3 | dd 86 00 : add  a,(ix+$00)
        4fe6 | c9       : ret
        4fe7 | cd ee 4f : call $4FEE      // x position
        4fea | dd 86 01 : add  a,(ix+$01)
        4fed | c9       : ret
        4fee | a7       : and  a          // main routine
        4fef | c8       : ret  z
        4ff0 | 3e xx    : ld   a,$xx
        4ff2 | f0       : ret  p
        4ff3 | ed 44    : neg
        4ff5 | c9       : ret
        -->
    </script>
    <script state="change">
        <action>maincpu.mb@4ff1 = param</action>
    </script>
    <script state="off">
        <action>maincpu.md@272a =         dd0086dd</action>
        <action>maincpu.md@2732 =         dd0186dd</action>
        <action>maincpu.mq@4fe0 = 55324f435300002e</action>
        <action>maincpu.mq@4fe8 = 2e5258a4644cb050</action>
        <action>maincpu.mq@4ff0 = 504f544e41520000</action>
    </script>
</cheat>
"player speed" : merge two routines into one. change value parameter to item. reallocate address for custom routine.

Code: Select all

<cheat desc="fast bomb">
    <script state="on">
        <action>maincpu.md@28ba =         184fd0cd</action> <!-- range -->
        <action>maincpu.mq@4fd0 = 0077dd6ec6007edd</action>
        <action>maincpu.mq@4fd8 = 00000000000000c9</action>
        <!--
        4fd0 | dd 7e 00 : ld  a,(ix+$00)
        4fd3 | c6 6e    : add a,$6e
        4fd5 | dd 77 00 : ld  (ix+$00),a
        4fd8 | c9       : ret
        -->
        <action>maincpu.mb@2910 = 08</action> <!-- explosion timer -->
    </script>
    <script state="off">
        <action>maincpu.md@28ba =         280535dd</action>
        <action>maincpu.mq@4fd0 = 31494d4e00000149</action>
        <action>maincpu.mq@4fd8 = 4d58476400003031</action>
        <action>maincpu.mb@2910 =               20</action>
    </script>
</cheat>
"fast bomb" : reallocate address for custom routine.

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@04af = 02b4cdd9580021fb</action>
        <action>maincpu.mq@04b7 = f42847b858263ad9</action>
        <action>maincpu.mq@04bf = 2001fe35012002fe</action>
        <action>maincpu.mq@04c7 = f03e042008fe3401</action>
        <action>maincpu.mq@04cf = 103e052004fe0618</action>
        <action>maincpu.mq@04d7 = 7e032010fe787786</action>
        <action>maincpu.mq@04df = f23e052020fe0618</action>
        <action>maincpu.mq@04e7 = 000000c718609032</action>
        <!--
        04af | fb       : ei             // enable interrupt
        04b0 | 21 00 58 : ld   hl,$5800
        04b3 | d9       : exx
        04b4 | cd b4 02 : call $02B4     // check input
        04b7 | d9       : exx
        04b8 | 3a 26 58 : ld   a,($5826) // read input
        04bb | b8       : cp   b
        04bc | 47       : ld   b,a
        04bd | 28 f4    : jr   z,$04B3
        04bf | fe 02    : cp   $02
        04c1 | 20 01    : jr   nz,$04C4
        04c3 | 35       : dec  (hl)      // decrease code -01
        04c4 | fe 01    : cp   $01
        04c6 | 20 01    : jr   nz,$04C9
        04c8 | 34       : inc  (hl)      // increase code +01
        04c9 | fe 08    : cp   $08
        04cb | 20 04    : jr   nz,$04D1
        04cd | 3e f0    : ld   a,$F0     // decrease code -10
        04cf | 18 06    : jr   $04D7
        04d1 | fe 04    : cp   $04
        04d3 | 20 05    : jr   nz,$04DA
        04d5 | 3e 10    : ld   a,$10     // increase code +10
        04d7 | 86       : add  a,(hl)
        04d8 | 77       : ld   (hl),a
        04d9 | 78       : ld   a,b
        04da | fe 10    : cp   $10
        04dc | 20 03    : jr   nz,$04E1
        04de | 7e       : ld   a,(hl)    // play sound
        04df | 18 06    : jr   $04E7
        04e1 | fe 20    : cp   $20
        04e3 | 20 05    : jr   nz,$04EA
        04e5 | 3e f2    : ld   a,$F2     // stop sound
        04e7 | 32 90 60 : ld   ($6090),a // send sound code
        04ea | 18 c7    : jr   $04B3
        -->
    </script>
    <script state="run">
        <output format="----- espial 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@5800</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.mq@04af = 042001841c11013e</action>
        <action>maincpu.mq@04b7 = 580032ff3e0402cd</action>
        <action>maincpu.mq@04bf = 803e58192258ba21</action>
        <action>maincpu.mq@04c7 = 003ecf113e582332</action>
        <action>maincpu.mq@04cf = 003a0006fb710032</action>
        <action>maincpu.mq@04d7 = 580021eb09100e70</action>
        <action>maincpu.mq@04df = 0036052012fe7e34</action>
        <action>maincpu.mq@04e7 = 581922eb4e58ca11</action>
    </script>
</cheat>
"sound test mode" : rewrite routine. add up/down key (code ±10).
jman
Posts: 843
Joined: Tue Dec 01, 2020 1:24 pm

[espialu] conversion

Post by jman »

Added codes for espialu. Address is different from espial.

Code: Select all

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

<cheat desc="auto fire">
    <script state="on">
        <action>maincpu.mb@28d5 = 04</action> <!-- shot -->
        <action>maincpu.mb@28c0 = 04</action> <!-- bomb -->
    </script>
    <script state="off">
        <action>maincpu.mb@28d5 = 18</action>
        <action>maincpu.mb@28c0 = 28</action>
    </script>
</cheat>

<cheat desc="player speed">
    <parameter>
        <item value="0x01">01 (slow)</item>
        <item value="0x02">02       </item>
        <item value="0x04">03       </item>
        <item value="0x06">04       </item>
        <item value="0x08">05 (fast)</item>
    </parameter>
    <script state="on">
        <action>maincpu.md@27f5 =         dd4fe0cd</action> <!-- y position -->
        <action>maincpu.md@27fd =         dd4fe7cd</action> <!-- x position -->
        <action>maincpu.mq@4fe0 = cdc90086dd4feecd</action>
        <action>maincpu.mq@4fe8 = c8a7c90186dd4fee</action>
        <action>maincpu.mq@4ff0 = 0000c944edf0003e</action>
        <!--
        4fe0 | cd ee 4f : call $4FEE      // y position
        4fe3 | dd 86 00 : add  a,(ix+$00)
        4fe6 | c9       : ret
        4fe7 | cd ee 4f : call $4FEE      // x position
        4fea | dd 86 01 : add  a,(ix+$01)
        4fed | c9       : ret
        4fee | a7       : and  a          // main routine
        4fef | c8       : ret  z
        4ff0 | 3e xx    : ld   a,$xx
        4ff2 | f0       : ret  p
        4ff3 | ed 44    : neg
        4ff5 | c9       : ret
        -->
    </script>
    <script state="change">
        <action>maincpu.mb@4ff1 = param</action>
    </script>
    <script state="off">
        <action>maincpu.md@27f5 =         dd0086dd</action>
        <action>maincpu.md@27fd =         dd0186dd</action>
        <action>maincpu.mq@4fe0 = 55324f435300002e</action>
        <action>maincpu.mq@4fe8 = 2e5258a4644cb050</action>
        <action>maincpu.mq@4ff0 = 504f544e41520000</action>
    </script>
</cheat>

<cheat desc="bullet speed">
    <parameter>
        <item value="0x08">01 (slow)</item>
        <item value="0x10">02       </item>
        <item value="0x18">03       </item>
        <item value="0x20">04       </item>
        <item value="0x28">05 (fast)</item>
    </parameter>
    <script state="change">
        <action>maincpu.mb@2a0c =  param</action>
        <action>maincpu.mb@2a0e = -param</action>
    </script>
    <script state="off">
        <action>maincpu.mb@2a0c = 10</action>
        <action>maincpu.mb@2a0e = f0</action>
    </script>
</cheat>

<cheat desc="fast bomb">
    <script state="on">
        <action>maincpu.md@2985 =         184fd0cd</action> <!-- range -->
        <action>maincpu.mq@4fd0 = 0077dd6ec6007edd</action>
        <action>maincpu.mq@4fd8 = 00000000000000c9</action>
        <!--
        4fd0 | dd 7e 00 : ld  a,(ix+$00)
        4fd3 | c6 6e    : add a,$6e
        4fd5 | dd 77 00 : ld  (ix+$00),a
        4fd8 | c9       : ret
        -->
        <action>maincpu.mb@29db = 08</action> <!-- explosion timer -->
    </script>
    <script state="off">
        <action>maincpu.md@2985 =         280535dd</action>
        <action>maincpu.mq@4fd0 = 31494d4e00000149</action>
        <action>maincpu.mq@4fd8 = 4d58476400003031</action>
        <action>maincpu.mb@29db =               20</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@057d = 02b4cdd9580021fb</action>
        <action>maincpu.mq@0585 = f42847b858263ad9</action>
        <action>maincpu.mq@058d = 2001fe35012002fe</action>
        <action>maincpu.mq@0595 = f03e042008fe3401</action>
        <action>maincpu.mq@059d = 103e052004fe0618</action>
        <action>maincpu.mq@05a5 = 7e032010fe787786</action>
        <action>maincpu.mq@05ad = f23e052020fe0618</action>
        <action>maincpu.mq@05b5 = 000000c718609032</action>
        <!--
        057d | fb       : ei             // enable interrupt
        057e | 21 00 58 : ld   hl,$5800
        0581 | d9       : exx
        0582 | cd b4 02 : call $02B4     // check input
        0585 | d9       : exx
        0586 | 3a 26 58 : ld   a,($5826) // read input
        0589 | b8       : cp   b
        058a | 47       : ld   b,a
        058b | 28 f4    : jr   z,$0581
        058d | fe 02    : cp   $02
        058f | 20 01    : jr   nz,$0592
        0591 | 35       : dec  (hl)      // decrease code -01
        0592 | fe 01    : cp   $01
        0594 | 20 01    : jr   nz,$0597
        0596 | 34       : inc  (hl)      // increase code +01
        0597 | fe 08    : cp   $08
        0599 | 20 04    : jr   nz,$059F
        059b | 3e f0    : ld   a,$F0     // decrease code -10
        059d | 18 06    : jr   $05A5
        059f | fe 04    : cp   $04
        05a1 | 20 05    : jr   nz,$05A8
        05a3 | 3e 10    : ld   a,$10     // increase code +10
        05a5 | 86       : add  a,(hl)
        05a6 | 77       : ld   (hl),a
        05a7 | 78       : ld   a,b
        05a8 | fe 10    : cp   $10
        05aa | 20 03    : jr   nz,$05AF
        05ac | 7e       : ld   a,(hl)    // play sound
        05ad | 18 06    : jr   $05B5
        05af | fe 20    : cp   $20
        05b1 | 20 05    : jr   nz,$05B8
        05b3 | 3e f2    : ld   a,$F2     // stop sound
        05b5 | 32 90 60 : ld   ($6090),a // send sound code
        05b8 | 18 c7    : jr   $0581
        -->
        <action>audiocpu.mb@184a = 00</action> <!-- disable playing music and sfx at the same time -->
    </script>
    <script state="run">
        <output format="----- espial 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@5800</argument>
        </output>
    </script>
    <script state="off">
        <action> maincpu.mq@057d = 042001841c11013e</action>
        <action> maincpu.mq@0585 = 580032ff3e04d0cd</action>
        <action> maincpu.mq@058d = 803e58192258ba21</action>
        <action> maincpu.mq@0595 = 003ecf113e582332</action>
        <action> maincpu.mq@059d = 003a0006fb710032</action>
        <action> maincpu.mq@05a5 = 580021eb09100e70</action>
        <action> maincpu.mq@05ad = 0036052012fe7e34</action>
        <action> maincpu.mq@05b5 = 581922eb4e58ca11</action>
        <action>audiocpu.mb@184a =               03</action>
    </script>
</cheat>

<cheat desc="skip rom check">
    <script state="on">
        <action>maincpu.mw@4d57 = 1f18</action>
    </script>
    <script state="off">
        <action>maincpu.mw@4d57 = 0021</action>
    </script>
</cheat>
Main difference is that espialu has in-game music. Unfortunately, "sound test mode" has problem by simple conversion from espial. Sfx and music are played at the same time in some sound codes so that espialu needs to hack routine in audiocpu.
jman
Posts: 843
Joined: Tue Dec 01, 2020 1:24 pm

[espial]+ Espial

Post by jman »

In 0.259, espialj and espialn are added. Based code is similar to espialu but no playing music like espial.

espialj.xml

Code: Select all

<!-- Espial (Japan) -->
<mamecheat version="1">

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

    <cheat desc="auto fire">
        <script state="on">
            <action>maincpu.mb@28C0 = 04</action> <!-- bomb -->
            <action>maincpu.mb@28D5 = 04</action> <!-- shot -->
        </script>
        <script state="off">
            <action>maincpu.mb@28C0 = 28</action>
            <action>maincpu.mb@28D5 = 18</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter>
            <item value="0x01">01 (slow)</item>
            <item value="0x02">02       </item>
            <item value="0x04">03       </item>
            <item value="0x06">04       </item>
            <item value="0x08">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.md@27F5 = DD5F00CD</action> <!-- y position -->
            <action>maincpu.md@27FD = DD5F07CD</action> <!-- x position -->
        </script>
        <script state="run">
            <action>maincpu.pq@5F00 = CDC90086DD5F0ECD</action>
            <action>maincpu.pq@5F08 = C8A7C90186DD5F0E</action>
            <action>maincpu.pq@5F10 = 0000C944EDF0003E</action>
            <!--
            5F00 | CD 0E 5F : call $5F0E      // y position
            5F03 | DD 86 00 : add  a,(ix+$00)
            5F06 | C9       : ret
            5F07 | CD 0E 5F : call $5F0E      // x position
            5F0A | DD 86 01 : add  a,(ix+$01)
            5F0D | C9       : ret
            5F0E | A7       : and  a          // calculate routine
            5F0F | C8       : ret  z
            5F10 | 3E xx    : ld   a,$xx
            5F12 | F0       : ret  p
            5F13 | ED 44    : neg
            5F15 | C9       : ret
            -->
            <action>maincpu.pb@5F11 = param</action>
        </script>
        <script state="off">
            <action>maincpu.md@27F5 = DD0086DD        </action>
            <action>maincpu.md@27FD = DD0186DD        </action>
            <action>maincpu.pq@5F00 = 0000000000000000</action>
            <action>maincpu.pq@5F08 = 0000000000000000</action>
            <action>maincpu.pq@5F10 = 0000000000000000</action>
        </script>
    </cheat>

    <cheat desc="bullet speed">
        <parameter>
            <item value="0x08">01 (slow)</item>
            <item value="0x10">02       </item>
            <item value="0x18">03       </item>
            <item value="0x20">04       </item>
            <item value="0x28">05 (fast)</item>
        </parameter>
        <script state="change">
            <action>maincpu.mb@2A0C =  param</action>
            <action>maincpu.mb@2A0E = -param</action>
        </script>
        <script state="off">
            <action>maincpu.mb@2A0C = 10</action>
            <action>maincpu.mb@2A0E = F0</action>
        </script>
    </cheat>

    <cheat desc="fast bomb">
        <script state="on">
            <action>maincpu.mw@2939 = 5BF4</action> <!-- y position -->
            <action>maincpu.mw@2950 = 013E</action> <!-- landing timer -->
            <action>maincpu.mw@29DA = 0807</action> <!-- explosion timer -->
        </script>
        <script state="off">
            <action>maincpu.mw@2939 = 59EA</action>
            <action>maincpu.mw@2950 = 223E</action>
            <action>maincpu.mw@29DA = 2007</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@057D = 02B4CDD9580021FB</action>
            <action>maincpu.mq@0585 = F42847B858263AD9</action>
            <action>maincpu.mq@058D = 2001FE35012002FE</action>
            <action>maincpu.mq@0595 = F03E042008FE3401</action>
            <action>maincpu.mq@059D = 103E052004FE0618</action>
            <action>maincpu.mq@05A5 = 7E032010FE787786</action>
            <action>maincpu.mq@05AD = F23E052020FE0618</action>
            <action>maincpu.mq@05B5 = 000000C718609032</action>
            <!--
            057D | FB       : ei             // enable interrupt
            057E | 21 00 58 : ld   hl,$5800
            0581 | D9       : exx
            0582 | CD B4 02 : call $02B4     // check input
            0585 | D9       : exx
            0586 | 3A 26 58 : ld   a,($5826) // read input
            0589 | B8       : cp   b
            058A | 47       : ld   b,a
            058B | 28 F4    : jr   z,$0581
            058D | FE 02    : cp   $02
            058F | 20 01    : jr   nz,$0592
            0591 | 35       : dec  (hl)      // decrease code -01
            0592 | FE 01    : cp   $01
            0594 | 20 01    : jr   nz,$0597
            0596 | 34       : inc  (hl)      // increase code +01
            0597 | FE 08    : cp   $08
            0599 | 20 04    : jr   nz,$059F
            059B | 3E F0    : ld   a,$F0     // decrease code -10
            059D | 18 06    : jr   $05A5
            059F | FE 04    : cp   $04
            05A1 | 20 05    : jr   nz,$05A8
            05A3 | 3E 10    : ld   a,$10     // increase code +10
            05A5 | 86       : add  a,(hl)
            05A6 | 77       : ld   (hl),a
            05A7 | 78       : ld   a,b
            05A8 | FE 10    : cp   $10
            05AA | 20 03    : jr   nz,$05AF
            05AC | 7E       : ld   a,(hl)    // play sound
            05AD | 18 06    : jr   $05B5
            05AF | FE 20    : cp   $20
            05B1 | 20 05    : jr   nz,$05B8
            05B3 | 3E F2    : ld   a,$F2     // stop sound
            05B5 | 32 90 60 : ld   ($6090),a // send sound code
            05B8 | 18 C7    : jr   $0581
            -->
        </script>
        <script state="run">
            <output format="----- espial 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@5800</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mq@057D = 042001841C11013E</action>
            <action>maincpu.mq@0585 = 580032FF3E04D0CD</action>
            <action>maincpu.mq@058D = 803E58192258BA21</action>
            <action>maincpu.mq@0595 = 003ECF113E582332</action>
            <action>maincpu.mq@059D = 003A0006FB710032</action>
            <action>maincpu.mq@05A5 = 580021EB09100E70</action>
            <action>maincpu.mq@05AD = 0036052012FE7E34</action>
            <action>maincpu.mq@05B5 = 581922EB4E58CA11</action>
        </script>
    </cheat>

    <cheat desc="skip rom check">
        <script state="on">
            <action>maincpu.mw@4D60 = 1618</action>
        </script>
        <script state="off">
            <action>maincpu.mw@4D60 = 8679</action>
        </script>
    </cheat>

</mamecheat>
espialn.xml

Code: Select all

<!-- Espial (Nova Apparate license) -->
<mamecheat version="1">

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

    <cheat desc="auto fire">
        <script state="on">
            <action>maincpu.mb@28C0 = 04</action> <!-- bomb -->
            <action>maincpu.mb@28D5 = 04</action> <!-- shot -->
        </script>
        <script state="off">
            <action>maincpu.mb@28C0 = 28</action>
            <action>maincpu.mb@28D5 = 18</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter>
            <item value="0x01">01 (slow)</item>
            <item value="0x02">02       </item>
            <item value="0x04">03       </item>
            <item value="0x06">04       </item>
            <item value="0x08">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.md@27F5 = DD5F00CD</action> <!-- y position -->
            <action>maincpu.md@27FD = DD5F07CD</action> <!-- x position -->
        </script>
        <script state="run">
            <action>maincpu.pq@5F00 = CDC90086DD5F0ECD</action>
            <action>maincpu.pq@5F08 = C8A7C90186DD5F0E</action>
            <action>maincpu.pq@5F10 = 0000C944EDF0003E</action>
            <!--
            5F00 | CD 0E 5F : call $5F0E      // y position
            5F03 | DD 86 00 : add  a,(ix+$00)
            5F06 | C9       : ret
            5F07 | CD 0E 5F : call $5F0E      // x position
            5F0A | DD 86 01 : add  a,(ix+$01)
            5F0D | C9       : ret
            5F0E | A7       : and  a          // calculate routine
            5F0F | C8       : ret  z
            5F10 | 3E xx    : ld   a,$xx
            5F12 | F0       : ret  p
            5F13 | ED 44    : neg
            5F15 | C9       : ret
            -->
            <action>maincpu.pb@5F11 = param</action>
        </script>
        <script state="off">
            <action>maincpu.md@27F5 = DD0086DD        </action>
            <action>maincpu.md@27FD = DD0186DD        </action>
            <action>maincpu.pq@5F00 = 0000000000000000</action>
            <action>maincpu.pq@5F08 = 0000000000000000</action>
            <action>maincpu.pq@5F10 = 0000000000000000</action>
        </script>
    </cheat>

    <cheat desc="bullet speed">
        <parameter>
            <item value="0x08">01 (slow)</item>
            <item value="0x10">02       </item>
            <item value="0x18">03       </item>
            <item value="0x20">04       </item>
            <item value="0x28">05 (fast)</item>
        </parameter>
        <script state="change">
            <action>maincpu.mb@2A0C =  param</action>
            <action>maincpu.mb@2A0E = -param</action>
        </script>
        <script state="off">
            <action>maincpu.mb@2A0C = 10</action>
            <action>maincpu.mb@2A0E = F0</action>
        </script>
    </cheat>

    <cheat desc="fast bomb">
        <script state="on">
            <action>maincpu.mw@2939 = 5BF4</action> <!-- y position -->
            <action>maincpu.mw@2950 = 013E</action> <!-- landing timer -->
            <action>maincpu.mw@29DA = 0807</action> <!-- explosion timer -->
        </script>
        <script state="off">
            <action>maincpu.mw@2939 = 59EA</action>
            <action>maincpu.mw@2950 = 223E</action>
            <action>maincpu.mw@29DA = 2007</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@057D = 02B4CDD9580021FB</action>
            <action>maincpu.mq@0585 = F42847B858263AD9</action>
            <action>maincpu.mq@058D = 2001FE35012002FE</action>
            <action>maincpu.mq@0595 = F03E042008FE3401</action>
            <action>maincpu.mq@059D = 103E052004FE0618</action>
            <action>maincpu.mq@05A5 = 7E032010FE787786</action>
            <action>maincpu.mq@05AD = F23E052020FE0618</action>
            <action>maincpu.mq@05B5 = 000000C718609032</action>
            <!--
            057D | FB       : ei             // enable interrupt
            057E | 21 00 58 : ld   hl,$5800
            0581 | D9       : exx
            0582 | CD B4 02 : call $02B4     // check input
            0585 | D9       : exx
            0586 | 3A 26 58 : ld   a,($5826) // read input
            0589 | B8       : cp   b
            058A | 47       : ld   b,a
            058B | 28 F4    : jr   z,$0581
            058D | FE 02    : cp   $02
            058F | 20 01    : jr   nz,$0592
            0591 | 35       : dec  (hl)      // decrease code -01
            0592 | FE 01    : cp   $01
            0594 | 20 01    : jr   nz,$0597
            0596 | 34       : inc  (hl)      // increase code +01
            0597 | FE 08    : cp   $08
            0599 | 20 04    : jr   nz,$059F
            059B | 3E F0    : ld   a,$F0     // decrease code -10
            059D | 18 06    : jr   $05A5
            059F | FE 04    : cp   $04
            05A1 | 20 05    : jr   nz,$05A8
            05A3 | 3E 10    : ld   a,$10     // increase code +10
            05A5 | 86       : add  a,(hl)
            05A6 | 77       : ld   (hl),a
            05A7 | 78       : ld   a,b
            05A8 | FE 10    : cp   $10
            05AA | 20 03    : jr   nz,$05AF
            05AC | 7E       : ld   a,(hl)    // play sound
            05AD | 18 06    : jr   $05B5
            05AF | FE 20    : cp   $20
            05B1 | 20 05    : jr   nz,$05B8
            05B3 | 3E F2    : ld   a,$F2     // stop sound
            05B5 | 32 90 60 : ld   ($6090),a // send sound code
            05B8 | 18 C7    : jr   $0581
            -->
        </script>
        <script state="run">
            <output format="----- espial 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@5800</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mq@057D = 042001841C11013E</action>
            <action>maincpu.mq@0585 = 580032FF3E04D0CD</action>
            <action>maincpu.mq@058D = 803E58192258BA21</action>
            <action>maincpu.mq@0595 = 003ECF113E582332</action>
            <action>maincpu.mq@059D = 003A0006FB710032</action>
            <action>maincpu.mq@05A5 = 580021EB09100E70</action>
            <action>maincpu.mq@05AD = 0036052012FE7E34</action>
            <action>maincpu.mq@05B5 = 581922EB4E58CA11</action>
        </script>
    </cheat>

    <cheat desc="skip rom check">
        <script state="on">
            <action>maincpu.mw@4D60 = 1618</action>
        </script>
        <script state="off">
            <action>maincpu.mw@4D60 = 8679</action>
        </script>
    </cheat>

</mamecheat>
Also clean up espial and espialu.

espial.xml

Code: Select all

<!-- Espial (Europe) -->
<mamecheat version="1">

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

    <cheat desc="auto fire">
        <script state="on">
            <action>maincpu.mb@27F5 = 04</action> <!-- bomb -->
            <action>maincpu.mb@280A = 04</action> <!-- shot -->
        </script>
        <script state="off">
            <action>maincpu.mb@27F5 = 28</action>
            <action>maincpu.mb@280A = 18</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter>
            <item value="0x01">01 (slow)</item>
            <item value="0x02">02       </item>
            <item value="0x04">03       </item>
            <item value="0x06">04       </item>
            <item value="0x08">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.md@272A = DD5F00CD</action> <!-- y position -->
            <action>maincpu.md@2732 = DD5F07CD</action> <!-- x position -->
        </script>
        <script state="run">
            <action>maincpu.pq@5F00 = CDC90086DD5F0ECD</action>
            <action>maincpu.pq@5F08 = C8A7C90186DD5F0E</action>
            <action>maincpu.pq@5F10 = 0000C944EDF0003E</action>
            <!--
            5F00 | CD 0E 5F : call $5F0E      // y position
            5F03 | DD 86 00 : add  a,(ix+$00)
            5F06 | C9       : ret
            5F07 | CD 0E 5F : call $5F0E      // x position
            5F0A | DD 86 01 : add  a,(ix+$01)
            5F0D | C9       : ret
            5F0E | A7       : and  a          // calculate routine
            5F0F | C8       : ret  z
            5F10 | 3E xx    : ld   a,$xx
            5F12 | F0       : ret  p
            5F13 | ED 44    : neg
            5F15 | C9       : ret
            -->
            <action>maincpu.pb@5F11 = param</action>
        </script>
        <script state="off">
            <action>maincpu.md@272A = DD0086DD        </action>
            <action>maincpu.md@2732 = DD0186DD        </action>
            <action>maincpu.pq@5F00 = 0000000000000000</action>
            <action>maincpu.pq@5F08 = 0000000000000000</action>
            <action>maincpu.pq@5F10 = 0000000000000000</action>
        </script>
    </cheat>

    <cheat desc="bullet speed">
        <parameter>
            <item value="0x08">01 (slow)</item>
            <item value="0x10">02       </item>
            <item value="0x18">03       </item>
            <item value="0x20">04       </item>
            <item value="0x28">05 (fast)</item>
        </parameter>
        <script state="change">
            <action>maincpu.mb@2941 =  param</action>
            <action>maincpu.mb@2943 = -param</action>
        </script>
        <script state="off">
            <action>maincpu.mb@2941 = 10</action>
            <action>maincpu.mb@2943 = F0</action>
        </script>
    </cheat>

    <cheat desc="fast bomb">
        <script state="on">
            <action>maincpu.mw@286E = 5BF4</action> <!-- y position -->
            <action>maincpu.mw@2885 = 013E</action> <!-- landing timer -->
            <action>maincpu.mw@290F = 0807</action> <!-- explosion timer -->
        </script>
        <script state="off">
            <action>maincpu.mw@286E = 59EA</action>
            <action>maincpu.mw@2885 = 223E</action>
            <action>maincpu.mw@290F = 2007</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@04AF = 02B4CDD9580021FB</action>
            <action>maincpu.mq@04B7 = F42847B858263AD9</action>
            <action>maincpu.mq@04BF = 2001FE35012002FE</action>
            <action>maincpu.mq@04C7 = F03E042008FE3401</action>
            <action>maincpu.mq@04CF = 103E052004FE0618</action>
            <action>maincpu.mq@04D7 = 7E032010FE787786</action>
            <action>maincpu.mq@04DF = F23E052020FE0618</action>
            <action>maincpu.mq@04E7 = 000000C718609032</action>
            <!--
            04AF | FB       : ei             // enable interrupt
            04B0 | 21 00 58 : ld   hl,$5800
            04B3 | D9       : exx
            04B4 | CD B4 02 : call $02B4     // check input
            04B7 | D9       : exx
            04B8 | 3A 26 58 : ld   a,($5826) // read input
            04BB | B8       : cp   b
            04BC | 47       : ld   b,a
            04BD | 28 F4    : jr   z,$04B3
            04BF | FE 02    : cp   $02
            04C1 | 20 01    : jr   nz,$04C4
            04C3 | 35       : dec  (hl)      // decrease code -01
            04C4 | FE 01    : cp   $01
            04C6 | 20 01    : jr   nz,$04C9
            04C8 | 34       : inc  (hl)      // increase code +01
            04C9 | FE 08    : cp   $08
            04CB | 20 04    : jr   nz,$04D1
            04CD | 3E F0    : ld   a,$F0     // decrease code -10
            04CF | 18 06    : jr   $04D7
            04D1 | FE 04    : cp   $04
            04D3 | 20 05    : jr   nz,$04DA
            04D5 | 3E 10    : ld   a,$10     // increase code +10
            04D7 | 86       : add  a,(hl)
            04D8 | 77       : ld   (hl),a
            04D9 | 78       : ld   a,b
            04DA | FE 10    : cp   $10
            04DC | 20 03    : jr   nz,$04E1
            04DE | 7E       : ld   a,(hl)    // play sound
            04DF | 18 06    : jr   $04E7
            04E1 | FE 20    : cp   $20
            04E3 | 20 05    : jr   nz,$04EA
            04E5 | 3E F2    : ld   a,$F2     // stop sound
            04E7 | 32 90 60 : ld   ($6090),a // send sound code
            04EA | 18 C7    : jr   $04B3
            -->
        </script>
        <script state="run">
            <output format="----- espial 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@5800</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mq@04AF = 042001841C11013E</action>
            <action>maincpu.mq@04B7 = 580032FF3E0402CD</action>
            <action>maincpu.mq@04BF = 803E58192258BA21</action>
            <action>maincpu.mq@04C7 = 003ECF113E582332</action>
            <action>maincpu.mq@04CF = 003A0006FB710032</action>
            <action>maincpu.mq@04D7 = 580021EB09100E70</action>
            <action>maincpu.mq@04DF = 0036052012FE7E34</action>
            <action>maincpu.mq@04E7 = 581922EB4E58CA11</action>
        </script>
    </cheat>

    <cheat desc="skip rom check">
        <script state="on">
            <action>maincpu.mw@4C8C = 1618</action>
        </script>
        <script state="off">
            <action>maincpu.mw@4C8C = 8679</action>
        </script>
    </cheat>

</mamecheat>
espialu.xml

Code: Select all

<!-- Espial (US?) -->
<mamecheat version="1">

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

    <cheat desc="auto fire">
        <script state="on">
            <action>maincpu.mb@28C0 = 04</action> <!-- bomb -->
            <action>maincpu.mb@28D5 = 04</action> <!-- shot -->
        </script>
        <script state="off">
            <action>maincpu.mb@28C0 = 28</action>
            <action>maincpu.mb@28D5 = 18</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter>
            <item value="0x01">01 (slow)</item>
            <item value="0x02">02       </item>
            <item value="0x04">03       </item>
            <item value="0x06">04       </item>
            <item value="0x08">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.md@27F5 = DD5F00CD</action> <!-- y position -->
            <action>maincpu.md@27FD = DD5F07CD</action> <!-- x position -->
        </script>
        <script state="run">
            <action>maincpu.pq@5F00 = CDC90086DD5F0ECD</action>
            <action>maincpu.pq@5F08 = C8A7C90186DD5F0E</action>
            <action>maincpu.pq@5F10 = 0000C944EDF0003E</action>
            <!--
            5F00 | CD 0E 5F : call $5F0E      // y position
            5F03 | DD 86 00 : add  a,(ix+$00)
            5F06 | C9       : ret
            5F07 | CD 0E 5F : call $5F0E      // x position
            5F0A | DD 86 01 : add  a,(ix+$01)
            5F0D | C9       : ret
            5F0E | A7       : and  a          // calculate routine
            5F0F | C8       : ret  z
            5F10 | 3E xx    : ld   a,$xx
            5F12 | F0       : ret  p
            5F13 | ED 44    : neg
            5F15 | C9       : ret
            -->
            <action>maincpu.pb@5F11 = param</action>
        </script>
        <script state="off">
            <action>maincpu.md@27F5 = DD0086DD        </action>
            <action>maincpu.md@27FD = DD0186DD        </action>
            <action>maincpu.pq@5F00 = 0000000000000000</action>
            <action>maincpu.pq@5F08 = 0000000000000000</action>
            <action>maincpu.pq@5F10 = 0000000000000000</action>
        </script>
    </cheat>

    <cheat desc="bullet speed">
        <parameter>
            <item value="0x08">01 (slow)</item>
            <item value="0x10">02       </item>
            <item value="0x18">03       </item>
            <item value="0x20">04       </item>
            <item value="0x28">05 (fast)</item>
        </parameter>
        <script state="change">
            <action>maincpu.mb@2A0C =  param</action>
            <action>maincpu.mb@2A0E = -param</action>
        </script>
        <script state="off">
            <action>maincpu.mb@2A0C = 10</action>
            <action>maincpu.mb@2A0E = F0</action>
        </script>
    </cheat>

    <cheat desc="fast bomb">
        <script state="on">
            <action>maincpu.mw@2939 = 5BF4</action> <!-- y position -->
            <action>maincpu.mw@2950 = 013E</action> <!-- landing timer -->
            <action>maincpu.mw@29DA = 0807</action> <!-- explosion timer -->
        </script>
        <script state="off">
            <action>maincpu.mw@2939 = 59EA</action>
            <action>maincpu.mw@2950 = 223E</action>
            <action>maincpu.mw@29DA = 2007</action>
        </script>
    </cheat>

    <cheat desc="no broken sound (test)">
        <script state="on">
            <action>audiocpu.mb@1F14 = 18</action>
        </script>
        <script state="off">
            <action>audiocpu.mb@1F14 = 28</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@057D = 02B4CDD9580021FB</action>
            <action>maincpu.mq@0585 = F42847B858263AD9</action>
            <action>maincpu.mq@058D = 2001FE35012002FE</action>
            <action>maincpu.mq@0595 = F03E042008FE3401</action>
            <action>maincpu.mq@059D = 103E052004FE0618</action>
            <action>maincpu.mq@05A5 = 7E032010FE787786</action>
            <action>maincpu.mq@05AD = F23E052020FE0618</action>
            <action>maincpu.mq@05B5 = 000000C718609032</action>
            <!--
            057D | FB       : ei             // enable interrupt
            057E | 21 00 58 : ld   hl,$5800
            0581 | D9       : exx
            0582 | CD B4 02 : call $02B4     // check input
            0585 | D9       : exx
            0586 | 3A 26 58 : ld   a,($5826) // read input
            0589 | B8       : cp   b
            058A | 47       : ld   b,a
            058B | 28 F4    : jr   z,$0581
            058D | FE 02    : cp   $02
            058F | 20 01    : jr   nz,$0592
            0591 | 35       : dec  (hl)      // decrease code -01
            0592 | FE 01    : cp   $01
            0594 | 20 01    : jr   nz,$0597
            0596 | 34       : inc  (hl)      // increase code +01
            0597 | FE 08    : cp   $08
            0599 | 20 04    : jr   nz,$059F
            059B | 3E F0    : ld   a,$F0     // decrease code -10
            059D | 18 06    : jr   $05A5
            059F | FE 04    : cp   $04
            05A1 | 20 05    : jr   nz,$05A8
            05A3 | 3E 10    : ld   a,$10     // increase code +10
            05A5 | 86       : add  a,(hl)
            05A6 | 77       : ld   (hl),a
            05A7 | 78       : ld   a,b
            05A8 | FE 10    : cp   $10
            05AA | 20 03    : jr   nz,$05AF
            05AC | 7E       : ld   a,(hl)    // play sound
            05AD | 18 06    : jr   $05B5
            05AF | FE 20    : cp   $20
            05B1 | 20 05    : jr   nz,$05B8
            05B3 | 3E F2    : ld   a,$F2     // stop sound
            05B5 | 32 90 60 : ld   ($6090),a // send sound code
            05B8 | 18 C7    : jr   $0581
            -->
            <action>audiocpu.mb@184A = 00</action> <!-- disable playing music and sfx at the same time -->
        </script>
        <script state="run">
            <output format="----- espial 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@5800</argument>
            </output>
        </script>
        <script state="off">
            <action> maincpu.mq@057D = 042001841C11013E</action>
            <action> maincpu.mq@0585 = 580032FF3E04D0CD</action>
            <action> maincpu.mq@058D = 803E58192258BA21</action>
            <action> maincpu.mq@0595 = 003ECF113E582332</action>
            <action> maincpu.mq@059D = 003A0006FB710032</action>
            <action> maincpu.mq@05A5 = 580021EB09100E70</action>
            <action> maincpu.mq@05AD = 0036052012FE7E34</action>
            <action> maincpu.mq@05B5 = 581922EB4E58CA11</action>
            <action>audiocpu.mb@184A = 03              </action>
        </script>
    </cheat>

    <cheat desc="skip rom check">
        <script state="on">
            <action>maincpu.mw@4D60 = 1618</action>
        </script>
        <script state="off">
            <action>maincpu.mw@4D60 = 8679</action>
        </script>
    </cheat>

</mamecheat>
I add "no broken sound (test)" code for espialu because sometimes sound is broken when you use "auto fire" + "fast bomb".
Post Reply