joy.c (6734) | joy.c (7430) |
---|---|
1/*- 2 * Copyright (c) 1995 Jean-Marc Zucconi 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 18 unchanged lines hidden (view full) --- 27 * 28 */ 29#include "joy.h" 30 31#if NJOY > 0 32 33#include <errno.h> 34 | 1/*- 2 * Copyright (c) 1995 Jean-Marc Zucconi 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 18 unchanged lines hidden (view full) --- 27 * 28 */ 29#include "joy.h" 30 31#if NJOY > 0 32 33#include <errno.h> 34 |
35#include <sys/types.h> | 35#include <sys/param.h> 36#include <sys/systm.h> |
36 | 37 |
37#include <machine/cpufunc.h> | |
38#include <machine/joystick.h> 39 40#include <i386/isa/isa.h> 41#include <i386/isa/isa_device.h> 42#include <i386/isa/timerreg.h> 43 44/* The game port can manage 4 buttons and 4 variable resistors (usually 2 45 * joysticks, each with 2 buttons and 2 pots.) via the port at address 0x201. --- 107 unchanged lines hidden (view full) --- 153 break; 154 } 155 enable_intr (); 156 c.x = x ? joy[unit].x_off[joypart(dev)] + ticks2usec(t0-x) : 0x80000000; 157 c.y = y ? joy[unit].y_off[joypart(dev)] + ticks2usec(t0-y) : 0x80000000; 158 state >>= 4; 159 c.b1 = ~state & 1; 160 c.b2 = ~(state >> 1) & 1; | 38#include <machine/joystick.h> 39 40#include <i386/isa/isa.h> 41#include <i386/isa/isa_device.h> 42#include <i386/isa/timerreg.h> 43 44/* The game port can manage 4 buttons and 4 variable resistors (usually 2 45 * joysticks, each with 2 buttons and 2 pots.) via the port at address 0x201. --- 107 unchanged lines hidden (view full) --- 153 break; 154 } 155 enable_intr (); 156 c.x = x ? joy[unit].x_off[joypart(dev)] + ticks2usec(t0-x) : 0x80000000; 157 c.y = y ? joy[unit].y_off[joypart(dev)] + ticks2usec(t0-y) : 0x80000000; 158 state >>= 4; 159 c.b1 = ~state & 1; 160 c.b2 = ~(state >> 1) & 1; |
161 return uiomove (&c, sizeof(struct joystick), uio); | 161 return uiomove ((caddr_t)&c, sizeof(struct joystick), uio); |
162} 163int joyioctl (dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) 164{ 165 int unit = UNIT (dev); 166 int i = joypart (dev); 167 int x; 168 169 switch (cmd) { --- 39 unchanged lines hidden --- | 162} 163int joyioctl (dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) 164{ 165 int unit = UNIT (dev); 166 int i = joypart (dev); 167 int x; 168 169 switch (cmd) { --- 39 unchanged lines hidden --- |