[vsmjtria] VS Mahjong Triangle

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

[vsmjtria] VS Mahjong Triangle

Post by jman »

Code: Select all

<cheat desc="P1 winning hand">
    <script state="on">
        <action>cpu0.md@34a1 =         cb9eb0cd</action> <!-- ron -->
        <action>cpu0.md@38bf =         cb9eb0cd</action> <!-- tsumo -->
        <action>cpu0.mq@9eb0 = 0e01a070119ebc21</action>
        <action>cpu0.mq@9eb8 = 32313131c9b0ed00</action>
        <action>cpu0.mq@9ec0 = 3736363635353532</action>
        <action>cpu0.mq@9ec8 = ffffffffffff3737</action>
        <!--
        9eb0 | 21 bc 9e : ld   hl,$9ebc
        9eb3 | 11 70 a0 : ld   de,$a070
        9eb6 | 01 0e 00 : ld   bc,$000e
        9eb9 | ed b0    : ldir
        9ebb | c9       : ret
        9ebc - 9ec9     : tile table
        -->
    </script>
    <script state="off">
        <action>cpu0.md@34a1 =         cba35e3a</action>
        <action>cpu0.md@38bf =         cba35e3a</action>
        <action>cpu0.mq@9eb0 = ffffffffffffffff</action>
        <action>cpu0.mq@9eb8 = ffffffffffffffff</action>
        <action>cpu0.mq@9ec0 = ffffffffffffffff</action>
        <action>cpu0.mq@9ec8 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="P2 winning hand">
    <script state="on">
        <action>cpu1.md@34a1 =         cb9eb0cd</action> <!-- ron -->
        <action>cpu1.md@38bf =         cb9eb0cd</action> <!-- tsumo -->
        <action>cpu1.mq@9eb0 = 0e01a070119ebc21</action>
        <action>cpu1.mq@9eb8 = 32313131c9b0ed00</action>
        <action>cpu1.mq@9ec0 = 3736363635353532</action>
        <action>cpu1.mq@9ec8 = ffffffffffff3737</action>
        <!--
        9eb0 | 21 bc 9e : ld   hl,$9ebc
        9eb3 | 11 70 a0 : ld   de,$a070
        9eb6 | 01 0e 00 : ld   bc,$000e
        9eb9 | ed b0    : ldir
        9ebb | c9       : ret
        9ebc - 9ec9     : tile table
        -->
    </script>
    <script state="off">
        <action>cpu1.md@34a1 =         cba35e3a</action>
        <action>cpu1.md@38bf =         cba35e3a</action>
        <action>cpu1.mq@9eb0 = ffffffffffffffff</action>
        <action>cpu1.mq@9eb8 = ffffffffffffffff</action>
        <action>cpu1.mq@9ec0 = ffffffffffffffff</action>
        <action>cpu1.mq@9ec8 = ffffffffffffffff</action>
    </script>
</cheat>
Unfortunately, game is reset at mahjong result screen after pressed RON key.

Other addresses are...
  • a278 : credit
  • a338 : thinking time (2-bytes)
  • a062 - a06f : opponent tiles
  • a070 - a07d : player tiles
Last edited by jman on Fri Oct 29, 2021 2:04 pm, edited 1 time in total.
jman
Posts: 843
Joined: Tue Dec 01, 2020 1:24 pm

Re: [vsmjtria] VS Mahjong Triangle

Post by jman »

Reset problem occurs in the following routine.

Code: Select all

2B90  ld   hl,$A15E
2B93  ld   a,(hl)
2B94  cp   $FF
2B96  jp   z,$2C2C  // always false so don't go to $2c2c
2B99  push hl
2B9A  cp   $98
2B9C  ld   c,$00
2B9E  jr   nz,$2BA1
2BA0  inc  c
2BA1  cp   $80
2BA3  jr   c,$2BA7
2BA5  sub  $61
2BA7  jp   $DDAD    // jump to illegal(?) address
Address $ddad - $ffff is all "0xFF" so that program counter reaches to $0000 and restart the game.
The following codes will avoid resetting but gfx is not fixed (eg mahjong result screen).

Code: Select all

<cheat desc="P1 avoid reset problem">
    <script state="on">
        <action>cpu0.mb@2b96 = c3</action>
    </script>
    <script state="off">
        <action>cpu0.mb@2b96 = ca</action>
    </script>
</cheat>

<cheat desc="P2 avoid reset problem">
    <script state="on">
        <action>cpu1.mb@2b96 = c3</action>
    </script>
    <script state="off">
        <action>cpu1.mb@2b96 = ca</action>
    </script>
</cheat>
Post Reply