Make line draw faster
This commit is contained in:
parent
0fd76b862a
commit
adef2c0f56
Notes:
Hugo Ameln
2025-04-03 00:22:45 +02:00
Goes from 835768 cpu cycles to 811183 in test
2 changed files with 9 additions and 5 deletions
|
@ -64,7 +64,12 @@ selfmod:
|
||||||
STA case_1 +7
|
STA case_1 +7
|
||||||
end_selfmod:
|
end_selfmod:
|
||||||
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
|
||||||
LDX X_pos
|
;; X = X_end - X_pos
|
||||||
|
LDA X_end
|
||||||
|
SEC
|
||||||
|
SBC X_pos
|
||||||
|
TAX
|
||||||
|
;LDX X_pos
|
||||||
LDY #$00
|
LDY #$00
|
||||||
for_x:
|
for_x:
|
||||||
;; Paints A to address in |btp_mem_pos* + Y|
|
;; Paints A to address in |btp_mem_pos* + Y|
|
||||||
|
@ -84,8 +89,7 @@ move_8px_left:
|
||||||
LDA #%10000000
|
LDA #%10000000
|
||||||
STA byte_to_paint
|
STA byte_to_paint
|
||||||
increment_pixel_x_end:
|
increment_pixel_x_end:
|
||||||
INX
|
DEX
|
||||||
CPX X_end
|
|
||||||
BEQ end ;We keep track on when to stop line draw with the X registry.
|
BEQ end ;We keep track on when to stop line draw with the X registry.
|
||||||
;;If D < %00000010 00000000: case_2
|
;;If D < %00000010 00000000: case_2
|
||||||
;;else case 1.
|
;;else case 1.
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
.include "routines/memory/mem.inc"
|
.include "routines/memory/mem.inc"
|
||||||
;;Code to run
|
;;Code to run
|
||||||
.include "STARTUP.s"
|
.include "STARTUP.s"
|
||||||
;.include "routines/line/line_test_time.s"
|
.include "routines/line/line_test_time.s"
|
||||||
.include "routines/memory/memcpy_test.s"
|
;.include "routines/memory/memcpy_test.s"
|
||||||
exit:
|
exit:
|
||||||
jmp exit
|
jmp exit
|
||||||
.include "routines/line/line.s"
|
.include "routines/line/line.s"
|
||||||
|
|
Loading…
Add table
Reference in a new issue