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 INC byte_to_paint_qcb
Sub_16 btp_mem_pos_qcb, btp_mem_pos_qcb + 1, #$08, #$00,! 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,! Sub_16 btp_mem_pos_qbb, btp_mem_pos_qbb + 1, #$08, #$00,!
CLC
qcb_x_end: qcb_x_end:
;;t1 += y ;;t1 += y
CLC ;; C =0 becuse CLC above or branching logic
LDA t1 LDA t1
ADC Y_math ADC Y_math
STA t1 STA t1
@ -234,17 +235,16 @@ qcb_x_end:
;; if t2 < 0 then skip to endif ;; if t2 < 0 then skip to endif
;; we can skipp CMP #$00 because SBC above do the same ;; we can skipp CMP #$00 because SBC above do the same
BPL if BPL if
JMP (jmp_location_pointer_two) JMP (jmp_location_pointer_two) ; jump to endif
if: if:
change_x: change_x:
DEC X_math DEC X_math
LDA t2
STA t1 ; t1 = t2 STA t1 ; t1 = t2
qaa_x: qaa_x:
ASL byte_to_paint ASL byte_to_paint
BCC qaa_x_end BCC qaa_x_end
qaa_x_overflow: 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 Sub_16 btp_mem_pos_qda, btp_mem_pos_qda + 1, #$08, #$00, ! ;+8
;; Restores byte to paint ;; Restores byte to paint
INC byte_to_paint INC byte_to_paint
@ -275,7 +275,7 @@ qbb_y:
qbb_y_overflow: qbb_y_overflow:
Add_16 btp_mem_pos_qbb, btp_mem_pos_qbb + 1, #$3f, #$01, ! ;+320 Add_16 btp_mem_pos_qbb, btp_mem_pos_qbb + 1, #$3f, #$01, ! ;+320
Add_16 btp_mem_pos_qab, btp_mem_pos_qab + 1, #$40, #$01, !;+320 Add_16 btp_mem_pos_qab, btp_mem_pos_qab + 1, #$40, #$01, ! ;+320
LDA #$00 LDA #$00
STA Y_qbb STA Y_qbb
qbb_y_end: qbb_y_end: