1
0
Fork 0
forked from len0rd/rockbox
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
This commit is contained in:
Franklin Wei 2018-02-11 15:34:30 -05:00
parent b70fecf21d
commit 5d05b9d3e9
171 changed files with 64268 additions and 20 deletions

View file

@ -204,6 +204,7 @@ int SDLCALL SDL_RunAudio(void *audiop)
/* Convert the audio if necessary */
if ( audio->convert.needed ) {
LOGF("RB AUDIO: converting audio. Will be slow!");
SDL_ConvertAudio(&audio->convert);
stream = audio->GetAudioBuf(audio);
if ( stream == NULL ) {

View file

@ -225,12 +225,29 @@ static void ROCKBOXAUD_CloseAudio(_THIS)
rb->pcm_set_frequency(HW_SAMPR_DEFAULT);
}
static bool freq_ok(unsigned int freq)
{
for(int i = 0; i < SAMPR_NUM_FREQ; i++)
{
if(rb->hw_freq_sampr[i] == freq)
return true;
}
return false;
}
static int ROCKBOXAUD_OpenAudio(_THIS, SDL_AudioSpec *spec)
{
/* change to our format */
spec->format = AUDIO_S16SYS;
spec->channels = 2;
spec->freq = RB_SAMPR;
if(!freq_ok(spec->freq))
{
rb->splashf(HZ, "Warning: Unsupported audio rate. Defaulting to %d Hz", RB_SAMPR);
// switch to default
spec->freq = RB_SAMPR;
}
/* we've changed it */
SDL_CalculateAudioSpec(spec);

View file

@ -51,13 +51,13 @@ int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
static int threadnum = 0;
snprintf(names[threadnum], 16, "sdl_%d", threadnum);
while(global_args) rb->yield(); /* busy wait */
while(global_args) rb->yield(); /* busy wait, pray that this works */
global_args = args;
thread->handle = rb->create_thread(rbsdl_runthread, stacks[threadnum], DEFAULT_STACK_SIZE,
0, names[threadnum] /* collisions allowed? */
IF_PRIO(, PRIORITY_USER_INTERFACE)
IF_PRIO(, PRIORITY_BUFFERING) // this is used for sound mixing
IF_COP(, CPU));
threadnum++;

View file

@ -28,6 +28,7 @@
#include "plugin.h"
/* color because greylib will use timer otherwise */
#if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) && !defined(RB_PROFILE)
#define USE_TIMER
#endif

View file

@ -769,8 +769,8 @@ static void ROCKBOX_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
/* FIXME: this won't work for rotated screen or overlapping rects */
flip_pixels(rects[i].x, rects[i].y, rects[i].w, rects[i].h);
#endif
rb->lcd_update_rect(rects[i].x, rects[i].y, rects[i].w, rects[i].h);
} /* for */
rb->lcd_update();
} /* if */
}