Advertisement
Dotsarecool

Untitled

Sep 17th, 2015
502
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.12 KB | None | 0 0
  1. == Null Sprite ==
  2. Routine at $01F14B is called, Y = #$FF from $01F15A: "LDY $160E,X"
  3. Bunch of values are set according to Y.
  4. Y is usually the sprite slot number of the sprite Yoshi has in his mouth.
  5. X is the sprite slot of Yoshi.
  6. Null sprite is id -1, or #$FF, so all tables are indexed way out of bounds.
  7.  
  8. PC Instruction Eff.Addr. Intended Memory/Table Result Memory/Table Value Stored
  9.  
  10. $01F203 STA $00E4,Y $01E3 sprite X position low byte stack $00E4,X +/- #$10 (Yoshi X-pos low, depending on direction)
  11. $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)
  12. $01F215 STA $00D8,Y $01D7 sprite Y position low byte stack $00D8,X (Yoshi Y-pos low)
  13. $01F21B STA $14D4,Y $15D3 sprite Y position high byte sprite about to be eaten table,#$03 $14D4,X (Yoshi Y-pos high)
  14. $01F220 STA $00C2,Y $01C1 misc sprite table stack #$00
  15. $01F223 STA $15D0,Y $16CF sprite about to be eaten table bounce sprite pos/size interaction table,#$02 #$00
  16. $01F226 STA $1626,Y $1725 sprite kill counter table extended sprite X position low byte,#$06 #$00
  17. $01F234 STA $14C8,Y $15C7 sprite status table sprite off-screen table,#$03 #$09 if ducking, #$0A otherwise
  18. $01F23B STA $157C,Y $167B sprite horiz direction table 4th tweaker byte table,#$01 $157C,X (Yoshi direction)
  19. $01F246 STA $00B6,Y $01B5 sprite X speed table stack +/- #$10 if ducking, +/- #$30 other wise (depending on direction)
  20. $01F24B STA $00AA,Y $01A9 sprite Y speed table stack #$00
  21.  
  22. == Brown Platform Spit ==
  23. Normally on execution of routine ($01F14B), Stack pointer is $01EB.
  24. 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)
  25. However, when routine is called on brown platform, stack frame is larger due to having to adjust positions with janky brown swinging platform.
  26. Stack pointer is $01E2 upon calling $01F14B.
  27. In this stack frame (#$01 | $01E4 | $01E3) is address routine will return to + 1. (uses RTS)
  28. 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.
  29.  
  30. == Powerup Incrementation ==
  31. With Yoshi X-pos low byte of #$C6 and facing right, we return execution to $01EED7.
  32. This is a desynced PC value, which corresponds to JSR $9D68. We jump to $019D68.
  33. This is also a desynced PC value, which corresponds to INC $15,X.
  34. Remember X is Yoshi's sprite slot, so if Yoshi's slot is #$04, we incrment $0019, which is Mario's current powerup.
  35. Like credits warp, execution syncs back up eventually after running through a sprite graphics routine.
  36. This is why you see a dark Mario head under Yoshi for one frame when you sucessfully pull off PI.
  37.  
  38. Yoshi Slot Eff.Addr. Result
  39.  
  40. 00 $0015 Right direction on d-pad is held for one frame
  41. 01 $0016 Right direction on d-pad is pressed
  42. 02 $0017 nothing
  43. 03 $0018 nothing
  44. 04 $0019 Mario's powerup increments. small -> big -> cape -> fire -> unused
  45. 05 $001A layer 1 X-pos shifts by #$0001 for one frame
  46. 06 $001B layer 1 X-pos shifts by #$0100 for one frame
  47. 07 $001C layer 1 Y-pos shifts by #$0001 for one frame
  48. 08 $001D layer 1 Y-pos shifts by #$0100 for one frame
  49. 09 $001E layer 2 X-pos shifts by #$0001 for one frame
  50. 0A $001F layer 2 X-pos shifts by #$0100 for one frame
  51. 0B $0020 layer 2 Y-pos shifts by #$0001 for one frame
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement