Points of Required Attention™
Smaghetti, a new Super Mario Advance 4 editor, is currently in development! Check out the thread HERE!

Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,315,056
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 03-29-24 03:35 AM
Guest: Register | Login

0 users currently in ROM Hacking | 3 guests

Main - ROM Hacking - The Downside to the SMB1 GG Stage Select Code New thread | New reply


GameGenie81
Posted on 06-15-08 03:28 PM Link | Quote | ID: 85166


Koopa
Level: 24

Posts: 58/100
EXP: 77914
Next: 211

Since: 08-15-07
From: Milwaukie, OR

Last post: 5405 days
Last view: 5359 days
There is but one downside as to the official Game Genie stage select code for Super Mario Bros. for NES (YSAOPE+YEAOZA+_EAPYA): after moving to the next given world or so, you restart at the world the code applies to (for example, if you enter YSAOPE+YEAOZA+PEAPYA for World 2). This also happens if you are at a higher world than the one the code applies to and if you go down any pipes or otherwise clear the first level in that other world, you are back at the world that the code applies to. Could it be something in the game's coding that causes this downside?


;------------------------------
; $9071-$90cb ( 0x1081 - 0x10db ) run secondary game setup routine
SecondaryGameSetup:
lda #$00
sta DisableScreenFlag ;enable screen output
tay
ClearVRLoop: sta VRAM_Buffer1-1,y ;clear buffer at $0300-$03ff
iny
bne ClearVRLoop
sta GameTimerExpiredFlag ;clear game timer expiration flag
sta DisableIntermediate ;clear skip lives display flag
sta BackloadingFlag ;clear value here
lda #$ff
sta BalPlatformAlignment ;initialize balance platform assignment flag
lda ScreenLeft_PageLoc ;get left side page location
lsr MIRROR_PPU_CTRL_REG1 ;shift LSB of PPU register #1 mirror out
and #$01 ;mask out all but LSB of page location
ror
rol MIRROR_PPU_CTRL_REG1 ;this is to set the proper PPU name table
jsr GetAreaMusic ;load proper music into queue
lda #$38 ;load sprite shuffle amounts to be used later
sta SprShuffleAmt+2
lda #$48
sta SprShuffleAmt+1
lda #$58
sta SprShuffleAmt
ldx #$0e ;load default OAM offsets into $06e4-$06f2
ShufAmtLoop: lda DefaultSprOffsets,x
sta SprDataOffset,x
dex ;do this until they're all set
bpl ShufAmtLoop
ldy #$03 ;set up sprite #0
ISpr0Loop: lda Sprite0Data,y
sta Sprite_Data,y
dey
bpl ISpr0Loop
jsr DoNothing2 ;these jsr's don't do anything useful
jsr DoNothing1
inc Sprite0HitDetectFlag ;set sprite #0 check flag
inc OperMode_Task ;increment to next task
rts


Once the YSAOPE+YEAOZA+PEAPYA example code is input into the game's ROM, the ClearVRLoop instructions would now look like this:

ClearVRLoop: sta VRAM_Buffer1-1,y ;clear buffer at $0300-$03ff
iny
bne ClearVRLoop
sta GameTimerExpiredFlag ;clear game timer expiration flag
sta DisableIntermediate ;clear skip lives display flag
sta BackloadingFlag ;clear value here
lda #$01
sta WorldNumber
lda ScreenLeft_PageLoc ;get left side page location
lsr MIRROR_PPU_CTRL_REG1 ;shift LSB of PPU register #1 mirror out
and #$01 ;mask out all but LSB of page location
ror
rol MIRROR_PPU_CTRL_REG1 ;this is to set the proper PPU name table
jsr GetAreaMusic ;load proper music into queue
lda #$38 ;load sprite shuffle amounts to be used later
sta SprShuffleAmt+2
lda #$48
sta SprShuffleAmt+1
lda #$58
sta SprShuffleAmt
ldx #$0e ;load default OAM offsets into $06e4-$06f2


Should I also then change the byte at address 0x1098 so as to move on continuously from the world I'd just started on?

Thank you,



Ben

____________________
We are a nation with no geographic boundaries, bound together through our beliefs. We are like-minded individuals, sharing a common vision, pushing toward a world rid of color lines.

Main - ROM Hacking - The Downside to the SMB1 GG Stage Select Code New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.015 seconds. (350KB of memory used)
MySQL - queries: 37, rows: 57/58, time: 0.013 seconds.