Super Mario All-Stars: World 4-3 Pulley Fix

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
SMB2J-2Q
Posts: 154
Joined: Thu Jul 27, 2017 5:13 pm

Super Mario All-Stars: World 4-3 Pulley Fix

Post by SMB2J-2Q »

Code: Select all

PositionPlayerOnVPlat:
         lda Enemy_Y_Position,x    ;get vertical coordinate
         ldy GameEngineSubroutine
         cpy #$0b                  ;if certain routine being executed on this frame,
         beq ExPlPos               ;skip all of this
         ldy Enemy_Y_HighPos,x
         cpy #$01                  ;if vertical high byte offscreen, skip this
         bne ExPlPos
         sec                       ;subtract 32 pixels from vertical coordinate
         sbc #$20                  ;for the player object's height
         sta Player_Y_Position     ;save as player's new vertical coordinate
         tya
         sbc #$00                  ;subtract borrow and store as player's
         sta Player_Y_HighPos      ;new vertical high byte
         bne ExPlPos
         stz PlatformCollisionFlag,x
         lda #$01
         sta $0028
         lda #$00
         sta Player_Y_Speed        ;initialize vertical speed and low byte of force
         sta Player_Y_MoveForce    ;and then leave
ExPlPos: rts
In the above code, there are four new lines of code. These are apparently what correct the erratic pulley movement in World 4-3 of SMB1.

Code: Select all

bne ExPlPos
stz PlatformCollisionFlag,x
lda #$01
sta $0028
May I please ask you how this can be implemented in the code for the original NES version of SMB1 and SMB2J? For example, what is STA $0028 assigned to, that way I can correctly implement it in the original 6502 code? I do know I can duplicate the STZ before it just by doing this:

Code: Select all

lda #$00
sta PlatformCollisionFlag,x
In the original NES version, when you arrive at the second half of the level with the three pulleys, you can get one of the next ones to move automatically while standing on the one before it, as explained here:
https://themushroomkingdom.net/bugs/10

This has been fixed in SMAS, with pictures below for proof:
Image
Image

Thank you,



Ben (SMB2J-2Q)
Post Reply