home *** CD-ROM | disk | FTP | other *** search
- Path: mordred.cc.jyu.fi!news
- From: daeron@horus.co.jyu.fi (Aki Laukkanen)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Integer Sine tables?
- Date: 26 Feb 1996 13:53:50 GMT
- Organization: University of Jyvaskyla, Finland
- Message-ID: <1410.6630T670T1066@horus.co.jyu.fi>
- References: <4glqbd$4ab@nnrp1.news.primenet.com>
- NNTP-Posting-Host: dynamic03.co.jyu.fi
- X-Newsreader: THOR 2.22 (Amiga;TCP/IP) *UNREGISTERED*
-
-
- > Since I am using assembly, how can I make sine tables without using an FPU?
- >(i.e. to use in 3d routines)
-
- I use this sort source (courtesy of Touchstone/Essence):
-
- --clip--
- calcsincos
- Size equ 4096 ;number of entries
- Amp equ 1024 ;the amplitude
- Pi equ 205887 ;Pi^1 = (3.14159)^1*65536
- Pi2 equ 646814 ;Pi^2 = (3.14159)^2*65536
-
- lea sin,a0
- moveq #0,d0 ; s = 0
- move.l #2*Pi*Amp/Size,d1 ; t = 2 * pi / Size
- move.l #4*Pi2/Size*65536/Size,d2 ; r = t * t
- move #Size-1,d7 ; number of values
-
- si2.Loop
- move.l d0,(a0) ; Store the value (but
- addq.l #2,a0 ; only the HIGH word!)
-
- move.l d2,d3 ; d3 = r
- muls.l d0,d4:d3 ; d3 + d4 = r * s
- sub.l d4,d1 ; t = t - r * s
- add.l d1,d0 ; s = s + t
- dbf d7,si2.Loop ; all data done?
- move.w #1024/2-1,d7
- lea sin,a0
- lea sin+4096*2,a1
- .copy move.l (a0)+,(a1)+
- dbf d7,.copy
- rts ; good bye!
-
- --clap--
-
-
- ---
- Daeron
-
- VirusScan: MS Windows found. Delete? (Y/y)
-
-