User:Araxestroy: Difference between revisions

From sc2k-reverse
Jump to navigationJump to search
No edit summary
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:


== Notepad ==
== Notepad ==
::''Subpages:'' [[User:Araxestroy/DOS version decompilation notes]]
::''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 ===
=== Loading requirements ===

Latest revision as of 10:02, 24 March 2025

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

  1. Load everything into the structures
  2. Load pszCityName
  3. Call void sub_402743(void) -- recalculates border connections, updates power and water consumption, loads bond information, does some pollution modifiers I think?
  4. Call void sub_402EF5(void) -- updates dwTileCount
  5. Call void sub_401FFA(void) -- does something with regards to graphs, I think? Needs investigation
  6. Call void sub_430C00(void) if we need to "uncompress" XLAB -- should only need to be done on manually converted save files
  7. Return a non-zero from LoadGame intercept