Does anyone here know of a fix for the game Super Mario Bros. for the NES in which if Mario/Luigi gets 128 or more lives, that the counter regards these numbers as negative? The fix involves not recognizing the numbers 128-255 in the lives counter as negative.
I know the extra life count maxes out at 128 on this and Super Mario Bros.: The Lost Levels as represented on Super Mario All-Stars for the Super NES and on Super Mario Bros. Deluxe for the Game Boy Color.
Again, said fix should be as simple as the fix regarding the arcade Donkey Kong where the kill screen bug is fixed by changing the part of that game's code which was originally represented as:
Code:
0F7A 3A2962 - LD A,(#6229) ; Load A with level number
0F7D 47 - LD B,A ; Copy this number into B
0F7E A7 - AND A ; Perform bitwise AND of A with A
0F7F 17 - RLA ; Rotate left the bits in A (multiply by 2)
0F80 A7 - AND A ; Perform bitwise AND of A with A
0F81 17 - RLA ; Rotate left the bits in A (multiply by 2)
0F82 A7 - AND A ; Perform bitwise AND of A with A
0F83 17 - RLA ; Rotate left the bits in A (multiply by 2)
0F84 80 - ADD A,B ; A = A + B
0F85 80 - ADD A,B ; A = A + B
0F86 C628 - ADD A,#28 ; A = A + #28 (40 decimal)
0F88 FE51 - CP #51 ; Is A >= #51 (81 decimal)?
0F8A 3802 - JR C,#0F8E ; No, then skip ahead to #0F8E
0F8C 3E50 - LD A,#50 ; Yes, then A = #50 (80 decimal)
0F8E 21B062 - LD HL,#62B0 ; Load HL address to store the result
0F91 0603 - LD B,#03 ; For B = 1 to 3
0F93 77 - LD (HL),A ; Stores A in #62B0, #62B1 and #62B2
0F94 2C - INC L ; L = L + 1
0F95 10FC - DJNZ #0F93 ; Next B
0F7D 47 - LD B,A ; Copy this number into B
0F7E A7 - AND A ; Perform bitwise AND of A with A
0F7F 17 - RLA ; Rotate left the bits in A (multiply by 2)
0F80 A7 - AND A ; Perform bitwise AND of A with A
0F81 17 - RLA ; Rotate left the bits in A (multiply by 2)
0F82 A7 - AND A ; Perform bitwise AND of A with A
0F83 17 - RLA ; Rotate left the bits in A (multiply by 2)
0F84 80 - ADD A,B ; A = A + B
0F85 80 - ADD A,B ; A = A + B
0F86 C628 - ADD A,#28 ; A = A + #28 (40 decimal)
0F88 FE51 - CP #51 ; Is A >= #51 (81 decimal)?
0F8A 3802 - JR C,#0F8E ; No, then skip ahead to #0F8E
0F8C 3E50 - LD A,#50 ; Yes, then A = #50 (80 decimal)
0F8E 21B062 - LD HL,#62B0 ; Load HL address to store the result
0F91 0603 - LD B,#03 ; For B = 1 to 3
0F93 77 - LD (HL),A ; Stores A in #62B0, #62B1 and #62B2
0F94 2C - INC L ; L = L + 1
0F95 10FC - DJNZ #0F93 ; Next B
Into... (credit to Don Hodges and Jeff Kulczycki):
Code:
0F7A 3A2962 - LD A,(#6229) ; Load A with level number
0F7D FE04 - CP #04 ; Is the level # >= 4?
0F7F 3802 - JR C,#0F83 ; If not, jump ahead and compute bonus normally
0F81 3E04 - LD A,#04 ; If it is, then set A = 4
0F83 47 - LD B,A ; Copy A into B
0F84 A7 - AND A ; Clear the carry flag
0F85 17 - RLA ; Rotate left the bits of A
0F86 A7 - AND A ; Clear the carry flag
0F87 17 - RLA ; Rotate left the bits of A
0F88 A7 - AND A ; Clear the carry flag
0F89 17 - RLA ; Rotate left the bits of A
0F8A 80 - ADD A,B ; A = A + B
0F8B 80 - ADD A,B ; A = A + B
0F8C C628 - ADD A,#28 ; A = A + #28 (40 decimal)
0F8E 21B062 - LD HL,#62B0 ; Load HL address to store the result
0F7D FE04 - CP #04 ; Is the level # >= 4?
0F7F 3802 - JR C,#0F83 ; If not, jump ahead and compute bonus normally
0F81 3E04 - LD A,#04 ; If it is, then set A = 4
0F83 47 - LD B,A ; Copy A into B
0F84 A7 - AND A ; Clear the carry flag
0F85 17 - RLA ; Rotate left the bits of A
0F86 A7 - AND A ; Clear the carry flag
0F87 17 - RLA ; Rotate left the bits of A
0F88 A7 - AND A ; Clear the carry flag
0F89 17 - RLA ; Rotate left the bits of A
0F8A 80 - ADD A,B ; A = A + B
0F8B 80 - ADD A,B ; A = A + B
0F8C C628 - ADD A,#28 ; A = A + #28 (40 decimal)
0F8E 21B062 - LD HL,#62B0 ; Load HL address to store the result
As you all know, the new code that Hodges and Kulczycki devised which fixes the kill screen fits in the same space as the original.
~Ben