mirror of
https://github.com/pkali/scorch_src.git
synced 2026-05-21 06:39:46 +02:00
C64 Nulear Winter works natively
This commit is contained in:
+94
-2
@@ -608,9 +608,101 @@ next8lines
|
||||
sta $0700,x
|
||||
inx
|
||||
bne @-
|
||||
|
||||
|
||||
rts
|
||||
.endp
|
||||
;--------------------------------------------------
|
||||
|
||||
|
||||
; ******* This is weapon .... but ... *******
|
||||
; -------------------------------------------------
|
||||
.proc AtomicWinter
|
||||
; -------------------------------------------------
|
||||
; This routine is run from inside of the main loop
|
||||
; and replaces Shoot and Flight routines
|
||||
; X and TankNr - index of shooting tank
|
||||
; -------------------------------------------------
|
||||
mva #sfx_sandhog sfx_effect
|
||||
.IF FASTER_GRAF_PROCS = 1
|
||||
mvy #0 magic ; byte counter (from 0 to 39)
|
||||
NextColumn
|
||||
; big loop - we repat internal loops for each column of bytes
|
||||
ldx #120 ; line counter (from 0 to 60 )
|
||||
; first loop - inverse column of bytes for a while
|
||||
NextLine1
|
||||
jsr InverseScreenByte
|
||||
dex
|
||||
dex
|
||||
bpl NextLine1
|
||||
;
|
||||
jsr WaitOneFrame ; wait uses A only
|
||||
; second loop - inverse again and put random "snow" to column of bytes
|
||||
ldx #120
|
||||
mva #$55 magic+1
|
||||
NextLine2
|
||||
jsr InverseScreenByte
|
||||
lda random
|
||||
ora magic+1
|
||||
and (temp),y
|
||||
sta (temp),y
|
||||
lda magic+1
|
||||
eor #$ff
|
||||
sta magic+1
|
||||
dex
|
||||
dex
|
||||
bpl NextLine2
|
||||
; and go to next column
|
||||
inc magic
|
||||
ldy magic
|
||||
cpy #40
|
||||
bne NextColumn
|
||||
.ELSE
|
||||
mva #1 color
|
||||
mwa #120 ydraw
|
||||
NextLineSlow
|
||||
lda #0
|
||||
sta xdraw
|
||||
sta xdraw+1
|
||||
NextPixelSlow
|
||||
bit random
|
||||
bpl NoPlot
|
||||
bvc NoPlot
|
||||
jsr plot.MakePlot
|
||||
NoPlot
|
||||
inw xdraw
|
||||
cpw xdraw #screenwidth
|
||||
bne NextPixelSlow
|
||||
dec ydraw
|
||||
dec ydraw
|
||||
bpl NextLineSlow
|
||||
.ENDIF
|
||||
; and we have "snow" :)
|
||||
lda #0
|
||||
ldx TankNr
|
||||
sta ActiveDefenceWeapon,x ; deactivate Nuclear Winter
|
||||
jsr SetFullScreenSoilRange
|
||||
jsr SoilDown2.NoClearTanks
|
||||
rts
|
||||
|
||||
; in order to optimize the fragment repeated in both internal loops
|
||||
; we save 15 bytes :)
|
||||
InverseScreenByte
|
||||
ldy magic
|
||||
sty temp
|
||||
ldy #0
|
||||
sty temp+1
|
||||
aslw temp
|
||||
rolw temp
|
||||
rolw temp
|
||||
lda temp
|
||||
adc LineTableL,x
|
||||
sta temp
|
||||
lda LineTableH,x
|
||||
adc temp+1
|
||||
sta temp+1
|
||||
lda (temp),y
|
||||
eor #$ff
|
||||
sta (temp),y
|
||||
rts
|
||||
.endp
|
||||
|
||||
.ENDIF
|
||||
Reference in New Issue
Block a user