2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
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>
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 */
32 struct Device gp_device
;
33 struct Library
*gp_MouseHiddBase
;
35 struct MinList gp_PendingQueue
; /* IOrequests (GPD_READEVENT)
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 */
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_
;
60 #define HiddMouseAB (GPBase->HiddMouseAB_)
64 UWORD gpu_readPos
; /* Position in the key buffer */
65 UWORD gpu_Qualifiers
; /* Known qualifiers at this moment */
68 UBYTE gpu_flags
; /* For unit flags definitions, see below */
73 struct GamePortTrigger gpu_trigger
;
76 #define GBUB_PENDING 0 /* Unit has pending request for gameport
78 #define GBUF_PENDING 0x01
80 #endif /* GAMEPORT_INTERN_H */