Page 1 of 1

[rastan+] Built-in flags

Posted: Wed Aug 22, 2007 6:39 am
by stephh
There are 2 flags in RAM that were used by coders to test the game, and they left the code for them (even if they are originally filled by an address in ROM area which "blanks" them) !

The first one gives you infinite energy ... I'm not convinced it is useful as we already have such cheat, but it's for documentation purpose ...

But the second one gives you better invulnerability than your ROM cheat as you can only die if you fall into water (but you can walk on fire) ...

Here are the codes :

Code: Select all

:rastan:00900000:10C040:00000040:FFFFFFFF:Invincibility (flag)
:rastan:00900000:10C044:00000080:FFFFFFFF:Infinite Energy (flag)

Code: Select all

:rastanu:00900000:10C040:00000040:FFFFFFFF:Invincibility (flag)
:rastanu:00900000:10C044:00000080:FFFFFFFF:Infinite Energy (flag)

Code: Select all

:rastanu2:00900000:10C040:00000040:FFFFFFFF:Invincibility (flag)
:rastanu2:00900000:10C044:00000080:FFFFFFFF:Infinite Energy (flag)

Code: Select all

:rastsag1:00900000:10C040:00000040:FFFFFFFF:Invincibility (flag)
:rastsag1:00900000:10C044:00000080:FFFFFFFF:Infinite Energy (flag)

Code: Select all

:rastsaga:00900000:10C040:00000040:FFFFFFFF:Invincibility (flag)
:rastsaga:00900000:10C044:00000080:FFFFFFFF:Infinite Energy (flag)
Notice the "Restore Previous Value" type bit (for RAM cheats !) which is far better to easily toggle the cheat ON/OFF ... BTW, flags cheats in your database for other games could also use this useful feature of the cheat engine (especially when you map the cheat to a key) ...

Last thing to know is that the ROM area where this flags come from is the same as the one to allow you to select the starting level ! Here are my notes from the rastan.c driver I've submitted to MAME Devs :

Code: Select all

  - There was sort of debug address at 0x05ff9e.w ('rastan' and 'rastanu') or 0x05fffc ('rastanu2' and 'rastsag*') in ROM area :
      * bits 0 to 2 determine the level (0 to 5)
      * bits 3 and 5 determine where you start at the level !
          . OFF & OFF : part 1
          . OFF & ON  : part 2
          . ON  & OFF : part 3 (boss)
          . ON  & ON  : IMPOSSIBLE !
      * bit 4 doesn't seem to have any effect
      * bit 6 is the invulnerability flag (stored at 0x10c040.w = $40,A5)
        surprisingly, it doesn't work when you fall in the water
      * bit 7 is the infinite energy flag (stored at 0x10c044.w = $44,A5)
    Be aware that the bits are active low !
I hope that this helps ... Please let me know if you intend to add such things ...

Image Steph from The Ultimate Patchers Image

Posted: Thu Aug 23, 2007 2:40 am
by Vec2017
Even if it doesn't get in stephh, thank you - I've personally been hoping for an improvement on invincibility for this one for years.

I know where the rest of my evening is going to go :)

Posted: Thu Aug 23, 2007 10:39 am
by Pugsy
There are 2 flags in RAM that were used by coders to test the game, and they left the code for them (even if they are originally filled by an address in ROM area which "blanks" them) !
Nice find
The first one gives you infinite energy ... I'm not convinced it is useful as we already have such cheat, but it's for documentation purpose ...
Yes, I see no reason to change the existing cheat - standard energy is always easier to understand.
But the second one gives you better invulnerability than your ROM cheat as you can only die if you fall into water (but you can walk on fire) ...
Not my ROM cheat, though it was a nicely done cheat..yours is better so I've replaced the existing ROM invincibility. I might have a look at finding ROM walk on water or a megajump cheat if I get a chance. Though I do have one issue, surely if it's a flag cheat it should have a flag based mask rather than FFFFFFFF?

Code: Select all

:rastan:00900000:10C040:00000040:00000040:Invincibility

Posted: Thu Aug 23, 2007 5:10 pm
by stephh
Pugsy wrote:Though I do have one issue, surely if it's a flag cheat it should have a flag based mask rather than FFFFFFFF?

Code: Select all

:rastan:00900000:10C040:00000040:00000040:Invincibility
The fact is that the code only looks for a value != 0 ... So you can use a flag mask or a "solid" cheat, noone cares ...

BTW, I'll check your database and see which cheats can be "flagged" as well with the "Restore Previous Value" type bit (provided you don't activate them when you are already invincible - i.e. to be used before game starts) ...

Image Steph from The Ultimate Patchers Image