It is currently Tue Aug 22, 2017 3:41 pm

All times are UTC - 7 hours

Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Jul 27, 2017 5:17 pm 

Joined: Thu Jul 27, 2017 5:13 pm
Posts: 2

I am wondering if there might be a way to hack the NES version of Super Mario Bros. so that I can do the following two fixes?

My intended fixes are:
1. Fixing the number of lives so they are read as proper numbers after both 10 lives and 19 lives instead of showing all these random symbols pulled from the game's character map.

2. 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 Super Mario Bros.: 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, for all those of you who mastered the jumping-on-the-Koopa-on-the-stairs trick (easiest to do in World 3-1).
I do understand what to do from the above link... but, what instructions would I change within for the two fixes I want?

Thank you,


PostPosted: Fri Jul 28, 2017 11:30 pm 

Joined: Thu Jul 27, 2017 5:13 pm
Posts: 2
To make this clearer for you all, I am going to post this...

    inc DisableScreenFlag     ;disable screen and sprite 0 check
    lda #$00
    sta Sprite0HitDetectFlag
    lda #Silence              ;silence music
    sta EventMusicQueue
    dec NumberofLives         ;take one life from player
    bpl StillinGame           ;if player has lives, branch
    lda #$00
    sta OperMode_Task         ;initialize mode task
    lda #GameOverModeValue    ;switch to game over mode
    sta OperMode              ;and leave

The main issue here is I want to change this so that Game Over is only attainable after you lose your last life (that is, when it last said "(sprite of Mario/Luigi) x 1" on the screen), rather than also fall between 128-255 lives (-127 to 0). I may need to add yet another branch to this to cover this.

The equivalent lives code in SMB1 (SMAS) is:
CODE_048596: EE 5A 07 INC $075A        ;increase lives by 1 and make sure
CODE_048599: AD 5A 07 LDA $075A        ;it doesn't go past 128.
CODE_04859C: C9 80    CMP #$80
CODE_04859E: 90 05    BCC CODE_0485A5
CODE_0485A0: A9 7F    LDA #$7F
CODE_0485A2: 8D 5A 07 STA $075A
CODE_0485A5: 6B       RTL


Last edited by SMB2J-2Q on Sat Jul 29, 2017 12:13 am, edited 1 time in total.

PostPosted: Sat Jul 29, 2017 12:01 am 
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5557
Location: Canada
That NumberofLives variable is going to be a common thing in all of the things you want to do. If you search for this you'll be able to find all the code that's relevant. There are 10 occurences of this term in the code.

You'll find two points that give an extra life by incrementing it (inc NumberofLives), and you can replace both of them with a jsr to a patch routine that checks it against a limit before incrementing it.

The part that draws it to the screen begins with lda NumberofPlayers. The code for the number rendering logic immediately follows it, which you could rewrite to handle numbers above 19, but probably not in the same space it takes. (Again, jsr to a patch somewhere else if you need more room.)

It might, however, be difficult to find empty space to put a patch. There's really not a lot of extra space in the ROM.

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours

Who is online

Users browsing this forum: No registered users and 5 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group