define __KERNEL_STRICT_NAMES to avoid inclusion of kernel types on systems that carry...
[cake.git] / rom / devs / gameport / gameport_intern.h
blobff1681319061068d34c84a8344f72889ea741222
1 /*
2 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
9 #ifndef GAMEPORT_INTERN_H
10 #define GAMEPORT_INTERN_H
12 #include <exec/types.h>
13 #include <exec/devices.h>
14 #include <exec/semaphores.h>
15 #include <exec/interrupts.h>
16 #include <exec/devices.h>
18 #include <oop/oop.h>
19 #include <devices/gameport.h>
21 /* Must always be a multiple of 3 since one event consists of code, x and y */
23 #define GP_NUMELEMENTS (100 * 3)
24 #define GP_BUFFERSIZE (sizeof (WORD) * GP_NUMELEMENTS)
26 #define GP_NUNITS 2 /* Number of units supported by gameport.device */
28 #define GP_MAXUNIT 1 /* Highest possible gameport unit */
30 struct GameportBase
32 struct Device gp_device;
33 struct Library *gp_LowLevelBase;
35 struct MinList gp_PendingQueue; /* IOrequests (GPD_READEVENT)
36 not done quick */
37 struct SignalSemaphore gp_QueueLock;
38 struct SignalSemaphore gp_Lock;
40 struct Interrupt gp_Interrupt; /* Interrupt to invoke in case of
41 keypress (or releases) and there
42 are pending requests */
43 struct Interrupt gp_VBlank; /* Gameport VBlank server */
45 WORD *gp_eventBuffer;
46 UWORD gp_writePos;
48 ULONG gp_nTicks; /* Bookkeeping of frames */
50 OOP_Object *gp_Hidd; /* Hidd object to use */
52 UBYTE gp_cTypes[GP_NUNITS];
54 BOOL gp_RelativeMouse;
55 OOP_AttrBase HiddMouseAB_;
58 #ifdef HiddMouseAB
59 #undef HiddMouseAB
60 #endif
61 #define HiddMouseAB (GPBase->HiddMouseAB_)
63 typedef struct GPUnit
65 UWORD gpu_readPos; /* Position in the key buffer */
66 UWORD gpu_Qualifiers; /* Known qualifiers at this moment */
68 UWORD gpu_unitNum;
69 UBYTE gpu_flags; /* For unit flags definitions, see below */
71 WORD gpu_lastX;
72 WORD gpu_lastY;
74 struct GamePortTrigger gpu_trigger;
75 } GPUnit;
77 #define GBUB_PENDING 0 /* Unit has pending request for gameport
78 events */
79 #define GBUF_PENDING 0x01
81 #endif /* GAMEPORT_INTERN_H */