diff --git a/contrib/other/sdlquake-1.0.9/host.c b/contrib/other/sdlquake-1.0.9/host.c index 845429517b..999fa28bbf 100644 --- a/contrib/other/sdlquake-1.0.9/host.c +++ b/contrib/other/sdlquake-1.0.9/host.c @@ -834,11 +834,6 @@ Host_Init */ void Host_Init (quakeparms_t *parms) { - #ifdef _KOLIBRI - #include "dirname.c" - parms->basedir=dirname(parms->argv[0]); - #endif - if (standard_quake) minimum_memory = MINIMUM_MEMORY; else diff --git a/contrib/other/sdlquake-1.0.9/dirname.c b/contrib/other/sdlquake-1.0.9/kolibri.h similarity index 90% rename from contrib/other/sdlquake-1.0.9/dirname.c rename to contrib/other/sdlquake-1.0.9/kolibri.h index 505c19953d..ff32d07d6a 100644 --- a/contrib/other/sdlquake-1.0.9/dirname.c +++ b/contrib/other/sdlquake-1.0.9/kolibri.h @@ -1,3 +1,6 @@ +#ifndef _KOLIBRI_H_ +#define _KOLIBRI_H_ + #include #include @@ -47,4 +50,13 @@ char *dirname (char *path) found and so a static and constant string is required. */ path = (char *) dot; return path; -} +} + + +void _ksys_setcwd(char* dir){ + __asm__ __volatile__ ( + "int $0x40" + ::"a"(30), "b"(1), "c"(dir) + ); +}; +#endif diff --git a/contrib/other/sdlquake-1.0.9/sys_sdl.c b/contrib/other/sdlquake-1.0.9/sys_sdl.c index e097337e65..cb8f93d29a 100644 --- a/contrib/other/sdlquake-1.0.9/sys_sdl.c +++ b/contrib/other/sdlquake-1.0.9/sys_sdl.c @@ -384,6 +384,10 @@ void moncontrol(int x) int main (int c, char **v) { + #ifdef _KOLIBRI + #include "kolibri.h" + _ksys_setcwd(dirname(v[0])); + #endif double time, oldtime, newtime; quakeparms_t parms;