From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "identification" |
|---|
| subject | "Format:SCI resource files" |
|---|
| claim | "ScummVM detects the SCI map version from the last four bytes and the directory: last u32 0xFFFFFFFF means an SCI0-style 6-byte-entry map (seven FF bytes: KQ5 FM-Towns); it is SCI0/SCI01 unless an entry names a resource volume that does not exist, in which case it is SCI1 middle. Otherwise a 3-byte-per-directory header list ending in id 0xFF (which must point at end of file) decides: directory span divisible by 6 but not 5 means 6-byte entries (SCI1 late), by 5 but not 6 means 5-byte entries (SCI1.1), neither or both leaves the choice open and the default is SCI1 late; a directory id below 0x80 means SCI32 (SCI2+)." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:SCI resource files" |
|---|
| observed_in | |
|---|
|
|---|
| data | | method | "map file heuristics" |
|---|
| indicator | "last u32 == 0xFFFFFFFF (SCI0/SCI01 or SCI1 middle by volume check); else directory span % 6 == 0 and % 5 != 0 -> 6-byte entries; % 5 == 0 and % 6 != 0 -> 5-byte entries" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "detection function around the comments 'SCI0 and SCI01 maps have last 6 bytes set to FF' and 'SCI1 and SCI1.1 maps consist of a fixed 3-byte header'" |
|---|
| repo | "scummvm/scummvm" |
|---|
| commit | "98d8fda924f4d469d1281a0747dc4385462a78c6" |
|---|
| path | "engines/sci/resource/resource.cpp" |
|---|
|
| type | "source" |
|---|
| detail | "detectMapVersion: uEnd == 0xFFFFFFFF branch with KQ5FMT check and findVolume-based kResVersionSci1Middle vs kResVersionSci0Sci1Early; directory loop with the % 5 / % 6 tests, directoryType < 0x80 -> Sci2, FF entry must equal file size, default kResVersionSci1Late" |
|---|
| repo | "https://github.com/scummvm/scummvm" |
|---|
| commit | "98d8fda924f4d469d1281a0747dc4385462a78c6" |
|---|
| path | "engines/sci/resource/resource.cpp" |
|---|
| lines | "1306-1372" |
|---|
|
|
|---|
| confidence | "medium" |
|---|
| related | |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-18T12:40:46.905Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T10:08:56.175Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read scummvm resource.cpp detectMapVersion 1278-1372 at 98d8fda: 0xFFFFFFFF branch with KQ5 FM-Towns seven-FF test and findVolume check, directory loop with % 5 / % 6, <0x80 means SCI2, FF entry must equal file size, default Sci1Late. The Mac resource-fork early return above it is not in the claim." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T06:38:56.520Z" |
|---|
| summary | "Read detectMapVersion in resource.cpp: an FF-terminated map is SCI0/SCI01 only if every volume number in its 6-byte entries exists, else SCI1 middle; the 6/5-byte split needs exactly one of the two…" |
|---|
| changed | | "claim" |
| "data" |
| "evidence" |
|
|---|
|
|
|---|