# CorsixTH

> Built from commit 3effc4a043e0 on 2026-11-24. The current build: https://abdess.github.io/retrobios/version.json

Source: https://abdess.github.io/retrobios/emulators/corsixth/

CorsixTH emulates Theme Hospital. It reads 6 files, 5 of them required: without a required file it does not start games.

**About this profile**

| Detail | Value |
|---|---|
| Type | standalone |
| Classification | Game engine |
| Source | [https://github.com/CorsixTH/CorsixTH](https://github.com/CorsixTH/CorsixTH) |
| Upstream | none: the source is the project itself |
| Version | v0.70.1-263-ge5668b9, 263 commits after tag [`v0.70.1`](https://github.com/CorsixTH/CorsixTH/tree/v0.70.1) |
| Revision | [CorsixTH/CorsixTH@e5668b9b2a6f](https://github.com/CorsixTH/CorsixTH/commit/e5668b9b2a6f59c492b2446821528d67f5d0ee53) |
| Run by | [Batocera](https://abdess.github.io/retrobios/platforms/batocera/), [KNULLI](https://abdess.github.io/retrobios/platforms/knulli/), [Recalbox](https://abdess.github.io/retrobios/platforms/recalbox/), [RetroBat](https://abdess.github.io/retrobios/platforms/retrobat/) |
| Profiled | 2026-10-04 |
| Profile | [YAML](https://github.com/Abdess/retrobios/blob/main/emulators/corsixth.yml), [JSON](https://abdess.github.io/retrobios/api/v1/emulators/corsixth.json) |
| Cores | corsixth |
| Systems | [Theme Hospital](https://abdess.github.io/retrobios/systems/game-engines/#theme-hospital) |
| Checks the file by | existence |

**Install this emulator's files**

With Batocera, Recalbox, RetroBat or KNULLI: the installer finds Batocera, Recalbox, RetroBat or KNULLI and its BIOS folder, then downloads only the files CorsixTH reads there and checks each one.

**Windows:**

Open Start. Type **PowerShell**, press Enter. Click Copy. Right-click to paste. Press Enter.

PowerShell

```
&([scriptblock]::Create((irm https://abdess.github.io/retrobios/i.ps1))) --emulator corsixth
```

**On the device:**

Open a terminal on the device. Or connect from a computer with SSH, a terminal over the network. Paste the line. Press Enter.

Terminal

```
curl -fsSL https://abdess.github.io/retrobios/i | sh -s -- --emulator corsixth
```

**Technical notes**

CorsixTH is a Lua + C++ reimplementation of Bullfrog's Theme Hospital engine. It reads graphics, sprites, levels and sounds from an untouched Theme Hospital install (full retail/GOG or the shareware demo).

App:checkInstallFolder() in [`CorsixTH/Lua/app.lua:1450`](https://github.com/CorsixTH/CorsixTH/blob/e5668b9b2a6f59c492b2446821528d67f5d0ee53/CorsixTH/Lua/app.lua#L1450) drives the install discovery:

1. config.theme_hospital_install (user override) is tried first (:1453). If unset or wrong, the loader scans a list of common paths (:1473-1491) looking for a folder that passes App:isThemeHospitalPath, which demands three subdirectories named data, levels and qdata (:1435-1447).
2. Once a candidate is accepted, three sentinel files must exist (:1523-1525): DATA/VBlk-0.tab LEVELS/Level.L1 QDATA/SPointer.dat Any missing file aborts init with "Invalid Theme Hospital folder specified in config file..." (:1528).
3. DataM/Demo.dat (:1537) marks the shareware demo install. Its presence switches a different corruption-size check on ANIMS/WINLEVEL.SMK (243188), LEVELS/LEVEL.L1 (163948) and DATA/BUTTON01.DAT (252811) at :1561-1563. Full installs instead get soft size checks on ANIMS/AREA01V.SMK, WINGAME.SMK, WINLEVEL.SMK, LOSE1.SMK and INTRO/INTRO.SM4 (:1565-1569).
4. QData/Font00V.dat is read unconditionally (:1578) and its CRC32 picks the charset (mik vs cp437).

The install root is read as a tree. FileSystem:setRoot() lists the root, each subdirectory is listed the first time a path crosses it, and every name is matched after normalise() upper-cases it ([`CorsixTH/Lua/filesystem.lua:59-76`](https://github.com/CorsixTH/CorsixTH/blob/e5668b9b2a6f59c492b2446821528d67f5d0ee53/CorsixTH/Lua/filesystem.lua#L59-L76), [`93-117`](https://github.com/CorsixTH/CorsixTH/blob/e5668b9b2a6f59c492b2446821528d67f5d0ee53/CorsixTH/Lua/filesystem.lua#L93-L117), [`243-272`](https://github.com/CorsixTH/CorsixTH/blob/e5668b9b2a6f59c492b2446821528d67f5d0ee53/CorsixTH/Lua/filesystem.lua#L243-L272)). Graphics, sprites, levels, sounds and movies are opened from that tree on demand, so the install is declared as one directory. The files the loader names at startup keep their own entries, written with the upper-case names the DOS release ships and the lookup normalises to.

The sound/music path uses the game's XMI tracks when a SoundFont is available (App:findSoundFont at [`CorsixTH/Lua/app.lua:1591`](https://github.com/CorsixTH/CorsixTH/blob/e5668b9b2a6f59c492b2446821528d67f5d0ee53/CorsixTH/Lua/app.lua#L1591) probes GeneralUser-GS.sf2, FluidR3_GM.sf2, FluidR3.sf3 and three Linux system paths), and the SoundFont is a user preference, not game data.

## Files

**6 files**: 5 required, 1 optional.

By kind: 6 game data.

In this collection: 6 in repo and 0 missing.

## Game data

| File | Status |
|---|---|
| ** ### `corsixth/` ** Theme Hospital install directory (full game or demo) - System: [Theme Hospital](https://abdess.github.io/retrobios/systems/game-engines/#theme-hospital)- Accepted as an install when it holds data, levels and qdata subdirectories. The rest of the tree is opened by name on demand. - Collection copies: 379 files under [`bios/Game Engines/Theme Hospital/corsixth/`](https://abdess.github.io/retrobios/systems/game-engines/#theme-hospital) ([browse](https://github.com/Abdess/retrobios/tree/main/bios/Game%20Engines/Theme%20Hospital/corsixth)) **Source** - Source: [`CorsixTH/Lua/filesystem.lua:64-76`](https://github.com/CorsixTH/CorsixTH/blob/e5668b9b2a6f59c492b2446821528d67f5d0ee53/CorsixTH/Lua/filesystem.lua#L64-L76), [`CorsixTH/Lua/app.lua:1435-1447`](https://github.com/CorsixTH/CorsixTH/blob/e5668b9b2a6f59c492b2446821528d67f5d0ee53/CorsixTH/Lua/app.lua#L1435-L1447), [`CorsixTH/Lua/app.lua:1454`](https://github.com/CorsixTH/CorsixTH/blob/e5668b9b2a6f59c492b2446821528d67f5d0ee53/CorsixTH/Lua/app.lua#L1454), [`CorsixTH/Lua/app.lua:1501`](https://github.com/CorsixTH/CorsixTH/blob/e5668b9b2a6f59c492b2446821528d67f5d0ee53/CorsixTH/Lua/app.lua#L1501) | requiredin repogame datadirectory |
| ** ### `VBLK-0.TAB` ** Theme Hospital core sprite index, sentinel checked at startup - Path: `corsixth/DATA/VBLK-0.TAB`- System: [Theme Hospital](https://abdess.github.io/retrobios/systems/game-engines/#theme-hospital)- Looked up as Data/VBlk-0.tab. - Collection copy: [`bios/Game Engines/Theme Hospital/corsixth/DATA/VBLK-0.TAB`](https://abdess.github.io/retrobios/systems/game-engines-theme-hospital/#sha1-e3de36bdd14d) **Source** - Source: [`CorsixTH/Lua/app.lua:1523`](https://github.com/CorsixTH/CorsixTH/blob/e5668b9b2a6f59c492b2446821528d67f5d0ee53/CorsixTH/Lua/app.lua#L1523) | requiredin repogame data |
| ** ### `LEVEL.L1` ** First Theme Hospital level file, sentinel checked at startup - Path: `corsixth/LEVELS/LEVEL.L1`- System: [Theme Hospital](https://abdess.github.io/retrobios/systems/game-engines/#theme-hospital)- Looked up as Levels/Level.L1. With the demo marker present, a size more than 1024 bytes away from 163948 is reported as corrupt and the game still starts. - Collection copy: [`bios/Game Engines/Theme Hospital/corsixth/LEVELS/LEVEL.L1`](https://abdess.github.io/retrobios/systems/game-engines-theme-hospital/#sha1-d264f15b394d) **Source** - Source: [`CorsixTH/Lua/app.lua:1524`](https://github.com/CorsixTH/CorsixTH/blob/e5668b9b2a6f59c492b2446821528d67f5d0ee53/CorsixTH/Lua/app.lua#L1524), [`CorsixTH/Lua/app.lua:1562`](https://github.com/CorsixTH/CorsixTH/blob/e5668b9b2a6f59c492b2446821528d67f5d0ee53/CorsixTH/Lua/app.lua#L1562) | requiredin repogame data |
| ** ### `SPOINTER.DAT` ** Sprite pointer table, sentinel checked at startup - Path: `corsixth/QDATA/SPOINTER.DAT`- System: [Theme Hospital](https://abdess.github.io/retrobios/systems/game-engines/#theme-hospital)- Looked up as QData/SPointer.dat. - Collection copy: [`bios/Game Engines/Theme Hospital/corsixth/QDATA/SPOINTER.DAT`](https://abdess.github.io/retrobios/systems/game-engines-theme-hospital/#sha1-e564e0e0e6d4) **Source** - Source: [`CorsixTH/Lua/app.lua:1525`](https://github.com/CorsixTH/CorsixTH/blob/e5668b9b2a6f59c492b2446821528d67f5d0ee53/CorsixTH/Lua/app.lua#L1525) | requiredin repogame data |
| ** ### `FONT00V.DAT` ** Theme Hospital font, its CRC32 selects charset (mik vs cp437) - Path: `corsixth/QDATA/FONT00V.DAT`- System: [Theme Hospital](https://abdess.github.io/retrobios/systems/game-engines/#theme-hospital)- Looked up as QData/Font00V.dat. - Collection copy: [`bios/Game Engines/Theme Hospital/corsixth/QDATA/FONT00V.DAT`](https://abdess.github.io/retrobios/systems/game-engines-theme-hospital/#sha1-9e2393861590) **Source** - Source: [`CorsixTH/Lua/app.lua:1578-1586`](https://github.com/CorsixTH/CorsixTH/blob/e5668b9b2a6f59c492b2446821528d67f5d0ee53/CorsixTH/Lua/app.lua#L1578-L1586) | requiredin repogame data |
| ** ### `DEMO.DAT` ** Demo marker: its presence selects the demo graphics set and the demo size checks - Path: `corsixth/DATAM/DEMO.DAT`- System: [Theme Hospital](https://abdess.github.io/retrobios/systems/game-engines/#theme-hospital)- Looked up as DataM/Demo.dat. Absent from a full install. - Collection copy: [`bios/Game Engines/Theme Hospital/corsixth/DATAM/DEMO.DAT`](https://abdess.github.io/retrobios/systems/game-engines-theme-hospital/#sha1-cbb8391cb65c) **Source** - Source: [`CorsixTH/Lua/app.lua:1537-1541`](https://github.com/CorsixTH/CorsixTH/blob/e5668b9b2a6f59c492b2446821528d67f5d0ee53/CorsixTH/Lua/app.lua#L1537-L1541), [`CorsixTH/Lua/app.lua:1560-1563`](https://github.com/CorsixTH/CorsixTH/blob/e5668b9b2a6f59c492b2446821528d67f5d0ee53/CorsixTH/Lua/app.lua#L1560-L1563) | optionalin repogame data |

## Next steps

- [Get the files](https://abdess.github.io/retrobios/which-pack/), for the setup in use
- [Every system](https://abdess.github.io/retrobios/systems/), and the files each one needs
- [When a game does not start](https://abdess.github.io/retrobios/wiki/troubleshooting/)

Data as of 24 November 2026.
