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 rts
.endp .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 .proc point_plot
; ----------------------------------------- ; -----------------------------------------
+48
View File
@@ -142,6 +142,54 @@ lab2
jsr RASTERMUSICTRACKER+3 ;1 play jsr RASTERMUSICTRACKER+3 ;1 play
; ------- RMT ------- ; ------- RMT -------
SkipRMTVBL 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 bit ScrollFlag
bpl EndOfCreditsVBI bpl EndOfCreditsVBI
CreditsVBI CreditsVBI
+4 -4
View File
@@ -45,7 +45,7 @@
dta d"HASTA LA VISTA, BABY!"^ dta d"HASTA LA VISTA, BABY!"^
dta d"THIS IS YOUR BRAIN ON SCORCH."^ dta d"THIS IS YOUR BRAIN ON SCORCH."^
dta d"TAKE THIS!"^ dta d"TAKE THIS!"^
dta d"THIS SCREEN AIN'T BIG ENOUGH FOR THE BOTH OF US."^ dta d"THIS SCREEN AIN'T BIG ENOUGH FOR US."^
dta d"DIE, ALIEN SWINE!"^ dta d"DIE, ALIEN SWINE!"^
dta d"AWRUK!!!"^ dta d"AWRUK!!!"^
dta d"I SHALL OIL MY TURRET WITH YOUR BLOOD."^ dta d"I SHALL OIL MY TURRET WITH YOUR BLOOD."^
@@ -78,12 +78,12 @@
dta d"OH MAN!"^ dta d"OH MAN!"^
dta d"DOOUGH!"^ dta d"DOOUGH!"^
dta d"NEW DAY, NEW BOMB."^ dta d"NEW DAY, NEW BOMB."^
dta d"THIS IS THE END, MY ONLY FRIEND."^ dta d"THIS IS END."^
dta d"VERY FUNNY."^ dta d"VERY FUNNY."^
dta d"THE FAT LADY SANG."^ dta d"THE FAT LADY SANG."^
dta d"WHY DOES EVERYTHING HAPPEN TO ME?"^ dta d"WHY DOES HAPPEN TO ME?"^
dta d"I'M GOING DOWN."^ dta d"I'M GOING DOWN."^
dta d"I'VE GOT A BAD FEELING ABOUT THIS."^ dta d"I'VE GOT A BAD FEELING."^
dta d"CRAPOLA."^ dta d"CRAPOLA."^
dta d"POW!"^ dta d"POW!"^
dta d"BIF!"^ dta d"BIF!"^
+4
View File
@@ -42,6 +42,7 @@ MainGameLoop
jsr RoundInit jsr RoundInit
jsr MainRoundLoop jsr MainRoundLoop
mva #$ff MeteorsFlag
bit escFlag bit escFlag
jvs GoGameOver jvs GoGameOver
bmi START bmi START
@@ -360,6 +361,8 @@ CheckNextTankAD
jsr PutTankNameOnScreen jsr PutTankNameOnScreen
; jsr DisplayStatus ; There is no need anymore, it is always after PutTankNameOnScreen ; jsr DisplayStatus ; There is no need anymore, it is always after PutTankNameOnScreen
mva #0 MeteorsFlag
lda SkillTable,x lda SkillTable,x
beq ManualShooting beq ManualShooting
@@ -392,6 +395,7 @@ ManualShooting
spl:rts ; keys Esc or O spl:rts ; keys Esc or O
AfterManualShooting AfterManualShooting
mva #$ff MeteorsFlag
mva #$00 plot4x4color mva #$00 plot4x4color
jsr DisplayTankNameAbove jsr DisplayTankNameAbove
; defensive weapons without flight handling ; defensive weapons without flight handling
+15 -2
View File
@@ -26,7 +26,7 @@
;--------------------------------------------------- ;---------------------------------------------------
.macro build .macro build
dta d"1.37" ; number of this build (4 bytes) dta d"1.38" ; number of this build (4 bytes)
.endm .endm
.macro RMTSong .macro RMTSong
@@ -37,6 +37,17 @@
;--------------------------------------------------- ;---------------------------------------------------
icl 'definitions.asm' icl 'definitions.asm'
;--------------------------------------------------- ;---------------------------------------------------
AdditionalZPvariables = $20
.zpvar EplotX .word = AdditionalZPvariables
.zpvar EplotByte .word
.zpvar EplotY .byte
.zpvar Mpoint1X .word ; meteor first point X position
.zpvar Mpoint1Y .byte ; meteor first point Y position
.zpvar Mpoint2X .word ; meteor last point X position
.zpvar Mpoint2Y .byte ; meteor last point Y position
.zpvar Mcounter .byte ; meteor length counter ( $ff - no meteor on sky )
.zpvar MeteorsFlag .byte ; $ff - block meteors
FirstZpageVariable = $51 FirstZpageVariable = $51
.zpvar DliColorBack .byte = FirstZpageVariable .zpvar DliColorBack .byte = FirstZpageVariable
@@ -374,7 +385,9 @@ NoRMT_PALchange
lda #$ff ; initial value lda #$ff ; initial value
sta sfx_effect sta sfx_effect
sta Mcounter
sta MeteorsFlag
RMTSong 0 RMTSong 0
.IF TARGET = 5200 .IF TARGET = 5200
BIN
View File
Binary file not shown.
+2 -1
View File
@@ -35,8 +35,9 @@
icl 'definitions.asm' icl 'definitions.asm'
;--------------------------------------------------- ;---------------------------------------------------
FirstZpageVariable = $55 ; $57 FirstZpageVariable = $54 ; $57
.zpvar DliColorBack .byte = FirstZpageVariable .zpvar DliColorBack .byte = FirstZpageVariable
.zpvar MeteorsFlag .byte
.zpvar GradientNr .byte .zpvar GradientNr .byte
.zpvar GradientColors .word .zpvar GradientColors .word
.zpvar WindChangeInRound .byte ; wind change after each turn (not round only) flag - (0 - round only, >0 - each turn) .zpvar WindChangeInRound .byte ; wind change after each turn (not round only) flag - (0 - round only, >0 - each turn)
BIN
View File
Binary file not shown.