Add performance improvments to line_down_inv.s
This commit is contained in:
parent
9b8e3fe33f
commit
05b0ff9762
3 changed files with 17 additions and 24 deletions
|
@ -44,27 +44,22 @@
|
||||||
Add_16 >D, <D, #$ff, #$01
|
Add_16 >D, <D, #$ff, #$01
|
||||||
Sub_16 >D, <D, dy, #$00
|
Sub_16 >D, <D, dy, #$00
|
||||||
|
|
||||||
LDY #$00
|
|
||||||
jsr pixel_draw ;;only used first pixel. after this relative position is abused
|
jsr pixel_draw ;;only used first pixel. after this relative position is abused
|
||||||
CLC ; this makes it that C =0 always on for_x
|
|
||||||
for_y:
|
|
||||||
LDX #$00
|
|
||||||
LDA byte_to_paint
|
|
||||||
ORA (>btp_mem_pos, X)
|
|
||||||
STA (>btp_mem_pos, X)
|
|
||||||
increment_y_pos:
|
|
||||||
Add_16 >btp_mem_pos, <btp_mem_pos, #$01, #$00, ! ; I know that C ==0 on for_y
|
|
||||||
INY
|
|
||||||
CPY #$08 ;
|
|
||||||
BEQ move_8px_down
|
|
||||||
jmp increment_y_pos_end
|
|
||||||
move_8px_down:
|
|
||||||
;; +320-8 bytes
|
|
||||||
LDY #$00
|
LDY #$00
|
||||||
Add_16 >btp_mem_pos, <btp_mem_pos,#$38 , #$01
|
|
||||||
increment_y_pos_end:
|
|
||||||
INC Y_pos;; legacy
|
|
||||||
LDX Y_pos
|
LDX Y_pos
|
||||||
|
for_y:
|
||||||
|
LDA byte_to_paint
|
||||||
|
ORA (>btp_mem_pos), Y
|
||||||
|
STA (>btp_mem_pos), Y
|
||||||
|
increment_y_pos:
|
||||||
|
INY
|
||||||
|
CPY #$08
|
||||||
|
BNE increment_y_pos_end
|
||||||
|
move_8px_down:
|
||||||
|
LDY #$00
|
||||||
|
Add_16 >btp_mem_pos, <btp_mem_pos,#$40 , #$01; ; +320 bytes
|
||||||
|
increment_y_pos_end:
|
||||||
|
INX
|
||||||
CPX Y_end
|
CPX Y_end
|
||||||
BEQ end
|
BEQ end
|
||||||
;;If D < %00000010 00000000: case_2
|
;;If D < %00000010 00000000: case_2
|
||||||
|
@ -73,11 +68,9 @@ increment_y_pos_end:
|
||||||
case_1:
|
case_1:
|
||||||
Sub_16 >D, <D, >V, <V; D = D - V
|
Sub_16 >D, <D, >V, <V; D = D - V
|
||||||
increment_pixel_x:
|
increment_pixel_x:
|
||||||
CLC
|
|
||||||
LDA byte_to_paint
|
LDA byte_to_paint
|
||||||
ROR byte_to_paint
|
LSR byte_to_paint
|
||||||
BCS move_8px_left
|
BCC for_y
|
||||||
JMP for_y
|
|
||||||
move_8px_left:
|
move_8px_left:
|
||||||
;; add +8 to btp_mem_pos. Find more of why in pixel_draw
|
;; add +8 to btp_mem_pos. Find more of why in pixel_draw
|
||||||
Add_16 >btp_mem_pos, <btp_mem_pos, #$08, #$00
|
Add_16 >btp_mem_pos, <btp_mem_pos, #$08, #$00
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
;;NOTE THAT Y_pos >) Y_end, X_pos <= X_end. Min 45deg!
|
;;NOTE THAT Y_pos >) Y_end, X_pos <= X_end. Min 45deg!
|
||||||
|
|
||||||
.proc line_up_inv
|
.proc line_up_inv
|
||||||
include "line.inc"
|
.include "line.inc"
|
||||||
|
|
||||||
;We need to clear this memory
|
;We need to clear this memory
|
||||||
LDA #$00
|
LDA #$00
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
.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.s"
|
||||||
|
|
||||||
;;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:
|
||||||
|
|
Loading…
Add table
Reference in a new issue