home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / programm / 18575 < prev    next >
Encoding:
Text File  |  1993-01-12  |  1.2 KB  |  44 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!spool.mu.edu!news.nd.edu!mentor.cc.purdue.edu!noose.ecn.purdue.edu!gn.ecn.purdue.edu!seifert
  3. From: seifert@gn.ecn.purdue.edu (Michael S. Seifert)
  4. Subject:  OS joystick routines
  5. Message-ID: <1993Jan12.173159.28081@gn.ecn.purdue.edu>
  6. Organization: Purdue University Engineering Computer Network
  7. Date: Tue, 12 Jan 93 17:31:59 GMT
  8. Lines: 34
  9.  
  10.  
  11. Ive been having some minor problems using the gameport.device to
  12. read an absolute joystick...  Although my code works, once in a 
  13. while it misses a joystick input...
  14.  
  15. There are a lot of calculations being done between READEVENTs, but
  16. I figured the device's buffer would just queue up the inputs.  The
  17. code looks a little like this...
  18.  
  19. for(;;)
  20. {
  21. calculations();
  22. readjoystick();
  23. timerdevicedelay(); 
  24. }
  25.  
  26. timerdevicedelay()
  27. {
  28. while (GetMsg != NULL) READEVENT();
  29. }
  30.  
  31. Ive tried putting more calls to the routine readjoystick() in the 
  32. middle of the calculations, but this doesnt seem to help...
  33. SO...
  34.  
  35. What would be a good solution? 
  36.  
  37. 1) Give up the gameport.device and use hardware bashing...
  38. 2) Fix something in this routine  (give solution, please)
  39. 3) or could I use an Interrupt to automatically read the joystick
  40.  
  41. thanks in advance,
  42. mike
  43.  
  44.