I'd love to delve into disassembling DF and do some memory mapping. Helping with dfhack and TWBT memory address fixing on updates is one reason, but also I'd like to see more about what is going on under the hood exactly.
I'm a coder and I've written plenty of asm before, but never dabbled with disassembly. I can't seem to find a README or BUILDING or any sort of docs on decompiling DF into a readable state.
Using df-structures and df_misc, I've been able to get metasm running (see screenshot below), but I'm not sure what to do next.
There is undoubtedly a whole bunch of knowledge about DF's internals floating around here in the form of _Q, angavrilov, jjyg, mifki, et. al., and I'd like to extract some of that.
Anyone care to write a simple primer on the subject? I don't need my hand held the whole way through, just a good shove in the right direction.
---
An example of two tasks I wanted to learn how to accomplish.
1. Find the
p_display memory address for TWBT
// Original code will check screentexpos et al. for changes but we don't want that
// because map is not rendered this way now. But we can't completely disable graphics
// because it's used on status screen to show professions at least.
// To find this address, look for a function with two SDL_GetTicks calls inside,
// there will be two calls with the same argument right before an increment between
How do I get libs/Dwarf_Fortress decompiled to work start grepping through the asm for that case?
2. Stockpile Settings UI lists - example: Furniture -> Metal and Stone material sub-lists
I want to be able to see which flags (IS_METAL, etc) DF is using to filter inorganics to generate these lists. So the question becomes:
How do I get libs/Dwarf_Fortress decompiled? (same as previous). How do I use the associated df_misc, and df-structure utils to help narrow down the section of code where the stockpile setting ui is?
edit: I'm looking for Linux specific advice here, not Windows.