Do some sneaky code reductions in circle draw

This commit is contained in:
hugova 2025-07-10 16:46:54 +02:00
parent 156abddbe7
commit a1089ccd1c

View file

@ -220,10 +220,11 @@ qcb_x_overflow:
INC byte_to_paint_qcb
Sub_16 btp_mem_pos_qcb, btp_mem_pos_qcb + 1, #$08, #$00,!
Sub_16 btp_mem_pos_qbb, btp_mem_pos_qbb + 1, #$08, #$00,!
CLC
qcb_x_end:
;;t1 += y
CLC
;; C =0 becuse CLC above or branching logic
LDA t1
ADC Y_math
STA t1
@ -234,17 +235,16 @@ qcb_x_end:
;; if t2 < 0 then skip to endif
;; we can skipp CMP #$00 because SBC above do the same
BPL if
JMP (jmp_location_pointer_two)
JMP (jmp_location_pointer_two) ; jump to endif
if:
change_x:
DEC X_math
LDA t2
STA t1 ; t1 = t2
qaa_x:
ASL byte_to_paint
BCC qaa_x_end
qaa_x_overflow:
Sub_16 btp_mem_pos, btp_mem_pos + 1, #$08, #$00, ! ;+8
Sub_16 btp_mem_pos_qaa, btp_mem_pos_qaa + 1, #$08, #$00, ! ;+8
Sub_16 btp_mem_pos_qda, btp_mem_pos_qda + 1, #$08, #$00, ! ;+8
;; Restores byte to paint
INC byte_to_paint