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 "skip rom check" 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="<< sound code %02X >>" 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 "skip rom check" 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="<< sound code %02X >>" 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 "skip rom check" 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="<< sound code %02X >>" 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.