Page 1 of 1

[tokisens] Toki no Senshi

Posted: Fri Dec 03, 2021 9:32 am
by jman

Code: Select all

<cheat desc="no hit">
    <script state="on">
        <action>maincpu.ob@1234 = c3</action>
    </script>
    <script state="off">
        <action>maincpu.ob@1234 = ca</action>
    </script>
</cheat>

<cheat desc="walk through wall">
    <script state="on">
        <action>maincpu.od@147b = 47000079</action>
    </script>
    <script state="off">
        <action>maincpu.od@147b = 47e6243a</action>
    </script>
</cheat>

<cheat desc="auto fire">
    <script state="on">
        <action>maincpu.mb@1ba1 = 01</action> <!-- power up -->
        <action>maincpu.mb@1baa = 01</action> <!-- normal -->
    </script>
    <script state="off">
        <action>maincpu.mb@1ba1 = 10</action>
        <action>maincpu.mb@1baa = 20</action>
    </script>
</cheat>

<cheat desc="player speed">
    <parameter min="0x01" max="0x08" step="0x01" />
    <script state="on">
        <action>maincpu.ob@16dc = 3e</action> <!-- y position -->
        <action>maincpu.mb@170f = 11</action> <!-- x position 1 -->
        <action>maincpu.ob@1717 = c3</action> <!-- x position 2 -->
    </script>
    <script state="change">
        <action>maincpu.mb@16dd = param</action>
        <action>maincpu.mb@1712 = param</action>
    </script>
    <script state="off">
        <action>maincpu.ob@16dc = cb</action>
        <action>maincpu.mb@16dd = 43</action>
        <action>maincpu.mb@170f = 1c</action>
        <action>maincpu.mb@1712 = b0</action>
        <action>maincpu.ob@1717 = ca</action>
    </script>
</cheat>

<cheat desc="fast bomb">
    <script state="on">
        <action>maincpu.mb@1a7b = 50</action> <!-- y position -->
        <action>maincpu.mb@1a9f = 01</action> <!-- range -->
    </script>
    <script state="off">
    </script>
</cheat>

<cheat desc="sound test mode">
    <comment>reset the game (F3) to enter sound test mode</comment>
    <script state="on">
        <action>maincpu.ob@0201 =               c3</action>
        <action>maincpu.mw@0202 =             7f70</action>
        <action>maincpu.oq@7f70 = 2847b829db189621</action>
        <action>maincpu.mq@7f70 = 0000000000c10000</action>
        <action>maincpu.oq@7f78 = 05fe35292018fe3f</action>
        <action>maincpu.mq@7f78 = bf000001007f00fa</action>
        <action>maincpu.oq@7f80 = 7ef2205ffe343720</action>
        <action>maincpu.mq@7f80 = 000300fb00000100</action>
        <action>maincpu.oq@7f88 = d33e7420cafe3718</action>
        <action>maincpu.mq@7f88 = ff000400fd000600</action>
        <action>maincpu.oq@7f90 = a15739407e1844d3</action>
        <action>maincpu.mq@7f90 = 00000000df001400</action>
        <!--
        7f70 | 21 00 c1 : ld  hl,$C100 // sound code address
        7f73 | db 00    : in  a,($00)  // read input
        7f75 | b8       : cp  b
        7f76 | 47       : ld  b,a
        7f77 | 28 fa    : jr  z,$7F73
        7f79 | fe 7f    : cp  $7F
        7f7b | 20 01    : jr  nz,$7F7E
        7f7d | 35       : dec (hl)     // decrease code
        7f7e | fe bf    : cp  $BF
        7f80 | 20 01    : jr  nz,$7F83
        7f82 | 34       : inc (hl)     // increase code
        7f83 | fe fb    : cp  $FB
        7f85 | 20 03    : jr  nz,$7F8A
        7f87 | 7e       : ld  a,(hl)   // play sound
        7f88 | 18 06    : jr  $7F90
        7f8a | fe fd    : cp  $FD
        7f8c | 20 04    : jr  nz,$7F92
        7f8e | 3e ff    : ld  a,$FF    // stop sound
        7f90 | d3 14    : out ($14),a  // send sound code
        7f92 | 18 df    : jr  $7F73
        -->
    </script>
    <script state="run">
        <output format="----- toki no senshi 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@c100</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.ob@0201 =               21</action>
        <action>maincpu.mw@0202 =             c014</action>
        <action>maincpu.oq@7f70 = 050074291118963f</action>
        <action>maincpu.mq@7f70 = 0000000000000000</action>
        <action>maincpu.oq@7f78 = 050074291118963f</action>
        <action>maincpu.mq@7f78 = 0000000000000000</action>
        <action>maincpu.oq@7f80 = c0f2745fca7337d8</action>
        <action>maincpu.mq@7f80 = 0000000000000000</action>
        <action>maincpu.oq@7f88 = c0f2745fca7337d8</action>
        <action>maincpu.mq@7f88 = 0000000000000000</action>
        <action>maincpu.oq@7f90 = a15739407e62441c</action>
        <action>maincpu.mq@7f90 = 0000000000000000</action>
    </script>
</cheat>
"invincibility" in official package based on 0.221 doesn't work because tokisens has encrypted opcodes.

[tokisens] Toki no Senshi (update)

Posted: Sun Dec 25, 2022 1:23 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.ob@0201 =               c3</action>
        <action>maincpu.mw@0202 =             7f70</action>
        <action>maincpu.oq@7f70 = 2847b829db189621</action>
        <action>maincpu.mq@7f70 = 0000000000c10000</action>
        <action>maincpu.oq@7f78 = 05fe35292018fe3f</action>
        <action>maincpu.mq@7f78 = bf000001007f00fa</action>
        <action>maincpu.oq@7f80 = 3ef2205ffe343720</action>
        <action>maincpu.mq@7f80 = 000400ef00000100</action>
        <action>maincpu.oq@7f88 = 3ef2205ffe7318d8</action>
        <action>maincpu.mq@7f88 = 000500df000600f0</action>
        <action>maincpu.oq@7f90 = a12039fe7877861c</action>
        <action>maincpu.mq@7f90 = 0300fb0000000010</action>
        <action>maincpu.oq@7f98 = 3e572040fe62187e</action>
        <action>maincpu.mq@7f98 = 000400fd00060000</action>
        <action>maincpu.oq@7fa0 = c0f2745f1873d3d8</action>
        <action>maincpu.mq@7fa0 = 000000ce001400ff</action>
        <!--
        7f70 | 21 00 c1 : ld  hl,$C100 // sound code address
        7f73 | db 00    : in  a,($00)  // read input
        7f75 | b8       : cp  b
        7f76 | 47       : ld  b,a
        7f77 | 28 fa    : jr  z,$7F73
        7f79 | fe 7f    : cp  $7F
        7f7b | 20 01    : jr  nz,$7F7E
        7f7d | 35       : dec (hl)     // decrease code -01
        7f7e | fe bf    : cp  $BF
        7f80 | 20 01    : jr  nz,$7F83
        7f82 | 34       : inc (hl)     // increase code +01
        7f83 | fe ef    : cp  $EF
        7f85 | 20 04    : jr  nz,$7F8B
        7f87 | 3e f0    : ld  a,$F0    // decrease code -10
        7f89 | 18 06    : jr  $7F91
        7f8b | fe df    : cp  $DF
        7f8d | 20 05    : jr  nz,$7F94
        7f8f | 3e 10    : ld  a,$10    // increase code +10
        7f91 | 86       : add a,(hl)
        7f92 | 77       : ld  (hl),a
        7f93 | 78       : ld  a,b
        7f94 | fe fb    : cp  $FB
        7f96 | 20 03    : jr  nz,$7F9B
        7f98 | 7e       : ld  a,(hl)   // play sound
        7f99 | 18 06    : jr  $7FA1
        7f9b | fe fd    : cp  $FD
        7f9d | 20 04    : jr  nz,$7FA3
        7f9f | 3e ff    : ld  a,$FF    // stop sound
        7fa1 | d3 14    : out ($14),a
        7fa3 | 18 ce    : jr  $7F73
        -->
    </script>
    <script state="run">
        <output format="----- toki no senshi 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@c100</argument>
        </output>
    </script>
    <script state="off">
        <action>maincpu.ob@0201 =               21</action>
        <action>maincpu.mw@0202 =             c014</action>
        <action>maincpu.oq@7f70 = 050074291118963f</action>
        <action>maincpu.mq@7f70 = 0000000000000000</action>
        <action>maincpu.oq@7f78 = 050074291118963f</action>
        <action>maincpu.mq@7f78 = 0000000000000000</action>
        <action>maincpu.oq@7f80 = c0f2745fca7337d8</action>
        <action>maincpu.mq@7f80 = 0000000000000000</action>
        <action>maincpu.oq@7f88 = c0f2745fca7337d8</action>
        <action>maincpu.mq@7f88 = 0000000000000000</action>
        <action>maincpu.oq@7f90 = a15739407e62441c</action>
        <action>maincpu.mq@7f90 = 0000000000000000</action>
        <action>maincpu.oq@7f98 = a15739407e62441c</action>
        <action>maincpu.mq@7f98 = 0000000000000000</action>
        <action>maincpu.oq@7fa0 = c0f2745fca7337d8</action>
        <action>maincpu.mq@7fa0 = 0000000000000000</action>
    </script>
</cheat>
"sound test mode" : rewrite routine. add up/down key (code ±10).

[tokisens]+ Toki no Senshi

Posted: Sun Feb 11, 2024 11:38 pm
by jman
tokisens.xml

Code: Select all

<!-- Toki no Senshi - Chrono Soldier (MC-8123, 317-0040) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>maincpu.ob@1234 = C3</action>
        </script>
        <script state="off">
            <action>maincpu.ob@1234 = CA</action>
        </script>
    </cheat>

    <cheat desc="walk through wall">
        <script state="on">
            <action>maincpu.od@147B = 47000079</action>
        </script>
        <script state="off">
            <action>maincpu.od@147B = 47E6243A</action>
        </script>
    </cheat>

    <cheat desc="auto fire">
        <script state="on">
            <action>maincpu.mb@1BA1 = 01</action> <!-- power up -->
            <action>maincpu.mb@1BAA = 01</action> <!-- normal -->
        </script>
        <script state="off">
            <action>maincpu.mb@1BA1 = 10</action>
            <action>maincpu.mb@1BAA = 20</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter>
            <item value="0x01">01 (slow)</item>
            <item value="0x02">02       </item>
            <item value="0x04">03       </item>
            <item value="0x06">04       </item>
            <item value="0x08">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.ob@16DC = 3E</action> <!-- y position -->
            <action>maincpu.mb@170F = 11</action> <!-- x position -->
            <action>maincpu.ob@1717 = C3</action> <!-- x position -->
        </script>
        <script state="change">
            <action>maincpu.mb@16DD = param</action>
            <action>maincpu.mb@1712 = param</action>
        </script>
        <script state="off">
            <action>maincpu.ob@16DC = CB</action>
            <action>maincpu.mb@16DD = 43</action>
            <action>maincpu.mb@170F = 1C</action>
            <action>maincpu.mb@1712 = B0</action>
            <action>maincpu.ob@1717 = CA</action>
        </script>
    </cheat>

    <cheat desc="fast bomb">
        <script state="on">
            <action>maincpu.mb@1A7B = 50</action> <!-- y position -->
            <action>maincpu.mb@1A9F = 01</action> <!-- range -->
        </script>
        <script state="off">
            <action>maincpu.mb@1A7B = F0</action>
            <action>maincpu.mb@1A9F = 28</action>
        </script>
    </cheat>

    <cheat desc="sound test mode">
        <comment>reset the game (F3) to enter sound test mode</comment>
        <script state="on">
            <action>maincpu.ob@0201 = C3              </action>
            <action>maincpu.mw@0202 = 7F70            </action>
            <action>maincpu.oq@7F70 = 2847B8FFDBFFFF21</action>
            <action>maincpu.mq@7F70 = FFFFFF00FFC100FF</action>
            <action>maincpu.oq@7F78 = FFFE35FF20FFFEFF</action>
            <action>maincpu.mq@7F78 = BFFFFF01FF7FFFFA</action>
            <action>maincpu.oq@7F80 = 3EFF20FFFE34FF20</action>
            <action>maincpu.mq@7F80 = FF04FFEFFFFF01FF</action>
            <action>maincpu.oq@7F88 = 3EFF20FFFEFF18FF</action>
            <action>maincpu.mq@7F88 = FF05FFDFFF06FFF0</action>
            <action>maincpu.oq@7F90 = FF20FFFE787786FF</action>
            <action>maincpu.mq@7F90 = 03FFFBFFFFFFFF10</action>
            <action>maincpu.oq@7F98 = 3EFF20FFFEFF187E</action>
            <action>maincpu.mq@7F98 = FF04FFFDFF06FFFF</action>
            <action>maincpu.oq@7FA0 = FFFFFFFF18FFD3FF</action>
            <action>maincpu.mq@7FA0 = FFFFFFCEFF14FFFF</action>
            <!--
            7F70 | 21 00 C1 : ld   hl,$C100 // sound code address
            7F73 | DB 00    : in   a,($00)  // read input
            7F75 | B8       : cp   b
            7F76 | 47       : ld   b,a
            7F77 | 28 FA    : jr   z,$7F73
            7F79 | FE 7F    : cp   $7F
            7F7B | 20 01    : jr   nz,$7F7E
            7F7D | 35       : dec  (hl)     // decrease code -01
            7F7E | FE BF    : cp   $BF
            7F80 | 20 01    : jr   nz,$7F83
            7F82 | 34       : inc  (hl)     // increase code +01
            7F83 | FE EF    : cp   $EF
            7F85 | 20 04    : jr   nz,$7F8B
            7F87 | 3E F0    : ld   a,$F0    // decrease code -10
            7F89 | 18 06    : jr   $7F91
            7F8B | FE DF    : cp   $DF
            7F8D | 20 05    : jr   nz,$7F94
            7F8F | 3E 10    : ld   a,$10    // increase code +10
            7F91 | 86       : add  a,(hl)
            7F92 | 77       : ld   (hl),a
            7F93 | 78       : ld   a,b
            7F94 | FE FB    : cp   $FB
            7F96 | 20 03    : jr   nz,$7F9B
            7F98 | 7E       : ld   a,(hl)   // play sound
            7F99 | 18 06    : jr   $7FA1
            7F9B | FE FD    : cp   $FD
            7F9D | 20 04    : jr   nz,$7FA3
            7F9F | 3E FF    : ld   a,$FF    // stop sound
            7FA1 | D3 14    : out  ($14),a  // send sound code
            7FA3 | 18 CE    : jr   $7F73
            -->
        </script>
        <script state="run">
            <output format="----- toki no senshi 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@C100</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.ob@0201 = 21              </action>
            <action>maincpu.mw@0202 = C014            </action>
            <action>maincpu.oq@7F70 = 050074291118963F</action>
            <action>maincpu.mq@7F70 = 0000000000000000</action>
            <action>maincpu.oq@7F78 = 050074291118963F</action>
            <action>maincpu.mq@7F78 = 0000000000000000</action>
            <action>maincpu.oq@7F80 = C0F2745FCA7337D8</action>
            <action>maincpu.mq@7F80 = 0000000000000000</action>
            <action>maincpu.oq@7F88 = C0F2745FCA7337D8</action>
            <action>maincpu.mq@7F88 = 0000000000000000</action>
            <action>maincpu.oq@7F90 = A15739407E62441C</action>
            <action>maincpu.mq@7F90 = 0000000000000000</action>
            <action>maincpu.oq@7F98 = A15739407E62441C</action>
            <action>maincpu.mq@7F98 = 0000000000000000</action>
            <action>maincpu.oq@7FA0 = C0F2745FCA7337D8</action>
            <action>maincpu.mq@7FA0 = 0000000000000000</action>
        </script>
    </cheat>

</mamecheat>
tokisensa.xml

Code: Select all

<!-- Toki no Senshi - Chrono Soldier (prototype?) -->
<mamecheat version="1">

    <cheat desc="no hit">
        <script state="on">
            <action>maincpu.mb@1234 = C3</action>
        </script>
        <script state="off">
            <action>maincpu.mb@1234 = CA</action>
        </script>
    </cheat>

    <cheat desc="walk through wall">
        <script state="on">
            <action>maincpu.md@1437 = 47000079</action>
        </script>
        <script state="off">
            <action>maincpu.md@1437 = 47C12A3A</action>
        </script>
    </cheat>

    <cheat desc="auto fire">
        <script state="on">
            <action>maincpu.mb@1B5D = 01</action> <!-- power up -->
            <action>maincpu.mb@1B66 = 01</action> <!-- normal -->
        </script>
        <script state="off">
            <action>maincpu.mb@1B5D = 10</action>
            <action>maincpu.mb@1B66 = 20</action>
        </script>
    </cheat>

    <cheat desc="player speed">
        <parameter>
            <item value="0x01">01 (slow)</item>
            <item value="0x02">02       </item>
            <item value="0x04">03       </item>
            <item value="0x06">04       </item>
            <item value="0x08">05 (fast)</item>
        </parameter>
        <script state="on">
            <action>maincpu.mb@1698 = 3E</action> <!-- y position -->
            <action>maincpu.mb@16CB = CD</action> <!-- x position -->
            <action>maincpu.mb@16D3 = C3</action> <!-- x position -->
        </script>
        <script state="change">
            <action>maincpu.mb@1699 = param</action>
            <action>maincpu.mb@16CE = param</action>
        </script>
        <script state="off">
            <action>maincpu.mw@1698 = 27CB</action>
            <action>maincpu.mb@16CB = D8  </action>
            <action>maincpu.mb@16CE = B0  </action>
            <action>maincpu.mb@16D3 = CA  </action>
        </script>
    </cheat>

    <cheat desc="fast bomb">
        <script state="on">
            <action>maincpu.mb@1A37 = 50</action> <!-- y position -->
            <action>maincpu.mb@1A5B = 01</action> <!-- range -->
        </script>
        <script state="off">
            <action>maincpu.mb@1A37 = 50</action>
            <action>maincpu.mb@1A5B = 28</action>
        </script>
    </cheat>

    <cheat desc="sound test mode">
        <comment>reset the game (F3) to enter sound test mode</comment>
        <script state="on">
            <action>maincpu.md@0201 = 067EB0C3        </action>
            <action>maincpu.mq@7EB0 = 2847B800DBC10021</action>
            <action>maincpu.mq@7EB8 = BFFE3501207FFEFA</action>
            <action>maincpu.mq@7EC0 = 3E0420EFFE340120</action>
            <action>maincpu.mq@7EC8 = 3E0520DFFE0618F0</action>
            <action>maincpu.mq@7ED0 = 0320FBFE78778610</action>
            <action>maincpu.mq@7ED8 = 3E0420FDFE06187E</action>
            <action>maincpu.mq@7EE0 = 000000CE1814D3FF</action>
            <!--
            7EB0 | 21 00 C1 : ld   hl,$C100 // sound code address
            7EB3 | DB 00    : in   a,($00)  // read input
            7EB5 | B8       : cp   b
            7EB6 | 47       : ld   b,a
            7EB7 | 28 FA    : jr   z,$7EB3
            7EB9 | FE 7F    : cp   $7F
            7EBB | 20 01    : jr   nz,$7EBE
            7EBD | 35       : dec  (hl)     // decrease code -01
            7EBE | FE BF    : cp   $BF
            7EC0 | 20 01    : jr   nz,$7EC3
            7EC2 | 34       : inc  (hl)     // increase code +01
            7EC3 | FE EF    : cp   $EF
            7EC5 | 20 04    : jr   nz,$7ECB
            7EC7 | 3E F0    : ld   a,$F0    // decrease code -10
            7EC9 | 18 06    : jr   $7ED1
            7ECB | FE DF    : cp   $DF
            7ECD | 20 05    : jr   nz,$7ED4
            7ECF | 3E 10    : ld   a,$10    // increase code +10
            7ED1 | 86       : add  a,(hl)
            7ED2 | 77       : ld   (hl),a
            7ED3 | 78       : ld   a,b
            7ED4 | FE FB    : cp   $FB
            7ED6 | 20 03    : jr   nz,$7EDB
            7ED8 | 7E       : ld   a,(hl)   // play sound
            7ED9 | 18 06    : jr   $7EE1
            7EDB | FE FD    : cp   $FD
            7EDD | 20 04    : jr   nz,$7EE3
            7EDF | 3E FF    : ld   a,$FF    // stop sound
            7EE1 | D3 14    : out  ($14),a  // send sound code
            7EE3 | 18 CE    : jr   $7EB3
            -->
        </script>
        <script state="run">
            <output format="----- toki no senshi 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@C100</argument>
            </output>
        </script>
        <script state="off">
            <action>maincpu.md@0201 = 06C01421        </action>
            <action>maincpu.mq@7EB0 = 0000000000000000</action>
            <action>maincpu.mq@7EB8 = 0000000000000000</action>
            <action>maincpu.mq@7EC0 = 0000000000000000</action>
            <action>maincpu.mq@7EC8 = 0000000000000000</action>
            <action>maincpu.mq@7ED0 = 0000000000000000</action>
            <action>maincpu.mq@7ED8 = 0000000000000000</action>
            <action>maincpu.mq@7EE0 = 0000000000000000</action>
        </script>
    </cheat>

</mamecheat>