Thanks for the reply. Any idea how to approach this?
Two main ways, both not trivial but something I could see a determined person that is vaguely familiar with tech make proper headway in for something like this.
1) Recreate a gameshark/action replay/whatever RAM cheats were called in your region.
2) Hardcode the cheat in.
Possible alternative. If there is a save or savestate editor then you can edit then you can grab that, edit it to include 99 lives and even more continues and carry on never really having to worry about it, or if it comes to it then the time take to redo it back to 99 lives should be far less than it took you to get there. I am seldom in a position where I care to play a game when I don't have cheats thanks to a flash cart, cheat device or emulator but I can see where people might be limited.
Anyway more explanations of the methods.
1) You find some point in the game that runs all the time (vblanks are common for this) and add an instruction to write to that area. For something like lives it should not matter if you die if 60 times a second said lives counter is set to 99.
2) You find what writes to this area and change it from something that subtracts to something that adds.
Downsides of those methods.
1) is quite a bit harder if you are new to all this, unless someone does it all for you (possible with super mario brothers as people do like it).
Maybe not for lives but for life counters then even 60 times a second can be too little, and the in normal in game invincibility cheat might be better than it. Basically if a blow does 200 damage and your character only has 100 health then it might do the damage, do the "dead or not" check and go from there before the game writes it back to 100.
2) Lives might be in one part of RAM but many things might write to it, and you would need to find them all (or do something else). Super Mario is actually one of the examples I often give here (though what a given version of mario will do might vary). Death reasons include pits, crushing for those automove levels (maybe not in SMB but in later ones it can be), time out, environmental hazards, enemies, poison mushrooms (maybe not in this but in later games)
The something else part from before is maybe change one to an add instead of a subtract -- if jumping in a pit is an assured one up then change the jumping in a pit thing and leave the others (or change the ones you can be bothered to find).
You can also do this if the game will not respond if something is frozen -- if a game needs you to get below a certain health, time or whatever for something to happen in it then being able to refill rather than freeze can be nice. Many would probably try to make a button activation code but that is actually difficult.
Outline of how to do it.
1) Find something that runs all the time. Find either where that code ends or something you can overwrite in it without it bothering the game as a whole, if you know what you are doing there are more methods you can use like jumping and optimising to gain space but let us not go there right away.
Super Mario is an exceptionally popular game and thus it has been fully documented unlike most games where you would be going in blind. Here you can consult the disassembly, find a constantly run routine and find where it is. Add your instruction that constantly writes a value to the lives location and go from there.
A disassembly is a big text of what each part of the game is doing. For the most part you can't assemble a disassembled work but the disassembled work will tell you where everything is in the ROM so you can edit that instead.
2) You will need a debugging emulator. Here you will set a break on write breakpoint (usually called bpw) on that memory location the cheat details. Load up a game and proceed to die. It will say hold up, something wrote here, here is what tried to do it and here are the 10 or so instructions that led up to that point.
Instructions if you are not familiar with the concept are what CPUs use to do their jobs in games. They are usually very simple things (even modern PCs are still simple when all is said and done, the NES stuff is even more so) that might have something you can describe in a line of mathematical notes be dozens of instructions long (usually a bit less but be prepared). Figure out what thing will do what you want (if you don't want it to subtract then figure out what takes away and change that, change the write back to always write a certain number instead, or stop the write back from ever happening* if it is a viable option for your chosen hack**)
As mentioned you might need to do it for pits, enemies, time, hazards and whatever else I am forgetting here and do it for all of them.
*deleting things is tricky so instead you need to make it waste some time instead. Some processors, or indeed assemblers, will have a so called No Operation aka NOP but other times you will have to invent something that functions as one.
**here it will probably be OK but other times you might need it to actually send back a value for something.