mirror of
https://github.com/Pecusx/scorch_src.git
synced 2026-05-20 22:33:43 +02:00
ExplosionRange variable is now really one byte long. :)
This commit is contained in:
+2
-2
@@ -26,7 +26,7 @@
|
||||
;---------------------------------------------------
|
||||
icl 'definitions.asm'
|
||||
;---------------------------------------------------
|
||||
FirstZpageVariable = $60
|
||||
FirstZpageVariable = $61
|
||||
.zpvar DliColorBack .byte = FirstZpageVariable
|
||||
.zpvar JoystickNumber .byte
|
||||
.zpvar xdraw .word ;= $64 ;variable X for plot
|
||||
@@ -87,7 +87,7 @@ FirstZpageVariable = $60
|
||||
.zpvar decimal .word
|
||||
.zpvar NumberOfPlayers .byte ;current number of players (counted from 1)
|
||||
.zpvar Counter .byte ;temporary Counter for outside loops
|
||||
.zpvar ExplosionRadius .word ;because when adding in xdraw it is double byte
|
||||
.zpvar ExplosionRadius .byte
|
||||
.zpvar ResultY .byte
|
||||
.zpvar xcircle .word
|
||||
.zpvar ycircle .word
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+25
-5
@@ -3008,14 +3008,34 @@ CalculateExplosionRange0
|
||||
;calculates total horizontal range of explosion by
|
||||
;"summing up" ranges of all separate explosions
|
||||
|
||||
adw xdraw ExplosionRadius WeaponRangeRight
|
||||
cpw WeaponRangeRight #screenwidth-1
|
||||
bcc NotOutOfTheScreenRight
|
||||
; WeaponRangeRight = xdraw + ExplosionRadius
|
||||
clc
|
||||
lda xdraw
|
||||
adc ExplosionRadius
|
||||
sta WeaponRangeRight
|
||||
lda xdraw+1
|
||||
adc #$00
|
||||
sta WeaponRangeRight+1
|
||||
; adw xdraw ExplosionRadius WeaponRangeRight ; Pozor! ExplosionRadius is one byte now
|
||||
; cpw WeaponRangeRight #screenwidth-1
|
||||
cmp #>(screenwidth-1)
|
||||
bne @+
|
||||
lda WeaponRangeRight
|
||||
cmp #<(screenwidth-1)
|
||||
@ bcc NotOutOfTheScreenRight
|
||||
mwa #screenwidth-1 WeaponRangeRight
|
||||
|
||||
NotOutOfTheScreenRight
|
||||
sbw xdraw ExplosionRadius WeaponRangeLeft
|
||||
lda WeaponRangeLeft+1
|
||||
; WeaponRangeLeft = xdraw - ExplosionRadius
|
||||
sec
|
||||
lda xdraw
|
||||
sbc ExplosionRadius
|
||||
sta WeaponRangeLeft
|
||||
lda xdraw+1
|
||||
sbc #$00
|
||||
sta WeaponRangeLeft+1
|
||||
; sbw xdraw ExplosionRadius WeaponRangeLeft ; Pozor! ExplosionRadius is one byte now
|
||||
; lda WeaponRangeLeft+1
|
||||
bpl NotOutOfTheScreenLeft
|
||||
lda #0
|
||||
sta WeaponRangeLeft
|
||||
|
||||
Reference in New Issue
Block a user