--------------------------------------------------------------- How the Super Mario Bros. extra lives system works (I think) MEGAߥTE 05.24.2000 megabyte@kontek.net http://kontek.net ##h represents Hexadecimal. The extra lives information is stored in byte offset 106Ah (Add 10h for ROM header and 200h if the trainer is present) Value Mario x Extra life 00h 1 0 01h-08h 2-9 1-8 09h-12h [crown]0-9 9-18 The crown appears after Mario x 9 The CHR data for the numbers 0-9 are stored in 00h-08h of the second CHR table. After this comes letters (09h-23h) and the rest of the second CHR table. Therefore, to find out which character will appear for each value, subtract 0Ah (because 0-9 are repeated) and look on the table. Value Mario x Extra life 13h-2Dh [crown]A-Z 19-45 2Eh-7Fh [crown][tile 23h-75h] 46-127 This continues up until 7Fh. However, after you obtain 128 1-ups, you will get Game Over if you lose a life. The reason for this is that the extra life data is stored as a signed byte. This means that for values where the first bit is 0, the value is positive (00h-79h) Where the first bit is 1, the value is negative (80h-FFh) When you obtain a 1-up, the game simply adds 1 to the byte value. However, when the game checks to see if your extra life count is greater than 0, values past 127 will result in a value less than 0. (FFh=-1, 80h=-127) This results in Game Over. If you managed to get 257 1-ups, the counter resets to 00h, and if you get 258+ 1-ups, the counter will be at 01h+, and you won't get Game Over after you die. Since 00h resulted in tile 01h, FFh +1 results in tile 00h, so Mario x 0 would result. Value Mario x Extra life 80h-FEh [crown][tile 76h-F4h] 0 (-127 - -2) FFh 0 0 (-1) Of course you could not get a reading of greater than 7Fh since you would automatically die, so to get this result, an emulator or game enhancer must be used. To change the extra life value with the Game Genie, you must use the base code: 12TOZ6 0 extra lives is AATOZA To add Change value 1 1 to P 2 1 to Z 3 1 to L 4 1 to G 5 1 to I 6 1 to T 7 1 to Y 8 6 to E 16 2 to P 32 2 to Z 48 2 to L 64 2 to G 80 2 to I 96 2 to T 112 2 to Y 128 (-127) 1 to E 129 (-126) 1 to O 130 (-125) 1 to X 131 (-124) 1 to U 132 (-123) 1 to K 133 (-122) 1 to S 134 (-121) 1 to V 135 (-120) 1 to N etc. 255 (-1) = NYTOZE I think that covers it. EoF. ---------------------------------------------------------------