make line drawing slightly faster, and make it a bit smaller

This commit is contained in:
hugova 2025-07-01 20:11:18 +02:00
parent e0314e8530
commit 3f470688a4
4 changed files with 9 additions and 15 deletions

View file

@ -76,13 +76,12 @@ increment_pixel_x:
LSR byte_to_paint ; Rotates the pixel one bit to the left ON THE SCREEN. LSR byte_to_paint ; Rotates the pixel one bit to the left ON THE SCREEN.
BCC increment_pixel_x_end; We need to move to the next chunk BCC increment_pixel_x_end; We need to move to the next chunk
move_8px_left: move_8px_left:
;; Restores byte to paint to #%10000000
ROR byte_to_paint
;; Next chunk is 8 addresses away. Look in pixel_draw for more detail. ;; Next chunk is 8 addresses away. Look in pixel_draw for more detail.
;; -8. ;; -8.
;; C = 1 therefore you se 07 ;; C = 1 therefore you se 07
Add_16 btp_mem_pos, btp_mem_pos + 1, #$07, #$00, ! Add_16 btp_mem_pos, btp_mem_pos + 1, #$08, #$00, !
;; Restores byte to paint
LDA #%10000000
STA byte_to_paint
increment_pixel_x_end: increment_pixel_x_end:
DEX DEX
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.

View file

@ -61,13 +61,11 @@ increment_y_pos_end:
case_1: case_1:
Sub_16_A D, D + 1, #>V, #<V, ! Sub_16_A D, D + 1, #>V, #<V, !
increment_pixel_x: increment_pixel_x:
LDA byte_to_paint
LSR byte_to_paint LSR byte_to_paint
BCC for_y BCC for_y
move_8px_left: move_8px_left:
Add_16 btp_mem_pos, btp_mem_pos + 1, #$07, #$00, ! ROR byte_to_paint
LDA #%10000000 Add_16 btp_mem_pos, btp_mem_pos + 1, #$08, #$00, !
STA byte_to_paint
JMP for_y JMP for_y
case_2: case_2:
Add_16 D, D + 1, #>dx_2, #<dx_2, ! ;D = D + 2*dx Add_16 D, D + 1, #>dx_2, #<dx_2, ! ;D = D + 2*dx

View file

@ -52,9 +52,8 @@ increment_pixel_x:
LSR byte_to_paint LSR byte_to_paint
BCC increment_pixel_x_end BCC increment_pixel_x_end
move_8px_left: move_8px_left:
Add_16 btp_mem_pos, btp_mem_pos + 1, #$07, #$00,! ROR byte_to_paint
LDA #%10000000 Add_16 btp_mem_pos, btp_mem_pos + 1, #$08, #$00,!
STA byte_to_paint
increment_pixel_x_end: increment_pixel_x_end:
DEX DEX
;CPX X_end ;CPX X_end

View file

@ -60,13 +60,11 @@ decrement_y_pos_end:
case_1: case_1:
Sub_16_A D, D + 1, #>V, #<V, ! Sub_16_A D, D + 1, #>V, #<V, !
increment_pixel_x: increment_pixel_x:
LDA byte_to_paint
LSR byte_to_paint LSR byte_to_paint
BCC for_y BCC for_y
move_8px_left: move_8px_left:
Add_16 btp_mem_pos, btp_mem_pos + 1, #$07, #$00,! ROR byte_to_paint
LDA #%10000000 Add_16 btp_mem_pos, btp_mem_pos + 1, #$08, #$00,!
STA byte_to_paint
JMP for_y JMP for_y
case_2: case_2:
Add_16 D, D + 1, #>dx_2, #<dx_2, ! Add_16 D, D + 1, #>dx_2, #<dx_2, !