2022-01-25 19:16:08 +00:00
|
|
|
; try to get sine table from ROM
|
|
|
|
|
2022-01-25 20:44:27 +00:00
|
|
|
sinetable=$6000
|
|
|
|
costable_base = $F5BA
|
2022-01-25 19:16:08 +00:00
|
|
|
|
|
|
|
rom_sine:
|
|
|
|
|
|
|
|
;==========================================
|
|
|
|
; create sinetable using ROM cosine table
|
|
|
|
|
2022-01-25 20:44:27 +00:00
|
|
|
ldx #0
|
|
|
|
ldy #$f
|
2022-01-25 19:16:08 +00:00
|
|
|
sinetable_loop:
|
|
|
|
|
2022-01-25 20:44:27 +00:00
|
|
|
lda costable_base+1,X
|
|
|
|
force_zero:
|
2022-01-25 19:16:08 +00:00
|
|
|
lsr ; rom value is *256
|
|
|
|
lsr ; we want *32
|
|
|
|
lsr
|
|
|
|
|
2022-01-25 20:44:27 +00:00
|
|
|
sta sinetable+$10,X
|
|
|
|
sta sinetable+$00,Y
|
|
|
|
eor #$FF
|
2022-01-25 21:42:56 +00:00
|
|
|
|
|
|
|
sec ; these aren't strictly necessary
|
|
|
|
adc #$0 ; depending how accurate you want it
|
|
|
|
|
2022-01-25 20:44:27 +00:00
|
|
|
sta sinetable+$30,X
|
|
|
|
sta sinetable+$20,Y
|
2022-01-25 19:16:08 +00:00
|
|
|
|
2022-01-25 20:44:27 +00:00
|
|
|
lda #0
|
2022-01-25 19:16:08 +00:00
|
|
|
|
2022-01-25 20:44:27 +00:00
|
|
|
inx
|
|
|
|
dey
|
2022-01-25 19:16:08 +00:00
|
|
|
|
2022-01-25 20:44:27 +00:00
|
|
|
beq force_zero
|
|
|
|
bpl sinetable_loop
|
2022-01-25 19:16:08 +00:00
|
|
|
end:
|
|
|
|
jmp end
|