diff --git a/wip-hugo/routines/circle/circle.inc b/wip-hugo/routines/circle/circle.inc index 72a4451..40546d8 100644 --- a/wip-hugo/routines/circle/circle.inc +++ b/wip-hugo/routines/circle/circle.inc @@ -7,7 +7,7 @@ t2 = $E1 X_rel = radius Y_rel = $E2 - temp = $E3 + Y_copy = $E3 temp_ = $E4 temo__ = $E5 byte_to_paint_qaa = byte_to_paint diff --git a/wip-hugo/routines/circle/circle.s b/wip-hugo/routines/circle/circle.s index 2a02e2f..2f128fb 100644 --- a/wip-hugo/routines/circle/circle.s +++ b/wip-hugo/routines/circle/circle.s @@ -33,7 +33,7 @@ draw_center_px_in_circle: draw_lower_px_in_circle: CLC LDA Y_pos - STA temp + STA temp_ ADC radius STA Y_pos @@ -48,7 +48,7 @@ draw_lower_px_in_circle: Sub_16 btp_mem_pos_qdb, btp_mem_pos_qdb +1, #$08, #$00 - LDA temp + LDA temp_ STA Y_pos draw_right_px_in_circle: CLC diff --git a/wip-hugo/routines/circle/circle_help.s b/wip-hugo/routines/circle/circle_help.s index 3b73aaf..952f091 100644 --- a/wip-hugo/routines/circle/circle_help.s +++ b/wip-hugo/routines/circle/circle_help.s @@ -6,13 +6,13 @@ ;;We have named the parts of the circle as such. ;; | - ;; qbb | qab + ;; qbb (7) | qab (8) ;; | ;; qba (2) | qaa (1) ;;---------------X-----------------> X - ;; qca | qda + ;; qca (4) | qda (3) ;; | - ;; qcb | qdb + ;; qcb (5) | qdb (6) ;; | ;; v Y @@ -57,7 +57,7 @@ end_calculation: ;; Lets draw all half-quatrons of the circle. This draws only 8 pixels per iteration. ;; Note that I have the draw_qxx in listed pairs. Each pair chair the same Y-register :) -STY temp +STY Y_copy draw_qaa: LDA byte_to_paint ;A byte containing a single 1. Coresponds to X position in the chunk. ORA (btp_mem_pos), Y @@ -65,19 +65,35 @@ draw_qaa: draw_qba: ;;mirror_technique LDX byte_to_paint LDA inverse_factor_value, X;; (see END.s) - STA temp___ + TAX ORA (btp_mem_pos_qba), Y STA (btp_mem_pos_qba), Y +draw_qda:; y is inverted + + ;; invert Y, this is shared with qca + LDA #$07 + SBC Y_copy + TAY + + LDA byte_to_paint + ORA (btp_mem_pos_qda), Y + STA (btp_mem_pos_qda), Y + +draw_qca: ;;mirror technique + + TXA + ORA (btp_mem_pos_qca), Y + STA (btp_mem_pos_qca), Y + draw_qcb:; xy swoped - LDX temp___ LDA log, X TAY ;;modify X_pos - LDX temp + LDX Y_copy LDA binary_factor, X; (see END.s) - TAX + TAX ORA (btp_mem_pos_qcb), Y STA (btp_mem_pos_qcb), Y @@ -106,25 +122,9 @@ draw_qab:; xy swoped + mirroring ORA (btp_mem_pos_qab), Y STA (btp_mem_pos_qab), Y -draw_qda:; y is inverted - ;; invert Y, this is shared with qca - LDA #$07 - SBC temp - TAY - - LDA byte_to_paint - ORA (btp_mem_pos_qda), Y - STA (btp_mem_pos_qda), Y - -draw_qca: ;;mirror technique - - LDA temp___ - ORA (btp_mem_pos_qca), Y - STA (btp_mem_pos_qca), Y - - ;;Recover the Y value (we changed it because evrything is inverted) - LDY temp +;;Recover the Y value (we changed it because evrything is inverted) +LDY Y_copy increment_y_pos: INC Y_rel ; y++