User:Araxestroy: Difference between revisions
From sc2k-reverse
Jump to navigationJump to search
Araxestroy (talk | contribs) No edit summary |
Araxestroy (talk | contribs) No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Hi, I'm Troy. I started and maintain the sc2kfix plugin and project. | Hi, I'm Troy. I started and maintain the sc2kfix plugin and project. | ||
== Notepad == | |||
::''Subpages:'' [[User:Araxestroy/DOS version decompilation notes]], [[User:Araxestroy/Class notes]] | |||
=== 1995 load crash bug === | |||
It looks like this particular crash is a null pointer dereference caused by trying to retrieve the CSimcityView HWND before the CSimcityView class instance actually exists. I probably won't get around to fixing this one since there's a whole modding framework to be written. | |||
=== Loading requirements === | |||
Intercept at '''int __thiscall LoadGame(void *this, int *a2, char *Src)''' -- 0x4025A4 -- and check the extension; jump to 0x4302E0 for .sc2 | |||
# Load everything into the structures | |||
# Load pszCityName | |||
# Call '''void sub_402743(void)''' -- recalculates border connections, updates power and water consumption, loads bond information, does some pollution modifiers I think? | |||
# Call '''void sub_402EF5(void)''' -- updates dwTileCount | |||
# Call '''void sub_401FFA(void)''' -- does ''something'' with regards to graphs, I think? Needs investigation | |||
# Call '''void sub_430C00(void)''' if we need to "uncompress" XLAB -- should only need to be done on manually converted save files | |||
# Return a non-zero from LoadGame intercept |
Latest revision as of 10:02, 24 March 2025
Hi, I'm Troy. I started and maintain the sc2kfix plugin and project.
Notepad
1995 load crash bug
It looks like this particular crash is a null pointer dereference caused by trying to retrieve the CSimcityView HWND before the CSimcityView class instance actually exists. I probably won't get around to fixing this one since there's a whole modding framework to be written.
Loading requirements
Intercept at int __thiscall LoadGame(void *this, int *a2, char *Src) -- 0x4025A4 -- and check the extension; jump to 0x4302E0 for .sc2
- Load everything into the structures
- Load pszCityName
- Call void sub_402743(void) -- recalculates border connections, updates power and water consumption, loads bond information, does some pollution modifiers I think?
- Call void sub_402EF5(void) -- updates dwTileCount
- Call void sub_401FFA(void) -- does something with regards to graphs, I think? Needs investigation
- Call void sub_430C00(void) if we need to "uncompress" XLAB -- should only need to be done on manually converted save files
- Return a non-zero from LoadGame intercept