2 // Analog joystick handler
5 // GCC/SDL port by Niels Wagenaar (Linux/WIN32) and Caz (BeOS)
6 // Cleanups by James L. Hammons
11 static uint8 anajoy_ram[2];
12 static uint8 analog_x, analog_y;
15 void anajoy_init(void)
20 void anajoy_reset(void)
22 memset(anajoy_ram,0x00,2);
27 void anajoy_done(void)
31 void anajoy_byte_write(uint32 offset, uint8 data)
33 anajoy_ram[offset&0x01]=data;
36 void anajoy_word_write(uint32 offset, uint16 data)
39 anajoy_ram[offset+0]=(data>>8)&0xff;
40 anajoy_ram[offset+1]=data&0xff;
43 uint8 anajoy_byte_read(uint32 offset)
45 if (anajoy_ram[1]&0x01)
51 uint16 anajoy_word_read(uint32 offset)
53 uint16 data=anajoy_byte_read((offset+0)&0x01);
55 data|=anajoy_byte_read((offset+1)&0x01);