Stronghold Decompilation Progress Almost done recovering the data files.
That was really tedious...
Remains saving sprite sheets as *.LBM, instead of PNG.
Then the grab process should be working again.
That will allow easily decompiling the stash functions.
Recovering unit sprite sheets was involved.
The game has a set of hardcoded agent archetype structures.
Each references a hardcoded animation table.
Each agent variation can have up to 6 sprite sheets:
three races, two genders.
Ghidra structure support is top notch.
Compared to IDA Pro, you can just define the areas you care about.
typedef struct {
uint8_t ai; //0=player controlled, 1=computer controlled
uint8_t type;
int8_t nanims;
uint32_t sprs[6]; //stash handle for sprfls
undefined field5_0x1b;
undefined field6_0x1c;
undefined field7_0x1d;
undefined field8_0x1e;
undefined field9_0x1f;
undefined field10_0x20;
undefined field11_0x21;
undefined field12_0x22;
undefined field13_0x23;
uint32_t name;
uint32_t anms;
int16_t sprfls[6]; /* sprite file ids; 0,1,2=male; 3,4,5=female */
undefined field20_0x38;
undefined field21_0x39;
undefined field22_0x3a;
undefined field23_0x3b;
undefined field24_0x3c;
undefined field25_0x3d;
undefined field26_0x3e;
undefined field27_0x3f;
undefined field28_0x40;
undefined field29_0x41;
undefined field30_0x42;
undefined field31_0x43;
undefined field32_0x44;
undefined field33_0x45;
undefined field34_0x46;
undefined field35_0x47;
undefined field36_0x48;
undefined field37_0x49;
undefined field38_0x4a;
undefined field39_0x4b;
undefined field40_0x4c;
undefined field41_0x4d;
undefined field42_0x4e;
undefined field43_0x4f;
undefined field44_0x50;
undefined field45_0x51;
undefined field46_0x52;
undefined field47_0x53;
int16_t prtfls[6]; /* portrait file ids; 0,1,2=male; 3,4,5=female */
uint32_t prts[6]; /* portrait stash handles */
uint32_t prtpals[6]; /* portrait palettes */
uint32_t wpn_name;
undefined field52_0x94;
} PACKED agntG_t;
Current Mood: accomplished