sdlquake: newlib

git-svn-id: svn://kolibrios.org@8520 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
maxcodehack 2021-01-05 13:00:22 +00:00
parent 62a646eb18
commit 41c3cb567f
3 changed files with 21 additions and 22 deletions

View File

@ -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",

View File

@ -11,6 +11,7 @@
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <kos32sys.h>
#if !defined(__WIN32__) && !defined(_KOLIBRI)
#include <sys/ipc.h>
#include <sys/shm.h>
@ -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

8
programs/use_sdl_newlib.lua Executable file
View File

@ -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 .. "/<libSDLn>")
LIBS = "-lSDLn " .. LIBS