Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Overlays

To run within the 640 KiB conventional memory ceiling of MS-DOS, Civilization uses Microsoft LINK’s dynamic overlay manager.

All 23 overlays share a single memory window of 9,648 bytes located at resident linear address 0x23740 (frame 0x2374). When an overlay routine is invoked, the overlay manager loads the requested overlay from disk (CIV.EXE) into this shared window before executing it.

       Resident Code Area                     Shared Overlay Swap Window
┌───────────────────────────────┐          ┌──────────────────────────────┐
│ Resident Modules (0000..23740)│ ──Call──>│ 2374:0000                    │
│                               │          │ Active Overlay Code (Max 9KB)│
│  [GAME.C, TURN.C, CITYMGT.C]  │<──Ret────│                              │
└───────────────────────────────┘          └──────────────────────────────┘
                                                          ▲
                                                          │ Swapped from disk
                                           ┌──────────────┴──────────────┐
                                           │ CIVILIZATION EXE File       │
                                           │  - Overlay 1  (SETUP)       │
                                           │  - Overlay 6  (AUDIENCE)    │
                                           │  - Overlay 7  (WORLDGEN)    │
                                           │  - Overlay 11 (SAVE)        │
                                           │  - Overlay 18 (SPACESHP)    │
                                           │  ... (23 Total Overlays)    │
                                           └─────────────────────────────┘

Each module can expose several entry points; the table shows one current shared declaration.

Complete Catalog of the 23 Overlays

Overlay IDModule SourceLocal Code BytesExample Shared ExportFunctional Purpose
1src/SETUP.C1,018setup_main()Hardware detection, graphics mode & audio driver configuration.
2src/INTRO.C6,588game_startup()Title sequence, MicroProse logo animations, credits.
3src/FAME.C3,192fame_load()Hall of Fame score calculation and high score table display.
4src/NOTES.C1,146o4_notes()In-game instructional popups, game tips, and key summaries.
5src/NEWGAME.C7,534new_game()New game menu, difficulty, world customization, tribe selection.
6src/AUDIENCE.C9,642leader_audience()Diplomatic negotiations, treaty proposals, leader audience screens.
7src/WORLDGEN.C7,512make_world()Procedural map generation, land growth, climate, rivers.
8src/PEDIA.C6,134civilopedia()Civilopedia encyclopedia viewer (units, improvements, wonders).
9src/REPLAY.C5,468o9_replay()Historical timeline replay displayed upon game victory/defeat.
10src/MAPVIEW.C1,702o10_mapview()Full-world strategic minimap viewer and territory inspection.
11src/SAVE.C3,994o11_save()Save/load menus, disk validation, .SVE and .MAP serialization.
12src/REPORTS.C7,000o12_reports()Military, foreign affairs, commerce, and demographic status reports.
13src/STATUS.C2,472o13_status()World status screen, civilization ranking, Top 5 Cities display.
14src/ADVISORS.C7,026advisor_open()Graphic advisor consultations (Military, Domestic, Foreign, Science).
15src/CIVWAR.C2,426civil_war()Civil war partition logic triggered when an enemy capital falls.
16src/QUIZ.C1,372o16_quiz()Manual-lookup copy protection challenge questions.
17src/PALACE.C4,246palace_view()Palace upgrade view and graphic construction screen.
18src/SPACESHP.C5,842spaceship_open()Alpha Centauri spaceship component assembly, flight simulation, arrival.
19src/CITYVIEW.C7,332city_scene()Hand-drawn graphical city interior view with active improvements.
20src/CITY.C5,188o20_city()City founding ceremony, naming prompt, tile radius activation.
21src/NEWS.C1,066news_box()Newspaper banner popups announcing world wonders and disasters.
22src/DIPLOMAT.C4,434dip_menu()Diplomat operations (bribery, sabotage, theft).
23src/NAMES.C1,926rename_leader()Procedural city name lists and tribal leader nomenclature.

Overlay Sizing Constraint

The overlay swap window is determined by the largest single overlay linked into the binary: $$\text{Max Overlay Size} = \text{Overlay 6 (\texttt{AUDIENCE.C})} = 9,642\text{ bytes}$$

Because LINK allocates 9,648 bytes (rounded up to a paragraph boundary) at [0x23740, 0x25CF0), any individual overlay is guaranteed to fit into the swap window without corrupting adjacent far data segments.