From 41c3cb567fed45f04cacae31efd0605001d860ec Mon Sep 17 00:00:00 2001 From: maxcodehack Date: Tue, 5 Jan 2021 13:00:22 +0000 Subject: [PATCH] sdlquake: newlib git-svn-id: svn://kolibrios.org@8520 a494cfbc-eb01-0410-851d-a64ba20cac60 --- contrib/other/sdlquake-1.0.9/Tupfile.lua | 9 +++++--- contrib/other/sdlquake-1.0.9/sys_sdl.c | 26 +++++++----------------- programs/use_sdl_newlib.lua | 8 ++++++++ 3 files changed, 21 insertions(+), 22 deletions(-) create mode 100755 programs/use_sdl_newlib.lua diff --git a/contrib/other/sdlquake-1.0.9/Tupfile.lua b/contrib/other/sdlquake-1.0.9/Tupfile.lua index f51650abce..7aede95466 100644 --- a/contrib/other/sdlquake-1.0.9/Tupfile.lua +++ b/contrib/other/sdlquake-1.0.9/Tupfile.lua @@ -5,11 +5,14 @@ then HELPERDIR = "../../../programs" end tup.include(HELPERDIR .. "/use_gcc.lua") -tup.include(HELPERDIR .. "/use_menuetlibc.lua") -use_dynamic_stack() -- default 64K are not sufficient -tup.include(HELPERDIR .. "/use_sdl.lua") +tup.include(HELPERDIR .. "/use_newlib.lua") +--use_dynamic_stack() -- default 64K are not sufficient +tup.include(HELPERDIR .. "/use_sdl_newlib.lua") CFLAGS = CFLAGS .. " -DSDL -UWIN32 -U_WIN32 -U__WIN32__ -D_KOLIBRI" CFLAGS = CFLAGS .. " -DUSE_ASM" + +LDFLAGS = LDFLAGS .. " --subsystem native --stack 0x200000" + -- CFLAGS = CFLAGS:gsub("-Os", "-O2") compile_gcc{ "chase.c", "cl_demo.c", "cl_input.c", "cl_main.c", "cl_parse.c", "cl_tent.c", diff --git a/contrib/other/sdlquake-1.0.9/sys_sdl.c b/contrib/other/sdlquake-1.0.9/sys_sdl.c index a27c2b5bd0..e097337e65 100644 --- a/contrib/other/sdlquake-1.0.9/sys_sdl.c +++ b/contrib/other/sdlquake-1.0.9/sys_sdl.c @@ -11,6 +11,7 @@ #include #include #include +#include #if !defined(__WIN32__) && !defined(_KOLIBRI) #include #include @@ -46,11 +47,8 @@ void Sys_Printf (char *fmt, ...) va_start (argptr,fmt); vsprintf (text,fmt,argptr); va_end (argptr); -#ifdef _KOLIBRI - __menuet__debug_out(text); -#else + fprintf(stderr, "%s", text); -#endif //Con_Print (text); } @@ -102,17 +100,11 @@ void Sys_Error (char *error, ...) va_start (argptr,error); vsprintf (string,error,argptr); va_end (argptr); -#ifdef _KOLIBRI - __menuet__debug_out("Error: "); - __menuet__debug_out(string); - __menuet__debug_out("\n"); -#else + fprintf(stderr, "Error: %s\n", string); -#endif Host_Shutdown (); exit (1); - } void Sys_Warn (char *warning, ...) @@ -123,12 +115,8 @@ void Sys_Warn (char *warning, ...) va_start (argptr,warning); vsprintf (string,warning,argptr); va_end (argptr); -#ifdef _KOLIBRI - __menuet__debug_out("Warning: "); - __menuet__debug_out(string); -#else + fprintf(stderr, "Warning: %s", string); -#endif } /* @@ -282,7 +270,7 @@ void Sys_mkdir (char *path) #ifdef __WIN32__ mkdir (path); #else - mkdir (path, 0777); + //mkdir (path, 0777); #endif } @@ -376,7 +364,7 @@ void Sys_LineRefresh(void) void Sys_Sleep(void) { #ifdef _KOLIBRI - __menuet__delay100(1); + delay(1); #else SDL_Delay(1); #endif @@ -437,7 +425,7 @@ int main (int c, char **v) if (time < sys_ticrate.value && (vcrFile == -1 || recording) ) { #ifdef _KOLIBRI - __menuet__delay100(1); + delay(1); #else SDL_Delay (1); #endif diff --git a/programs/use_sdl_newlib.lua b/programs/use_sdl_newlib.lua new file mode 100755 index 0000000000..fde075b52d --- /dev/null +++ b/programs/use_sdl_newlib.lua @@ -0,0 +1,8 @@ +SDL_INCLUDE = tup.getcwd() .. "/../contrib/sdk/sources/SDL-1.2.2_newlib/include" +SDL_LIB = tup.getcwd() .. "/../contrib/sdk/lib" + +tup.include("use_sound.lua") + +INCLUDES = INCLUDES .. " -I" .. SDL_INCLUDE +table.insert(LIBDEPS, SDL_LIB .. "/") +LIBS = "-lSDLn " .. LIBS