make circledraw faster by using lookup table
This commit is contained in:
parent
380728a80a
commit
b7f04d1fcb
2 changed files with 81 additions and 13 deletions
|
@ -1,6 +1,65 @@
|
|||
inverse_factor_value: ;lookup 00000001 --gives--> 10000000 , etc etc. only 1st 1 in binary numbers
|
||||
NOP
|
||||
.byte %10000000, %01000000
|
||||
NOP
|
||||
.byte %00100000
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
.byte %00010000
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
;; i put another lookup table where nops normaly are'
|
||||
binary_factor:
|
||||
.byte %10000000, %01000000, %00100000, %00010000, %00001000, %00000100, %00000010, %00000001
|
||||
|
||||
;; ^ this one it is (in inverse_faktor value)
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
.byte %00000100
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
.byte %00000010
|
||||
;; i put another lookup table where nops normaly are
|
||||
Bitmap = $4000
|
||||
;;This is used by pixel_draw! look at it for more detail
|
||||
big_y_offset:
|
||||
|
@ -54,3 +113,17 @@ big_y_offset:
|
|||
.hibytes $1CC0 + Bitmap
|
||||
.lobytes $1E00 + Bitmap
|
||||
.hibytes $1E00 + Bitmap
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
NOP
|
||||
.byte %00000001
|
||||
|
|
|
@ -43,8 +43,7 @@ draw_right_px_in_circle:
|
|||
|
||||
while_x_bigger_then_y:
|
||||
|
||||
;STY temp
|
||||
;LDY #$00
|
||||
|
||||
draw_pixel:
|
||||
LDA byte_to_paint ;A byte containing a single 1. Coresponds to X position in the chunk.
|
||||
ORA (btp_mem_pos), Y
|
||||
|
@ -66,16 +65,12 @@ SEC
|
|||
SBC temp
|
||||
TAY
|
||||
|
||||
;; calculate byte_to_paint_inv (could be faster with lookup table)
|
||||
LDA byte_to_paint
|
||||
STA temp_
|
||||
LDA #%10000000
|
||||
jmp start_calc
|
||||
calc:
|
||||
LSR A
|
||||
start_calc:
|
||||
LSR temp_
|
||||
BCC calc
|
||||
;; calculate byte_to_paint_inv 00000001 --> 10000000, 00000010 --> 01000000 ... etc
|
||||
;; uses a table!
|
||||
stx temp_
|
||||
ldx byte_to_paint
|
||||
LDA inverse_factor_value, X;; (see END.s)
|
||||
ldx temp_
|
||||
|
||||
; A = byte_to_paint_inv
|
||||
ORA (btp_mem_pos_inv), Y
|
||||
|
|
Loading…
Add table
Reference in a new issue