save fpu state properly-ish, add a guard to doom_malloc_wrapper, fix QueryPerformance* and GetSystemTimeAsFileTime

This commit is contained in:
maksw committed 2026-05-15 14:42:39 +02:00
1 parent def649b995
commit ddb5d5f5d8
8 files changed
+78 -56

No files matched your search

+4 -3
View File
@@ -27,11 +27,12 @@ static void doom_print_wrapper(const char* msg)
// ---------------------------------------------------------------------------
// doom_malloc_fn / doom_free_fn
// Heap handle 0, same convention as video.c.
// ---------------------------------------------------------------------------
static void* doom_malloc_wrapper(int size)
{
return HeapAlloc(0, HEAP_ZERO_MEMORY, size);
void* p = HeapAlloc(0, HEAP_ZERO_MEMORY, size);
if (!p) ExitProcess(GetLastError());
return p;
}
static void doom_free_wrapper(void* ptr)
@@ -126,7 +127,7 @@ static void doom_exit_wrapper(int code)
static char* doom_getenv_wrapper(const char* name)
{
if (strcmp(name, "HOME") == 0) {
static char home[] = "fs0:\\";
static char home[] = "c:";
doom_print_wrapper("getenv: Returning HOME="); doom_print_wrapper(home); doom_print_wrapper("\n");
return home;
}