5d05b9d3e9
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
78 lines
2.3 KiB
C
78 lines
2.3 KiB
C
/***************************************************************************
|
|
* __________ __ ___.
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
* \/ \/ \/ \/ \/
|
|
*
|
|
* Copyright (C) 2013 by Marcin Bukat
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
* KIND, either express or implied.
|
|
*
|
|
****************************************************************************/
|
|
|
|
#include <stddef.h>
|
|
|
|
#define MAX_STDIO_FILES 11
|
|
|
|
#undef FILE
|
|
#define FILE _FILE_
|
|
|
|
#define fopen _fopen_
|
|
#define fclose _fclose_
|
|
#define fflush _fflush_
|
|
#define fread _fread_
|
|
#define fwrite _fwrite_
|
|
#define fseek _fseek_
|
|
#define fseeko _fseek_
|
|
#define ftell _ftell_
|
|
#define ftello _ftell_
|
|
#define fgetc _fgetc_
|
|
#define ungetc _ungetc_
|
|
#define fputc _fputc_
|
|
#define fgets _fgets_
|
|
#undef clearerr
|
|
#define clearerr _clearerr_
|
|
#undef ferror
|
|
#define ferror _ferror_
|
|
#undef feof
|
|
#define feof _feof_
|
|
#define fprintf _fprintf_
|
|
#undef stdout
|
|
#define stdout _stdout_
|
|
#undef stderr
|
|
#define stderr _stderr_
|
|
|
|
#define getc fgetc
|
|
|
|
typedef struct {
|
|
int fd;
|
|
int unget_char;
|
|
int error;
|
|
} _FILE_;
|
|
|
|
extern _FILE_ *_stdout_, *_stderr_;
|
|
|
|
_FILE_ *_fopen_(const char *path, const char *mode);
|
|
int _fclose_(_FILE_ *stream);
|
|
int _fflush_(_FILE_ *stream);
|
|
size_t _fread_(void *ptr, size_t size, size_t nmemb, _FILE_ *stream);
|
|
size_t _fwrite_(const void *ptr, size_t size, size_t nmemb, _FILE_ *stream);
|
|
int _fseek_(_FILE_ *stream, long offset, int whence);
|
|
long _ftell_(_FILE_ *stream);
|
|
int _fgetc_(_FILE_ *stream);
|
|
int _ungetc_(int c, _FILE_ *stream);
|
|
int _fputc_(int c, _FILE_ *stream);
|
|
char *_fgets_(char *s, int size, _FILE_ *stream);
|
|
int _unlink_(const char *pathname);
|
|
void _clearerr_(_FILE_ *stream);
|
|
int _ferror_(_FILE_ *stream);
|
|
int _feof_(_FILE_ *stream);
|
|
int _fprintf_(_FILE_ *stream, const char *format, ...);
|