Advertisement
Guest User

Offscreen Indicator

a guest
Feb 14th, 2018
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. ; Offscreen indicator. Displays a small sprite at the top/bottom of the screen to show where Mario is when he's offscreen.
  2. ; Change the settings below as you need to, then insert with UberASM as either level asm or gamemode asm (for mode 14).
  3.  
  4. !tileAbove = $1D ; 8x8 tile to use for the marker when above the screen.
  5. !propsAbove = $28 ; YXPPCCCT properties for the tile when above the screen.
  6. !yOffAbove = $02 ; How many pixels below the very top of the screen that the tile should appear.
  7.  
  8. !tileBelow = $1D ; 8x8 tile to use for the marker when below the screen.
  9. !propsBelow = $28 ; YXPPCCCT properties for the tile when below the screen.
  10. !yOffBelow = $02 ; How many pixels below the very bottom of the screen that the tile should appear.
  11.  
  12. ;;;
  13.  
  14. !oamIndex = $0000 ; OAM index from $0200 to use.
  15. ; ^ don't touch this one unless you know how it works
  16. ; the default value isn't really used by much so it should be fine
  17.  
  18.  
  19. ;;;;;
  20. ; Code begins
  21. main:
  22. LDY #$00
  23. REP #$20
  24. LDA $80
  25. CMP #$FFE1
  26. BMI .offscreen
  27. LDX $19
  28. BNE +
  29. CLC : ADC #$0008
  30. + CMP #$00DA
  31. BMI .ret
  32. LDY #$01
  33.  
  34. .offscreen
  35. SEP #$20
  36. LDA $7E
  37. CLC : ADC #$04
  38. STA $0200+!oamIndex
  39. LDA yOffs,y
  40. STA $0201+!oamIndex
  41. LDA Tiles,y
  42. STA $0202+!oamIndex
  43. LDA Props,y
  44. STA $0203+!oamIndex
  45. STZ $0420+(!oamIndex/4)
  46.  
  47. .ret
  48. SEP #$20
  49. RTL
  50.  
  51. Tiles:
  52. db !tileAbove,!tileBelow
  53. Props:
  54. db !propsAbove,!propsBelow
  55. yOffs:
  56. db !yOffAbove,$D8-!yOffBelow
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement