29

The Sega Genesis system had a rather interesting game. X-Men (1993) was based on the popular cartoon version of the comic book series. But it had what was still one of the most unique (and unintuitive) mechanisms I've ever heard of. In the second to last level, the game asks you to "reset the computer". The strange thing about this is there's no in-game way to do this, and many people would get frustrated with the inability to progress to the game's final level. But the reset mechanism the game wants you to activate is the console's reset button

Now years after attempting, failing and just moving on to other games, I happened to find the answer. This was years ago, by the way. To reset the computer- the player had to press reset on the Sega Genesis console. Yes. I was taken aback. It felt like a slap in the face. Not only was the player supposed to think outside the game cartridge, but they were supposed to do something NO gamer in their right mind would ever think of doing for fear of losing progress in the game.
And to top it off- if you pressed it for even a fraction of a second to long, the game would do exactly that- reset the system and you'd lose your progress. So gamers were supposed to tap the reset button which brought up a screen full of numbers and then moved you on to the next level.

The reset button should clear the console's memory. How did the game manage to survive pressing the reset button AND know that that was what had happened?

2
  • 1
    One bit that the answers do not address is that progress is supposedly lost when the reset button is pressed too long. I'd welcome an explanation of that (I wouldn't think a separate question is necessary)
    – Oliphaunt
    Dec 29, 2022 at 15:26
  • 3
    @Oliphaunt Just a comment as I no longer have actual Genesis hardware to test on (and it’s also a fairly hard game), but I suspect that’s just a misconception. The Genesis can’t tell how long the reset button was held down. Someone would have to disassemble the ROM to know for sure the mechanism for X-Men warm booting; if it’s actually using a different component that does use dynamic memory (maybe the VDP or a CPU’s registers?), that might explain it, but I’m not convinced. Dec 29, 2022 at 17:07

3 Answers 3

32

The reset button should clear the console's memory.

No, it shouldn’t. The 68000 reset vector is the first eight bytes in cartridge ROM. The cartridge will point at its own initialization code; the boot ROM (if there is one; very early Geneses didn’t have lockout) only enables the “TradeMark Security System” lockout.

How did the game manage to survive pressing the reset button AND know that that was what had happened?

I’m making an educated guess that it checked RAM for a known pattern, which was unlikely to be randomly set. The Genesis uses PSRAM (pseudo-static RAM, basically DRAM with a built-in refresh controller), which does not get cleared on reset, only on power loss.


I disassembled the cartridge using Ghidra and found the following "magic constant" comparison of an apparently-uninitialized RAM value ($ff0800) fairly early in the reset logic, in the function starting at $014cd8 (I labeled it Start2):

Decompilation of the cartridge at address $014cec

The magic constant $57425554 is an ASCII string WBUT.

If the comparison succeeds, control jumps to $027fe0, otherwise it skips to the next address, $014cfe.

See also:

11
  • 9
    @Davislor Possibly because the designers were trying for a unique gimmick for player interaction? Stranger things have been discussed for this type of thing, such as Rare’s ‘Stop N' Swop' gimmick on the N64 (which would have had players literally swapping the cartridge while the system was running). Dec 29, 2022 at 2:46
  • 3
    ^ That same technique is used by Paper Mario speedrunners to do an Arbitrary Code Execution glitch. They set the RAM to known values by first playing Zelda 64, then hotswapping the cartridge to Paper Mario without turning off the console Dec 29, 2022 at 4:19
  • 2
    What about the "if you pressed it [too] long" part?
    – AndreKR
    Dec 29, 2022 at 15:00
  • 4
    @AndreKR I think whomever wrote that quote was confused. They're assuming the game can detect a reset button "tap" which wasn't long enough to perform a real reset. But as this answers says, that's wrong -- the game is detecting an actual reset. Dec 29, 2022 at 16:33
  • 5
    @OwenReynolds If the reset button turns off the power supply and pulls the reset line low you might get the described behavior, where the memory state is lost iff you hold the button longer than the capacitors last.
    – AndreKR
    Dec 29, 2022 at 17:47
15

Similar methods have existed and are still used.

The reset does not clear the memory, it simply resets the CPU to start running code from start vector.

All the code needs to do is to check a known piece of memory if something known exists in memory or not, to trigger an action how to proceed after startup.

Then it is up to the game progress to write something known to the special memory address or write nonsense to make sure the function is not triggered at next reset.

This was for example used in IBM PC 5150 to skip cold boot memory test. After cold boot is done, pressing CTRL-ALT-DEL writes a special word to known memory address, so the startup code knows to skip the RAM test.

12

The reset button should clear the console's memory.

Why? And who should do that?

The Mega Drive is a very classic console. There is no OS or monitor (*1) that controls execution and prepares the machine. It's all up to the cartridge if it wants to clear memory, or how it initializes anything at all.

The Reset button just resets the system, that means whatever reset address is in the reset vector - the first few bytes of the cartridge - gets executed.

How did the game manage to survive pressing the reset button AND know that that was what had happened?

It knows it happened because it gets started at the reset entry point. Most likely it will check a few memory locations for some value stored there prior to reset. If that value (usually with some checksum) is found, it knows it's a warm-boot, so it continues the game. If not, which for all chance is when the console gets powered up, it'll setup whatever needed and start the game.


*1 Situation is a bit different with CD based games

15
  • While many cartridge-based consoles had no internal ROM, many others (including the first one I owned--a Magnavox Odyssey2) did include one. For a cartridge-based machine of the Genesis era, booting from an internal ROM would have been fairly typical.
    – supercat
    Dec 28, 2022 at 19:14
  • @supercat no, most did not, not until the late 90s. G7000, Intelivision, Colleco and Vectrex are outliers even within teh second generation consoles.
    – Raffzahn
    Dec 29, 2022 at 1:08
  • Many consoles included some internal ROM, and many did not. I'd regard both inclusion and omission of ROM as "fairly typical". Having an internal ROM would make various kinds of future system enhancements easier, and make it possible to avoid nailing down certain aspects of system design if, for example, Sega wanted to migrate toward using a common video chip for PAL, NTSC, and SCART outputs, and have code in ROM configure a chip suitably at startup.
    – supercat
    Dec 29, 2022 at 1:33
  • @supercat Consider what ever you want and speculate ahead. I'd rather go with fact.
    – Raffzahn
    Dec 29, 2022 at 1:38
  • 1
    @LieRyan interrupting external power is often not enough to destroy RAM content immideately. You will have to wait some time until capacitors and inductors discharge. This is why after split-second blackout some devices turn off or restart, and other seem to not notice it at all. Dec 30, 2022 at 8:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .