Optimization by redusing 2 compare operations (now other part of circle is renderd but still 1/4 of it is renderd.)

This commit is contained in:
hugova 2025-06-29 10:36:50 +02:00
parent c5b0d5f64b
commit 219f8c155d

View file

@ -82,16 +82,14 @@ draw_pixel_inv:
increment_y_pos:
INC Y_rel ; y++
INY
CPY #$08
BNE increment_y_pos_end
DEY
BPL increment_y_pos_end
move_8px_down:
LDY #$00
LDY #$07
;; Switch to chunk bellow
; So we subtract #$4001
; C = 1 because branching!
Add_16 btp_mem_pos, btp_mem_pos + 1, #$3F, #$01, ! ;+320
Sub_16 btp_mem_pos, btp_mem_pos + 1, #$40, #$01, ! ;-320
increment_y_pos_end:
;;t1 += y
@ -105,7 +103,7 @@ increment_y_pos_end:
SBC X_rel
STA t2
;; if t2 < 0 then skip to endif
CMP #$00
;; we can skipp CMP #$00 because SBC above do the same
BMI endif
if:
decrement_x_pos: