Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!bloom-beacon!eru!hagbard!sunic!dkuug!diku!thomas From: thomas@diku.dk (Thomas Nikolajsen) Newsgroups: comp.sys.amiga.programmer Subject: VPOSR/VHPOSR custom register values (which do they take) Summary: which values do VPOSR/VHPOSR take? Keywords: video position timer, task timing, PAL/NTSC differences Message-ID: <1991Jun18.120731.13523@odin.diku.dk> Date: 18 Jun 91 12:07:31 GMT Sender: thomas@rimfaxe.diku.dk Organization: Department of Computer Science, U of Copenhagen Lines: 55 Hello, I tried this question in comp.sys.amiga.hardware, to no avail, so here we go (it isn't too hardware related anyway). Please dig out the info, or if there is no answer then say it (Dave). Background: Inspired by the timer code in Tomas Rokickis old profiler I want to use VPOSR/VHPOSR as a timer too (for adding per task time usage to Xoper; not only per task switch number. For this task I think it is important not to take up a CIA timer). As I want the timer to be as accurate as possible and work on all amigas, (PAL/NTSC, AmigaOS version x.y) I need some info. Question: Which values (intervals) does the custom registers VPOSR/VHPOSR take? Is the resolution 280ns; as given in the hardware manual? Are there differences for PAL/NTSC machines (in intervals/resolution)? For short lets call VPOSR/VHPOSR (32b) for VPOSR.l. It is only the video position I am interested in, lets call it: vpos_h = VPOSR.l and $ff ; horizontal vpos_v = VPOSR.l and $1ff00 ; vertical In my rather old hardware manual it is just stated that the resolution is '1/160 of the screen width or 280ns'. I have made a little program to get emperical results, it gives (PAL): vpos_h in 0 .. $e2 ( 0 .. 226 ) vpos_v in 0 .. $138 ( 0 .. 312 ) The problem is now that these values doesn't match the 280ns given in the hardware manual: 313*227*280 ns = 1/50.27 s Vertical blank frequency if 50 Hz for PAL. In the 'Introduction to the Amiga 500' which I got when I brought the Amiga, Appendix F: 'Amiga 500 Schematics', page F-9 contains: Master Clock: X1 Oscillator 28.63836 MHz. Which makes me believe that the resolution is: 1/(28.63836*1000000/8) s = 279.35 ns which gives: 313*227*275.35 ns = 1/50.38 s Which brings me to the other questions, is the 280ns value exact? and is the resolution different for PAL/NTSC machines (what is it?)? Is VPOSR.l a good timer (stable ..), does it count when video DMA is off (haven't tried yet)? I know (from the hardware manual) that it is unusable when a light pen is connacted. Which is the correct way to distinguish between PAL/NTSC machines (mode)? Is it PowerSupplyFrequency(SysBase) or VBlankFrequency(SysBase) or ..? I don't know much about hardware, I just try to use it (for programming). When I have gotten this info, I will send off the diffs for xoper to Werner Gu:nther, so he can include it in his next official version. thomas@diku.dk, Thomas Nikolajsen, CS. Dept, U. of Copenhagen, Denmark