[tsamurai] Samurai Nihon-Ichi

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: 842
Joined: Tue Dec 01, 2020 1:24 pm

[tsamurai] Samurai Nihon-Ichi

Post by jman »

Code: Select all

<cheat desc="no hit">
    <script state="on">
        <action>maincpu.mq@269b = 00000c18c30732af</action> <!-- xor a / ld ($C307),a / jr $26AD / nop / nop -->
    </script>
    <script state="off">
        <action>maincpu.mq@269b = 2a18ca01fec3073a</action>
    </script>
</cheat>

<cheat desc="auto fire">
    <script state="on">
        <action>maincpu.md@4552 = a7c0e53a</action> <!-- button 2 -->
        <action>maincpu.md@4558 = a7c0e43a</action> <!-- button 1 -->
    </script>
    <script state="off">
        <action>maincpu.md@4552 = a7177edd</action>
        <action>maincpu.md@4558 = a7167edd</action>
    </script>
</cheat>

<cheat desc="attack speed up">
    <script state="on">
        <action>maincpu.mb@4539 = 01</action>
    </script>
    <script state="off">
        <action>maincpu.mb@4539 = 03</action>
    </script>
</cheat>

<cheat desc="timer speed">
    <parameter>
        <item value="0xff">01 (slow)</item>
        <item value="0x80">02       </item>
        <item value="0x40">03       </item>
        <item value="0x10">04       </item>
        <item value="0x00">05 (fast)</item>
    </parameter>
    <script state="change">
        <action>maincpu.mb@228b = param</action>
    </script>
    <script state="off">
        <action>maincpu.mb@228b = 3c</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.mb@0141 =               18</action> <!-- enable sound -->
        <action>maincpu.md@07a3 =         06a200c3</action>
        <action>maincpu.mq@a200 = 003af40111c01021</action>
        <action>maincpu.mq@a208 = 2002fef32847b8f8</action>
        <action>maincpu.mq@a210 = fe34012001fe3501</action>
        <action>maincpu.mq@a218 = fe0618f03e042008</action>
        <action>maincpu.mq@a220 = 787786103e052004</action>
        <action>maincpu.mq@a228 = 3010fe7e172010fe</action>
        <action>maincpu.mq@a230 = 10d60c18c1083205</action>
        <action>maincpu.mq@a238 = 10d60318023010fe</action>
        <action>maincpu.mq@a240 = af082020fe781213</action>
        <action>maincpu.mq@a248 = 18c108323c121312</action>
        <action>maincpu.mq@a250 = 00000000000000af</action>
        <!--
        a200 | 21 10 c0 : ld  hl,$C010  // sound code address
        a203 | 11 01 f4 : ld  de,$F401
        a206 | 3a 00 f8 : ld  a,($F800) // read input
        a209 | b8       : cp  b
        a20a | 47       : ld  b,a
        a20b | 28 f3    : jr  z,$A200
        a20d | fe 02    : cp  $02
        a20f | 20 01    : jr  nz,$A212
        a211 | 35       : dec (hl)      // decrease code -01
        a212 | fe 01    : cp  $01
        a214 | 20 01    : jr  nz,$A217
        a216 | 34       : inc (hl)      // increase code +01
        a217 | fe 08    : cp  $08
        a219 | 20 04    : jr  nz,$A21F
        a21b | 3e f0    : ld  a,$F0     // decrease code -10
        a21d | 18 06    : jr  $A225
        a21f | fe 04    : cp  $04
        a221 | 20 05    : jr  nz,$A228
        a223 | 3e 10    : ld  a,$10     // increase code +10
        a225 | 86       : add a,(hl)
        a226 | 77       : ld  (hl),a
        a227 | 78       : ld  a,b
        a228 | fe 10    : cp  $10
        a22a | 20 17    : jr  nz,$A243
        a22c | 7e       : ld  a,(hl)    // play sound
        a22d | fe 10    : cp  $10
        a22f | 30 05    : jr  nc,$A236
        a231 | 32 08 c1 : ld  ($C108),a // send music code 0x00-0x0f to $c108
        a234 | 18 0c    : jr  $A242
        a236 | d6 10    : sub $10
        a238 | fe 10    : cp  $10
        a23a | 30 02    : jr  nc,$A23E
        a23c | 18 03    : jr  $A241     // send sfx code 0x10-0x1f to $f401
        a23e | d6 10    : sub $10
        a240 | 13       : inc de        // send sfx code 0x20- to $f402
        a241 | 12       : ld  (de),a
        a242 | 78       : ld  a,b
        a243 | fe 20    : cp  $20
        a245 | 20 08    : jr  nz,$A24F
        a247 | af       : xor a         // stop sound
        a248 | 12       : ld  (de),a
        a249 | 13       : inc de
        a24a | 12       : ld  (de),a
        a24b | 3c       : inc a
        a24c | 32 08 c1 : ld  ($C108),a
        a24f | 18 af    : jr  $A200
        -->
    </script>
    <script state="run">
        <output format="----- samurai nihon-ichi 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="up : increase code +10"                         line="13" align="center" />
        <output format="down : decrease 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@c010</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.mb@0141 =               20</action>
        <action>maincpu.md@07a3 =         06c14021</action>
        <action>maincpu.mq@a200 = 0000000000000000</action>
        <action>maincpu.mq@a208 = 0000000000000000</action>
        <action>maincpu.mq@a210 = 0000000000000000</action>
        <action>maincpu.mq@a218 = 0000000000000000</action>
        <action>maincpu.mq@a220 = 0000000000000000</action>
        <action>maincpu.mq@a228 = 0000000000000000</action>
        <action>maincpu.mq@a230 = 0000000000000000</action>
        <action>maincpu.mq@a238 = 0000000000000000</action>
        <action>maincpu.mq@a240 = 0000000000000000</action>
        <action>maincpu.mq@a248 = 0000000000000000</action>
        <action>maincpu.mq@a250 = 0000000000000000</action>
    </script>
</cheat>

<cheat desc="skip rom check">
    <script state="on">
        <action>maincpu.mw@046f = 3418</action>
    </script>
    <script state="off">
        <action>maincpu.mw@046f = 4016</action>
    </script>
</cheat>
jman
Posts: 842
Joined: Tue Dec 01, 2020 1:24 pm

[tsamurai]+ Samurai Nihon-Ichi

Post by jman »

tsamurai.xml

Code: Select all

<!-- Samurai Nihon-Ichi (set 1) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>maincpu.mb@33F0 = C9</action> <!-- dagger -->
            <action>maincpu.mb@37C9 = C9</action> <!-- arrow -->
            <action>maincpu.mb@3C93 = C9</action> <!-- bomb -->
            <action>maincpu.mb@429B = C9</action> <!-- tiger -->
            <action>maincpu.mb@4C08 = C9</action> <!-- boss -->
            <action>maincpu.mb@9AE4 = C9</action> <!-- samurai -->
            <action>maincpu.mb@9F3E = C9</action> <!-- syuriken -->
        </script>
        <script state="off">
            <action>maincpu.mb@33F0 = 3E</action>
            <action>maincpu.mb@37C9 = 3E</action>
            <action>maincpu.mb@3C93 = 3E</action>
            <action>maincpu.mb@429B = 3E</action>
            <action>maincpu.mb@4C08 = 3E</action>
            <action>maincpu.mb@9AE4 = 3E</action>
            <action>maincpu.mb@9F3E = 3E</action>
        </script>
    </cheat>

    <cheat desc="auto fire">
        <script state="on">
            <action>maincpu.md@4552 = A7C0E53A</action> <!-- button 2 -->
            <action>maincpu.md@4558 = A7C0E43A</action> <!-- button 1 -->
        </script>
        <script state="off">
            <action>maincpu.md@4552 = A7177EDD</action>
            <action>maincpu.md@4558 = A7167EDD</action>
        </script>
    </cheat>

    <cheat desc="attack speed up">
        <script state="on">
            <action>maincpu.mb@4539 = 01</action>
        </script>
        <script state="off">
            <action>maincpu.mb@4539 = 03</action>
        </script>
    </cheat>

    <cheat desc="timer speed">
        <parameter>
            <item value="0xff">01 (slow)</item>
            <item value="0x80">02       </item>
            <item value="0x40">03       </item>
            <item value="0x10">04       </item>
            <item value="0x00">05 (fast)</item>
        </parameter>
        <script state="change">
            <action>maincpu.mb@228B = param</action>
        </script>
        <script state="off">
            <action>maincpu.mb@228B = 3C</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.mb@0141 = 18              </action> <!-- enable sound -->
            <action>maincpu.md@07A3 = 06A200C3        </action>
            <action>maincpu.mq@A200 = 47B8F8003AC00021</action>
            <action>maincpu.mq@A208 = FE35012002FEF928</action>
            <action>maincpu.mq@A210 = 042008FE34012001</action>
            <action>maincpu.mq@A218 = 052004FE0618F03E</action>
            <action>maincpu.mq@A220 = F40111787786103E</action>
            <action>maincpu.mq@A228 = 3010FE7E152010FE</action>
            <action>maincpu.mq@A230 = 10D60A18C1083205</action>
            <action>maincpu.mq@A238 = 121310D6033810FE</action>
            <action>maincpu.mq@A240 = 1312AF082020FE78</action>
            <action>maincpu.mq@A248 = 00B418C108323C12</action>
            <!--
            A200 | 21 00 C0 : ld   hl,$C000  // sound code address
            A203 | 3A 00 F8 : ld   a,($F800) // read input
            A206 | B8       : cp   b
            A207 | 47       : ld   b,a
            A208 | 28 F9    : jr   z,$A203
            A20A | FE 02    : cp   $02
            A20C | 20 01    : jr   nz,$A20F
            A20E | 35       : dec  (hl)      // decrease code -01
            A20F | FE 01    : cp   $01
            A211 | 20 01    : jr   nz,$A214
            A213 | 34       : inc  (hl)      // increase code +01
            A214 | FE 08    : cp   $08
            A216 | 20 04    : jr   nz,$A21C
            A218 | 3E F0    : ld   a,$F0     // decrease code -10
            A21A | 18 06    : jr   $A222
            A21C | FE 04    : cp   $04
            A21E | 20 05    : jr   nz,$A225
            A220 | 3E 10    : ld   a,$10     // increase code +10
            A222 | 86       : add  a,(hl)
            A223 | 77       : ld   (hl),a
            A224 | 78       : ld   a,b
            A225 | 11 01 F4 : ld   de,$F401
            A228 | FE 10    : cp   $10
            A22A | 20 15    : jr   nz,$A241
            A22C | 7E       : ld   a,(hl)    // play sound
            A22D | FE 10    : cp   $10
            A22F | 30 05    : jr   nc,$A236
            A231 | 32 08 C1 : ld   ($C108),a // music (0x00-0x0f)
            A234 | 18 0A    : jr   $A240
            A236 | D6 10    : sub  $10       // sfx 1 (0x10-0x1f)
            A238 | FE 10    : cp   $10
            A23A | 38 03    : jr   c,$A23F
            A23C | D6 10    : sub  $10       // sfx 2 (0x20-)
            A23E | 13       : inc  de
            A23F | 12       : ld   (de),a
            A240 | 78       : ld   a,b
            A241 | FE 20    : cp   $20
            A243 | 20 08    : jr   nz,$A24D
            A245 | AF       : xor  a         // stop sound
            A246 | 12       : ld   (de),a
            A247 | 13       : inc  de
            A248 | 12       : ld   (de),a
            A249 | 3C       : inc  a
            A24A | 32 08 C1 : ld   ($C108),a
            A24D | 18 B4    : jr   $A203
            -->
        </script>
        <script state="run">
            <output format="----- samurai nihon-ichi 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@C000</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mb@0141 = 20              </action>
            <action>maincpu.md@07A3 = 06C14021        </action>
            <action>maincpu.mq@A200 = 0000000000000000</action>
            <action>maincpu.mq@A208 = 0000000000000000</action>
            <action>maincpu.mq@A210 = 0000000000000000</action>
            <action>maincpu.mq@A218 = 0000000000000000</action>
            <action>maincpu.mq@A220 = 0000000000000000</action>
            <action>maincpu.mq@A228 = 0000000000000000</action>
            <action>maincpu.mq@A230 = 0000000000000000</action>
            <action>maincpu.mq@A238 = 0000000000000000</action>
            <action>maincpu.mq@A240 = 0000000000000000</action>
            <action>maincpu.mq@A248 = 0000000000000000</action>
        </script>
    </cheat>

    <cheat desc="skip rom check">
        <script state="on">
            <action>maincpu.mw@046F = 3418</action>
        </script>
        <script state="off">
            <action>maincpu.mw@046F = 4016</action>
        </script>
    </cheat>

</mamecheat>
tsamurai2.xml

Code: Select all

<!-- Samurai Nihon-Ichi (set 2) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>maincpu.mb@33E3 = C9</action> <!-- dagger -->
            <action>maincpu.mb@37AA = C9</action> <!-- arrow -->
            <action>maincpu.mb@3C4E = C9</action> <!-- bomb -->
            <action>maincpu.mb@422F = C9</action> <!-- tiger -->
            <action>maincpu.mb@4C08 = C9</action> <!-- boss -->
            <action>maincpu.mb@9AE4 = C9</action> <!-- samurai -->
            <action>maincpu.mb@9F3E = C9</action> <!-- syuriken -->
        </script>
        <script state="off">
            <action>maincpu.mb@33E3 = 3E</action>
            <action>maincpu.mb@37AA = 3E</action>
            <action>maincpu.mb@3C4E = 3E</action>
            <action>maincpu.mb@422F = 3E</action>
            <action>maincpu.mb@4C08 = 3E</action>
            <action>maincpu.mb@9AE4 = 3E</action>
            <action>maincpu.mb@9F3E = 3E</action>
        </script>
    </cheat>

    <cheat desc="auto fire">
        <script state="on">
            <action>maincpu.md@4552 = A7C0E53A</action> <!-- button 2 -->
            <action>maincpu.md@4558 = A7C0E43A</action> <!-- button 1 -->
        </script>
        <script state="off">
            <action>maincpu.md@4552 = A7177EDD</action>
            <action>maincpu.md@4558 = A7167EDD</action>
        </script>
    </cheat>

    <cheat desc="attack speed up">
        <script state="on">
            <action>maincpu.mb@4539 = 01</action>
        </script>
        <script state="off">
            <action>maincpu.mb@4539 = 03</action>
        </script>
    </cheat>

    <cheat desc="timer speed">
        <parameter>
            <item value="0xff">01 (slow)</item>
            <item value="0x80">02       </item>
            <item value="0x40">03       </item>
            <item value="0x10">04       </item>
            <item value="0x00">05 (fast)</item>
        </parameter>
        <script state="change">
            <action>maincpu.mb@228B = param</action>
        </script>
        <script state="off">
            <action>maincpu.mb@228B = 3C</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.mb@0141 = 18              </action> <!-- enable sound -->
            <action>maincpu.md@0787 = 06A200C3        </action>
            <action>maincpu.mq@A200 = 47B8F8003AC00021</action>
            <action>maincpu.mq@A208 = FE35012002FEF928</action>
            <action>maincpu.mq@A210 = 042008FE34012001</action>
            <action>maincpu.mq@A218 = 052004FE0618F03E</action>
            <action>maincpu.mq@A220 = F40111787786103E</action>
            <action>maincpu.mq@A228 = 3010FE7E152010FE</action>
            <action>maincpu.mq@A230 = 10D60A18C1083205</action>
            <action>maincpu.mq@A238 = 121310D6033810FE</action>
            <action>maincpu.mq@A240 = 1312AF082020FE78</action>
            <action>maincpu.mq@A248 = 00B418C108323C12</action>
            <!--
            A200 | 21 00 C0 : ld   hl,$C000  // sound code address
            A203 | 3A 00 F8 : ld   a,($F800) // read input
            A206 | B8       : cp   b
            A207 | 47       : ld   b,a
            A208 | 28 F9    : jr   z,$A203
            A20A | FE 02    : cp   $02
            A20C | 20 01    : jr   nz,$A20F
            A20E | 35       : dec  (hl)      // decrease code -01
            A20F | FE 01    : cp   $01
            A211 | 20 01    : jr   nz,$A214
            A213 | 34       : inc  (hl)      // increase code +01
            A214 | FE 08    : cp   $08
            A216 | 20 04    : jr   nz,$A21C
            A218 | 3E F0    : ld   a,$F0     // decrease code -10
            A21A | 18 06    : jr   $A222
            A21C | FE 04    : cp   $04
            A21E | 20 05    : jr   nz,$A225
            A220 | 3E 10    : ld   a,$10     // increase code +10
            A222 | 86       : add  a,(hl)
            A223 | 77       : ld   (hl),a
            A224 | 78       : ld   a,b
            A225 | 11 01 F4 : ld   de,$F401
            A228 | FE 10    : cp   $10
            A22A | 20 15    : jr   nz,$A241
            A22C | 7E       : ld   a,(hl)    // play sound
            A22D | FE 10    : cp   $10
            A22F | 30 05    : jr   nc,$A236
            A231 | 32 08 C1 : ld   ($C108),a // music (0x00-0x0f)
            A234 | 18 0A    : jr   $A240
            A236 | D6 10    : sub  $10       // sfx 1 (0x10-0x1f)
            A238 | FE 10    : cp   $10
            A23A | 38 03    : jr   c,$A23F
            A23C | D6 10    : sub  $10       // sfx 2 (0x20-)
            A23E | 13       : inc  de
            A23F | 12       : ld   (de),a
            A240 | 78       : ld   a,b
            A241 | FE 20    : cp   $20
            A243 | 20 08    : jr   nz,$A24D
            A245 | AF       : xor  a         // stop sound
            A246 | 12       : ld   (de),a
            A247 | 13       : inc  de
            A248 | 12       : ld   (de),a
            A249 | 3C       : inc  a
            A24A | 32 08 C1 : ld   ($C108),a
            A24D | 18 B4    : jr   $A203
            -->
        </script>
        <script state="run">
            <output format="----- samurai nihon-ichi 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@C000</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mb@0141 = 20              </action>
            <action>maincpu.md@0787 = 06C14021        </action>
            <action>maincpu.mq@A200 = 0000000000000000</action>
            <action>maincpu.mq@A208 = 0000000000000000</action>
            <action>maincpu.mq@A210 = 0000000000000000</action>
            <action>maincpu.mq@A218 = 0000000000000000</action>
            <action>maincpu.mq@A220 = 0000000000000000</action>
            <action>maincpu.mq@A228 = 0000000000000000</action>
            <action>maincpu.mq@A230 = 0000000000000000</action>
            <action>maincpu.mq@A238 = 0000000000000000</action>
            <action>maincpu.mq@A240 = 0000000000000000</action>
            <action>maincpu.mq@A248 = 0000000000000000</action>
        </script>
    </cheat>

    <cheat desc="skip rom check">
        <script state="on">
            <action>maincpu.mw@0453 = 3418</action>
        </script>
        <script state="off">
            <action>maincpu.mw@0453 = 4016</action>
        </script>
    </cheat>

</mamecheat>
tsamuraih.xml

Code: Select all

<!-- Samurai Nihon-Ichi (bootleg, harder) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>maincpu.mb@33E3 = C9</action> <!-- dagger -->
            <action>maincpu.mb@37AA = C9</action> <!-- arrow -->
            <action>maincpu.mb@3C4E = C9</action> <!-- bomb -->
            <action>maincpu.mb@422F = C9</action> <!-- tiger -->
            <action>maincpu.mb@4C08 = C9</action> <!-- boss -->
            <action>maincpu.mb@9AE4 = C9</action> <!-- samurai -->
            <action>maincpu.mb@9F3E = C9</action> <!-- syuriken -->
        </script>
        <script state="off">
            <action>maincpu.mb@33E3 = 3E</action>
            <action>maincpu.mb@37AA = 3E</action>
            <action>maincpu.mb@3C4E = 3E</action>
            <action>maincpu.mb@422F = 3E</action>
            <action>maincpu.mb@4C08 = 3E</action>
            <action>maincpu.mb@9AE4 = 3E</action>
            <action>maincpu.mb@9F3E = 3E</action>
        </script>
    </cheat>

    <cheat desc="auto fire">
        <script state="on">
            <action>maincpu.md@4552 = A7C0E53A</action> <!-- button 2 -->
            <action>maincpu.md@4558 = A7C0E43A</action> <!-- button 1 -->
        </script>
        <script state="off">
            <action>maincpu.md@4552 = A7177EDD</action>
            <action>maincpu.md@4558 = A7167EDD</action>
        </script>
    </cheat>

    <cheat desc="attack speed up">
        <script state="on">
            <action>maincpu.mb@4539 = 01</action>
        </script>
        <script state="off">
            <action>maincpu.mb@4539 = 03</action>
        </script>
    </cheat>

    <cheat desc="timer speed">
        <parameter>
            <item value="0xff">01 (slow)</item>
            <item value="0x80">02       </item>
            <item value="0x40">03       </item>
            <item value="0x10">04       </item>
            <item value="0x00">05 (fast)</item>
        </parameter>
        <script state="change">
            <action>maincpu.mb@228B = param</action>
        </script>
        <script state="off">
            <action>maincpu.mb@228B = 3C</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.mb@0141 = 18              </action> <!-- enable sound -->
            <action>maincpu.md@0787 = 06A200C3        </action>
            <action>maincpu.mq@A200 = 47B8F8003AC00021</action>
            <action>maincpu.mq@A208 = FE35012002FEF928</action>
            <action>maincpu.mq@A210 = 042008FE34012001</action>
            <action>maincpu.mq@A218 = 052004FE0618F03E</action>
            <action>maincpu.mq@A220 = F40111787786103E</action>
            <action>maincpu.mq@A228 = 3010FE7E152010FE</action>
            <action>maincpu.mq@A230 = 10D60A18C1083205</action>
            <action>maincpu.mq@A238 = 121310D6033810FE</action>
            <action>maincpu.mq@A240 = 1312AF082020FE78</action>
            <action>maincpu.mq@A248 = 00B418C108323C12</action>
            <!--
            A200 | 21 00 C0 : ld   hl,$C000  // sound code address
            A203 | 3A 00 F8 : ld   a,($F800) // read input
            A206 | B8       : cp   b
            A207 | 47       : ld   b,a
            A208 | 28 F9    : jr   z,$A203
            A20A | FE 02    : cp   $02
            A20C | 20 01    : jr   nz,$A20F
            A20E | 35       : dec  (hl)      // decrease code -01
            A20F | FE 01    : cp   $01
            A211 | 20 01    : jr   nz,$A214
            A213 | 34       : inc  (hl)      // increase code +01
            A214 | FE 08    : cp   $08
            A216 | 20 04    : jr   nz,$A21C
            A218 | 3E F0    : ld   a,$F0     // decrease code -10
            A21A | 18 06    : jr   $A222
            A21C | FE 04    : cp   $04
            A21E | 20 05    : jr   nz,$A225
            A220 | 3E 10    : ld   a,$10     // increase code +10
            A222 | 86       : add  a,(hl)
            A223 | 77       : ld   (hl),a
            A224 | 78       : ld   a,b
            A225 | 11 01 F4 : ld   de,$F401
            A228 | FE 10    : cp   $10
            A22A | 20 15    : jr   nz,$A241
            A22C | 7E       : ld   a,(hl)    // play sound
            A22D | FE 10    : cp   $10
            A22F | 30 05    : jr   nc,$A236
            A231 | 32 08 C1 : ld   ($C108),a // music (0x00-0x0f)
            A234 | 18 0A    : jr   $A240
            A236 | D6 10    : sub  $10       // sfx 1 (0x10-0x1f)
            A238 | FE 10    : cp   $10
            A23A | 38 03    : jr   c,$A23F
            A23C | D6 10    : sub  $10       // sfx 2 (0x20-)
            A23E | 13       : inc  de
            A23F | 12       : ld   (de),a
            A240 | 78       : ld   a,b
            A241 | FE 20    : cp   $20
            A243 | 20 08    : jr   nz,$A24D
            A245 | AF       : xor  a         // stop sound
            A246 | 12       : ld   (de),a
            A247 | 13       : inc  de
            A248 | 12       : ld   (de),a
            A249 | 3C       : inc  a
            A24A | 32 08 C1 : ld   ($C108),a
            A24D | 18 B4    : jr   $A203
            -->
        </script>
        <script state="run">
            <output format="----- samurai nihon-ichi 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@C000</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mb@0141 = 20              </action>
            <action>maincpu.md@0787 = 06C14021        </action>
            <action>maincpu.mq@A200 = 0000000000000000</action>
            <action>maincpu.mq@A208 = 0000000000000000</action>
            <action>maincpu.mq@A210 = 0000000000000000</action>
            <action>maincpu.mq@A218 = 0000000000000000</action>
            <action>maincpu.mq@A220 = 0000000000000000</action>
            <action>maincpu.mq@A228 = 0000000000000000</action>
            <action>maincpu.mq@A230 = 0000000000000000</action>
            <action>maincpu.mq@A238 = 0000000000000000</action>
            <action>maincpu.mq@A240 = 0000000000000000</action>
            <action>maincpu.mq@A248 = 0000000000000000</action>
        </script>
    </cheat>

    <cheat desc="skip rom check">
        <script state="on">
            <action>maincpu.mw@0453 = 3418</action>
        </script>
        <script state="off">
            <action>maincpu.mw@0453 = 4016</action>
        </script>
    </cheat>

</mamecheat>
"sound test mode" : Rewritten routine.
Post Reply