shift pistol HUD sprite
[d2d-psx.git] / src / keyb.h
blob59c6ceb64a66cec89f42009715bbbf20c37e7bfd
1 /*
2 * Драйвер клавиатуры V1.1 для DOS4GW (а также DirectX 3)
3 * Copyright (C) Алексей Волынсков, 1996
5 * Copyright (C) Prikol Software 1996-1997
6 * Copyright (C) Aleksey Volynskov 1996-1997
7 * Copyright (C) <ARembo@gmail.com> 2011
8 * Copyright (C) fgsfds 2019
10 * This file is part of the Doom2D PSX project.
12 * Doom2D PSX is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
16 * Doom2D PSX is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, see <http://www.gnu.org/licenses/> or
23 * write to the Free Software Foundation, Inc.,
24 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 #ifndef MYKEYB
28 # define MYKEYBs
30 # ifdef __cplusplus
31 extern "C" {
32 # endif
34 #include <sys/types.h>
35 #include <libetc.h>
37 extern unsigned int pad_btns;
38 extern unsigned int pad_trig;
40 #define K_P1_UP _PAD(0, PADLup)
41 #define K_P1_DOWN _PAD(0, PADLdown)
42 #define K_P1_LEFT _PAD(0, PADLleft)
43 #define K_P1_RIGHT _PAD(0, PADLright)
44 #define K_P1_TRIANGLE _PAD(0, PADRup)
45 #define K_P1_CROSS _PAD(0, PADRdown)
46 #define K_P1_SQUARE _PAD(0, PADRleft)
47 #define K_P1_CIRCLE _PAD(0, PADRright)
48 #define K_P1_L1 _PAD(0, PADL1)
49 #define K_P1_L2 _PAD(0, PADL2)
50 #define K_P1_R1 _PAD(0, PADR1)
51 #define K_P1_R2 _PAD(0, PADR2)
52 #define K_P1_START _PAD(0, PADstart)
53 #define K_P1_SELECT _PAD(0, PADselect)
55 #define K_P2_UP _PAD(1, PADLup)
56 #define K_P2_DOWN _PAD(1, PADLdown)
57 #define K_P2_LEFT _PAD(1, PADLleft)
58 #define K_P2_RIGHT _PAD(1, PADLright)
59 #define K_P2_TRIANGLE _PAD(1, PADRup)
60 #define K_P2_CROSS _PAD(1, PADRdown)
61 #define K_P2_SQUARE _PAD(1, PADRleft)
62 #define K_P2_CIRCLE _PAD(1, PADRright)
63 #define K_P2_L1 _PAD(1, PADL1)
64 #define K_P2_L2 _PAD(1, PADL2)
65 #define K_P2_R1 _PAD(1, PADR1)
66 #define K_P2_R2 _PAD(1, PADR2)
67 #define K_P2_START _PAD(1, PADstart)
68 #define K_P2_SELECT _PAD(1, PADselect)
70 #define K_held(x) (pad_btns & (x))
71 #define K_pressed(x) (pad_trig & (x))
73 void K_init(void);
74 void K_done(void);
75 void K_update(void);
76 const char *K_name(int k);
78 // тип функции обработки клавиш
79 typedef void key_f (int k, int pressed);
81 // установить функцию обработки клавиш
82 void K_setkeyproc(key_f *);
84 # ifdef __cplusplus
86 # endif
88 #endif // ifndef MYKEYB