User:AF/ClassExtrapolation

From sc2k-reverse
Jump to navigationJump to search

The purposes of this page is to list the extrapolated classes during the reconstruction phase of the 1996 Special Edition.

For the most part this is a brute-force approach. As the classes are refined/trimmed they'll be adjusted over time.

The general methodology in this case is to generate a struct with N number of contained variables (this number can be rather high at times - it doesn't account for internal sub-structs and the like mind you, but there must be a starting place).

Structure Extrapolation

Whether the structural class format is entirely correct based on what was originally present is unclear.

However in order to ease the RE process some of these subclasses have created to reasonably allow for alignment.

NOTE: THIS LIST IS HEAVILY SUBJECT TO CHANGE

CWinApp -> CSimcityApp
CFrameWnd -> CMainFrame
CView -> CSimcityView
CWnd -> CSimcityWnd (This one appears to deal with some general sub-classing, this one needs more investigating and clarification)
CScrollView -> CSimcityScrollViewOne
CScrollView -> CSimcityScrollViewTwo
CScrollView -> CSimcityScrollViewThree
CDocument -> CSimcityDoc
CDocument -> CEngine
CDocument -> CSimGraphData
CMDIChildWnd -> CMyMDIChildWnd
CControlBar -> CMyToolBar
CMyToolBar -> CCityToolBar
CMyToolBar -> CMapToolBar
CDialog -> CAboutDialog
CDialog -> CMovieDialog
CDialog -> CGameDialog
CGameDialog -> CBridgeSelectDialog
CGameDialog -> CBudgetAdvisorDialog
CGameDialog -> CBudgetEducationDialog
CGameDialog -> CBudgetFireDialog
CGameDialog -> CBudgetFundDialog
CGameDialog -> CBudgetHealthDialog
CGameDialog -> CBudgetInformationDialog
CGameDialog -> CBudgetMainDialog
CGameDialog -> CBudgetOrdinanceDialog
CGameDialog -> CBudgetPoliceDialog
CGameDialog -> CBudgetTransportDialog
CGameDialog -> CBudgetZoneTaxSubDialog
CGameDialog -> CCityIndustryDialog
CGameDialog -> CCityMapDialog
CGameDialog -> CEventDialog
CGameDialog -> CGeneralInfoDialog
CGameDialog -> CInflightDialog
CGameDialog -> CInitialDialog
CGameDialog -> CNeighbourDialog
CGameDialog -> CNewGameDialog
CGameDialog -> CNewspaperDialog
CGameDialog -> COwnerInfoDialog
CGameDialog -> CPopulationDialog
CGameDialog -> CPowerPlantDialog
CGameDialog -> CQueryGeneralDialog
CGameDialog -> CQuerySpecificDialog
CGameDialog -> CScenarioDialog
CGameDialog -> CSelectArcologyDialog
CGameDialog -> CSimGraphDialog
CDockBar -> CStatusControlBar
CGraphics
CSound

CGraphics

struct CGraphics
{
  HBITMAP dwGRBitmap;
  HBITMAP dwGRBitmapLoColor;
  DWORD dwGRthree;
  CPalette *dwGRPalette;
  tagRECT dwGRRect;
  void *dwGRRGB;
  void *dwGRRGBLoColor;
  BITMAPINFO *dwGRBitmapInfo;
};

CSound

This deals with both the Music and Sound.

struct __unaligned __declspec(align(2)) CSound
{
  HWND *dwSNDhWnd;
  BOOL bSNDPlaySound;
  int iSNDCurrSoundID;
  CString dwSNDSoundString;
  void *dwSNDBufferOne;
  int iSNDCurrentSound;
  void *dwSNDBufferTwo;
  BOOL bSNDWasPlaying;
  int iSNDSoundID;
  void *dwSNDBufferThree;
  void *dwSNDBufferFour;
  void *dwSNDBufferFive;
  int iSNDNextSoundID;
  DWORD dwSNDUnknownOne;
  WORD wSNDMCIDevID;
  DWORD dwSNDMCIError;
  DWORD dwSNDUnknownTwo;
  CString dwSNDMusicString;
};

CSimcityApp

Struct to address reference ('this' type is set to 'DWORD *' in this case - exceptions will be noted accordingly):

this[53]  -> 0x4C70E4 - (unmarked and unreferenced area)
this[54]  -> 0x4C70E8 - Game AutoSave
this[55]  -> 0x4C70EC - This appears to be to do with cursor hit testing (and adjustment made during OnSetCursor) (further tracing likely needed)
this[56]  -> 0x4C70F0 - Another CityMode var separate from wCityMode.
this[57]  -> 0x4C70F4 - results of GameDeviceCaps with the HORZRES attribute
this[58]  -> 0x4C70F8 - results of GameDeviceCaps with the VERTRES attribute
this[59]  -> 0x4C70FC - Boolean var for selecting the background or foreground palette (toggled via CMainFrame::OnActivateApp)
this[60]  -> 0x4C7100 - Variable set and unset via CGameDialog::DoModal
this[61]  -> 0x4C7104 - Priscilla Activated
this[62]  -> 0x4C7108 - Variable that's set during widget/dialog/window drag situations (further tracing needed)
this[63]  -> 0x4C710C - OnQuit var that could be about suspending the simulation (further tracing needed)
this[64]  -> 0x4C7110 - Variable set to 1 via CMainFrame::OnDestroy
this[65]  -> 0x4C7114 - Variable that gets set to 0 if you fail a scenario or are generally chucked out of office.
this[66]  -> 0x4C7118 - NoNewspapers setting
this[67]  -> 0x4C711C - Foreground palette
this[68]  -> 0x4C7120 - Background palette
this[69]  -> 0x4C7124 - CString One (marked as data but not with any name or reference)
this[72]  -> 0x4C7130 - CString Two
this[75]  -> 0x4C713C - CString Three
this[78]  -> 0x4C7148 - CString Four (the global has the type LPSTR during initial detection here)
this[81]  -> 0x4C7154 - SCURK setting
this[82]  -> 0x4C7158 - CSound class allocation
this[83]  -> 0x4C715C - Toggle next program step (boolean)
this[120] -> 0x4C71F0 - GameMusic
this[121] -> 0x4C71F4 - GameSound
this[122] -> 0x4C71F8 - CString Array One (new alloc of 12)
this[158] -> 0x4C7288 - CString Array Two (new alloc of 12)
(WORD *)this[388] -> 0x4C7318 - Simulation Speed setting
(WORD *)this[389] -> 0x4C731A - Simulation Speed setting (this also appears in some areas as a HIGH word - hence the distinction)
this[195] -> 0x4C731C - Variable that's set and then unset within the SimulationTickingSpeed function
this[196] -> 0x4C7320 - (unmarked area - no name or reference)
this[197] -> 0x4C7324 - Animation "On Cycle" variable
this[200] -> 0x4C7330 - GetTickCount() result (unmarked area - no name or reference)
this[201] -> 0x4C7334 - Program Step
this[204] -> 0x4C7340 - MapModeVarCheck
this[206] -> 0x4C7348 - Variable that's set via CMainFrame::OnSysCommand (likely if the 'Quit' command is triggered)

CSimcityView

struct __cppobj __unaligned __declspec(align(2)) CSimcityView : CView
{
  CGraphics *dwSCVCGraphics;
  DWORD dwSCVTwo;
  DWORD dwSCVThree;
  BITMAPINFO *dwSCVBitmapInfo;
  LONG dwSCVWidth;
  LONG dwSCVHeight;
  CScrollView *dwSCVScrollViewOne;
  CScrollView *dwSCVScrollViewTwo;
  CScrollView *dwSCVScrollViewThree;
  tagRECT dwSCVRectSeven;
  tagRECT dwSCVRectFour;
  tagRECT dwSCVRectFive;
  tagRECT dwSCVRectOne;
  tagRECT dwSCVRectEight;
  tagRECT dwSCVRectNine;
  tagRECT dwSCVRectTen;
  tagRECT dwSCVRectEleven;
  tagRECT dwSCVRectTwelve;
  tagRECT dwSCVRectThirteen;
  DWORD dwSCVFiftyThree;
  DWORD dwSCVFiftyFour;
  DWORD dwSCVFiftyFive;
  tagPOINT dwSCVScrollPointOne;
  DWORD dwSCVFiftyEight;
  tagPOINT dwSCVScrollPointTwo;
  DWORD dwSCVSixtyOne;
  DWORD dwSCVSixtyTwo;
  DWORD dwSCVSixtyThree;
  RECT dwSCVRECTOne;
  DWORD dwSCVSixtySix;
  tagPOINT dwSCVScrollPointThree;
  WORD wSCVZoomLevel;
  DWORD dwSCVAdditionalZoomPerhaps;
};