28  Menu & Config: Overview

This tour examines the Doom engine’s menu system (m_menu.*) and configuration handling (m_misc.*), showing the key functions, data structures, and file operations used to manage game settings.


28.1 Doom Menu System

The next section examines the Doom menu system, starting with the core functions and data structures in m_menu.h and m_menu.c.

28.1.1 Core Menu Functions

File: linuxdoom-1.10/m_menu.h
The menu system operates through these core functions that handle input events, animation, rendering, initialization, and menu activation.

28.2 Configuration and Utility Functions

Next we’ll look at configuration and utility functions in m_misc.h and m_misc.c, which handle settings, file I/O, and support routines.

28.2.1 Header Declarations

File: linuxdoom-1.10/m_misc.h
Includes function declarations for configuration saving/loading, screenshots, text output.

28.2.2 Config Storage

File: linuxdoom-1.10/m_misc.c
Defines how config data is mapped and persisted.

  • default_t: Maps config names to variables and default values.
  • defaults[]: Holds the full array of settings.

28.2.3 Saving and Loading Defaults

  • M_SaveDefaults():
    > File: linuxdoom-1.10/m_misc.c
    Writes settings to file using numeric/string markers.

  • M_LoadDefaults():
    > File: linuxdoom-1.10/m_misc.c
    Reads file, matches name fields, applies overrides.

Config line parsing handles: - Quoted strings → allocated memory - Numeric values → parsed hex/decimal - Matches entries in defaults[]


And that’s it — Doom’s menu system and configuration settings in action.