fix small issues with linedraw

This commit is contained in:
hugova 2025-07-17 14:45:51 +02:00
parent 1ad8071f75
commit 8fe1c85a40
5 changed files with 18 additions and 16 deletions

View file

@ -57,8 +57,9 @@ end_selfmod:
JSR pixel_calc ;;only used first pixel. after this relative position is abused JSR pixel_calc ;;only used first pixel. after this relative position is abused
STA byte_to_paint STA byte_to_paint
INY INY
Sub_16 btp_mem_pos, btp_mem_pos + 1, #$01, #$00 Sub_16 btp_mem_pos, btp_mem_pos + 1, #$00, #$00, !
LDX dy LDX dy
CLC
for_y: for_y:
LDA byte_to_paint LDA byte_to_paint
ORA (btp_mem_pos), Y ORA (btp_mem_pos), Y
@ -68,7 +69,7 @@ increment_y_pos:
BNE increment_y_pos_end BNE increment_y_pos_end
move_8px_down: move_8px_down:
LDY #$08 LDY #$08
Sub_16 btp_mem_pos, btp_mem_pos + 1, #$40 ,#$01 Sub_16 btp_mem_pos, btp_mem_pos + 1, #$3f ,#$01, !
increment_y_pos_end: increment_y_pos_end:
DEX DEX
;CPX Y_end ;CPX Y_end
@ -80,8 +81,8 @@ increment_pixel_x:
ASL byte_to_paint ASL byte_to_paint
BCC for_y BCC for_y
move_8px_left: move_8px_left:
ROL byte_to_paint
Sub_16 btp_mem_pos, btp_mem_pos + 1, #$08, #$00 Sub_16 btp_mem_pos, btp_mem_pos + 1, #$08, #$00
ROL 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

@ -53,7 +53,7 @@ selfmod:
end_selfmod: end_selfmod:
JSR pixel_calc ;;only used first pixel. after this relative position is abused JSR pixel_calc ;;only used first pixel. after this relative position is abused
STA byte_to_paint STA byte_to_paint
Sub_16 btp_mem_pos, btp_mem_pos + 1, #$01, #$00 ;; Y has always a offset of at least 1 Sub_16 btp_mem_pos, btp_mem_pos + 1, #$00, #$00, !
;LDY #$01 ;LDY #$01
INY INY
LDX dx LDX dx

View file

@ -53,8 +53,8 @@ end_selfmod:
JSR pixel_calc ;;only used first pixel. after this relative position is abused JSR pixel_calc ;;only used first pixel. after this relative position is abused
STA byte_to_paint STA byte_to_paint
INY INY
Sub_16 btp_mem_pos, btp_mem_pos + 1, #$01, #$00 ;; Y has always a offset of at least 1 Sub_16 btp_mem_pos, btp_mem_pos + 1, #$00, #$00,!
;LDY #$00 CLC
LDX dy LDX dy
for_y: for_y:
LDA byte_to_paint LDA byte_to_paint
@ -65,6 +65,7 @@ decrement_y_pos:
BNE decrement_y_pos_end BNE decrement_y_pos_end
move_8px_up: move_8px_up:
LDY #$08 LDY #$08
; C=0
Sub_16 btp_mem_pos, btp_mem_pos + 1,#$3F , #$01, ! Sub_16 btp_mem_pos, btp_mem_pos + 1,#$3F , #$01, !
decrement_y_pos_end: decrement_y_pos_end:
DEX DEX

View file

@ -8,17 +8,17 @@
.include "STARTUP.s" .include "STARTUP.s"
;.include "dubbel_buffer/raster_irqs.s" ;.include "dubbel_buffer/raster_irqs.s"
;.include "routines/arithmatic/mult_test.s" .include "routines/arithmatic/mult_test.s"
;.include "routines/arithmatic/div_test.s" .include "routines/arithmatic/div_test.s"
;.include "routines/circle/circle_test.s" .include "routines/circle/circle_test.s"
;.include "routines/circle/circle_test_size.s" .include "routines/circle/circle_test_size.s"
;.include "routines/circle/circle_test_position.s" .include "routines/circle/circle_test_position.s"
.include "routines/line/line_test.s" .include "routines/line/line_test.s"
.include "routines/line/line_test_extensive.s" .include "routines/line/line_test_extensive.s"
;.include "routines/text/char_draw_test.s" .include "routines/text/char_draw_test.s"
;.include "routines/pixel/pixel_test.s" .include "routines/pixel/pixel_test.s"
;.include "routines/memory/memcpy_test.s" .include "routines/memory/memcpy_test.s"
;.include "routines/memory/memset_test.s" .include "routines/memory/memset_test.s"
;.include "routines/triangle/triangle_test.s" ;.include "routines/triangle/triangle_test.s"
exit: exit: