From a1089ccd1cfc3b5a288c4c0e4932a953d513cb13 Mon Sep 17 00:00:00 2001 From: hugova Date: Thu, 10 Jul 2025 16:46:54 +0200 Subject: [PATCH] Do some sneaky code reductions in circle draw --- wip-hugo/routines/circle/circle.s | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wip-hugo/routines/circle/circle.s b/wip-hugo/routines/circle/circle.s index e8cf1f2..5f93092 100644 --- a/wip-hugo/routines/circle/circle.s +++ b/wip-hugo/routines/circle/circle.s @@ -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 @@ -275,7 +275,7 @@ qbb_y: qbb_y_overflow: 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 STA Y_qbb qbb_y_end: