mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 03:00:38 +00:00
Patch adding Wii support by tueidj, part 8: system-specific changes
- conditionally compiles out some code intended for the PC platforms - compat.c: get home directory routine, access() implementation - game.c: don't use ioctl(), lower cache1d size to 8 MiB, Wii-specific initialization code and application directory ("apps/eduke32") git-svn-id: https://svn.eduke32.com/eduke32@2628 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
4ec6ffcef8
commit
dfa212aaf9
5 changed files with 46 additions and 4 deletions
|
@ -377,7 +377,7 @@ int32_t baselayer_init(void)
|
||||||
|
|
||||||
void makeasmwriteable(void)
|
void makeasmwriteable(void)
|
||||||
{
|
{
|
||||||
#ifndef NOASM
|
#if !defined(NOASM) && !defined(GEKKO)
|
||||||
extern int32_t dep_begin, dep_end;
|
extern int32_t dep_begin, dep_end;
|
||||||
# if defined _WIN32
|
# if defined _WIN32
|
||||||
DWORD oldprot;
|
DWORD oldprot;
|
||||||
|
|
|
@ -396,6 +396,14 @@ char *Bgethomedir(void)
|
||||||
if (s) s = Bstrdup(s);
|
if (s) s = Bstrdup(s);
|
||||||
CFRelease(str);
|
CFRelease(str);
|
||||||
return s;
|
return s;
|
||||||
|
#elif defined(GEKKO)
|
||||||
|
// return current drive's name
|
||||||
|
char *drv, cwd[BMAX_PATH] = {0};
|
||||||
|
getcwd(cwd, BMAX_PATH);
|
||||||
|
drv = strchr(cwd, ':');
|
||||||
|
if (drv)
|
||||||
|
drv[1] = '\0';
|
||||||
|
return Bstrdup(cwd);
|
||||||
#else
|
#else
|
||||||
char *e = getenv("HOME");
|
char *e = getenv("HOME");
|
||||||
if (!e) return NULL;
|
if (!e) return NULL;
|
||||||
|
@ -845,7 +853,7 @@ uint32_t Bgetsysmemsize(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
return siz;
|
return siz;
|
||||||
#elif (defined(_SC_PAGE_SIZE) || defined(_SC_PAGESIZE)) && defined(_SC_PHYS_PAGES)
|
#elif (defined(_SC_PAGE_SIZE) || defined(_SC_PAGESIZE)) && defined(_SC_PHYS_PAGES) && !defined(GEKKO)
|
||||||
uint32_t siz = UINT_MAX;
|
uint32_t siz = UINT_MAX;
|
||||||
int64_t scpagesiz, scphyspages;
|
int64_t scpagesiz, scphyspages;
|
||||||
|
|
||||||
|
@ -867,5 +875,16 @@ uint32_t Bgetsysmemsize(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef GEKKO
|
||||||
|
int access(const char *pathname, int mode)
|
||||||
|
{
|
||||||
|
struct stat st;
|
||||||
|
if (stat(pathname, &st)==-1)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
// TODO: Check mode against st_mode
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -242,7 +242,7 @@ void setvsync(int32_t sync)
|
||||||
static void attach_debugger_here(void) {}
|
static void attach_debugger_here(void) {}
|
||||||
|
|
||||||
/* XXX: libexecinfo could be used on systems without gnu libc. */
|
/* XXX: libexecinfo could be used on systems without gnu libc. */
|
||||||
#if defined __GNUC__ && !defined __OpenBSD__ && !(defined __APPLE__ && defined __BIG_ENDIAN__)
|
#if defined __GNUC__ && !defined __OpenBSD__ && !(defined __APPLE__ && defined __BIG_ENDIAN__) && !defined(GEKKO)
|
||||||
# define PRINTSTACKONSEGV 1
|
# define PRINTSTACKONSEGV 1
|
||||||
# include <execinfo.h>
|
# include <execinfo.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -76,7 +76,9 @@ extern int32_t G_GetVersionFromWebsite(char *buffer);
|
||||||
#define UPDATEINTERVAL 604800 // 1w
|
#define UPDATEINTERVAL 604800 // 1w
|
||||||
#else
|
#else
|
||||||
static int32_t usecwd = 0;
|
static int32_t usecwd = 0;
|
||||||
|
#ifndef GEKKO
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
#endif
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
int32_t g_quitDeadline = 0;
|
int32_t g_quitDeadline = 0;
|
||||||
|
@ -183,7 +185,11 @@ static char user_quote[MAXUSERQUOTES][178];
|
||||||
// This was 32 for a while, but I think lowering it to 24 will help things like the Dingoo.
|
// This was 32 for a while, but I think lowering it to 24 will help things like the Dingoo.
|
||||||
// Ideally, we would look at our memory usage on our most cramped platform and figure out
|
// Ideally, we would look at our memory usage on our most cramped platform and figure out
|
||||||
// how much of that is needed for the underlying OS and things like SDL instead of guessing
|
// how much of that is needed for the underlying OS and things like SDL instead of guessing
|
||||||
|
#ifndef GEKKO
|
||||||
static int32_t MAXCACHE1DSIZE = (24*1048576);
|
static int32_t MAXCACHE1DSIZE = (24*1048576);
|
||||||
|
#else
|
||||||
|
static int32_t MAXCACHE1DSIZE = (8*1048576);
|
||||||
|
#endif
|
||||||
|
|
||||||
int32_t tempwallptr;
|
int32_t tempwallptr;
|
||||||
|
|
||||||
|
@ -9792,6 +9798,12 @@ void app_crashhandler(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef GEKKO
|
||||||
|
void L2Enhance();
|
||||||
|
void CON_EnableGecko(int channel,int safe);
|
||||||
|
bool fatInit (uint32_t cacheSize, bool setAsDefaultDevice);
|
||||||
|
#endif
|
||||||
|
|
||||||
int32_t app_main(int32_t argc, const char **argv)
|
int32_t app_main(int32_t argc, const char **argv)
|
||||||
{
|
{
|
||||||
int32_t i = 0, j;
|
int32_t i = 0, j;
|
||||||
|
@ -9803,6 +9815,13 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
ENetCallbacks callbacks = { NULL, NULL, NULL };
|
ENetCallbacks callbacks = { NULL, NULL, NULL };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef GEKKO
|
||||||
|
L2Enhance();
|
||||||
|
CON_EnableGecko(1, 1);
|
||||||
|
printf("Console started\n");
|
||||||
|
fatInit(28, true);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef RENDERTYPEWIN
|
#ifdef RENDERTYPEWIN
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
{
|
{
|
||||||
|
@ -9925,6 +9944,8 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
"EDuke32 Settings"
|
"EDuke32 Settings"
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
"Library/Application Support/EDuke32"
|
"Library/Application Support/EDuke32"
|
||||||
|
#elif defined(GEKKO)
|
||||||
|
"apps/eduke32"
|
||||||
#else
|
#else
|
||||||
".eduke32"
|
".eduke32"
|
||||||
#endif
|
#endif
|
||||||
|
@ -10586,7 +10607,9 @@ MAIN_LOOP_RESTART:
|
||||||
static uint32_t bufpos = 0;
|
static uint32_t bufpos = 0;
|
||||||
static char buf[128];
|
static char buf[128];
|
||||||
|
|
||||||
|
#ifndef GEKKO
|
||||||
ioctl(0, FIONBIO, &flag);
|
ioctl(0, FIONBIO, &flag);
|
||||||
|
#endif
|
||||||
|
|
||||||
if ((nb = read(0, &ch, 1)) > 0 && bufpos < sizeof(buf))
|
if ((nb = read(0, &ch, 1)) > 0 && bufpos < sizeof(buf))
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,7 +41,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include "sdl_inc.h"
|
#include "sdl_inc.h"
|
||||||
#include "music.h"
|
#include "music.h"
|
||||||
|
|
||||||
#if !defined _WIN32
|
#if !defined _WIN32 && !defined(GEKKO)
|
||||||
# define FORK_EXEC_MIDI 1
|
# define FORK_EXEC_MIDI 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue