Of saving, passwords, and Nintendo...

BlitzPlus Forums/BlitzPlus Programming/Of saving, passwords, and Nintendo...

It's seemed to me that, even back in the days of the Nintendo Entertainment System, a lot of the bigger adventure games -- The Legend of Zelda, Kid Icarus, Metroid, Kirby's Adventure -- used either a password or saving system. The trouble is, I don't know exactly how one would go about implementing either in less than a hundred or so lines -- or even if it would be possible. (Not that I'm anywhere close to having a game big enough to need a password system, just I'm interested in the idea and any shortcuts relating to it.)

I would imagine that a password system would be the simpler one, as it would exist entirely in the game instead of having to save data elsewhere. However, I don't understand exactly how one could set up an efficient password system (or at least one as big as the ones in Kid Icarus and Metroid), especially with that many possibilities. I suppose it would be possible to take a few keys and take their scan codes to test, something like this:

If KeyHit(M)
For space.space = Each space
If space\active = 1
space\no = M ;As M is now the variable for M's scan code
EndIf
Next
EndIf

However, I haven't tried that yet, I don't know it would work, and I only have really small games to try it with right now anyway. If you know about this kind of thing, could you please explain it to me?

Thank you!
Tomas Khan