User Tools

Site Tools


makesin

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
makesin [2013/01/10 21:32] darkbytemakesin [2017/02/16 13:34] (current) darkbyte
Line 1: Line 1:
-==== makesin (fast, approximated) ==== +====Sinus table generators==== 
-//fast generator via approximation of x^2 parabola//+ 
 +---- 
 + 
 +**__makesin (fast, approximated)__**
  
 <code z80> <code z80>
 +;fast generator via approximation of x^2 parabola
 +;Copyright © 2012 Busy, optimized by Zilogat0r
 +
 mksin:    ld    bc,sintab mksin:    ld    bc,sintab
           ld    d,c           ld    d,c
Line 30: Line 36:
 sintab:   ds    256 sintab:   ds    256
 </code> </code>
-Copyright © 2012 Busy, optimized by Zilogat0r 
  
-Navigation: [[general]] . [[math]] . [[graphic]] . [[sound]] . [[system]] . [[other]] . back to [[start]]+---- 
 + 
 +**__makesin (alternative)__** 
 + 
 +<code z80> 
 +; sinus maker. {C} Jordan of exodus 
 +; a: amplitude, c: offset, hl: adr 
 +; WARNING!! 
 +; org  xx00h 
 + 
 +mksnt exx 
 +    ld   c,a 
 +    ld   b,01h 
 +    ld   hl,sintabb 
 +    exx 
 +    ld   e,00h 
 +    call h800e 
 +    dec  e 
 +h800e call h8011 
 +h8011 ld   b,40h 
 +h8013 exx 
 +    ld   e,(hl) 
 +    inc  l 
 +    ld   d,(hl) 
 +    ld   a,l 
 +    add  a,b 
 +    ld   l,a 
 +    ld   a,c 
 +    srl  a 
 +    srl  e 
 +    jr   nc,h8022 
 +    add  a,c 
 +h8022 srl 
 +    srl  e 
 +    jr   nc,h8029 
 +    add  a,c 
 +h8029 srl 
 +    srl  e 
 +    jr   nc,h8030 
 +    add  a,c 
 +h8030 srl 
 +    srl  e 
 +    jr   nc,h8037 
 +    add  a,c 
 +h8037 srl 
 +    srl  e 
 +    jr   nc,h803e 
 +    add  a,c 
 +h803e srl 
 +    srl  e 
 +    jr   nc,h8045 
 +    add  a,c 
 +h8045 srl 
 +    srl  e 
 +    jr   nc,h804c 
 +    add  a,c 
 +h804c srl 
 +    srl  e 
 +    jr   nc,h8053 
 +    add  a,c 
 +h8053 srl 
 +    srl  d 
 +    jr   nc,h805a 
 +    add  a,c 
 +h805a srl 
 +    srl  d 
 +    jr   nc,h8061 
 +    add  a,c 
 +h8061 srl 
 +    srl  d 
 +    jr   nc,h8068 
 +    add  a,c 
 +h8068 srl 
 +    adc  a,d 
 +    exx 
 +    xor  e 
 +    jp   p,h8071 
 +    inc  a 
 +h8071 add  a,c 
 +    ld   (hl),
 +    inc  l 
 +    djnz h8013 
 +    exx 
 +    ld   a,b 
 +    xor  0fch 
 +    ld   b,a 
 +    exx 
 +    ret 
 +   
 +sintabb: 
 +    db   00h,00h,32h,00h 
 +    db   64h,00h,97h,00h 
 +    db   0c9h,00h,0fbh,00h 
 +    db   2dh,01h 
 +    db   5eh,01h,90h,01h 
 +    db   0c1h,01h,0f2h,01h 
 +    db   22h,02h,53h,02h 
 +    db   82h,02h 
 +    db   0b2h,02h,0e1h,02h 
 +    db   10h,03h,3eh,03h 
 +    db   6ch,03h,99h,03h 
 +    db   0c5h,03h 
 +    db   0f1h,03h,1dh,04h 
 +    db   48h,04h,72h,04h 
 +    db   9bh,04h,0c4h,04h 
 +    db   0ech,04h 
 +    db   13h,05h,3ah,05h 
 +    db   5fh,05h,84h,05h 
 +    db   0a8h,05h,0cbh,05h 
 +    db   0edh,05h 
 +    db   0fh,06h,2fh,06h 
 +    db   4fh,06h,6dh,06h 
 +    db   8ah,06h,0a7h,06h 
 +    db   0c2h,06h 
 +    db   0ddh,06h,0f6h,06h 
 +    db   0eh,07h,25h,07h 
 +    db   3bh,07h,50h,07h 
 +    db   64h,07h 
 +    db   77h,07h,88h,07h 
 +    db   99h,07h,0a8h,07h 
 +    db   0b6h,07h,0c3h,07h 
 +    db   0ceh,07h 
 +    db   0d9h,07h,0e2h,07h 
 +    db   0eah,07h,0f1h,07h 
 +    db   0f6h,07h,0fah,07h 
 +    db   0feh,07h 
 +    db   0ffh,07h,0ffh,07h 
 +</code> 
 + 
 +---- 
 + 
 +**Navigation: [[general]] . [[math]] . [[graphic]] . [[sound]] . [[system]] . [[other]] . back to [[start]]**
makesin.1357849942.txt.gz · Last modified: 2013/01/10 21:32 by darkbyte