Improve line_down from 839904 to 837970 cykles in line_test_time
This commit is contained in:
parent
46a52661b8
commit
08daa79e6a
3 changed files with 26 additions and 9 deletions
|
@ -37,12 +37,13 @@
|
||||||
STA hi
|
STA hi
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
.macro Add_16_A a_low, a_hi, b_hi, fast_unsafe
|
.macro Add_16_A a_low, a_hi, b_low, b_hi, fast_unsafe
|
||||||
;; IF to run it fast
|
;; IF to run it fast
|
||||||
.ifblank fast_unsafe
|
.ifblank fast_unsafe
|
||||||
CLC
|
CLC
|
||||||
.endif
|
.endif
|
||||||
ADC a_low
|
LDA a_low
|
||||||
|
ADC b_low
|
||||||
STA a_low
|
STA a_low
|
||||||
LDA b_hi
|
LDA b_hi
|
||||||
ADC a_hi
|
ADC a_hi
|
||||||
|
@ -64,6 +65,18 @@
|
||||||
STA a_hi
|
STA a_hi
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
|
.macro Sub_16_A a_low, a_hi, b_low, b_hi, fast_unsafe
|
||||||
|
;; IF to run it fast
|
||||||
|
.ifblank fast_unsafe
|
||||||
|
SEC
|
||||||
|
.endif
|
||||||
|
SBC b_low
|
||||||
|
STA a_low
|
||||||
|
LDA a_hi
|
||||||
|
SBC b_hi
|
||||||
|
STA a_hi
|
||||||
|
.endmacro
|
||||||
|
|
||||||
;; Untested
|
;; Untested
|
||||||
;; Subtraction uses the A register
|
;; Subtraction uses the A register
|
||||||
;; a = a - b. b_low = A, b_hi = X
|
;; a = a - b. b_low = A, b_hi = X
|
||||||
|
|
|
@ -61,10 +61,10 @@ selfmod:
|
||||||
;; V
|
;; V
|
||||||
;;Modidies SBC >V
|
;;Modidies SBC >V
|
||||||
LDA >V
|
LDA >V
|
||||||
STA case_1 +3
|
STA case_1 +1
|
||||||
;; Modifies SBC <V
|
;; Modifies SBC <V
|
||||||
LDA <V
|
LDA <V
|
||||||
STA case_1 +9
|
STA case_1 +7
|
||||||
end_selfmod:
|
end_selfmod:
|
||||||
|
|
||||||
for_x:
|
for_x:
|
||||||
|
@ -89,8 +89,12 @@ increment_pixel_x_end:
|
||||||
;;If D < %00000010 00000000: case_2
|
;;If D < %00000010 00000000: case_2
|
||||||
;;else case 1.
|
;;else case 1.
|
||||||
Lag_16 >D, <D, #$00, #$02, case_2
|
Lag_16 >D, <D, #$00, #$02, case_2
|
||||||
case_1:; C =1 so we can use !
|
case_1:
|
||||||
Sub_16 >D, <D, #>V, #<V, ! ; D = D - V
|
;; D = D - V
|
||||||
|
;; Because Lag_16:
|
||||||
|
;; C =1 so we can use !
|
||||||
|
;; A = >D
|
||||||
|
Sub_16_A >D, <D, #>V, #<V, !
|
||||||
increment_y_pos:
|
increment_y_pos:
|
||||||
INY ; Increment Y pos inside the buffer
|
INY ; Increment Y pos inside the buffer
|
||||||
CPY #$08
|
CPY #$08
|
||||||
|
@ -101,7 +105,7 @@ move_8px_down: ; Z=1 --> C=1
|
||||||
Add_16 >btp_mem_pos, <btp_mem_pos, #$40, #$01; +320
|
Add_16 >btp_mem_pos, <btp_mem_pos, #$40, #$01; +320
|
||||||
JMP for_x
|
JMP for_x
|
||||||
increment_y_pos_end:
|
increment_y_pos_end:
|
||||||
case_2: ;; C =0 because LAG_16 so we can use !
|
case_2:
|
||||||
Add_16 >D, <D, #>dy_2, #<dy_2, ! ;D = D + 2*dy
|
Add_16 >D, <D, #>dy_2, #<dy_2, ! ;D = D + 2*dy
|
||||||
JMP for_x
|
JMP for_x
|
||||||
end:
|
end:
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
.include "macros/timer.s"
|
.include "macros/timer.s"
|
||||||
|
|
||||||
.include "STARTUP.s"
|
.include "STARTUP.s"
|
||||||
;.include "routines/line/line_test_time.s"
|
.include "routines/line/line_test_time.s"
|
||||||
jsr char_draw
|
;jsr char_draw
|
||||||
;;This is used by .s files to terminate nicely without reading includes at the end!
|
;;This is used by .s files to terminate nicely without reading includes at the end!
|
||||||
exit:
|
exit:
|
||||||
jmp exit
|
jmp exit
|
||||||
|
|
Loading…
Add table
Reference in a new issue