2 Copyright © 1995-2006, 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 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 */
32 struct Device gp_device
;
33 struct Library
*gp_LowLevelBase
;
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 BOOL gp_RelativeMouse
;
55 OOP_AttrBase HiddMouseAB_
;
61 #define HiddMouseAB (GPBase->HiddMouseAB_)
65 UWORD gpu_readPos
; /* Position in the key buffer */
66 UWORD gpu_Qualifiers
; /* Known qualifiers at this moment */
69 UBYTE gpu_flags
; /* For unit flags definitions, see below */
74 struct GamePortTrigger gpu_trigger
;
77 #define GBUB_PENDING 0 /* Unit has pending request for gameport
79 #define GBUF_PENDING 0x01
81 #endif /* GAMEPORT_INTERN_H */