This is a fork of doomgeneric, specifically adapted to run on the Milagro kernel.
The goal of this project is to simplify the process of running DOOM on new platforms by providing a minimal, portable layer that abstracts platform-specific functionality. Tarkus is a custom x86_64 UNIX-like kernel, and this fork tailors doomgeneric to that environment.
To port doomgeneric to a new platform, create a file named doomgeneric_<yourplatform>.c and implement the following platform-specific functions:
| Function | Description |
|---|---|
DG_Init |
Initialize your platform (e.g., create framebuffer, set up hardware, etc.). |
DG_DrawFrame |
Copy the contents of DG_ScreenBuffer to your screen/framebuffer. |
DG_SleepMs |
Sleep for the specified number of milliseconds. |
DG_GetTicksMs |
Return milliseconds elapsed since the application started. |
DG_GetKey |
Return current key input (if any). |
DG_SetWindowTitle |
Optional: Set the window title (DOOM uses the title from the WAD file). |
A basic DOOM main loop using doomgeneric looks like this:
int main(int argc, char **argv)
{
doomgeneric_Create(argc, argv);
while (1)
{
doomgeneric_Tick();
}
return 0;
}- Call
doomgeneric_Create()once at startup. - Repeatedly call
doomgeneric_Tick()inside your main loop.
Sound implementation is more complex and not included in all ports. If you require sound:
- Define
FEATURE_SOUND - Assign
DG_sound_moduleandDG_music_module
Refer to the SDL port for a complete sound implementation.
You can try the WASM version of doomgeneric directly in your browser: https://nilayshenai.github.io/doomgeneric