Results 1 to 14 of 14

Thread: Super Mario Bros. - 128 Lives Fix

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Red (Level 21) Jorpho's Avatar
    Join Date
    Jul 2002
    Location
    We're all mad here
    Posts
    13,554
    Thanks Thanks Given 
    2
    Thanks Thanks Received 
    1
    Thanked in
    1 Post

    Default

    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)

  2. #2
    Insert Coin (Level 0)
    Join Date
    Oct 2014
    Posts
    68
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    1
    Thanked in
    1 Post

    Default

    Quote Originally Posted by Jorpho View Post
    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.
    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.

  3. #3
    Cherry (Level 1)
    Join Date
    Oct 2010
    Location
    Milwaukie (Oak Grove), Oregon
    Posts
    352
    Thanks Thanks Given 
    1
    Thanks Thanks Received 
    1
    Thanked in
    1 Post

    Default

    Sorry to re-open this thread, but now I've figured it out.

    In Super Mario All-Stars, this was how it got fixed:
    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
    Another way to do this:
    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
    ~Ben (ColecoFan1981)
    Last edited by ColecoFan1981; 01-07-2024 at 08:34 PM.

  4. The Following User Says Thank You to ColecoFan1981 For This Useful Post:

    Nz17 (08-28-2023)

  5. #4
    Bell (Level 8)
    Join Date
    Dec 2008
    Posts
    1,678
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    7
    Thanked in
    6 Posts

    Default

    Why would you LDA and INC the number of lives in that second example? It's pointless.

  6. The Following User Says Thank You to SparTonberry For This Useful Post:

    ColecoFan1981 (01-07-2024)

  7. #5
    Cherry (Level 1)
    Join Date
    Oct 2010
    Location
    Milwaukie (Oak Grove), Oregon
    Posts
    352
    Thanks Thanks Given 
    1
    Thanks Thanks Received 
    1
    Thanked in
    1 Post

    Default

    Quote Originally Posted by SparTonberry View Post
    Why would you LDA and INC the number of lives in that second example? It's pointless.
    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:
    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
    Saves a lot of bytes.

    Another way...
    Code:
    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
    ~Ben
    Last edited by ColecoFan1981; 08-30-2023 at 10:25 PM.

  8. #6
    Cherry (Level 1)
    Join Date
    Oct 2010
    Location
    Milwaukie (Oak Grove), Oregon
    Posts
    352
    Thanks Thanks Given 
    1
    Thanks Thanks Received 
    1
    Thanked in
    1 Post

    Default

    Quote Originally Posted by SparTonberry View Post
    Why would you LDA and INC the number of lives in that second example? It's pointless.
    OK, I fixed the examples I listed. In SMAS, the lives counter is incremented first, and then reloaded to see if the target result has been met.

    ~Ben

Similar Threads

  1. Super Mario Bros. Toy - Two Ladders & Mario Luigi Figures
    By ZackyH in forum Buying and Selling
    Replies: 5
    Last Post: 10-31-2007, 02:06 AM
  2. FS: N64 Mario Kart 64, Mario Golf, Super Smash Bros $35
    By Perkar in forum Buying and Selling
    Replies: 2
    Last Post: 08-24-2006, 11:31 PM
  3. NEW Super Mario Bros. an evolution of classic 2D Mario
    By Jasoco in forum Classic Gaming
    Replies: 28
    Last Post: 05-19-2005, 03:25 PM
  4. FA: Mario Bros / Zelda Toy Chest, Super Mario 2 Inside Out
    By TisLord in forum Buying and Selling
    Replies: 2
    Last Post: 10-21-2004, 09:25 AM
  5. Everybody Rejoice ---- Super Mario Bros. Super Show! - Vol 1
    By www.consolegames.org in forum Classic Gaming
    Replies: 11
    Last Post: 06-28-2004, 04:28 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •