 opt %100101› org $a042››screen equ $bf09›ul   equ $90›duh  equ $91›vl   equ $92›dvh  equ $93›uh   equ $94›dul  equ $95›vh   equ $96›dvl  equ $97›ma   equ $98›mk   equ $9a›scr_ofs     equ $9b›a    equ $9c››start equ *› lda #4› jsr $ef90› lda #$49› sta $bd63››main equ *› lda dr_sch› sta $bd65› eor #4› sta dr_sch› ldx #0›* lda <ftab›* sta f_ofs› stx f_ofs››line1 equ *› stx scr_ofs› ldx #3›makeuv1 equ *› jsr smul› dex› jsr smul› lda #$7f› cmp dul,x› adc #$80› sta duh,x› lda ul,x› sta ma› lda uh,x› ldy #74› jsr mul› dex› bpl makeuv1›› ldx scr_ofs› ldy #10›draw1 lda #1›draw2 pha› lda dul› adc ul› sta ul› lda duh› adc uh› sta uh› lda dvl› adc vl› sta vl› lda dvh› adc vh› sta vh› eor uh› ror @› ror @› ror @› pla› rol @› bcc draw2› sta screen,x›dr_sch equ *-1› inx› dey› bne draw1›› inc f_ofs› cpx #240› bcc line1› inc a› bcs main››smul equ *› lda sin_ofs,x›* clc› adc a› asl @› php› ror @› and #$3f› cmp #$21› bcc first› eor #$3f› adc #0›first equ *› tay› lda sin,y› plp› bpl plus› eor #$ff› adc #1›plus equ *› ldy ftab›f_ofs equ *-2› stx ma››mul equ *› sty mk› ldy #0› sty ul,x› sty uh,x› bpl mul2›mul1 equ *› tay› lda ma› clc› adc ul,x› sta ul,x› tya› adc uh,x› sta uh,x› tya›mul2 equ *› cmp #$80› ror @› ror ma› asl mk› bcs mul1› bne mul2›* rts››sin_ofs dta b($60),b($90),b($c0),b($f0)››* opt %10111›ftab equ *› dta B(255),B(227),B(204),B(186)› dta B(170),B(157),B(146),B(136),B(127)› dta B(120),B(113),B(107),B(102),B(97)› dta B(93),B(89),B(85),B(81),B(78)› dta B(75),B(73),B(70),B(68),B(66)››sin equ *› dta B(0),B(6),B(12),B(18),B(24),B(30)› dta B(36),B(42),B(48),B(54),B(59)› dta B(65),B(70),B(75),B(80),B(85)› dta B(89),B(94),B(98),B(102),B(105)› dta B(108),B(112),B(114),B(117),B(119)› dta B(121),B(123),B(124),B(125)› dta B(126),B(126),B(127)››* opt %10111›* opt %10101›› org $2e0› dta a(start)››