Page 1 of 1

[jongbou2] Jongbou sono-ni

Posted: Thu Jan 06, 2022 9:56 am
by jman
jongbou2 is added on 0.240.
Image

Code: Select all

<cheat desc="P1 keep a ball">
    <script state="on">
        <action>maincpu.mq@02afa = 4eb90001a000655c</action>
        <action>maincpu.mq@1a000 = 0c2e00fa0117650a</action>
        <action>maincpu.mq@1a008 = 3d7cf9000256442e</action>
        <action>maincpu.mq@1a010 = 02524e75ffffffff</action>
        <!--
        1a000 | 0c2e 00fa 0117 : cmpi.b #-$6,($117,A6)
        1a006 | 650a           : bcs    $1a012
        1a008 | 3d7c f900 0256 : move.w #$f900,($256,A6)
        1a00e | 442e 0252      : neg.b  ($252,A6)
        1a012 | 4e75           : rts
        -->
    </script>
    <script state="off">
        <action>maincpu.mq@02afa = 0c2e00fa0117655c</action>
        <action>maincpu.mq@1a000 = ffffffffffffffff</action>
        <action>maincpu.mq@1a008 = ffffffffffffffff</action>
        <action>maincpu.mq@1a010 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="P1 winning hand">
    <script state="run">
        <action>maincpu.pq@202c2 = 3131313232353535</action>
        <action>maincpu.pd@202ca =         36363637</action>
        <action>maincpu.pb@202ce =               37</action>
        <action>maincpu.pb@20303 =               37</action>
    </script>
</cheat>

<cheat desc="skip rom check">
    <script state="on">
        <action>maincpu.mw@0640 = 604c</action>
    </script>
    <script state="off">
        <action>maincpu.mw@0640 = 41f8</action>
    </script>
</cheat>
"winning hand" works after you catch a tile but sometimes doesn't work and tile gfx doesn't change immediately.

[jongbou2] update

Posted: Thu Jan 06, 2022 3:29 pm
by jman
Converted "winning hand" RAM code to ROM. Random not-working problem will be fixed.

Code: Select all

<cheat desc="P1 winning hand">
    <comment>catch a tile to win</comment>
    <script state="on">
        <action>maincpu.mq@0694a = 4eb90001a0704e41</action>
        <action>maincpu.mq@1a070 = 43ee02c245fa0018</action>
        <action>maincpu.mq@1a078 = 700c12da51c8fffc</action>
        <action>maincpu.mq@1a080 = 117c003700031d7c</action>
        <action>maincpu.mq@1a088 = 000602074e753131</action>
        <action>maincpu.mq@1a090 = 3132323535353636</action>
        <action>maincpu.mq@1a098 = 363737ffffffffff</action>
        <!--
        1a070 | 43ee 02c2      : lea    ($2c2,A6),A1
        1a074 | 45fa 0018      : lea    ($18,PC);($1a08e),A2
        1a078 | 700c           : moveq  #$c,D0
        1a07a | 12da           : move.b (A2)+,(A1)+
        1a07c | 51c8 fffc      : dbra   D0,$1a07a
        1a080 | 117c 0037 0003 : move.b #$37,($3,A0)
        1a086 | 1d7c 0006 0207 : move.b #$6,($207,A6)
        1a08c | 4e75           : rts
        1a08e - 1a09a          : tile table
        -->
    </script>
    <script state="off">
        <action>maincpu.mq@0694a = 1d7c000602074e41</action>
        <action>maincpu.mq@1a070 = ffffffffffffffff</action>
        <action>maincpu.mq@1a078 = ffffffffffffffff</action>
        <action>maincpu.mq@1a080 = ffffffffffffffff</action>
        <action>maincpu.mq@1a088 = ffffffffffffffff</action>
        <action>maincpu.mq@1a090 = ffffffffffffffff</action>
        <action>maincpu.mq@1a098 = ffffffffffffffff</action>
    </script>
</cheat>
Also player 2 code for "keep a ball" and "winning hand".

Code: Select all

<cheat desc="P2 keep a ball">
    <script state="on">
        <action>maincpu.mq@02a88 = 4eb90001a020646a</action>
        <action>maincpu.mq@1a020 = 0c2e00060117640c</action>
        <action>maincpu.mq@1a028 = 3d7c07000256442e</action>
        <action>maincpu.mq@1a030 = 025270004e75ffff</action>
        <!--
        1a020 | 0c2e 0006 0117 : cmpi.b #$6,($117,A6)
        1a026 | 640a           : bcc    $1a034
        1a028 | 3d7c f900 0256 : move.w #$f900,($256,A6)
        1a02e | 442e 0252      : neg.b  ($252,A6)
        1a032 | 7000           : moveq  #$0,D0
        1a034 | 4e75           : rts
        -->
    </script>
    <script state="off">
        <action>maincpu.mq@02a88 = 0c2e00060117646a</action>
        <action>maincpu.mq@1a020 = ffffffffffffffff</action>
        <action>maincpu.mq@1a028 = ffffffffffffffff</action>
        <action>maincpu.mq@1a030 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="P2 winning hand">
    <comment>catch a tile to win</comment>
    <script state="on">
        <action>maincpu.mq@06cba = 4eb90001a0a04e41</action>
        <action>maincpu.mq@1a0a0 = 43ee02e245fa0018</action>
        <action>maincpu.mq@1a0a8 = 700c12da51c8fffc</action>
        <action>maincpu.mq@1a0b0 = 117c003700031d7c</action>
        <action>maincpu.mq@1a0b8 = 000602074e753131</action>
        <action>maincpu.mq@1a0c0 = 3132323535353636</action>
        <action>maincpu.mq@1a0c8 = 363737ffffffffff</action>
        <!--
        1a0a0 | 43ee 02e2      : lea    ($2e2,A6),A1
        1a0a4 | 45fa 0018      : lea    ($18,PC);($1a0be),A2
        1a0a8 | 700c           : moveq  #$c,D0
        1a0aa | 12da           : move.b (A2)+,(A1)+
        1a0ac | 51c8 fffc      : dbra   D0,$1a0aa
        1a0b0 | 117c 0037 0003 : move.b #$37,($3,A0)
        1a0b6 | 1d7c 0006 0207 : move.b #$6,($207,A6)
        1a0bc | 4e75           : rts
        1a0be - 1a0ca          : tile table
        -->
    </script>
    <script state="off">
        <action>maincpu.mq@06cba = 1d7c000602074e41</action>
        <action>maincpu.mq@1a0a0 = ffffffffffffffff</action>
        <action>maincpu.mq@1a0a8 = ffffffffffffffff</action>
        <action>maincpu.mq@1a0b0 = ffffffffffffffff</action>
        <action>maincpu.mq@1a0b8 = ffffffffffffffff</action>
        <action>maincpu.mq@1a0c0 = ffffffffffffffff</action>
        <action>maincpu.mq@1a0c8 = ffffffffffffffff</action>
    </script>
</cheat>
And "ball speed" code.

Code: Select all

<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@029d6 = 4eb90001a0404e71</action> <!-- x position -->
        <action>maincpu.mq@029e2 = 4eb90001a0564e71</action> <!-- y position -->
        <action>maincpu.mq@1a040 = 302e0254323c0000</action>
        <action>maincpu.mq@1a048 = 4a6e025067066a02</action>
        <action>maincpu.mq@1a050 = 4441d0414e75302e</action>
        <action>maincpu.mq@1a058 = 0256323c00004a6e</action>
        <action>maincpu.mq@1a060 = 025267066a024441</action>
        <action>maincpu.mq@1a068 = d0414e75ffffffff</action>
        <!--
        1a040 | 302e 0254 : move.w ($254,A6),D0 // x position
        1a044 | 323c xxxx : move.w #$xxxx,D1
        1a048 | 4a6e 0250 : tst.w  ($250,A6)
        1a04c | 6706      : beq    $1a054
        1a04e | 6a02      : bpl    $1a052
        1a050 | 4441      : neg.w  D1
        1a052 | d041      : add.w  D1,D0
        1a054 | 4e75      : rts
        1a056 | 302e 0256 : move.w ($256,A6),D0 // y position
        1a05a | 323c xxxx : move.w #$xxxx,D1
        1a05e | 4a6e 0252 : tst.w  ($252,A6)
        1a062 | 6706      : beq    $1a06a
        1a064 | 6a02      : bpl    $1a068
        1a066 | 4441      : neg.w  D1
        1a068 | d041      : add.w  D1,D0
        1a06a | 4e75      : rts
        -->
    </script>
    <script state="change">
        <action>maincpu.mw@1a046 = param</action>
        <action>maincpu.mw@1a05c = param</action>
    </script>
    <script state="off">
        <action>maincpu.mq@029d6 = 4eb90001a0404e71</action>
        <action>maincpu.mq@029e2 = 4eb90001a0564e71</action>
        <action>maincpu.mq@1a040 = ffffffffffffffff</action>
        <action>maincpu.mq@1a048 = ffffffffffffffff</action>
        <action>maincpu.mq@1a050 = ffffffffffffffff</action>
        <action>maincpu.mq@1a058 = ffffffffffffffff</action>
        <action>maincpu.mq@1a060 = ffffffffffffffff</action>
        <action>maincpu.mq@1a068 = ffffffffffffffff</action>
    </script>
</cheat>
Other basic addresses are...
  • $20202 : credit
  • $20205 : P1 life
  • $20206 : P2 life
  • $202c2 : P1 tiles (13-bytes)
  • $202e2 : P2 tiles (13-bytes)
  • $20284 : P1 score (4-bytes)
  • $20288 : P2 score (4-bytes)
  • $20254 : ball x position (2-bytes)
  • $20256 : ball y position (2-bytes)

[jongbou2] sound test mode

Posted: Sun Jan 09, 2022 1:25 pm
by jman
Added "sound test mode".

Code: Select all

<cheat desc="sound test mode">
    <comment>reset the game (F3) to enter sound test mode</comment>
    <script state="on">
        <action>maincpu.mq@00706 = 4ef90001a0d043f9</action>
        <action>maincpu.mq@1a0d0 = 41ee010012001039</action>
        <action>maincpu.mq@1a0d8 = 000c0000b20067f4</action>
        <action>maincpu.mq@1a0e0 = 0c00001066025310</action>
        <action>maincpu.mq@1a0e8 = 0c00002066025210</action>
        <action>maincpu.mq@1a0f0 = 0c00004066041410</action>
        <action>maincpu.mq@1a0f8 = 600a0c000080660a</action>
        <action>maincpu.mq@1a100 = 143c001013c2000e</action>
        <action>maincpu.mq@1a108 = 000060c8ffffffff</action>
        <!--
        1a0d0 | 41ee 0100      : lea    ($100,A6),A0 // sound code address
        1a0d4 | 1200           : move.b D0,D1
        1a0d6 | 1039 000c 0000 : move.b $c0000.l,D0  // read input
        1a0dc | b200           : cmp.b  D0,D1
        1a0de | 67f4           : beq    $1a0d4
        1a0e0 | 0c00 0010      : cmpi.b #$10,D0
        1a0e4 | 6602           : bne    $1a0e8
        1a0e6 | 5310           : subq.b #1,(A0)      // decrease code
        1a0e8 | 0c00 0020      : cmpi.b #$20,D0
        1a0ec | 6602           : bne    $1a0f0
        1a0ee | 5210           : addq.b #1,(A0)      // increase code
        1a0f0 | 0c00 0040      : cmpi.b #$40,D0
        1a0f4 | 6604           : bne    $1a0fa
        1a0f6 | 1410           : move.b (A0),D2      // play sound
        1a0f8 | 600a           : bra    $1a104
        1a0fa | 0c00 0080      : cmpi.b #-$80,D0
        1a0fe | 660a           : bne    $1a10a
        1a100 | 143c 0010      : move.b #$10,D2      // stop sound
        1a104 | 13c2 000e 0000 : move.b D2,$e0000.l  // send sound code
        1a10a | 60c8           : bra    $1a0d4
        -->
    </script>
    <script state="run">
        <output format="----- jongbou 2 sound test mode -----" line="10" align="center" />
        <output format="P1 start : decrease code"              line="11" align="center" />
        <output format="P2 start : increase code"              line="12" align="center" />
        <output format="P1 button 1 : play sound"              line="13" align="center" />
        <output format="P2 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@00706 = 41f90002010243f9</action>
        <action>maincpu.mq@1a0d0 = ffffffffffffffff</action>
        <action>maincpu.mq@1a0d8 = ffffffffffffffff</action>
        <action>maincpu.mq@1a0e0 = ffffffffffffffff</action>
        <action>maincpu.mq@1a0e8 = ffffffffffffffff</action>
        <action>maincpu.mq@1a0f0 = ffffffffffffffff</action>
        <action>maincpu.mq@1a0f8 = ffffffffffffffff</action>
        <action>maincpu.mq@1a100 = ffffffffffffffff</action>
        <action>maincpu.mq@1a108 = ffffffffffffffff</action>
    </script>
</cheat>

[jongbou2] update

Posted: Mon Jan 31, 2022 10:03 am
by jman
code clean up.

Code: Select all

<cheat desc="P1 keep a ball">
    <script state="on">
        <action>maincpu.mq@02afa = 4eb90001a000605c</action>
        <action>maincpu.mq@1a000 = 0c2e00fa0117650a</action>
        <action>maincpu.mq@1a008 = 3d7cf9000256462e</action>
        <action>maincpu.mq@1a010 = 02524e75ffffffff</action>
        <!--
        1a000 | 0c2e 00fa 0117 : cmpi.b #-$6,($117,A6)
        1a006 | 650a           : bcs    $1a012
        1a008 | 3d7c f900 0256 : move.w #$f900,($256,A6)
        1a00e | 462e 0252      : not.b  ($252,A6)
        1a012 | 4e75           : rts
        -->
    </script>
    <script state="off">
        <action>maincpu.mq@02afa = 0c2e00fa0117655c</action>
        <action>maincpu.mq@1a000 = ffffffffffffffff</action>
        <action>maincpu.mq@1a008 = ffffffffffffffff</action>
        <action>maincpu.mq@1a010 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="P2 keep a ball">
    <script state="on">
        <action>maincpu.mq@02a88 = 4eb90001a020606a</action>
        <action>maincpu.mq@1a020 = 0c2e00060117640a</action>
        <action>maincpu.mq@1a028 = 3d7c07000256462e</action>
        <action>maincpu.mq@1a030 = 02524e75ffffffff</action>
        <!--
        1a020 | 0c2e 0006 0117 : cmpi.b #$6,($117,A6)
        1a026 | 640a           : bcc    $1a032
        1a028 | 3d7c 0700 0256 : move.w #$700,($256,A6)
        1a02e | 462e 0252      : not.b  ($252,A6)
        1a032 | 4e75           : rts
        -->
    </script>
    <script state="off">
        <action>maincpu.mq@02a88 = 0c2e00060117646a</action>
        <action>maincpu.mq@1a020 = ffffffffffffffff</action>
        <action>maincpu.mq@1a028 = ffffffffffffffff</action>
        <action>maincpu.mq@1a030 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="P1 winning hand">
    <comment>catch a tile to win</comment>
    <script state="on">
        <action>maincpu.mq@0694a = 4eb90001a0704e41</action>
        <action>maincpu.mq@1a070 = 43ee02c245fa0014</action>
        <action>maincpu.mq@1a078 = 700c12da51c8fffc</action>
        <action>maincpu.mq@1a080 = 115a000311520207</action>
        <action>maincpu.mq@1a088 = 4e75313131323235</action>
        <action>maincpu.mq@1a090 = 3535363636373737</action>
        <action>maincpu.mq@1a098 = 06ffffffffffffff</action>
        <!--
        1a070 | 43ee 04c2 : lea    ($2c2,A6),A1
        1a074 | 45fa 0014 : lea    ($14,PC);($1a08a),A2
        1a078 | 700c      : moveq  #$c,D0
        1a07a | 12da      : move.b (A2)+,(A1)+
        1a07c | 51c8 fffc : dbra   D0,$1a07a
        1a080 | 115a 0003 : move.b (A2)+,($3,A0)
        1a084 | 1152 0234 : move.b (A2),($207,A0)
        1a088 | 4e75      : rts
        1a08a - 1a098     : tile table
        -->
    </script>
    <script state="off">
        <action>maincpu.mq@0694a = 1d7c000602074e41</action>
        <action>maincpu.mq@1a070 = ffffffffffffffff</action>
        <action>maincpu.mq@1a078 = ffffffffffffffff</action>
        <action>maincpu.mq@1a080 = ffffffffffffffff</action>
        <action>maincpu.mq@1a088 = ffffffffffffffff</action>
        <action>maincpu.mq@1a090 = ffffffffffffffff</action>
        <action>maincpu.mq@1a098 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="P2 winning hand">
    <comment>catch a tile to win</comment>
    <script state="on">
        <action>maincpu.mq@06cba = 4eb90001a0a04e41</action>
        <action>maincpu.mq@1a0a0 = 43ee02e245fa0014</action>
        <action>maincpu.mq@1a0a8 = 700c12da51c8fffc</action>
        <action>maincpu.mq@1a0b0 = 115a000311520207</action>
        <action>maincpu.mq@1a0b8 = 4e75313131323235</action>
        <action>maincpu.mq@1a0c0 = 3535363636373737</action>
        <action>maincpu.mq@1a0c8 = 06ffffffffffffff</action>
        <!--
        1a0a0 | 43ee 02e2 : lea    ($2e2,A6),A1
        1a0a4 | 45fa 0014 : lea    ($14,PC);($1a0ba),A2
        1a0a8 | 700c      : moveq  #$c,D0
        1a0aa | 12da      : move.b (A2)+,(A1)+
        1a0ac | 51c8 fffc : dbra   D0,$1a0aa
        1a0b0 | 115a 0003 : move.b (A2)+,($3,A0)
        1a0b4 | 1152 0207 : move.b (A2),($207,A0)
        1a0b8 | 4e75      : rts
        1a0ba - 1a0c8     : tile table
        -->
    </script>
    <script state="off">
        <action>maincpu.mq@06cba = 1d7c000602074e41</action>
        <action>maincpu.mq@1a0a0 = ffffffffffffffff</action>
        <action>maincpu.mq@1a0a8 = ffffffffffffffff</action>
        <action>maincpu.mq@1a0b0 = ffffffffffffffff</action>
        <action>maincpu.mq@1a0b8 = ffffffffffffffff</action>
        <action>maincpu.mq@1a0c0 = ffffffffffffffff</action>
        <action>maincpu.mq@1a0c8 = 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@029d6 = 4eb90001a0404e71</action> <!-- x position -->
        <action>maincpu.mq@029e2 = 4eb90001a04e4e71</action> <!-- y position -->
        <action>maincpu.mq@1a040 = 302e0254323c0000</action>
        <action>maincpu.mq@1a048 = 4a6e0250600c302e</action>
        <action>maincpu.mq@1a050 = 0256323c00004a6e</action>
        <action>maincpu.mq@1a058 = 025267066a024441</action>
        <action>maincpu.mq@1a060 = d0414e75ffffffff</action>
        <!--
        1a040 | 302e 0254 : move.w ($254,A6),D0 // x position
        1a044 | 323c xxxx : move.w #$xxxx,D1
        1a048 | 4a6e 0250 : tst.w  ($250,A6)
        1a04c | 600c      : bra    $1a05a
        1a04e | 302e 0256 : move.w ($256,A6),D0 // y position
        1a052 | 323c xxxx : move.w #$xxxx,D1
        1a056 | 4a6e 0252 : tst.w  ($252,A6)
        1a05a | 6706      : beq    $1a062
        1a05c | 6a02      : bpl    $1a060
        1a05e | 4441      : neg.w  D1
        1a060 | d041      : add.w  D1,D0
        1a062 | 4e75      : rts
       -->
    </script>
    <script state="change">
        <action>maincpu.mw@1a046 = param</action>
        <action>maincpu.mw@1a054 = param</action>
    </script>
    <script state="off">
        <action>maincpu.mq@029d6 = 4eb90001a0404e71</action>
        <action>maincpu.mq@029e2 = 4eb90001a0564e71</action>
        <action>maincpu.mq@1a040 = ffffffffffffffff</action>
        <action>maincpu.mq@1a048 = ffffffffffffffff</action>
        <action>maincpu.mq@1a050 = ffffffffffffffff</action>
        <action>maincpu.mq@1a058 = ffffffffffffffff</action>
        <action>maincpu.mq@1a060 = 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@00706 = 4ef90001a0d043f9</action>
        <action>maincpu.mq@1a0d0 = 41ee010043f9000e</action>
        <action>maincpu.mq@1a0d8 = 000012001039000c</action>
        <action>maincpu.mq@1a0e0 = 0000b20067f40c00</action>
        <action>maincpu.mq@1a0e8 = 0010660253100c00</action>
        <action>maincpu.mq@1a0f0 = 0020660252100c00</action>
        <action>maincpu.mq@1a0f8 = 0040660212900c00</action>
        <action>maincpu.mq@1a100 = 0080660412bc0010</action>
        <action>maincpu.mq@1a108 = 60d0ffffffffffff</action>
        <!--
        1a0d0 | 41ee 0100      : lea    ($100,A6),A0 // sound code address
        1a0d4 | 43f9 000e 0000 : lea    $e0000.l,A1
        1a0da | 1200           : move.b D0,D1
        1a0dc | 1039 000c 0000 : move.b $c0000.l,D0  // read input
        1a0e2 | b200           : cmp.b  D0,D1
        1a0e4 | 67f4           : beq    $1a0da
        1a0e6 | 0c00 0010      : cmpi.b #$10,D0
        1a0ea | 6602           : bne    $1a0ee
        1a0ec | 5310           : subq.b #1,(A0)      // decrease code
        1a0ee | 0c00 0020      : cmpi.b #$20,D0
        1a0f2 | 6602           : bne    $1a0f6
        1a0f4 | 5210           : addq.b #1,(A0)      // increase code
        1a0f6 | 0c00 0040      : cmpi.b #$40,D0
        1a0fa | 6602           : bne    $1a0fe
        1a0fc | 1290           : move.b (A0),(A1)    // play sound
        1a0fe | 0c00 0080      : cmpi.b #-$80,D0
        1a102 | 6604           : bne    $1a108
        1a104 | 12bc 0010      : move.b #$10,(A1)    // stop sound
        1a108 | 60d0           : bra    $1a0da
        -->
    </script>
    <script state="run">
        <output format="----- jongbou 2 sound test mode -----" line="10" align="center" />
        <output format="P1 start : decrease code"              line="11" align="center" />
        <output format="P2 start : increase code"              line="12" align="center" />
        <output format="P1 button 1 : play sound"              line="13" align="center" />
        <output format="P2 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@00706 = 41f90002010243f9</action>
        <action>maincpu.mq@1a0d0 = ffffffffffffffff</action>
        <action>maincpu.mq@1a0d8 = ffffffffffffffff</action>
        <action>maincpu.mq@1a0e0 = ffffffffffffffff</action>
        <action>maincpu.mq@1a0e8 = ffffffffffffffff</action>
        <action>maincpu.mq@1a0f0 = ffffffffffffffff</action>
        <action>maincpu.mq@1a0f8 = ffffffffffffffff</action>
        <action>maincpu.mq@1a100 = ffffffffffffffff</action>
        <action>maincpu.mq@1a108 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="skip rom check">
    <script state="on">
        <action>maincpu.mw@0640 = 604c</action>
    </script>
    <script state="off">
        <action>maincpu.mw@0640 = 41f8</action>
    </script>
</cheat>

[jongbou2] Jongbou sono-ni

Posted: Sat Dec 23, 2023 9:01 am
by jman

Code: Select all

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

    <cheat desc="P1 keep a ball">
        <script state="on">
            <action>maincpu.mq@02AFA = 4EB90001A000605C</action>
            <action>maincpu.mq@1A000 = 0C2E00FA0117650A</action>
            <action>maincpu.mq@1A008 = 3D7CF9000256462E</action>
            <action>maincpu.mq@1A010 = 02524E75FFFFFFFF</action>
            <!--
            1A000 | 0C2E 00FA 0117 : cmpi.b  #-$6, ($117,A6)
            1A006 | 650A           : bcs     $1a012
            1A008 | 3D7C F900 0256 : move.w  #$f900, ($256,A6)
            1A00E | 462E 0252      : not.b   ($252,A6)
            1A012 | 4E75           : rts
            -->
        </script>
        <script state="off">
            <action>maincpu.mq@02AFA = 0C2E00FA0117655C</action>
            <action>maincpu.mq@1A000 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A008 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A010 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="P2 keep a ball">
        <script state="on">
            <action>maincpu.mq@02A88 = 4EB90001A020606A</action>
            <action>maincpu.mq@1A020 = 0C2E00060117640A</action>
            <action>maincpu.mq@1A028 = 3D7C07000256462E</action>
            <action>maincpu.mq@1A030 = 02524E75FFFFFFFF</action>
            <!--
            1A020 | 0C2E 0006 0117 : cmpi.b  #$6, ($117,A6)
            1A026 | 640A           : bcc     $1a032
            1A028 | 3D7C 0700 0256 : move.w  #$700, ($256,A6)
            1A02E | 462E 0252      : not.b   ($252,A6)
            1A032 | 4E75           : rts
            -->
        </script>
        <script state="off">
            <action>maincpu.mq@02A88 = 0C2E00060117646A</action>
            <action>maincpu.mq@1A020 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A028 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A030 = 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@029D6 = 4EB90001A0404E71</action> <!-- x position -->
            <action>maincpu.mq@029E2 = 4EB90001A04E4E71</action> <!-- y position -->
            <action>maincpu.mq@1A040 = 302E0254323C0000</action>
            <action>maincpu.mq@1A048 = 4A6E0250600C302E</action>
            <action>maincpu.mq@1A050 = 0256323C00004A6E</action>
            <action>maincpu.mq@1A058 = 025267066A024441</action>
            <action>maincpu.mq@1A060 = D0414E75FFFFFFFF</action>
            <!--
            1A040 | 302E 0254 : move.w  ($254,A6), D0 // x position
            1A044 | 323C xxxx : move.w  #$xx, D1
            1A048 | 4A6E 0250 : tst.w   ($250,A6)
            1A04C | 600C      : bra     $1a05a
            1A04E | 302E 0256 : move.w  ($256,A6), D0 // y position
            1A052 | 323C xxxx : move.w  #$xx, D1
            1A056 | 4A6E 0252 : tst.w   ($252,A6)
            1A05A | 6706      : beq     $1a062
            1A05C | 6A02      : bpl     $1a060
            1A05E | 4441      : neg.w   D1
            1A060 | D041      : add.w   D1, D0
            1A062 | 4E75      : rts
           -->
        </script>
        <script state="change">
            <action>maincpu.mw@1A046 = param</action>
            <action>maincpu.mw@1A054 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mq@029D6 = 4EB90001A0404E71</action>
            <action>maincpu.mq@029E2 = 4EB90001A0564E71</action>
            <action>maincpu.mq@1A040 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A048 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A050 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A058 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A060 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="P1 winning hand">
        <comment>catch a tile to win</comment>
        <script state="on">
            <action>maincpu.mq@0694A = 4EB90001A0704E41</action>
            <action>maincpu.mq@1A070 = 43EE02C245FA0014</action>
            <action>maincpu.mq@1A078 = 700C12DA51C8FFFC</action>
            <action>maincpu.mq@1A080 = 115A000311520207</action>
            <action>maincpu.mq@1A088 = 4E75313131323235</action>
            <action>maincpu.mq@1A090 = 3535363636373737</action>
            <action>maincpu.mq@1A098 = 06FFFFFFFFFFFFFF</action>
            <!--
            1A070 | 43EE 02C2 : lea     ($2c2,A6), A1
            1A074 | 45FA 0014 : lea     ($14,PC) ; ($1a08a), A2
            1A078 | 700C      : moveq   #$c, D0
            1A07A | 12DA      : move.b  (A2)+, (A1)+
            1A07C | 51C8 FFFC : dbra    D0, $1a07a
            1A080 | 115A 0003 : move.b  (A2)+, ($3,A0)
            1A084 | 1152 0207 : move.b  (A2), ($207,A0)
            1A088 | 4E75      : rts
            1A08A - 1A098     : tile table
            -->
        </script>
        <script state="off">
            <action>maincpu.mq@0694A = 1D7C000602074E41</action>
            <action>maincpu.mq@1A070 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A078 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A080 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A088 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A090 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A098 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="P2 winning hand">
        <comment>catch a tile to win</comment>
        <script state="on">
            <action>maincpu.mq@06CBA = 4EB90001A0A04E41</action>
            <action>maincpu.mq@1A0A0 = 43EE02E245FA0014</action>
            <action>maincpu.mq@1A0A8 = 700C12DA51C8FFFC</action>
            <action>maincpu.mq@1A0B0 = 115A000311520207</action>
            <action>maincpu.mq@1A0B8 = 4E75313131323235</action>
            <action>maincpu.mq@1A0C0 = 3535363636373737</action>
            <action>maincpu.mq@1A0C8 = 06FFFFFFFFFFFFFF</action>
            <!--
            1A0A0 | 43EE 02E2 : lea     ($2e2,A6), A1
            1A0A4 | 45FA 0014 : lea     ($14,PC) ; ($1a0ba), A2
            1A0A8 | 700C      : moveq   #$c, D0
            1A0AA | 12DA      : move.b  (A2)+, (A1)+
            1A0AC | 51C8 FFFC : dbra    D0, $1a0aa
            1A0B0 | 115A 0003 : move.b  (A2)+, ($3,A0)
            1A0B4 | 1152 0207 : move.b  (A2), ($207,A0)
            1A0B8 | 4E75      : rts
            1A0bA - 1A0C8     : tile table
            -->
        </script>
        <script state="off">
            <action>maincpu.mq@06CBA = 1D7C000602074E41</action>
            <action>maincpu.mq@1A0A0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A0A8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A0B0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A0B8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A0C0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A0C8 = 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@06764 = 0002            </action>
            <action>maincpu.mq@00706 = 4EF90001A0D043F9</action>
            <action>maincpu.mq@1A0D0 = 41F9000E00001200</action>
            <action>maincpu.mq@1A0D8 = 7400102E02176708</action>
            <action>maincpu.mq@1A0E0 = 6A04740260027404</action>
            <action>maincpu.mq@1A0E8 = 1039000C00008002</action>
            <action>maincpu.mq@1A0F0 = B20067E20C000002</action>
            <action>maincpu.mq@1A0F8 = 660253160C000004</action>
            <action>maincpu.mq@1A100 = 660252160C000040</action>
            <action>maincpu.mq@1A108 = 660210960C000010</action>
            <action>maincpu.mq@1A110 = 660410BC001060BE</action>
            <!--
            1A0D0 | 41F9 000E 0000 : lea     $e0000.l, A0  // sound latch address
            1A0D6 | 1200           : move.b  D0, D1
            1A0D8 | 7400           : moveq   #$0, D2
            1A0DA | 102E 0217      : move.b  ($217,A6), D0 // read paddle ($20217)
            1A0DE | 6708           : beq     $1a0e8
            1A0E0 | 6A04           : bpl     $1a0e6
            1A0E2 | 7402           : moveq   #$2, D2
            1A0E4 | 6002           : bra     $1a0e8
            1A0E6 | 7404           : moveq   #$4, D2
            1A0E8 | 1039 000C 0000 : move.b  $c0000.l, D0  // read buttons
            1A0EE | 8002           : or.b    D2, D0
            1A0F0 | B200           : cmp.b   D0, D1
            1A0F2 | 67E2           : beq     $1a0d6
            1A0F4 | 0C00 0002      : cmpi.b  #$2, D0
            1A0F8 | 6602           : bne     $1a0fc
            1A0FA | 5316           : subq.b  #1, (A6)      // decrease code -01
            1A0FC | 0C00 0004      : cmpi.b  #$4, D0
            1A100 | 6602           : bne     $1a104
            1A102 | 5216           : addq.b  #1, (A6)      // increase code +01
            1A104 | 0C00 0040      : cmpi.b  #$40, D0
            1A108 | 6602           : bne     $1a10c
            1A10A | 1096           : move.b  (A6), (A0)    // play sound
            1A10C | 0C00 0010      : cmpi.b  #$10, D0
            1A110 | 6604           : bne     $1a116
            1A112 | 10BC 0010      : move.b  #$10, (A0)    // stop sound
            1A116 | 60BE           : bra     $1a0d6
            -->
        </script>
        <script state="run">
            <output format="----- jongbou sono-ni 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@06764 = FF10            </action>
            <action>maincpu.mq@00706 = 41F90002010243F9</action>
            <action>maincpu.mq@1A0D0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A0D8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A0E0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A0E8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A0F0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A0F8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A100 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A108 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@1A110 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="skip rom check">
        <script state="on">
            <action>maincpu.mw@0640 = 604C</action>
        </script>
        <script state="off">
            <action>maincpu.mw@0640 = 41F8</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.