From fd587ea440553bc5e833a5d3fb60381d48fc0e0f Mon Sep 17 00:00:00 2001 From: hugova Date: Mon, 30 Jun 2025 21:38:13 +0200 Subject: [PATCH] do some code cleanup (still ugly) in circle drawing code --- wip-hugo/routines/circle/circle_help.s | 33 ++++++++++++++------------ 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/wip-hugo/routines/circle/circle_help.s b/wip-hugo/routines/circle/circle_help.s index a917c87..0e32a59 100644 --- a/wip-hugo/routines/circle/circle_help.s +++ b/wip-hugo/routines/circle/circle_help.s @@ -24,10 +24,10 @@ draw_qaa: ;; something is wrong | well isue for another time draw_qcb:; xy swaped STY temp - STX temp_ LDA byte_to_paint STA temp__ + ;;modify Y_pos LDY #$00 jmp goto_loop loop: @@ -36,8 +36,11 @@ goto_loop: ASL byte_to_paint; lsr asl BCC loop STY temp___ +revert_byte_to_paint: + LDA temp__ + STA byte_to_paint - + ;;modify X_pos LDX temp LDA binary_factor, X; (see END.s) @@ -46,23 +49,25 @@ goto_loop: ORA (btp_mem_pos_swop), Y STA (btp_mem_pos_swop), Y; -;; this one is buggy draw_qdb:; xy swaped and y is inverted. + + ;;modify X LDX temp LDA binary_factor, X; (see END.s) TAX LDA inverse_factor_value, X;; (see END.s) + ;;Uses modifyed Y from above + ORA (btp_mem_pos_swop_inv_y), Y STA (btp_mem_pos_swop_inv_y), Y; - SEC - LDA #$07 - SBC temp___ - TAY -draw_qab:; xy swoped + mirroring + LDY temp + LDA temp__ + STA byte_to_paint +draw_qab:; xy swoped + mirroring LDA btp_mem_pos_center_two SBC btp_mem_pos_swop STA btp_mem_pos_inv @@ -70,6 +75,11 @@ draw_qab:; xy swoped + mirroring SBC btp_mem_pos_swop + 1 STA btp_mem_pos_inv + 1 + SEC + LDA #$07 + SBC temp___ + TAY + LDA #$07 SBC temp TAX @@ -80,14 +90,10 @@ draw_qab:; xy swoped + mirroring LDY temp -; LDX temp_ - LDA temp__ - STA byte_to_paint draw_qda:; y is inverted ;; invert Y, this is shared with qca STY temp LDA #$07 - ;SEC SBC temp TAY @@ -128,9 +134,6 @@ draw_qba: ;;mirror_technique STA btp_mem_pos_inv + 1 TXA - LDX temp_ - -; A = byte_to_paint_inv ORA (btp_mem_pos_inv), Y STA (btp_mem_pos_inv), Y