Make line draw faster

This commit is contained in:
hugova 2025-04-03 00:21:01 +02:00
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

View file

@ -64,7 +64,12 @@ selfmod:
STA case_1 +7
end_selfmod:
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
for_x:
;; Paints A to address in |btp_mem_pos* + Y|
@ -84,8 +89,7 @@ move_8px_left:
LDA #%10000000
STA byte_to_paint
increment_pixel_x_end:
INX
CPX X_end
DEX
BEQ end ;We keep track on when to stop line draw with the X registry.
;;If D < %00000010 00000000: case_2
;;else case 1.

View file

@ -6,8 +6,8 @@
.include "routines/memory/mem.inc"
;;Code to run
.include "STARTUP.s"
;.include "routines/line/line_test_time.s"
.include "routines/memory/memcpy_test.s"
.include "routines/line/line_test_time.s"
;.include "routines/memory/memcpy_test.s"
exit:
jmp exit
.include "routines/line/line.s"