[jongbou] Mahjong Block Jongbou

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

[jongbou] Mahjong Block Jongbou

Post by jman »

Code: Select all

<cheat desc="keep a ball">
    <script state="on">
        <action>maincpu.mq@07432 = 4eb900013640606a</action>
        <action>maincpu.mq@13640 = 0c2e00fb0113650a</action>
        <action>maincpu.mq@13648 = 3d7cfa000382462e</action>
        <action>maincpu.mq@13650 = 03864e75ffffffff</action>
        <!--
        13640 | 0c2e 00fb 0113 : cmpi.b #-$5,($113,A6)
        13646 | 650a           : bcs    $13652
        13648 | 3d7c fa00 0382 : move.w #$fa00,($382,A6)
        1364e | 462e 0386      : not.b  ($386,A6)
        13652 | 4e75           : rts
        -->
    </script>
    <script state="off">
        <action>maincpu.mq@07432 = 0c2e00fb0113656a</action>
        <action>maincpu.mq@13640 = ffffffffffffffff</action>
        <action>maincpu.mq@13648 = ffffffffffffffff</action>
        <action>maincpu.mq@13650 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="winning hand">
    <comment>catch a tile to win</comment>
    <script state="on">
        <action>maincpu.mq@00c80 = 4eb9000136604e41</action>
        <action>maincpu.mq@13660 = 43ee04c24a2e0207</action>
        <action>maincpu.mq@13668 = 670443ee04e245fa</action>
        <action>maincpu.mq@13670 = 0014700c12da51c8</action>
        <action>maincpu.mq@13678 = fffc115a00031152</action>
        <action>maincpu.mq@13680 = 02344e7531313132</action>
        <action>maincpu.mq@13688 = 3235353536363637</action>
        <action>maincpu.mq@13690 = 373706ffffffffff</action>
        <!--
        13660 | 43ee 04c2 : lea    ($4c2,A6),A1         // P1
        13664 | 4a2e 0207 : tst.b  ($207,A6)
        13668 | 6704      : beq    $1366e
        1366a | 43ee 04e2 : lea    ($4e2,A6),A1         // P2
        1366e | 45fa 0014 : lea    ($14,PC);($13684),A2
        13672 | 700c      : moveq  #$c,D0
        13674 | 12da      : move.b (A2)+,(A1)+
        13676 | 51c8 fffc : dbra   D0,$13674
        1367a | 115a 0003 : move.b (A2)+,($3,A0)
        1367e | 1152 0234 : move.b (A2),($234,A0)
        13682 | 4e75      : rts
        13684 - 13692     : tile table
        -->
    </script>
    <script state="off">
        <action>maincpu.mq@00c80 = 1d7c000602344e41</action>
        <action>maincpu.mq@13660 = ffffffffffffffff</action>
        <action>maincpu.mq@13668 = ffffffffffffffff</action>
        <action>maincpu.mq@13670 = ffffffffffffffff</action>
        <action>maincpu.mq@13678 = ffffffffffffffff</action>
        <action>maincpu.mq@13680 = ffffffffffffffff</action>
        <action>maincpu.mq@13688 = ffffffffffffffff</action>
        <action>maincpu.mq@13690 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="ball speed">
    <parameter>
        <item value="0x100">01 (slow)</item>
        <item value="0x200">02       </item>
        <item value="0x300">03       </item>
        <item value="0x400">04       </item>
        <item value="0x500">05 (fast)</item>
    </parameter>
    <script state="on">
        <action>maincpu.mq@072f2 = 4eb9000136a04e71</action> <!-- x position -->
        <action>maincpu.mq@072fe = 4eb9000136ae4e71</action> <!-- y position -->
        <action>maincpu.mq@136a0 = 302e0380323c0000</action>
        <action>maincpu.mq@136a8 = 4a6e0384600c302e</action>
        <action>maincpu.mq@136b0 = 0382323c00004a6e</action>
        <action>maincpu.mq@136b8 = 038667066a024441</action>
        <action>maincpu.mq@136c0 = d0414e75ffffffff</action>
        <!--
        136a0 | 302e 0380 : move.w ($380,A6),D0 // x position
        136a4 | 323c xxxx : move.w #$xxxx,D1
        136a8 | 4a6e 0384 : tst.w  ($384,A6)
        136ac | 600c      : bra    $136ba
        136ae | 302e 0382 : move.w ($382,A6),D0 // y position
        136b2 | 323c xxxx : move.w #$xxxx,D1
        136b6 | 4a6e 0386 : tst.w  ($386,A6)
        136ba | 6706      : beq    $136c2
        136bc | 6a02      : bpl    $136c0
        136be | 4441      : neg.w  D1
        136c0 | d041      : add.w  D1,D0
        136c2 | 4e75      : rts
        -->
    </script>
    <script state="change">
        <action>maincpu.mw@136a6 = param</action>
        <action>maincpu.mw@136b4 = param</action>
    </script>
    <script state="off">
        <action>maincpu.mq@072f2 = 302e0380d06e0384</action>
        <action>maincpu.mq@072fe = 302e0382d06e0386</action>
        <action>maincpu.mq@136a0 = ffffffffffffffff</action>
        <action>maincpu.mq@136a8 = ffffffffffffffff</action>
        <action>maincpu.mq@136b0 = ffffffffffffffff</action>
        <action>maincpu.mq@136b8 = ffffffffffffffff</action>
        <action>maincpu.mq@136c0 = 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.mq@01aa0 = 4ef9000136d043f9</action>
        <action>maincpu.mq@136d0 = 41ee010043f9000e</action>
        <action>maincpu.mq@136d8 = 000012001039000c</action>
        <action>maincpu.mq@136e0 = 0000b20067f40c00</action>
        <action>maincpu.mq@136e8 = 0010660253100c00</action>
        <action>maincpu.mq@136f0 = 0020660252100c00</action>
        <action>maincpu.mq@136f8 = 0040660212900c00</action>
        <action>maincpu.mq@13700 = 0080660412bc0010</action>
        <action>maincpu.mq@13708 = 60d0ffffffffffff</action>
        <!--
        136d0 | 41ee 0100      : lea    ($100,A6),A0 // sound code address
        136d4 | 43f9 000e 0000 : lea    $e0000.l,A1
        136da | 1200           : move.b D0,D1
        136dc | 1039 000c 0000 : move.b $c0000.l,D0  // read input
        136e2 | b200           : cmp.b  D0,D1
        136e4 | 67f4           : beq    $136da
        136e6 | 0c00 0010      : cmpi.b #$10,D0
        136ea | 6602           : bne    $136ee
        136ec | 5310           : subq.b #1,(A0)      // decrease code
        136ee | 0c00 0020      : cmpi.b #$20,D0
        136f2 | 6602           : bne    $136f6
        136f4 | 5210           : addq.b #1,(A0)      // increase code
        136f6 | 0c00 0040      : cmpi.b #$40,D0
        136fa | 6602           : bne    $136fe
        136fc | 1290           : move.b (A0),(A1)    // play sound
        136fe | 0c00 0080      : cmpi.b #-$80,D0
        13702 | 6604           : bne    $13708
        13704 | 12bc 0010      : move.b #$10,(A1)    // stop sound
        13708 | 60d0           : bra    $136da
        -->
    </script>
    <script state="run">
        <output format="----- jongbou sound test mode -----" line="10" align="center" />
        <output format="1P start : decrease code"            line="11" align="center" />
        <output format="2P start : increase code"            line="12" align="center" />
        <output format="1P button 1 : play sound"            line="13" align="center" />
        <output format="2P button 1 : 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@20100</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.mq@01aa0 = 41f90002010243f9</action>
        <action>maincpu.mq@136d0 = ffffffffffffffff</action>
        <action>maincpu.mq@136d8 = ffffffffffffffff</action>
        <action>maincpu.mq@136e0 = ffffffffffffffff</action>
        <action>maincpu.mq@136e8 = ffffffffffffffff</action>
        <action>maincpu.mq@136f0 = ffffffffffffffff</action>
        <action>maincpu.mq@136f8 = ffffffffffffffff</action>
        <action>maincpu.mq@13700 = ffffffffffffffff</action>
        <action>maincpu.mq@13708 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="skip rom check">
    <script state="on">
        <action>maincpu.md@1928 = 600000f8</action>
    </script>
    <script state="off">
        <action>maincpu.md@1928 = 41f80401</action>
    </script>
</cheat>
BTW, correct title for jongbou2 is "Jongbou sono-ni (or sono-2)" (jongbou part-2) and it doesn't have "mahjong block".
jman
Posts: 844
Joined: Tue Dec 01, 2020 1:24 pm

[jongbou] Mahjong Block Jongbou

Post by jman »

Code: Select all

<!-- Mahjong Block Jongbou (Japan) -->
<mamecheat version="1">

    <cheat desc="keep a ball">
        <script state="on">
            <action>maincpu.mq@07432 = 4EB900013640606A</action>
            <action>maincpu.mq@13640 = 0C2E00FB0113650A</action>
            <action>maincpu.mq@13648 = 3D7CFA000382462E</action>
            <action>maincpu.mq@13650 = 03864E75FFFFFFFF</action>
            <!--
            13640 | 0C2E 00FB 0113 : cmpi.b  #-$5, ($113,A6)
            13646 | 650A           : bcs     $13652
            13648 | 3D7C FA00 0382 : move.w  #$fa00, ($382,A6)
            1364E | 462E 0386      : not.b   ($386,A6)
            13652 | 4E75           : rts
            -->
        </script>
        <script state="off">
            <action>maincpu.mq@07432 = 0C2E00FB0113656A</action>
            <action>maincpu.mq@13640 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@13648 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@13650 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="winning hand">
        <comment>catch a tile to win</comment>
        <script state="on">
            <action>maincpu.mq@00C80 = 4EB9000136604E41</action>
            <action>maincpu.mq@13660 = 43EE04C24A2E0207</action>
            <action>maincpu.mq@13668 = 670443EE04E245FA</action>
            <action>maincpu.mq@13670 = 0014700C12DA51C8</action>
            <action>maincpu.mq@13678 = FFFC115A00031152</action>
            <action>maincpu.mq@13680 = 02344E7531313132</action>
            <action>maincpu.mq@13688 = 3235353536363637</action>
            <action>maincpu.mq@13690 = 373706FFFFFFFFFF</action>
            <!--
            13660 | 43EE 04C2 : lea     ($4c2,A6), A1           // P1
            13664 | 4A2E 0207 : tst.b   ($207,A6)
            13668 | 6704      : beq     $1366e
            1366A | 43EE 04E2 : lea     ($4e2,A6), A1           // P2
            1366E | 45FA 0014 : lea     ($14,PC) ; ($13684), A2
            13672 | 700C      : moveq   #$c, D0
            13674 | 12DA      : move.b  (A2)+, (A1)+
            13676 | 51C8 FFFC : dbra    D0, $13674
            1367A | 115A 0003 : move.b  (A2)+, ($3,A0)
            1367E | 1152 0234 : move.b  (A2), ($234,A0)
            13682 | 4E75      : rts
            13684 - 13692     : tile table
            -->
        </script>
        <script state="off">
            <action>maincpu.mq@00C80 = 1D7C000602344E41</action>
            <action>maincpu.mq@13660 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@13668 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@13670 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@13678 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@13680 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@13688 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@13690 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="ball speed">
        <parameter>
            <item value="0x0100">01 (slow)</item>
            <item value="0x0200">02       </item>
            <item value="0x0300">03       </item>
            <item value="0x0400">04       </item>
            <item value="0x0500">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.mq@072F2 = 4EB9000136A04E71</action> <!-- x position -->
            <action>maincpu.mq@072FE = 4EB9000136AE4E71</action> <!-- y position -->
            <action>maincpu.mq@136A0 = 302E0380323C0000</action>
            <action>maincpu.mq@136A8 = 4A6E0384600C302E</action>
            <action>maincpu.mq@136B0 = 0382323C00004A6E</action>
            <action>maincpu.mq@136B8 = 038667066A024441</action>
            <action>maincpu.mq@136C0 = D0414E75FFFFFFFF</action>
            <!--
            136A0 | 302E 0380 : move.w  ($380,A6), D0 // x position
            136A4 | 323C xxxx : move.w  #$xx, D1
            136A8 | 4A6E 0384 : tst.w   ($384,A6)
            136AC | 600C      : bra     $136ba
            136AE | 302E 0382 : move.w  ($382,A6), D0 // y position
            136B2 | 323C xxxx : move.w  #$xx, D1
            136B6 | 4A6E 0386 : tst.w   ($386,A6)
            136BA | 6706      : beq     $136c2
            136BC | 6A02      : bpl     $136c0
            136BE | 4441      : neg.w   D1
            136C0 | D041      : add.w   D1, D0
            136C2 | 4E75      : rts
            -->
        </script>
        <script state="change">
            <action>maincpu.mw@136A6 = param</action>
            <action>maincpu.mw@136B4 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mq@072F2 = 302E0380D06E0384</action>
            <action>maincpu.mq@072FE = 302E0382D06E0386</action>
            <action>maincpu.mq@136A0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@136A8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@136B0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@136B8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@136C0 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="sound test mode">
        <!-- set "dial sensitivity" as 0x30 or later if you feel it difficult to select code -->
        <comment>reset the game (F3) to enter sound test mode</comment>
        <script state="on">
            <action>maincpu.mw@01864 = 0002            </action> <!-- enable paddle check in interrupt -->
            <action>maincpu.mq@01AA0 = 4EF9000136D043F9</action>
            <action>maincpu.mq@136D0 = 41F9000E00001200</action>
            <action>maincpu.mq@136D8 = 7400102E020D6708</action>
            <action>maincpu.mq@136E0 = 6A04740260027404</action>
            <action>maincpu.mq@136E8 = 1039000C00008002</action>
            <action>maincpu.mq@136F0 = B20067E20C000002</action>
            <action>maincpu.mq@136F8 = 660253160C000004</action>
            <action>maincpu.mq@13700 = 660252160C000040</action>
            <action>maincpu.mq@13708 = 660210960C000010</action>
            <action>maincpu.mq@13710 = 660410BC001060BE</action>
            <!--
            136D0 | 41F9 000E 0000 : lea     $e0000.l, A0  // sound latch address
            136D6 | 1200           : move.b  D0, D1
            136D8 | 7400           : moveq   #$0, D2
            136DA | 102E 020D      : move.b  ($20d,A6), D0 // read paddle ($2020d)
            136DE | 6708           : beq     $136e8
            136E0 | 6A04           : bpl     $136e6
            136E2 | 7402           : moveq   #$2, D2
            136E4 | 6002           : bra     $136e8
            136E6 | 7404           : moveq   #$4, D2
            136E8 | 1039 000C 0000 : move.b  $c0000.l, D0 // read buttons
            136EE | 8002           : or.b    D2, D0
            136F0 | B200           : cmp.b   D0, D1
            136F2 | 67E2           : beq     $136d6
            136F4 | 0C00 0002      : cmpi.b  #$2, D0
            136F8 | 6602           : bne     $136fc
            136FA | 5316           : subq.b  #1, (A6)      // decrease code -01
            136FC | 0C00 0004      : cmpi.b  #$4, D0
            13700 | 6602           : bne     $13704
            13702 | 5216           : addq.b  #1, (A6)      // increase code +01
            13704 | 0C00 0040      : cmpi.b  #$40, D0
            13708 | 6602           : bne     $1370c
            1370A | 1096           : move.b  (A6), (A0)    // play sound
            1370C | 0C00 0010      : cmpi.b  #$10, D0
            13710 | 6604           : bne     $13716
            13712 | 10BC 0010      : move.b  #$10, (A0)    // stop sound
            13716 | 60BE           : bra     $136d6
            -->
        </script>
        <script state="run">
            <output format="----- jongbou sound test mode -----" line="10" align="center" />
            <output format="left : decrease code"                line="11" align="center" />
            <output format="right : increase code"               line="12" align="center" />
            <output format="button 1 : play sound"               line="13" align="center" />
            <output format="P1 start : stop sound"               line="14" align="center" />
            <output format="----------------------------"        line="15" align="center" />
            <output format="&lt;&lt; sound code %02X &gt;&gt;"   line="17" align="center"  >
                <argument>maincpu.pb@20000</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mw@01864 = FF10            </action>
            <action>maincpu.mq@01AA0 = 41F90002010243F9</action>
            <action>maincpu.mq@136D0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@136D8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@136E0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@136E8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@136F0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@136F8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@13700 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@13708 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@13710 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="skip rom check">
        <script state="on">
            <action>maincpu.md@1928 = 600000f8</action>
        </script>
        <script state="off">
            <action>maincpu.md@1928 = 41f80401</action>
        </script>
    </cheat>

</mamecheat>
"sound test mode" : Changed code selection from button to paddle. Set "dial sensitivity" as 0x30 or later if you feel it difficult to select code.
Post Reply