Page 1 of 1

[wboy] Infinite jump / moon jump

Posted: Sun May 19, 2024 10:18 am
by daninthemix
Hello,

I am requesting moon jump / infinite jump for Wonder boy.

Thanks

Re: [wboy] Infinite jump / moon jump

Posted: Sun May 19, 2024 1:32 pm
by jman
Multiple jump. Tap jump button to moon jump.

wboy.xml

Code: Select all

    <cheat desc="multiple jump">
        <script state="on">
            <action>maincpu.od@29A1 = 00FFFFCD        </action> <!-- jump -->
            <action>maincpu.md@29A1 = FFBFE0FF        </action>
            <action>maincpu.od@2A25 = 00FFFFCD        </action> <!-- fall down -->
            <action>maincpu.md@2A25 = FFBFE0FF        </action>
            <action>maincpu.mq@BFE0 = CB08286ECBC08421</action>
            <action>maincpu.mq@BFE8 = DDC9E1031F36DDAE</action>
            <action>maincpu.mq@BFF0 = FFFFFFFFC97E1FCB</action>
            <!--
            BFE0 | 21 84 C0    : ld   hl,$C084     // check jump button
            BFE3 | CB 6E       : bit  5,(hl)
            BFE5 | 28 08       : jr   z,$BFEF
            BFE7 | CB AE       : res  5,(hl)
            BFE9 | DD 36 1F 03 : ld   (ix+$1f),$03 // set jump flag
            BFED | E1          : pop  hl
            BFEE | C9          : ret
            BFEF | DD CB 1F 7E : bit  7,(ix+$1f)
            BFF3 | C9          : ret
            -->
        </script>
        <script state="off">
            <action>maincpu.od@29A1 = 2E5BCBDD        </action>
            <action>maincpu.md@29A1 = 7E1F9B99        </action>
            <action>maincpu.od@2A25 = 3B4FCBDD        </action>
            <action>maincpu.md@2A25 = 7E1FCF8D        </action>
            <action>maincpu.mq@BFE0 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@BFE8 = FFFFFFFFFFFFFFFF</action>
            <action>maincpu.mq@BFF0 = FFFFFFFFFFFFFFFF</action>
        </script>
    </cheat>
It's WIP code because I put custom routine into "bank" rom area so that the game will crash if bank changes.
Please tell me if this code has bug.

Re: [wboy] Infinite jump / moon jump

Posted: Sun May 19, 2024 2:26 pm
by daninthemix
Thanks - but this code appears to cause the game to reset when I hit jump.

Re: [wboy] Infinite jump / moon jump

Posted: Mon May 20, 2024 10:15 am
by jman
daninthemix wrote: but this code appears to cause the game to reset when I hit jump.
That's curious. The game reset doesn't happen on my MAME for now.

But it sounds like wrong bank switching. Try another code.

Code: Select all

    <cheat desc="multiple jump">
        <script state="on">
            <action>maincpu.od@29A1 = 00FFFFCD</action>
            <action>maincpu.md@29A1 = FFC780FF</action>
            <action>maincpu.od@2A25 = 00FFFFCD</action>
            <action>maincpu.md@2A25 = FFC780FF</action>
        </script>
        <script state="run">
            <action>maincpu.pq@C780 = CB08286ECBC08421</action>
            <action>maincpu.pq@C788 = DDC9E1031F36DDAE</action>
            <action>maincpu.pq@C790 = 00000000C97E1FCB</action>
            <!--
            C780 | 21 84 C0    : ld   hl,$C084
            C783 | CB 6E       : bit  5,(hl)       // check jump button
            C785 | 28 08       : jr   z,$C78F
            C787 | CB AE       : res  5,(hl)
            C789 | DD 36 1F 03 : ld   (ix+$1f),$03 // set jump flag
            C78D | E1          : pop  hl
            C78E | C9          : ret
            C78F | DD CB 1F 7E : bit  7,(ix+$1f)
            C793 | C9          : ret
            -->
        </script>
        <script state="off">
            <action>maincpu.od@29A1 = 2E5BCBDD        </action>
            <action>maincpu.md@29A1 = 7E1F9B99        </action>
            <action>maincpu.od@2A25 = 3B4FCBDD        </action>
            <action>maincpu.md@2A25 = 7E1FCF8D        </action>
            <action>maincpu.pq@C780 = 0000000000000000</action>
            <action>maincpu.pq@C788 = 0000000000000000</action>
            <action>maincpu.pq@C790 = 0000000000000000</action>
        </script>
    </cheat>
Custom routine is put into RAM instead of bank ROM. But some bugs may happen if other routines access this area.

Also daninthemix needs to check the following items.
  • Check game you play. The above codes are for wboy ONLY. I don't guarantee other sets.
  • Check MAME you use. I confirm the above codes for "official" MAME "0.265". I don't quarantee other clone MAME or lower version too.

Re: [wboy] Infinite jump / moon jump

Posted: Mon May 20, 2024 6:55 pm
by daninthemix
Works perfectly - thankyou.

Reason I was having issues before is I was loading save states. Sorry about that!