# Down By The Laituri — native Windows runtime

`DBTL_Win.exe` runs the original DOS release of the DBTL game (Skitso Productions, 1997) as a normal Windows program. It is a 32-bit program, so it runs on Windows XP and every later version, 32-bit or 64-bit. It does not need DOSBox or any other emulator.

It contains its own x86 CPU core, NE loader and DPMI host (replacing RTM.EXE/DPMI16BI.OVL), DOS/BIOS services, a mouse driver, VESA 640×480×256 graphics and an emulated Sound Blaster 16 that plays the game's S3M music and VOC effects through Windows audio.

On first run it writes a `SOUND.CFG` for the emulated card (Sound Blaster 16, 220h, IRQ 7, DMA 1, HDMA 5). High scores are saved to `HISCORES.DAT` as usual. A diagnostic log goes to `dbtl_port.log`. It includes the window and picture sizes whenever they change, which helps with display problems. The game's DOS start-up text (hardware detection) is not shown on screen; the window stays black until graphics start. If the game quits with an error message, that message is shown in a dialog box.

| Key | Action |
|---|---|
| Alt+Enter or F11 | Toggle fullscreen |
| F8 | Switch between sharp scaling (fills the screen; all pixels even) and whole-number scaling (pixel-perfect, with black borders) |
| Alt+F4 or closing the window | Quit immediately (the same as switching off a DOS PC) |

The Windows cursor is hidden only while the game is drawing its own mouse pointer (the office, map and other interactive screens). Everywhere else, such as the title, the main menu and the results screens, the normal Windows cursor stays visible.

At the advertising agency, holding the left mouse button on an amount arrow repeats it: after half a second it steps about five times a second. A normal click is still a single step.

In the main menu, mouse movement does not move the guitar. Right-click moves it to the next item, left-click chooses, and the arrow keys and Enter work as before.

The game runs on its own thread, separate from the window. Minimising, maximising, resizing or dragging the window never pauses the game or its sound. Audio is buffered about 120 ms ahead. If Windows ever pauses the program long enough for the sound to run dry (an "audio underrun" in `dbtl_port.log`), the buffer grows by 40 ms, up to 300 ms, so the same kind of pause won't click again. The log also records every pause of 40 ms or more ("audio feed gap").

Settings are kept in `DBTL_Win.ini` next to the game. The file is created on first run, and each option is explained inside it: `speed(mips)`, `scale` (`whole` or `sharp`), `fullscreen` (`true` or `false`) and `volume` (0–100). Changes you make with F8 or Alt+Enter/F11 are saved there automatically.

The game's timing mostly depends on emulated CPU speed. The default of 20 million instructions per second (`speed(mips)=` in `DBTL_Win.ini`) feels close to the 486 the game was made for. Screen-refresh-paced parts run at the real 60 Hz of 640×480 VGA.

### Command-line options

| Option | Effect |
|---|---|
| `--fullscreen` | Start in fullscreen. |
| `--scale=1..6` | Initial window size multiplier. |
| `--nosound` | Disable audio output. |
| `--windowed` | Start in a window even if the last session ended in fullscreen. |

Any problem should show up in `dbtl_port.log`. Windows SmartScreen may warn about an unsigned new executable.
