mirror of
https://github.com/Pecusx/scorch_src.git
synced 2026-05-20 22:33:43 +02:00
Long (generated) bittables for fastest plot and point
This commit is contained in:
+30
-15
@@ -52,9 +52,10 @@ MakeUnPlot
|
||||
sta xbyte+1
|
||||
sta oldplot+1
|
||||
|
||||
lda xdraw
|
||||
and #$7
|
||||
tax
|
||||
; lda xdraw
|
||||
; and #$7
|
||||
; tax
|
||||
ldx xdraw ; optimization (256 bytes long bittable)
|
||||
|
||||
lda color
|
||||
bne ClearUnPlot
|
||||
@@ -62,13 +63,13 @@ MakeUnPlot
|
||||
;plotting here
|
||||
lda (xbyte),y
|
||||
sta OldOraTemp
|
||||
ora bittable,x
|
||||
ora bittable1_long,x
|
||||
sta (xbyte),y
|
||||
bne ContinueUnPlot ; allways <>0
|
||||
ClearUnPlot
|
||||
lda (xbyte),y
|
||||
sta OldOraTemp
|
||||
and bittable2,x
|
||||
and bittable2_long,x
|
||||
sta (xbyte),y
|
||||
ContinueUnPlot
|
||||
ldx WhichUnPlot
|
||||
@@ -140,20 +141,22 @@ MakePlot
|
||||
lda linetableH,x
|
||||
sta xbyte+1
|
||||
|
||||
lda xdraw
|
||||
and #$7
|
||||
tax
|
||||
; lda xdraw
|
||||
; and #$7
|
||||
; tax
|
||||
ldx xdraw ; optimization (256 bytes long bittable)
|
||||
|
||||
lda color
|
||||
bne ClearPlot
|
||||
|
||||
lda (xbyte),y
|
||||
ora bittable,x
|
||||
ora bittable1_long,x
|
||||
sta (xbyte),y
|
||||
EndOfPlot
|
||||
rts
|
||||
ClearPlot
|
||||
lda (xbyte),y
|
||||
and bittable2,x
|
||||
and bittable2_long,x
|
||||
sta (xbyte),y
|
||||
rts
|
||||
.endp
|
||||
@@ -180,13 +183,14 @@ ClearPlot
|
||||
lda linetableH,x
|
||||
sta xbyte+1
|
||||
|
||||
lda xdraw
|
||||
and #$7
|
||||
tax
|
||||
; lda xdraw
|
||||
; and #$7
|
||||
; tax
|
||||
ldx xdraw ; optimization (256 bytes long bittable)
|
||||
|
||||
lda (xbyte),y
|
||||
eor #$ff
|
||||
and bittable,x
|
||||
and bittable1_long,x
|
||||
rts
|
||||
.endp
|
||||
;--------------------------------------------------
|
||||
@@ -247,7 +251,7 @@ MinCalculated
|
||||
; because one pixel is already plotted (and who cares? :) )
|
||||
@
|
||||
lda (xbyte),y
|
||||
and bittable2,x
|
||||
and bittable2_long,x
|
||||
sta (xbyte),y
|
||||
;IntoDraw
|
||||
adw xbyte #screenBytes
|
||||
@@ -752,6 +756,17 @@ loop sta (temp),y
|
||||
iny
|
||||
cpy #screenheight+1
|
||||
bne @-
|
||||
; and bittables for fastes plot and point
|
||||
ldy #0
|
||||
@ tya
|
||||
and #%00000111
|
||||
tax
|
||||
lda bittable,x
|
||||
sta bittable1_long,y
|
||||
eor #%11111111
|
||||
sta bittable2_long,y
|
||||
iny
|
||||
bne @-
|
||||
rts
|
||||
.endp
|
||||
;--------------------------------------------------
|
||||
|
||||
+32
-15
@@ -44,9 +44,11 @@ MakeUnPlot
|
||||
sta xbyte+1
|
||||
sta oldplot+1
|
||||
|
||||
lda xdraw
|
||||
and #$7
|
||||
tax
|
||||
; lda xdraw
|
||||
; and #$7
|
||||
; tax
|
||||
ldx xdraw ; optimization (256 bytes long bittable)
|
||||
|
||||
ldy #0
|
||||
|
||||
lda color
|
||||
@@ -55,13 +57,13 @@ MakeUnPlot
|
||||
;plotting here
|
||||
lda (xbyte),y
|
||||
sta OldOraTemp
|
||||
ora bittable,x
|
||||
ora bittable1_long,x
|
||||
sta (xbyte),y
|
||||
bne ContinueUnPlot ; allways <>0
|
||||
ClearUnPlot
|
||||
lda (xbyte),y
|
||||
sta OldOraTemp
|
||||
and bittable2,x
|
||||
and bittable2_long,x
|
||||
sta (xbyte),y
|
||||
ContinueUnPlot
|
||||
ldx WhichUnPlot
|
||||
@@ -128,21 +130,23 @@ MakePlot
|
||||
adc xdraw+1
|
||||
sta xbyte+1
|
||||
|
||||
lda xdraw
|
||||
and #$7
|
||||
tax
|
||||
; lda xdraw
|
||||
; and #$7
|
||||
; tax
|
||||
ldx xdraw ; optimization (256 bytes long bittable)
|
||||
|
||||
ldy #0
|
||||
lda color
|
||||
bne ClearPlot
|
||||
|
||||
lda (xbyte),y
|
||||
ora bittable,x
|
||||
ora bittable1_long,x
|
||||
sta (xbyte),y
|
||||
EndOfPlot
|
||||
rts
|
||||
ClearPlot
|
||||
lda (xbyte),y
|
||||
and bittable2,x
|
||||
and bittable2_long,x
|
||||
sta (xbyte),y
|
||||
rts
|
||||
.endp
|
||||
@@ -167,13 +171,15 @@ ClearPlot
|
||||
adc xdraw+1
|
||||
sta xbyte+1
|
||||
|
||||
lda xdraw
|
||||
and #$7
|
||||
tax
|
||||
; lda xdraw
|
||||
; and #$7
|
||||
; tax
|
||||
ldx xdraw ; optimization (256 bytes long bittable)
|
||||
|
||||
ldy #0
|
||||
lda (xbyte),y
|
||||
eor #$ff
|
||||
and bittable,x
|
||||
and bittable1_long,x
|
||||
rts
|
||||
.endp
|
||||
;--------------------------------------------------
|
||||
@@ -228,7 +234,7 @@ MinCalculated
|
||||
clc ; and faster
|
||||
@
|
||||
lda (xbyte),y
|
||||
and bittable2,x
|
||||
and bittable2_long,x
|
||||
sta (xbyte),y
|
||||
;IntoDraw
|
||||
inc ydraw
|
||||
@@ -653,6 +659,17 @@ next8lines
|
||||
iny
|
||||
cpy #screenheight+1
|
||||
bne @-
|
||||
; and bittables for fastes plot and point
|
||||
ldy #0
|
||||
@ tya
|
||||
and #%00000111
|
||||
tax
|
||||
lda bittable,x
|
||||
sta bittable1_long,y
|
||||
eor #%11111111
|
||||
sta bittable2_long,y
|
||||
iny
|
||||
bne @-
|
||||
rts
|
||||
.endp
|
||||
;--------------------------------------------------
|
||||
|
||||
@@ -872,10 +872,10 @@ PurchaseAIRoutines
|
||||
sta temp+1
|
||||
:3 lsr ; A=A/8
|
||||
sta temp
|
||||
tya
|
||||
and #%00000111
|
||||
tay
|
||||
lda bittable,y
|
||||
; tya ; optimization (256 bytes long bittable)
|
||||
; and #%00000111
|
||||
; tay
|
||||
lda bittable1_long,y
|
||||
ldy temp
|
||||
and PurchaseMeTable2,y
|
||||
beq TryToPurchaseOnePiece.SorryNoPurchase
|
||||
@@ -890,10 +890,10 @@ PurchaseAIRoutines
|
||||
sta temp+1
|
||||
:3 lsr ; A=A/8
|
||||
sta temp
|
||||
tya
|
||||
and #%00000111
|
||||
tay
|
||||
lda bittable,y
|
||||
; tya ; optimization (256 bytes long bittable)
|
||||
; and #%00000111
|
||||
; tay
|
||||
lda bittable1_long,y
|
||||
ldy temp
|
||||
and PurchaseMeTable,y
|
||||
beq SorryNoPurchase
|
||||
|
||||
+3
-2
@@ -199,10 +199,11 @@ sintable
|
||||
;linetableH
|
||||
; :screenheight+1 .by >(display+screenBytes*#)
|
||||
;----------------------------
|
||||
; now long (256 bytes) bittables are generated in RAM based on one bittable:
|
||||
bittable
|
||||
.by $80,$40,$20,$10,$08,$04,$02,$01
|
||||
bittable2
|
||||
.by $7f,$bf,$df,$ef,$f7,$fb,$fd,$fe
|
||||
;bittable2
|
||||
; .by $7f,$bf,$df,$ef,$f7,$fb,$fd,$fe
|
||||
;----------------------------
|
||||
disktance ;tanks distance
|
||||
.by 0,0
|
||||
|
||||
@@ -810,7 +810,7 @@ deletePtr = temp
|
||||
@ tya
|
||||
sta (deletePtr),y
|
||||
inw deletePtr
|
||||
cpw deletePtr #variablesEnd
|
||||
cpw deletePtr #ClearedvariablesEnd
|
||||
bne @-
|
||||
tya
|
||||
jsr SetJoystickPort
|
||||
|
||||
+1
-4
@@ -207,7 +207,7 @@ FirstZpageVariable = $54
|
||||
;-----------------------------------------------
|
||||
; variable declarations in RAM (no code)
|
||||
;-----------------------------------------------
|
||||
ORG PMGraph + $0300 - (variablesEnd - OneTimeZeroVariables + 1)
|
||||
ORG PMGraph + $0300 - (variablesEnd - OneTimeZeroVariables)
|
||||
icl 'variables.asm'
|
||||
|
||||
; Game loading address
|
||||
@@ -755,9 +755,6 @@ EndofBFGDLI
|
||||
rts
|
||||
.endp
|
||||
;--------------------------------------------------
|
||||
.if variablesEnd > (PMGraph + $300)
|
||||
.ERROR 'Variables too long'
|
||||
.endif
|
||||
.IF * > MODUL-1
|
||||
.ECHO *
|
||||
.ERROR 'Code and data too long'
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
@@ -450,6 +450,13 @@ trackn_audctl .ds TRACKS
|
||||
v_aspeed .ds 1
|
||||
track_endvariables
|
||||
|
||||
ClearedvariablesEnd
|
||||
; These tebles are at the beginning of memory pages becouse ....
|
||||
bittable1_long
|
||||
.ds $100
|
||||
bittable2_long
|
||||
.ds $100
|
||||
; .... variablesEnd is aligned to PMGraph + $0300 in scorch.asm (before include this file)
|
||||
variablesEnd
|
||||
;----------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user