Difference for arch/linux/joystick.c from version 1.1 to 1.2


version 1.1 version 1.2
Line 5
 
Line 5
 #include <fcntl.h>  #include <fcntl.h>
 #include <unistd.h>  #include <unistd.h>
   
   #include "timer.h"
 #include "types.h"  #include "types.h"
 #include "mono.h"  #include "mono.h"
 #include "joy.h"  #include "joy.h"
Line 52
 
Line 53
  struct JS_DATA_TYPE joy_data;   struct JS_DATA_TYPE joy_data;
   
  for (i = 0; i < j_num_buttons; i++) {   for (i = 0; i < j_num_buttons; i++) {
  if (j_button[i].state && j_button[i].last_state) {   //changed 6/24/1999 to finally squish the timedown bug - Owen Evans
  j_button[i].timedown = 1490; // = 1500 makes for instant accelleration, etc but a += would make accelleration more gradual.   if (j_button[i].state != j_button[i].last_state) {
  } else {  
  j_button[i].timedown = 0;  
  if (j_button[i].state) {   if (j_button[i].state) {
  j_button[i].downcount++;   j_button[i].downcount++;
    j_button[i].timedown = timer_get_fixed_seconds();
  }   }
  }   }
    //end changed - OE
  j_button[i].last_state = j_button[i].state;   j_button[i].last_state = j_button[i].state;
  }   }
   
Line 345
 
Line 346
 }  }
   
   
   //changed 6/24/99 to finally squish the timedown bug - Owen Evans
 fix joy_get_button_down_time(int btn)  {  fix joy_get_button_down_time(int btn)  {
    fix downtime;
  j_Update_state ();   j_Update_state ();
   
  return j_button[btn].timedown;   if (j_button[btn].state) {
    downtime = timer_get_fixed_seconds() - j_button[btn].timedown;
    j_button[btn].timedown = timer_get_fixed_seconds();
    } else {
    downtime = 0;
 }  }
   
    return downtime;
   }
   //end changed - OE
   
 void joy_poll() {  void joy_poll() {
   

Legend:
line(s) removed in v.1.1 
line(s) changed
 line(s) added in v.1.2