Starting the game

Starting the game

The first thing the user sees when they start up the game is is a simple text string announcing that the game is loading.

The game is loading, hurray

Some of the things that happens in the backgrounds are

Video

  1. The game sets VGA Mode 13h
  2. The game then immediately moves to Mode X (this have consequences for how VGA buffers are written)
  3. Unlocks 256KB Video Ram for page flipping

Input

  1. Mouse driver is reset
  2. Mouse cursor is clamped to the 320x200 resolution
  3. Install an event handler (interrupt service routine) to process input asynchronously

Audio

  1. Loads the appropriate Miles Sound System driver for the configured soundcards, one of:

    • ADL.DRV
    • GENMIDI.DRV
    • MT32.DRV
    • SNDBLAST.DRV
    • STD.DRV
  2. Loads the sound handling overlay (SX.OVL) and the sound frame work (FRP.SX)

  3. Allocates a DMA buffer for sound mixing

System

  1. Sets up the Borland Overlay Manager. This is how the game deals with the game logic being larger than the available RAM: It swaps in bits of code into overlay segments when requested.
  2. Crash handling.
  3. load GAME.FNT from KRONDOR.001 and makes it the default font.
  4. Reprograms the PIT (Programmable Interval Timer) to increase the tick rate beyond the standard 18.2Hz DOS clock.

Drawing the loading text

As soon as the base video mode is configured, the game will do the following:

  1. load OPTIONS.PAL from KRONDOR.001 and make it the default palette (see https://krondor.ubik-shakespeare.com/resource-management/ for how game resources are managed)
  2. VGA back buffer is cleared to black
  3. set the pen colour to palette index 0xFF (which displays as white in the OPTIONS.PAL palette)
  4. set the cursor position to 0,10
  5. write the text Loading Betrayal at Krondor... please wait. (The font was already loaded during the game init)

After which the game enters the main menu loop.