[comp.sys.atari.st.tech] using evnt_timer

rcb@netcom.UUCP (Roy Bixler) (09/04/90)

I have just ported my first program which uses Turbo C's graphics to GEM
and the Atari ST.  Everything works except for when I call evnt_timer(). 

I have checked out 3 different sources on the parameter usage and they
all have a different story.  Abacus' GEM Programmer's Reference says
that evnt_timer() takes two 32-bit parameters, which make up a 64-bit
millisecond delay (the first parameter is the low-order 32 bits ...). 
Tim Oren's Profession GEM series column 12 specifies that the
millisecond delay is a 32-bit value passed as 2 16-bit parameters.  The
aesbind.h file that comes with GCC 1.37.1 says there is one 32-bit
parameter.  I have tried all of these and the result is always that my
timer waits a lot longer than I would like (i.e. the machine seems to
lock up).  If I reverse the order of parameters (where there are 2
parameters, of course), there is no delay.  Can anyone help?

Roy Bixler
netcom!rcb@apple.com

bammi@curie.ces.cwru.edu (Jwahar R. Bammi) (09/04/90)

In article <13154@netcom.UUCP> rcb@netcom.UUCP (Roy Bixler) writes:
   and the Atari ST.  Everything works except for when I call evnt_timer(). 

sounds like i screwed up the low and high words of the long in the
aes bindings. here is a diff:
-
*** /tmp/,RCSt1a01858	Mon Sep  3 17:06:12 1990
--- aesevnt.c	Mon Sep  3 17:02:33 1990
***************
*** 117,124 ****
  {
      unsigned short *i = (unsigned short *)&Interval;
      
!     _int_in[0] = i[0];
!     _int_in[1] = i[1];
      return __aes__(AES_CONTROL_ENCODE(24, 2, 1, 0));
  }
  
--- 117,124 ----
  {
      unsigned short *i = (unsigned short *)&Interval;
      
!     _int_in[0] = i[1];
!     _int_in[1] = i[0];
      return __aes__(AES_CONTROL_ENCODE(24, 2, 1, 0));
  }
  
***************
*** 170,177 ****
      _int_in[12] = In2W;
      _int_in[13] = In2H;
      
!     _int_in[14] = i[0];
!     _int_in[15] = i[1];
      
  #ifdef __MSHORT__
      _addrin[0] = MesagBuf;
--- 170,177 ----
      _int_in[12] = In2W;
      _int_in[13] = In2H;
      
!     _int_in[14] = i[1];
!     _int_in[15] = i[0];
      
  #ifdef __MSHORT__
      _addrin[0] = MesagBuf;
--
bang:   {any internet host}!dsrgsun.CES.CWRU.Edu!bammi	jwahar r. bammi
domain: bammi@dsrgsun.ces.CWRU.edu
GEnie:	J.Bammi