Bäh viel zu hell und nicht melodramatisch!
Bäh viel zu hell und nicht melodramatisch!
;----------------------------------------------------;
; BG Flowers - by Ladida ;
; Can be whatever you want, just change the graphics ;
; Edit of Roy's original Spike Hell sprite ;
;----------------------------------------------------;
!FlowerTile = $6D ;Tile # of the flower petal
SpeedTableY:
db $01,$02,$01,$02,$01,$02,$01,$02,$01,$02,$01,$02,$01,$02,$01,$02,$01,$02,$01,$02 ; Speed table, per sprite. Amount of pixels to move down each frame. 00 = still, 80-FF = rise, 01-7F = sink.
SpeedTableX:
db $FD,$FF,$FE,$FF,$FD,$FF,$FE,$FF,$FD,$FF,$FE,$FF,$FD,$FF,$FE,$FF,$FD,$FF,$FE,$FF ; Speed table, per sprite. Amount of pixels to move down each frame. 00 = still, 80-FF = rise, 01-7F = sink.
SpeedTableXTwo:
db $FF,$FE,$FD,$FE,$FF,$FE,$FD,$FE,$FF,$FE,$FD,$FE,$FF,$FE,$FD,$FE,$FF,$FE,$FD,$FE ; Speed table, per sprite. Amount of pixels to move down each frame. 00 = still, 80-FF = rise, 01-7F = sink.
OAMStuff:
db $20,$24,$28,$2C,$80,$84,$88,$8C,$B0,$B4,$B8,$BC,$C0,$C4,$C8,$CC,$E4,$E8,$EC,$F0 ; These are all in $02xx
Properties:
db $34,$74,$B4,$F4,$34,$74,$B4,$F4,$34,$74,$B4,$F4,$34,$74,$B4,$F4,$34,$74,$B4,$F4 ; Properties table, per sprite. YXPPCCCT.
PropertiesTwo:
db $B4,$F4,$34,$74,$B4,$F4,$34,$74,$B4,$F4,$34,$74,$B4,$F4,$34,$74,$B4,$F4,$34,$74 ; Properties table, per sprite. YXPPCCCT.
IncrementByOne:
LDA $1E02,y ; \ Increment Y position of sprite.
INC A ; |
STA $1E02,y ; |
SEC ; | Check Y position relative to screen border Y position.
SBC $1C ; | If equal to #$F0...
CMP #$F0 ; |
BNE ReturnAndSuch ; |
LDA #$01 ; | Appear.
STA $1E2A,y ; /
ReturnAndSuch:
RTS
Main: ;The code always starts at this label in all sprites.
LDA $1E2A,y ; \ If meant to appear, skip sprite intro code.
BEQ IncrementByOne ; /
SkipIntro:
LDA $9D ; \ Don't move if sprites are supposed to be frozen.
BNE Immobile ; /
LDA $14
AND #$02
BEQ +
LDA $1E02,y ; \
CLC ; |
ADC SpeedTableY,y ; | Movement.
STA $1E02,y ; /
+
LDA $14
LSR #5
AND #$01
BEQ +
LDA $1E16,y
CLC
ADC SpeedTableX,y
BRA ++
+
LDA $1E16,y
CLC
ADC SpeedTableXTwo,y
++
STA $1E16,y
Immobile: ; OAM routine starts here.
LDX.w OAMStuff,y ; Get OAM index.
LDA $1E02,y ; \ Copy Y position relative to screen Y to OAM Y.
SEC ; |
SBC $1C ; |
STA $0201,x ; /
LDA $1E16,y ; \ Copy X position relative to screen X to OAM X.
SEC ; |
SBC $1A ; |
STA $0200,x ; /
LDA #!FlowerTile ; \ Tile
STA $0202,x ; /
LDA $14
LSR #2
AND #$01
BEQ +
LDA Properties,y
BRA ++
+
LDA PropertiesTwo,y
++
STA $0203,x
PHX
TXA
LSR
LSR
TAX
LDA #$00
STA $0420,x
PLX
LDA $18BF
ORA $1493
BEQ ReturnToTheChocolateWhatever ; Change BEQ to BRA if you don't want it to disappear at generator 2, sprite D2.
LDA $0201,x
CMP #$F0 ; As soon as the sprite is off-screen...
BCC ReturnToTheChocolateWhatever
LDA #$00 ; Kill it.
STA $1892,y ;
ReturnToTheChocolateWhatever:
!SpikeCount = $09 ; Amount of sprites to fall down, -1. Values outside of 00-13 are not recommended.
!ClusterSpriteNum = $09 ; Cluster sprite number
print "INIT ",pc
PHY ; \ Wrapper.
PHB ; |
PHK ; |
PLB ; /
LDY #!SpikeCount
-
LDA #!ClusterSpriteNum
STA $1892,y
LDA InitXY,y ; \ Initial X and Y position of each sprite.
PHA ; | Is relative to screen border.
AND #$F0 ; |
STA $1E16,y ; |
PLA ; |
ASL #4 ; |
STA $1E02,y ; |
DEY ; | Loop until all slots are done.
BPL - ; /
LDA #$01 ; \ Run cluster sprite routine.
STA $18B8 ; /
PLB ;
PLY ;
RTL ; Return.
InitXY:
db $06,$45,$9E,$E2,$A7,$BC,$59,$40,$61,$F5,$D6,$24,$7B,$33,$C6,$0B,$00,$39,$70,$A1
; Initial X and Y position table of sprites.
; Relative to screen border.
; Format: $xy
print "MAIN ",pc
STZ $14C8,x
RTL
SpeedTableY:
db $01,$02,$01,$02,$01,$02,$01,$02,$01,$02,$01,$02,$01,$02,$01,$02,$01,$02,$01,$02 ; Speed table, per sprite. Amount of pixels to move down each frame. 00 = still, 80-FF = rise, 01-7F = sink.
SpeedTableX:
db $FD,$FF,$FE,$FF,$FD,$FF,$FE,$FF,$FD,$FF,$FE,$FF,$FD,$FF,$FE,$FF,$FD,$FF,$FE,$FF ; Speed table, per sprite. Amount of pixels to move down each frame. 00 = still, 80-FF = rise, 01-7F = sink.