[ridleofp] Riddle of Pythagoras/Pythagoras no Nazo

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: 1315
Joined: Tue Dec 01, 2020 1:24 pm
Been thanked: 9 times

[ridleofp] Riddle of Pythagoras/Pythagoras no Nazo

Post by jman »

Code: Select all

<cheat desc="keep a ball">
    <script state="on">
        <action>maincpu.md@62ef =         007d00c3</action>
        <action>maincpu.mq@7d00 = 857d19210b7efde5</action>
        <action>maincpu.mq@7d08 = c1fb3a0b77fd7e6f</action>
        <action>maincpu.mq@7d10 = 01c3e10377fd08d6</action>
        <action>maincpu.mq@7d18 = 02030c0302010063</action>
        <action>maincpu.mq@7d20 = 0e0d040d0e0f0001</action>
        <action>maincpu.mq@7d28 = ffffffffffffff0f</action>
        <!--
        7d00 | e5       : push hl
        7d01 | fd 7e 0b : ld   a,(iy+$0b)
        7d04 | 21 17 7d : ld   hl,$7D19
        7d07 | 85       : add  a,l
        7d08 | 6f       : ld   l,a
        7d09 | 7e       : ld   a,(hl)
        7d0a | fd 77 0b : ld   (iy+$0b),a
        7d0d | 3a fb c1 : ld   a,($C1FB)
        7d10 | d6 10    : sub  $08
        7d12 | fd 77 03 : ld   (iy+$03),a
        7d15 | e1       : pop  hl
        7d16 | c3 01 63 : jp   $6301
        7d19 - 7d28     : direction conversion table
         source  destination
          00      00    : up to up?
          01      01    : upper-right to upper-right?
          02      02    : upper-right to upper-right?
          03      03    : upper-right to upper-right?
          04      0c    : left to right
          05      03    : lower-right to upper-right
          06      02    : lower-right to upper-right
          07      01    : lower-right to upper-right
          08      00    : down to up
          09      0f    : lower-left to upper-left
          0a      0e    : lower-left to upper-left
          0b      0d    : lower-left to upper-left
          0c      04    : right to left
          0d      0d    : upper-left to upper-left?
          0e      0e    : upper-left to upper-left?
          0f      0f    : upper-left to upper-left?
        -->
    </script>
    <script state="off">
        <action>maincpu.md@62ef =         000136fd</action>
        <action>maincpu.mq@7d00 = ffffffffffffffff</action>
        <action>maincpu.mq@7d08 = ffffffffffffffff</action>
        <action>maincpu.mq@7d10 = ffffffffffffffff</action>
        <action>maincpu.mq@7d18 = ffffffffffffffff</action>
        <action>maincpu.mq@7d20 = ffffffffffffffff</action>
        <action>maincpu.mq@7d28 = ffffffffffffffff</action>
    </script>
</cheat>

<cheat desc="auto fire">
    <script state="on">
        <action>maincpu.mb@2aa6 = 37</action>
    </script>
    <script state="off">
        <action>maincpu.mb@2aa6 = 39</action>
    </script>
</cheat>

<cheat desc="ball speed">
    <parameter>
        <item value="0x0080">01 (slow)</item>
        <item value="0x0280">02       </item>
        <item value="0x0480">03       </item>
        <item value="0x0680">04       </item>
        <item value="0x0880">05 (fast)</item>
    </parameter>
    <script state="on">
        <action>maincpu.mw@6389 = 7d30</action>
        <action>maincpu.mw@63b9 = 7d30</action>
        <action>maincpu.mq@7d30 = 0011c8b37a6626cd</action>
        <action>maincpu.mq@7d38 = ffffffffffffc900</action>
        <!--
        7d30 | cd 26 66 : call $6626
        7d33 | 7a       : ld   a,d
        7d34 | b3       : or   e
        7d35 | c8       : ret  z
        7d36 | 11 xx xx : ld   de,$xxxx
        7d39 | c9       : ret
        -->
    </script>
    <script state="change">
        <action>maincpu.mw@7d37 = param</action>
    </script>
    <script state="off">
        <action>maincpu.mw@6389 = 6626</action>
        <action>maincpu.mw@63b9 = 6626</action>
        <action>maincpu.mq@7d30 = ffffffffffffffff</action>
        <action>maincpu.mq@7d38 = 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@77ad =             ff3e</action> <!-- sound stop when pressed coin input -->
        <action>maincpu.mw@00cd =             7d40</action>
        <action>maincpu.mq@7d40 = 022077cbe0db000e</action>
        <action>maincpu.mq@7d48 = 76cbec3921f3c1cb</action>
        <action>maincpu.mq@7d50 = 66cbc9cbb6cb0428</action>
        <action>maincpu.mq@7d58 = 79fbd1cba6cb0428</action>
        <action>maincpu.mq@7d60 = fec10021dc2847b8</action>
        <action>maincpu.mq@7d68 = 012004fe35012002</action>
        <action>maincpu.mq@7d70 = 00327e042001fe34</action>
        <action>maincpu.mq@7d78 = ffffffffffc518f8</action>
        <!--
        7d40 | 0e 00    : ld  c,$00
        7d42 | db e0    : in  a,($E0)   // read start button
        7d44 | cb 77    : bit 6,a
        7d46 | 20 02    : jr  nz,$7D4A
        7d48 | cb c1    : set 0,c
        7d4a | f3       : di
        7d4b | 21 39 ec : ld  hl,$EC39
        7d4e | cb 76    : bit 6,(hl)    // read button 1
        7d50 | 28 04    : jr  z,$7D56
        7d52 | cb b6    : res 6,(hl)
        7d54 | cb c9    : set 1,c
        7d56 | cb 66    : bit 4,(hl)    // read button 2
        7d58 | 28 04    : jr  z,$7D5E
        7d5a | cb a6    : res 4,(hl)
        7d5c | cb d1    : set 2,c
        7d5e | fb       : ei
        7d5f | 79       : ld  a,c
        7d60 | b8       : cp  b
        7d61 | 47       : ld  b,a
        7d62 | 28 dc    : jr  z,$7D40
        7d64 | 21 00 c1 : ld  hl,$C100
        7d67 | fe 02    : cp  $02
        7d69 | 20 01    : jr  nz,$7D6C
        7d6b | 35       : dec (hl)      // decrease code -01
        7d6c | fe 04    : cp  $04
        7d6e | 20 01    : jr  nz,$7D71
        7d70 | 34       : inc (hl)      // increase code +01
        7d71 | fe 01    : cp  $01
        7d73 | 20 04    : jr  nz,$7D79
        7d75 | 7e       : ld  a,(hl)    // play sound
        7d76 | 32 00 f8 : ld  ($F800),a
        7d79 | 18 c5    : jr  $7D40
        -->
    </script>
    <script state="run">
        <output format="----- riddle of pythagoras sound test mode -----" line="10" align="center" />
        <output format="button 1 : decrease code"                         line="11" align="center" />
        <output format="button 2 : increase code"                         line="12" align="center" />
        <output format="start : play sound"                               line="13" align="center" />
        <output format="coin : 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@c100</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.mw@77ad =             7e19</action>
        <action>maincpu.mw@00cd =             14a5</action>
        <action>maincpu.mq@7d40 = ffffffffffffffff</action>
        <action>maincpu.mq@7d48 = ffffffffffffffff</action>
        <action>maincpu.mq@7d50 = ffffffffffffffff</action>
        <action>maincpu.mq@7d58 = ffffffffffffffff</action>
        <action>maincpu.mq@7d60 = ffffffffffffffff</action>
        <action>maincpu.mq@7d68 = ffffffffffffffff</action>
        <action>maincpu.mq@7d70 = ffffffffffffffff</action>
        <action>maincpu.mq@7d78 = ffffffffffffffff</action>
    </script>
</cheat>
In "sound test mode", I fail to handle paddle input to choose sound code so that use button 1 and 2 instead of left and right.
jman

my wip cheat database back-up (06/01/2025 ver.)
https://u3.getuploader.com/...../download/58
downloadpass : jman2020
jman
Posts: 1315
Joined: Tue Dec 01, 2020 1:24 pm
Been thanked: 9 times

[ridleofp] Riddle of Pythagoras/Pythagoras no Nazo

Post by jman »

ridleofp.xml

Code: Select all

<!-- Riddle of Pythagoras (Japan) -->
<mamecheat version="1">

    <cheat desc="keep a ball">
        <script state="on">
            <action>maincpu.md@62EF = 007D00C3        </action>
            <action>maincpu.mq@7D00 = 857D19210B7EFDE5</action>
            <action>maincpu.mq@7D08 = C1FB3A0B77FD7E6F</action>
            <action>maincpu.mq@7D10 = 01C3E10377FD08D6</action>
            <action>maincpu.mq@7D18 = 02030C0302010063</action>
            <action>maincpu.mq@7D20 = 0E0D040D0E0F0001</action>
            <action>maincpu.mq@7D28 = FFFFFFFFFFFFFF0F</action>
            <!--
            7D00 | E5       : push hl
            7D01 | FD 7E 0B : ld   a,(iy+$0b)
            7D04 | 21 19 7D : ld   hl,$7D19
            7D07 | 85       : add  a,l
            7D08 | 6F       : ld   l,a
            7D09 | 7E       : ld   a,(hl)
            7D0A | FD 77 0B : ld   (iy+$0b),a
            7D0D | 3A FB C1 : ld   a,($C1FB)
            7D10 | D6 08    : sub  $08
            7D12 | FD 77 03 : ld   (iy+$03),a
            7D15 | E1       : pop  hl
            7D16 | C3 01 63 : jp   $6301
            7D19 - 7D28     : direction conversion table
             source  destination
              00      00    : up to up?
              01      01    : upper-right to upper-right?
              02      02    : upper-right to upper-right?
              03      03    : upper-right to upper-right?
              04      0c    : left to right
              05      03    : lower-right to upper-right
              06      02    : lower-right to upper-right
              07      01    : lower-right to upper-right
              08      00    : down to up
              09      0f    : lower-left to upper-left
              0a      0e    : lower-left to upper-left
              0b      0d    : lower-left to upper-left
              0c      04    : right to left
              0d      0d    : upper-left to upper-left?
              0e      0e    : upper-left to upper-left?
              0f      0f    : upper-left to upper-left?
            -->
        </script>
        <script state="off">
            <action>maincpu.md@62EF = 000136FD        </action>
            <action>maincpu.mq@7D00 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@7D08 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@7D10 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@7D18 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@7D20 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@7D28 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="rapid fire">
        <script state="on">
            <action>maincpu.mb@2AA6 = 37</action>
        </script>
        <script state="off">
            <action>maincpu.mb@2AA6 = 39</action>
        </script>
    </cheat>

    <cheat desc="ball speed">
        <parameter>
            <item value="0x0080">01 (slow)</item>
            <item value="0x0280">02       </item>
            <item value="0x0480">03       </item>
            <item value="0x0680">04       </item>
            <item value="0x0880">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.mw@6389 = 7D30            </action>
            <action>maincpu.mw@63B9 = 7D30            </action>
            <action>maincpu.mq@7D30 = 0011C8B37A6626CD</action>
            <action>maincpu.mq@7D38 = FFFFFFFFFFFFC900</action>
            <!--
            7D30 | CD 26 66 : call $6626
            7D33 | 7A       : ld   a,d
            7D34 | B3       : or   e
            7D35 | C8       : ret  z
            7D36 | 11 xx xx : ld   de,$xxxx
            7D39 | C9       : ret
            -->
        </script>
        <script state="change">
            <action>maincpu.mw@7D37 = param</action>
        </script>
        <script state="off">
            <action>maincpu.mw@6389 = 6626            </action>
            <action>maincpu.mw@63B9 = 6626            </action>
            <action>maincpu.mq@7D30 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@7D38 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="easy stage finish">
        <comment>press start button to finish current stage</comment>
        <script state="on">
            <action>maincpu.md@0D72 = 7C7DB0CD        </action>
            <action>maincpu.mq@7DB0 = C0E5452A77CBE0DB</action>
            <action>maincpu.mq@7DB8 = FFFFFFFFC9000021</action>
            <!--
            7DB0 | DB E0    : in   a,($E0)
            7DB2 | CB 77    : bit  6,a        // check start button
            7DB4 | 2A 45 E5 : ld   hl,($E545)
            7DB7 | C0       : ret  nz
            7DB8 | 21 00 00 : ld   hl,$0000   // set rest of walls as 0
            7DBB | C9       : ret
            -->
        </script>
        <script state="off">
            <action>maincpu.md@0D72 = 7CE5452A        </action>
            <action>maincpu.mq@7DB0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@7DB8 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="sound test mode (test)">
        <!-- hard to select sound code -->
        <comment>reset the game (F3) to enter sound test mode</comment>
        <script state="on">
            <action>maincpu.mw@00CD = 7D40            </action>
            <action>maincpu.mq@7D40 = 40E62FE0DBC00021</action>
            <action>maincpu.mq@7D48 = 50E6EC183A4F0707</action>
            <action>maincpu.mq@7D50 = D3AFFAD3103E4FB1</action>
            <action>maincpu.mq@7D58 = 1E0420A757F8DBFA</action>
            <action>maincpu.mq@7D60 = 3E03FE7B1C111800</action>
            <action>maincpu.mq@7D68 = FA023EA77A093800</action>
            <action>maincpu.mq@7D70 = 2847B8B1043E7D74</action>
            <action>maincpu.mq@7D78 = 04FE35012002FECA</action>
            <action>maincpu.mq@7D80 = 3E042003FE340120</action>
            <action>maincpu.mq@7D88 = 3E052005FE0618F0</action>
            <action>maincpu.mq@7D90 = 032040FE78778610</action>
            <action>maincpu.mq@7D98 = 3E052010FE06187E</action>
            <action>maincpu.mq@7DA0 = FFFF9D18F80032FF</action>
            <!--
            7D40 | 21 00 C0 : ld   hl,$C000  // sound code address
            7D43 | DB E0    : in   a,($E0)   // read start button
            7D45 | 2F       : cpl
            7D46 | E6 40    : and  $40
            7D48 | 07       : rlca
            7D49 | 07       : rlca
            7D4A | 4F       : ld   c,a
            7D4B | 3A 18 EC : ld   a,($EC18) // read buttons
            7D4E | E6 50    : and  $50
            7D50 | B1       : or   c
            7D51 | 4F       : ld   c,a
            7D52 | 3E 10    : ld   a,$10
            7D54 | D3 FA    : out  ($FA),a
            7D56 | AF       : xor  a
            7D57 | D3 FA    : out  ($FA),a
            7D59 | DB F8    : in   a,($F8)   // read paddle
            7D5B | 57       : ld   d,a
            7D5C | A7       : and  a
            7D5D | 20 04    : jr   nz,$7D63
            7D5F | 1E 00    : ld   e,$00
            7D61 | 18 11    : jr   $7D74
            7D63 | 1C       : inc  e
            7D64 | 7B       : ld   a,e
            7D65 | FE 03    : cp   $03
            7D67 | 3E 00    : ld   a,$00
            7D69 | 38 09    : jr   c,$7D74
            7D6B | 7A       : ld   a,d
            7D6C | A7       : and  a
            7D6D | 3E 02    : ld   a,$02
            7D6F | FA 74 7D : jp   m,$7D74
            7D72 | 3E 04    : ld   a,$04
            7D74 | B1       : or   c
            7D75 | B8       : cp   b
            7D76 | 47       : ld   b,a
            7D77 | 28 CA    : jr   z,$7D43
            7D79 | FE 02    : cp   $02
            7D7B | 20 01    : jr   nz,$7D7E
            7D7D | 35       : dec  (hl)      // decrease code -01
            7D7E | FE 04    : cp   $04
            7D80 | 20 01    : jr   nz,$7D83
            7D82 | 34       : inc  (hl)      // increase code +01
            7D83 | FE 03    : cp   $03
            7D85 | 20 04    : jr   nz,$7D8B
            7D87 | 3E F0    : ld   a,$F0     // decrease code -10
            7D89 | 18 06    : jr   $7D91
            7D8B | FE 05    : cp   $05
            7D8D | 20 05    : jr   nz,$7D94
            7D8F | 3E 10    : ld   a,$10     // increase code -10
            7D91 | 86       : add  a,(hl)
            7D92 | 77       : ld   (hl),a
            7D93 | 78       : ld   a,b
            7D94 | FE 40    : cp   $40
            7D96 | 20 03    : jr   nz,$7D9B
            7D98 | 7E       : ld   a,(hl)    // play sound
            7D99 | 18 06    : jr   $7DA1
            7D9B | FE 10    : cp   $10
            7D9D | 20 05    : jr   nz,$7DA4
            7D9F | 3E FF    : ld   a,$FF     // stop sound
            7DA1 | 32 00 F8 : ld   ($F800),a // send sound code
            7DA4 | 18 9D    : jr   $7D43
            -->
        </script>
        <script state="run">
            <output format="----- 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="start + left : decrease code -10"  line="13" align="center" />
            <output format="start + right : 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="&lt;&lt; sound code %02X &gt;&gt;" line="19" align="center"  >
                <argument>maincpu.pb@C000</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mw@00CD = 14A5            </action>
            <action>maincpu.mq@7D40 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@7D48 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@7D50 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@7D58 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@7D60 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@7D68 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@7D70 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@7D78 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@7D80 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@7D88 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@7D90 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@7D98 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@7DA0 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

</mamecheat>
  • "easy stage finish" : Added new. You can finish current stage when press start button.
  • "sound test mode" : Changed sound code selection from button to paddle. Added "start + left/right" to select code ±10. But It's hard to select sound code because of sensitive input.
jman

my wip cheat database back-up (06/01/2025 ver.)
https://u3.getuploader.com/...../download/58
downloadpass : jman2020
Post Reply