Skip to content

COMMONSP.IMG — Common Sprite Bank

Compact startup graphics bank loaded during the VGA bootstrap phase. Contains common UI sprites and shape records used across multiple game screens. Loaded by DARKLAND.EXE startup helper 1699:179A0 after mgraphic.exe is installed.

Extension
COMMONSP.IMG
Location
DARKLAND\
Byte order
Little-endian (16-bit)
Size
4,078 B fixed (0x0FEE) — length word + 14-entry offset table + 4,048-byte payload
Compression
None
Magic
None — payload_length word (0x0FD0) at 0x00
Status
Partial
Source
RE — direct file inspection + DARKLAND.EXE startup analysis (2026-04-16)
Partial. File layout and offset table are confirmed. Per-record row encoding in the large body (slice 13) and the exact semantics of slices 0–10 are not yet fully solved. The label/dimension pattern is well-supported but pixel-row encoding is not complete.

Reverse-engineered from direct file inspection and DARKLAND.EXE startup analysis (2026-04-16).

File Layout

Offset 0x0000:  word       payload_length = 0x0FD0
Offset 0x0002:  word[13]   payload_offsets — 13 non-zero offsets into payload
Offset 0x001E:  byte[0x0FD0] payload

The leading word is the payload length (0x0FD0 = 4048). The header is 0x001E bytes: 0x001E + 0x0FD0 = 0x0FEE exactly matches the file size.

The offset table begins at word 1 and contains 14 entries (including a zero-valued first entry). Only the 13 non-zero entries are meaningful offsets into the payload. This count is an exact match for the 13 startup globals seeded from this file: A3D6, A3E5, A2E9, A33B, A33E, A392, A660, A662, A664, A666, A626, A628, A2E5.

Offset Table

EntryPayload offsetSlice lengthNotes
00x00000x001218 bytes; control/descriptor
10x00120x00044 bytes
20x00160x00044 bytes
30x001A0x000D13 bytes
40x00270x000D13 bytes
50x00340x00044 bytes
60x00380x00044 bytes
70x003C0x00022 bytes
80x003E0x00022 bytes
90x00400x00022 bytes
100x00420x00022 bytes
110x00440x0086134 bytes; structured descriptor block
120x00CA0x002739 bytes; short control block
130x00F10x0EDF3807 bytes; main image body

Slices 0–10 are tiny entries; slices 11 and 12 are short structured blocks; slice 13 is the dominant image/resource body.

Payload Contents

Small slices (0–10)

Dominated by low byte values such as 0x05, 0x07, 0x08, 0x0F, and small counter-like bytes (0x17). Best current reading: dimension tables, hotspot entries, or group descriptor records.

Large body (slice 13)

The 3807-byte body contains compact indexed art records with short embedded ASCII labels. Dominant byte values are in the range 0x96..0x9F — consistent with palette-indexed sprite data.

Each named subrecord follows a common pattern: a label string, then a width byte, then a height byte, then the pixel data (possibly with per-row length encoding).

Selected subrecords identified by label:

File offsetLabelWidthHeightNotes
0x0178OVEEM0x360x01Wide 1-line strip
0x0358HALLEN0x360x01Wide 1-line strip
0x0398EEP0x360x01Wide 1-line strip
0x03D8CORIDO0x040x04Small 4×4 shape
0x03F7KCONVER0x040x04Small 4×4 shape
0x0417KCNSTRN0x040x04Small 4×4 shape
0x0437KCHAMAL0x040x04Small 4×4 shape
0x0457KBATLMN0x360x26Large named record
0x0CB7BCHANGE0x360x0BLarge named record

Note: Some label bytes are immediately followed by the width byte which happens to fall in the printable ASCII range (0x36 = '6'). Strings such as HALLEN6 are correctly read as HALLEN + width 0x36, not as a 7-character label.

How the Engine Uses This File

The startup helper 1699:179A0:

  1. Loads COMMONSP.IMG into the staging buffer set up at C103:C105.
  2. Calls 0DDD:0004 (a shared object-allocation service) with the first payload word and tag string CnnmSp; stores the returned handle in 9C42.
  3. Calls 0EC4:2EB4 (a far memory-copy helper) with the payload body and the returned base.
  4. Walks the 14-entry offset table and seeds 13 startup globals in regions A2xx, A3xx, A6xx by rebasing file-relative offsets against the installed base.

Later presentation logic compares [9C42] against runtime-selected resource handles, confirming that COMMONSP.IMG is installed as a durable common-asset bank rather than a one-shot load buffer.

Relationship to BATTLEGR.IMG

COMMONSP.IMG belongs to the same named image-bank family as BATTLEGR.IMG. Both files begin with a payload-length word, carry a multi-entry offset table, and embed compact named subrecords. BATTLEGR.IMG uses a 0x194-byte header and labels like $VILLA0, $MINET3, $CITYW0.

Confidence

High for the file layout and offset table.

Medium for the exact per-record row encoding and the semantics of each small slice. The label/dimension pattern is well-supported but the exact pixel-row encoding is not yet fully solved.