;small document about the beams' running code $90AEF3 LDA $0C04,x ;acceleration direction AND #$00F0 BEQ BRANCH_ALPHA ;branch if still "alive" JSR $90ADB7 ;delete beam RTS BRANCH_ALPHA: DEC $0C90,x ;timer for projectile trails BNE + LDA #$0004 STA $0C90,x ;4 frames JSR $90B657 ;trail movement/position LDX $0DDE ;current projectile index + LDA $0C04,x ;accelerating direction AND #$000F ASL a TAY LDA $0BDC,x ;handles acceleration CLC ADC $C353,y ;this is loaded from ROM STA $0BDC,x LDA $0BF0,x CLC ADC $C367,y STA $0BF0,x TYX ;now X holds direction *2 JSR ($AF36,x) ;execute code for indivitual movement directions JSR $B16A ;deletes beam if offscreen RTS @ 90AF36: DW $AF4A ; U DW $AF52 ; UR DW $AF60 ; R DW $AF52 ; DR DW $AF4A ; D DW $AF4A ; D DW $AF52 ; DL DW $AF60 ; L DW $AF52 ; UL DW $AF4A ; U @ 90B657: ;trail spawning routine? { PHB ;push bank LDA $0C18,x ;projectile type BIT #$0F00 BNE ALPHA ;branch if not a beam AND #$003F BRA BETA ALPHA: XBA AND #$000F CMP #$0003 BCS LEAVE ;leave if it's a bomb CLC ADC #$001F BETA: ASL a TAX PEA $7E7E ;set bank to 7E (RAM) PLB PLB ;pull it into the Bank register LDY #$0022 ;maximum of 18 trails onscreen - LDA $D658,y ;find an empty spot in RAM BEQ GAMMA DEY DEY BPL - LEAVE: PLB SEC ;set carry = no trail drawn RTL GAMMA: LDA #$0001 STA $D658,y ;set flag for beam so this spot is used STA $D67C,y ;timer LDA $90B5BB,x ;load special alignment? STA $D6A0,y LDA $90B609,x ;load type of trails? STA $D6C4,y LDX $0DDE JSR $9BA3CC ;finally draw the trail (not going to look into that >_>) PLB CLC ;we have successfully drawn a trail, so get us outta here RTL }