summaryrefslogtreecommitdiff
path: root/apps/plugins/sdl/include/SDL_config_rockbox.h
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2018-02-11 15:34:30 -0500
committerFranklin Wei <git@fwei.tk>2019-07-19 22:37:40 -0400
commit5d05b9d3e920a6aa5fcb553758e98ed0da8c91e4 (patch)
tree84406e21639529a185556a33e5de7f43cffc277b /apps/plugins/sdl/include/SDL_config_rockbox.h
parentb70fecf21ddc21877ec1ae7888d9c18a979e37ad (diff)
downloadrockbox-5d05b9d3e920a6aa5fcb553758e98ed0da8c91e4.tar.gz
rockbox-5d05b9d3e920a6aa5fcb553758e98ed0da8c91e4.zip
Quake!
This ports id Software's Quake to run on the SDL plugin runtime. The source code originated from id under the GPLv2 license. I used https://github.com/ahefner/sdlquake as the base of my port. Performance is, unsurprisingly, not on par with what you're probably used to on PC. I average about 10FPS on ipod6g, but it's still playable. Sound works well enough, but in-game music is not supported. I've written ARM assembly routines for the inner sound loop. Make sure you turn the "brightness" all the way down, or colors will look funky. To run, extract Quake's data files to /.rockbox/quake. Have fun! Change-Id: I4285036e967d7f0722802d43cf2096c808ca5799
Diffstat (limited to 'apps/plugins/sdl/include/SDL_config_rockbox.h')
-rw-r--r--apps/plugins/sdl/include/SDL_config_rockbox.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/apps/plugins/sdl/include/SDL_config_rockbox.h b/apps/plugins/sdl/include/SDL_config_rockbox.h
index e268a73a8b..2b7f9a6793 100644
--- a/apps/plugins/sdl/include/SDL_config_rockbox.h
+++ b/apps/plugins/sdl/include/SDL_config_rockbox.h
@@ -38,7 +38,8 @@
38 38
39//#define COMBINED_SDL 39//#define COMBINED_SDL
40 40
41/* games will use this sample rate */ 41/* "recommended" sample rate for Rockbox. Games should use this by
42 * default unless necessary to do otherwise. */
42#ifdef SIMULATOR 43#ifdef SIMULATOR
43#define RB_SAMPR SAMPR_44 44#define RB_SAMPR SAMPR_44
44#else 45#else
@@ -57,6 +58,7 @@
57/* woot */ 58/* woot */
58#define SDL_AUDIO_DRIVER_ROCKBOX 1 59#define SDL_AUDIO_DRIVER_ROCKBOX 1
59#define SDL_THREAD_ROCKBOX 1 60#define SDL_THREAD_ROCKBOX 1
61#undef SDL_THREAD_PTHREAD
60#define SDL_TIMER_ROCKBOX 1 62#define SDL_TIMER_ROCKBOX 1
61#define SDL_VIDEO_DRIVER_ROCKBOX 1 63#define SDL_VIDEO_DRIVER_ROCKBOX 1
62 64
@@ -78,6 +80,10 @@
78#define HAVE_FREE 1 80#define HAVE_FREE 1
79#define HAVE_REALLOC 1 81#define HAVE_REALLOC 1
80#define HAVE_QSORT 1 82#define HAVE_QSORT 1
83#define HAVE_STRLEN 1
84#define HAVE_STRLCPY 1
85#define HAVE_STRCMP 1
86#define HAVE_STRNCMP 1
81 87
82#undef strdup 88#undef strdup
83 89
@@ -116,6 +122,7 @@
116#define floor floor_wrapper 122#define floor floor_wrapper
117#define fmod fmod_wrapper 123#define fmod fmod_wrapper
118#define free tlsf_free 124#define free tlsf_free
125#define fscanf fscanf_wrapper
119#define getchar() rb->sleep(2*HZ) 126#define getchar() rb->sleep(2*HZ)
120#define getenv SDL_getenv 127#define getenv SDL_getenv
121#define log rb_log 128#define log rb_log
@@ -146,6 +153,7 @@
146#define strcpy strcpy_wrapper 153#define strcpy strcpy_wrapper
147#define strdup strdup_wrapper 154#define strdup strdup_wrapper
148#define strerror(x) "error" 155#define strerror(x) "error"
156#define strlcpy rb->strlcpy
149#define strlen rb->strlen 157#define strlen rb->strlen
150#define strncasecmp rb->strncasecmp 158#define strncasecmp rb->strncasecmp
151#define strncat rb->strlcat /* hack */ 159#define strncat rb->strlcat /* hack */
@@ -163,8 +171,12 @@
163#define vsnprintf rb->vsnprintf 171#define vsnprintf rb->vsnprintf
164#define vsprintf vsprintf_wrapper 172#define vsprintf vsprintf_wrapper
165 173
174// use Rockbox's string routines
175#define SDL_memcpy memcpy
176#define SDL_memcmp memcmp
177
166#define M_PI 3.14159265358979323846 178#define M_PI 3.14159265358979323846
167#define EOF 0xff 179#define EOF (-1)
168 180
169#define LOAD_XPM 181#define LOAD_XPM
170#define MID_MUSIC 182#define MID_MUSIC
@@ -194,6 +206,7 @@ int vprintf(const char *fmt, va_list ap);
194void fatal(char *fmt, ...); 206void fatal(char *fmt, ...);
195void rb_exit(int rc); 207void rb_exit(int rc);
196void rbsdl_atexit(void (*)(void)); 208void rbsdl_atexit(void (*)(void));
209float atof_wrapper (char *str);
197 210
198/* speed */ 211/* speed */
199static inline uint16_t readLE16(void *addr) 212static inline uint16_t readLE16(void *addr)