
Mega Man 2 (NES) password algorithm and code - kpshek
https://github.com/kpshek/mm2pwd
======
binarymax
There is an amazing port of Mega Man 2 for iOS. It autosaves however, so there
is no way to enter the code. I play it all the time. My record for beating it
is under 20 minutes on normal. Greatest NES game of all time, and also the
greatest 8-bit music. I still get the airman theme stuck in my head sometimes.

~~~
techdmn
Airman theme has been my ringtone for the last year. :)

~~~
pimentel
My ringtone has been Dr. Willy's first stage for quite some years :)

It's great that there are so many creative covers out there. Metal versions,
piano, etc

~~~
shrub
Another Dr. Willy ringtone here.

------
T-hawk
Many NES games have had their password systems cracked:

Mega Man 3: <http://www.mmhp.net/Passwords/MM3/>

Metroid: <http://www.gdward.plus.com/site/flash/metroid/>

Kid Icarus: <http://www.geocities.ws/passgens/pages/Kid_Icarus.htm>

Castlevania III: <http://castlevaniadungeon.net/forums/index.php?topic=4659.0>

Google for pretty much any popular NES game + "password generator" and you'll
find something.

~~~
Tyrant505
Metroid! I haven't thought about that game for years! I loved it. I played
through a ton of it.. but what was that pw? Justin Bailey? TIL(this only
reddit?) "Justin Bailey is a term used to refer to the bikini swimsuit that
Samus Aran wore during the endings of Metroid, Metroid II: Return of Samus,
Super Metroid and Metroid Fusion." I can't even remember how I learned of that
code..

~~~
T-hawk
The password is JUSTIN BAILEY ------ ------ . Metroid has been disassembled to
prove that there's nothing special about those words in the code. The password
is a coincidence, that the bit pattern happens to pass the checksum and
produces a Samus who possesses most of the powerups in the game.

There's no meaning to it. It's not anybody's name, and anything about the
swimsuit is fan retcon. You probably learned about it from either Nintendo
Power or one of the many unofficial NES game guidebooks. They invented all
sorts of urban legends around it, but modern eyes on the cold code can prove
it's just a fluke.

It actually gives an impossible game state: Samus has 255 missiles current but
205 max, and some of the combinations are inconsistent like a set of missiles
acquired behind a door that remains locked.

~~~
Tyrant505
Awesome. It is interesting thinking about these childhood days. Yea I did have
a subscription to Nintendo Power. I actually got in it on the time trial of a
mario cart level(i think the first). It is crazy that I actually remembered
the code. That is how the brain works I guess.. I do remember one time I
guessed a code: Turbo graphics 16, Military Madness: Neptune I completely
guessed it as a child and it was like.. uhh. amazing!

------
Raz0rblade
He licensed his code, which is kinda strange since he took the algorithm from
another program which he didn't owns. I wonder the real legal status of his
code and license

~~~
tadfisher
Algorithms are patented, not copyrighted.

~~~
TheZenPsycho
strictly speaking, in theory, algorithms aren't patentable, only specific
implementations of algorithms. In practice, it would seem, lawyers figured out
a way to do it with some clever wording. "Method and Apparatus"- You see
because the method on its own is not enough to patent you have to include the
computer that the algorithm runs on in the patent, in order to patent it.

------
w1ntermute
When I got a Super Famicom from Super Potato in Akihabara, I got a copy of
_Rockman 7_ (known as _Mega Man 7_ in the English localization) too, and that
was my first time playing a game that old. It was so weird seeing the password
system, rather than saving in-game. They used a 4x4 (or 5x5?) grid of faces of
characters from the game. I wonder why they didn't just use a text password -
perhaps because it removed the need for localization.

Another game I got, _The Legend of Zelda: The Triforce of the Gods_ (known as
_A Link to the Past_ in the West), had a great in-game save system. It seems
like there should have been enough storage for that with Rockman 7 too.

Edit: my bad, 7, not X7.

~~~
pcwalton
Cost savings, most likely. Supporting saving in the SNES era required a
physical battery in the cartridge. Passwords were rarer in the SNES days than
in the NES days, but there were still several developers who figured they'd
save a few bucks by omitting the battery-backed memory.

------
Gmo
Kudos for recreating the algorithm ... Too bad there is no details if it is by
inspecting the assembly code or by external observation ...

Now ... if someone could do the same with the name of the worlds in the
original Populous ...

~~~
danielweber
The algorithm was published in _Nintendo Power_. Even 14-year-olds could
figure it out.

Once you knew MM2 had such an easy system, you could figure out MM3's password
system by itself on your very first playthrough just as long as you wrote
things down.

~~~
chc
I figured out Mega Man 3's without even trying. The patterns were just really
obvious. I remember I thought it was kind of cool that the passwords actually
"meant" something.

------
danso
While MM2's password system seems pretty straightforward, I've always been
fascinated with how other games managed to track state with a 10-24 letter
password. Metroid, for example...IIRC, didn't the game also keep track of your
current health, besides the progress you made in the game? I guess that state
could be encapsulated in just a few of those letters. And the state of
progress would be pretty easy to do (A = Kraid beaten, B = Ridley beaten, and
so forth) as each individual "scene" resetted its state as soon as you left
it.

~~~
warfangle
You only received a password when you died in Metroid; the password would
track how many energy tanks you'd collected, but not your current energy level
(because at the time you receive the password, that energy level is zero).

~~~
danso
What about missiles?

~~~
danielweber
It not only tracked your missile count, it tracked _which_ missile tanks you
picked up, as well as _which doors_ you had blown open. There's a lot in
there.

~~~
bmohlenhoff
You only need a single bit to keep track of whether or not a door was blown
open. I'd imagine the missiles worked the same way, and they just computed the
total as the number of missile bits set times 5.

------
jheriko
This is quite interesting... I wonder if anyone 'cracked' it when it was
new... :)

~~~
incision
>I wonder if anyone 'cracked' it when it was new... :)

Certainly.

For years I maintained a ragged spiral notebook of video game info which
contained among other things some extensive, entirely handwritten reverse
engineering of the password systems for MegaMan 2 and Metal Gear.

------
mratzloff
I love this stuff. Fun project.

Some day I need to get around to releasing the X-wing save game editor I
wrote... in JavaScript. (So it can run directly on GitHub.)

------
markost
Has anyone else noticed that the music playing during the MM2 password screen
is remarkably similar to the end of Nine Inch Nails' "Closer"?

------
QuantumGuy
Anybody think implementing the Mega Man in browser would be a cool side
project?

~~~
VoiceOfWisdom
This site[1] has a couple games emulated in javascript. Just select Mega Man
from the list and start playing.

[1] <http://fir.sh/projects/jsnes/>

