Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- == Null Sprite ==
- Routine at $01F14B is called, Y = #$FF from $01F15A: "LDY $160E,X"
- Bunch of values are set according to Y.
- Y is usually the sprite slot number of the sprite Yoshi has in his mouth.
- X is the sprite slot of Yoshi.
- Null sprite is id -1, or #$FF, so all tables are indexed way out of bounds.
- PC Instruction Eff.Addr. Intended Memory/Table Result Memory/Table Value Stored
- $01F203 STA $00E4,Y $01E3 sprite X position low byte stack $00E4,X +/- #$10 (Yoshi X-pos low, depending on direction)
- $01F210 STA $14E0,Y $15DF sprite X position high byte sprite interact with objects table,#$03 $14E0,X - 0/1 (Yoshi X-pos high, depending on direction)
- $01F215 STA $00D8,Y $01D7 sprite Y position low byte stack $00D8,X (Yoshi Y-pos low)
- $01F21B STA $14D4,Y $15D3 sprite Y position high byte sprite about to be eaten table,#$03 $14D4,X (Yoshi Y-pos high)
- $01F220 STA $00C2,Y $01C1 misc sprite table stack #$00
- $01F223 STA $15D0,Y $16CF sprite about to be eaten table bounce sprite pos/size interaction table,#$02 #$00
- $01F226 STA $1626,Y $1725 sprite kill counter table extended sprite X position low byte,#$06 #$00
- $01F234 STA $14C8,Y $15C7 sprite status table sprite off-screen table,#$03 #$09 if ducking, #$0A otherwise
- $01F23B STA $157C,Y $167B sprite horiz direction table 4th tweaker byte table,#$01 $157C,X (Yoshi direction)
- $01F246 STA $00B6,Y $01B5 sprite X speed table stack +/- #$10 if ducking, +/- #$30 other wise (depending on direction)
- $01F24B STA $00AA,Y $01A9 sprite Y speed table stack #$00
- == Brown Platform Spit ==
- Normally on execution of routine ($01F14B), Stack pointer is $01EB.
- Stack is small enough that values that are written into the stack as a result of table index issue don't effect important values. ($01E3 is deepest errant address)
- However, when routine is called on brown platform, stack frame is larger due to having to adjust positions with janky brown swinging platform.
- Stack pointer is $01E2 upon calling $01F14B.
- In this stack frame (#$01 | $01E4 | $01E3) is address routine will return to + 1. (uses RTS)
- Therefore you can jump to different parts of code between $01EE01 and $01EF00 depending on Yoshi's X-pos low byte being between #$00 and #$FF upon spitting.
- == Powerup Incrementation ==
- With Yoshi X-pos low byte of #$C6 and facing right, we return execution to $01EED7.
- This is a desynced PC value, which corresponds to JSR $9D68. We jump to $019D68.
- This is also a desynced PC value, which corresponds to INC $15,X.
- Remember X is Yoshi's sprite slot, so if Yoshi's slot is #$04, we incrment $0019, which is Mario's current powerup.
- Like credits warp, execution syncs back up eventually after running through a sprite graphics routine.
- This is why you see a dark Mario head under Yoshi for one frame when you sucessfully pull off PI.
- Yoshi Slot Eff.Addr. Result
- 00 $0015 Right direction on d-pad is held for one frame
- 01 $0016 Right direction on d-pad is pressed
- 02 $0017 nothing
- 03 $0018 nothing
- 04 $0019 Mario's powerup increments. small -> big -> cape -> fire -> unused
- 05 $001A layer 1 X-pos shifts by #$0001 for one frame
- 06 $001B layer 1 X-pos shifts by #$0100 for one frame
- 07 $001C layer 1 Y-pos shifts by #$0001 for one frame
- 08 $001D layer 1 Y-pos shifts by #$0100 for one frame
- 09 $001E layer 2 X-pos shifts by #$0001 for one frame
- 0A $001F layer 2 X-pos shifts by #$0100 for one frame
- 0B $0020 layer 2 Y-pos shifts by #$0001 for one frame
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement