# Windows 95 and DirectDraw games: what to know before the first run

## What to know

A game made for Windows 95 and DirectX 1 to 5 assumed a 1990s machine. It expected port I/O to
be allowed, a 16-bit desktop, a dozen display modes, a CD in the drive and the settings its
installer wrote. Each assumption fails in its own way on Windows 10 or under Wine. Make the
checks below before the first run. Most failures then need only a one-line fix.

Before the first run:

- **Privileged instructions.** Windows 95 let a program use `in`, `out`, `cli` and `sti`.
  Run `./gameframe run insns GAME.EXE '^(in|out|ins|outs|cli|sti)'` and patch every probe
  ([privileged instruction](https://tanepiper.github.io/game-frame/knowhow/wine-privileged-instruction.md)).
- **CPU checks.** Games use `cpuid`, `rdtsc` and Cyrix register probes to choose a build or to
  refuse to run.
  `insns GAME.EXE '^(cpuid|rdtsc)'` finds them. A game may have an MMX build
  ([docs/hardware/simd.md](https://tanepiper.github.io/game-frame/hardware/simd.md)).
- **Display modes.** The game lists modes with `EnumDisplayModes` into a fixed table, and may
  overflow it ([mode table](https://tanepiper.github.io/game-frame/knowhow/directdraw-mode-table-overflow.md)). It may allow a window only on a
  16-bit desktop ([windowed mode](https://tanepiper.github.io/game-frame/knowhow/directdraw-windowed-16bit-desktop.md)). It may draw 16-bit
  pixels in RGB565 or RGB555 ([back surface](https://tanepiper.github.io/game-frame/knowhow/directdraw-16bit-back-surface.md)).
- **The CD.** The game finds its disc by drive type and volume label. It reads data from the
  disc.
  Every failed file open may show as "insert the CD" ([insert CD](https://tanepiper.github.io/game-frame/knowhow/insert-cd-file-open-failed.md)).
  Copy the disc's files and give the drive the same label.
- **Settings.** The installer wrote an ini file in the Windows folder or registry keys. Read the
  installer's script or strings. Write exactly the same values
  ([ini paths](https://tanepiper.github.io/game-frame/knowhow/installer-ini-path-separator.md)).
- **One copy.** A named mutex allows only one copy to run. A leftover process blocks every new
  run ([leftover process](https://tanepiper.github.io/game-frame/knowhow/single-instance-leftover.md)).
- **Video.** Intro videos often need the Indeo codec from the disc's install folder. Leave them
  out at first.
- **Sound and CD audio.** DirectSound and `mcicda` can fail on a modern machine. Most games
  offer to continue without them. Accept that until the picture works.

The places to run it, best first for observing, are Wine on Linux or macOS (trace channels,
scriptable), 86Box with a recorded period machine profile when motherboard or card behavior
matters, a virtual machine with Windows 98, and GameFrame's `pe32_emu` for single routines with
no system calls. See the [86Box guide](https://tanepiper.github.io/game-frame/observe/86box.md) before using a profile as evidence.

Wine's trace channels for this era are `+ddraw` (surfaces and modes), `+dinput`, `+dsound`,
`+file` (every file open) and `+seh` (exceptions with registers). Use `+relay` with
`RelayFromInclude=GAME` to see only the game's own calls.
