So I was playing the original NES version of FF2, and I noticed that HP can go above 9999, while MP can go above 999. This wouldn't be an issue, except for the fact that both of these stats roll back over to 0 once they reach 65536. So I'm wondering how simple it would be to add in a simple overflow check, and/or limit HP and MP to 9999 and 999 respectively. I haven't seen this game taken apart and detailed yet, and quite honestly, I wouldn't know how to find this information in the ROM if I tried.
EDIT: Here's a list of rollover bugs/glitches I discovered a couple years back that I'd be interested in fixing.
1. HP and MP max out at 65535, any higher and it rolls over to 0. This makes it possible, through controlled stat growth manipulation and lots of patience, to have characters with 0 HP and MP, effectively screwing over your save file for good. (if you have 0 HP and MP, you have no way to gain any more, and with 0 HP, you'll die as soon as any enemy hits you or casts a spell in battle. Even when you try to cast a spell in battle with 0 HP, it kills the character who casts it.)
2. The Ultima spell doesn't get any stronger, ever. Even if you have an inventory full of level 16 spells, Ultima still does the same damage as it would if all you had was a level 1 Ultima and no other spells.
3. Gil maxes out at 16777215 (only up to 9999999 is shown properly) - after that it rolls over to 0.
4. Inn costs roll over to 0 once they reach 65535. This can be exploited if you get your HP/MP high enough (you can make it so you pay 0 gold to recover 65536 MP, for example)