Meteors added :)

This commit is contained in:
Pecusx
2023-09-03 15:47:45 +02:00
parent d716e02e12
commit f701ef3227
8 changed files with 103 additions and 7 deletions
+30
View File
@@ -161,6 +161,36 @@ ClearPlot
rts
.endp
; -----------------------------------------
.proc ExPlot ;ExPlot (EplotX, EplotY)
; EOR plot:
; Inverts color of a pixel
; Note: No coordinate control!!!
; With off-screen coordinates, it can damage main program.
; -----------------------------------------
; let's calculate coordinates from xdraw and ydraw
;xbyte = xbyte/8
lda EplotX+1
lsr
lda EplotX
ror ;just one bit over 256. Max screenwidth = 512!!!
lsr
lsr
sta EplotByte
;---
ldx EplotY
ldy linetableL,x
lda linetableH,x
sta EplotByte+1
ldx EplotX ; optimization (256 bytes long bittable)
lda (EplotByte),y
eor bittable1_long,x
sta (EplotByte),y
rts
.endp
; -----------------------------------------
.proc point_plot
; -----------------------------------------
+48
View File
@@ -142,6 +142,54 @@ lab2
jsr RASTERMUSICTRACKER+3 ;1 play
; ------- RMT -------
SkipRMTVBL
; ------ meteors ------ start
bit Mcounter
bpl MeteorOnSky
bit MeteorsFlag
bmi SkipMeteors
; randomize meteor
lda random
and #%11111111
bne SkipMeteors
lda random
sta Mpoint1X
sta Mpoint2X
lda #0
sta Mpoint1X+1
sta Mpoint2X+1
lda random
and #$1f
sta Mpoint1Y
sta Mpoint2Y
mva #10 Mcounter
MeteorOnSky
lda Mpoint1Y
cmp #64
beq NoFirstPlot
sta EplotY
inc Mpoint1Y
mwa Mpoint1X EplotX
inw Mpoint1X
jsr Explot
NoFirstPlot
lda Mcounter
beq @+
dec Mcounter
bpl SkipSecondPlot
@ lda Mpoint2Y
cmp #64
bne GoSecondPlot
mva #$ff Mcounter
bmi SkipMeteors
GoSecondPlot
sta EplotY
inc Mpoint2Y
mwa Mpoint2X EplotX
inw Mpoint2X
jsr Explot
SkipSecondPlot
SkipMeteors
; ------ meteors ------ end
bit ScrollFlag
bpl EndOfCreditsVBI
CreditsVBI