mem optimization, nicer explosions

This commit is contained in:
2022-04-27 09:09:07 -04:00
parent 5d86373b98
commit d57a8265db
5 changed files with 21 additions and 50 deletions
+2 -4
View File
@@ -55,12 +55,10 @@ dl ; MAIN game display list
.byte $4f .byte $4f
.word display .word display
:101 .by $0f
:100 .by $0f
.by $0f
.by $4f .by $4f
.wo display+$0ff0 .wo display+$0ff0
:100 .byte $0f ;97 :97 .byte $0f ;1+101+1+97 = 200
.byte $41 .byte $41
.word dl .word dl
;----------------------------------------------- ;-----------------------------------------------
+5 -34
View File
@@ -443,41 +443,12 @@ clearscreen .proc
;-------------------------------------------------- ;--------------------------------------------------
lda #0 lda #0
tax tax
Loopi1 @
sta display,x :31 sta display+($100*#),x
sta display+$100,x sta display+$1e50,x ; this is so no space outside of the screen is cleared
sta display+$200,x ; of course we are clearing $100 instead of $50, but who cares :]
sta display+$300,x
sta display+$400,x
sta display+$500,x
sta display+$600,x
sta display+$700,x
sta display+$800,x
sta display+$900,x
sta display+$a00,x
sta display+$b00,x
sta display+$c00,x
sta display+$d00,x
sta display+$e00,x
sta display+$f00,x
sta display+$1000,x
sta display+$1100,x
sta display+$1200,x
sta display+$1300,x
sta display+$1400,x
sta display+$1500,x
sta display+$1600,x
sta display+$1700,x
sta display+$1800,x
sta display+$1900,x
sta display+$1a00,x
sta display+$1b00,x
sta display+$1c00,x
sta display+$1d00,x
sta display+$1e00,x
sta display+$1f00,x
inx inx
bne Loopi1 bne @-
rts rts
.endp .endp
;-------------------------------*------------------ ;-------------------------------*------------------
+4 -6
View File
@@ -81,16 +81,14 @@ displayposition = modify
icl 'artwork/HIMARS14.asm' icl 'artwork/HIMARS14.asm'
;Game loading address ;Game loading address
ORG $3010 ;must be $2K after screen, because screen cleaning erases $2K ORG $3000
WeaponFont
ins 'artwork/weapons_AW4.fnt' ; 'artwork/weapons.fnt'
;----------------------------------------------- ;-----------------------------------------------
;Screen displays go first to avoid crossing 4kb barrier ;Screen displays go here to avoid crossing 4kb barrier
;----------------------------------------------- ;-----------------------------------------------
icl 'display.asm' icl 'display.asm'
;---------------------------------------------- ;----------------------------------------------
.ALIGN $400
WeaponFont
ins 'artwork/weapons_AW4.fnt' ; 'artwork/weapons.fnt'
;-------------------------------------------------- ;--------------------------------------------------
; Game Code ; Game Code
BIN
View File
Binary file not shown.
+10 -6
View File
@@ -549,16 +549,20 @@ ExplosionLoop
lda radius lda radius
cmp ExplosionRadius cmp ExplosionRadius
bcc ExplosionLoop bcc ExplosionLoop
lda #0
sta color ldx #0
stx color
inx
stx radius
ExplosionLoop2 ExplosionLoop2
jsr circle jsr circle
dec radius inc radius
lda radius lda radius
bne ExplosionLoop2 cmp ExplosionRadius
lda #1 bcc ExplosionLoop2
sta color
mva #1 color
;check tanks' distance from the centre of the explosion ;check tanks' distance from the centre of the explosion
mwa #DrawLen DrawJumpAddr mwa #DrawLen DrawJumpAddr