From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "behavior" |
|---|
| subject | "Format:HAM (Descent)" |
|---|
| claim | "In Rebirth's Descent 2 build, after the HAM header (id, version, and for versions below 3 an int32 sound offset) bm_read_all reads, in this order, count-prefixed tables: textures (+tmap_info), sounds (two byte arrays of that count), vclips, eclips, wall clips, robots, robot joints, weapons, powerups, polygon models (records then model data), dying/dead model numbers, gauges (and hires gauges), object bitmaps (and their pointers), player ship, cockpits, first multi bitmap number, reactors, marker model number, and for HAM versions below 3 the two exit model numbers; read_hamfile then reads int16 bitmap translations until end of file or until the translation array is full, and for versions below 3 seeks to the sound offset to read the sounds." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Descent 2 game data as read by Rebirth's bm_read_all (compiled only in the Descent 2 build; per-game record layouts were not summed)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | trigger | "loading game data (gamedata_init -> properties_init -> read_hamfile)" |
|---|
| effect | "fills the texture, sound, clip, robot, weapon and model tables from consecutive count + record arrays" |
|---|
| condition | "bm_read_all exists only in the Descent 2 build (DXX_BUILD_DESCENT == 2); the Descent 1 build reads its tables in properties_read_cmp (same file) from the PIG and was not compared; HAM version below 3 files (Descent 2 demo ham, found when descent2.ham is missing) take the extra branches" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "bm_read_all sequence of PHYSFSX_readInt counts and *_read_n calls; exit models only if Piggy_hamfile_version < pig_hamfile_version::_3" |
|---|
| repo | "https://github.com/dxx-rebirth/dxx-rebirth" |
|---|
| commit | "6943b924bea749543ef5729f31a28345e79716d2" |
|---|
| path | "similar/main/bm.cpp" |
|---|
| lines | "325-423" |
|---|
|
| type | "source" |
|---|
| detail | "read_hamfile calls bm_read_all then reads GameBitmapXlat int16 values until PHYSFS_eof" |
|---|
| repo | "https://github.com/dxx-rebirth/dxx-rebirth" |
|---|
| commit | "6943b924bea749543ef5729f31a28345e79716d2" |
|---|
| path | "similar/main/piggy.cpp" |
|---|
| lines | "1126-1155" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Order of tables in bm_read_all" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-19T09:36:32.664Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T11:48:56.530Z" |
|---|
| result | "confirmed" |
|---|
| method | "After my correction: read bm_read_all (bm.cpp 325-423), the preprocessor structure of bm.cpp and read_hamfile/properties_init in piggy.cpp 1083-1215 at 6943b92." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T11:48:54.649Z" |
|---|
| summary | "Scope was wrong: bm_read_all sits inside the DXX_BUILD_DESCENT == 2 branch of bm.cpp (#elif at 279, #endif at 838), so the Descent 1 build does not have it at all, and the '// D1' exit-model branch…" |
|---|
| changed | |
|---|
|
|
|---|