add a realtime scheduler class and priority-inheritance mutexes with timeouts and abandonment, add an HDA audio driver and a SYS_AUDIO_* syscall family, flesh out kernel32 with Win32 threads, events, mutexes, critical sections, and condition variables, add SYS_RESUME_THREAD for suspended thread creation, add KeInitializeMemoryTypes to reprogram MTRRs and install a canonical PAT for WB/WC/UC control, rework the display pipeline with a pitched present path and console output flush, bring back disk.vhd with mtools since vvfat fucking sucks, harden AHCI with serialized cache flush, USB mass storage with SCSI sense-data decoding, and xHCI with cleaner DMA teardown, fix the last stray for(;;) in HalStopProcessor to while(true), pile on smoke tests for audio, win32 sync primitives, and thread suspend, implement AHCI timeout, kill readahead since it was desperetaly trying to murder me, fix doom sound x2.
This commit is contained in:
1 parent
8b254f84f4
commit
4add6789ba
177 files changed
+22565
-3070
No files matched your search
@@ -1,6 +1,6 @@
|
||||
// doom.c — PureDOOM port
|
||||
// Native personality carrying all the weight.
|
||||
// Drop doom1.wad (or doom.wad) next to this binary on your FAT32 volume.
|
||||
// Place the Doom WAD and optional doom.sf2 in the process working directory.
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
@@ -10,6 +10,8 @@
|
||||
#include <intrin.h>
|
||||
#include <ntlite/syscall.h>
|
||||
|
||||
#include "doom_audio.h"
|
||||
|
||||
#define DOOM_IMPLEMENTATION
|
||||
#include "PureDOOM.h"
|
||||
|
||||
@@ -189,6 +191,7 @@ static void doom_gettime_wrapper(int* sec, int* usec)
|
||||
// ---------------------------------------------------------------------------
|
||||
static void doom_exit_wrapper(int code)
|
||||
{
|
||||
DoomAudioAbort();
|
||||
SysExitProcess(code);
|
||||
}
|
||||
|
||||
@@ -445,7 +448,7 @@ static int doom_now_tic(void)
|
||||
// Waits until Doom has a new simulation tic to render.
|
||||
static int wait_for_next_doom_tic(int lastTic)
|
||||
{
|
||||
for (;;) {
|
||||
while (true) {
|
||||
int now = doom_now_tic();
|
||||
if (now != lastTic)
|
||||
return now;
|
||||
@@ -495,9 +498,18 @@ int main(void)
|
||||
char argvStorage[512];
|
||||
const char* argv[32];
|
||||
int argc = build_argv_from_command_line(cmdline, argvStorage, sizeof(argvStorage), argv, 32);
|
||||
if (argc == 1)
|
||||
doom_print_wrapper("doom: parsed argc == 1\n");
|
||||
else if (argc > 1)
|
||||
doom_print_wrapper("doom: parsed argc > 1\n");
|
||||
else
|
||||
doom_print_wrapper("doom: parsed argc <= 0\n");
|
||||
init_surface();
|
||||
init_display_clock();
|
||||
do { SYS_WRITE_CONSOLE_REQUEST req = { SYS_SV_LITERAL("doom: starting doom\n") }; SysWriteConsole(&req); } while (0);
|
||||
doom_init(argc, argv, 0);
|
||||
do { SYS_WRITE_CONSOLE_REQUEST req = { SYS_SV_LITERAL("doom: starting audio\n") }; SysWriteConsole(&req); } while (0);
|
||||
DoomAudioStart();
|
||||
|
||||
do { SYS_WRITE_CONSOLE_REQUEST req = { SYS_SV_LITERAL("doom: entering game loop\n") }; SysWriteConsole(&req); } while (0);
|
||||
|
||||
@@ -508,9 +520,12 @@ int main(void)
|
||||
int frameTic = wait_for_next_doom_tic(lastFrameTic);
|
||||
lastFrameTic = frameTic;
|
||||
|
||||
DoomAudioLockCore();
|
||||
poll_input();
|
||||
doom_update();
|
||||
render_frame((const uint8_t*)doom_get_framebuffer(4 /* RGBA */));
|
||||
const uint8_t* framebuffer = (const uint8_t*)doom_get_framebuffer(4 /* RGBA */);
|
||||
DoomAudioUnlockCore();
|
||||
render_frame(framebuffer);
|
||||
}
|
||||
|
||||
SysExitProcess(0);
|
||||
|
||||
Reference in new issue
Block a user