Path: chuka.playstation.co.uk!news From: "Derek da Silva" Newsgroups: scee.yaroze.beginners Subject: Re: Counters Date: Sun, 21 Feb 1999 12:44:03 -0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 46 Message-ID: <7aov1r$erp14@chuka.playstation.co.uk> References: <7ahnnv$btf15@chuka.playstation.co.uk> <7ai02v$btf20@chuka.playstation.co.uk> NNTP-Posting-Host: pFCs13a01.client.global.net.uk X-Newsreader: Microsoft Outlook Express 4.72.3110.1 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Here's some info from way back in May 1997. Look, and ye shall find... So, nobody knows how often the timers are incremented? :-) >Basically, a call to GetRCnt(1) obtains the value of this >counter; it seems to increment Very fast (not yet sure how fast), >and its range is (we think) 0-65535 ie unsigned_short, >and can be expected to wraparound very often (more than once >per second). >Sorry about the uncertainty, but we're unsure about the >other timers and whether or nopt they're usable. >Will post again soon. >There are 3 root counters, 0, 1, and 2. The return values are 0-65535, >root counter 1 is slowest. As theres no information on which root >counter measures what, so we don't know the timings, so it'll have to be >trial and error (1 maybe hsyncs). > >As for the code, something like this should do the trick. > >void main(void) >{ > printf("starting\n"); > StartRCnt(1); // not needed on Yaroze > ResetRCnt(1); > > while(!kbhit()) > { > if (GetRCnt(1) == 40) > { > printf("event\n"); > ResetRCnt(1); > } > } > getch(); > printf("done\n"); >} >SCEE Developer Support Derek --- --- --- --- --- --- dasi@globalnet.co.uk