summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranklin Wei <franklin@rockbox.org>2019-07-29 17:32:45 -0400
committerFranklin Wei <franklin@rockbox.org>2019-07-29 17:32:45 -0400
commit0c42b31a37de29c4a65bbd634d87b9ff46b88e6b (patch)
treef6a8f96a7b4e3d720c0ef57f9e2a07a91ae05e90
parentfb0d34650f990e44c741a0661d95ede3abed919b (diff)
downloadrockbox-quake5.zip
rockbox-quake5.tar.gz
rockbox-quake5.tar.bz2
rockbox-quake5.tar.xz
tmp on quakequake5
Change-Id: Id8bc9e5e47cad5c620f5273fc39348eb19e8e5d8
-rw-r--r--apps/plugins/sdl/include/SDL_config_rockbox.h1
-rw-r--r--apps/plugins/sdl/progs/quake/common.c9
-rw-r--r--apps/plugins/sdl/progs/quake/model.c1
-rw-r--r--apps/plugins/sdl/progs/quake/r_edge.c5
-rw-r--r--apps/plugins/sdl/progs/quake/snd_dma.c2
-rw-r--r--apps/plugins/sdl/progs/quake/sys_sdl.c8
-rw-r--r--apps/plugins/sdl/sdl.make2
7 files changed, 26 insertions, 2 deletions
diff --git a/apps/plugins/sdl/include/SDL_config_rockbox.h b/apps/plugins/sdl/include/SDL_config_rockbox.h
index 2b7f9a6..2cefc24 100644
--- a/apps/plugins/sdl/include/SDL_config_rockbox.h
+++ b/apps/plugins/sdl/include/SDL_config_rockbox.h
@@ -203,6 +203,7 @@ int mkdir_wrapepr(const char *path);
int printf_wrapper(const char*, ...);
int sprintf_wrapper(char*, const char*, ...);
int vprintf(const char *fmt, va_list ap);
+int fscanf_wrapper(FILE *f, const char *fmt, ...);
void fatal(char *fmt, ...);
void rb_exit(int rc);
void rbsdl_atexit(void (*)(void));
diff --git a/apps/plugins/sdl/progs/quake/common.c b/apps/plugins/sdl/progs/quake/common.c
index 5191af8..cc50311 100644
--- a/apps/plugins/sdl/progs/quake/common.c
+++ b/apps/plugins/sdl/progs/quake/common.c
@@ -1621,6 +1621,9 @@ byte *COM_LoadFile (char *path, int usehunk)
if (h == -1)
return NULL;
+ if(len < 1)
+ rb->splashf(HZ, "suspicious length %d", len);
+
check_ptr = &h;
//printf("handle %d", h);
@@ -1642,9 +1645,15 @@ byte *COM_LoadFile (char *path, int usehunk)
else if (usehunk == 4)
{
if (len+1 > loadsize)
+ {
+ LOGF("LoadFile: allocating hunk b/c stackbuf too small (filelen=%d)\n", len);
buf = Hunk_TempAlloc (len+1);
+ }
else
+ {
+ LOGF("filelen=%d, using stack buf\n", len);
buf = loadbuf;
+ }
}
else
Sys_Error ("COM_LoadFile: bad usehunk");
diff --git a/apps/plugins/sdl/progs/quake/model.c b/apps/plugins/sdl/progs/quake/model.c
index 5ac6dc6..1dafa4b 100644
--- a/apps/plugins/sdl/progs/quake/model.c
+++ b/apps/plugins/sdl/progs/quake/model.c
@@ -283,6 +283,7 @@ model_t *Mod_LoadModel (model_t *mod, qboolean crash)
//printf("loadmodel 2");
buf = (unsigned *)COM_LoadStackFile (mod->name, stackbuf, sizeof(stackbuf));
+ //buf = (unsigned *)COM_LoadHunkFile (mod->name);
if (!buf)
{
if (crash)
diff --git a/apps/plugins/sdl/progs/quake/r_edge.c b/apps/plugins/sdl/progs/quake/r_edge.c
index 1fff765..351d194 100644
--- a/apps/plugins/sdl/progs/quake/r_edge.c
+++ b/apps/plugins/sdl/progs/quake/r_edge.c
@@ -275,6 +275,11 @@ pushback:
// find out where the edge goes in the edge list
pwedge = pedge->prev->prev;
+ // BUG??? - FW 7/29/19
+ if(!pwedge || !pedge)
+ rb->splashf(HZ, "BUG 1!!!!!");
+
+
while (pwedge->u > pedge->u)
{
pwedge = pwedge->prev;
diff --git a/apps/plugins/sdl/progs/quake/snd_dma.c b/apps/plugins/sdl/progs/quake/snd_dma.c
index 4c42f32..6d575bf 100644
--- a/apps/plugins/sdl/progs/quake/snd_dma.c
+++ b/apps/plugins/sdl/progs/quake/snd_dma.c
@@ -64,7 +64,7 @@ int num_sfx;
sfx_t *ambient_sfx[NUM_AMBIENTS];
// lowest rockbox supported
-int desired_speed = SAMPR_16;
+int desired_speed = SAMPR_44;
int desired_bits = 16;
int sound_started=0;
diff --git a/apps/plugins/sdl/progs/quake/sys_sdl.c b/apps/plugins/sdl/progs/quake/sys_sdl.c
index 44411bd..4c0c88f 100644
--- a/apps/plugins/sdl/progs/quake/sys_sdl.c
+++ b/apps/plugins/sdl/progs/quake/sys_sdl.c
@@ -168,8 +168,11 @@ static int Qfilelength (FILE *f)
}
#define CACHE_THRESHOLD (1024*1024)
+//#define CACHE_ENABLE
/* really rough guesses */
+
+#ifdef CACHE_ENABLE
#if MEMORYSIZE >= 64
#define MAX_CACHE (32*1024*1024)
#elif MEMORYSIZE >= 32
@@ -177,6 +180,9 @@ static int Qfilelength (FILE *f)
#else
#define MAX_CACHE 0
#endif
+#else
+#define MAX_CACHE 0
+#endif
static int cache_left = MAX_CACHE;
@@ -221,6 +227,8 @@ int Sys_FileOpenRead (char *path, int *hndl)
}
}
}
+
+ return len;
}
int Sys_FileOpenWrite (char *path)
diff --git a/apps/plugins/sdl/sdl.make b/apps/plugins/sdl/sdl.make
index a00948d..290ba2a 100644
--- a/apps/plugins/sdl/sdl.make
+++ b/apps/plugins/sdl/sdl.make
@@ -30,7 +30,7 @@ OTHER_INC += -I$(SDL_SRCDIR)/include
SDLFLAGS = -I$(SDL_SRCDIR)/include $(filter-out -O%,$(PLUGINFLAGS)) \
-O3 -Wno-unused-parameter -Xpreprocessor -Wno-undef -Wcast-align \
-ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations \
--D_GNU_SOURCE=1 -D_REENTRANT -DSDL -DELF -w # disable all warnings
+-D_GNU_SOURCE=1 -D_REENTRANT -DSDL -DELF # disable all warnings
# use FPU on ARMv6
ifeq ($(ARCH_VERSION),6)