Path: chuka.playstation.co.uk!news From: "Alex Herbert" Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: What do'you mean I have to brush up on me maths! Date: Wed, 14 Jul 1999 23:10:39 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 36 Message-ID: <7mj1bi$bjc2@chuka.playstation.co.uk> References: <7ko1jf$33u25@chuka.playstation.co.uk> <376fbd21.251404588@news.scea.sony.com> <7lkucs$ko217@chuka.playstation.co.uk> <7lnteg$i9a1@chuka.playstation.co.uk> <37823145.682258342@news.scea.sony.com> <7mah71$t1v6@chuka.playstation.co.uk> <378a1a59.1200158692@news.scea.sony.com> <7mioup$t1v11@chuka.playstation.co.uk> <7miu76$bjc1@chuka.playstation.co.uk> NNTP-Posting-Host: 212.56.110.165 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 > ... and divide the higher value (shifted left a few bits for resolution) by the > lower. ... Doh! That's not right. Should divide the lower value by the higher, thereby keeping the result within a known range. Oh, and here's that square root function: asm u_short sqroot(u_long) { addu v0,$0,$0 ori t0,$0,0x8000 or t1,v0,t0 L1: multu t1,t1 mflo t2 sltu $at,a0,t2 bne $at,$0,L2 srl t0,t0,1 addu v0,t1,$0 L2: bne t0,$0,L1 or t1,v0,t0 jr ra nop } If anyone has a quicker method, please let me know; thanks. Herbs