]> icculus.org git repositories - btb/d2x.git/blob - main/old/coindev.h
Stuff
[btb/d2x.git] / main / old / coindev.h
1 /*
2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.  
11 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
12 */
13
14
15
16 #ifndef _COINDEV_H
17 #define _COINDEV_H
18
19 /* Header file to define the JoyStick access functions */
20 /* and bit-masks.                                      */
21 /*                                                     */
22 /* Updates:                                            */
23 /*                                                     */
24 /*    + Reworked the conio.h check to work with both   */
25 /*      Borland and Watcom compilers.                  */
26 /*    + Added UPDATE_JOYSTICK_VALUE and global value   */
27 /*      JoyStickValue to allow for a stable state of   */
28 /*      joystick condition.  This means that once at   */
29 /*      the begining of each game loop (frame) you     */
30 /*      should execute UPDATE_JOYSTICK_VALUE, then     */
31 /*      use JoyStickValue for the remainder of that    */
32 /*      entire loop to determine joystick settings.    */
33 /*    + Added values needed by the CoinMech section    */
34 /*      of the digital I/O card.                       */
35
36 #define IOCARD_BASEPORT         0x2A0
37
38 //#define JOYSTICK_PORT           (IOCARD_BASEPORT + 1)
39 //#define JS_TRIGGER              0x0001
40 //#define JS_BUTTONLEFT           0x0002
41 //#define JS_BUTTONRIGHT          0x0004
42 //#define JS_BUTTONCENTER         0x0008
43 //#define JS_UP                   0x0010
44 //#define JS_DOWN                 0x0020
45 //#define JS_LEFT                 0x0040
46 //#define JS_RIGHT                0x0080
47
48 #define COINMECH_CMDPORT        (IOCARD_BASEPORT + 7)
49 #define COINMECH_ADJPORT        (IOCARD_BASEPORT + 3)
50
51 #define COINMECH1_PORT          (IOCARD_BASEPORT + 4)
52 #define COINMECH2_PORT          (IOCARD_BASEPORT + 5)
53 #define COINMECH3_PORT          (IOCARD_BASEPORT + 6)
54
55 #define COINMECH1_ADJMASK       0x10
56 #define COINMECH2_ADJMASK       0x20
57 #define COINMECH3_ADJMASK       0x40
58
59 #define COINMECH1_CTRLMASK      0x30
60 #define COINMECH2_CTRLMASK      0x70
61 #define COINMECH3_CTRLMASK      0xB0
62
63
64 // Include file for use with gameport coin mech interface and parallel
65 // port joystick interface
66
67 //#define GAMEPORT_ADDR 0x201
68
69 //#define PARALLEL_ADDR 0x378
70
71 #define MECH1   16
72 #define MECH2   32
73 #define MECH3   64
74 // #define MECH4          // Not supported yet.
75
76 //#define FIRE    1
77 //#define LBUTTON 2
78 //#define RBUTTON 4
79 //#define CBUTTON 8
80
81 //#define UP      16
82 //#define DOWN    32
83 //#define LEFT    64
84 //#define RIGHT   128
85
86 //#define JOY_GAMEPORT  0
87 //#define JOY_PARALLEL  1
88 //#define JOY_IODEV     2
89
90 int coindev_init(int CoinMechNumber);
91 unsigned int coindev_read(int CoinMechNumber);
92 unsigned int coindev_count(int CoinMechNumber);
93
94 #define ARCADE_FIRST_SECONDS            120
95 #define ARCADE_CONTINUE_SECONDS 60
96
97 #endif