mirror of
https://github.com/Pecusx/scorch_src.git
synced 2026-05-20 22:33:43 +02:00
Battery lottery
This commit is contained in:
+32
-24
@@ -625,30 +625,8 @@ NextPlayerShoots
|
|||||||
SeteXistenZ
|
SeteXistenZ
|
||||||
lda Energy,x
|
lda Energy,x
|
||||||
sta eXistenZ,x
|
sta eXistenZ,x
|
||||||
sta L1
|
|
||||||
|
jsr MaxForceCalculate
|
||||||
;DATA L1,L2
|
|
||||||
;Multiplication 8bit*8bit,
|
|
||||||
;result 16bit
|
|
||||||
;this algiorithm is a little longer than one in Ruszczyc 6502 book
|
|
||||||
;but it is faster
|
|
||||||
|
|
||||||
LDy #8
|
|
||||||
LDA #0
|
|
||||||
CLC
|
|
||||||
LP0
|
|
||||||
ror
|
|
||||||
ROR L1
|
|
||||||
BCC B0
|
|
||||||
CLC
|
|
||||||
ADC #10 ; (L2) multiplication by 10
|
|
||||||
B0 DEY
|
|
||||||
BNE LP0
|
|
||||||
ror
|
|
||||||
ROR L1
|
|
||||||
STA MaxForceTableH,x
|
|
||||||
lda L1
|
|
||||||
sta MaxForceTableL,x
|
|
||||||
|
|
||||||
dex
|
dex
|
||||||
bpl SeteXistenZ
|
bpl SeteXistenZ
|
||||||
@@ -908,7 +886,37 @@ NotNegativeShieldEnergy
|
|||||||
.endr
|
.endr
|
||||||
@ rts
|
@ rts
|
||||||
.endp
|
.endp
|
||||||
|
;--------------------------------------------------
|
||||||
|
.proc MaxForceCalculate
|
||||||
|
; calculates max force for tank (tanknr in X)
|
||||||
|
; Energy of tank X in A
|
||||||
|
;--------------------------------------------------
|
||||||
|
sta L1
|
||||||
|
|
||||||
|
;DATA L1,L2
|
||||||
|
;Multiplication 8bit*8bit,
|
||||||
|
;result 16bit
|
||||||
|
;this algiorithm is a little longer than one in Ruszczyc 6502 book
|
||||||
|
;but it is faster
|
||||||
|
|
||||||
|
LDy #8
|
||||||
|
LDA #0
|
||||||
|
CLC
|
||||||
|
LP0
|
||||||
|
ror
|
||||||
|
ROR L1
|
||||||
|
BCC B0
|
||||||
|
CLC
|
||||||
|
ADC #10 ; (L2) multiplication by 10
|
||||||
|
B0 DEY
|
||||||
|
BNE LP0
|
||||||
|
ror
|
||||||
|
ROR L1
|
||||||
|
STA MaxForceTableH,x
|
||||||
|
lda L1
|
||||||
|
sta MaxForceTableL,x
|
||||||
|
rts
|
||||||
|
.endp
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc PMoutofScreen
|
.proc PMoutofScreen
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
|
|||||||
BIN
Binary file not shown.
+2
-1
@@ -835,7 +835,8 @@ invSelectDef
|
|||||||
; if activate battery, we do it differently
|
; if activate battery, we do it differently
|
||||||
mva #sfx_battery sfx_effect
|
mva #sfx_battery sfx_effect
|
||||||
mva #99 Energy,x
|
mva #99 Energy,x
|
||||||
bne DecreaseDefensive ; bypass activation
|
jsr MaxForceCalculate
|
||||||
|
jmp DecreaseDefensive ; bypass activation
|
||||||
NotBattery
|
NotBattery
|
||||||
cmp #ind_Long_Barrel____
|
cmp #ind_Long_Barrel____
|
||||||
bne NotBarrel
|
bne NotBarrel
|
||||||
|
|||||||
Reference in New Issue
Block a user