more minute optimisations of circle draw

This commit is contained in:
hugova 2025-07-02 01:17:08 +02:00
parent 913a6ba072
commit 0ed8359f66

View file

@ -8,7 +8,7 @@
;; | ;; |
;; qbb | qab ;; qbb | qab
;; | ;; |
;; qba | qaa ;; qba (2) | qaa (1)
;;---------------X-----------------> X ;;---------------X-----------------> X
;; qca | qda ;; qca | qda
;; | ;; |
@ -57,7 +57,7 @@ end_calculation:
;; Lets draw all half-quatrons of the circle. This draws only 8 pixels per iteration. ;; 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 :) ;; Note that I have the draw_qxx in listed pairs. Each pair chair the same Y-register :)
STY temp
draw_qaa: draw_qaa:
LDA byte_to_paint ;A byte containing a single 1. Coresponds to X position in the chunk. LDA byte_to_paint ;A byte containing a single 1. Coresponds to X position in the chunk.
ORA (btp_mem_pos), Y ORA (btp_mem_pos), Y
@ -65,13 +65,11 @@ draw_qaa:
draw_qba: ;;mirror_technique draw_qba: ;;mirror_technique
LDX byte_to_paint LDX byte_to_paint
LDA inverse_factor_value, X;; (see END.s) LDA inverse_factor_value, X;; (see END.s)
STA temp___
ORA (btp_mem_pos_qba), Y ORA (btp_mem_pos_qba), Y
STA (btp_mem_pos_qba), Y STA (btp_mem_pos_qba), Y
draw_qcb:; xy swoped draw_qcb:; xy swoped
STY temp LDX temp___
LDA inverse_factor_value, X;; (see END.s)
TAX
LDA log, X LDA log, X
TAY TAY
@ -83,7 +81,7 @@ draw_qcb:; xy swoped
ORA (btp_mem_pos_qcb), Y ORA (btp_mem_pos_qcb), Y
STA (btp_mem_pos_qcb), Y STA (btp_mem_pos_qcb), Y
draw_qdb:; xy swaped and y is inverted. ;;;;;;;;;;;;;;;;;;; draw_qdb:; xy swaped and y is inverted.
LDA inverse_factor_value, X LDA inverse_factor_value, X
STA temp__ STA temp__
@ -98,14 +96,11 @@ draw_qbb:
SBC temp_ SBC temp_
TAY TAY
LDX temp TXA
LDA binary_factor, X; (see END.s)
TAX
ORA (btp_mem_pos_qbb), Y ORA (btp_mem_pos_qbb), Y
STA (btp_mem_pos_qbb), Y STA (btp_mem_pos_qbb), Y
draw_qab:; xy swoped + mirroring ;!!!!!!!!!!!!!!!!!!!!!!!!!!1111111!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! draw_qab:; xy swoped + mirroring
LDA temp__ LDA temp__
ORA (btp_mem_pos_qab), Y ORA (btp_mem_pos_qab), Y
@ -124,12 +119,8 @@ draw_qda:; y is inverted
draw_qca: ;;mirror technique draw_qca: ;;mirror technique
;; calculate byte_to_paint_inv 00000001 --> 10000000, 00000010 --> 01000000 ... etc LDA temp___
;; uses a table! ORA (btp_mem_pos_qca), Y
LDX byte_to_paint
LDA inverse_factor_value, X;; (see END.s)
; A = byte_to_paint_inv
ORA (btp_mem_pos_qca), Y
STA (btp_mem_pos_qca), Y STA (btp_mem_pos_qca), Y
;;Recover the Y value (we changed it because evrything is inverted) ;;Recover the Y value (we changed it because evrything is inverted)