Fix first pixel of, in all line_*

This commit is contained in:
hugova 2025-03-29 19:47:39 +01:00
parent d9fe32e8f3
commit 147ceb73f2
4 changed files with 9 additions and 10 deletions

View file

@ -43,9 +43,6 @@
Add_16 >D, <D, #$ff, #$01, !
Sub_16 >D, <D, dx, #$00
jsr pixel_draw ;;only used first pixel. after this relative position is abused
LDX X_pos
selfmod:
;; Self modifying code. Makes LDA and SBC instructions each take 1 cycle less.
;; You can remove this if you run the loop without # at dy_2 and V.
@ -66,7 +63,9 @@ selfmod:
LDA <V
STA case_1 +7
end_selfmod:
LDY #$01
JSR pixel_draw ;;only used first pixel. after this relative position is abused
LDX X_pos
for_x:
;; Paints A to address in |btp_mem_pos* + Y|
;; Y is pixel position in the chunk. Therefor it may be that Y = 0, 1, 2, 3, 4, ,5 ,6 ,7.

View file

@ -39,7 +39,7 @@ selfmod:
LDA <V
STA case_1 +7
end_selfmod:
LDY #$01
jsr pixel_draw
LDX Y_pos
for_y:

View file

@ -36,11 +36,11 @@ selfmod:
LDA <dy_2
STA case_2 +7
LDA >V
STA case_1 +1
STA case_1 +3
LDA <V
STA case_1 +7
STA case_1 +9
end_selfmod:
LDY #$01
jsr pixel_draw
LDX X_pos
for_x:
@ -60,7 +60,7 @@ increment_pixel_x_end:
BEQ end
Lag_16 >D, <D, #$00, #$02, case_2
case_1:
Sub_16_A >D, <D, #>V, #<V, !
Sub_16 >D, <D, #>V, #<V, !
decrement_y_pos:
DEY
CPY #$ff

View file

@ -39,7 +39,7 @@
LDA <V
STA case_1 +7
end_selfmod:
LDY #$01
jsr pixel_draw
LDX Y_pos
for_y: