mirror of
https://github.com/Pecusx/scorch_src.git
synced 2026-05-20 22:33:43 +02:00
Napalm and Diggers optimizations (TypeChar)
This commit is contained in:
@@ -402,6 +402,18 @@ NoClearTanks
|
||||
; in: CharCode
|
||||
; in: left LOWER corner of the char coordinates (xdraw, ydraw)
|
||||
;--------------------------------------------------
|
||||
; check coordinates
|
||||
cpw xdraw #(screenwidth-7)
|
||||
bcs CharOffTheScreen
|
||||
lda ydraw
|
||||
cmp #7
|
||||
bcc CharOffTheScreen
|
||||
cmp #(screenHeight-1)
|
||||
bcc CharOnTheScreen
|
||||
CharOffTheScreen
|
||||
rts
|
||||
CharOnTheScreen
|
||||
Fast ; Put char without coordinates check!
|
||||
; char to the table
|
||||
lda CharCode
|
||||
sta fontind
|
||||
@@ -560,6 +572,7 @@ EndPutChar
|
||||
jcs TypeChar.EndPutChar ;nearest RTS
|
||||
; checks ommited.
|
||||
; char to the table
|
||||
Fast ; Put char without coordinates check!
|
||||
lda CharCode4x4
|
||||
and #%00000001
|
||||
beq Upper4bits ; A=0
|
||||
|
||||
@@ -303,6 +303,18 @@ NoMountain
|
||||
; in: CharCode
|
||||
; in: left LOWER corner of the char coordinates (xdraw, ydraw)
|
||||
;--------------------------------------------------
|
||||
; check coordinates
|
||||
cpw xdraw #(screenwidth-7)
|
||||
bcs CharOffTheScreen
|
||||
lda ydraw
|
||||
cmp #7
|
||||
bcc CharOffTheScreen
|
||||
cmp #(screenHeight-1)
|
||||
bcc CharOnTheScreen
|
||||
CharOffTheScreen
|
||||
rts
|
||||
CharOnTheScreen
|
||||
Fast ; Put char without coordinates check!
|
||||
; char to the table
|
||||
lda CharCode
|
||||
sta fontind
|
||||
@@ -456,6 +468,7 @@ EndPutChar
|
||||
jcs TypeChar.EndPutChar ;nearest RTS
|
||||
; checks ommited.
|
||||
; char to the table
|
||||
Fast ; Put char without coordinates check!
|
||||
lda CharCode4x4
|
||||
and #%00000001
|
||||
beq Upper4bits ; A=0
|
||||
|
||||
Binary file not shown.
+1
-1
@@ -638,7 +638,7 @@ CreditsStart
|
||||
dta d" "*
|
||||
dta d"Ideas, help and QA"^
|
||||
dta d"Bocianu, Probabilitydragon,"^
|
||||
dta d"EnderDude, Dracon,"^
|
||||
dta d"EnderDude, Dracon, TDC,"^
|
||||
dta d"Beeblebrox, KrzysRog, lopezpb,"^
|
||||
dta d"brad-colbert, archon800, nowy80,"^
|
||||
dta d"Shaggy the Atarian, RetroBorsuk, ZPH"
|
||||
|
||||
+3
-3
@@ -660,7 +660,7 @@ DrawTankNrX
|
||||
ldx tanknr
|
||||
jsr SetupXYdraw
|
||||
|
||||
jsr TypeChar
|
||||
jsr TypeChar.Fast
|
||||
lda Erase
|
||||
jne noTankNoPM
|
||||
; now P/M graphics on the screen (only for 5 tanks)
|
||||
@@ -787,7 +787,7 @@ DrawTankFlag
|
||||
sec
|
||||
sbc #8
|
||||
sta ydraw
|
||||
jsr TypeChar
|
||||
jsr TypeChar.Fast
|
||||
NoShieldDraw
|
||||
BarrelChange
|
||||
ldy #$01
|
||||
@@ -925,7 +925,7 @@ tankflash_loop
|
||||
sbc #8
|
||||
sta ydraw
|
||||
jsr SetupXYdraw.X
|
||||
jsr TypeChar
|
||||
jsr TypeChar.Fast
|
||||
ToHighToParachute
|
||||
ldx TankNr
|
||||
rts
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
|
||||
;---------------------------------------------------
|
||||
.macro build
|
||||
dta d"1.31" ; number of this build (4 bytes)
|
||||
dta d"1.32" ; number of this build (4 bytes)
|
||||
.endm
|
||||
|
||||
.macro RMTSong
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+1
-1
@@ -24,7 +24,7 @@
|
||||
|
||||
;---------------------------------------------------
|
||||
.macro build
|
||||
dta d"1.28" ; number of this build (4 bytes)
|
||||
dta d"1.32" ; number of this build (4 bytes)
|
||||
.endm
|
||||
|
||||
.macro RMTSong
|
||||
|
||||
Binary file not shown.
+1
-34
@@ -294,16 +294,7 @@ LastNapalmRepeat
|
||||
lda #char_clear_flame ; clear flame symbol
|
||||
PutFlameChar
|
||||
sta CharCode
|
||||
; check coordinates
|
||||
cpw xdraw #(screenwidth-7)
|
||||
bcs CharOffTheScreen
|
||||
lda ydraw
|
||||
cmp #7
|
||||
bcc CharOffTheScreen
|
||||
cmp #(screenHeight-1)
|
||||
bcs CharOffTheScreen
|
||||
jsr TypeChar
|
||||
CharOffTheScreen
|
||||
adw xdraw #5 ; reverse half character correction (4 px - we need positon of character center) and next char 1 pixels to righ
|
||||
inc magic+1
|
||||
lda magic+1
|
||||
@@ -443,8 +434,7 @@ WriteToBranches
|
||||
sta digtabyH,x
|
||||
dex
|
||||
bpl WriteToBranches
|
||||
;jsr DiggerCharacter ; start character ; No memory to check Y range! Let's not draw this char - fix for very high mountans
|
||||
|
||||
jsr DiggerCharacter ; start character
|
||||
adw xdraw #4
|
||||
lda DigLong
|
||||
; looks strange, but it is (DigLong+2)*4
|
||||
@@ -503,29 +493,6 @@ DigUp
|
||||
; sbc #$00
|
||||
@ ; sta digtabyH,x
|
||||
DigCalculateNext
|
||||
;second crashing bug here :) - if too much subtracted from digtaby, it gets under 8 (char height) and starts writing over random areas
|
||||
lda digtabyH,x
|
||||
bmi ToHigh
|
||||
; cmp #0 ; necessary only if screenheight > 255
|
||||
; bne @+
|
||||
lda digtabyL,x
|
||||
cmp #7
|
||||
;@
|
||||
bcs CheckLow
|
||||
ToHigh
|
||||
lda #0
|
||||
sta digtabyH,x
|
||||
lda #7
|
||||
sta digtabyL,x
|
||||
CheckLow
|
||||
;crashing bug here - if too much added to digtaby, it gets over screenheight and starts writing over random areas
|
||||
;WARNING! fix for 1 byte screenheight. TODO
|
||||
lda digtabyL,x
|
||||
cmp #screenheight
|
||||
bcc @+ ; branch if less
|
||||
lda #screenheight-1
|
||||
sta digtabyL,x
|
||||
@
|
||||
dex
|
||||
bpl CalculateBranches
|
||||
; here we draw...
|
||||
|
||||
Reference in New Issue
Block a user