Advertisement
Guest User

Untitled

a guest
Sep 24th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. !explodeTime = $FF ; frames until the bob-omb explodes
  2. !xSpeed = $10 ; x speed to give the spawned bob-omb
  3.  
  4. !shootTime = $FF ; frames between firing
  5. !xOff = $04 ; x offset from the shooter to spawn the bomb
  6.  
  7.  
  8.  
  9. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  10.  
  11. print "INIT ",pc
  12. LDA #!shootTime
  13. STA $1540,x
  14. RTL
  15.  
  16. print "MAIN ",pc
  17. PHB
  18. PHK
  19. PLB
  20. JSR Main
  21. PLB
  22. RTL
  23.  
  24. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  25. xOffs:
  26. db !xOff, $100-!xOff
  27. db $00,$FF
  28.  
  29. Main:
  30. LDA $1540,x
  31. BNE Return
  32.  
  33. LDA #!shootTime
  34. STA $1540,x
  35.  
  36. JSR SubHorzPos
  37. LDA xOffs,y
  38. STA $00
  39. LDA xOffs+2,y
  40. STA $01
  41.  
  42. LDA $186C,x
  43. BNE Return
  44. JSL $02A9DE
  45. BMI Return
  46. LDA #$09
  47. STA $14C8,y
  48. LDA #!SpriteNumber
  49. STA $009E,y
  50. LDA $E4,x
  51. CLC
  52. ADC $00
  53. STA $00E4,y
  54. LDA $14E0,x
  55. CLC
  56. ADC $01
  57. STA $14E0,y
  58. LDA $D8,x
  59. STA $00D8,y
  60. LDA $14D4,x
  61. STA $14D4,y
  62. PHX
  63. TYX
  64. JSL $07F7D2
  65. LDA #!explodeTime
  66. STA $1540,x
  67. LDA #!xSpeed
  68. STA $B6,x
  69. PLX
  70. Return:
  71. RTS
  72.  
  73.  
  74.  
  75. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  76. SubHorzPos:
  77. LDY.b #$00
  78. LDA $D1
  79. SEC
  80. SBC $E4,X
  81. STA $0F
  82. LDA $D2
  83. SBC.w $14E0,X
  84. BPL +
  85. INY
  86. +
  87. RTS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement