do some code cleanup (still ugly) in circle drawing code

This commit is contained in:
hugova 2025-06-30 21:38:13 +02:00
parent 55ab7e367d
commit fd587ea440

View file

@ -24,10 +24,10 @@ draw_qaa:
;; something is wrong | well isue for another time ;; something is wrong | well isue for another time
draw_qcb:; xy swaped draw_qcb:; xy swaped
STY temp STY temp
STX temp_
LDA byte_to_paint LDA byte_to_paint
STA temp__ STA temp__
;;modify Y_pos
LDY #$00 LDY #$00
jmp goto_loop jmp goto_loop
loop: loop:
@ -36,8 +36,11 @@ goto_loop:
ASL byte_to_paint; lsr asl ASL byte_to_paint; lsr asl
BCC loop BCC loop
STY temp___ STY temp___
revert_byte_to_paint:
LDA temp__
STA byte_to_paint
;;modify X_pos
LDX temp LDX temp
LDA binary_factor, X; (see END.s) LDA binary_factor, X; (see END.s)
@ -46,23 +49,25 @@ goto_loop:
ORA (btp_mem_pos_swop), Y ORA (btp_mem_pos_swop), Y
STA (btp_mem_pos_swop), Y; STA (btp_mem_pos_swop), Y;
;; this one is buggy
draw_qdb:; xy swaped and y is inverted. draw_qdb:; xy swaped and y is inverted.
;;modify X
LDX temp LDX temp
LDA binary_factor, X; (see END.s) LDA binary_factor, X; (see END.s)
TAX TAX
LDA inverse_factor_value, X;; (see END.s) LDA inverse_factor_value, X;; (see END.s)
;;Uses modifyed Y from above
ORA (btp_mem_pos_swop_inv_y), Y ORA (btp_mem_pos_swop_inv_y), Y
STA (btp_mem_pos_swop_inv_y), Y; STA (btp_mem_pos_swop_inv_y), Y;
SEC LDY temp
LDA #$07 LDA temp__
SBC temp___ STA byte_to_paint
TAY
draw_qab:; xy swoped + mirroring
draw_qab:; xy swoped + mirroring
LDA btp_mem_pos_center_two LDA btp_mem_pos_center_two
SBC btp_mem_pos_swop SBC btp_mem_pos_swop
STA btp_mem_pos_inv STA btp_mem_pos_inv
@ -70,6 +75,11 @@ draw_qab:; xy swoped + mirroring
SBC btp_mem_pos_swop + 1 SBC btp_mem_pos_swop + 1
STA btp_mem_pos_inv + 1 STA btp_mem_pos_inv + 1
SEC
LDA #$07
SBC temp___
TAY
LDA #$07 LDA #$07
SBC temp SBC temp
TAX TAX
@ -80,14 +90,10 @@ draw_qab:; xy swoped + mirroring
LDY temp LDY temp
; LDX temp_
LDA temp__
STA byte_to_paint
draw_qda:; y is inverted draw_qda:; y is inverted
;; invert Y, this is shared with qca ;; invert Y, this is shared with qca
STY temp STY temp
LDA #$07 LDA #$07
;SEC
SBC temp SBC temp
TAY TAY
@ -128,9 +134,6 @@ draw_qba: ;;mirror_technique
STA btp_mem_pos_inv + 1 STA btp_mem_pos_inv + 1
TXA TXA
LDX temp_
; A = byte_to_paint_inv
ORA (btp_mem_pos_inv), Y ORA (btp_mem_pos_inv), Y
STA (btp_mem_pos_inv), Y STA (btp_mem_pos_inv), Y