Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; , by yoshicookiezeus
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; sprite constants - feel free to change these
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- Cooldown: db $FF,$18,$10
- Speed: db $FF,$C0,$B8
- !Speed1 = $C0
- !Speed2 = $B8
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; defines - don't mess with these
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- !RAM_ScreenBndryXLo = $1A
- !RAM_ScreenBndryXHi = $1B
- !RAM_ScreenBndryYLo = $1C
- !RAM_ScreenBndryYHi = $1D
- !RAM_SpriteNum = $9E
- !RAM_SpriteSpeedX = $B6
- !RAM_SpriteState = $C2
- !RAM_SpriteYLo = $D8
- !RAM_SpriteXLo = $E4
- !RAM_SpriteStatus = $14C8
- !RAM_SpriteYHi = $14D4
- !RAM_SpriteXHi = $14E0
- !RAM_ShooterNum = $1783
- !RAM_ShooterYLo = $178B
- !RAM_ShooterYHi = $1793
- !RAM_ShooterXLo = $179B
- !RAM_ShooterXHi = $17A3
- !RAM_ShooterTimer = $17AB
- !RAM_SmokeNum = $17C0
- !RAM_SmokeYLo = $17C4
- !RAM_SmokeXLo = $17C8
- !RAM_SmokeTimer = $17CC
- !FindFreeSlotLowPri = $02A9DE
- !InitSpriteTables = $07F7D2
- !RAM_ActivityFlag = $58
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; sprite code JSL
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- print "INIT ",pc
- print "MAIN ",pc
- PHB
- PHK
- PLB
- JSR Main
- PLB
- RTL
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; main bullet bill shooter code
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- Return: RTS
- Main: LDA !RAM_ActivityFlag
- CMP #$FF
- BEQ Return
- CMP #$00
- BEQ Return
- LDA !RAM_ShooterTimer,x ;\ return if not time to generate
- BNE Return ;/
- LDY !RAM_ActivityFlag
- LDA Cooldown,y
- STA !RAM_ShooterTimer,x ;/
- JSL !FindFreeSlotLowPri ;\ get an index to an unused sprite slot, return if all slots full
- BMI Return ;/ after: Y has index of sprite being generated
- LDA #$09 ;\ play sound effect
- STA $1DFC ;/
- LDA #$0A ;\ set sprite status for new sprite
- STA !RAM_SpriteStatus,y ;/
- LDA #$04 ;\ set sprite number for new sprite
- STA.w !RAM_SpriteNum,y ;/
- LDA !RAM_ShooterXLo,x ;\ set x position for new sprite
- STA.w !RAM_SpriteXLo,y ; |
- LDA !RAM_ShooterXHi,x ; |
- STA !RAM_SpriteXHi,y ;/
- LDA !RAM_ShooterYLo,x ;\ set y position for new sprite
- SEC ; | (y position of generator - 1)
- SBC #$01 ; |
- STA.w !RAM_SpriteYLo,y ; |
- LDA !RAM_ShooterYHi,x ; |
- SBC #$00 ; |
- STA !RAM_SpriteYHi,y ;/
- PHX ;\ before: X must have index of sprite being generated
- TYX ; | routine clears old sprite values...
- JSL !InitSpriteTables ; | ...and loads in new values for the 6 main sprite tables
- PLX ;/
- PHY
- LDY !RAM_ActivityFlag
- LDA Speed,y
- PLY
- STA.w !RAM_SpriteSpeedX,y
- JSR SubSmoke
- RTS
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; display smoke effect
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- SubSmoke: LDY #$03 ; setup loop
- .LoopStart LDA !RAM_SmokeNum,y ;\ if slot is empty,
- BEQ .Continue ;/ branch
- DEY ; decrease index
- BPL .LoopStart ; if slots left to check, branch
- RTS ; return if no slots open
- .Continue LDA #$01 ;\ set smoke sprite type
- STA !RAM_SmokeNum,y ;/
- LDA !RAM_ShooterYLo,x ;\ load shooter y position
- STA !RAM_SmokeYLo,y ;/ and store to smoke sprite y position
- LDA #$1B ;\ set time to show smoke
- STA !RAM_SmokeTimer,y ;/
- LDA !RAM_ShooterXLo,x ;\ load shooter x position
- STA !RAM_SmokeXLo,y ;/ and store to smoke sprite x position
- RTS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement