From c1846e35bdf536a3533cbbd706db729035308692 Mon Sep 17 00:00:00 2001 From: hugova Date: Tue, 1 Jul 2025 01:19:21 +0200 Subject: [PATCH] add more circle testing and remove none working offsets --- wip-hugo/routines/circle/circle.s | 9 +--- wip-hugo/routines/circle/circle_help.s | 7 --- .../routines/circle/circle_test_extensive.s | 45 +++++++++++++++++++ wip-hugo/source.s | 4 +- 4 files changed, 49 insertions(+), 16 deletions(-) create mode 100644 wip-hugo/routines/circle/circle_test_extensive.s diff --git a/wip-hugo/routines/circle/circle.s b/wip-hugo/routines/circle/circle.s index a7c5e05..e74be35 100644 --- a/wip-hugo/routines/circle/circle.s +++ b/wip-hugo/routines/circle/circle.s @@ -29,8 +29,6 @@ draw_center_px_in_circle: ;; btp_mem_pos_center_two = 2*btp_mem_pos_center | used later for calculating btp_mem_pos_inv Mult_16 btp_mem_pos_center, btp_mem_pos_center + 1 - ;; fix offset of 8 bytes, idk why this is needed - Sub_16 btp_mem_pos_center, btp_mem_pos_center + 1, #$40, #$01 ;-320 draw_lower_px_in_circle: CLC @@ -47,9 +45,6 @@ draw_lower_px_in_circle: LDA btp_mem_pos + 1 STA btp_mem_pos_qdb + 1 STA btp_mem_pos_qcb + 1 - ;; fix offset of 8 bytes, idk why this is needed - Sub_16 btp_mem_pos_qcb, btp_mem_pos_qcb + 1, #$40, #$01 ;-320 - Sub_16 btp_mem_pos_qdb, btp_mem_pos_qdb + 1, #$40, #$01 ;-320 LDA temp STA Y_pos @@ -68,10 +63,8 @@ draw_right_px_in_circle: LDA btp_mem_pos + 1 STA btp_mem_pos_qda + 1 - ;; fix offset of 8 bytes, idk why this is needed - Sub_16 btp_mem_pos_qda, btp_mem_pos_qda + 1, #$40, #$01 ;-320 - while_x_bigger_then_y: + SEC ;;Draw pixels and does the ypos incrementation logic ;; WARNING expects C=1 before and C =0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! JSR circle_help diff --git a/wip-hugo/routines/circle/circle_help.s b/wip-hugo/routines/circle/circle_help.s index e4d1521..aed3612 100644 --- a/wip-hugo/routines/circle/circle_help.s +++ b/wip-hugo/routines/circle/circle_help.s @@ -108,15 +108,8 @@ draw_qbb:;; the one not working ORA (btp_mem_pos_qbb), Y STA (btp_mem_pos_qbb), Y - ;LDY temp_ - draw_qab:; xy swoped + mirroring - ;STY temp_ - ;LDA #$07 - ;SBC temp_ - ;TAY - TXA ORA (btp_mem_pos_qab), Y STA (btp_mem_pos_qab), Y diff --git a/wip-hugo/routines/circle/circle_test_extensive.s b/wip-hugo/routines/circle/circle_test_extensive.s new file mode 100644 index 0000000..cd12dd5 --- /dev/null +++ b/wip-hugo/routines/circle/circle_test_extensive.s @@ -0,0 +1,45 @@ +.scope circle_test + .include "circle.inc" + + LDA #$50 + STA X_pos + STA Y_pos + LDA #$00 + STA $EF + + + + LDX #$ff + LDY #$ff + hihi: + NOP + NOP + DEX + BNE hihi + DEY + BNE hihi + + LDA #$50 + STA X_pos + STA Y_pos + + INC $EF + LDA $EF + + STA radius + + + + VIC_bank = $4000 + Mov_16 A_start, A_start + 1, #VIC_bank + Mov_16 length, length + 1, #<$1f40, #>$1f40 + LDA #$00 + jsr memset + + JSR circle + + LDX #$ff + LDY #$ff + + jmp hihi +.endscope diff --git a/wip-hugo/source.s b/wip-hugo/source.s index 80571b4..ac6e45e 100644 --- a/wip-hugo/source.s +++ b/wip-hugo/source.s @@ -10,7 +10,9 @@ ;.include "routines/arithmatic/mult_test.s" ;.include "routines/arithmatic/div_test.s" -.include "routines/circle/circle_test.s" +;.include "routines/circle/circle_test.s" +.include "routines/circle/circle_test_extensive.s" + ;.include "routines/line/line_test.s" ;.include "routines/text/char_draw_test.s" ;.include "routines/pixel/pixel_test.s"