Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Doomgeneric

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.


Porting Guide

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).

Main Loop Usage

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 Support

Sound implementation is more complex and not included in all ports. If you require sound:

  • Define FEATURE_SOUND
  • Assign DG_sound_module and DG_music_module

Refer to the SDL port for a complete sound implementation.


🕹️ WASM Demo

You can try the WASM version of doomgeneric directly in your browser: https://nilayshenai.github.io/doomgeneric


About

Doomgeneric, modified and optimized specifically for the Tarkus kernel.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages