Frames timer

Anything QL Software or Programming Related.
Post Reply
User avatar
1024MAK
Super Gold Card
Posts: 593
Joined: Sun Dec 11, 2011 1:16 am
Location: Looking forward to summer in Somerset, UK...

Frames timer

Post by 1024MAK »

I was doing some research about timers/time information on the QL and came across this topic Floating Point Numbers.

Well, although it does not appear to be documented (a list of the system variables shows this as SV_RAND pseudo random number, offset 2E), I have found what appears to be a frames counter (by which I mean, it counts video frames at 50Hz / 20mS). The system I tried this on is a standard QL with a JS ROM.

Now I have not tested this on any other QL systems and this frames clock may be affected by other operations or hardware. This may affect it's accuracy, so keep that in mind.

Code: Select all

QL with JS ROM
FRAMES 50Hz (20mS) counter

Example:-
10 PAPER 0
20 CLS
30 frames=PEEK_W(163886)+32768
40 AT 0,0:PRINT frames,INT(frames/50)
50 GO TO 30
Mark


:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer in Somerset later in the year :)

QL, Falcon, Atari 520STFM, Atari 1040STE, more PC's than I care to count and an assortment of 8 bit micros (Sinclair and Acorn)(nearly forgot the Psion's)
Post Reply