mirror of
https://github.com/Pecusx/scorch_src.git
synced 2026-05-21 21:34:20 +02:00
Napalm and Diggers optimizations (TypeChar)
This commit is contained in:
@@ -402,6 +402,18 @@ NoClearTanks
|
|||||||
; in: CharCode
|
; in: CharCode
|
||||||
; in: left LOWER corner of the char coordinates (xdraw, ydraw)
|
; 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
|
; char to the table
|
||||||
lda CharCode
|
lda CharCode
|
||||||
sta fontind
|
sta fontind
|
||||||
@@ -560,6 +572,7 @@ EndPutChar
|
|||||||
jcs TypeChar.EndPutChar ;nearest RTS
|
jcs TypeChar.EndPutChar ;nearest RTS
|
||||||
; checks ommited.
|
; checks ommited.
|
||||||
; char to the table
|
; char to the table
|
||||||
|
Fast ; Put char without coordinates check!
|
||||||
lda CharCode4x4
|
lda CharCode4x4
|
||||||
and #%00000001
|
and #%00000001
|
||||||
beq Upper4bits ; A=0
|
beq Upper4bits ; A=0
|
||||||
|
|||||||
@@ -303,6 +303,18 @@ NoMountain
|
|||||||
; in: CharCode
|
; in: CharCode
|
||||||
; in: left LOWER corner of the char coordinates (xdraw, ydraw)
|
; 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
|
; char to the table
|
||||||
lda CharCode
|
lda CharCode
|
||||||
sta fontind
|
sta fontind
|
||||||
@@ -456,6 +468,7 @@ EndPutChar
|
|||||||
jcs TypeChar.EndPutChar ;nearest RTS
|
jcs TypeChar.EndPutChar ;nearest RTS
|
||||||
; checks ommited.
|
; checks ommited.
|
||||||
; char to the table
|
; char to the table
|
||||||
|
Fast ; Put char without coordinates check!
|
||||||
lda CharCode4x4
|
lda CharCode4x4
|
||||||
and #%00000001
|
and #%00000001
|
||||||
beq Upper4bits ; A=0
|
beq Upper4bits ; A=0
|
||||||
|
|||||||
Binary file not shown.
+1
-1
@@ -638,7 +638,7 @@ CreditsStart
|
|||||||
dta d" "*
|
dta d" "*
|
||||||
dta d"Ideas, help and QA"^
|
dta d"Ideas, help and QA"^
|
||||||
dta d"Bocianu, Probabilitydragon,"^
|
dta d"Bocianu, Probabilitydragon,"^
|
||||||
dta d"EnderDude, Dracon,"^
|
dta d"EnderDude, Dracon, TDC,"^
|
||||||
dta d"Beeblebrox, KrzysRog, lopezpb,"^
|
dta d"Beeblebrox, KrzysRog, lopezpb,"^
|
||||||
dta d"brad-colbert, archon800, nowy80,"^
|
dta d"brad-colbert, archon800, nowy80,"^
|
||||||
dta d"Shaggy the Atarian, RetroBorsuk, ZPH"
|
dta d"Shaggy the Atarian, RetroBorsuk, ZPH"
|
||||||
|
|||||||
+3
-3
@@ -660,7 +660,7 @@ DrawTankNrX
|
|||||||
ldx tanknr
|
ldx tanknr
|
||||||
jsr SetupXYdraw
|
jsr SetupXYdraw
|
||||||
|
|
||||||
jsr TypeChar
|
jsr TypeChar.Fast
|
||||||
lda Erase
|
lda Erase
|
||||||
jne noTankNoPM
|
jne noTankNoPM
|
||||||
; now P/M graphics on the screen (only for 5 tanks)
|
; now P/M graphics on the screen (only for 5 tanks)
|
||||||
@@ -787,7 +787,7 @@ DrawTankFlag
|
|||||||
sec
|
sec
|
||||||
sbc #8
|
sbc #8
|
||||||
sta ydraw
|
sta ydraw
|
||||||
jsr TypeChar
|
jsr TypeChar.Fast
|
||||||
NoShieldDraw
|
NoShieldDraw
|
||||||
BarrelChange
|
BarrelChange
|
||||||
ldy #$01
|
ldy #$01
|
||||||
@@ -925,7 +925,7 @@ tankflash_loop
|
|||||||
sbc #8
|
sbc #8
|
||||||
sta ydraw
|
sta ydraw
|
||||||
jsr SetupXYdraw.X
|
jsr SetupXYdraw.X
|
||||||
jsr TypeChar
|
jsr TypeChar.Fast
|
||||||
ToHighToParachute
|
ToHighToParachute
|
||||||
ldx TankNr
|
ldx TankNr
|
||||||
rts
|
rts
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
;---------------------------------------------------
|
;---------------------------------------------------
|
||||||
.macro build
|
.macro build
|
||||||
dta d"1.31" ; number of this build (4 bytes)
|
dta d"1.32" ; number of this build (4 bytes)
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro RMTSong
|
.macro RMTSong
|
||||||
|
|||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+1
-1
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
;---------------------------------------------------
|
;---------------------------------------------------
|
||||||
.macro build
|
.macro build
|
||||||
dta d"1.28" ; number of this build (4 bytes)
|
dta d"1.32" ; number of this build (4 bytes)
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro RMTSong
|
.macro RMTSong
|
||||||
|
|||||||
Binary file not shown.
+1
-34
@@ -294,16 +294,7 @@ LastNapalmRepeat
|
|||||||
lda #char_clear_flame ; clear flame symbol
|
lda #char_clear_flame ; clear flame symbol
|
||||||
PutFlameChar
|
PutFlameChar
|
||||||
sta CharCode
|
sta CharCode
|
||||||
; check coordinates
|
|
||||||
cpw xdraw #(screenwidth-7)
|
|
||||||
bcs CharOffTheScreen
|
|
||||||
lda ydraw
|
|
||||||
cmp #7
|
|
||||||
bcc CharOffTheScreen
|
|
||||||
cmp #(screenHeight-1)
|
|
||||||
bcs CharOffTheScreen
|
|
||||||
jsr TypeChar
|
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
|
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
|
inc magic+1
|
||||||
lda magic+1
|
lda magic+1
|
||||||
@@ -443,8 +434,7 @@ WriteToBranches
|
|||||||
sta digtabyH,x
|
sta digtabyH,x
|
||||||
dex
|
dex
|
||||||
bpl WriteToBranches
|
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
|
adw xdraw #4
|
||||||
lda DigLong
|
lda DigLong
|
||||||
; looks strange, but it is (DigLong+2)*4
|
; looks strange, but it is (DigLong+2)*4
|
||||||
@@ -503,29 +493,6 @@ DigUp
|
|||||||
; sbc #$00
|
; sbc #$00
|
||||||
@ ; sta digtabyH,x
|
@ ; sta digtabyH,x
|
||||||
DigCalculateNext
|
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
|
dex
|
||||||
bpl CalculateBranches
|
bpl CalculateBranches
|
||||||
; here we draw...
|
; here we draw...
|
||||||
|
|||||||
Reference in New Issue
Block a user