summaryrefslogtreecommitdiff
path: root/apps/plugins/sdl/progs/wolf3d/gp2x.h
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2019-07-07 22:00:20 -0400
committerFranklin Wei <git@fwei.tk>2019-07-09 11:20:55 -0400
commit3f59fc8b771625aca9c3aefe03cf1038d8461963 (patch)
treee0623a323613baa0b0993411b38bcaed144b27ed /apps/plugins/sdl/progs/wolf3d/gp2x.h
parent439a0d1d91fa040d261fc39b87278bc9f5391dcc (diff)
downloadrockbox-3f59fc8b771625aca9c3aefe03cf1038d8461963.tar.gz
rockbox-3f59fc8b771625aca9c3aefe03cf1038d8461963.zip
Wolfenstein 3-D!
This is a port of Wolf4SDL, which is derived from the original id software source release. The port runs on top of the SDL plugin runtime and is loaded as an overlay. Licensing of the game code is not an issue, as discussed below (essentially, the Debian project treats Wolf4SDL as GPLv2, with an email from John Carmack backing it up): http://forums.rockbox.org/index.php?topic=52872 Included is a copy of MAME's Yamaha OPL sound chip emulator (fmopl_gpl.c). This file was not part of the original Wolf4SDL source (which includes a non-GPL'd version), but was rather rebased from from a later MAME source which had been relicensed to GPLv2. Change-Id: I64c2ba035e0be7e2f49252f40640641416613439
Diffstat (limited to 'apps/plugins/sdl/progs/wolf3d/gp2x.h')
-rw-r--r--apps/plugins/sdl/progs/wolf3d/gp2x.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/apps/plugins/sdl/progs/wolf3d/gp2x.h b/apps/plugins/sdl/progs/wolf3d/gp2x.h
new file mode 100644
index 0000000000..f8b3557a41
--- /dev/null
+++ b/apps/plugins/sdl/progs/wolf3d/gp2x.h
@@ -0,0 +1,51 @@
1#ifndef GP2X_H
2#define GP2X_H
3
4#include <SDL/SDL.h>
5#include <sys/ioctl.h>
6#include <sys/soundcard.h>
7#include <fcntl.h>
8#include <unistd.h>
9
10#include "wl_def.h"
11
12#define GP2X_BUTTON_UP (0)
13#define GP2X_BUTTON_DOWN (4)
14#define GP2X_BUTTON_LEFT (2)
15#define GP2X_BUTTON_RIGHT (6)
16#define GP2X_BUTTON_UPLEFT (1)
17#define GP2X_BUTTON_UPRIGHT (7)
18#define GP2X_BUTTON_DOWNLEFT (3)
19#define GP2X_BUTTON_DOWNRIGHT (5)
20#define GP2X_BUTTON_CLICK (18)
21#define GP2X_BUTTON_A (12)
22#define GP2X_BUTTON_B (13)
23#define GP2X_BUTTON_X (15)
24#define GP2X_BUTTON_Y (14)
25#define GP2X_BUTTON_L (11)
26#define GP2X_BUTTON_R (10)
27#define GP2X_BUTTON_START (8)
28#define GP2X_BUTTON_SELECT (9)
29#define GP2X_BUTTON_VOLUP (16)
30#define GP2X_BUTTON_VOLDOWN (17)
31
32#define VOLUME_MIN 0
33#define VOLUME_MAX 100
34#define VOLUME_CHANGE_RATE 2
35#define VOLUME_NOCHG 0
36#define VOLUME_DOWN 1
37#define VOLUME_UP 2
38#define KEY_DOWN 1
39#define KEY_UP 0
40
41void GP2X_Init();
42void GP2X_Shutdown();
43void GP2X_StartMMUHack();
44
45void GP2X_AdjustVolume( int direction );
46void GP2X_ButtonDown( int button );
47void GP2X_ButtonUp( int button );
48void Screenshot( void );
49void SetKeyboard( unsigned int key, int press );
50
51#endif // GP2X_H