revert between 56095 -> 55830 in arch
[AROS.git] / rom / devs / gameport / gameport_intern.h
blob3ecfeeff38e8b58a6bb752e62306d65e90ecbd64
1 /*
2 Copyright © 1995-2010, 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 4 since one event consists of code, x, y and flags */
23 #define GP_NUMELEMENTS (100 * 4)
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_MouseHiddBase;
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 OOP_AttrBase HiddMouseAB_;
57 #ifdef HiddMouseAB
58 #undef HiddMouseAB
59 #endif
60 #define HiddMouseAB (GPBase->HiddMouseAB_)
62 typedef struct GPUnit
64 UWORD gpu_readPos; /* Position in the key buffer */
65 UWORD gpu_Qualifiers; /* Known qualifiers at this moment */
67 UWORD gpu_unitNum;
68 UBYTE gpu_flags; /* For unit flags definitions, see below */
70 WORD gpu_lastX;
71 WORD gpu_lastY;
73 struct GamePortTrigger gpu_trigger;
74 } GPUnit;
76 #define GBUB_PENDING 0 /* Unit has pending request for gameport
77 events */
78 #define GBUF_PENDING 0x01
80 #endif /* GAMEPORT_INTERN_H */