+  RHDN Forum Archive
|-+  Romhacking
| |-+  General Romhacking
| | |-+  How to Change the Star Man Invincibility Timer
Pages: [1]
Author Topic: How to Change the Star Man Invincibility Timer  (Read 1 times)
SMB2J-2Q
Guest
« on: July 27, 2008, 07:38:40 am »

How does one adjust the Star Man invincibility timer in Super Mario Bros. for the NES?

The default byte or bytes sets this limit to about 20 seconds, but I want to increase that by at least twice its limit. What byte do I change in the game's ROM to have 40 seconds of Star Man time?

What do I need to refer to in Doppelganger's SMB1 ASM guide to seek this out?

Regards,



Ben
KingMike
Guest
« Reply #1 on: July 27, 2008, 08:26:09 am »

Use cheat search every couple seconds, find a value that keeps decreasing.
According to datacrystal, it's $079F. Using FCEUXD SP, set a write breakpoint for that address to track down the code that changes it.
« Last Edit: July 27, 2008, 08:32:21 am by KingMike »
SMB2J-2Q
Guest
« Reply #2 on: July 27, 2008, 09:23:11 am »

Quote from: KingMike on July 27, 2008, 08:26:09 am
Use cheat search every couple seconds, find a value that keeps decreasing.
According to datacrystal, it's $079F. Using FCEUXD SP, set a write breakpoint for that address to track down the code that changes it.

Never mind, I found it: Change the byte at address 0x5827 to 0x46 to extend the Star Man time to twice the default value.

Code:
;--------------------------------------------------------------------
; $d800-$d81f ( 0x5810 - 0x582f ) handle power-up collision routine
HandlePowerUpCollision:
      jsr EraseEnemyObject    ;erase the power-up object
      lda #$06
      jsr SetUpFloateyNumber  ;award 1000 points to the player by default
      lda #SFX_PowerUpGrab
      sta Square2SoundQueue   ;play the power-up sound
      lda PowerUpType         ;check power-up type
      cmp #$02
      bcc Shroom_Flower_PUp   ;if Super Mushroom or Fire Flower, branch
      cmp #$03
      beq SetFor1Up           ;if 1-Up Mushroom, branch
      lda #$23                ;otherwise set Star Mario invincibility
      sta StarInvincibleTimer ;timer, and load the Star Mario music
      lda #StarPowerMusic     ;into the area music queue, then leave
      sta AreaMusicQueue
      rts
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC