Page 1 of 1

[garyoret] Garyo Retsuden

Posted: Mon Dec 20, 2021 9:31 am
by jman

Code: Select all

<cheat desc="no hit">
    <script state="on">
        <action>maincpu.mb@d867 = 20</action> <!-- enemy -->
        <action>maincpu.mb@db4f = 20</action> <!-- bullet -->
    </script>
    <script state="off">
        <action>maincpu.mb@d867 = 27</action>
        <action>maincpu.mb@db4f = 24</action>
    </script>
</cheat>

<cheat desc="auto fire">
    <script state="on">
        <action>maincpu.mb@e060 = 00</action>
    </script>
    <script state="off">
        <action>maincpu.mb@e060 = 04</action>
    </script>
</cheat>

<cheat desc="walk through wall">
    <script state="on">
        <action>maincpu.mw@9213 = 4f12</action>
    </script>
    <script state="off">
        <action>maincpu.mw@9213 = a6c6</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@81c1 =             fe60</action>
        <action>maincpu.mq@fe60 = d711f6380bd11127</action>
        <action>maincpu.mq@fe68 = f7c1fb26020a10c1</action>
        <action>maincpu.mq@fe70 = f726020c10c1ef26</action>
        <action>maincpu.mq@fe78 = 0496102006c1df26</action>
        <action>maincpu.mq@fe80 = 058601b7381020d8</action>
        <!--
        fe60 | d7 11    : STB  $11
        fe62 | f6 38 0B : LDB  $380B // read input
        fe65 | d1 11    : CMPB $11
        fe67 | 27 f7    : BEQ  $FE60
        fe69 | c1 fb    : CMPB #$FB
        fe6b | 26 02    : BNE  $FE6F
        fe6d | 0a 10    : DEC  $10   // decrease code
        fe6f | c1 f7    : CMPB #$F7
        fe71 | 26 02    : BNE  $FE75
        fe73 | 0c 10    : INC  $10   // increase code
        fe75 | c1 ef    : CMPB #$EF
        fe77 | 26 04    : BNE  $FE7D
        fe79 | 96 10    : LDA  $10   // play sound
        fe7b | 20 06    : BRA  $FE83
        fe7d | c1 df    : CMPB #$DF
        fe7f | 26 05    : BNE  $FE86
        fe81 | 86 01    : LDA  #$01  // stop sound
        fe83 | b7 38 10 : STA  $3810 // send sound code
        fe86 | 20 d8    : BRA  $FE60
        -->
    </script>
    <script state="run">
        <output format="----- garyo retsuden 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="button 2 : 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@1210</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.mw@81c1 =             e426</action>
        <action>maincpu.mq@fe60 = 0000000000000000</action>
        <action>maincpu.mq@fe68 = 0000000000000000</action>
        <action>maincpu.mq@fe70 = 0000000000000000</action>
        <action>maincpu.mq@fe78 = 0000000000000000</action>
        <action>maincpu.mq@fe80 = 0000000000000000</action>
    </script>
</cheat>

[garyoret] Garyo Retsuden (update)

Posted: Sat Dec 31, 2022 1:51 am
by jman

Code: Select all

<cheat desc="sound test mode">
    <comment>reset the game (F3) to enter sound test mode</comment>
    <script state="on">
        <action>maincpu.mw@81c1 =             fe60</action>
        <action>maincpu.mq@fe60 = 9711b6380b911127</action>
        <action>maincpu.mq@fe68 = f7d61081fb26015a</action>
        <action>maincpu.mq@fe70 = 81f726015c81fd26</action>
        <action>maincpu.mq@fe78 = 02c01081fe2602cb</action>
        <action>maincpu.mq@fe80 = 10d71081ef270681</action>
        <action>maincpu.mq@fe88 = df2605c601f73810</action>
        <action>maincpu.mq@fe90 = 20ceffffffffffff</action>
        <!--
        fe60 | 97 11    : STA  $11
        fe62 | b6 38 0b : LDA  $380B // read input
        fe65 | 91 11    : CMPA $11
        fe67 | 27 f7    : BEQ  $FE60
        fe69 | d6 10    : LDB  $10
        fe6b | 81 fb    : CMPA #$FB
        fe6d | 26 01    : BNE  $FE70
        fe6f | 5a       : DECB       // decrease code -01
        fe70 | 81 f7    : CMPA #$F7
        fe72 | 26 01    : BNE  $FE75
        fe74 | 5c       : INCB       // increase code +01
        fe75 | 81 fd    : CMPA #$FD
        fe77 | 26 02    : BNE  $FE7B
        fe79 | c0 10    : SUBB #$10  // decrease code -10
        fe7b | 81 fe    : CMPA #$FE
        fe7d | 26 02    : BNE  $FE81
        fe7f | cb 10    : ADDB #$10  // increase code +10
        fe81 | d7 10    : STB  $10
        fe83 | 81 ef    : CMPA #$EF
        fe85 | 27 06    : BEQ  $FE8D
        fe87 | 81 df    : CMPA #$DF
        fe89 | 26 05    : BNE  $FE90
        fe8b | c6 01    : LDB  #$01  // stop sound
        fe8d | f7 38 10 : STB  $3810 // send sound code
        fe90 | 20 ce    : BRA  $FE60
        -->
    </script>
    <script state="run">
        <output format="----- garyo retsuden 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="down : decrease code -10"                   line="13" align="center" />
        <output format="up : 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 %2.2X &gt;&gt;"         line="19" align="center"  >
            <argument>maincpu.pb@1210</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.mw@81c1 =             e426</action>
        <action>maincpu.mq@fe60 = ffffffffffffffff</action>
        <action>maincpu.mq@fe68 = ffffffffffffffff</action>
        <action>maincpu.mq@fe70 = ffffffffffffffff</action>
        <action>maincpu.mq@fe78 = ffffffffffffffff</action>
        <action>maincpu.mq@fe80 = ffffffffffffffff</action>
        <action>maincpu.mq@fe88 = ffffffffffffffff</action>
        <action>maincpu.mq@fe90 = ffffffffffffffff</action>
    </script>
</cheat>
"sound test mode" : rewrite routine. add up/down key (code ±10).

[garyoret] Garyo Retsuden

Posted: Sat Nov 30, 2024 2:21 am
by jman
garyoret.xml

Code: Select all

<!-- Garyo Retsuden (Japan) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>maincpu.mb@D867 = 20</action> <!-- enemy (1P) -->
            <action>maincpu.mb@D8B9 = 20</action> <!-- enemy (2P) -->
            <action>maincpu.mb@DB4F = 20</action> <!-- bullet -->
        </script>
        <script state="off">
            <action>maincpu.mb@D867 = 27</action>
            <action>maincpu.mb@D8B9 = 27</action>
            <action>maincpu.mb@DB4F = 24</action>
        </script>
    </cheat>

    <cheat desc="walk through wall">
        <script state="on">
            <action>maincpu.mw@9213 = 4F12</action>
        </script>
        <script state="off">
            <action>maincpu.mw@9213 = A6C6</action>
        </script>
    </cheat>

    <cheat desc="rapid fire">
        <script state="on">
            <action>maincpu.mb@E060 = 00</action> <!-- 1P -->
            <action>maincpu.mb@E097 = 00</action> <!-- 2P -->
        </script>
        <script state="off">
            <action>maincpu.mb@E060 = 04</action>
            <action>maincpu.mb@E097 = 00</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter>
            <item value="0x08">01 (slow)</item>
            <item value="0x18">02       </item>
            <item value="0x28">03       </item>
            <item value="0x38">04       </item>
            <item value="0x48">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.mb@9366 = C6</action> <!-- up -->
            <action>maincpu.mb@9373 = C6</action> <!-- down -->
            <action>maincpu.mb@9380 = C6</action> <!-- left -->
            <action>maincpu.mb@938D = C6</action> <!-- right -->
            <action>maincpu.mb@939A = C6</action> <!-- upper-left : left -->
            <action>maincpu.mb@93A6 = C6</action> <!-- upper-left : up -->
            <action>maincpu.mb@93B3 = C6</action> <!-- lower-left : left -->
            <action>maincpu.mb@93BF = C6</action> <!-- lower-left : down -->
            <action>maincpu.mb@93CC = C6</action> <!-- upper-right : right -->
            <action>maincpu.mb@93D8 = C6</action> <!-- upper-right : up -->
            <action>maincpu.mb@93E5 = C6</action> <!-- lower-right : right -->
            <action>maincpu.mb@93F1 = C6</action> <!-- lower-right : up -->
        </script>
        <script state="change">
            <action>maincpu.mb@9367 =  param</action>
            <action>maincpu.mb@9374 = -param</action>
            <action>maincpu.mb@9381 =  param</action>
            <action>maincpu.mb@938E = -param</action>
            <action>maincpu.mb@939B =  param</action>
            <action>maincpu.mb@93A7 =  param</action>
            <action>maincpu.mb@93B4 =  param</action>
            <action>maincpu.mb@93C0 = -param</action>
            <action>maincpu.mb@93CD = -param</action>
            <action>maincpu.mb@93D9 =  param</action>
            <action>maincpu.mb@93E6 = -param</action>
            <action>maincpu.mb@93F2 = -param</action>
        </script>
        <script state="off">
            <action>maincpu.mw@9366 = E621</action>
            <action>maincpu.mw@9373 = E623</action>
            <action>maincpu.mw@9380 = E624</action>
            <action>maincpu.mw@938D = E626</action>
            <action>maincpu.mw@939A = E628</action>
            <action>maincpu.mw@93A6 = E629</action>
            <action>maincpu.mw@93B3 = E62A</action>
            <action>maincpu.mw@93BF = E62B</action>
            <action>maincpu.mw@93CC = E62C</action>
            <action>maincpu.mw@93D8 = E62D</action>
            <action>maincpu.mw@93E5 = E62E</action>
            <action>maincpu.mw@93F1 = E62F</action>
        </script>
    </cheat>

    <cheat desc="short hit mark">
        <script state="on">
            <action>maincpu.mb@9AF3 = 00</action>
        </script>
        <script state="off">
            <action>maincpu.mb@9AF3 = 1B</action>
        </script>
    </cheat>

    <cheat desc="easy level finish">
        <comment>press start button to finish current level</comment>
        <script state="on">
            <action>maincpu.mw@843E = 81FF            </action>
            <action>maincpu.mw@8431 = FEB0            </action>
            <action>maincpu.mq@FEB0 = BDDFA1B6380B8540</action>
            <action>maincpu.mq@FEB8 = 260486FF97A839FF</action>
            <!--
            FEB0 | BD DF A1 : JSR    $DFA1
            FEB3 | B6 38 0B : LDA    $380B
            FEB6 | 85 40    : BITA   #$40  // check 1P start button
            FEB8 | 26 04    : BNE    $FEBE
            FEBA | 86 FF    : LDA    #$FF
            FEBC | 97 A8    : STA    $A8
            FEBE | 39       : RTS
            -->
        </script>
        <script state="off">
            <action>maincpu.mw@843E = 8101            </action>
            <action>maincpu.mw@8431 = DFA1            </action>
            <action>maincpu.mq@FEB0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@FEB8 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

    <cheat desc="starting level">
        <parameter min="0x01" max="0x08" step="0x01" />
        <script state="on">
            <action>maincpu.md@83DE = BDFEA0BD        </action>
            <action>maincpu.md@8400 = BDFEA0C6        </action>
            <action>maincpu.mq@FEA0 = 8600B7130239FFFF</action>
            <!--
            FEA0 | 86 xx    : LDA    #$xx
            FEA2 | B7 13 02 : STA    $1302
            FEA5 | 39       : RTS
            -->
        </script>
        <script state="change">
            <action>maincpu.mb@FEA1 = param - 1</action>
        </script>
        <script state="off">
            <action>maincpu.md@83DE = 7F1302BD        </action>
            <action>maincpu.md@8400 = 7F1302C6        </action>
            <action>maincpu.mq@FEA0 = 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@81C1 = FE60            </action>
            <action>maincpu.mq@FE60 = 9701B6380B910127</action>
            <action>maincpu.mq@FE68 = F7D60081FB26015A</action>
            <action>maincpu.mq@FE70 = 81F726015C81FD26</action>
            <action>maincpu.mq@FE78 = 02C01081FE2602CB</action>
            <action>maincpu.mq@FE80 = 10D70081EF270681</action>
            <action>maincpu.mq@FE88 = DF2605C601F73810</action>
            <action>maincpu.mq@FE90 = 20CEFFFFFFFFFFFF</action>
            <!--
            FE60 | 97 01    : STA    $01
            FE62 | B6 38 0B : LDA    $380B // read input
            FE65 | 91 01    : CMPA   $01
            FE67 | 27 F7    : BEQ    $FE60
            FE69 | D6 00    : LDB    $00
            FE6B | 81 FB    : CMPA   #$FB
            FE6D | 26 01    : BNE    $FE70
            FE6F | 5A       : DECB         // decrease code -01
            FE70 | 81 F7    : CMPA   #$F7
            FE72 | 26 01    : BNE    $FE75
            FE74 | 5C       : INCB         // increase code +01
            FE75 | 81 FD    : CMPA   #$FD
            FE77 | 26 02    : BNE    $FE7B
            FE79 | C0 10    : SUBB   #$10  // decrease code -10
            FE7B | 81 FE    : CMPA   #$FE
            FE7D | 26 02    : BNE    $FE81
            FE7F | CB 10    : ADDB   #$10  // increase code +10
            FE81 | D7 00    : STB    $00
            FE83 | 81 EF    : CMPA   #$EF
            FE85 | 27 06    : BEQ    $FE8D // play sound
            FE87 | 81 DF    : CMPA   #$DF
            FE89 | 26 05    : BNE    $FE90
            FE8B | C6 01    : LDB    #$01  // stop sound
            FE8D | F7 38 10 : STB    $3810 // send sound code
            FE90 | 20 CE    : BRA    $FE60
            -->
        </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="down : decrease code -10"          line="13" align="center" />
            <output format="up : 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@1200</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.mw@81C1 = E426            </action>
            <action>maincpu.mq@FE60 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@FE68 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@FE70 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@FE78 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@FE80 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@FE88 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@FE90 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>

</mamecheat>
  • "no hit" and "rapid fire" : Fixed that these codes don't work in case of player 2.
  • "player speed", "short hit mark" and "starting level" : Added new.
  • "easy level finish" : Added new. You can finish current level when you press player 1 start button.