11 March 2016 - Forum Rules
Started by SMB2J-2Q, July 27, 2017, 08:00:46 PM
Quote from: Disch on July 27, 2017, 08:36:11 PMYes. Both of those fixes are possible.
EndGameText: ... lda NumberOfLives ;otherwise, check for number of lives clc ;and increment by one for display adc #$01 cmp #10 ;more than 9 lives? bcc PutLives sbc #10 ;if so, subtract 10 and put a crown tile ldy #$9f ;next to the difference... strange things happen if sty VRAM_Buffer1+7 ;the number of lives exceeds 19
Quote from: SMB2J-2Q on July 27, 2017, 09:22:34 PMAnd where in the code does it prompt a Game Over for racking 129 lives or more, which occurs when losing a life from that point? I want to fix that, too.
Quote from: Jorpho on July 28, 2017, 12:16:13 AMIf I'm not mistaken, that happens because the number of lives is stored as a signed 8-bit integer – when you add 1 to 127, the game decides that you have negative 128 lives. The game checks if your number of lives is positive when you die (dec NumberofLives, bpl StillInGame) to decide if you have a Game Over.So, I guess you would need to add extra code somewhere – probably a check to see if the number of lives is negative after you gain an extra life, which then sets the number of lives back to 128. Makes sense?
CODE_048596: EE 5A 07 INC $075A ;increase lives by 1 & make sureCODE_048599: AD 5A 07 LDA $075A ;it doesn't get past 128CODE_04859C: C9 80 CMP #$80CODE_04859E: 90 05 BCC CODE_0485A5CODE_0485A0: A9 7F LDA #$7FCODE_0485A2: 8D 5A 07 STA $075ACODE_0485A5: 6B RTL
Quote from: Teeporage777 on August 01, 2017, 06:48:48 AMI have a patch that can fix the number lives glitch if you think it could be helpful.
Quote from: SMB2J-2Q on July 27, 2017, 08:00:46 PM2. Setting the maximum number of lives to 128 ($7f hex) so that (a) you never go beyond this limit, as is the case with the Game Boy Color port Super Mario Bros. Deluxe, though the maximum number of lives in the SNES Super Mario All-Stars version of SMB (and SMB2-J, here called SMB: The Lost Levels) for the NES is 99; and thus (b) no Game Over for losing your next life after racking up 129 or more lives.
Page created in 0.107 seconds with 19 queries.