Ultimate Amiga
Network Boards => AMOS Language Discussion => AMOS Factory => AMOS Professional Forum => Topic started by: Yarc on September 06, 2013, 05:07:10 PM
-
Hi, after many years I have got myself an A1200 and tinkering with AMOS Pro. It's a great diversion from my current job as a C# developer. I am very rusty with AMOS after such a long time, and to be honest never an expert with AMOS. I would like to create a timing routine that can measure in milliseconds but struggling to see how this can be done. I know I need to use the Dev Open command to open the "timer.device" and make use of the Struc and probably Equ commands. I have looked through the AMOSPro_System_Equates file and found references to various timer entries such as UNIT_MICROHZ, TR_GETSYSTIME, but don't fully understand how I need to use these. Can anybody shed some light? Thanks.
-
It actually doesn't matter because regardless of the settings you put into Timer.device, it always syncs to the screen refresh rate.
If you really need advanced timing routines, you'll have to use a complex interface adapter chip (CIA) which has much more precise timing. As for how you'd do it with AmosPro? I'm not sure, apart from writing inline Assembly code.
-
Thanks SamuraiCrow for your reply. I have seen a small C program which accesses the timer.device to count in milliseconds and it looks like I should be able to replicate the code with Dev open command etc., but maybe as you say, this just isn't possible with Amos basic pro. Thanks anyway.
-
If you use an NTSC version of the Amiga, the milliseconds count will always be an even multiple of 1/60th of a second. Otherwise (PAL or SECAM) it will be 1/50th of a second. Those are the only 2 native video scan rates supported by the Timer.device code as a time base on a Classic Amiga.
-
I understand that this would be the timing for updating graphics, but what if I just want to time routines for testing performance of code?
-
On a Classic Amiga, you'll get much better timing resolution from a CIA timer. Follow this link (http://amigadev.elowar.com/read/ADCD_2.1/Hardware_Manual_guide/node012E.html) for documentation on its register layout.
-
Hi SamuraiCrow, thanks for the link! I'll take a look.