Just tell me if you would want me to describe the steps to easily find these offsets.
That would be perfect.
Ok here are the steps:
1. Edit your init to run DF at 80x25 windowed.
2. Download
this save and put it into your save folder. It is made in 0.31.01 so will run in any 0.31.xx version.
3. Run DF and load the save.
4. Press F1 and N (it will move your view to upper right corner of the map and make you see notes).
It should look like that: (look at the corner
)
5. Open Cheat Engine and connect to DF process.
6. Search for "Array of bytes" 480405014104050158040501 hexagonal.
7. You should get 2 addresses, choose one randomly.
8. Substract 68 hexagonal from that address to get the address of the start of the array. ( 68 hex = 104 dec = (25+1)*4 )
9. Add 1F40 hexagonal to the array start address to get array end address (1F40 hex = 8000 dec = 80*25*4 )
10. Now you have 2 adresses. Search for "4 bytes" values containing them. You will get adresses of screen and screen_limit pointers. Both will be in static memory. You may need to try a few times bacause the pointers swap between 2 tables and may temporarily point to the wrong one.
11. The other addresses are related to screen and screen_limit:
clipx[0] = screen + 24 bytes
clipx[1] = screen + 28 bytes
clipy[0] = screen + 32 bytes
clipy[1] = screen + 36 bytes
dimx = screen_limit - 16 bytes
dimy = screen_limit - 12 bytes
mouse_x = screen_limit - 8 bytes
mouse_y = screen_limit - 4 bytes
Ok that is all.
I got the offsets for 0.31.19 Windows SDL when preparing this post:
screen: 00B4AD1C
screen_limit: 00B4B08C
The other variables as above.