Well, it's easy enough to do accidentally if you're doing one of the extra life tricks like in 3-1.
Anyway, yes, there is now a thread at RH.net.
Well, it's easy enough to do accidentally if you're doing one of the extra life tricks like in 3-1.
Anyway, yes, there is now a thread at RH.net.
"There is much pleasure to be gained from useless knowledge." --Bertrand Russel (attributed)
Yeah I can see how it could be done but I don't really think anybody would need more than 20 or so lives to beat the game, if you're going to the trouble of hacking that bug out of the game you might as well just disable the lives system altogether. Only bug I've ever really disliked in the game is the one where you can accidentally get stuck in blocks.
Last edited by drunk3nj3sus; 10-08-2014 at 12:40 AM.
Sorry to re-open this thread, but now I've figured it out.
In Super Mario All-Stars, this was how it got fixed:
Another way to do this:Code:CheckLives: INC NumberofLives ;increment the lives counter by one LDA NumberofLives ;then reload it to see if player has 128 lives CMP #$80 BCC WereGood ;if not past 128 lives yet, we're good LDA #$7F STA NumberofLives ;otherwise, set A=128 lives WereGood: RTL ;end of routine
~Ben (ColecoFan1981)Code:CheckLives: INC NumberofLives ;increment the lives counter by one LDA NumberofLives ;then reload it to see if we have more than 128 lives BPL WereGood ;if not past 128 lives yet, we're good DEC NumberofLives ;otherwise decrement counter by one to prevent overflow WereGood: RTL ;end of routine
Last edited by ColecoFan1981; 01-07-2024 at 08:34 PM.
Nz17 (08-28-2023)
Why would you LDA and INC the number of lives in that second example? It's pointless.
ColecoFan1981 (01-07-2024)
The same would apply to the first example, too... I too would like to know why not to INC right after LDA? It might be because INC is like LDA #$01+STA.
A better way to do this would be:
Saves a lot of bytes.Code:CheckLives: lda NumberofLives ;load the lives counter cmp #$7f ;check if player has 127 lives bcs EndCheckL ;skip to end of routine if so inc NumberofLives ;otherwise increment counter by one EndCheckL: rtl
Another way...
~BenCode:CheckLives: lda NumberofLives ;load the lives counter bmi EndCheckL ;skip to end if negative flag set inc NumberofLives ;otherwise increment counter by one EndCheckL: rtl
Last edited by ColecoFan1981; 08-30-2023 at 10:25 PM.