make line drawing slightly faster, and make it a bit smaller
This commit is contained in:
parent
e0314e8530
commit
3f470688a4
4 changed files with 9 additions and 15 deletions
|
@ -76,13 +76,12 @@ increment_pixel_x:
|
|||
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
|
||||
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.
|
||||
;; -8.
|
||||
;; C = 1 therefore you se 07
|
||||
Add_16 btp_mem_pos, btp_mem_pos + 1, #$07, #$00, !
|
||||
;; Restores byte to paint
|
||||
LDA #%10000000
|
||||
STA byte_to_paint
|
||||
Add_16 btp_mem_pos, btp_mem_pos + 1, #$08, #$00, !
|
||||
increment_pixel_x_end:
|
||||
DEX
|
||||
BEQ end ;We keep track on when to stop line draw with the X registry.
|
||||
|
|
|
@ -61,13 +61,11 @@ increment_y_pos_end:
|
|||
case_1:
|
||||
Sub_16_A D, D + 1, #>V, #<V, !
|
||||
increment_pixel_x:
|
||||
LDA byte_to_paint
|
||||
LSR byte_to_paint
|
||||
BCC for_y
|
||||
move_8px_left:
|
||||
Add_16 btp_mem_pos, btp_mem_pos + 1, #$07, #$00, !
|
||||
LDA #%10000000
|
||||
STA byte_to_paint
|
||||
ROR byte_to_paint
|
||||
Add_16 btp_mem_pos, btp_mem_pos + 1, #$08, #$00, !
|
||||
JMP for_y
|
||||
case_2:
|
||||
Add_16 D, D + 1, #>dx_2, #<dx_2, ! ;D = D + 2*dx
|
||||
|
|
|
@ -52,9 +52,8 @@ increment_pixel_x:
|
|||
LSR byte_to_paint
|
||||
BCC increment_pixel_x_end
|
||||
move_8px_left:
|
||||
Add_16 btp_mem_pos, btp_mem_pos + 1, #$07, #$00,!
|
||||
LDA #%10000000
|
||||
STA byte_to_paint
|
||||
ROR byte_to_paint
|
||||
Add_16 btp_mem_pos, btp_mem_pos + 1, #$08, #$00,!
|
||||
increment_pixel_x_end:
|
||||
DEX
|
||||
;CPX X_end
|
||||
|
|
|
@ -60,13 +60,11 @@ decrement_y_pos_end:
|
|||
case_1:
|
||||
Sub_16_A D, D + 1, #>V, #<V, !
|
||||
increment_pixel_x:
|
||||
LDA byte_to_paint
|
||||
LSR byte_to_paint
|
||||
BCC for_y
|
||||
move_8px_left:
|
||||
Add_16 btp_mem_pos, btp_mem_pos + 1, #$07, #$00,!
|
||||
LDA #%10000000
|
||||
STA byte_to_paint
|
||||
ROR byte_to_paint
|
||||
Add_16 btp_mem_pos, btp_mem_pos + 1, #$08, #$00,!
|
||||
JMP for_y
|
||||
case_2:
|
||||
Add_16 D, D + 1, #>dx_2, #<dx_2, !
|
||||
|
|
Loading…
Add table
Reference in a new issue