45 lines
642 B
Plaintext
45 lines
642 B
Plaintext
BYTE RTCLOK1=$13
|
|
BYTE RTCLOK2=$14
|
|
BYTE PALNTSC=$D014
|
|
|
|
PROC Count(CARD max)
|
|
CARD i
|
|
|
|
FOR i=1 TO max DO OD
|
|
RETURN
|
|
|
|
CARD FUNC GetFrame()
|
|
CARD res
|
|
BYTE lsb=res,msb=res+1
|
|
|
|
lsb=RTCLOK2
|
|
msb=RTCLOK1
|
|
RETURN (res)
|
|
|
|
CARD FUNC FramesToMs(CARD frames)
|
|
CARD res
|
|
|
|
IF PALNTSC=15 THEN
|
|
res=frames*60
|
|
ELSE
|
|
res=frames*50
|
|
FI
|
|
RETURN (res)
|
|
|
|
PROC Main()
|
|
CARD ARRAY c=[1000 2000 5000 10000 20000 50000]
|
|
CARD beg,end,diff,diffMs
|
|
BYTE i
|
|
|
|
FOR i=0 TO 5
|
|
DO
|
|
PrintF("Count to %U takes ",c(i))
|
|
beg=GetFrame()
|
|
Count(c(i))
|
|
end=GetFrame()
|
|
diff=end-beg
|
|
diffMs=FramesToMs(diff)
|
|
PrintF("%U ms%E",diffMs)
|
|
OD
|
|
RETURN
|