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
100 lines
2.4 KiB
C
100 lines
2.4 KiB
C
/*
|
|
Copyright (C) 1996-1997 Id Software, Inc.
|
|
|
|
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 program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
//
|
|
// dosisms.h: I'd call it dos.h, but the name's taken
|
|
//
|
|
|
|
#ifndef _DOSISMS_H_
|
|
#define _DOSISMS_H_
|
|
|
|
int dos_lockmem(void *addr, int size);
|
|
int dos_unlockmem(void *addr, int size);
|
|
|
|
typedef union {
|
|
struct {
|
|
unsigned long edi;
|
|
unsigned long esi;
|
|
unsigned long ebp;
|
|
unsigned long res;
|
|
unsigned long ebx;
|
|
unsigned long edx;
|
|
unsigned long ecx;
|
|
unsigned long eax;
|
|
} d;
|
|
struct {
|
|
unsigned short di, di_hi;
|
|
unsigned short si, si_hi;
|
|
unsigned short bp, bp_hi;
|
|
unsigned short res, res_hi;
|
|
unsigned short bx, bx_hi;
|
|
unsigned short dx, dx_hi;
|
|
unsigned short cx, cx_hi;
|
|
unsigned short ax, ax_hi;
|
|
unsigned short flags;
|
|
unsigned short es;
|
|
unsigned short ds;
|
|
unsigned short fs;
|
|
unsigned short gs;
|
|
unsigned short ip;
|
|
unsigned short cs;
|
|
unsigned short sp;
|
|
unsigned short ss;
|
|
} x;
|
|
struct {
|
|
unsigned char edi[4];
|
|
unsigned char esi[4];
|
|
unsigned char ebp[4];
|
|
unsigned char res[4];
|
|
unsigned char bl, bh, ebx_b2, ebx_b3;
|
|
unsigned char dl, dh, edx_b2, edx_b3;
|
|
unsigned char cl, ch, ecx_b2, ecx_b3;
|
|
unsigned char al, ah, eax_b2, eax_b3;
|
|
} h;
|
|
} regs_t;
|
|
|
|
unsigned int ptr2real(void *ptr);
|
|
void *real2ptr(unsigned int real);
|
|
void *far2ptr(unsigned int farptr);
|
|
unsigned int ptr2far(void *ptr);
|
|
|
|
int dos_inportb(int port);
|
|
int dos_inportw(int port);
|
|
void dos_outportb(int port, int val);
|
|
void dos_outportw(int port, int val);
|
|
|
|
void dos_irqenable(void);
|
|
void dos_irqdisable(void);
|
|
void dos_registerintr(int intr, void (*handler)(void));
|
|
void dos_restoreintr(int intr);
|
|
|
|
int dos_int86(int vec);
|
|
|
|
void *dos_getmemory(int size);
|
|
void dos_freememory(void *ptr);
|
|
|
|
void dos_usleep(int usecs);
|
|
|
|
int dos_getheapsize(void);
|
|
|
|
extern regs_t regs;
|
|
|
|
#endif // _DOSISMS_H_
|
|
|