Lines Matching refs:gameport

1 Programming gameport drivers
4 1. A basic classic gameport
7 If the gameport doesn't provide more than the inb()/outb() functionality,
10 struct gameport gameport;
12 gameport.io = MY_IO_ADDRESS;
13 gameport_register_port(&gameport);
15 Make sure struct gameport is initialized to 0 in all other fields. The
16 gameport generic code will take care of the rest.
26 If your hardware supports a gameport address that is not mapped to ISA io
30 gameport. Although only one ioport is really used, the gameport usually
33 Please also consider enabling the gameport on the card in the ->open()
40 2. Memory mapped gameport
43 When a gameport can be accessed through MMIO, this way is preferred, because
44 it is faster, allowing more reads per second. Registering such a gameport
47 struct gameport gameport;
49 void my_trigger(struct gameport *gameport)
54 unsigned char my_read(struct gameport *gameport)
59 gameport.read = my_read;
60 gameport.trigger = my_trigger;
61 gameport_register_port(&gameport);
63 3. Cooked mode gameport
68 the gameport. To register a cooked gameport:
70 struct gameport gameport;
72 int my_cooked_read(struct gameport *gameport, int *axes, int *buttons)
81 int my_open(struct gameport *gameport, int mode)
86 gameport.cooked_read = my_cooked_read;
87 gameport.open = my_open;
88 gameport.fuzz = 8;
89 gameport_register_port(&gameport);
104 more than one gameport instance simultaneously, use the ->private member of
105 the gameport struct to point to your data.
107 5. Unregistering a gameport
112 gameport_unregister_port(&gameport);
114 6. The gameport structure
117 struct gameport {
121 A private pointer for free use in the gameport driver. (Not the joystick
126 Number assigned to the gameport when registered. Informational purpose only.
131 to some value if your gameport supports raw mode.
135 Raw mode speed of the gameport reads in thousands of reads per second.
139 If the gameport supports cooked mode, this should be set to a value that
142 void (*trigger)(struct gameport *);
147 unsigned char (*read)(struct gameport *);
152 int (*cooked_read)(struct gameport *, int *axes, int *buttons);
154 If the gameport supports cooked mode, it should point this to its cooked
158 int (*calibrate)(struct gameport *, int *axes, int *max);
167 int (*open)(struct gameport *, int mode);
172 here. Prior to this call, other fields of the gameport struct (namely the io
175 void (*close)(struct gameport *);
178 gameport.
181 struct gameport *next;
183 For internal use by the gameport layer.