ROM codes collection. All codes are WIP.
mjvegasa.xml
Code: Select all
<!-- Mahjong Vegas (Japan, unprotected) -->
<mamecheat version="1">
<cheat desc="winning hand">
<script state="on">
<action>maincpu.mw@786F5 = FE20 </action> <!-- ron -->
<action>maincpu.mw@78D3B = FE27 </action> <!-- tsumo -->
<action>maincpu.mq@7FE20 = 1C1EAEA21CFE2E1C</action>
<action>maincpu.mq@7FE28 = 473A1EAE1E1CFE2E</action>
<action>maincpu.mq@7FE30 = FE00103861C039FE</action>
<action>maincpu.mq@7FE38 = 26EA373664403A59</action>
<action>maincpu.mq@7FE40 = 311E26EA9226EA92</action>
<action>maincpu.mq@7FE48 = 3635353532323131</action>
<action>maincpu.mq@7FE50 = FFFFFF3737373636</action>
<!--
FE20 | 1C 2E FE : call ,$FE2E // ron
FE23 | 1C A2 AE : call ,$AEA2
FE26 | 1E : ret
FE27 | 1C 2E FE : call ,$FE2E // tsumo
FE2A | 1C 1E AE : call ,$AE1E
FE2D | 1E : ret
FE2E | 3A 47 FE : ld hl,$FE47 // tile conversion routine
FE31 | 39 C0 61 : ld de,$61C0
FE34 | 38 10 00 : ld bc,$0010
FE37 | FE 59 : ldir
FE39 | 3A 40 64 : ld hl,$6440
FE3C | 36 37 : ld a,$37
FE3E | EA 26 : ld (hl),a
FE40 | 92 : inc hl
FE41 | EA 26 : ld (hl),a
FE43 | 92 : inc hl
FE44 | EA 26 : ld (hl),a
FE46 | 1E : ret
FE47 - FE56 : tile table
-->
</script>
<script state="off">
<action>maincpu.mw@786F5 = AEA2 </action>
<action>maincpu.mw@78D3B = AE1E </action>
<action>maincpu.mq@7FE20 = FFFFFFFFFFFFFFFF</action>
<action>maincpu.mq@7FE28 = FFFFFFFFFFFFFFFF</action>
<action>maincpu.mq@7FE30 = FFFFFFFFFFFFFFFF</action>
<action>maincpu.mq@7FE38 = FFFFFFFFFFFFFFFF</action>
<action>maincpu.mq@7FE40 = FFFFFFFFFFFFFFFF</action>
<action>maincpu.mq@7FE48 = FFFFFFFFFFFFFFFF</action>
<action>maincpu.mq@7FE50 = FFFFFFFFFFFFFFFF</action>
</script>
</cheat>
<cheat desc="sound test mode">
<comment>reset the game (F3) to enter sound test mode</comment>
<script state="on">
<action>maincpu.mw@0591 = 3E90 </action>
<action>maincpu.mq@3E90 = 2E67C2E360003A03</action>
<action>maincpu.mq@3E98 = CE816FF7C62867F8</action>
<action>maincpu.mq@3EA0 = E202CE826F8FE202</action>
<action>maincpu.mq@3EA8 = C8F03604CE836F87</action>
<action>maincpu.mq@3EB0 = E2103607CE846F06</action>
<action>maincpu.mq@3EB8 = 04CE856F2026EA60</action>
<action>maincpu.mq@3EC0 = 05CE866F06C82EE2</action>
<action>maincpu.mq@3EC8 = 00C5C816F31C3036</action>
<!--
3E90 | 03 : ei // enable interrupt
3E91 | 3A 00 60 : ld hl,$6000 // sound code address
3E94 | E3 C2 67 2E : ld a,($67C2) // read input
3E98 | F8 67 : cp a,b
3E9A | 28 : ld b,a
3E9B | C6 F7 : jr z,$3E94
3E9D | 6F 81 : cp a,$81
3E9F | CE 02 : jr nz,$3EA3
3EA1 | E2 8F : dec (hl) // decrease code -01
3EA3 | 6F 82 : cp a,$82
3EA5 | CE 02 : jr nz,$3EA9
3EA7 | E2 87 : inc (hl) // increase code +01
3EA9 | 6F 83 : cp a,$83
3EAB | CE 04 : jr nz,$3EB1
3EAD | 36 F0 : ld a,$F0 // decrease code -10
3EAF | C8 06 : jr ,$3EB7
3EB1 | 6F 84 : cp a,$84
3EB3 | CE 07 : jr nz,$3EBC
3EB5 | 36 10 : ld a,$10 // increase code +10
3EB7 | E2 60 : add a,(hl)
3EB9 | EA 26 : ld (hl),a
3EBB | 20 : ld a,b
3EBC | 6F 85 : cp a,$85
3EBE | CE 04 : jr nz,$3EC4
3EC0 | E2 2E : ld a,(hl) // play sound
3EC2 | C8 06 : jr ,$3ECA
3EC4 | 6F 86 : cp a,$86
3EC6 | CE 05 : jr nz,$3ECD
3EC8 | 36 30 : ld a,$30 // stop sound
3ECA | 1C F3 16 : call ,$16F3 // send sound code
3ECD | C8 C5 : jr ,$3E94
-->
</script>
<script state="run">
<output format="----- sound test mode -----" line="10" align="center" />
<output format="A : decrease code -01" line="11" align="center" />
<output format="B : increase code +01" line="12" align="center" />
<output format="C : decrease code -10" line="13" align="center" />
<output format="D : increase code +10" line="14" align="center" />
<output format="E : play sound" line="15" align="center" />
<output format="F : stop sound" line="16" align="center" />
<output format="----------------------------" line="17" align="center" />
<output format="<< sound code %02X >>" line="19" align="center" >
<argument>maincpu.pb@6000</argument>
</output>
</script>
<script state="off">
<action>maincpu.mw@0591 = 377E </action>
<action>maincpu.mq@3E90 = 0000000000000000</action>
<action>maincpu.mq@3E98 = 0000000000000000</action>
<action>maincpu.mq@3EA0 = 0000000000000000</action>
<action>maincpu.mq@3EA8 = 0000000000000000</action>
<action>maincpu.mq@3EB0 = 0000000000000000</action>
<action>maincpu.mq@3EB8 = 0000000000000000</action>
<action>maincpu.mq@3EC0 = 0000000000000000</action>
<action>maincpu.mq@3EC8 = 0000000000000000</action>
</script>
</cheat>
</mamecheat>
mjvegas.xml
Code: Select all
<!-- Mahjong Vegas (Japan) -->
<mamecheat version="1">
<cheat desc="winning hand">
<script state="on">
<action>maincpu.mw@786F5 = FE20 </action> <!-- ron -->
<action>maincpu.mw@78D28 = FE27 </action> <!-- tsumo -->
<action>maincpu.mq@7FE20 = 1C1EAE391CFE2E1C</action>
<action>maincpu.mq@7FE28 = 473A1EADB51CFE2E</action>
<action>maincpu.mq@7FE30 = FE00103861C039FE</action>
<action>maincpu.mq@7FE38 = 26EA373664403A59</action>
<action>maincpu.mq@7FE40 = 311E26EA9226EA92</action>
<action>maincpu.mq@7FE48 = 3635353532323131</action>
<action>maincpu.mq@7FE50 = FFFFFF3737373636</action>
<!--
FE20 | 1C 2E FE : call ,$FE2E // ron
FE23 | 1C 39 AE : call ,$AE39
FE26 | 1E : ret
FE27 | 1C 2E FE : call ,$FE2E // tsumo
FE2A | 1C B5 AD : call ,$ADB5
FE2D | 1E : ret
FE2E | 3A 47 FE : ld hl,$FE47 // tile conversion routine
FE31 | 39 C0 61 : ld de,$61C0
FE34 | 38 10 00 : ld bc,$0010
FE37 | FE 59 : ldir
FE39 | 3A 40 64 : ld hl,$6440
FE3C | 36 37 : ld a,$37
FE3E | EA 26 : ld (hl),a
FE40 | 92 : inc hl
FE41 | EA 26 : ld (hl),a
FE43 | 92 : inc hl
FE44 | EA 26 : ld (hl),a
FE46 | 1E : ret
FE47 - FE56 : tile table
-->
</script>
<script state="off">
<action>maincpu.mw@786F5 = AE39 </action>
<action>maincpu.mw@78D28 = ADB5 </action>
<action>maincpu.mq@7FE20 = FFFFFFFFFFFFFFFF</action>
<action>maincpu.mq@7FE28 = FFFFFFFFFFFFFFFF</action>
<action>maincpu.mq@7FE30 = FFFFFFFFFFFFFFFF</action>
<action>maincpu.mq@7FE38 = FFFFFFFFFFFFFFFF</action>
<action>maincpu.mq@7FE40 = FFFFFFFFFFFFFFFF</action>
<action>maincpu.mq@7FE48 = FFFFFFFFFFFFFFFF</action>
<action>maincpu.mq@7FE50 = FFFFFFFFFFFFFFFF</action>
</script>
</cheat>
<cheat desc="sound test mode">
<comment>reset the game (F3) to enter sound test mode</comment>
<script state="on">
<action>maincpu.mw@023B5 = FE60 </action>
<action>maincpu.mq@7FE60 = 2E67C2E360003A03</action>
<action>maincpu.mq@7FE68 = CE816FF7C62867F8</action>
<action>maincpu.mq@7FE70 = E202CE826F8FE202</action>
<action>maincpu.mq@7FE78 = C8F03604CE836F87</action>
<action>maincpu.mq@7FE80 = E2103607CE846F06</action>
<action>maincpu.mq@7FE88 = 04CE856F2026EA60</action>
<action>maincpu.mq@7FE90 = 05CE866F06C82EE2</action>
<action>maincpu.mq@7FE98 = FFC5C834F01C3036</action>
<!--
FE60 | 03 : ei // enable interrupt
FE61 | 3A 00 60 : ld hl,$6000 // sound code address
FE64 | E3 C2 67 2E : ld a,($67C2) // read input
FE68 | F8 67 : cp a,b
FE6A | 28 : ld b,a
FE6B | C6 F7 : jr z,$3E94
FE6D | 6F 81 : cp a,$81
FE6F | CE 02 : jr nz,$3EA3
FE71 | E2 8F : dec (hl) // decrease code -01
FE73 | 6F 82 : cp a,$82
FE75 | CE 02 : jr nz,$3EA9
FE77 | E2 87 : inc (hl) // increase code +01
FE79 | 6F 83 : cp a,$83
FE7B | CE 04 : jr nz,$3EB1
FE7D | 36 F0 : ld a,$F0 // decrease code -10
FE7F | C8 06 : jr ,$3EB7
FE81 | 6F 84 : cp a,$84
FE83 | CE 07 : jr nz,$3EBC
FE85 | 36 10 : ld a,$10 // increase code +10
FE87 | E2 60 : add a,(hl)
FE89 | EA 26 : ld (hl),a
FE8B | 20 : ld a,b
FE8C | 6F 85 : cp a,$85
FE8E | CE 04 : jr nz,$3EC4
FE90 | E2 2E : ld a,(hl) // play sound
FE92 | C8 06 : jr ,$3ECA
FE94 | 6F 86 : cp a,$86
FE96 | CE 05 : jr nz,$3ECD
FE98 | 36 30 : ld a,$30 // stop sound
FE9A | 1C F0 34 : call ,$34F0 // send sound code
FE9D | C8 C5 : jr ,$3E94
-->
</script>
<script state="run">
<output format="----- sound test mode -----" line="10" align="center" />
<output format="A : decrease code -01" line="11" align="center" />
<output format="B : increase code +01" line="12" align="center" />
<output format="C : decrease code -10" line="13" align="center" />
<output format="D : increase code +10" line="14" align="center" />
<output format="E : play sound" line="15" align="center" />
<output format="F : stop sound" line="16" align="center" />
<output format="----------------------------" line="17" align="center" />
<output format="<< sound code %02X >>" line="19" align="center" >
<argument>maincpu.pb@6000</argument>
</output>
</script>
<script state="off">
<action>maincpu.mw@023B5 = 46DE </action>
<action>maincpu.mq@7FE60 = FFFFFFFFFFFFFFFF</action>
<action>maincpu.mq@7FE68 = FFFFFFFFFFFFFFFF</action>
<action>maincpu.mq@7FE70 = FFFFFFFFFFFFFFFF</action>
<action>maincpu.mq@7FE78 = FFFFFFFFFFFFFFFF</action>
<action>maincpu.mq@7FE80 = FFFFFFFFFFFFFFFF</action>
<action>maincpu.mq@7FE88 = FFFFFFFFFFFFFFFF</action>
<action>maincpu.mq@7FE90 = FFFFFFFFFFFFFFFF</action>
<action>maincpu.mq@7FE98 = FFFFFFFFFFFFFFFF</action>
</script>
</cheat>
</mamecheat>
"winning hand" : This code works even in opponent turn. So "ron" is available.