summaryrefslogtreecommitdiff
path: root/apps/plugins/sdl/progs/wolf3d/id_ca.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/id_ca.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/id_ca.h')
-rw-r--r--apps/plugins/sdl/progs/wolf3d/id_ca.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/apps/plugins/sdl/progs/wolf3d/id_ca.h b/apps/plugins/sdl/progs/wolf3d/id_ca.h
new file mode 100644
index 0000000000..87a8886417
--- /dev/null
+++ b/apps/plugins/sdl/progs/wolf3d/id_ca.h
@@ -0,0 +1,60 @@
1#ifndef __ID_CA__
2#define __ID_CA__
3
4//===========================================================================
5
6#define NUMMAPS 60
7#ifdef USE_FLOORCEILINGTEX
8 #define MAPPLANES 3
9#else
10 #define MAPPLANES 2
11#endif
12
13#define UNCACHEGRCHUNK(chunk) {if(grsegs[chunk]) {free(grsegs[chunk]); grsegs[chunk]=NULL;}}
14#define UNCACHEAUDIOCHUNK(chunk) {if(audiosegs[chunk]) {free(audiosegs[chunk]); audiosegs[chunk]=NULL;}}
15
16//===========================================================================
17
18typedef struct
19{
20 int32_t planestart[3];
21 word planelength[3];
22 word width,height;
23 char name[16];
24} maptype;
25
26//===========================================================================
27
28extern int mapon;
29
30extern word *mapsegs[MAPPLANES];
31extern byte *audiosegs[NUMSNDCHUNKS];
32extern byte *grsegs[NUMCHUNKS];
33
34extern char extension[5];
35extern char graphext[5];
36extern char audioext[5];
37
38//===========================================================================
39
40boolean CA_LoadFile (const char *filename, memptr *ptr);
41boolean CA_WriteFile (const char *filename, void *ptr, int32_t length);
42
43int32_t CA_RLEWCompress (word *source, int32_t length, word *dest, word rlewtag);
44
45void CA_RLEWexpand (word *source, word *dest, int32_t length, word rlewtag);
46
47void CA_Startup (void);
48void CA_Shutdown (void);
49
50int32_t CA_CacheAudioChunk (int chunk);
51void CA_LoadAllSounds (void);
52
53void CA_CacheGrChunk (int chunk);
54void CA_CacheMap (int mapnum);
55
56void CA_CacheScreen (int chunk);
57
58void CA_CannotOpen(const char *name);
59
60#endif