Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.14 KB | None | 0 0
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;; , by yoshicookiezeus
  3. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4.  
  5. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6. ; sprite constants - feel free to change these
  7. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8.  
  9.  
  10. Cooldown: db $FF,$18,$10
  11. Speed: db $FF,$C0,$B8
  12.  
  13. !Speed1 = $C0
  14. !Speed2 = $B8
  15.  
  16. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  17. ; defines - don't mess with these
  18. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  19.  
  20. !RAM_ScreenBndryXLo = $1A
  21. !RAM_ScreenBndryXHi = $1B
  22. !RAM_ScreenBndryYLo = $1C
  23. !RAM_ScreenBndryYHi = $1D
  24. !RAM_SpriteNum = $9E
  25. !RAM_SpriteSpeedX = $B6
  26. !RAM_SpriteState = $C2
  27. !RAM_SpriteYLo = $D8
  28. !RAM_SpriteXLo = $E4
  29. !RAM_SpriteStatus = $14C8
  30. !RAM_SpriteYHi = $14D4
  31. !RAM_SpriteXHi = $14E0
  32. !RAM_ShooterNum = $1783
  33. !RAM_ShooterYLo = $178B
  34. !RAM_ShooterYHi = $1793
  35. !RAM_ShooterXLo = $179B
  36. !RAM_ShooterXHi = $17A3
  37. !RAM_ShooterTimer = $17AB
  38. !RAM_SmokeNum = $17C0
  39. !RAM_SmokeYLo = $17C4
  40. !RAM_SmokeXLo = $17C8
  41. !RAM_SmokeTimer = $17CC
  42.  
  43. !FindFreeSlotLowPri = $02A9DE
  44. !InitSpriteTables = $07F7D2
  45.  
  46. !RAM_ActivityFlag = $58
  47.  
  48. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  49. ; sprite code JSL
  50. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  51.  
  52. print "INIT ",pc
  53. print "MAIN ",pc
  54. PHB
  55. PHK
  56. PLB
  57. JSR Main
  58. PLB
  59. RTL
  60.  
  61. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  62. ; main bullet bill shooter code
  63. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  64.  
  65. Return: RTS
  66.  
  67. Main: LDA !RAM_ActivityFlag
  68. CMP #$FF
  69. BEQ Return
  70. CMP #$00
  71. BEQ Return
  72.  
  73. LDA !RAM_ShooterTimer,x ;\ return if not time to generate
  74. BNE Return ;/
  75. LDY !RAM_ActivityFlag
  76. LDA Cooldown,y
  77. STA !RAM_ShooterTimer,x ;/
  78.  
  79. JSL !FindFreeSlotLowPri ;\ get an index to an unused sprite slot, return if all slots full
  80. BMI Return ;/ after: Y has index of sprite being generated
  81.  
  82. LDA #$09 ;\ play sound effect
  83. STA $1DFC ;/
  84. LDA #$0A ;\ set sprite status for new sprite
  85. STA !RAM_SpriteStatus,y ;/
  86. LDA #$04 ;\ set sprite number for new sprite
  87. STA.w !RAM_SpriteNum,y ;/
  88. LDA !RAM_ShooterXLo,x ;\ set x position for new sprite
  89. STA.w !RAM_SpriteXLo,y ; |
  90. LDA !RAM_ShooterXHi,x ; |
  91. STA !RAM_SpriteXHi,y ;/
  92. LDA !RAM_ShooterYLo,x ;\ set y position for new sprite
  93. SEC ; | (y position of generator - 1)
  94. SBC #$01 ; |
  95. STA.w !RAM_SpriteYLo,y ; |
  96. LDA !RAM_ShooterYHi,x ; |
  97. SBC #$00 ; |
  98. STA !RAM_SpriteYHi,y ;/
  99. PHX ;\ before: X must have index of sprite being generated
  100. TYX ; | routine clears old sprite values...
  101. JSL !InitSpriteTables ; | ...and loads in new values for the 6 main sprite tables
  102. PLX ;/
  103.  
  104. PHY
  105. LDY !RAM_ActivityFlag
  106. LDA Speed,y
  107. PLY
  108. STA.w !RAM_SpriteSpeedX,y
  109.  
  110. JSR SubSmoke
  111.  
  112. RTS
  113.  
  114.  
  115. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  116. ; display smoke effect
  117. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  118.  
  119. SubSmoke: LDY #$03 ; setup loop
  120. .LoopStart LDA !RAM_SmokeNum,y ;\ if slot is empty,
  121. BEQ .Continue ;/ branch
  122. DEY ; decrease index
  123. BPL .LoopStart ; if slots left to check, branch
  124. RTS ; return if no slots open
  125.  
  126. .Continue LDA #$01 ;\ set smoke sprite type
  127. STA !RAM_SmokeNum,y ;/
  128. LDA !RAM_ShooterYLo,x ;\ load shooter y position
  129. STA !RAM_SmokeYLo,y ;/ and store to smoke sprite y position
  130.  
  131. LDA #$1B ;\ set time to show smoke
  132. STA !RAM_SmokeTimer,y ;/
  133. LDA !RAM_ShooterXLo,x ;\ load shooter x position
  134. STA !RAM_SmokeXLo,y ;/ and store to smoke sprite x position
  135. RTS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement