PVcollib  1.5.0
A devkit for ColecoVision
pad.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------------
2 
3  Generic pad & spinner functions.
4 
5  Copyright (C) 2018-2019
6  Alekmaul
7 
8  This software is provided 'as-is', without any express or implied
9  warranty. In no event will the authors be held liable for any
10  damages arising from the use of this software.
11 
12  Permission is granted to anyone to use this software for any
13  purpose, including commercial applications, and to alter it and
14  redistribute it freely, subject to the following restrictions:
15 
16  1. The origin of this software must not be misrepresented; you
17  must not claim that you wrote the original software. If you use
18  this software in a product, an acknowledgment in the product
19  documentation would be appreciated but is not required.
20  2. Altered source versions must be plainly marked as such, and
21  must not be misrepresented as being the original software.
22  3. This notice may not be removed or altered from any source
23  distribution.
24 
25 
26 ---------------------------------------------------------------------------------*/
38 #ifndef COL_PAD_H
39 #define COL_PAD_H
40 
41 #include <coleco/coltypes.h>
42 
43 #define PAD_UP 1
44 #define PAD_RIGHT 2
45 #define PAD_DOWN 4
46 #define PAD_LEFT 8
47 #define PAD_FIRE4 16
48 #define PAD_FIRE3 32
49 #define PAD_FIRE2 64
50 #define PAD_FIRE1 128
51 
52 #define PAD_KEY0 0
53 #define PAD_KEY1 1
54 #define PAD_KEY2 2
55 #define PAD_KEY3 3
56 #define PAD_KEY4 4
57 #define PAD_KEY5 5
58 #define PAD_KEY6 6
59 #define PAD_KEY7 7
60 #define PAD_KEY8 8
61 #define PAD_KEY9 9
62 #define PAD_KEYSTAR 10
63 #define PAD_KEYSHARP 11
64 #define PAD_KEYNONE 15
65 
69 extern volatile u8 joypad_1;
70 
74 extern volatile u8 joypad_2;
75 
80 extern volatile char spinner_1;
81 
85 extern volatile char spinner_2;
86 
90 extern volatile u8 keypad_1;
91 
95 extern volatile u8 keypad_2;
96 
101 void pad_resetspin(void);
102 
107 void pad_disablespin(void);
108 
113 void pad_enablespin(void);
114 
115 #endif
volatile char spinner_2
SPINNER 2 value.
volatile char spinner_1
SPINNER 1 value /!\ spinner 1 value is reversed
void pad_enablespin(void)
enable spinners functions to get their values
volatile u8 joypad_2
PAD 2 value.
Custom types used by pvcollib.
volatile u8 keypad_1
KEYBOARD from PAD 1 values.
void pad_resetspin(void)
reset spinners 1 & 2 values
void pad_disablespin(void)
enable spinners functions
volatile u8 joypad_1
PAD 1 value.
volatile u8 keypad_2
KEYBOARD from PAD 2 values.