<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sc2kfix.net/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Araxestroy</id>
	<title>sc2k-reverse - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sc2kfix.net/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Araxestroy"/>
	<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/Special:Contributions/Araxestroy"/>
	<updated>2026-04-07T16:26:58Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=MediaWiki:Sidebar&amp;diff=799</id>
		<title>MediaWiki:Sidebar</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=MediaWiki:Sidebar&amp;diff=799"/>
		<updated>2025-04-15T10:53:34Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* navigation&lt;br /&gt;
** mainpage|mainpage-description&lt;br /&gt;
** recentchanges-url|recentchanges&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
** https://sc2kfix.net|sc2kfix Home&lt;br /&gt;
** https://sc2kfix.net/discord|Discord&lt;br /&gt;
** https://community.simtropolis.com/forums/topic/763619-sc2kfix-a-bugfix-and-modding-plugin-for-simcity-2000-special-edition/|Simtropolis thread&lt;br /&gt;
* SEARCH&lt;br /&gt;
* TOOLBOX&lt;br /&gt;
* LANGUAGES&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Main_Page&amp;diff=798</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Main_Page&amp;diff=798"/>
		<updated>2025-04-15T10:52:03Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ __NOEDITSECTION__ {{#description2:Welcome to sc2k-reverse, the sc2kfix Project wiki!}}&lt;br /&gt;
[[File:{{#setmainimage:SC2K-reverse Header.png}}|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Welcome to sc2k-reverse, the sc2kfix Project wiki!&#039;&#039;&#039; Pardon our dust, as this wiki is brand new and we haven&#039;t had a chance to do much of anything around here yet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;u&amp;gt;Need an account?&amp;lt;/u&amp;gt;&#039;&#039;&#039; PM araxestroy on the Simtropolis forums or on the libera.chat IRC network, or ask in the sc2kfix Discord.&lt;br /&gt;
&lt;br /&gt;
== Wiki to-do list ==&lt;br /&gt;
&lt;br /&gt;
* More page component templates (see [[:Category:Templates]])&lt;br /&gt;
** Game infoboxes&lt;br /&gt;
** RE related stuff? Not sure what we&#039;ll need&lt;br /&gt;
** Category navboxes&lt;br /&gt;
* Wiki meta pages (categories, help, copyright page, etc)&lt;br /&gt;
* Nicer main page (maybe split it into flex columns?)&lt;br /&gt;
* Get some stub articles written up as a &amp;quot;schema&amp;quot;&lt;br /&gt;
* &amp;lt;s&amp;gt;Make sure the email system actually works&amp;lt;/s&amp;gt; it absolutely does not, I may need to move this thing to a Linode VPS sooner rather than later&lt;br /&gt;
&lt;br /&gt;
== sc2kfix Plugin Information ==&lt;br /&gt;
&lt;br /&gt;
* [https://sc2kfix.net/plugin.html Plugin user guide]&lt;br /&gt;
* [[SC2X|SC2X save file format]]&lt;br /&gt;
* &#039;&#039;&#039;Modding with C/C++&#039;&#039;&#039;&lt;br /&gt;
** [[Modding|C/C++ Modding Basics]] &#039;&#039;(draft)&#039;&#039;&lt;br /&gt;
** [[Modding/Hooks|Hook List]]&lt;br /&gt;
* &#039;&#039;&#039;Modding with Kuroko&#039;&#039;&#039;&lt;br /&gt;
** [[Kuroko|Kuroko Basics]]&lt;br /&gt;
** [[Kuroko/Module_sc2kfix|sc2kfix module]]&lt;br /&gt;
** [[Kuroko/Module_sc2k|sc2k module]]&lt;br /&gt;
&lt;br /&gt;
== SimCity 2000 Reverse Engineering ==&lt;br /&gt;
&lt;br /&gt;
* [[Function list]]&lt;br /&gt;
* [[Known global variables]]&lt;br /&gt;
* [[Classes]]&lt;br /&gt;
* [[Map data]]&lt;br /&gt;
* [[Data formats]]&lt;br /&gt;
* [[Tiles]]&lt;br /&gt;
* [[SimCity 2000 Bugs]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Known_global_variables&amp;diff=796</id>
		<title>Known global variables</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Known_global_variables&amp;diff=796"/>
		<updated>2025-04-09T03:09:12Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Heavy construction}}&lt;br /&gt;
&lt;br /&gt;
This is a table of global variables in SimCity 2000 that have been at least partially reverse engineered and given names. It is probably going to be unpleasant to update, but at least it looks nice and you can sort it.&lt;br /&gt;
&lt;br /&gt;
Data about where in the MISC chunk certain variables are located is from dfloer&#039;s sc2k-docs repository on GitHub (CC BY-SA 4.0).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Uncategorized variables&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Address|The address of the variable.}} ! {{tooltip|Type|What type this variable is declared as.}} ! {{tooltip|Name|The name of the variable.}} ! {{tooltip|MISC offset|If this variable is stored in the .sc2 MISC chunk, this is where in the chunk it&#039;s stored.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C702C || CWnd* || &#039;&#039;&#039;pCWndRootWindow&#039;&#039;&#039; ||  || Pointer to the MFC CWnd class for the &amp;quot;root window&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
| 0x4C7104 || {{Win32_BOOL}} || &#039;&#039;&#039;bPriscillaActivated&#039;&#039;&#039; ||  || Whether or not the debug menu has been activated&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C71F0 || {{Win32_BOOL}} || &#039;&#039;&#039;bOptionsMusicEnabled&#039;&#039;&#039; || 0x0FFC || Whether or not music is enabled&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C71F4 || {{Win32_BOOL}} || &#039;&#039;&#039;bSoundEffectsEnabled&#039;&#039;&#039; ||  || Whether or not sound effects are enabled&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C7318 || WORD || &#039;&#039;&#039;wSimulationSpeed&#039;&#039;&#039; || 0x0FEC || 1-5 for Paused through African Swallow&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C7A9C || DWORD || &#039;&#039;&#039;dwSystemMetricCYHSCROLL&#039;&#039;&#039; ||  || Cached result from &amp;lt;code&amp;gt;GetSystemMetrics(SM_CYHSCROLL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C7AC8 || DWORD || &#039;&#039;&#039;dwSystemMetricCYVSCROLL&#039;&#039;&#039; ||  || Cached result from &amp;lt;code&amp;gt;GetSystemMetrics(SM_CYVSCROLL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C7ACC || DWORD || &#039;&#039;&#039;dwSystemMetricCXVSCROLL&#039;&#039;&#039; ||  || Cached result from &amp;lt;code&amp;gt;GetSystemMetrics(SM_CXVSCROLL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C7AD4 || DWORD || &#039;&#039;&#039;dwSystemMetricCXHSCROLL&#039;&#039;&#039; ||  || Cached result from &amp;lt;code&amp;gt;GetSystemMetrics(SM_CXHSCROLL)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C85A0 || DWORD || &#039;&#039;&#039;dwTotalBusRiders&#039;&#039;&#039; ||  || Sum of all trips that entered the Bus Network&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C85A4 || DWORD || &#039;&#039;&#039;dwTotalTrainRiders&#039;&#039;&#039; ||  || Sum of all trips that entered the Train Network&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C8600 || DWORD || &#039;&#039;&#039;dwTotalSubwayRiders&#039;&#039;&#039; ||  || Sum of all trips that entered the Subway Network&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C93AC || WORD || &#039;&#039;&#039;wTotalGeneratedWaterTiles&#039;&#039;&#039; ||  || Total number of generated watered tiles from water sources&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C93B0 || WORD || &#039;&#039;&#039;wTotalGeneratedPowerTiles&#039;&#039;&#039; ||  || Total number of generated powered tiles from power plants&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C93B4 || WORD || &#039;&#039;&#039;wXVALTiles_TotalCount&#039;&#039;&#039; ||  || Total count of XVAL masked tiles, needed for Average Land Value.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C9428 || WORD || &#039;&#039;&#039;wIndustrialMixPollutionBonus&#039;&#039;&#039; ||  || -1 to 2 used to calculate the map wide Pollution Divisor&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C942C || WORD || &#039;&#039;&#039;wViewRotation&#039;&#039;&#039; || 0x0008 || 0 = north, 1 = west, 2 = south, 3 = east&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C94C4 || DWORD || &#039;&#039;&#039;dwArcologyPopulation&#039;&#039;&#039; || 0x1020 || Population of the city specifically in arcologies&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C9EE8 || DWORD || &#039;&#039;&#039;dwDisasterActive&#039;&#039;&#039; ||  || Set to 1 when disaster is active, overrides usual status bar messages.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C9EF0 || WORD[50] || &#039;&#039;&#039;wArrBondData&#039;&#039;&#039; || 0x0610 || Array of Interest rates for each outstanding bond.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1A0 || char* || &#039;&#039;&#039;pszCityName&#039;&#039;&#039; ||   || Pointer to the city name, loaded/saved as the CNAM chunk&lt;br /&gt;
|- &lt;br /&gt;
| 0x4CA1BC || WORD || &#039;&#039;&#039;wNationalEconomyTrend&#039;&#039;&#039; || 0x005C || A growth modifier for the SimNation economic model that only affects interest rates. (0=&amp;quot;Bull Market&amp;quot;,1=&amp;quot;Steady&amp;quot;,2=&amp;quot;Recession&amp;quot;,3=&amp;quot;Depression&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1E8 || WORD || &#039;&#039;&#039;wIndustrialMixBonus&#039;&#039;&#039; ||  || This is used in RCI demand generation as a bonus (cities dominated by 1 industry receive growth bonuses)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1DC || WORD || &#039;&#039;&#039;wPrisonBonus&#039;&#039;&#039; ||  || This sets if power stations get increased Police power from Prisons.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1EC || WORD || &#039;&#039;&#039;wCurrentMapToolGroup&#039;&#039;&#039; ||  || Currently selected mapping tool group&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA3F0 || WORD || &#039;&#039;&#039;wCityNeighborConnections1500&#039;&#039;&#039; ||  || Count of all $1500 (industrial) neighbor connections (railroad, highways)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA400 || DWORD || &#039;&#039;&#039;dwInterestRateSum&#039;&#039;&#039; ||  || The combined Total Sum of all the interest rates of outstanding bonds&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA41C || WORD || &#039;&#039;&#039;wSubwayXUNDCount&#039;&#039;&#039; || 0x0FE8 || Seems to be mostly used for budget calculations&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA420 || WORD || &#039;&#039;&#039;wSetTriggerDisasterType&#039;&#039;&#039; || 0x0070 || The ID of the next disaster to occur&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA42C || WORD || &#039;&#039;&#039;wCityMode&#039;&#039;&#039; || 0x0004 || 0 = map editor, 1 = regular gameplay, 2 = scenario mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA440 || int || &#039;&#039;&#039;dwCityLandValue&#039;&#039;&#039; || 0x0028 || Sum of all values in XVAL&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA444 || int || &#039;&#039;&#039;dwCityFunds&#039;&#039;&#039; || 0x0014 || How much money the city has&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA4C8 || WORD* || &#039;&#039;&#039;dwTileCount&#039;&#039;&#039; ||  || Pointer to an array of tile counts for every valid iTileID&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA4CC || DWORD || &#039;&#039;&#039;dwNewPopulations&#039;&#039;&#039; ||  || New Populations that moved into the city&#039;s zones from last count (new immigrants).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA4D0 || DWORD || &#039;&#039;&#039;dwCityValue&#039;&#039;&#039; || 0x0024 || Appears to have something to do with bond interest rates&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA5D8 || {{Win32_BOOL}} || &#039;&#039;&#039;bAutoGoToFlag&#039;&#039;&#039; ||  || Auto-Go To Flag&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA5F0 || WORD || &#039;&#039;&#039;wCityGarbage&#039;&#039;&#039; || 0x0040 || Entirely unused. Initialized to 0 when the city is founded, goes up by dwCityPopulation on the 22nd of every month&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA5F4 || WORD || &#039;&#039;&#039;wCityStartYear&#039;&#039;&#039; || 0x000C || The year the city was founded&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA5F8 || DWORD || &#039;&#039;&#039;dwCityUnemployment&#039;&#039;&#039; ||  || (Population in &amp;quot;Abandoned buildings&amp;quot; x 100) / (Population in &amp;quot;Abandoned buildings&amp;quot; + TotalPopulation + 1)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA804|| DWORD[3] || &#039;&#039;&#039;dwNeighborGNP&#039;&#039;&#039; ||  || the GNP of the Neighboring city&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA81C || WORD || &#039;&#039;&#039;wMonsterXTHGIndex&#039;&#039;&#039; ||  || Which XTHG entry the monster&#039;s [[Thing]] is&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA928 || DWORD || &#039;&#039;&#039;dwNationalPopulation&#039;&#039;&#039; || 0x0050 || Population of SimNation&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA92C || DWORD[3] || &#039;&#039;&#039;dwNeighborFame&#039;&#039;&#039; ||  || Completely unused and always 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA934 || WORD* || &#039;&#039;&#039;dwMilitaryTiles&#039;&#039;&#039; ||  || Pointer to the beginning of the military tiles in the dwTileCount array&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA938 || WORD || &#039;&#039;&#039;wNationalFedRate&#039;&#039;&#039; || 0x0058 || The national base tax rate or the &amp;quot;fed rate&amp;quot;, for calculating bond interest rates&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA93C || WORD || &#039;&#039;&#039;wCurrentDisasterType&#039;&#039;&#039; ||  || The Disaster ID for the current/ongoing disaster.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAA40 || DWORD || &#039;&#039;&#039;dwCityOrdinances&#039;&#039;&#039; || 0x0FA0 || Flags for which city [[ordinances]] are enacted&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAA50 || DWORD || &#039;&#039;&#039;dwPowerUsedPercentage&#039;&#039;&#039; ||  || Percentage of power capacity in use&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAA74 || DWORD || &#039;&#039;&#039;dwCityPopulation&#039;&#039;&#039; || 0x102C || Total city population, excluding arcologies&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAD10|| DWORD[3] || &#039;&#039;&#039;dwNeighborPopulation&#039;&#039;&#039; ||  || the Population of the Neighboring city&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAD28 || DWORD || &#039;&#039;&#039;dwCityFame&#039;&#039;&#039; || 0x0038 || Completely unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAD2C || {{Win32_BOOL}} || &#039;&#039;&#039;bYearEndFlag&#039;&#039;&#039; || 0x0E3C || Whether or not the first of the month is the start of a new year&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAD44 || {{Win32_BOOL}} || &#039;&#039;&#039;bInScenario&#039;&#039;&#039; ||  || Whether or not this game is a scenario&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAD58 || neighbor_city_t[4] || &#039;&#039;&#039;stNeighborCities&#039;&#039;&#039; || 0x06D8 || Array of four strings for the actual neighbor city&#039;s names (32 bytes each), clockwise from bottom left. Doesn&#039;t last beyond current game session.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CADE0 || BYTE || &#039;&#039;&#039;bWeatherHeat&#039;&#039;&#039; || 0x0060 || Weather heat level (Temperature in Fahrenheit = [WeatherHeat - 100] as seen in newspapers)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAE04 || DWORD || &#039;&#039;&#039;dwCityDays&#039;&#039;&#039; || 0x0010 || How many days have elapsed since the city was founded&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAE0C || BYTE || &#039;&#039;&#039;bWeatherWind&#039;&#039;&#039; || 0x0064 || Weather wind speed (miles per hour as seen in newspapers)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB010 || WORD || &#039;&#039;&#039;wCityProgression&#039;&#039;&#039; || 0x0078 || Flags for city reward progression&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB014 || DWORD || &#039;&#039;&#039;dwNationalValue&#039;&#039;&#039; || 0x0054 || Gross National Product&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB018 || DWORD || &#039;&#039;&#039;dwCityAdvertising&#039;&#039;&#039; || 0x003C || Completely unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB01C || WORD || &#039;&#039;&#039;wCityCurrentMonth&#039;&#039;&#039; ||  || Which month of the year it is (0-indexed; calculated from dwCityDays)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB020 || WORD || &#039;&#039;&#039;wCityElapsedYears&#039;&#039;&#039; ||  || Years since the city was founded (calculated from dwCityDays)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB1A8 || DWORD || &#039;&#039;&#039;dwNewLocalBirthPops&#039;&#039;&#039; ||  || Seems to actually be local city newbirths in the city as opposed to new pops from immigration.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB1B8 || void* || &#039;&#039;&#039;pArrSpriteHeaders&#039;&#039;&#039; ||  || Pointer to the array of loaded sprite headers&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3D0 || {{Win32_BOOL}} || &#039;&#039;&#039;bNewspaperSubscription&#039;&#039;&#039; || 0x1004 || Whether or not the Subscription newspaper is checked&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3D4 || BYTE || &#039;&#039;&#039;bWeatherRain&#039;&#039;&#039; || 0x0068 || Weather humidity value (Rain in mm as seen in newspaper)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3DC || WORD || &#039;&#039;&#039;wSewerBonus&#039;&#039;&#039; ||  || Whether the city has adequate wastewater treatment facilities for use in the Pollution Divisor&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3E8 || WORD || &#039;&#039;&#039;wCityCurrentSeason&#039;&#039;&#039; ||  || Which season it is (0 = winter, 1 = spring, 2 = summer, 3 = autumn; calculated from dwCityDays)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB38C || microsim_t* || &#039;&#039;&#039;dwMicroSimArr&#039;&#039;&#039; ||  || Pointer to the array of [[microsim]]s&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB404 || WORD || &#039;&#039;&#039;wCityDifficulty&#039;&#039;&#039; || 0x001C || Game difficulty (0 = no city founded, 1 = easy, 2 = medium, 3 = hard)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB40C || BYTE || &#039;&#039;&#039;bWeatherTrend&#039;&#039;&#039; || 0x006C || What the [[WeatherTrend type|current weather type]] is&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB410 || DWORD || &#039;&#039;&#039;bWorkforceLE&#039;&#039;&#039; ||  || Workforce Life Expectancy &lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB430 || WORD[17] || &#039;&#039;&#039;wCityInventionYears&#039;&#039;&#039; || 0x0738 || What years different technologies are invented in (see: [[Inventions]])&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB454 || DWORD || &#039;&#039;&#039;dwCityCrime&#039;&#039;&#039; || 0x002C || Sum of all values in XCRM&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB458 || WORD || &#039;&#039;&#039;wCityCenterXCoord&#039;&#039;&#039; ||  || The X location of where the Simulator deems to be the &amp;quot;city center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB45C || WORD || &#039;&#039;&#039;wCityCenterYCoord&#039;&#039;&#039; ||  || The Y location of where the Simulator deems to be the &amp;quot;city center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB460 || DWORD || &#039;&#039;&#039;dwWorkforcePercent&#039;&#039;&#039; ||  || Workforce Percent&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB464 || WORD || &#039;&#039;&#039;wCurrentCityToolGroup&#039;&#039;&#039; ||  || Currently selected city tool group&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4B0 || {{Win32_BOOL}} || &#039;&#039;&#039;bAutoBudgetFlag&#039;&#039;&#039; ||  || When set to 1, the budget window will not pop up in January nor will there be a Fiscal Warning given for negative CityFunds.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4B4 || DWORD || &#039;&#039;&#039;dwWorkforceEQ&#039;&#039;&#039; ||  || Workforce Educational Quotient &lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4B8 || DWORD || &#039;&#039;&#039;dwWaterUsedPercentage&#039;&#039;&#039; ||  || Percentage of water capacity in use&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4BC || {{Win32_BOOL}} || &#039;&#039;&#039;bNewspaperExtra&#039;&#039;&#039; || 0x1008 || Whether or not the Extra!!! newspaper is checked&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4CC || void* || &#039;&#039;&#039;dwBudgetArr&#039;&#039;&#039; ||  || Pointer to the [[budget array]] (needs some reverse engineering and/or documentation work)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4D4 || {{Win32_BOOL}} || &#039;&#039;&#039;bNoDisasters&#039;&#039;&#039; || 0x1000 || Whether or not disasters should be disabled (also disables city council autonomy)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4D8 || WORD || &#039;&#039;&#039;wCityNeighborConnections1000&#039;&#039;&#039; ||  || Count of all $1000 (commercial) neighbor connections (roads)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4DC || WORD[3] || &#039;&#039;&#039;wNeighborStringNameID&#039;&#039;&#039; ||  || A string lookup ID for the neighbor city&#039;s name, the appropriate string is loaded whenever map is loaded. There are 36 city names.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4E0 || WORD || &#039;&#039;&#039;wStadiumSportsTypes&#039;&#039;&#039; ||  || Flags for the currently available &amp;quot;Sports types&amp;quot; (+1 Football, +2 baseball, +4 Soccer, +8 Cricket, +16 Rugby)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4E4 || BYTE || &#039;&#039;&#039;bMilitaryBaseType&#039;&#039;&#039; || 0x0EF4 || Military base type (0 = not offered yet, 1 = declined/no location, 2 = army, 3 = air force, 4 = navy, 5 = missile silos)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4E8 || DWORD || &#039;&#039;&#039;dwCityBonds&#039;&#039;&#039; || 0x0018 || Total number of current outstanding city bonds&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC8F8 || WORD || &#039;&#039;&#039;wCityResidentialDemand&#039;&#039;&#039; || 0x0718 || Residential demand (-2000 to +2000)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC8FA || WORD || &#039;&#039;&#039;wCityCommericalDemand&#039;&#039;&#039; || 0x071C || Commercial demand (-2000 to +2000)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC8FC || WORD || &#039;&#039;&#039;wCityIndustrialDemand&#039;&#039;&#039; || 0x0720 || Industrial demand (-2000 to +2000)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC910 || DWORD || &#039;&#039;&#039;dwCityPollution&#039;&#039;&#039; ||  || Sum of all Pollution in city.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC918 || WORD || &#039;&#039;&#039;wScenarioDisasterID&#039;&#039;&#039; ||  || ID of the disaster set for the given scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC91A || BYTE || &#039;&#039;&#039;bScenarioDisasterX&#039;&#039;&#039; ||  || X coordinate for preparing the disaster.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC91B || BYTE || &#039;&#039;&#039;bScenarioDisasterY&#039;&#039;&#039; ||  || Y coordinate for preparing the disaster.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC91C || BYTE || &#039;&#039;&#039;wScenarioTimeLimitMonths&#039;&#039;&#039; ||  || Time limit of the scenario in months.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC91E || DWORD || &#039;&#039;&#039;dwScenarioCitySize&#039;&#039;&#039; ||  || Target total population for the scenario exceeded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC922 || DWORD || &#039;&#039;&#039;dwScenarioResPopulation&#039;&#039;&#039; ||  || Target Residential population for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC926 || DWORD || &#039;&#039;&#039;dwScenarioComPopulation&#039;&#039;&#039; ||  || Target Commericial population for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC92A || DWORD || &#039;&#039;&#039;dwScenarioIndPopulation&#039;&#039;&#039; ||  || Target Industrial population for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC92E || DWORD || &#039;&#039;&#039;dwScenarioCashGoal&#039;&#039;&#039; ||  || Cash goal target for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC932 || DWORD || &#039;&#039;&#039;dwScenarioLandValueGoal&#039;&#039;&#039; ||  || Land Value goal target for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC936 || WORD || &#039;&#039;&#039;wScenarioLEGoal&#039;&#039;&#039; ||  || Workforce LE goal target for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC938 || WORD || &#039;&#039;&#039;wScenarioEQGoal&#039;&#039;&#039; ||  || Workforce EQ goal target for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC93A || WORD || &#039;&#039;&#039;wScenarioPollutionLimit&#039;&#039;&#039; ||  || Pollution limit for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC93E || WORD || &#039;&#039;&#039;wScenarioCrimeLimit&#039;&#039;&#039; ||  || Crime limit for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC942 || WORD || &#039;&#039;&#039;wScenarioTrafficLimit&#039;&#039;&#039; ||  || Traffic limit for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC946 || BYTE || &#039;&#039;&#039;bScenarioBuildingGoal1&#039;&#039;&#039; ||  || Scenario building goal one.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC947 || BYTE || &#039;&#039;&#039;bScenarioBuildingGoal2&#039;&#039;&#039; ||  || Scenario building goal two.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC948 || WORD || &#039;&#039;&#039;wScenarioBuildingGoal1Count&#039;&#039;&#039; ||  || Scenario building goal one count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC94A || WORD || &#039;&#039;&#039;wScenarioBuildingGoal2Count&#039;&#039;&#039; ||  || Scenario building goal two count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC950 || WORD || &#039;&#039;&#039;wSelectedSubtoolBulldozer&#039;&#039;&#039; ||  || (*** See below) Selected Bulldozer mode (Demolish/Clear, Level Terrain, Raise Terrain, Lower Terrain, De-zone) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC952 || WORD || &#039;&#039;&#039;wSelectedSubtoolNature&#039;&#039;&#039; ||  || Selected Nature mode (trees, water) (forests and stream are available in map-editing mode) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC954 || WORD || &#039;&#039;&#039;wSelectedSubtoolDispatch&#039;&#039;&#039; ||  || Selected Dispatch mode (Police, Fire, Military (if facilities for the first two aren&#039;t present)) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC956 || WORD || &#039;&#039;&#039;wSelectedSubtoolPower&#039;&#039;&#039; ||  || Selected Power mode (Power Lines, Power Plant) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC958 || WORD || &#039;&#039;&#039;wSelectedSubtoolWater&#039;&#039;&#039; ||  || Selected Water mode (Pipes, Water Pump, Water Tower, Treatment, Desalinization) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC95A || WORD || &#039;&#039;&#039;wSelectedSubtoolRewards&#039;&#039;&#039; ||  || Selected Rewards mode (Mayor&#039;s Hour, City Hall, Statue, Military Base, Braun Llama Dome, Arcologies) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC95C || WORD || &#039;&#039;&#039;wSelectedSubtoolRoads&#039;&#039;&#039; ||  || Selected Roads mode (Road, Highway, Tunnel, Onramp, Bus Depot) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC95E || WORD || &#039;&#039;&#039;wSelectedSubtoolRail&#039;&#039;&#039; ||  || Selected Rail mode (Rail, Subway. Rail Depot, Sub Station, Sub&amp;lt;--&amp;gt;Rail) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC960 || WORD || &#039;&#039;&#039;wSelectedSubtoolPorts&#039;&#039;&#039; ||  || Selected Ports mode (Seaport, Airport) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC962 || WORD || &#039;&#039;&#039;wSelectedSubtoolResidential&#039;&#039;&#039; ||  || Selected Residential mode (Light, Dense) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC964 || WORD || &#039;&#039;&#039;wSelectedSubtoolCommercial&#039;&#039;&#039; ||  || Selected Commercial mode (Light, Dense) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC966 || WORD || &#039;&#039;&#039;wSelectedSubtoolIndustrial&#039;&#039;&#039; ||  || Selected Industrial mode (Light, Dense) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC968 || WORD || &#039;&#039;&#039;wSelectedSubtoolEducation&#039;&#039;&#039; ||  || Selected Education mode (School, College, Library, Museum) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC96A || WORD || &#039;&#039;&#039;wSelectedSubtoolServices&#039;&#039;&#039; ||  || Selected Services mode (Police, Fire Station, Hospital, Prison) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC96C || WORD || &#039;&#039;&#039;wSelectedSubtoolParks&#039;&#039;&#039; ||  || Selected Parks mode (Small Park, Big Park, Zoo, Stadium, Marina) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CDB68 || WORD || &#039;&#039;&#039;wHighlightedTileX&#039;&#039;&#039; ||  || The X coordinate of the tile currently highlighted on the map&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CDB70 || WORD || &#039;&#039;&#039;wHighlightedTileY&#039;&#039;&#039; ||  || The Y coordinate of the tile currently highlighted on the map&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CDB7C || DWORD || &#039;&#039;&#039;dwLFSRState&#039;&#039;&#039; ||  || Randomness state for the linear feedback shift register PRNG&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CDB80 || DWORD || &#039;&#039;&#039;dwLCGState&#039;&#039;&#039; ||  || Randomness state for the linear congruential generator PRNG&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CE8C0 || AFX_CORE_STATE || &#039;&#039;&#039;pCWinApp&#039;&#039;&#039; ||  || Pointer to a CWinApp (needs reverse engineering -- maybe IDA picked this one out on its own?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E6520 || DWORD || &#039;&#039;&#039;dwCheatsHandlingBuffer&#039;&#039;&#039; ||  || current lookup ID for current cheat being possibly entered, and then a return value once completed?&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E6524 || DWORD || &#039;&#039;&#039;dwCheatsHandlingBufferLength&#039;&#039;&#039; ||  || current string length for the current possibly valid cheat attempting to be entered&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E99C0 || WORD || &#039;&#039;&#039;wPassengerPlanes&#039;&#039;&#039; ||  || A total count of Passenger Plane things&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E99C4 || WORD || &#039;&#039;&#039;wActiveHelicopters&#039;&#039;&#039; ||  || A total count of Helicopter things&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E99C8 || WORD || &#039;&#039;&#039;wActiveCargoships&#039;&#039;&#039; ||  || A total count of Cargo Ship things&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E99CC || WORD || &#039;&#039;&#039;wMaxisMan&#039;&#039;&#039; ||  || A total count of MaxisMan things.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E99D0 || WORD || &#039;&#039;&#039;wSailingBoats&#039;&#039;&#039; ||  || A total count of Sailing boats from Marinas.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E99D4 || WORD || &#039;&#039;&#039;wMonster&#039;&#039;&#039; ||  || If there is an active monster, it&#039;s set to 1.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E99D8 || WORD || &#039;&#039;&#039;wActiveTrains&#039;&#039;&#039; ||  || A total count of Train things (train entities, not &#039;tiles&#039; of train)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E99DC || WORD || &#039;&#039;&#039;wTornados_XTHGs&#039;&#039;&#039; ||  || Active Tornado XTHGs&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E99E0 || DWORD || &#039;&#039;&#039;dwHelicopterThing&#039;&#039;&#039; ||  || A &#039;thing&#039; for Helicopter thing (will return to this one day)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
** The choices for each SelectedSubtool are for reference purposes only, they may not reflect the actual internal order.&lt;br /&gt;
&lt;br /&gt;
*** wSelectedSubtoolBulldozer - Address 0x4CC94C (WORD array - 18 entries) - unique case to override without changing the currently selected tool.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Terrain generation variables&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Address|The address of the variable.}} ! {{tooltip|Type|What type this variable is declared as.}} ! {{tooltip|Name|The name of the variable.}} ! {{tooltip|MISC offset|If this variable is stored in the .sc2 MISC chunk, this is where in the chunk it&#039;s stored.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C94C0 || {{Win32_BOOL}} || &#039;&#039;&#039;bCityHasOcean&#039;&#039;&#039; || 0x0E44 || Whether or not the city was generated with an ocean, also determines if City is eligible for Naval Base.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1E0 || WORD || &#039;&#039;&#039;wCityTerrainSliderHills&#039;&#039;&#039; ||  || Slider value for hill coverage during terrain generation&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA818 || __int16 || &#039;&#039;&#039;wWaterLevel&#039;&#039;&#039; || 0x0E40 || Water table level&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAAF8 || WORD || &#039;&#039;&#039;wCityTerrainSliderWater&#039;&#039;&#039; ||  || Slider vvalue for water coverage during terrain generation&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CADD8 || WORD || &#039;&#039;&#039;wCityTerrainSliderTrees&#039;&#039;&#039; ||  || Slider value for tree coverage during terrain generation&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3F8 || {{Win32_BOOL}} || &#039;&#039;&#039;bCityHasRiver&#039;&#039;&#039; || 0x0E48 || Whether or not the city was generated with a river&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
IF YOU&#039;RE READING THIS, HERE&#039;S AN EASY TASK:&lt;br /&gt;
These need to be put into tables. I&#039;m too tired to do it now.&lt;br /&gt;
&lt;br /&gt;
.bss:004CC918     wScenarioDisasterID dw ?                ; DATA XREF: sub_4345C0:loc_434650↑o&lt;br /&gt;
.bss:004CC918                                             ; sub_4345C0:loc_43467E↑o ...&lt;br /&gt;
.bss:004CC91A     bScenarioDisasterX db ?                 ; DATA XREF: sub_4345C0+1D6↑r&lt;br /&gt;
.bss:004CC91B     bScenarioDisasterY db ?                 ; DATA XREF: sub_4345C0+1CB↑r&lt;br /&gt;
.bss:004CC91C     wScenarioTimeLimitMonths dw ?           ; DATA XREF: _SimulationProcessTick+517↑w&lt;br /&gt;
.bss:004CC91C                                             ; sub_4345C0+CB↑o&lt;br /&gt;
.bss:004CC91E     dwScenarioCitySize dd ?                 ; DATA XREF: _SimulationProcessTick+402↑r&lt;br /&gt;
.bss:004CC91E                                             ; sub_4345C0+D8↑r ...&lt;br /&gt;
.bss:004CC922     dwScenarioResPopulation dd ?            ; DATA XREF: _SimulationProcessTick+411↑r&lt;br /&gt;
.bss:004CC922                                             ; sub_4345C0+EB↑r ...&lt;br /&gt;
.bss:004CC926     dwScenarioComPopulation dd ?            ; DATA XREF: _SimulationProcessTick+423↑r&lt;br /&gt;
.bss:004CC926                                             ; sub_4345C0+FE↑r ...&lt;br /&gt;
.bss:004CC92A     dwScenarioIndPopulation dd ?            ; DATA XREF: _SimulationProcessTick+438↑r&lt;br /&gt;
.bss:004CC92A                                             ; sub_4345C0+111↑r ...&lt;br /&gt;
.bss:004CC92E     dwScenarioCashGoal dd ?                 ; DATA XREF: _SimulationProcessTick+455↑r&lt;br /&gt;
.bss:004CC92E                                             ; sub_4345C0+124↑r ...&lt;br /&gt;
.bss:004CC932     dwScenarioLandValueGoal dd ?            ; DATA XREF: _SimulationProcessTick:loc_413981↑r&lt;br /&gt;
.bss:004CC932                                             ; sub_4345C0+137↑r ...&lt;br /&gt;
.bss:004CC936     word_4CC936     dw ?                    ; DATA XREF: _SimulationProcessTick:loc_413992↑r&lt;br /&gt;
.bss:004CC936                                             ; sub_4345C0+14A↑o&lt;br /&gt;
.bss:004CC938     word_4CC938     dw ?                    ; DATA XREF: _SimulationProcessTick:loc_4139A3↑r&lt;br /&gt;
.bss:004CC938                                             ; sub_4345C0+157↑o&lt;br /&gt;
.bss:004CC93A     wScenarioPollutionLimit dd ?            ; DATA XREF: _SimulationProcessTick:loc_4139B4↑r&lt;br /&gt;
.bss:004CC93A                                             ; sub_4345C0+164↑r ...&lt;br /&gt;
.bss:004CC93E     wScenarioCrimeLimit dd ?                ; DATA XREF: _SimulationProcessTick:loc_4139C9↑r&lt;br /&gt;
.bss:004CC93E                                             ; sub_4345C0+177↑r ...&lt;br /&gt;
.bss:004CC942     wScenarioTrafficLimit dd ?              ; DATA XREF: _SimulationProcessTick:loc_4139DE↑r&lt;br /&gt;
.bss:004CC942                                             ; sub_4345C0+18A↑r ...&lt;br /&gt;
.bss:004CC946     bScenarioBuildingGoal1 db ?             ; DATA XREF: _SimulationProcessTick+4D5↑r&lt;br /&gt;
.bss:004CC947     bScenarioBuildingGoal2 db ?             ; DATA XREF: _SimulationProcessTick+4F5↑r&lt;br /&gt;
.bss:004CC948     wScenarioBuildingGoal1Count dw ?        ; DATA XREF: _SimulationProcessTick+4DF↑r&lt;br /&gt;
.bss:004CC948                                             ; sub_4345C0+19D↑o&lt;br /&gt;
.bss:004CC94A     wScenarioBuildingGoal2Count dw ?        ; DATA XREF: _SimulationProcessTick+4FF↑r&lt;br /&gt;
.bss:004CC94A                                             ; sub_4345C0+1AA↑o&lt;br /&gt;
.bss:004CC94C                     align 10h&lt;br /&gt;
.bss:004CC950     ; __int16 wSelectedSubtoolBulldozer[]&lt;br /&gt;
.bss:004CC950     wSelectedSubtoolBulldozer dw ?          ; DATA XREF: sub_406FD0+AC↑r&lt;br /&gt;
.bss:004CC950                                             ; sub_40E250+18C↑w ...&lt;br /&gt;
.bss:004CC952     wSelectedSubtoolNature dw ?             ; DATA XREF: sub_422200+B6↑w&lt;br /&gt;
.bss:004CC952                                             ; sub_442440+74↑r ...&lt;br /&gt;
.bss:004CC954     wSelectedSubtoolDispatch dw ?           ; DATA XREF: sub_422200+D5↑w&lt;br /&gt;
.bss:004CC954                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F2F7↑r ...&lt;br /&gt;
.bss:004CC956     wSelectedSubtoolPower dw ?              ; DATA XREF: sub_422200+F4↑w&lt;br /&gt;
.bss:004CC956                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F336↑r ...&lt;br /&gt;
.bss:004CC958     wSelectedSubtoolWater dw ?              ; DATA XREF: sub_422200+113↑w&lt;br /&gt;
.bss:004CC958                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F3DD↑r ...&lt;br /&gt;
.bss:004CC95A     wSelectedSubtoolRewards dw ?            ; DATA XREF: sub_422200:loc_42231F↑w&lt;br /&gt;
.bss:004CC95A                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F462↑r ...&lt;br /&gt;
.bss:004CC95C     wSelectedSubtoolRoads dw ?              ; DATA XREF: sub_422200+155↑w&lt;br /&gt;
.bss:004CC95C                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F4BF↑r ...&lt;br /&gt;
.bss:004CC95E     wSelectedSubtoolRail dw ?               ; DATA XREF: sub_422200+174↑w&lt;br /&gt;
.bss:004CC95E                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F558↑r ...&lt;br /&gt;
.bss:004CC960     wSelectedSubtoolPorts dw ?              ; DATA XREF: sub_422200+193↑w&lt;br /&gt;
.bss:004CC960                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F60F↑r&lt;br /&gt;
.bss:004CC962     wSelectedSubtoolResidential dw ?        ; DATA XREF: sub_40E250+1B8↑w&lt;br /&gt;
.bss:004CC962                                             ; sub_422200+1B2↑w ...&lt;br /&gt;
.bss:004CC964     wSelectedSubtoolCommercial dw ?         ; DATA XREF: sub_40E250+1C4↑w&lt;br /&gt;
.bss:004CC964                                             ; sub_422200+1D1↑w ...&lt;br /&gt;
.bss:004CC966     wSelectedSubtoolIndustrial dw ?         ; DATA XREF: sub_40E250+1D0↑w&lt;br /&gt;
.bss:004CC966                                             ; sub_422200+1F0↑w ...&lt;br /&gt;
.bss:004CC968     wSelectedSubtoolEducation dw ?          ; DATA XREF: sub_422200+20F↑w&lt;br /&gt;
.bss:004CC968                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F6F7↑r&lt;br /&gt;
.bss:004CC96A     wSelectedSubtoolServices dw ?           ; DATA XREF: sub_422200+22E↑w&lt;br /&gt;
.bss:004CC96A                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F729↑r ...&lt;br /&gt;
.bss:004CC96C     wSelectedSubtoolParks dw ?              ; DATA XREF: sub_422200+24D↑w&lt;br /&gt;
.bss:004CC96C                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F787↑r ...&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Map data pointers&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Address|The address of the variable.}} ! {{tooltip|Type|What type this variable is declared as.}} ! {{tooltip|Name|The name of the variable.}} ! {{tooltip|MISC offset|If this variable is stored in the .sc2 MISC chunk, this is where in the chunk it&#039;s stored.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C9430 || void* || &#039;&#039;&#039;dwMapXPLC&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; for police coverage (1 byte per 4x4 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C9F58 || void* || &#039;&#039;&#039;dwMapXTER&#039;&#039;&#039; ||  || Pointer to a 128x128 map of terrain data (1 byte of type map_XTER_t per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1F0 || void* || &#039;&#039;&#039;dwMapXZON&#039;&#039;&#039; ||  || Pointer to a 128x128 map of zone and corner info (1 byte of type map_XZON_t per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3EC || void* || &#039;&#039;&#039;dwMapXMIC&#039;&#039;&#039; ||  || Pointer to an array of type map_XMIC_t[150] containing MicroSim data.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA198 || void* || &#039;&#039;&#039;dwMapXLAB&#039;&#039;&#039; ||  || Pointer to an array of type map_XLAB_t[256].&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA434 || void* || &#039;&#039;&#039;dwMapXTHG&#039;&#039;&#039; ||  || Pointer to an array of type map_XTHG_t[256] containing [[Thing]]s&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA448 || void* || &#039;&#039;&#039;dwMapXPOP&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; for population density (1 byte per 4x4 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA4D8 || void* || &#039;&#039;&#039;dwMapXCRM&#039;&#039;&#039; ||  || Pointer to a 64x64 &amp;quot;minimap&amp;quot; for crime (1 byte per 2x2 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA600 || void* || &#039;&#039;&#039;dwMapXTXT&#039;&#039;&#039; ||  || Pointer to a 128x128 map of [[XTXT]] IDs (1 byte per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA828 || void* || &#039;&#039;&#039;dwMapXPLT&#039;&#039;&#039; ||  || Pointer to a 64x64 &amp;quot;minimap&amp;quot; for pollution (1 byte per 2x2 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA940 || void* || &#039;&#039;&#039;dwMapXTRF&#039;&#039;&#039; ||  || Pointer to a 64x64 &amp;quot;minimap&amp;quot; for traffic (1 byte per 2x2 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAA78 || void* || &#039;&#039;&#039;dwMapXFIR&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; for fire coverage (1 byte per 4x4 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAB10 || void* || &#039;&#039;&#039;dwMapXBIT&#039;&#039;&#039; ||  || Pointer to a 128x128 map of tile flags (1 byte of type map_[[XBIT]]_t per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAE10 || void* || &#039;&#039;&#039;dwMapALTM&#039;&#039;&#039; ||  || Pointer to a 128x128 map of altitude data (1 byte of type map_ALTM_t per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB028 || void* || &#039;&#039;&#039;dwMapXROG&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; of rate of growth data (1 byte of unknown type per 4x4 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB0A8 || void* || &#039;&#039;&#039;dwMapXVAL&#039;&#039;&#039; ||  || Pointer to a 64x64 &amp;quot;minimap&amp;quot; of land value (1 byte of &amp;lt;code&amp;gt;(full value / 1000 - 1)&amp;lt;/code&amp;gt; per 2x2 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB1D0 || void* || &#039;&#039;&#039;dwMapXUND&#039;&#039;&#039; ||  || Pointer to a 128x128 map of underground map data (1 byte of type map_XUND_t per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC470 || void* || &#039;&#039;&#039;dwMapXGRP&#039;&#039;&#039; ||  || Pointer to the historical graph data&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4F0 || void* || &#039;&#039;&#039;dwMapXBLD&#039;&#039;&#039; ||  || Pointer to a 128x128 map of tile IDs (1 byte of type enumTileID per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC6F4 || void* || &#039;&#039;&#039;dwMapTempValMap1&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; of 4x4 parcels needed for land value calculation (pollution?).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC6F8 || void* || &#039;&#039;&#039;dwNaturalBeauty_ResCom&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; of 4x4 parcels needed for land value calculation (this includes surface water, water supply, terrain slopes, parks).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC6FC || void* || &#039;&#039;&#039;dwMapTempValMap2&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; of 4x4 parcels needed for land value calculation (pollution?).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC778 || void* || &#039;&#039;&#039;dwNaturalBeauty_Industrial&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; of 4x4 parcels needed for land value calculation (this includes surface water, water supply).&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Simulation Arrays&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Address|The address of the variable.}} ! {{tooltip|Type|What type this variable is declared as.}} ! {{tooltip|Name|The name of the array.}} ! {{tooltip|MISC offset|If this variable is stored in the .sc2 MISC chunk, this is where in the chunk it&#039;s stored.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 004C94B4 || void* || &#039;&#039;&#039;pRawPopTable&#039;&#039;&#039; ||  || Pointer to 20-item array for the Population Table&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAA70 || void* || &#039;&#039;&#039;pLETable&#039;&#039;&#039; ||  || Pointer to 20-item array for the LE Table, these are as aggregate sums for the entire age group (LE/RawPop=AgeGroupLE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C94BC || void* || &#039;&#039;&#039;pEQTable&#039;&#039;&#039; ||  || Pointer to 20-item array for the EQ Table, these are as aggregate sums for the entire age group (EQ/RawPop=AgeGroupEQ).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3F0 || void* || &#039;&#039;&#039;pIndividualIndPops&#039;&#039;&#039; ||  || Pointer to 11-item array for the Raw Populations for City Industries Table.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3E0 || void* || &#039;&#039;&#039;pIndividualIndTaxRate&#039;&#039;&#039; ||  || Pointer to 11-item array for the each of the Industrial Group&#039;s Tax Rates.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA3F4 || void* || &#039;&#039;&#039;pIndividualIndDemands&#039;&#039;&#039; ||  || Pointer to 11-item array for the each of the Industrial Group&#039;s current Demand.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA428 || void* || &#039;&#039;&#039;pZonePops&#039;&#039;&#039; ||  || Pointer to 8-item array of Zone Populations (/10): &#039;&#039;&#039;AllTotalPops, Light Res, Dense Res, Light Com, Dense Com, Light Ind, Dense Ind, Abandoned.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA930 || void* || &#039;&#039;&#039;zonePopsBase&#039;&#039;&#039; ||  || Pointer to 3-item array of Zone (light+dense combined) Populations (/10): &#039;&#039;&#039;Residential, Commercial, Industrial&#039;&#039;&#039; &lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAD10 || void* || &#039;&#039;&#039;pNeighborData&#039;&#039;&#039; ||  || Pointer to Neighbor Populations&lt;br /&gt;
|}&lt;br /&gt;
[[Category:Game data]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=MediaWiki:Common.css&amp;diff=795</id>
		<title>MediaWiki:Common.css</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=MediaWiki:Common.css&amp;diff=795"/>
		<updated>2025-04-06T10:58:31Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/* CSS placed here will be applied to all skins */&lt;br /&gt;
&lt;br /&gt;
pre {&lt;br /&gt;
	font-size: larger;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Message box template&lt;br /&gt;
 * Lovingly borrowed from The Cutting Room Floor&lt;br /&gt;
 */&lt;br /&gt;
.msgbox {&lt;br /&gt;
	margin: 0 12em 1em 12em;&lt;br /&gt;
	border: 1px solid #888;&lt;br /&gt;
	background: #ddd;&lt;br /&gt;
	color: #000;&lt;br /&gt;
	padding: 0;&lt;br /&gt;
	border-spacing: 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.msgbox td {&lt;br /&gt;
	vertical-align: middle;&lt;br /&gt;
	padding: 0.5em 1em 0.5em 0;&lt;br /&gt;
	width: 100%;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.msgbox .msgboximg {&lt;br /&gt;
	vertical-align: middle;&lt;br /&gt;
	width: 0;&lt;br /&gt;
	padding: 0.5em 1em 0.5em 1em;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Modding/Hooks&amp;diff=794</id>
		<title>Modding/Hooks</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Modding/Hooks&amp;diff=794"/>
		<updated>2025-04-06T10:54:44Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Live draft}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Uncategorized hooks&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Name|The name of the hook.}} ! {{tooltip|Before?|If there&#039;s a _Before hook.}} ! {{tooltip|After?|If there&#039;s an _After hook.}} ! {{tooltip|Kuroko?|Whether or not this hook is exposed to Kuroko.}} ! {{tooltip|Since|What release/commit the hook was added in}} ! Signature&lt;br /&gt;
|-&lt;br /&gt;
| Hook_OnNewCity || {{Yes|}} || {{No|}} || {{NYI}} || {{tooltip|0.10-dev|Added in commit bdda241}} || &amp;lt;tt&amp;gt;void fn(void)&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Hook_GameDoIdleUpkeep || {{Yes|}} || {{Yes|}} || {{NYI}} || {{tooltip|0.10-dev|Added in commit 6972bec}} || &amp;lt;tt&amp;gt;void fn(void* pThis)&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Hook_SimulationProcessTickDaySwitch || {{Yes|}} || {{Yes|}} || {{NYI}} || {{tooltip|0.10-dev|Added in commit 170f38d}} || &amp;lt;tt&amp;gt;void fn(void)&amp;lt;/tt&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Modding/Hooks&amp;diff=793</id>
		<title>Modding/Hooks</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Modding/Hooks&amp;diff=793"/>
		<updated>2025-04-06T10:49:19Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: Created page with &amp;quot;{{Live draft}}  {| class=&amp;quot;wikitable sortable&amp;quot; |+ Uncategorized hooks |- ! {{tooltip|Name|The name of the hook.}} ! {{tooltip|Before?|If there&amp;#039;s a _Before hook.}} ! {{tooltip|After?|If there&amp;#039;s an _After hook.}} ! {{tooltip|Kuroko?|Whether or not this hook is exposed to Kuroko.}} ! {{tooltip|Added in|What version/build the hook was added in}} ! Signature |- | Hook_OnNewCity || {{Yes|}} || {{No|}} || {{NYI}} || 0.10-dev || &amp;lt;tt&amp;gt;void fn(void)&amp;lt;/tt&amp;gt; |- | Hook_GameDoIdleUpkeep |...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Live draft}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Uncategorized hooks&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Name|The name of the hook.}} ! {{tooltip|Before?|If there&#039;s a _Before hook.}} ! {{tooltip|After?|If there&#039;s an _After hook.}} ! {{tooltip|Kuroko?|Whether or not this hook is exposed to Kuroko.}} ! {{tooltip|Added in|What version/build the hook was added in}} ! Signature&lt;br /&gt;
|-&lt;br /&gt;
| Hook_OnNewCity || {{Yes|}} || {{No|}} || {{NYI}} || 0.10-dev || &amp;lt;tt&amp;gt;void fn(void)&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Hook_GameDoIdleUpkeep || {{Yes|}} || {{Yes|}} || {{NYI}} || 0.10-dev || &amp;lt;tt&amp;gt;void fn(void* pThis)&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Hook_SimulationProcessTickDaySwitch || {{Yes|}} || {{Yes|}} || {{NYI}} || 0.10-dev || &amp;lt;tt&amp;gt;void fn(void)&amp;lt;/tt&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Template:NYI&amp;diff=792</id>
		<title>Template:NYI</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Template:NYI&amp;diff=792"/>
		<updated>2025-04-06T10:46:08Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: Created page with &amp;quot;&amp;lt;noinclude&amp;gt; {| class=&amp;quot;wikitable&amp;quot; |- |&amp;lt;/noinclude&amp;gt;style=&amp;quot;background:#CCCCCC; color:black; text-align:center; {{{style|}}}&amp;quot; class=&amp;quot;table-yes&amp;quot;|{{tooltip|NYI|Not yet implemented}}&amp;lt;noinclude&amp;gt; |} Category:Templates&amp;lt;/noinclude&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;/noinclude&amp;gt;style=&amp;quot;background:#CCCCCC; color:black; text-align:center; {{{style|}}}&amp;quot; class=&amp;quot;table-yes&amp;quot;|{{tooltip|NYI|Not yet implemented}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Template:No&amp;diff=791</id>
		<title>Template:No</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Template:No&amp;diff=791"/>
		<updated>2025-04-06T10:42:04Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;/noinclude&amp;gt;style=&amp;quot;background:#FFC7C7; color:black; text-align:center; {{{style|}}}&amp;quot; class=&amp;quot;table-yes&amp;quot;|[[File:Dark Red x.svg|13px|link=|]] {{{1|No}}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Template:Yes&amp;diff=790</id>
		<title>Template:Yes</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Template:Yes&amp;diff=790"/>
		<updated>2025-04-06T10:41:49Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;/noinclude&amp;gt;style=&amp;quot;background:#9EFF9E; color:black; text-align:center; {{{style|}}}&amp;quot; class=&amp;quot;table-yes&amp;quot;|[[File:Green check.svg|13px|link=|]] {{{1|Yes}}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Template:Yes&amp;diff=789</id>
		<title>Template:Yes</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Template:Yes&amp;diff=789"/>
		<updated>2025-04-06T10:41:12Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: Created page with &amp;quot;&amp;lt;noinclude&amp;gt; {| class=&amp;quot;wikitable&amp;quot; |- |&amp;lt;/noinclude&amp;gt;style=&amp;quot;background:#9EFF9E; color:black; {{{style|}}}&amp;quot; class=&amp;quot;table-yes&amp;quot;|link=| {{{1|Yes}}}&amp;lt;noinclude&amp;gt; |} Category:Templates&amp;lt;/noinclude&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;/noinclude&amp;gt;style=&amp;quot;background:#9EFF9E; color:black; {{{style|}}}&amp;quot; class=&amp;quot;table-yes&amp;quot;|[[File:Green check.svg|13px|link=|]] {{{1|Yes}}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Template:No&amp;diff=788</id>
		<title>Template:No</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Template:No&amp;diff=788"/>
		<updated>2025-04-06T10:40:42Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: Created page with &amp;quot;&amp;lt;noinclude&amp;gt; {| class=&amp;quot;wikitable&amp;quot; |- |&amp;lt;/noinclude&amp;gt;style=&amp;quot;background:#FFC7C7; color:black; {{{style|}}}&amp;quot; class=&amp;quot;table-yes&amp;quot;|link=| {{{1|No}}}&amp;lt;noinclude&amp;gt; |} Category:Templates&amp;lt;/noinclude&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;/noinclude&amp;gt;style=&amp;quot;background:#FFC7C7; color:black; {{{style|}}}&amp;quot; class=&amp;quot;table-yes&amp;quot;|[[File:Dark Red x.svg|13px|link=|]] {{{1|No}}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=File:Green_check.svg&amp;diff=787</id>
		<title>File:Green check.svg</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=File:Green_check.svg&amp;diff=787"/>
		<updated>2025-04-06T10:38:57Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=File:Dark_Red_x.svg&amp;diff=786</id>
		<title>File:Dark Red x.svg</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=File:Dark_Red_x.svg&amp;diff=786"/>
		<updated>2025-04-06T10:38:49Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Main_Page&amp;diff=785</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Main_Page&amp;diff=785"/>
		<updated>2025-04-06T10:04:47Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ __NOEDITSECTION__ {{#description2:Welcome to sc2k-reverse, the sc2kfix Project wiki!}}&lt;br /&gt;
[[File:{{#setmainimage:SC2K-reverse Header.png}}|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Welcome to sc2k-reverse, the sc2kfix Project wiki!&#039;&#039;&#039; Pardon our dust, as this wiki is brand new and we haven&#039;t had a chance to do much of anything around here yet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;u&amp;gt;Need an account?&amp;lt;/u&amp;gt;&#039;&#039;&#039; PM araxestroy on the Simtropolis forums or on the libera.chat IRC network.&lt;br /&gt;
&lt;br /&gt;
== Wiki to-do list ==&lt;br /&gt;
&lt;br /&gt;
* More page component templates (see [[:Category:Templates]])&lt;br /&gt;
** Game infoboxes&lt;br /&gt;
** RE related stuff? Not sure what we&#039;ll need&lt;br /&gt;
** Category navboxes&lt;br /&gt;
* Wiki meta pages (categories, help, copyright page, etc)&lt;br /&gt;
* Nicer main page (maybe split it into flex columns?)&lt;br /&gt;
* Get some stub articles written up as a &amp;quot;schema&amp;quot;&lt;br /&gt;
* &amp;lt;s&amp;gt;Make sure the email system actually works&amp;lt;/s&amp;gt; it absolutely does not, I may need to move this thing to a Linode VPS sooner rather than later&lt;br /&gt;
&lt;br /&gt;
== sc2kfix Plugin Information ==&lt;br /&gt;
&lt;br /&gt;
* [https://sc2kfix.net/plugin.html Plugin user guide]&lt;br /&gt;
* [[SC2X|SC2X save file format]]&lt;br /&gt;
* &#039;&#039;&#039;Modding with C/C++&#039;&#039;&#039;&lt;br /&gt;
** [[Modding|C/C++ Modding Basics]] &#039;&#039;(draft)&#039;&#039;&lt;br /&gt;
** [[Modding/Hooks|Hook List]]&lt;br /&gt;
* &#039;&#039;&#039;Modding with Kuroko&#039;&#039;&#039;&lt;br /&gt;
** [[Kuroko|Kuroko Basics]]&lt;br /&gt;
** [[Kuroko/Module_sc2kfix|sc2kfix module]]&lt;br /&gt;
** [[Kuroko/Module_sc2k|sc2k module]]&lt;br /&gt;
&lt;br /&gt;
== SimCity 2000 Reverse Engineering ==&lt;br /&gt;
&lt;br /&gt;
* [[Function list]]&lt;br /&gt;
* [[Known global variables]]&lt;br /&gt;
* [[Classes]]&lt;br /&gt;
* [[Map data]]&lt;br /&gt;
* [[Data formats]]&lt;br /&gt;
* [[Tiles]]&lt;br /&gt;
* [[SimCity 2000 Bugs]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Modding&amp;diff=784</id>
		<title>Modding</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Modding&amp;diff=784"/>
		<updated>2025-04-06T09:34:38Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: Created page with &amp;quot;{{Heavy construction}} {{Live draft}}  == Example: Mod template (testmod) ==  &amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt; // sc2kfix/testmod dllmain.cpp: test/template mod with inline documentation // (c) 2025 sc2kfix project (https://sc2kfix.net) - released under the MIT license  // These two lines are mandatory for sc2kfix mods. The first one ensures that all Windows API // calls use the ANSI calls instead of the Unicode calls, which aligns with the way that SimCity // 2000 was...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Heavy construction}}&lt;br /&gt;
{{Live draft}}&lt;br /&gt;
&lt;br /&gt;
== Example: Mod template (testmod) ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// sc2kfix/testmod dllmain.cpp: test/template mod with inline documentation&lt;br /&gt;
// (c) 2025 sc2kfix project (https://sc2kfix.net) - released under the MIT license&lt;br /&gt;
&lt;br /&gt;
// These two lines are mandatory for sc2kfix mods. The first one ensures that all Windows API&lt;br /&gt;
// calls use the ANSI calls instead of the Unicode calls, which aligns with the way that SimCity&lt;br /&gt;
// 2000 was compiled. It should be the first preprocessor line of each source file in each mod.&lt;br /&gt;
// The second is required in **EXACTLY** one file of each mod and no more, and lets sc2k_1996.h&lt;br /&gt;
// define all of its GAMECALLs and GAMEOFFs so the mod can interact with the game engine in the&lt;br /&gt;
// same way that the sc2kfix core does.&lt;br /&gt;
#undef UNICODE&lt;br /&gt;
#define GAMEOFF_IMPL&lt;br /&gt;
&lt;br /&gt;
// Include files go here. The standard order used in the sc2kfix project is to have bracketed C&lt;br /&gt;
// header files first, then any bracketed C++ header files, and then quoted header files.&lt;br /&gt;
#include &amp;lt;windows.h&amp;gt;&lt;br /&gt;
#include &amp;quot;../sc2kfix.h&amp;quot;&lt;br /&gt;
#include &amp;quot;../../include/sc2k_1996.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
// The stModHooks array of structs define each hook that the mod exports. Each hook is defined&lt;br /&gt;
// with a string of its full name followed by a signed integer of its priority level. Lower&lt;br /&gt;
// priorities are called first, so eg. a mod that exports Hook_OnNewCity_After with a priority&lt;br /&gt;
// of 0 will be called after a mod that exports Hook_OnNewCity_After with a priority of -1 and&lt;br /&gt;
// before a mod that exports Hook_OnNewCity_After with a priority of 1.&lt;br /&gt;
sc2kfix_mod_hook_t stModHooks[] = {&lt;br /&gt;
	{ &amp;quot;Hook_SimulationProcessTickDaySwitch_Before&amp;quot;, 0 },&lt;br /&gt;
	{ &amp;quot;Hook_SimulationProcessTickDaySwitch_After&amp;quot;, 0 },&lt;br /&gt;
	{ &amp;quot;Hook_GameDoIdleUpkeep_Before&amp;quot;, 0 }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// The stModInfo structure tells the sc2kfix mod loader about the mod and how to load it. It&lt;br /&gt;
// contains the version info for the mod itself as well as what version of sc2kfix it requires, as&lt;br /&gt;
// well as some basic textual descriptions of the mod and info about the stModHooks struct so that&lt;br /&gt;
// sc2kfix can load the mod&#039;s exported hooks.&lt;br /&gt;
//&lt;br /&gt;
// stModInfo should always be named exactly that; various macros depend on the stModInfo structure&lt;br /&gt;
// and renaming it will cause widespread compilation errors.&lt;br /&gt;
sc2kfix_mod_info_t stModInfo = {&lt;br /&gt;
	/* .iModInfoVersion = */ 1,&lt;br /&gt;
	/* .iModVersionMajor = */ 0,&lt;br /&gt;
	/* .iModVersionMinor = */ 1,&lt;br /&gt;
	/* .iModVersionPatch = */ 2,&lt;br /&gt;
	/* .iMinimumVersionMajor = */ 0,&lt;br /&gt;
	/* .iMinimumVersionMinor = */ 10,&lt;br /&gt;
	/* .iMinimumVersionPatch = */ 0,&lt;br /&gt;
	/* .szModName = */ &amp;quot;Test Native Code Mod&amp;quot;,&lt;br /&gt;
	/* .szModShortName = */ &amp;quot;testmod&amp;quot;,&lt;br /&gt;
	/* .szModAuthor = */ &amp;quot;sc2kfix Project&amp;quot;,&lt;br /&gt;
	/* .szModDescription = */ &amp;quot;A test mod to demonstrate sc2kfix native code mod loading, linking against DLL exports from sc2kfix, and manipulating game data from native code.&amp;quot;,&lt;br /&gt;
	/* .iHookCount = */ HOOKS_COUNT(stModHooks),&lt;br /&gt;
	/* .pstHooks = */ stModHooks&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// sc2kfix looks for the HookCb_GetModInfo function when loading each native code mod. You should&lt;br /&gt;
// never need to do anything in this function other than return a pointer to the stModInfo struct,&lt;br /&gt;
// as the entire purpose of this function is to initially validate that the DLL that sc2kfix is&lt;br /&gt;
// loading is actually a legitimate sc2kfix mod.&lt;br /&gt;
HOOKCB sc2kfix_mod_info_t* HookCb_GetModInfo(void) {&lt;br /&gt;
	return &amp;amp;stModInfo;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// The DllMain function in each hook should be used sparingly and follow the best practices&lt;br /&gt;
// conventions of the Windows API documentation for DLL entry points, as the DllMain function&lt;br /&gt;
// is executed while under the global loader lock. See the following link for details:&lt;br /&gt;
// https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-best-practices&lt;br /&gt;
BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID lpReserved) {&lt;br /&gt;
	switch (reason) {&lt;br /&gt;
	case DLL_PROCESS_ATTACH:&lt;br /&gt;
		LOG(LOG_INFO, &amp;quot;testmod says hello!\n&amp;quot;);&lt;br /&gt;
		break;&lt;br /&gt;
	case DLL_THREAD_ATTACH:&lt;br /&gt;
	case DLL_THREAD_DETACH:&lt;br /&gt;
		break;&lt;br /&gt;
	case DLL_PROCESS_DETACH:&lt;br /&gt;
		LOG(LOG_INFO, &amp;quot;testmod says goodbye!\n&amp;quot;);&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
	return TRUE;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// All game hooks exported from mods are declared using the HOOKCB macro, which expands to&lt;br /&gt;
// extern &amp;quot;C&amp;quot; __declspec(dllexport). This makes sure that there&#039;s no C++ name mangling and imports&lt;br /&gt;
// on the sc2kfix side are similarly simple.&lt;br /&gt;
//&lt;br /&gt;
// This is a &amp;quot;before&amp;quot; hook, and is called when sc2kfix intercepts a part of SimCity 2000&#039;s game&lt;br /&gt;
// engine, and before it lets the engine (or, depending on the hook, a recreation thereof) execute&lt;br /&gt;
// its original code. Many &amp;quot;before&amp;quot; hooks have a corresponding &amp;quot;after&amp;quot; hook that runs after the&lt;br /&gt;
// engine completes its designated task that the hook is related to, but before the calling&lt;br /&gt;
// function in the engine is returned to.&lt;br /&gt;
HOOKCB void Hook_SimulationProcessTickDaySwitch_Before(void) {&lt;br /&gt;
	// dwCityDays is a game engine variable declared and defined as a C++ reference variable.&lt;br /&gt;
	// Using reference variables lets sc2kfix developers and modders operate on SimCity 2000 game&lt;br /&gt;
	// engine state as if their own code is part of the game engine. Since sc2kfix hooks are&lt;br /&gt;
	// called into from the main game engine thread, this is safe to do from native code without&lt;br /&gt;
	// any multithreading-aware locking or mutex mechanism.&lt;br /&gt;
	if (dwCityDays % 300 == 0)&lt;br /&gt;
		LOG(LOG_NOTICE, &amp;quot;:toot: Happy new year!\n&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// This is an example of an &amp;quot;after&amp;quot; hook. sc2kfix intercepts the end of the game engine&#039;s&lt;br /&gt;
// SimulationProcessTick function and calls the Hook_SimulationProcessTickDaySwitch_After exports&lt;br /&gt;
// from each mod before returning to the calling function (in this case, the default case of the&lt;br /&gt;
// GameDoIdleUpkeep function).&lt;br /&gt;
HOOKCB void Hook_SimulationProcessTickDaySwitch_After(void) {&lt;br /&gt;
	// LOG() is a macro that prepends the module tag and the stModInfo.szModShortName to the log&lt;br /&gt;
	// message before calling ConsoleLog to output it. You should not directly call ConsoleLog in&lt;br /&gt;
	// mod DLLs; instead use LOG() to ensure that all log messages are properly formed.&lt;br /&gt;
	LOG(LOG_NOTICE, &amp;quot;Today was day %d in the glorious history of %s.\n&amp;quot;, dwCityDays + 1, *pszCityName);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Template:Live_draft&amp;diff=783</id>
		<title>Template:Live draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Template:Live_draft&amp;diff=783"/>
		<updated>2025-04-06T09:34:24Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: Created page with &amp;quot;{{mbox | text=&amp;#039;&amp;#039;&amp;#039;Release the terror of the year 2000!&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;This page or section is a &amp;quot;live draft&amp;quot;. It may be brand new or nearing completion, or constantly being reworked. Its current state should be considered accurate to the best of the knowledge of the authors, but may change in the future. | image=1224.png | iwidth=32 | min-width=32 | caption=1224 | border=#bbbbbb | background=#e8e8e8 }} &amp;lt;noinclude&amp;gt;Category:Templates&amp;lt;/noinclude&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mbox&lt;br /&gt;
| text=&#039;&#039;&#039;Release the terror of the year 2000!&#039;&#039;&#039;&amp;lt;br&amp;gt;This page or section is a &amp;quot;live draft&amp;quot;. It may be brand new or nearing completion, or constantly being reworked. Its current state should be considered accurate to the best of the knowledge of the authors, but may change in the future.&lt;br /&gt;
| image=1224.png&lt;br /&gt;
| iwidth=32&lt;br /&gt;
| min-width=32&lt;br /&gt;
| caption=1224&lt;br /&gt;
| border=#bbbbbb&lt;br /&gt;
| background=#e8e8e8&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=File:1224.png&amp;diff=782</id>
		<title>File:1224.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=File:1224.png&amp;diff=782"/>
		<updated>2025-04-06T09:26:58Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Game sprites]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=File:1224.png&amp;diff=781</id>
		<title>File:1224.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=File:1224.png&amp;diff=781"/>
		<updated>2025-04-06T09:26:47Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=File:224.png&amp;diff=780</id>
		<title>File:224.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=File:224.png&amp;diff=780"/>
		<updated>2025-04-06T09:26:25Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Main_Page&amp;diff=779</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Main_Page&amp;diff=779"/>
		<updated>2025-04-06T06:50:47Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ __NOEDITSECTION__ {{#description2:Welcome to sc2k-reverse, the sc2kfix Project wiki!}}&lt;br /&gt;
[[File:{{#setmainimage:SC2K-reverse Header.png}}|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Welcome to sc2k-reverse, the sc2kfix Project wiki!&#039;&#039;&#039; Pardon our dust, as this wiki is brand new and we haven&#039;t had a chance to do much of anything around here yet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;u&amp;gt;Need an account?&amp;lt;/u&amp;gt;&#039;&#039;&#039; PM araxestroy on the Simtropolis forums or on the libera.chat IRC network.&lt;br /&gt;
&lt;br /&gt;
== Wiki to-do list ==&lt;br /&gt;
&lt;br /&gt;
* More page component templates (see [[:Category:Templates]])&lt;br /&gt;
** Game infoboxes&lt;br /&gt;
** RE related stuff? Not sure what we&#039;ll need&lt;br /&gt;
** Category navboxes&lt;br /&gt;
* Wiki meta pages (categories, help, copyright page, etc)&lt;br /&gt;
* Nicer main page (maybe split it into flex columns?)&lt;br /&gt;
* Get some stub articles written up as a &amp;quot;schema&amp;quot;&lt;br /&gt;
* &amp;lt;s&amp;gt;Make sure the email system actually works&amp;lt;/s&amp;gt; it absolutely does not, I may need to move this thing to a Linode VPS sooner rather than later&lt;br /&gt;
&lt;br /&gt;
== sc2kfix Plugin Information ==&lt;br /&gt;
&lt;br /&gt;
* [https://sc2kfix.net/plugin.html Plugin user guide]&lt;br /&gt;
* [[SC2X|SC2X save file format]]&lt;br /&gt;
* &#039;&#039;&#039;Modding with C/C++&#039;&#039;&#039;&lt;br /&gt;
** [[Modding|C/C++ Modding Basics]]&lt;br /&gt;
** [[Modding/Hooks|Hook List]]&lt;br /&gt;
* &#039;&#039;&#039;Modding with Kuroko&#039;&#039;&#039;&lt;br /&gt;
** [[Kuroko|Kuroko Basics]]&lt;br /&gt;
** [[Kuroko/Module_sc2kfix|sc2kfix module]]&lt;br /&gt;
** [[Kuroko/Module_sc2k|sc2k module]]&lt;br /&gt;
&lt;br /&gt;
== SimCity 2000 Reverse Engineering ==&lt;br /&gt;
&lt;br /&gt;
* [[Function list]]&lt;br /&gt;
* [[Known global variables]]&lt;br /&gt;
* [[Classes]]&lt;br /&gt;
* [[Map data]]&lt;br /&gt;
* [[Data formats]]&lt;br /&gt;
* [[Tiles]]&lt;br /&gt;
* [[SimCity 2000 Bugs]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Main_Page&amp;diff=778</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Main_Page&amp;diff=778"/>
		<updated>2025-04-01T07:39:54Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ __NOEDITSECTION__ {{#description2:Welcome to sc2k-reverse, the sc2kfix Project wiki!}}&lt;br /&gt;
[[File:{{#setmainimage:SC2K-reverse Header.png}}|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Welcome to sc2k-reverse, the sc2kfix Project wiki!&#039;&#039;&#039; Pardon our dust, as this wiki is brand new and we haven&#039;t had a chance to do much of anything around here yet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;u&amp;gt;Need an account?&amp;lt;/u&amp;gt;&#039;&#039;&#039; PM araxestroy on the Simtropolis forums or on the libera.chat IRC network.&lt;br /&gt;
&lt;br /&gt;
== Wiki to-do list ==&lt;br /&gt;
&lt;br /&gt;
* More page component templates (see [[:Category:Templates]])&lt;br /&gt;
** Game infoboxes&lt;br /&gt;
** RE related stuff? Not sure what we&#039;ll need&lt;br /&gt;
** Category navboxes&lt;br /&gt;
* Wiki meta pages (categories, help, copyright page, etc)&lt;br /&gt;
* Nicer main page (maybe split it into flex columns?)&lt;br /&gt;
* Get some stub articles written up as a &amp;quot;schema&amp;quot;&lt;br /&gt;
* &amp;lt;s&amp;gt;Make sure the email system actually works&amp;lt;/s&amp;gt; it absolutely does not, I may need to move this thing to a Linode VPS sooner rather than later&lt;br /&gt;
&lt;br /&gt;
== sc2kfix Plugin Information ==&lt;br /&gt;
&lt;br /&gt;
* [https://sc2kfix.net/plugin.html Plugin user guide]&lt;br /&gt;
* &#039;&#039;&#039;Modding with C/C++&#039;&#039;&#039;&lt;br /&gt;
** [[Modding|C/C++ Modding Basics]]&lt;br /&gt;
** [[Modding/Hooks|Hook List]]&lt;br /&gt;
* &#039;&#039;&#039;Modding with Kuroko&#039;&#039;&#039;&lt;br /&gt;
** [[Kuroko|Kuroko Basics]]&lt;br /&gt;
** [[Kuroko/Module_sc2kfix|sc2kfix module]]&lt;br /&gt;
** [[Kuroko/Module_sc2k|sc2k module]]&lt;br /&gt;
&lt;br /&gt;
== SimCity 2000 Reverse Engineering ==&lt;br /&gt;
&lt;br /&gt;
* [[Function list]]&lt;br /&gt;
* [[Known global variables]]&lt;br /&gt;
* [[Classes]]&lt;br /&gt;
* [[Map data]]&lt;br /&gt;
* [[Data formats]]&lt;br /&gt;
* [[Tiles]]&lt;br /&gt;
* [[SimCity 2000 Bugs]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=User:Araxestroy/Class_notes&amp;diff=752</id>
		<title>User:Araxestroy/Class notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=User:Araxestroy/Class_notes&amp;diff=752"/>
		<updated>2025-03-24T17:21:36Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: Created page with &amp;quot;=== &amp;lt;code&amp;gt;class CCmdUI&amp;lt;/code&amp;gt; ===  This is a base class in MFC used as a helper for UI update/draw callbacks when eg. menus are drawn. The following is from the MFC 2.1 include file &amp;lt;code&amp;gt;afxwin.h&amp;lt;/code&amp;gt;, with additional annotations added:  &amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt; class CCmdUI        // simple helper class { public: // Attributes 	UINT m_nID; 	UINT m_nIndex;          // menu item or other index  	// if a menu item 	CMenu* m_pMenu;         // NULL if not a menu...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== &amp;lt;code&amp;gt;class CCmdUI&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
This is a base class in MFC used as a helper for UI update/draw callbacks when eg. menus are drawn. The following is from the MFC 2.1 include file &amp;lt;code&amp;gt;afxwin.h&amp;lt;/code&amp;gt;, with additional annotations added:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
class CCmdUI        // simple helper class&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
// Attributes&lt;br /&gt;
	UINT m_nID;&lt;br /&gt;
	UINT m_nIndex;          // menu item or other index&lt;br /&gt;
&lt;br /&gt;
	// if a menu item&lt;br /&gt;
	CMenu* m_pMenu;         // NULL if not a menu&lt;br /&gt;
	CMenu* m_pSubMenu;      // sub containing menu item&lt;br /&gt;
							// if a popup sub menu - ID is for first in popup&lt;br /&gt;
&lt;br /&gt;
	// if from some other window&lt;br /&gt;
	CWnd* m_pOther;         // NULL if a menu or not a CWnd&lt;br /&gt;
&lt;br /&gt;
// Operations to do in ON_UPDATE_COMMAND_UI&lt;br /&gt;
	virtual void Enable(BOOL bOn = TRUE);    // [ecx+0]&lt;br /&gt;
	virtual void SetCheck(int nCheck = 1);   // [ecx+4] 0, 1 or 2 (indeterminate)&lt;br /&gt;
	virtual void SetRadio(BOOL bOn = TRUE);  // [ecx+8]&lt;br /&gt;
	virtual void SetText(LPCTSTR lpszText);  // [ecx+12]&lt;br /&gt;
&lt;br /&gt;
// Advanced operation&lt;br /&gt;
	void ContinueRouting();&lt;br /&gt;
&lt;br /&gt;
// Implementation&lt;br /&gt;
	CCmdUI();&lt;br /&gt;
	BOOL m_bEnableChanged;&lt;br /&gt;
	BOOL m_bContinueRouting;&lt;br /&gt;
	UINT m_nIndexMax;       // last + 1 for iterating m_nIndex&lt;br /&gt;
&lt;br /&gt;
	CMenu* m_pParentMenu;   // NULL if parent menu not easily determined&lt;br /&gt;
							//  (probably a secondary popup menu)&lt;br /&gt;
&lt;br /&gt;
	void DoUpdate(CCmdTarget* pTarget, BOOL bDisableIfNoHndler);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;class CSimcityView&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
CView-derived class for the main game window.&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=User:Araxestroy&amp;diff=751</id>
		<title>User:Araxestroy</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=User:Araxestroy&amp;diff=751"/>
		<updated>2025-03-24T17:02:15Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi, I&#039;m Troy. I started and maintain the sc2kfix plugin and project.&lt;br /&gt;
&lt;br /&gt;
== Notepad ==&lt;br /&gt;
::&#039;&#039;Subpages:&#039;&#039; [[User:Araxestroy/DOS version decompilation notes]], [[User:Araxestroy/Class notes]]&lt;br /&gt;
&lt;br /&gt;
=== 1995 load crash bug ===&lt;br /&gt;
&lt;br /&gt;
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&#039;t get around to fixing this one since there&#039;s a whole modding framework to be written.&lt;br /&gt;
&lt;br /&gt;
=== Loading requirements ===&lt;br /&gt;
&lt;br /&gt;
Intercept at &#039;&#039;&#039;int __thiscall LoadGame(void *this, int *a2, char *Src)&#039;&#039;&#039; -- 0x4025A4 -- and check the extension; jump to 0x4302E0 for .sc2&lt;br /&gt;
&lt;br /&gt;
# Load everything into the structures&lt;br /&gt;
# Load pszCityName&lt;br /&gt;
# Call &#039;&#039;&#039;void sub_402743(void)&#039;&#039;&#039; -- recalculates border connections, updates power and water consumption, loads bond information, does some pollution modifiers I think?&lt;br /&gt;
# Call &#039;&#039;&#039;void sub_402EF5(void)&#039;&#039;&#039; -- updates dwTileCount&lt;br /&gt;
# Call &#039;&#039;&#039;void sub_401FFA(void)&#039;&#039;&#039; -- does &#039;&#039;something&#039;&#039; with regards to graphs, I think? Needs investigation&lt;br /&gt;
# Call &#039;&#039;&#039;void sub_430C00(void)&#039;&#039;&#039; if we need to &amp;quot;uncompress&amp;quot; XLAB -- should only need to be done on manually converted save files&lt;br /&gt;
# Return a non-zero from LoadGame intercept&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Main_Page&amp;diff=728</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Main_Page&amp;diff=728"/>
		<updated>2025-03-20T01:01:04Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ __NOEDITSECTION__ {{#description2:Welcome to sc2k-reverse, the sc2kfix Project wiki!}}&lt;br /&gt;
[[File:{{#setmainimage:SC2K-reverse Header.png}}|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Welcome to sc2k-reverse, the sc2kfix Project wiki!&#039;&#039;&#039; Pardon our dust, as this wiki is brand new and we haven&#039;t had a chance to do much of anything around here yet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;u&amp;gt;Need an account?&amp;lt;/u&amp;gt;&#039;&#039;&#039; PM araxestroy on the Simtropolis forums or on the libera.chat IRC network.&lt;br /&gt;
&lt;br /&gt;
== Wiki to-do list ==&lt;br /&gt;
&lt;br /&gt;
* More page component templates (see [[:Category:Templates]])&lt;br /&gt;
** Game infoboxes&lt;br /&gt;
** RE related stuff? Not sure what we&#039;ll need&lt;br /&gt;
** Category navboxes&lt;br /&gt;
* Wiki meta pages (categories, help, copyright page, etc)&lt;br /&gt;
* Nicer main page (maybe split it into flex columns?)&lt;br /&gt;
* Get some stub articles written up as a &amp;quot;schema&amp;quot;&lt;br /&gt;
* &amp;lt;s&amp;gt;Make sure the email system actually works&amp;lt;/s&amp;gt; it absolutely does not, I may need to move this thing to a Linode VPS sooner rather than later&lt;br /&gt;
&lt;br /&gt;
== sc2kfix Plugin Information ==&lt;br /&gt;
&lt;br /&gt;
* [https://sc2kfix.net/plugin.html Plugin user guide]&lt;br /&gt;
* &#039;&#039;&#039;Modding with Kuroko&#039;&#039;&#039;&lt;br /&gt;
** [[Kuroko|Kuroko Basics]]&lt;br /&gt;
** [[Kuroko/Module_sc2kfix|sc2kfix module]]&lt;br /&gt;
** [[Kuroko/Module_sc2k|sc2k module]]&lt;br /&gt;
&lt;br /&gt;
== SimCity 2000 Reverse Engineering ==&lt;br /&gt;
&lt;br /&gt;
* [[Function list]]&lt;br /&gt;
* [[Known global variables]]&lt;br /&gt;
* [[Classes]]&lt;br /&gt;
* [[Map data]]&lt;br /&gt;
* [[Data formats]]&lt;br /&gt;
* [[Tiles]]&lt;br /&gt;
* [[SimCity 2000 Bugs]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=User:Araxestroy&amp;diff=702</id>
		<title>User:Araxestroy</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=User:Araxestroy&amp;diff=702"/>
		<updated>2025-03-16T07:35:17Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi, I&#039;m Troy. I started and maintain the sc2kfix plugin and project.&lt;br /&gt;
&lt;br /&gt;
== Notepad ==&lt;br /&gt;
::&#039;&#039;Subpages:&#039;&#039; [[User:Araxestroy/DOS version decompilation notes]]&lt;br /&gt;
&lt;br /&gt;
=== 1995 load crash bug ===&lt;br /&gt;
&lt;br /&gt;
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&#039;t get around to fixing this one since there&#039;s a whole modding framework to be written.&lt;br /&gt;
&lt;br /&gt;
=== Loading requirements ===&lt;br /&gt;
&lt;br /&gt;
Intercept at &#039;&#039;&#039;int __thiscall LoadGame(void *this, int *a2, char *Src)&#039;&#039;&#039; -- 0x4025A4 -- and check the extension; jump to 0x4302E0 for .sc2&lt;br /&gt;
&lt;br /&gt;
# Load everything into the structures&lt;br /&gt;
# Load pszCityName&lt;br /&gt;
# Call &#039;&#039;&#039;void sub_402743(void)&#039;&#039;&#039; -- recalculates border connections, updates power and water consumption, loads bond information, does some pollution modifiers I think?&lt;br /&gt;
# Call &#039;&#039;&#039;void sub_402EF5(void)&#039;&#039;&#039; -- updates dwTileCount&lt;br /&gt;
# Call &#039;&#039;&#039;void sub_401FFA(void)&#039;&#039;&#039; -- does &#039;&#039;something&#039;&#039; with regards to graphs, I think? Needs investigation&lt;br /&gt;
# Call &#039;&#039;&#039;void sub_430C00(void)&#039;&#039;&#039; if we need to &amp;quot;uncompress&amp;quot; XLAB -- should only need to be done on manually converted save files&lt;br /&gt;
# Return a non-zero from LoadGame intercept&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=User:Araxestroy&amp;diff=701</id>
		<title>User:Araxestroy</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=User:Araxestroy&amp;diff=701"/>
		<updated>2025-03-16T05:18:42Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: /* Notepad */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi, I&#039;m Troy. I started and maintain the sc2kfix plugin and project.&lt;br /&gt;
&lt;br /&gt;
== Notepad ==&lt;br /&gt;
::&#039;&#039;Subpages:&#039;&#039; [[User:Araxestroy/DOS version decompilation notes]]&lt;br /&gt;
&lt;br /&gt;
=== Loading requirements ===&lt;br /&gt;
&lt;br /&gt;
Intercept at &#039;&#039;&#039;int __thiscall LoadGame(void *this, int *a2, char *Src)&#039;&#039;&#039; -- 0x4025A4 -- and check the extension; jump to 0x4302E0 for .sc2&lt;br /&gt;
&lt;br /&gt;
# Load everything into the structures&lt;br /&gt;
# Load pszCityName&lt;br /&gt;
# Call &#039;&#039;&#039;void sub_402743(void)&#039;&#039;&#039; -- recalculates border connections, updates power and water consumption, loads bond information, does some pollution modifiers I think?&lt;br /&gt;
# Call &#039;&#039;&#039;void sub_402EF5(void)&#039;&#039;&#039; -- updates dwTileCount&lt;br /&gt;
# Call &#039;&#039;&#039;void sub_401FFA(void)&#039;&#039;&#039; -- does &#039;&#039;something&#039;&#039; with regards to graphs, I think? Needs investigation&lt;br /&gt;
# Call &#039;&#039;&#039;void sub_430C00(void)&#039;&#039;&#039; if we need to &amp;quot;uncompress&amp;quot; XLAB -- should only need to be done on manually converted save files&lt;br /&gt;
# Return a non-zero from LoadGame intercept&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Known_global_variables&amp;diff=700</id>
		<title>Known global variables</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Known_global_variables&amp;diff=700"/>
		<updated>2025-03-16T02:53:22Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Heavy construction}}&lt;br /&gt;
&lt;br /&gt;
This is a table of global variables in SimCity 2000 that have been at least partially reverse engineered and given names. It is probably going to be unpleasant to update, but at least it looks nice and you can sort it.&lt;br /&gt;
&lt;br /&gt;
Data about where in the MISC chunk certain variables are located is from dfloer&#039;s sc2k-docs repository on GitHub (CC BY-SA 4.0).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Uncategorized variables&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Address|The address of the variable.}} ! {{tooltip|Type|What type this variable is declared as.}} ! {{tooltip|Name|The name of the variable.}} ! {{tooltip|MISC offset|If this variable is stored in the .sc2 MISC chunk, this is where in the chunk it&#039;s stored.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C702C || CWnd* || &#039;&#039;&#039;pCWndRootWindow&#039;&#039;&#039; ||  || Pointer to the MFC CWnd class for the &amp;quot;root window&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
| 0x4C7104 || {{Win32_BOOL}} || &#039;&#039;&#039;bPriscillaActivated&#039;&#039;&#039; ||  || Whether or not the debug menu has been activated&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C71F0 || {{Win32_BOOL}} || &#039;&#039;&#039;bOptionsMusicEnabled&#039;&#039;&#039; || 0x0FFC || Whether or not music is enabled&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C7318 || WORD || &#039;&#039;&#039;wSimulationSpeed&#039;&#039;&#039; || 0x0FEC || 1-5 for Paused through African Swallow&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C93AC || WORD || &#039;&#039;&#039;wTotalGeneratedWaterTiles&#039;&#039;&#039; ||  || Total number of generated watered tiles from water sources&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C93B0 || WORD || &#039;&#039;&#039;wTotalGeneratedPowerTiles&#039;&#039;&#039; ||  || Total number of generated powered tiles from power plants&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C93B4 || WORD || &#039;&#039;&#039;wXVALTiles_TotalCount&#039;&#039;&#039; ||  || Total count of XVAL masked tiles, needed for Average Land Value.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C9428 || WORD || &#039;&#039;&#039;wIndustrialMixPollutionBonus&#039;&#039;&#039; ||  || -1 to 2 used to calculate the map wide Pollution Divisor&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C942C || WORD || &#039;&#039;&#039;wViewRotation&#039;&#039;&#039; || 0x0008 || 0 = north, 1 = west, 2 = south, 3 = east&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C94C4 || DWORD || &#039;&#039;&#039;dwArcologyPopulation&#039;&#039;&#039; || 0x1020 || Population of the city specifically in arcologies&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C9EF0 || WORD[50] || &#039;&#039;&#039;wArrBondData&#039;&#039;&#039; || 0x0610 || Interest rates of all outstanding bonds&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1A0 || char* || &#039;&#039;&#039;pszCityName&#039;&#039;&#039; ||   || Pointer to the city name, loaded/saved as the CNAM chunk&lt;br /&gt;
|- &lt;br /&gt;
| 0x4CA1BC || WORD || &#039;&#039;&#039;wNationalEconomyTrend&#039;&#039;&#039; || 0x005C || Affects interest rates, apparently&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1E8 || WORD || &#039;&#039;&#039;wIndustrialMixBonus&#039;&#039;&#039; ||  || This is used in RCI demand generation as a bonus (cities dominated by 1 industry receive growth bonuses)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1DC || WORD || &#039;&#039;&#039;wPrisonBonus&#039;&#039;&#039; ||  || This sets if power stations get increased Police power from Prisons.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1EC || WORD || &#039;&#039;&#039;wCurrentMapToolGroup&#039;&#039;&#039; ||  || Currently selected mapping tool group&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA3F0 || WORD || &#039;&#039;&#039;wCityNeighborConnections1500&#039;&#039;&#039; ||  || Count of all $1500 (industrial) neighbor connections (railroad, highways)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA41C || WORD || &#039;&#039;&#039;wSubwayXUNDCount&#039;&#039;&#039; || 0x0FE8 || Seems to be mostly used for budget calculations&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA420 || WORD || &#039;&#039;&#039;wDisasterType&#039;&#039;&#039; || 0x0070 || The ID of the next disaster to occur&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA42C || WORD || &#039;&#039;&#039;wCityMode&#039;&#039;&#039; || 0x0004 || 0 = map editor, 1 = regular gameplay, 2 = scenario mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA440 || int || &#039;&#039;&#039;dwCityLandValue&#039;&#039;&#039; || 0x0028 || Sum of all values in XVAL&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA444 || int || &#039;&#039;&#039;dwCityFunds&#039;&#039;&#039; || 0x0014 || How much money the city has&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA4C8 || WORD* || &#039;&#039;&#039;dwTileCount&#039;&#039;&#039; ||  || Pointer to an array of tile counts for every valid iTileID&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA4D0 || DWORD || &#039;&#039;&#039;dwCityValue&#039;&#039;&#039; || 0x0024 || Appears to have something to do with bond interest rates&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA5F0 || WORD || &#039;&#039;&#039;wCityGarbage&#039;&#039;&#039; || 0x0040 || Entirely unused. Initialized to 0 when the city is founded, goes up by dwCityPopulation on the 22nd of every month&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA5F4 || WORD || &#039;&#039;&#039;wCityStartYear&#039;&#039;&#039; || 0x000C || The year the city was founded&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA5F8 || DWORD || &#039;&#039;&#039;dwCityUnemployment&#039;&#039;&#039; ||  || Exactly what it says on the tin. Probably.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA81C || WORD || &#039;&#039;&#039;wMonsterXTHGIndex&#039;&#039;&#039; ||  || Which XTHG entry the monster&#039;s [[Thing]] is&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA928 || DWORD || &#039;&#039;&#039;dwNationalPopulation&#039;&#039;&#039; || 0x0050 || Population of SimNation&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA934 || WORD* || &#039;&#039;&#039;dwMilitaryTiles&#039;&#039;&#039; ||  || Pointer to the beginning of the military tiles in the dwTileCount array&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA938 || WORD || &#039;&#039;&#039;wNationalTax&#039;&#039;&#039; || 0x0058 || The national base tax rate or the &amp;quot;fed rate&amp;quot;, for calculating bond interest rates&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAA40 || DWORD || &#039;&#039;&#039;dwCityOrdinances&#039;&#039;&#039; || 0x0FA0 || Flags for which city ordinances are enacted&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAA50 || DWORD || &#039;&#039;&#039;dwPowerUsedPercentage&#039;&#039;&#039; ||  || Percentage of power capacity in use&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAA74 || DWORD || &#039;&#039;&#039;dwCityPopulation&#039;&#039;&#039; || 0x102C || Total city population, excluding arcologies&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAD28 || DWORD || &#039;&#039;&#039;dwCityFame&#039;&#039;&#039; || 0x0038 || Completely unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAD2C || {{Win32_BOOL}} || &#039;&#039;&#039;bYearEndFlag&#039;&#039;&#039; || 0x0E3C || Whether or not the first of the month is the start of a new year&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAD44 || {{Win32_BOOL}} || &#039;&#039;&#039;bInScenario&#039;&#039;&#039; ||  || Whether or not this game is a scenario&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAD58 || neighbor_city_t[4] || &#039;&#039;&#039;stNeighborCities&#039;&#039;&#039; || 0x06D8 || Array of four neighbor cities (32 bytes each), clockwise from bottom left&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CADE0 || BYTE || &#039;&#039;&#039;bWeatherHeat&#039;&#039;&#039; || 0x0060 || Weather heat level (Temperature in Fahrenheit = [WeatherHeat - 100] as seen in newspapers)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAE04 || DWORD || &#039;&#039;&#039;dwCityDays&#039;&#039;&#039; || 0x0010 || How many days have elapsed since the city was founded&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAE0C || BYTE || &#039;&#039;&#039;bWeatherWind&#039;&#039;&#039; || 0x0064 || Weather wind speed (miles per hour as seen in newspapers)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB010 || WORD || &#039;&#039;&#039;wCityProgression&#039;&#039;&#039; || 0x0078 || Flags for city reward progression&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB014 || DWORD || &#039;&#039;&#039;dwNationalValue&#039;&#039;&#039; || 0x0054 || Gross National Product&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB018 || DWORD || &#039;&#039;&#039;dwCityAdvertising&#039;&#039;&#039; || 0x003C || Completely unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB01C || WORD || &#039;&#039;&#039;wCityCurrentMonth&#039;&#039;&#039; ||  || Which month of the year it is (0-indexed; calculated from dwCityDays)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB020 || WORD || &#039;&#039;&#039;wCityElapsedYears&#039;&#039;&#039; ||  || Years since the city was founded (calculated from dwCityDays)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB1B8 || void* || &#039;&#039;&#039;pArrSpriteHeaders&#039;&#039;&#039; ||  || Pointer to the array of loaded sprite headers&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3D0 || {{Win32_BOOL}} || &#039;&#039;&#039;bNewspaperSubscription&#039;&#039;&#039; || 0x1004 || Whether or not the Subscription newspaper is checked&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3D4 || BYTE || &#039;&#039;&#039;bWeatherHumidity&#039;&#039;&#039; || 0x0068 || Weather humidity value (mm in Rain as seen in newspaper)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3DC || WORD || &#039;&#039;&#039;wSewerBonus&#039;&#039;&#039; ||  || Whether the city has adequate wastewater treatment facilities for use in the Pollution Divisor&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3E8 || WORD || &#039;&#039;&#039;wCityCurrentSeason&#039;&#039;&#039; ||  || Which season it is (0 = winter, 1 = spring, 2 = summer, 3 = autumn; calculated from dwCityDays)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB38C || microsim_t* || &#039;&#039;&#039;dwMicroSimArr&#039;&#039;&#039; ||  || Pointer to the array of [[microsim]]s&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB404 || WORD || &#039;&#039;&#039;wCityDifficulty&#039;&#039;&#039; || 0x001C || Game difficulty (0 = no city founded, 1 = easy, 2 = medium, 3 = hard)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB40C || BYTE || &#039;&#039;&#039;bWeatherTrend&#039;&#039;&#039; || 0x006C || What the [[WeatherTrend type|current weather type]] is&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB430 || WORD[17] || &#039;&#039;&#039;wCityInventionYears&#039;&#039;&#039; || 0x0738 || What years different technologies are invented in&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB454 || DWORD || &#039;&#039;&#039;dwCityCrime&#039;&#039;&#039; || 0x002C || Sum of all values in XCRM&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB458 || WORD || &#039;&#039;&#039;wCityCenterXCoord&#039;&#039;&#039; ||  || The X location of where the Simulator deems to be the &amp;quot;city center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB45C || WORD || &#039;&#039;&#039;wCityCenterYCoord&#039;&#039;&#039; ||  || The Y location of where the Simulator deems to be the &amp;quot;city center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB464 || WORD || &#039;&#039;&#039;wCurrentCityToolGroup&#039;&#039;&#039; ||  || Currently selected city tool group&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4B8 || DWORD || &#039;&#039;&#039;dwWaterUsedPercentage&#039;&#039;&#039; ||  || Percentage of water capacity in use&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4BC || {{Win32_BOOL}} || &#039;&#039;&#039;bNewspaperExtra&#039;&#039;&#039; || 0x1008 || Whether or not the Extra!!! newspaper is checked&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4CC || void* || &#039;&#039;&#039;dwBudgetArr&#039;&#039;&#039; ||  || Pointer to the budget array (needs some reverse engineering and/or documentation work)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4D4 || {{Win32_BOOL}} || &#039;&#039;&#039;bNoDisasters&#039;&#039;&#039; || 0x1000 || Whether or not disasters should be disabled (also disables city council autonomy)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4D8 || WORD || &#039;&#039;&#039;wCityNeighborConnections1000&#039;&#039;&#039; ||  || Count of all $1000 (commercial) neighbor connections (roads)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4E4 || BYTE || &#039;&#039;&#039;bMilitaryBaseType&#039;&#039;&#039; || 0x0EF4 || Military base type (0 = not offered yet, 1 = declined/no location, 2 = army, 3 = air force, 4 = navy, 5 = missile silos)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC8F8 || WORD || &#039;&#039;&#039;wCityResidentialDemand&#039;&#039;&#039; || 0x0718 || Residential demand (-2000 to +2000)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC8FA || WORD || &#039;&#039;&#039;wCityCommericalDemand&#039;&#039;&#039; || 0x071C || Commercial demand (-2000 to +2000)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC8FC || WORD || &#039;&#039;&#039;wCityIndustrialDemand&#039;&#039;&#039; || 0x0720 || Industrial demand (-2000 to +2000)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC910 || DWORD || &#039;&#039;&#039;dwCityPollution&#039;&#039;&#039; ||  || Sum of all Pollution in city.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC918 || WORD || &#039;&#039;&#039;wScenarioDisasterID&#039;&#039;&#039; ||  || ID of the disaster set for the given scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC91A || BYTE || &#039;&#039;&#039;bScenarioDisasterX&#039;&#039;&#039; ||  || X coordinate for preparing the disaster.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC91B || BYTE || &#039;&#039;&#039;bScenarioDisasterY&#039;&#039;&#039; ||  || Y coordinate for preparing the disaster.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC91C || BYTE || &#039;&#039;&#039;wScenarioTimeLimitMonths&#039;&#039;&#039; ||  || Time limit of the scenario in months.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC91E || DWORD || &#039;&#039;&#039;dwScenarioCitySize&#039;&#039;&#039; ||  || Target total population for the scenario exceeded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC922 || DWORD || &#039;&#039;&#039;dwScenarioResPopulation&#039;&#039;&#039; ||  || Target Residential population for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC926 || DWORD || &#039;&#039;&#039;dwScenarioComPopulation&#039;&#039;&#039; ||  || Target Commericial population for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC92A || DWORD || &#039;&#039;&#039;dwScenarioIndPopulation&#039;&#039;&#039; ||  || Target Industrial population for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC92E || DWORD || &#039;&#039;&#039;dwScenarioCashGoal&#039;&#039;&#039; ||  || Cash goal target for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC932 || DWORD || &#039;&#039;&#039;dwScenarioLandValueGoal&#039;&#039;&#039; ||  || Land Value goal target for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC93A || WORD || &#039;&#039;&#039;wScenarioPollutionLimit&#039;&#039;&#039; ||  || Pollution limit for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC93E || WORD || &#039;&#039;&#039;wScenarioCrimeLimit&#039;&#039;&#039; ||  || Crime limit for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC942 || WORD || &#039;&#039;&#039;wScenarioTrafficLimit&#039;&#039;&#039; ||  || Traffic limit for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC946 || BYTE || &#039;&#039;&#039;bScenarioBuildingGoal1&#039;&#039;&#039; ||  || Scenario building goal one.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC947 || BYTE || &#039;&#039;&#039;bScenarioBuildingGoal2&#039;&#039;&#039; ||  || Scenario building goal two.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC948 || WORD || &#039;&#039;&#039;wScenarioBuildingGoal1Count&#039;&#039;&#039; ||  || Scenario building goal one count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC94A || WORD || &#039;&#039;&#039;wScenarioBuildingGoal2Count&#039;&#039;&#039; ||  || Scenario building goal two count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC950 || WORD || &#039;&#039;&#039;wSelectedSubtoolBulldozer&#039;&#039;&#039; ||  || (*** See below) Selected Bulldozer mode (Demolish/Clear, Level Terrain, Raise Terrain, Lower Terrain, De-zone) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC952 || WORD || &#039;&#039;&#039;wSelectedSubtoolNature&#039;&#039;&#039; ||  || Selected Nature mode (trees, water) (forests and stream are available in map-editing mode) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC954 || WORD || &#039;&#039;&#039;wSelectedSubtoolDispatch&#039;&#039;&#039; ||  || Selected Dispatch mode (Police, Fire, Military (if facilities for the first two aren&#039;t present)) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC956 || WORD || &#039;&#039;&#039;wSelectedSubtoolPower&#039;&#039;&#039; ||  || Selected Power mode (Power Lines, Power Plant) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC958 || WORD || &#039;&#039;&#039;wSelectedSubtoolWater&#039;&#039;&#039; ||  || Selected Water mode (Pipes, Water Pump, Water Tower, Treatment, Desalinization) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC95A || WORD || &#039;&#039;&#039;wSelectedSubtoolRewards&#039;&#039;&#039; ||  || Selected Rewards mode (Mayor&#039;s Hour, City Hall, Statue, Military Base, Braun Llama Dome, Arcologies) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC95C || WORD || &#039;&#039;&#039;wSelectedSubtoolRoads&#039;&#039;&#039; ||  || Selected Roads mode (Road, Highway, Tunnel, Onramp, Bus Depot) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC95E || WORD || &#039;&#039;&#039;wSelectedSubtoolRail&#039;&#039;&#039; ||  || Selected Rail mode (Rail, Subway. Rail Depot, Sub Station, Sub&amp;lt;--&amp;gt;Rail) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC960 || WORD || &#039;&#039;&#039;wSelectedSubtoolPorts&#039;&#039;&#039; ||  || Selected Ports mode (Seaport, Airport) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC962 || WORD || &#039;&#039;&#039;wSelectedSubtoolResidential&#039;&#039;&#039; ||  || Selected Residential mode (Light, Dense) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC964 || WORD || &#039;&#039;&#039;wSelectedSubtoolCommercial&#039;&#039;&#039; ||  || Selected Commercial mode (Light, Dense) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC966 || WORD || &#039;&#039;&#039;wSelectedSubtoolIndustrial&#039;&#039;&#039; ||  || Selected Industrial mode (Light, Dense) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC968 || WORD || &#039;&#039;&#039;wSelectedSubtoolEducation&#039;&#039;&#039; ||  || Selected Education mode (School, College, Library, Museum) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC96A || WORD || &#039;&#039;&#039;wSelectedSubtoolServices&#039;&#039;&#039; ||  || Selected Services mode (Police, Fire Station, Hospital, Prison) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC96C || WORD || &#039;&#039;&#039;wSelectedSubtoolParks&#039;&#039;&#039; ||  || Selected Parks mode (Small Park, Big Park, Zoo, Stadium, Marina) **&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CDB68 || WORD || &#039;&#039;&#039;wHighlightedTileX&#039;&#039;&#039; ||  || The X coordinate of the tile currently highlighted on the map&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CDB70 || WORD || &#039;&#039;&#039;wHighlightedTileY&#039;&#039;&#039; ||  || The Y coordinate of the tile currently highlighted on the map&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CDB7C || DWORD || &#039;&#039;&#039;dwLFSRState&#039;&#039;&#039; ||  || Randomness state for the linear feedback shift register PRNG&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CDB80 || DWORD || &#039;&#039;&#039;dwLCGState&#039;&#039;&#039; ||  || Randomness state for the linear congruential generator PRNG&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CE8C0 || AFX_CORE_STATE || &#039;&#039;&#039;pCWinApp&#039;&#039;&#039; ||  || Pointer to a CWinApp (needs reverse engineering -- maybe IDA picked this one out on its own?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C93B4 || DWORD || &#039;&#039;&#039;dwXVALTotalCount&#039;&#039;&#039; ||  || A total count of XVAL &amp;quot;tiles&amp;quot; used in land value average calc.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
** The choices for each SelectedSubtool are for reference purposes only, they may not reflect the actual internal order.&lt;br /&gt;
&lt;br /&gt;
*** wSelectedSubtoolBulldozer - Address 0x4CC94C (WORD array - 18 entries) - unique case to override without changing the currently selected tool.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Terrain generation variables&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Address|The address of the variable.}} ! {{tooltip|Type|What type this variable is declared as.}} ! {{tooltip|Name|The name of the variable.}} ! {{tooltip|MISC offset|If this variable is stored in the .sc2 MISC chunk, this is where in the chunk it&#039;s stored.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C94C0 || {{Win32_BOOL}} || &#039;&#039;&#039;bCityHasOcean&#039;&#039;&#039; || 0x0E44 || Whether or not the city was generated with an ocean, also determines if City is eligible for Naval Base.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1E0 || WORD || &#039;&#039;&#039;wCityTerrainSliderHills&#039;&#039;&#039; ||  || Slider value for hill coverage during terrain generation&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA818 || __int16 || &#039;&#039;&#039;wWaterLevel&#039;&#039;&#039; || 0x0E40 || Water table level&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAAF8 || WORD || &#039;&#039;&#039;wCityTerrainSliderWater&#039;&#039;&#039; ||  || Slider vvalue for water coverage during terrain generation&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CADD8 || WORD || &#039;&#039;&#039;wCityTerrainSliderTrees&#039;&#039;&#039; ||  || Slider value for tree coverage during terrain generation&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3F8 || {{Win32_BOOL}} || &#039;&#039;&#039;bCityHasRiver&#039;&#039;&#039; || 0x0E48 || Whether or not the city was generated with a river&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
IF YOU&#039;RE READING THIS, HERE&#039;S AN EASY TASK:&lt;br /&gt;
These need to be put into tables. I&#039;m too tired to do it now.&lt;br /&gt;
&lt;br /&gt;
.bss:004CC918     wScenarioDisasterID dw ?                ; DATA XREF: sub_4345C0:loc_434650↑o&lt;br /&gt;
.bss:004CC918                                             ; sub_4345C0:loc_43467E↑o ...&lt;br /&gt;
.bss:004CC91A     bScenarioDisasterX db ?                 ; DATA XREF: sub_4345C0+1D6↑r&lt;br /&gt;
.bss:004CC91B     bScenarioDisasterY db ?                 ; DATA XREF: sub_4345C0+1CB↑r&lt;br /&gt;
.bss:004CC91C     wScenarioTimeLimitMonths dw ?           ; DATA XREF: _SimulationProcessTick+517↑w&lt;br /&gt;
.bss:004CC91C                                             ; sub_4345C0+CB↑o&lt;br /&gt;
.bss:004CC91E     dwScenarioCitySize dd ?                 ; DATA XREF: _SimulationProcessTick+402↑r&lt;br /&gt;
.bss:004CC91E                                             ; sub_4345C0+D8↑r ...&lt;br /&gt;
.bss:004CC922     dwScenarioResPopulation dd ?            ; DATA XREF: _SimulationProcessTick+411↑r&lt;br /&gt;
.bss:004CC922                                             ; sub_4345C0+EB↑r ...&lt;br /&gt;
.bss:004CC926     dwScenarioComPopulation dd ?            ; DATA XREF: _SimulationProcessTick+423↑r&lt;br /&gt;
.bss:004CC926                                             ; sub_4345C0+FE↑r ...&lt;br /&gt;
.bss:004CC92A     dwScenarioIndPopulation dd ?            ; DATA XREF: _SimulationProcessTick+438↑r&lt;br /&gt;
.bss:004CC92A                                             ; sub_4345C0+111↑r ...&lt;br /&gt;
.bss:004CC92E     dwScenarioCashGoal dd ?                 ; DATA XREF: _SimulationProcessTick+455↑r&lt;br /&gt;
.bss:004CC92E                                             ; sub_4345C0+124↑r ...&lt;br /&gt;
.bss:004CC932     dwScenarioLandValueGoal dd ?            ; DATA XREF: _SimulationProcessTick:loc_413981↑r&lt;br /&gt;
.bss:004CC932                                             ; sub_4345C0+137↑r ...&lt;br /&gt;
.bss:004CC936     word_4CC936     dw ?                    ; DATA XREF: _SimulationProcessTick:loc_413992↑r&lt;br /&gt;
.bss:004CC936                                             ; sub_4345C0+14A↑o&lt;br /&gt;
.bss:004CC938     word_4CC938     dw ?                    ; DATA XREF: _SimulationProcessTick:loc_4139A3↑r&lt;br /&gt;
.bss:004CC938                                             ; sub_4345C0+157↑o&lt;br /&gt;
.bss:004CC93A     wScenarioPollutionLimit dd ?            ; DATA XREF: _SimulationProcessTick:loc_4139B4↑r&lt;br /&gt;
.bss:004CC93A                                             ; sub_4345C0+164↑r ...&lt;br /&gt;
.bss:004CC93E     wScenarioCrimeLimit dd ?                ; DATA XREF: _SimulationProcessTick:loc_4139C9↑r&lt;br /&gt;
.bss:004CC93E                                             ; sub_4345C0+177↑r ...&lt;br /&gt;
.bss:004CC942     wScenarioTrafficLimit dd ?              ; DATA XREF: _SimulationProcessTick:loc_4139DE↑r&lt;br /&gt;
.bss:004CC942                                             ; sub_4345C0+18A↑r ...&lt;br /&gt;
.bss:004CC946     bScenarioBuildingGoal1 db ?             ; DATA XREF: _SimulationProcessTick+4D5↑r&lt;br /&gt;
.bss:004CC947     bScenarioBuildingGoal2 db ?             ; DATA XREF: _SimulationProcessTick+4F5↑r&lt;br /&gt;
.bss:004CC948     wScenarioBuildingGoal1Count dw ?        ; DATA XREF: _SimulationProcessTick+4DF↑r&lt;br /&gt;
.bss:004CC948                                             ; sub_4345C0+19D↑o&lt;br /&gt;
.bss:004CC94A     wScenarioBuildingGoal2Count dw ?        ; DATA XREF: _SimulationProcessTick+4FF↑r&lt;br /&gt;
.bss:004CC94A                                             ; sub_4345C0+1AA↑o&lt;br /&gt;
.bss:004CC94C                     align 10h&lt;br /&gt;
.bss:004CC950     ; __int16 wSelectedSubtoolBulldozer[]&lt;br /&gt;
.bss:004CC950     wSelectedSubtoolBulldozer dw ?          ; DATA XREF: sub_406FD0+AC↑r&lt;br /&gt;
.bss:004CC950                                             ; sub_40E250+18C↑w ...&lt;br /&gt;
.bss:004CC952     wSelectedSubtoolNature dw ?             ; DATA XREF: sub_422200+B6↑w&lt;br /&gt;
.bss:004CC952                                             ; sub_442440+74↑r ...&lt;br /&gt;
.bss:004CC954     wSelectedSubtoolDispatch dw ?           ; DATA XREF: sub_422200+D5↑w&lt;br /&gt;
.bss:004CC954                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F2F7↑r ...&lt;br /&gt;
.bss:004CC956     wSelectedSubtoolPower dw ?              ; DATA XREF: sub_422200+F4↑w&lt;br /&gt;
.bss:004CC956                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F336↑r ...&lt;br /&gt;
.bss:004CC958     wSelectedSubtoolWater dw ?              ; DATA XREF: sub_422200+113↑w&lt;br /&gt;
.bss:004CC958                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F3DD↑r ...&lt;br /&gt;
.bss:004CC95A     wSelectedSubtoolRewards dw ?            ; DATA XREF: sub_422200:loc_42231F↑w&lt;br /&gt;
.bss:004CC95A                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F462↑r ...&lt;br /&gt;
.bss:004CC95C     wSelectedSubtoolRoads dw ?              ; DATA XREF: sub_422200+155↑w&lt;br /&gt;
.bss:004CC95C                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F4BF↑r ...&lt;br /&gt;
.bss:004CC95E     wSelectedSubtoolRail dw ?               ; DATA XREF: sub_422200+174↑w&lt;br /&gt;
.bss:004CC95E                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F558↑r ...&lt;br /&gt;
.bss:004CC960     wSelectedSubtoolPorts dw ?              ; DATA XREF: sub_422200+193↑w&lt;br /&gt;
.bss:004CC960                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F60F↑r&lt;br /&gt;
.bss:004CC962     wSelectedSubtoolResidential dw ?        ; DATA XREF: sub_40E250+1B8↑w&lt;br /&gt;
.bss:004CC962                                             ; sub_422200+1B2↑w ...&lt;br /&gt;
.bss:004CC964     wSelectedSubtoolCommercial dw ?         ; DATA XREF: sub_40E250+1C4↑w&lt;br /&gt;
.bss:004CC964                                             ; sub_422200+1D1↑w ...&lt;br /&gt;
.bss:004CC966     wSelectedSubtoolIndustrial dw ?         ; DATA XREF: sub_40E250+1D0↑w&lt;br /&gt;
.bss:004CC966                                             ; sub_422200+1F0↑w ...&lt;br /&gt;
.bss:004CC968     wSelectedSubtoolEducation dw ?          ; DATA XREF: sub_422200+20F↑w&lt;br /&gt;
.bss:004CC968                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F6F7↑r&lt;br /&gt;
.bss:004CC96A     wSelectedSubtoolServices dw ?           ; DATA XREF: sub_422200+22E↑w&lt;br /&gt;
.bss:004CC96A                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F729↑r ...&lt;br /&gt;
.bss:004CC96C     wSelectedSubtoolParks dw ?              ; DATA XREF: sub_422200+24D↑w&lt;br /&gt;
.bss:004CC96C                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F787↑r ...&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Map data pointers&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Address|The address of the variable.}} ! {{tooltip|Type|What type this variable is declared as.}} ! {{tooltip|Name|The name of the variable.}} ! {{tooltip|MISC offset|If this variable is stored in the .sc2 MISC chunk, this is where in the chunk it&#039;s stored.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C9430 || void* || &#039;&#039;&#039;dwMapXPLC&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; for police coverage (1 byte per 4x4 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C9F58 || void* || &#039;&#039;&#039;dwMapXTER&#039;&#039;&#039; ||  || Pointer to a 128x128 map of terrain data (1 byte of type map_XTER_t per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1F0 || void* || &#039;&#039;&#039;dwMapXZON&#039;&#039;&#039; ||  || Pointer to a 128x128 map of zone and corner info (1 byte of type map_XZON_t per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3EC || void* || &#039;&#039;&#039;dwMapXMIC&#039;&#039;&#039; ||  || Pointer to an array of type map_XMIC_t[150] containing MicroSim data.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA198 || void* || &#039;&#039;&#039;dwMapXLAB&#039;&#039;&#039; ||  || Pointer to an array of type map_XLAB_t[256].&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA434 || void* || &#039;&#039;&#039;dwMapXTHG&#039;&#039;&#039; ||  || Pointer to an array of type map_XTHG_t[256] containing [[Thing]]s&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA448 || void* || &#039;&#039;&#039;dwMapXPOP&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; for population density (1 byte per 4x4 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA4D8 || void* || &#039;&#039;&#039;dwMapXCRM&#039;&#039;&#039; ||  || Pointer to a 64x64 &amp;quot;minimap&amp;quot; for crime (1 byte per 2x2 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA600 || void* || &#039;&#039;&#039;dwMapXTXT&#039;&#039;&#039; ||  || Pointer to a 128x128 map of [[XTXT]] IDs (1 byte per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA828 || void* || &#039;&#039;&#039;dwMapXPLT&#039;&#039;&#039; ||  || Pointer to a 64x64 &amp;quot;minimap&amp;quot; for pollution (1 byte per 2x2 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA940 || void* || &#039;&#039;&#039;dwMapXTRF&#039;&#039;&#039; ||  || Pointer to a 64x64 &amp;quot;minimap&amp;quot; for traffic (1 byte per 2x2 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAA78 || void* || &#039;&#039;&#039;dwMapXFIR&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; for fire coverage (1 byte per 4x4 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAB10 || void* || &#039;&#039;&#039;dwMapXBIT&#039;&#039;&#039; ||  || Pointer to a 128x128 map of tile flags (1 byte of type map_[[XBIT]]_t per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAE10 || void* || &#039;&#039;&#039;dwMapALTM&#039;&#039;&#039; ||  || Pointer to a 128x128 map of altitude data (1 byte of type map_ALTM_t per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB028 || void* || &#039;&#039;&#039;dwMapXROG&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; of rate of growth data (1 byte of unknown type per 4x4 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB0A8 || void* || &#039;&#039;&#039;dwMapXVAL&#039;&#039;&#039; ||  || Pointer to a 64x64 &amp;quot;minimap&amp;quot; of land value (1 byte of &amp;lt;code&amp;gt;(full value / 1000 - 1)&amp;lt;/code&amp;gt; per 2x2 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB1D0 || void* || &#039;&#039;&#039;dwMapXUND&#039;&#039;&#039; ||  || Pointer to a 128x128 map of underground map data (1 byte of type map_XUND_t per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC470 || void* || &#039;&#039;&#039;dwMapXGRP&#039;&#039;&#039; ||  || Pointer to the historical graph data&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4F0 || void* || &#039;&#039;&#039;dwMapXBLD&#039;&#039;&#039; ||  || Pointer to a 128x128 map of tile IDs (1 byte of type enumTileID per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC6F4 || void* || &#039;&#039;&#039;dwMapTempValMap1&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; of 4x4 parcels needed for land value calculation (pollution?).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC6F8 || void* || &#039;&#039;&#039;dwNaturalBeauty_ResCom&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; of 4x4 parcels needed for land value calculation (this includes surface water, water supply, terrain slopes, parks).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC6FC || void* || &#039;&#039;&#039;dwMapTempValMap2&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; of 4x4 parcels needed for land value calculation (pollution?).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC778 || void* || &#039;&#039;&#039;dwNaturalBeauty_Industrial&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; of 4x4 parcels needed for land value calculation (this includes surface water, water supply).&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Simulation Arrays&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Address|The address of the variable.}} ! {{tooltip|Type|What type this variable is declared as.}} ! {{tooltip|Name|The name of the array.}} ! {{tooltip|MISC offset|If this variable is stored in the .sc2 MISC chunk, this is where in the chunk it&#039;s stored.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 004C94B4 || void* || &#039;&#039;&#039;pRawPopTable&#039;&#039;&#039; ||  || Pointer to 20-item array for the Population Table&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAA70 || void* || &#039;&#039;&#039;pLETable&#039;&#039;&#039; ||  || Pointer to 20-item array for the LE Table, these are as aggregate sums for the entire age group (LE/RawPop=AgeGroupLE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C94BC || void* || &#039;&#039;&#039;pEQTable&#039;&#039;&#039; ||  || Pointer to 20-item array for the EQ Table, these are as aggregate sums for the entire age group (EQ/RawPop=AgeGroupEQ).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3F0 || void* || &#039;&#039;&#039;pIndividualIndPops&#039;&#039;&#039; ||  || Pointer to 11-item array for the Raw Populations for City Industries Table.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3E0 || void* || &#039;&#039;&#039;pIndividualIndTaxRate&#039;&#039;&#039; ||  || Pointer to 11-item array for the each of the Industrial Group&#039;s Tax Rates.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA3F4 || void* || &#039;&#039;&#039;pIndividualIndDemands&#039;&#039;&#039; ||  || Pointer to 11-item array for the each of the Industrial Group&#039;s current Demand.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA428 || void* || &#039;&#039;&#039;pZonePops&#039;&#039;&#039; ||  || Pointer to 8-item array of Zone Populations (/10): &#039;&#039;&#039;AllTotalPops, Light Res, Dense Res, Light Com, Dense Com, Light Ind, Dense Ind, Abandoned.&#039;&#039;&#039; &lt;br /&gt;
|}&lt;br /&gt;
[[Category:Game data]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Function_list&amp;diff=677</id>
		<title>Function list</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Function_list&amp;diff=677"/>
		<updated>2025-03-14T06:35:16Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Heavy construction}}&lt;br /&gt;
&lt;br /&gt;
This is a table of functions in SimCity 2000 that have been at least partially reverse engineered and given names. It is probably going to be unpleasant to update, but at least it looks nice and you can sort it.&lt;br /&gt;
&lt;br /&gt;
When adding new functions to the table, please make sure you insert them into the appropriate order by thunk address (the function that just has a &amp;lt;code&amp;gt;jmp &#039;&#039;&#039;ActualFunctionBody&#039;&#039;&#039;&amp;lt;/code&amp;gt; instruction in it). If/when it gets too unwieldy we can split it out into multiple tables.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Uncategorized functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401262 || 0x468D30 || int || __stdcall || &#039;&#039;&#039;[[SimulationEQ_LE_Processing]]&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 22 || Handles EQ and LE simulation for the month.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40130C || 0x45F760 || {{Win32_BOOL}} || __stdcall || &#039;&#039;&#039;SimulationDoDisasterTick&#039;&#039;&#039; ||  || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x4013ED || 0x42BCA0 || int || __cdecl || &#039;&#039;&#039;SimulationCalculateOrdinanceCost&#039;&#039;&#039; || DWORD dwOrdinance || {{Mostly understood}} ||  || Returns the effective cost of an ordinance&lt;br /&gt;
|-&lt;br /&gt;
| 0x4015E6 || 0x4731E0 || int || __cdecl || &#039;&#039;&#039;SimulationPrepareBudgetDialog&#039;&#039;&#039; || int a1 || {{Mostly understood}} ||  || arg a1 only referenced on line, seems to be more like &amp;quot;BOOL bUseParentWindow&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401672 || 0x441E50 || int || __cdecl || &#039;&#039;&#039;SimulationGrantReward&#039;&#039;&#039; || __int16 iRewardID, BOOL bAddReward || {{Mostly understood}} ||  || Adds a city progression reward if (bAddReward), removes it if (!bAddReward).&lt;br /&gt;
|-&lt;br /&gt;
| 0x40174E || 0x42B4D0 || int || __cdecl || &#039;&#039;&#039;SimulationPrepareDisaster&#039;&#039;&#039; || DWORD *a1, __int16 a2, __int16 a3 || {{Somewhat understood}} ||  || Seems to prepare the starting location for disasters.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401820 || 0x413520 || void || __stdcall || &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; ||  || {{Mostly understood}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; based on game speed || Advances the calendar date and performs all appropriate daily/monthly/etc. tasks. May need better name?&lt;br /&gt;
|-&lt;br /&gt;
| 0x4019EC || 0x4412E0 || int || __cdecl || &#039;&#039;&#039;CenterOnTileCoords&#039;&#039;&#039; || __int16 iTileX, __int16 iTileY || {{Somewhat understood}} || Called from the centering tool and anywhere that needs to center the display || &lt;br /&gt;
|-&lt;br /&gt;
| 0x401CA8 || 0x464550 || int || __stdcall || &#039;&#039;&#039;SimulationUpdateWaterConsumption&#039;&#039;&#039; ||  || {{Barely explored}} || Called whenever tiles are placed and on &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 2 || Vanilla SC2K doesn&#039;t call this when tiles are placed on cities over 50,000 pop.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401E65 || 0x471BC0 || char || __stdcall || &#039;&#039;&#039;SimulationDetermineCityCrisis&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called on the last day of the month and from &#039;&#039;sub_406A50&#039;&#039; || Changes the city status line if there&#039;s a new demand, and also starts disasters.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40217B || 0x468150 || int || __stdcall || &#039;&#039;&#039;[[SimulationRCIDemandUpdates]]&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 22 || Handles all RCI bar updates for &amp;quot;zone balance&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4022FC || 0x4358B0 || int || __cdecl || &#039;&#039;&#039;SimulationGrowthTick&#039;&#039;&#039; || __int16 a1, __int16 a2 || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; on days 4-17 || The arguments and algorithms are not yet understood.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402527 || 0x45CF10 || int || __stdcall || &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; || Calls the appropriate disaster creation function and then runs disaster ticks&lt;br /&gt;
|-&lt;br /&gt;
| 0x4026B2 || 0x4734A0 || int || __usercall || &#039;&#039;&#039;SimulationGrowSpecificZone&#039;&#039;&#039; || int a1@&amp;lt;ebp&amp;gt;, __int16 iX, __int16 iY, __int16 iTileID, __int16 iZoneType || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationGrowthTick&#039;&#039;&#039; || Might be an omit-frame-pointer function?&lt;br /&gt;
|-&lt;br /&gt;
| 0x4026F8 || 0x467860 || int || __stdcall || &#039;&#039;&#039;SimulationUpdatePowerConsumption&#039;&#039;&#039; ||  || {{Barely explored}} || Called whenever tiles are placed and on &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 21 || Vanilla SC2K doesn&#039;t call this when tiles are placed on cities over 50,000 pop.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402A3B || 0x405AB0 || DWORD || __thiscall || &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; || CWinApp* this || {{Somewhat understood}} || Called from &#039;&#039;&#039;CWinApp::OnIdle&#039;&#039;&#039; via the class CWinApp vtable || Could stand to have a better name.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402A9F || 0x40C100 || __int16 || __tstdcall || &#039;&#039;&#039;SimulationProcessTimer&#039;&#039;&#039; ||  || {{Mostly understood}} || Called from the root window&#039;s AFX_MSGMAP to handle WM_TIMER messages ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x402D2E || 0x4734A0 || __int16 || __stdcall || &#039;&#039;&#039;SimulationCalculateBudgetUpdates&#039;&#039;&#039; ||  || {{Barely explored}} ||  || 00&lt;br /&gt;
|-&lt;br /&gt;
| 0x403017 || 0x4142C0 || int || __stdcall || &#039;&#039;&#039;SimulationProposeMilitaryBase&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; on day 23 and from &amp;quot;gilmartin&amp;quot; cheat || &lt;br /&gt;
|-&lt;br /&gt;
| 0x401154 || 0x46A840 || int || __stdcall || &#039;&#039;&#039;[[SimulationPollutionTerrainLandValueScan]]&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; on day 3 || This is where the land value, pollution and other things simulators lives.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4025A4 || 0x4302E0 || int || __thiscall || &#039;&#039;&#039;LoadSegmentsFromSavedCity&#039;&#039;&#039; || void *this, int *a2, char *Src || {{Barely explored}} ||  || Seems to be related to the loading / parsing of segments from a saved SC2 file&lt;br /&gt;
|-&lt;br /&gt;
| 0x4025A9 || 0x42D940 || int || || &#039;&#039;&#039;ClearMapsAndOtherThingsFromMemory&#039;&#039;&#039; || || {{Barely explored}} || Appears to be called when the game is about to close down || Seems to clear / reinitialize a number of global variables&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ [[MicroSim]] functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401460 || 0x44CF60 || char || __cdecl || &#039;&#039;&#039;SimulationProvisionMicrosim&#039;&#039;&#039; || __int16 a1, int a2, __int16 iTileID || {{Barely explored}} ||  || iTileID is the only argument used; needs some RE work for sure&lt;br /&gt;
|-&lt;br /&gt;
| 0x40158C || 0x44DDC0 || __int16 || __cdecl || &#039;&#039;&#039;SimulationInitializeMicrosim&#039;&#039;&#039; || __int16 iMicroSimIdx, __int16 iTileID || {{Barely explored}} ||  || Seems to initialize the values for each microsim based on the provided tile ID. First param is an index into the XLAB map.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ [[Thing]] functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x40132A || 0x4562E0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickSailboat&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Has a rare chance of turning into Nessie&lt;br /&gt;
|-&lt;br /&gt;
| 0x40137F || 0x454EA0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickTornado&#039;&#039;&#039; ||__int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x401992 || 0x4548C0 || void || __usercall || &#039;&#039;&#039;SimulationThingTickMonster&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || The function signature of this one is odd and needs investigation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401B6D || 0x455500 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickTrain&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Used for XTHG_TRAIN_ENGINE and XTHG_UNKNOWN_3&lt;br /&gt;
|-&lt;br /&gt;
| 0x401EBA || 0x452FA0 || int || __cdecl || &#039;&#039;&#039;SimulationSpawnMaxisMan&#039;&#039;&#039; || __int16 iDisasterID || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; || Creates the Thing for Maxis Man and determines based on iDisasterID what his behavior should be&lt;br /&gt;
|-&lt;br /&gt;
| 0x40236F || 0x456760 || void || __usercall || &#039;&#039;&#039;SimulationThingTickCargoShip&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || IDA really doesn&#039;t like this function for some reason&lt;br /&gt;
|-&lt;br /&gt;
| 0x402464 || 0x450890 || int || __stdcall || &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; ||  || {{Barely explored}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; via &#039;&#039;sub_401DBB&#039;&#039; || Does the individual simulation ticks for Things every 30-45 ms.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4024AA || 0x455020 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickMaxisMan&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || If you shoot down a helicopter and it lights something on fire, it&#039;s your own dang fault&lt;br /&gt;
|-&lt;br /&gt;
| 0x4027A2 || 0x453980 || void || __usercall || &#039;&#039;&#039;SimulationThingTickAirplane&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Another one with a bizarre function signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x4028D3 || 0x4546F0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickExplosion&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x402ED2 || 0x4540C0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickHelicopter&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Sound and music functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401096 || 0x4251D0 || int || __thiscall || &#039;&#039;&#039;SoundPlaySound&#039;&#039;&#039; || int* this, int iSoundID || {{Mostly understood}} || Called in so many places || Calls through to &#039;&#039;sub_4802B0&#039;&#039;, which does the buffer loads and calls to &#039;&#039;sndPlaySoundA&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401389 || 0x480890 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicSendMCICommands&#039;&#039;&#039; || unsigned __int16* this, char* szMidiPath || {{Understood}} || Called by &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039; || Sends the actual MCI commands to play/stop a MIDI file&lt;br /&gt;
|-&lt;br /&gt;
| 0x401479 || 0x480770 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039; || unsigned __int16* this, int iSongID || {{Understood}} || Called by &#039;&#039;&#039;MusicPlay&#039;&#039;&#039; || Turns iSongID into szMidiPath&lt;br /&gt;
|-&lt;br /&gt;
| 0x4015FF || 0x480B20 || void || __thiscall || &#039;&#039;&#039;AllocateSoundBuffers&#039;&#039;&#039; || DWORD *this, int a2 || {{Barely explored}} || Called by &#039;&#039;&#039;CMainFrame:OnCreate&#039;&#039;&#039; || Allocates sound buffers; replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x401A9B || 0x425290 || int || __thiscall || &#039;&#039;&#039;MusicPlayNextRefocusSong&#039;&#039;&#039; || unsigned __int16** this || {{Understood}} || Called in a few places || Loops through the non-event music; replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x401CE9 || 0x425220 || int || __thiscall || &#039;&#039;&#039;SoundStopSound&#039;&#039;&#039; || int* this, int iSoundID || {{Understood}} || Called in so many places || Does a few checks then blasts out &#039;&#039;sndPlaySoundA(0, 0)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401F9B || 0x480140 || void || __stdcall || &#039;&#039;&#039;LoadSoundBuffer&#039;&#039;&#039; || int iSoundID, void* lpBuffer || {{Understood}} || Called before a few sound calls || This and many other sound functions are replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x402414 || 0x425260 || int || __thiscall || &#039;&#039;&#039;MusicPlay&#039;&#039;&#039; || unsigned __int16** this, iSongID || {{Understood}} || Called by anything that changes the music || Basically just a trampoline to &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4027E8 || 0x48A3F0 || LRESULT || __stdcall || &#039;&#039;&#039;MaxisMovieWndProc&#039;&#039;&#039; || HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam || {{Mostly understood}} || Registered as window class &amp;quot;MaxisMovie&amp;quot; by sub_405650 || Window procedure for the &amp;quot;fullscreen&amp;quot; window that plays Smacker movies&lt;br /&gt;
|-&lt;br /&gt;
| 0x402BE4 || 0x480AE0 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicStop&#039;&#039;&#039; || int this || {{Understood}} || Called by anything that stops the music || Sends an MCI_CLOSE command to the sequencer device&lt;br /&gt;
|-&lt;br /&gt;
| 0x48A370 || || BOOL || __cdecl || &#039;&#039;&#039;MaxisMovieBlitNextFrame&#039;&#039;&#039; || HWND hWnd || {{Understood}} || Called by &#039;&#039;&#039;MaxisMovieWndProc&#039;&#039;&#039; from WM_PAINT message || Blits the next frame of a Smacker movie onto the MaxisMovie window&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Randomness functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401019 || 0x47FC30 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod32&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 32&lt;br /&gt;
|-&lt;br /&gt;
| 0x40116D || 0x47FAA0 || __int16 || __cdecl || &#039;&#039;&#039;RandomWordLCGMod&#039;&#039;&#039; || __int16 iModulus || {{Understood}} ||  || Returns a random word from the LCG modulo iModulus&lt;br /&gt;
|-&lt;br /&gt;
| 0x401415 || 0x47FC70 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod64&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 64&lt;br /&gt;
|-&lt;br /&gt;
| 0x4017AD || 0x47FAE0 || int || __stdcall || &#039;&#039;&#039;GetRandomLFSRState&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns the state of the LFSR&lt;br /&gt;
|-&lt;br /&gt;
| 0x401CAD || 0x47FAF0 || __int16 || __cdecl || &#039;&#039;&#039;RandomWordLFSRMod&#039;&#039;&#039; || __int16 iModulus || {{Understood}} ||  || Returns a random word from the LFSR modulo iModulus&lt;br /&gt;
|-&lt;br /&gt;
| 0x401D9D || 0x47FCF0 || unsigned __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSR&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR&lt;br /&gt;
|-&lt;br /&gt;
| 0x401F19 || 0x47FA80 || int || __cdecl || &#039;&#039;&#039;SeedRandomLCG&#039;&#039;&#039; || int iSeed || {{Understood}} ||  || Sets the LCG state&lt;br /&gt;
|-&lt;br /&gt;
| 0x402261 || 0x47FB70 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod4&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 4&lt;br /&gt;
|-&lt;br /&gt;
| 0x4025E5 || 0x47FBF0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod16&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 16&lt;br /&gt;
|-&lt;br /&gt;
| 0x402626 || 0x47FAD0 || int || __cdecl || &#039;&#039;&#039;SeedRandomLFSR&#039;&#039;&#039; || int iSeed || {{Understood}} ||  || Sets the LFSR state&lt;br /&gt;
|-&lt;br /&gt;
| 0x40288D || 0x47FBB0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod8&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 8&lt;br /&gt;
|-&lt;br /&gt;
| 0x402946 || 0x47FB30 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod2&#039;&#039;&#039; ||  || {{Understood}} || Called by &#039;&#039;&#039;SimulationThingTickTrain&#039;&#039;&#039; and &#039;&#039;&#039;SimulationDoDisasterTick&#039;&#039;&#039; || Returns a random word from the LFSR modulo 2&lt;br /&gt;
|-&lt;br /&gt;
| 0x402B3F || 0x47FCB0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod128&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 128&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Frequently-reused MFC class functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x40219E || 0x4815E0 || INT_PTR || __thiscall || &#039;&#039;&#039;CGameDialog::DoModal&#039;&#039;&#039; || LPCDLGTEMPLATEA* this || {{Understood}} || Called in so many places || Seems to pause the simulation, call CDialog::DoModal(this), then restore the simulation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40281A || 0x481300 || struct CRuntimeClass* || __stdcall || &#039;&#039;&#039;CGameDialog::GetRuntimeClass&#039;&#039;&#039; ||  || {{Understood}} ||  || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Game data]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Known_global_variables&amp;diff=654</id>
		<title>Known global variables</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Known_global_variables&amp;diff=654"/>
		<updated>2025-03-12T09:14:17Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: pCwndMainWindow -&amp;gt; pCWndRootWindow&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Heavy construction}}&lt;br /&gt;
&lt;br /&gt;
This is a table of global variables in SimCity 2000 that have been at least partially reverse engineered and given names. It is probably going to be unpleasant to update, but at least it looks nice and you can sort it.&lt;br /&gt;
&lt;br /&gt;
Data about where in the MISC chunk certain variables are located is from dfloer&#039;s sc2k-docs repository on GitHub (CC BY-SA 4.0).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Uncategorized variables&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Address|The address of the variable.}} ! {{tooltip|Type|What type this variable is declared as.}} ! {{tooltip|Name|The name of the variable.}} ! {{tooltip|MISC offset|If this variable is stored in the .sc2 MISC chunk, this is where in the chunk it&#039;s stored.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C702C || CWnd* || &#039;&#039;&#039;pCWndRootWindow&#039;&#039;&#039; ||  || Pointer to the MFC CWnd class for the &amp;quot;root window&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
| 0x4C7104 || {{Win32_BOOL}} || &#039;&#039;&#039;bPriscillaActivated&#039;&#039;&#039; ||  || Whether or not the debug menu has been activated&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C71F0 || {{Win32_BOOL}} || &#039;&#039;&#039;bOptionsMusicEnabled&#039;&#039;&#039; || 0x0FFC || Whether or not music is enabled&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C7318 || WORD || &#039;&#039;&#039;wSimulationSpeed&#039;&#039;&#039; || 0x0FEC || 1-5 for Paused through African Swallow&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C9428 || WORD || &#039;&#039;&#039;wIndustrialMixPollutionBonus&#039;&#039;&#039; ||  || -1 to 2 used to calculate the map wide Pollution Divisor&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C942C || WORD || &#039;&#039;&#039;wViewRotation&#039;&#039;&#039; || 0x0008 || 0 = north, 1 = west, 2 = south, 3 = east&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C94C4 || DWORD || &#039;&#039;&#039;dwArcologyPopulation&#039;&#039;&#039; || 0x1020 || Population of the city specifically in arcologies&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1A0 || char* || &#039;&#039;&#039;pszCityName&#039;&#039;&#039; ||   || Pointer to the city name, loaded/saved as the CNAM chunk&lt;br /&gt;
|- &lt;br /&gt;
| 0x4CA1BC || WORD || &#039;&#039;&#039;wNationalEconomyTrend&#039;&#039;&#039; || 0x005C || Affects interest rates, apparently&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1E8 || WORD || &#039;&#039;&#039;wIndustrialMixBonus&#039;&#039;&#039; ||  || This is used in RCI demand generation as a bonus (cities dominated by 1 industry receive growth bonuses)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1DC || WORD || &#039;&#039;&#039;wPrisonBonus&#039;&#039;&#039; ||  || This sets if power stations get increased Police power from Prisons.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA3F0 || WORD || &#039;&#039;&#039;wCityNeighborConnections1500&#039;&#039;&#039; ||  || Count of all $1500 (industrial) neighbor connections (railroad, highways)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA41C || WORD || &#039;&#039;&#039;wSubwayXUNDCount&#039;&#039;&#039; || 0x0FE8 || Seems to be mostly used for budget calculations&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA420 || WORD || &#039;&#039;&#039;wDisasterType&#039;&#039;&#039; || 0x0070 || The ID of the next disaster to occur&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA42C || WORD || &#039;&#039;&#039;wCityMode&#039;&#039;&#039; || 0x0004 || 0 = map editor, 1 = regular gameplay, 2 = scenario mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA440 || int || &#039;&#039;&#039;dwCityLandValue&#039;&#039;&#039; || 0x0028 || Sum of all values in XVAL&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA444 || int || &#039;&#039;&#039;dwCityFunds&#039;&#039;&#039; || 0x0014 || How much money the city has&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA4C8 || WORD* || &#039;&#039;&#039;dwTileCount&#039;&#039;&#039; ||  || Pointer to an array of tile counts for every valid iTileID&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA4D0 || DWORD || &#039;&#039;&#039;dwCityValue&#039;&#039;&#039; || 0x0024 || Appears to have something to do with bond interest rates&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA5F4 || WORD || &#039;&#039;&#039;wCityStartYear&#039;&#039;&#039; || 0x000C || The year the city was founded&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA81C || WORD || &#039;&#039;&#039;wMonsterXTHGIndex&#039;&#039;&#039; ||  || Which XTHG entry the monster&#039;s [[Thing]] is&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA928 || DWORD || &#039;&#039;&#039;dwNationalPopulation&#039;&#039;&#039; || 0x0050 || Population of SimNation&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA934 || WORD* || &#039;&#039;&#039;dwMilitaryTiles&#039;&#039;&#039; ||  || Pointer to the beginning of the military tiles in the dwTileCount array&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA938 || WORD || &#039;&#039;&#039;wNationalTax&#039;&#039;&#039; || 0x0058 || The national base tax rate or the &amp;quot;fed rate&amp;quot;, for calculating bond interest rates&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAA40 || DWORD || &#039;&#039;&#039;dwCityOrdinances&#039;&#039;&#039; || 0x0FA0 || Flags for which city ordinances are enacted&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAA50 || DWORD || &#039;&#039;&#039;dwPowerUsedPercentage&#039;&#039;&#039; ||  || Percentage of power capacity in use&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAA74 || DWORD || &#039;&#039;&#039;dwCityPopulation&#039;&#039;&#039; || 0x102C || Total city population, excluding arcologies&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAD2C || {{Win32_BOOL}} || &#039;&#039;&#039;bYearEndFlag&#039;&#039;&#039; || 0x0E3C || Whether or not the first of the month is the start of a new year&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAD44 || {{Win32_BOOL}} || &#039;&#039;&#039;bInScenario&#039;&#039;&#039; ||  || Whether or not this game is a scenario&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAD58 || neighbor_city_t[4] || &#039;&#039;&#039;stNeighborCities&#039;&#039;&#039; || 0x06D8 || Array of four neighbor cities (32 bytes each), clockwise from bottom left&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CADE0 || BYTE || &#039;&#039;&#039;bWeatherHeat&#039;&#039;&#039; || 0x0060 || Weather heat level&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAE04 || DWORD || &#039;&#039;&#039;dwCityDays&#039;&#039;&#039; || 0x0010 || How many days have elapsed since the city was founded&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAE0C || BYTE || &#039;&#039;&#039;bWeatherWind&#039;&#039;&#039; || 0x0064 || Weather wind speed&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB010 || WORD || &#039;&#039;&#039;wCityProgression&#039;&#039;&#039; || 0x0078 || Flags for city reward progression&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB014 || DWORD || &#039;&#039;&#039;dwNationalValue&#039;&#039;&#039; || 0x0054 || Gross National Product&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB018 || DWORD || &#039;&#039;&#039;dwCityAdvertising&#039;&#039;&#039; || 0x003C || City advertising effects (unknown what this actually does)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB01C || WORD || &#039;&#039;&#039;wCityCurrentMonth&#039;&#039;&#039; ||  || Which month of the year it is (0-indexed; calculated from dwCityDays)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB020 || WORD || &#039;&#039;&#039;wCityElapsedYears&#039;&#039;&#039; ||  || Years since the city was founded (calculated from dwCityDays)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB1B8 || void* || &#039;&#039;&#039;pArrSpriteHeaders&#039;&#039;&#039; ||  || Pointer to the array of loaded sprite headers&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3D0 || {{Win32_BOOL}} || &#039;&#039;&#039;bNewspaperSubscription&#039;&#039;&#039; || 0x1004 || Whether or not the Subscription newspaper is checked&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3D4 || BYTE || &#039;&#039;&#039;bWeatherHumidity&#039;&#039;&#039; || 0x0068 || Weather humidity value&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3DC || WORD || &#039;&#039;&#039;wSewerBonus&#039;&#039;&#039; ||  || Whether the city has adequate wastewater treatment facilities for use in the Pollution Divisor&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3E8 || WORD || &#039;&#039;&#039;wCityCurrentSeason&#039;&#039;&#039; ||  || Which season it is (0 = winter, 1 = spring, 2 = summer, 3 = autumn; calculated from dwCityDays)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB38C || microsim_t* || &#039;&#039;&#039;dwMicroSimArr&#039;&#039;&#039; ||  || Pointer to the array of [[microsim]]s&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB404 || WORD || &#039;&#039;&#039;wCityDifficulty&#039;&#039;&#039; || 0x001C || Game difficulty (0 = no city founded, 1 = easy, 2 = medium, 3 = hard)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB40C || BYTE || &#039;&#039;&#039;bWeatherTrend&#039;&#039;&#039; || 0x006C || What the current weather type is&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB430 || WORD[17] || &#039;&#039;&#039;wCityInventionYears&#039;&#039;&#039; || 0x0738 || What years different technologies are invented in&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB454 || DWORD || &#039;&#039;&#039;dwCityCrime&#039;&#039;&#039; || 0x002C || Sum of all values in XCRM&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB464 || WORD || &#039;&#039;&#039;wCurrentToolGroup&#039;&#039;&#039; ||  || Currently selected tool group&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4B8 || DWORD || &#039;&#039;&#039;dwWaterUsedPercentage&#039;&#039;&#039; ||  || Percentage of water capacity in use&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4BC || {{Win32_BOOL}} || &#039;&#039;&#039;bNewspaperExtra&#039;&#039;&#039; || 0x1008 || Whether or not the Extra!!! newspaper is checked&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4CC || void* || &#039;&#039;&#039;dwBudgetArr&#039;&#039;&#039; ||  || Pointer to the budget array (needs some reverse engineering and/or documentation work)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4D4 || {{Win32_BOOL}} || &#039;&#039;&#039;bNoDisasters&#039;&#039;&#039; || 0x1000 || Whether or not disasters should be disabled (also disables city council autonomy)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4D8 || WORD || &#039;&#039;&#039;wCityNeighborConnections1000&#039;&#039;&#039; ||  || Count of all $1000 (commercial) neighbor connections (roads)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4E4 || BYTE || &#039;&#039;&#039;bMilitaryBaseType&#039;&#039;&#039; || 0x0EF4 || Military base type (0 = not offered yet, 1 = declined/no location, 2 = army, 3 = air force, 4 = navy, 5 = missile silos)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC8F8 || WORD || &#039;&#039;&#039;wCityResidentialDemand&#039;&#039;&#039; || 0x0718 || Residential demand (-2000 to +2000)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC8FA || WORD || &#039;&#039;&#039;wCityCommericalDemand&#039;&#039;&#039; || 0x071C || Commercial demand (-2000 to +2000)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC8FC || WORD || &#039;&#039;&#039;wCityIndustrialDemand&#039;&#039;&#039; || 0x0720 || Industrial demand (-2000 to +2000)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC910 || DWORD || &#039;&#039;&#039;dwCityPollution&#039;&#039;&#039; ||  || Sum of all Pollution in city.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC918 || WORD || &#039;&#039;&#039;wScenarioDisasterID&#039;&#039;&#039; ||  || ID of the disaster set for the given scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC91A || BYTE || &#039;&#039;&#039;bScenarioDisasterX&#039;&#039;&#039; ||  || X coordinate for preparing the disaster.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC91B || BYTE || &#039;&#039;&#039;bScenarioDisasterY&#039;&#039;&#039; ||  || Y coordinate for preparing the disaster.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC91C || BYTE || &#039;&#039;&#039;wScenarioTimeLimitMonths&#039;&#039;&#039; ||  || Time limit of the scenario in months.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC91E || DWORD || &#039;&#039;&#039;dwScenarioCitySize&#039;&#039;&#039; ||  || Target total population for the scenario exceeded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC922 || DWORD || &#039;&#039;&#039;dwScenarioResPopulation&#039;&#039;&#039; ||  || Target Residential population for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC926 || DWORD || &#039;&#039;&#039;dwScenarioComPopulation&#039;&#039;&#039; ||  || Target Commericial population for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC92A || DWORD || &#039;&#039;&#039;dwScenarioIndPopulation&#039;&#039;&#039; ||  || Target Industrial population for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC92E || DWORD || &#039;&#039;&#039;dwScenarioCashGoal&#039;&#039;&#039; ||  || Cash goal target for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC932 || DWORD || &#039;&#039;&#039;dwScenarioLandValueGoal&#039;&#039;&#039; ||  || Land Value goal target for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC93A || WORD || &#039;&#039;&#039;wScenarioPollutionLimit&#039;&#039;&#039; ||  || Pollution limit for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC93E || WORD || &#039;&#039;&#039;wScenarioCrimeLimit&#039;&#039;&#039; ||  || Crime limit for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC942 || WORD || &#039;&#039;&#039;wScenarioTrafficLimit&#039;&#039;&#039; ||  || Traffic limit for the scenario.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC946 || BYTE || &#039;&#039;&#039;bScenarioBuildingGoal1&#039;&#039;&#039; ||  || Scenario building goal one.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC947 || BYTE || &#039;&#039;&#039;bScenarioBuildingGoal2&#039;&#039;&#039; ||  || Scenario building goal two.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC948 || WORD || &#039;&#039;&#039;wScenarioBuildingGoal1Count&#039;&#039;&#039; ||  || Scenario building goal one count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC94A || WORD || &#039;&#039;&#039;wScenarioBuildingGoal2Count&#039;&#039;&#039; ||  || Scenario building goal two count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC950 || WORD || &#039;&#039;&#039;wSelectedSubtoolBulldozer&#039;&#039;&#039; ||  || Selected Bulldozer mode (Demolish/Clear, Level Terrain, Raise Terrain, Lower Terrain, De-zone)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CDB68 || WORD || &#039;&#039;&#039;wHighlightedTileX&#039;&#039;&#039; ||  || The X coordinate of the tile currently highlighted on the map&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CDB70 || WORD || &#039;&#039;&#039;wHighlightedTileY&#039;&#039;&#039; ||  || The Y coordinate of the tile currently highlighted on the map&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CDB7C || DWORD || &#039;&#039;&#039;dwLFSRState&#039;&#039;&#039; ||  || Randomness state for the linear feedback shift register PRNG&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CDB80 || DWORD || &#039;&#039;&#039;dwLCGState&#039;&#039;&#039; ||  || Randomness state for the linear congruential generator PRNG&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CE8C0 || AFX_CORE_STATE || &#039;&#039;&#039;pCWinApp&#039;&#039;&#039; ||  || Pointer to a CWinApp (needs reverse engineering -- maybe IDA picked this one out on its own?)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Terrain generation variables&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Address|The address of the variable.}} ! {{tooltip|Type|What type this variable is declared as.}} ! {{tooltip|Name|The name of the variable.}} ! {{tooltip|MISC offset|If this variable is stored in the .sc2 MISC chunk, this is where in the chunk it&#039;s stored.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C94C0 || {{Win32_BOOL}} || &#039;&#039;&#039;bCityHasOcean&#039;&#039;&#039; || 0x0E44 || Whether or not the city was generated with an ocean, also determines if City is eligible for Naval Base.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1E0 || WORD || &#039;&#039;&#039;wCityTerrainSliderHills&#039;&#039;&#039; ||  || Slider value for hill coverage during terrain generation&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA818 || __int16 || &#039;&#039;&#039;wWaterLevel&#039;&#039;&#039; || 0x0E40 || Water table level&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAAF8 || WORD || &#039;&#039;&#039;wCityTerrainSliderWater&#039;&#039;&#039; ||  || Slider vvalue for water coverage during terrain generation&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CADD8 || WORD || &#039;&#039;&#039;wCityTerrainSliderTrees&#039;&#039;&#039; ||  || Slider value for tree coverage during terrain generation&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3F8 || {{Win32_BOOL}} || &#039;&#039;&#039;bCityHasRiver&#039;&#039;&#039; || 0x0E48 || Whether or not the city was generated with a river&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
IF YOU&#039;RE READING THIS, HERE&#039;S AN EASY TASK:&lt;br /&gt;
These need to be put into tables. I&#039;m too tired to do it now.&lt;br /&gt;
&lt;br /&gt;
.bss:004CC918     wScenarioDisasterID dw ?                ; DATA XREF: sub_4345C0:loc_434650↑o&lt;br /&gt;
.bss:004CC918                                             ; sub_4345C0:loc_43467E↑o ...&lt;br /&gt;
.bss:004CC91A     bScenarioDisasterX db ?                 ; DATA XREF: sub_4345C0+1D6↑r&lt;br /&gt;
.bss:004CC91B     bScenarioDisasterY db ?                 ; DATA XREF: sub_4345C0+1CB↑r&lt;br /&gt;
.bss:004CC91C     wScenarioTimeLimitMonths dw ?           ; DATA XREF: _SimulationProcessTick+517↑w&lt;br /&gt;
.bss:004CC91C                                             ; sub_4345C0+CB↑o&lt;br /&gt;
.bss:004CC91E     dwScenarioCitySize dd ?                 ; DATA XREF: _SimulationProcessTick+402↑r&lt;br /&gt;
.bss:004CC91E                                             ; sub_4345C0+D8↑r ...&lt;br /&gt;
.bss:004CC922     dwScenarioResPopulation dd ?            ; DATA XREF: _SimulationProcessTick+411↑r&lt;br /&gt;
.bss:004CC922                                             ; sub_4345C0+EB↑r ...&lt;br /&gt;
.bss:004CC926     dwScenarioComPopulation dd ?            ; DATA XREF: _SimulationProcessTick+423↑r&lt;br /&gt;
.bss:004CC926                                             ; sub_4345C0+FE↑r ...&lt;br /&gt;
.bss:004CC92A     dwScenarioIndPopulation dd ?            ; DATA XREF: _SimulationProcessTick+438↑r&lt;br /&gt;
.bss:004CC92A                                             ; sub_4345C0+111↑r ...&lt;br /&gt;
.bss:004CC92E     dwScenarioCashGoal dd ?                 ; DATA XREF: _SimulationProcessTick+455↑r&lt;br /&gt;
.bss:004CC92E                                             ; sub_4345C0+124↑r ...&lt;br /&gt;
.bss:004CC932     dwScenarioLandValueGoal dd ?            ; DATA XREF: _SimulationProcessTick:loc_413981↑r&lt;br /&gt;
.bss:004CC932                                             ; sub_4345C0+137↑r ...&lt;br /&gt;
.bss:004CC936     word_4CC936     dw ?                    ; DATA XREF: _SimulationProcessTick:loc_413992↑r&lt;br /&gt;
.bss:004CC936                                             ; sub_4345C0+14A↑o&lt;br /&gt;
.bss:004CC938     word_4CC938     dw ?                    ; DATA XREF: _SimulationProcessTick:loc_4139A3↑r&lt;br /&gt;
.bss:004CC938                                             ; sub_4345C0+157↑o&lt;br /&gt;
.bss:004CC93A     wScenarioPollutionLimit dd ?            ; DATA XREF: _SimulationProcessTick:loc_4139B4↑r&lt;br /&gt;
.bss:004CC93A                                             ; sub_4345C0+164↑r ...&lt;br /&gt;
.bss:004CC93E     wScenarioCrimeLimit dd ?                ; DATA XREF: _SimulationProcessTick:loc_4139C9↑r&lt;br /&gt;
.bss:004CC93E                                             ; sub_4345C0+177↑r ...&lt;br /&gt;
.bss:004CC942     wScenarioTrafficLimit dd ?              ; DATA XREF: _SimulationProcessTick:loc_4139DE↑r&lt;br /&gt;
.bss:004CC942                                             ; sub_4345C0+18A↑r ...&lt;br /&gt;
.bss:004CC946     bScenarioBuildingGoal1 db ?             ; DATA XREF: _SimulationProcessTick+4D5↑r&lt;br /&gt;
.bss:004CC947     bScenarioBuildingGoal2 db ?             ; DATA XREF: _SimulationProcessTick+4F5↑r&lt;br /&gt;
.bss:004CC948     wScenarioBuildingGoal1Count dw ?        ; DATA XREF: _SimulationProcessTick+4DF↑r&lt;br /&gt;
.bss:004CC948                                             ; sub_4345C0+19D↑o&lt;br /&gt;
.bss:004CC94A     wScenarioBuildingGoal2Count dw ?        ; DATA XREF: _SimulationProcessTick+4FF↑r&lt;br /&gt;
.bss:004CC94A                                             ; sub_4345C0+1AA↑o&lt;br /&gt;
.bss:004CC94C                     align 10h&lt;br /&gt;
.bss:004CC950     ; __int16 wSelectedSubtoolBulldozer[]&lt;br /&gt;
.bss:004CC950     wSelectedSubtoolBulldozer dw ?          ; DATA XREF: sub_406FD0+AC↑r&lt;br /&gt;
.bss:004CC950                                             ; sub_40E250+18C↑w ...&lt;br /&gt;
.bss:004CC952     wSelectedSubtoolNature dw ?             ; DATA XREF: sub_422200+B6↑w&lt;br /&gt;
.bss:004CC952                                             ; sub_442440+74↑r ...&lt;br /&gt;
.bss:004CC954     wSelectedSubtoolDispatch dw ?           ; DATA XREF: sub_422200+D5↑w&lt;br /&gt;
.bss:004CC954                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F2F7↑r ...&lt;br /&gt;
.bss:004CC956     wSelectedSubtoolPower dw ?              ; DATA XREF: sub_422200+F4↑w&lt;br /&gt;
.bss:004CC956                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F336↑r ...&lt;br /&gt;
.bss:004CC958     wSelectedSubtoolWater dw ?              ; DATA XREF: sub_422200+113↑w&lt;br /&gt;
.bss:004CC958                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F3DD↑r ...&lt;br /&gt;
.bss:004CC95A     wSelectedSubtoolRewards dw ?            ; DATA XREF: sub_422200:loc_42231F↑w&lt;br /&gt;
.bss:004CC95A                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F462↑r ...&lt;br /&gt;
.bss:004CC95C     wSelectedSubtoolRoads dw ?              ; DATA XREF: sub_422200+155↑w&lt;br /&gt;
.bss:004CC95C                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F4BF↑r ...&lt;br /&gt;
.bss:004CC95E     wSelectedSubtoolRail dw ?               ; DATA XREF: sub_422200+174↑w&lt;br /&gt;
.bss:004CC95E                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F558↑r ...&lt;br /&gt;
.bss:004CC960     wSelectedSubtoolPorts dw ?              ; DATA XREF: sub_422200+193↑w&lt;br /&gt;
.bss:004CC960                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F60F↑r&lt;br /&gt;
.bss:004CC962     wSelectedSubtoolResidential dw ?        ; DATA XREF: sub_40E250+1B8↑w&lt;br /&gt;
.bss:004CC962                                             ; sub_422200+1B2↑w ...&lt;br /&gt;
.bss:004CC964     wSelectedSubtoolCommercial dw ?         ; DATA XREF: sub_40E250+1C4↑w&lt;br /&gt;
.bss:004CC964                                             ; sub_422200+1D1↑w ...&lt;br /&gt;
.bss:004CC966     wSelectedSubtoolIndustrial dw ?         ; DATA XREF: sub_40E250+1D0↑w&lt;br /&gt;
.bss:004CC966                                             ; sub_422200+1F0↑w ...&lt;br /&gt;
.bss:004CC968     wSelectedSubtoolEducation dw ?          ; DATA XREF: sub_422200+20F↑w&lt;br /&gt;
.bss:004CC968                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F6F7↑r&lt;br /&gt;
.bss:004CC96A     wSelectedSubtoolServices dw ?           ; DATA XREF: sub_422200+22E↑w&lt;br /&gt;
.bss:004CC96A                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F729↑r ...&lt;br /&gt;
.bss:004CC96C     wSelectedSubtoolParks dw ?              ; DATA XREF: sub_422200+24D↑w&lt;br /&gt;
.bss:004CC96C                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F787↑r ...&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Map data pointers&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Address|The address of the variable.}} ! {{tooltip|Type|What type this variable is declared as.}} ! {{tooltip|Name|The name of the variable.}} ! {{tooltip|MISC offset|If this variable is stored in the .sc2 MISC chunk, this is where in the chunk it&#039;s stored.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C9430 || void* || &#039;&#039;&#039;dwMapXPLC&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; for police coverage (1 byte per 4x4 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C9F58 || void* || &#039;&#039;&#039;dwMapXTER&#039;&#039;&#039; ||  || Pointer to a 128x128 map of terrain data (1 byte of type map_XTER_t per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1F0 || void* || &#039;&#039;&#039;dwMapXZON&#039;&#039;&#039; ||  || Pointer to a 128x128 map of zone and corner info (1 byte of type map_XZON_t per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3EC || void* || &#039;&#039;&#039;dwMapXMIC&#039;&#039;&#039; ||  || Pointer to an array of type map_XMIC_t[150] containing MicroSim data.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA198 || void* || &#039;&#039;&#039;dwMapXLAB&#039;&#039;&#039; ||  || Pointer to an array of type map_XLAB_t[256].&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA434 || void* || &#039;&#039;&#039;dwMapXTHG&#039;&#039;&#039; ||  || Pointer to an array of type map_XTHG_t[256] containing [[Thing]]s&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA448 || void* || &#039;&#039;&#039;dwMapXPOP&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; for population density (1 byte per 4x4 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA4D8 || void* || &#039;&#039;&#039;dwMapXCRM&#039;&#039;&#039; ||  || Pointer to a 64x64 &amp;quot;minimap&amp;quot; for crime (1 byte per 2x2 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA600 || void* || &#039;&#039;&#039;dwMapXTXT&#039;&#039;&#039; ||  || Pointer to a 128x128 map of [[XTXT]] IDs (1 byte per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA828 || void* || &#039;&#039;&#039;dwMapXPLT&#039;&#039;&#039; ||  || Pointer to a 64x64 &amp;quot;minimap&amp;quot; for pollution (1 byte per 2x2 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA940 || void* || &#039;&#039;&#039;dwMapXTRF&#039;&#039;&#039; ||  || Pointer to a 64x64 &amp;quot;minimap&amp;quot; for traffic (1 byte per 2x2 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAA78 || void* || &#039;&#039;&#039;dwMapXFIR&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; for fire coverage (1 byte per 4x4 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAB10 || void* || &#039;&#039;&#039;dwMapXBIT&#039;&#039;&#039; ||  || Pointer to a 128x128 map of tile flags (1 byte of type map_XBIT_t per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAE10 || void* || &#039;&#039;&#039;dwMapALTM&#039;&#039;&#039; ||  || Pointer to a 128x128 map of altitude data (1 byte of type map_ALTM_t per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB028 || void* || &#039;&#039;&#039;dwMapXROG&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; of rate of growth data (1 byte of unknown type per 4x4 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB0A8 || void* || &#039;&#039;&#039;dwMapXVAL&#039;&#039;&#039; ||  || Pointer to a 64x64 &amp;quot;minimap&amp;quot; of land value (1 byte of &amp;lt;code&amp;gt;(full value / 1000 - 1)&amp;lt;/code&amp;gt; per 2x2 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB1D0 || void* || &#039;&#039;&#039;dwMapXUND&#039;&#039;&#039; ||  || Pointer to a 128x128 map of underground map data (1 byte of type map_XUND_t per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC470 || void* || &#039;&#039;&#039;dwMapXGRP&#039;&#039;&#039; ||  || Pointer to the historical graph data&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4F0 || void* || &#039;&#039;&#039;dwMapXBLD&#039;&#039;&#039; ||  || Pointer to a 128x128 map of tile IDs (1 byte of type enumTileID per tile)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Simulation Arrays&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Address|The address of the variable.}} ! {{tooltip|Type|What type this variable is declared as.}} ! {{tooltip|Name|The name of the array.}} ! {{tooltip|MISC offset|If this variable is stored in the .sc2 MISC chunk, this is where in the chunk it&#039;s stored.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 004C94B4 || void* || &#039;&#039;&#039;pRawPopTable&#039;&#039;&#039; ||  || Pointer to 20-item array for the Population Table&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAA70 || void* || &#039;&#039;&#039;pLETable&#039;&#039;&#039; ||  || Pointer to 20-item array for the LE Table, these are as aggregate sums for the entire age group (LE/RawPop=AgeGroupLE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C94BC || void* || &#039;&#039;&#039;pEQTable&#039;&#039;&#039; ||  || Pointer to 20-item array for the EQ Table, these are as aggregate sums for the entire age group (EQ/RawPop=AgeGroupEQ).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3F0 || void* || &#039;&#039;&#039;pIndividualIndPops&#039;&#039;&#039; ||  || Pointer to 11-item array for the Raw Populations for City Industries Table.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3E0 || void* || &#039;&#039;&#039;pIndividualIndTaxRate&#039;&#039;&#039; ||  || Pointer to 11-item array for the each of the Industrial Group&#039;s Tax Rates.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA3F4 || void* || &#039;&#039;&#039;pIndividualIndDemands&#039;&#039;&#039; ||  || Pointer to 11-item array for the each of the Industrial Group&#039;s current Demand.&lt;br /&gt;
|}&lt;br /&gt;
[[Category:Game data]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Known_global_variables&amp;diff=645</id>
		<title>Known global variables</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Known_global_variables&amp;diff=645"/>
		<updated>2025-03-12T01:53:19Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Heavy construction}}&lt;br /&gt;
&lt;br /&gt;
This is a table of global variables in SimCity 2000 that have been at least partially reverse engineered and given names. It is probably going to be unpleasant to update, but at least it looks nice and you can sort it.&lt;br /&gt;
&lt;br /&gt;
Data about where in the MISC chunk certain variables are located is from dfloer&#039;s sc2k-docs repository on GitHub (CC BY-SA 4.0).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Uncategorized variables&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Address|The address of the variable.}} ! {{tooltip|Type|What type this variable is declared as.}} ! {{tooltip|Name|The name of the variable.}} ! {{tooltip|MISC offset|If this variable is stored in the .sc2 MISC chunk, this is where in the chunk it&#039;s stored.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C702C || CWnd* || &#039;&#039;&#039;pCwndMainWindow&#039;&#039;&#039; ||  || Pointer to the MFC CWnd class for the &amp;quot;root window&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
| 0x4C7104 || {{Win32_BOOL}} || &#039;&#039;&#039;bPriscillaActivated&#039;&#039;&#039; ||  || Whether or not the debug menu has been activated&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C71F0 || {{Win32_BOOL}} || &#039;&#039;&#039;bOptionsMusicEnabled&#039;&#039;&#039; || 0x0FFC || Whether or not music is enabled&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C7318 || WORD || &#039;&#039;&#039;wSimulationSpeed&#039;&#039;&#039; || 0x0FEC || 1-5 for Paused through African Swallow&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C9428 || WORD || &#039;&#039;&#039;wIndustrialMixPollutionBonus&#039;&#039;&#039; ||  || -1 to 2 used to calculate the map wide Pollution Divisor&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C942C || WORD || &#039;&#039;&#039;wViewRotation&#039;&#039;&#039; || 0x0008 || 0 = north, 1 = west, 2 = south, 3 = east&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C94C4 || DWORD || &#039;&#039;&#039;dwArcologyPopulation&#039;&#039;&#039; || 0x1020 || Population of the city specifically in arcologies&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1A0 || char* || &#039;&#039;&#039;pszCityName&#039;&#039;&#039; ||   || Pointer to the city name, loaded/saved as the CNAM chunk&lt;br /&gt;
|- &lt;br /&gt;
| 0x4CA1BC || WORD || &#039;&#039;&#039;wNationalEconomyTrend&#039;&#039;&#039; || 0x005C || Affects interest rates, apparently&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1E8 || WORD || &#039;&#039;&#039;wIndustrialMixBonus&#039;&#039;&#039; ||  || This is used in RCI demand generation as a bonus (cities dominated by 1 industry receive growth bonuses)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1DC || WORD || &#039;&#039;&#039;wPrisonBonus&#039;&#039;&#039; ||  || This sets if power stations get increased Police power from Prisons.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA3F0 || WORD || &#039;&#039;&#039;wCityNeighborConnections1500&#039;&#039;&#039; ||  || Count of all $1500 (industrial) neighbor connections (railroad, highways)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA41C || WORD || &#039;&#039;&#039;wSubwayXUNDCount&#039;&#039;&#039; || 0x0FE8 || Seems to be mostly used for budget calculations&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA420 || WORD || &#039;&#039;&#039;wDisasterType&#039;&#039;&#039; || 0x0070 || The ID of the next disaster to occur&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA42C || WORD || &#039;&#039;&#039;wCityMode&#039;&#039;&#039; || 0x0004 || 0 = map editor, 1 = regular gameplay, 2 = scenario mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA440 || int || &#039;&#039;&#039;dwCityLandValue&#039;&#039;&#039; || 0x0028 || Sum of all values in XVAL&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA444 || int || &#039;&#039;&#039;dwCityFunds&#039;&#039;&#039; || 0x0014 || How much money the city has&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA4C8 || WORD* || &#039;&#039;&#039;dwTileCount&#039;&#039;&#039; ||  || Pointer to an array of tile counts for every valid iTileID&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA4D0 || DWORD || &#039;&#039;&#039;dwCityValue&#039;&#039;&#039; || 0x0024 || Appears to have something to do with bond interest rates&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA5F4 || WORD || &#039;&#039;&#039;wCityStartYear&#039;&#039;&#039; || 0x000C || The year the city was founded&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA81C || WORD || &#039;&#039;&#039;wMonsterXTHGIndex&#039;&#039;&#039; ||  || Which XTHG entry the monster&#039;s [[Thing]] is&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA928 || DWORD || &#039;&#039;&#039;dwNationalPopulation&#039;&#039;&#039; || 0x0050 || Population of SimNation&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA934 || WORD* || &#039;&#039;&#039;dwMilitaryTiles&#039;&#039;&#039; ||  || Pointer to the beginning of the military tiles in the dwTileCount array&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA938 || WORD || &#039;&#039;&#039;wNationalTax&#039;&#039;&#039; || 0x0058 || The national base tax rate or the &amp;quot;fed rate&amp;quot;, for calculating bond interest rates&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAA40 || DWORD || &#039;&#039;&#039;dwCityOrdinances&#039;&#039;&#039; || 0x0FA0 || Flags for which city ordinances are enacted&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAA50 || DWORD || &#039;&#039;&#039;dwPowerUsedPercentage&#039;&#039;&#039; ||  || Percentage of power capacity in use&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAA74 || DWORD || &#039;&#039;&#039;dwCityPopulation&#039;&#039;&#039; || 0x102C || Total city population, excluding arcologies&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAD2C || {{Win32_BOOL}} || &#039;&#039;&#039;bYearEndFlag&#039;&#039;&#039; || 0x0E3C || Whether or not the first of the month is the start of a new year&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAD44 || {{Win32_BOOL}} || &#039;&#039;&#039;bInScenario&#039;&#039;&#039; ||  || Whether or not this game is a scenario&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAD58 || neighbor_city_t[4] || &#039;&#039;&#039;stNeighborCities&#039;&#039;&#039; || 0x06D8 || Array of four neighbor cities (32 bytes each), clockwise from bottom left&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CADE0 || BYTE || &#039;&#039;&#039;bWeatherHeat&#039;&#039;&#039; || 0x0060 || Weather heat level&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAE04 || DWORD || &#039;&#039;&#039;dwCityDays&#039;&#039;&#039; || 0x0010 || How many days have elapsed since the city was founded&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAE0C || BYTE || &#039;&#039;&#039;bWeatherWind&#039;&#039;&#039; || 0x0064 || Weather wind speed&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB010 || WORD || &#039;&#039;&#039;wCityProgression&#039;&#039;&#039; || 0x0078 || Flags for city reward progression&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB014 || DWORD || &#039;&#039;&#039;dwNationalValue&#039;&#039;&#039; || 0x0054 || Gross National Product&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB018 || DWORD || &#039;&#039;&#039;dwCityAdvertising&#039;&#039;&#039; || 0x003C || City advertising effects (unknown what this actually does)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB01C || WORD || &#039;&#039;&#039;wCityCurrentMonth&#039;&#039;&#039; ||  || Which month of the year it is (0-indexed; calculated from dwCityDays)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB020 || WORD || &#039;&#039;&#039;wCityElapsedYears&#039;&#039;&#039; ||  || Years since the city was founded (calculated from dwCityDays)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB1B8 || void* || &#039;&#039;&#039;pArrSpriteHeaders&#039;&#039;&#039; ||  || Pointer to the array of loaded sprite headers&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3D0 || {{Win32_BOOL}} || &#039;&#039;&#039;bNewspaperSubscription&#039;&#039;&#039; || 0x1004 || Whether or not the Subscription newspaper is checked&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3D4 || BYTE || &#039;&#039;&#039;bWeatherHumidity&#039;&#039;&#039; || 0x0068 || Weather humidity value&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3DC || WORD || &#039;&#039;&#039;wSewerBonus&#039;&#039;&#039; ||  || Whether the city has adequate wastewater treatment facilities for use in the Pollution Divisor&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3E8 || WORD || &#039;&#039;&#039;wCityCurrentSeason&#039;&#039;&#039; ||  || Which season it is (0 = winter, 1 = spring, 2 = summer, 3 = autumn; calculated from dwCityDays)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB38C || microsim_t* || &#039;&#039;&#039;dwMicroSimArr&#039;&#039;&#039; ||  || Pointer to the array of [[microsim]]s&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB404 || WORD || &#039;&#039;&#039;wCityDifficulty&#039;&#039;&#039; || 0x001C || Game difficulty (0 = no city founded, 1 = easy, 2 = medium, 3 = hard)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB40C || BYTE || &#039;&#039;&#039;bWeatherTrend&#039;&#039;&#039; || 0x006C || What the current weather type is&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB430 || WORD[17] || &#039;&#039;&#039;wCityInventionYears&#039;&#039;&#039; || 0x0738 || What years different technologies are invented in&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB454 || DWORD || &#039;&#039;&#039;dwCityCrime&#039;&#039;&#039; || 0x002C || Sum of all values in XCRM&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB464 || WORD || &#039;&#039;&#039;wCurrentToolGroup&#039;&#039;&#039; ||  || Currently selected tool group&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4B8 || DWORD || &#039;&#039;&#039;dwWaterUsedPercentage&#039;&#039;&#039; ||  || Percentage of water capacity in use&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4BC || {{Win32_BOOL}} || &#039;&#039;&#039;bNewspaperExtra&#039;&#039;&#039; || 0x1008 || Whether or not the Extra!!! newspaper is checked&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4CC || void* || &#039;&#039;&#039;dwBudgetArr&#039;&#039;&#039; ||  || Pointer to the budget array (needs some reverse engineering and/or documentation work)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4D4 || {{Win32_BOOL}} || &#039;&#039;&#039;bNoDisasters&#039;&#039;&#039; || 0x1000 || Whether or not disasters should be disabled (also disables city council autonomy)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4D8 || WORD || &#039;&#039;&#039;wCityNeighborConnections1000&#039;&#039;&#039; ||  || Count of all $1000 (commercial) neighbor connections (roads)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4E4 || BYTE || &#039;&#039;&#039;bMilitaryBaseType&#039;&#039;&#039; || 0x0EF4 || Military base type (0 = not offered yet, 1 = declined/no location, 2 = army, 3 = air force, 4 = navy, 5 = missile silos)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC8F8 || WORD || &#039;&#039;&#039;wCityResidentialDemand&#039;&#039;&#039; || 0x0718 || Residential demand (-2000 to +2000)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC8FA || WORD || &#039;&#039;&#039;wCityCommericalDemand&#039;&#039;&#039; || 0x071C || Commercial demand (-2000 to +2000)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC8FC || WORD || &#039;&#039;&#039;wCityIndustrialDemand&#039;&#039;&#039; || 0x0720 || Industrial demand (-2000 to +2000)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC910 || DWORD || &#039;&#039;&#039;dwCityPollution&#039;&#039;&#039; ||  || Sum of all Pollution in city.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CDB68 || WORD || &#039;&#039;&#039;wHighlightedTileX&#039;&#039;&#039; ||  || The X coordinate of the tile currently highlighted on the map&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CDB70 || WORD || &#039;&#039;&#039;wHighlightedTileY&#039;&#039;&#039; ||  || The Y coordinate of the tile currently highlighted on the map&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CDB7C || DWORD || &#039;&#039;&#039;dwLFSRState&#039;&#039;&#039; ||  || Randomness state for the linear feedback shift register PRNG&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CDB80 || DWORD || &#039;&#039;&#039;dwLCGState&#039;&#039;&#039; ||  || Randomness state for the linear congruential generator PRNG&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CE8C0 || AFX_CORE_STATE || &#039;&#039;&#039;pCWinApp&#039;&#039;&#039; ||  || Pointer to a CWinApp (needs reverse engineering -- maybe IDA picked this one out on its own?)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Terrain generation variables&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Address|The address of the variable.}} ! {{tooltip|Type|What type this variable is declared as.}} ! {{tooltip|Name|The name of the variable.}} ! {{tooltip|MISC offset|If this variable is stored in the .sc2 MISC chunk, this is where in the chunk it&#039;s stored.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C94C0 || {{Win32_BOOL}} || &#039;&#039;&#039;bCityHasOcean&#039;&#039;&#039; || 0x0E44 || Whether or not the city was generated with an ocean&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1E0 || WORD || &#039;&#039;&#039;wCityTerrainSliderHills&#039;&#039;&#039; ||  || Slider value for hill coverage during terrain generation&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA818 || __int16 || &#039;&#039;&#039;wWaterLevel&#039;&#039;&#039; || 0x0E40 || Water table level&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAAF8 || WORD || &#039;&#039;&#039;wCityTerrainSliderWater&#039;&#039;&#039; ||  || Slider vvalue for water coverage during terrain generation&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CADD8 || WORD || &#039;&#039;&#039;wCityTerrainSliderTrees&#039;&#039;&#039; ||  || Slider value for tree coverage during terrain generation&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3F8 || {{Win32_BOOL}} || &#039;&#039;&#039;bCityHasRiver&#039;&#039;&#039; || 0x0E48 || Whether or not the city was generated with a river&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
IF YOU&#039;RE READING THIS, HERE&#039;S AN EASY TASK:&lt;br /&gt;
These need to be put into tables. I&#039;m too tired to do it now.&lt;br /&gt;
&lt;br /&gt;
.bss:004CC918     wScenarioDisasterID dw ?                ; DATA XREF: sub_4345C0:loc_434650↑o&lt;br /&gt;
.bss:004CC918                                             ; sub_4345C0:loc_43467E↑o ...&lt;br /&gt;
.bss:004CC91A     bScenarioDisasterX db ?                 ; DATA XREF: sub_4345C0+1D6↑r&lt;br /&gt;
.bss:004CC91B     bScenarioDisasterY db ?                 ; DATA XREF: sub_4345C0+1CB↑r&lt;br /&gt;
.bss:004CC91C     wScenarioTimeLimitMonths dw ?           ; DATA XREF: _SimulationProcessTick+517↑w&lt;br /&gt;
.bss:004CC91C                                             ; sub_4345C0+CB↑o&lt;br /&gt;
.bss:004CC91E     dwScenarioCitySize dd ?                 ; DATA XREF: _SimulationProcessTick+402↑r&lt;br /&gt;
.bss:004CC91E                                             ; sub_4345C0+D8↑r ...&lt;br /&gt;
.bss:004CC922     dwScenarioResPopulation dd ?            ; DATA XREF: _SimulationProcessTick+411↑r&lt;br /&gt;
.bss:004CC922                                             ; sub_4345C0+EB↑r ...&lt;br /&gt;
.bss:004CC926     dwScenarioComPopulation dd ?            ; DATA XREF: _SimulationProcessTick+423↑r&lt;br /&gt;
.bss:004CC926                                             ; sub_4345C0+FE↑r ...&lt;br /&gt;
.bss:004CC92A     dwScenarioIndPopulation dd ?            ; DATA XREF: _SimulationProcessTick+438↑r&lt;br /&gt;
.bss:004CC92A                                             ; sub_4345C0+111↑r ...&lt;br /&gt;
.bss:004CC92E     dwScenarioCashGoal dd ?                 ; DATA XREF: _SimulationProcessTick+455↑r&lt;br /&gt;
.bss:004CC92E                                             ; sub_4345C0+124↑r ...&lt;br /&gt;
.bss:004CC932     dwScenarioLandValueGoal dd ?            ; DATA XREF: _SimulationProcessTick:loc_413981↑r&lt;br /&gt;
.bss:004CC932                                             ; sub_4345C0+137↑r ...&lt;br /&gt;
.bss:004CC936     word_4CC936     dw ?                    ; DATA XREF: _SimulationProcessTick:loc_413992↑r&lt;br /&gt;
.bss:004CC936                                             ; sub_4345C0+14A↑o&lt;br /&gt;
.bss:004CC938     word_4CC938     dw ?                    ; DATA XREF: _SimulationProcessTick:loc_4139A3↑r&lt;br /&gt;
.bss:004CC938                                             ; sub_4345C0+157↑o&lt;br /&gt;
.bss:004CC93A     wScenarioPollutionLimit dd ?            ; DATA XREF: _SimulationProcessTick:loc_4139B4↑r&lt;br /&gt;
.bss:004CC93A                                             ; sub_4345C0+164↑r ...&lt;br /&gt;
.bss:004CC93E     wScenarioCrimeLimit dd ?                ; DATA XREF: _SimulationProcessTick:loc_4139C9↑r&lt;br /&gt;
.bss:004CC93E                                             ; sub_4345C0+177↑r ...&lt;br /&gt;
.bss:004CC942     wScenarioTrafficLimit dd ?              ; DATA XREF: _SimulationProcessTick:loc_4139DE↑r&lt;br /&gt;
.bss:004CC942                                             ; sub_4345C0+18A↑r ...&lt;br /&gt;
.bss:004CC946     bScenarioBuildingGoal1 db ?             ; DATA XREF: _SimulationProcessTick+4D5↑r&lt;br /&gt;
.bss:004CC947     bScenarioBuildingGoal2 db ?             ; DATA XREF: _SimulationProcessTick+4F5↑r&lt;br /&gt;
.bss:004CC948     wScenarioBuildingGoal1Count dw ?        ; DATA XREF: _SimulationProcessTick+4DF↑r&lt;br /&gt;
.bss:004CC948                                             ; sub_4345C0+19D↑o&lt;br /&gt;
.bss:004CC94A     wScenarioBuildingGoal2Count dw ?        ; DATA XREF: _SimulationProcessTick+4FF↑r&lt;br /&gt;
.bss:004CC94A                                             ; sub_4345C0+1AA↑o&lt;br /&gt;
.bss:004CC94C                     align 10h&lt;br /&gt;
.bss:004CC950     ; __int16 wSelectedSubtoolBulldozer[]&lt;br /&gt;
.bss:004CC950     wSelectedSubtoolBulldozer dw ?          ; DATA XREF: sub_406FD0+AC↑r&lt;br /&gt;
.bss:004CC950                                             ; sub_40E250+18C↑w ...&lt;br /&gt;
.bss:004CC952     wSelectedSubtoolNature dw ?             ; DATA XREF: sub_422200+B6↑w&lt;br /&gt;
.bss:004CC952                                             ; sub_442440+74↑r ...&lt;br /&gt;
.bss:004CC954     wSelectedSubtoolDispatch dw ?           ; DATA XREF: sub_422200+D5↑w&lt;br /&gt;
.bss:004CC954                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F2F7↑r ...&lt;br /&gt;
.bss:004CC956     wSelectedSubtoolPower dw ?              ; DATA XREF: sub_422200+F4↑w&lt;br /&gt;
.bss:004CC956                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F336↑r ...&lt;br /&gt;
.bss:004CC958     wSelectedSubtoolWater dw ?              ; DATA XREF: sub_422200+113↑w&lt;br /&gt;
.bss:004CC958                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F3DD↑r ...&lt;br /&gt;
.bss:004CC95A     wSelectedSubtoolRewards dw ?            ; DATA XREF: sub_422200:loc_42231F↑w&lt;br /&gt;
.bss:004CC95A                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F462↑r ...&lt;br /&gt;
.bss:004CC95C     wSelectedSubtoolRoads dw ?              ; DATA XREF: sub_422200+155↑w&lt;br /&gt;
.bss:004CC95C                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F4BF↑r ...&lt;br /&gt;
.bss:004CC95E     wSelectedSubtoolRail dw ?               ; DATA XREF: sub_422200+174↑w&lt;br /&gt;
.bss:004CC95E                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F558↑r ...&lt;br /&gt;
.bss:004CC960     wSelectedSubtoolPorts dw ?              ; DATA XREF: sub_422200+193↑w&lt;br /&gt;
.bss:004CC960                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F60F↑r&lt;br /&gt;
.bss:004CC962     wSelectedSubtoolResidential dw ?        ; DATA XREF: sub_40E250+1B8↑w&lt;br /&gt;
.bss:004CC962                                             ; sub_422200+1B2↑w ...&lt;br /&gt;
.bss:004CC964     wSelectedSubtoolCommercial dw ?         ; DATA XREF: sub_40E250+1C4↑w&lt;br /&gt;
.bss:004CC964                                             ; sub_422200+1D1↑w ...&lt;br /&gt;
.bss:004CC966     wSelectedSubtoolIndustrial dw ?         ; DATA XREF: sub_40E250+1D0↑w&lt;br /&gt;
.bss:004CC966                                             ; sub_422200+1F0↑w ...&lt;br /&gt;
.bss:004CC968     wSelectedSubtoolEducation dw ?          ; DATA XREF: sub_422200+20F↑w&lt;br /&gt;
.bss:004CC968                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F6F7↑r&lt;br /&gt;
.bss:004CC96A     wSelectedSubtoolServices dw ?           ; DATA XREF: sub_422200+22E↑w&lt;br /&gt;
.bss:004CC96A                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F729↑r ...&lt;br /&gt;
.bss:004CC96C     wSelectedSubtoolParks dw ?              ; DATA XREF: sub_422200+24D↑w&lt;br /&gt;
.bss:004CC96C                                             ; _CSimCityView_DoLeftMouseCityMode:loc_43F787↑r ...&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Map data pointers&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Address|The address of the variable.}} ! {{tooltip|Type|What type this variable is declared as.}} ! {{tooltip|Name|The name of the variable.}} ! {{tooltip|MISC offset|If this variable is stored in the .sc2 MISC chunk, this is where in the chunk it&#039;s stored.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C9430 || void* || &#039;&#039;&#039;dwMapXPLC&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; for police coverage (1 byte per 4x4 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C9F58 || void* || &#039;&#039;&#039;dwMapXTER&#039;&#039;&#039; ||  || Pointer to a 128x128 map of terrain data (1 byte of type map_XTER_t per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA1F0 || void* || &#039;&#039;&#039;dwMapXZON&#039;&#039;&#039; ||  || Pointer to a 128x128 map of zone and corner info (1 byte of type map_XZON_t per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3EC || void* || &#039;&#039;&#039;dwMapXMIC&#039;&#039;&#039; ||  || Pointer to an array of type map_XMIC_t[150] containing MicroSim data.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA198 || void* || &#039;&#039;&#039;dwMapXLAB&#039;&#039;&#039; ||  || Pointer to an array of type map_XLAB_t[256].&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA434 || void* || &#039;&#039;&#039;dwMapXTHG&#039;&#039;&#039; ||  || Pointer to an array of type map_XTHG_t[256] containing [[Thing]]s&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA448 || void* || &#039;&#039;&#039;dwMapXPOP&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; for population density (1 byte per 4x4 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA4D8 || void* || &#039;&#039;&#039;dwMapXCRM&#039;&#039;&#039; ||  || Pointer to a 64x64 &amp;quot;minimap&amp;quot; for crime (1 byte per 2x2 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA600 || void* || &#039;&#039;&#039;dwMapXTXT&#039;&#039;&#039; ||  || Pointer to a 128x128 map of [[XTXT]] IDs (1 byte per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA828 || void* || &#039;&#039;&#039;dwMapXPLT&#039;&#039;&#039; ||  || Pointer to a 64x64 &amp;quot;minimap&amp;quot; for pollution (1 byte per 2x2 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA940 || void* || &#039;&#039;&#039;dwMapXTRF&#039;&#039;&#039; ||  || Pointer to a 64x64 &amp;quot;minimap&amp;quot; for traffic (1 byte per 2x2 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAA78 || void* || &#039;&#039;&#039;dwMapXFIR&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; for fire coverage (1 byte per 4x4 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAB10 || void* || &#039;&#039;&#039;dwMapXBIT&#039;&#039;&#039; ||  || Pointer to a 128x128 map of tile flags (1 byte of type map_XBIT_t per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAE10 || void* || &#039;&#039;&#039;dwMapALTM&#039;&#039;&#039; ||  || Pointer to a 128x128 map of altitude data (1 byte of type map_ALTM_t per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB028 || void* || &#039;&#039;&#039;dwMapXROG&#039;&#039;&#039; ||  || Pointer to a 32x32 &amp;quot;minimap&amp;quot; of rate of growth data (1 byte of unknown type per 4x4 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB0A8 || void* || &#039;&#039;&#039;dwMapXVAL&#039;&#039;&#039; ||  || Pointer to a 64x64 &amp;quot;minimap&amp;quot; of land value (1 byte of &amp;lt;code&amp;gt;(full value / 1000 - 1)&amp;lt;/code&amp;gt; per 2x2 block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB1D0 || void* || &#039;&#039;&#039;dwMapXUND&#039;&#039;&#039; ||  || Pointer to a 128x128 map of underground map data (1 byte of type map_XUND_t per tile)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC470 || void* || &#039;&#039;&#039;dwMapXGRP&#039;&#039;&#039; ||  || Pointer to the historical graph data&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CC4F0 || void* || &#039;&#039;&#039;dwMapXBLD&#039;&#039;&#039; ||  || Pointer to a 128x128 map of tile IDs (1 byte of type enumTileID per tile)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Simulation Arrays&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Address|The address of the variable.}} ! {{tooltip|Type|What type this variable is declared as.}} ! {{tooltip|Name|The name of the array.}} ! {{tooltip|MISC offset|If this variable is stored in the .sc2 MISC chunk, this is where in the chunk it&#039;s stored.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 004C94B4 || void* || &#039;&#039;&#039;pRawPopTable&#039;&#039;&#039; ||  || Pointer to 20-item array for the Population Table&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CAA70 || void* || &#039;&#039;&#039;pLETable&#039;&#039;&#039; ||  || Pointer to 20-item array for the LE Table, these are as aggregate sums for the entire age group (LE/RawPop=AgeGroupLE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C94BC || void* || &#039;&#039;&#039;pEQTable&#039;&#039;&#039; ||  || Pointer to 20-item array for the EQ Table, these are as aggregate sums for the entire age group (EQ/RawPop=AgeGroupEQ).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3F0 || void* || &#039;&#039;&#039;pIndividualIndPops&#039;&#039;&#039; ||  || Pointer to 11-item array for the Raw Populations for City Industries Table.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CB3E0 || void* || &#039;&#039;&#039;pIndividualIndTaxRate&#039;&#039;&#039; ||  || Pointer to 11-item array for the each of the Industrial Group&#039;s Tax Rates.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CA3F4 || void* || &#039;&#039;&#039;pIndividualIndDemands&#039;&#039;&#039; ||  || Pointer to 11-item array for the each of the Industrial Group&#039;s current Demand.&lt;br /&gt;
|}&lt;br /&gt;
[[Category:Game data]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Function_list&amp;diff=644</id>
		<title>Function list</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Function_list&amp;diff=644"/>
		<updated>2025-03-12T01:50:16Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Heavy construction}}&lt;br /&gt;
&lt;br /&gt;
This is a table of functions in SimCity 2000 that have been at least partially reverse engineered and given names. It is probably going to be unpleasant to update, but at least it looks nice and you can sort it.&lt;br /&gt;
&lt;br /&gt;
When adding new functions to the table, please make sure you insert them into the appropriate order by thunk address (the function that just has a &amp;lt;code&amp;gt;jmp &#039;&#039;&#039;ActualFunctionBody&#039;&#039;&#039;&amp;lt;/code&amp;gt; instruction in it). If/when it gets too unwieldy we can split it out into multiple tables.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Uncategorized functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401262 || 0x468D30 || int || __stdcall || &#039;&#039;&#039;[[SimulationEQ_LE_Processing]]&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 22? || Handles EQ and LE simulation for the month.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40130C || 0x45F760 || {{Win32_BOOL}} || __stdcall || &#039;&#039;&#039;SimulationDoDisasterTick&#039;&#039;&#039; ||  || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x4013ED || 0x42BCA0 || int || __cdecl || &#039;&#039;&#039;SimulationCalculateOrdinanceCost&#039;&#039;&#039; || DWORD dwOrdinance || {{Mostly understood}} ||  || Returns the effective cost of an ordinance&lt;br /&gt;
|-&lt;br /&gt;
| 0x4015E6 || 0x4731E0 || int || __cdecl || &#039;&#039;&#039;SimulationPrepareBudgetDialog&#039;&#039;&#039; || int a1 || {{Mostly understood}} ||  || arg a1 only referenced on line, seems to be more like &amp;quot;BOOL bUseParentWindow&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401672 || 0x441E50 || int || __cdecl || &#039;&#039;&#039;SimulationGrantReward&#039;&#039;&#039; || __int16 iRewardID, BOOL bAddReward || {{Mostly understood}} ||  || Adds a city progression reward if (bAddReward), removes it if (!bAddReward).&lt;br /&gt;
|-&lt;br /&gt;
| 0x40174E || 0x42B4D0 || int || __cdecl || &#039;&#039;&#039;SimulationPrepareDisaster&#039;&#039;&#039; || DWORD *a1, __int16 a2, __int16 a3 || {{Somewhat understood}} ||  || Seems to prepare the starting location for disasters.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401820 || 0x413520 || void || __stdcall || &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; ||  || {{Mostly understood}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; based on game speed || Advances the calendar date and performs all appropriate daily/monthly/etc. tasks. May need better name?&lt;br /&gt;
|-&lt;br /&gt;
| 0x4019EC || 0x4412E0 || int || __cdecl || &#039;&#039;&#039;CenterOnTileCoords&#039;&#039;&#039; || __int16 iTileX, __int16 iTileY || {{Somewhat understood}} || Called from the centering tool and anywhere that needs to center the display || &lt;br /&gt;
|-&lt;br /&gt;
| 0x401CA8 || 0x464550 || int || __stdcall || &#039;&#039;&#039;SimulationUpdateWaterConsumption&#039;&#039;&#039; ||  || {{Barely explored}} || Called whenever tiles are placed and on &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 2 || Vanilla SC2K doesn&#039;t call this when tiles are placed on cities over 50,000 pop.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401E65 || 0x471BC0 || char || __stdcall || &#039;&#039;&#039;SimulationDetermineCityCrisis&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called on the last day of the month and from &#039;&#039;sub_406A50&#039;&#039; || Changes the city status line if there&#039;s a new demand, and also starts disasters.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40217B || 0x468150 || int || __stdcall || &#039;&#039;&#039;[[SimulationRCIDemandUpdates]]&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 22? || Handles all RCI bar updates for &amp;quot;zone balance&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4022FC || 0x4358B0 || int || __cdecl || &#039;&#039;&#039;SimulationGrowthTick&#039;&#039;&#039; || __int16 a1, __int16 a2 || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; on days 4-17 || The arguments and algorithms are not yet understood.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402527 || 0x45CF10 || int || __stdcall || &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; || Calls the appropriate disaster creation function and then runs disaster ticks&lt;br /&gt;
|-&lt;br /&gt;
| 0x4026B2 || 0x4734A0 || int || __usercall || &#039;&#039;&#039;SimulationGrowSpecificZone&#039;&#039;&#039; || int a1@&amp;lt;ebp&amp;gt;, __int16 iX, __int16 iY, __int16 iTileID, __int16 iZoneType || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationGrowthTick&#039;&#039;&#039; || Might be an omit-frame-pointer function?&lt;br /&gt;
|-&lt;br /&gt;
| 0x4026F8 || 0x467860 || int || __stdcall || &#039;&#039;&#039;SimulationUpdatePowerConsumption&#039;&#039;&#039; ||  || {{Barely explored}} || Called whenever tiles are placed and on &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 21 || Vanilla SC2K doesn&#039;t call this when tiles are placed on cities over 50,000 pop.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402A3B || 0x405AB0 || DWORD || __thiscall || &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; || CWinApp* this || {{Somewhat understood}} || Called from &#039;&#039;&#039;CWinApp::OnIdle&#039;&#039;&#039; via the class CWinApp vtable || Could stand to have a better name.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402A9F || 0x40C100 || __int16 || __tstdcall || &#039;&#039;&#039;SimulationProcessTimer&#039;&#039;&#039; ||  || {{Mostly understood}} || Called from the root window&#039;s AFX_MSGMAP to handle WM_TIMER messages ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x402D2E || 0x4734A0 || __int16 || __stdcall || &#039;&#039;&#039;SimulationCalculateBudgetUpdates&#039;&#039;&#039; ||  || {{Barely explored}} ||  || 00&lt;br /&gt;
|-&lt;br /&gt;
| 0x403017 || 0x4142C0 || int || __stdcall || &#039;&#039;&#039;SimulationProposeMilitaryBase&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; on day 23 and from &amp;quot;gilmartin&amp;quot; cheat || &lt;br /&gt;
|-&lt;br /&gt;
| 0x401154 || 0x46A840 || int || __stdcall || &#039;&#039;&#039;[[SimulationLandValueMapCalc]]&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; on day 3 || This is where the land value and pollution simulator lives.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4025A4 || 0x4302E0 || int || __thiscall || &#039;&#039;&#039;LoadSegmentsFromSavedCity&#039;&#039;&#039; || void *this, int *a2, char *Src || {{Barely explored}} ||  || Seems to be related to the loading / parsing of segments from a saved SC2 file&lt;br /&gt;
|-&lt;br /&gt;
| 0x4025A9 || 0x42D940 || int || || &#039;&#039;&#039;ClearMapsAndOtherThingsFromMemory&#039;&#039;&#039; || || {{Barely explored}} || Appears to be called when the game is about to close down || Seems to clear / reinitialize a number of global variables&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ [[MicroSim]] functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401460 || 0x44CF60 || char || __cdecl || &#039;&#039;&#039;SimulationProvisionMicrosim&#039;&#039;&#039; || __int16 a1, int a2, __int16 iTileID || {{Barely explored}} ||  || iTileID is the only argument used; needs some RE work for sure&lt;br /&gt;
|-&lt;br /&gt;
| 0x40158C || 0x44DDC0 || __int16 || __cdecl || &#039;&#039;&#039;SimulationInitializeMicrosim&#039;&#039;&#039; || __int16 iMicroSimIdx, __int16 iTileID || {{Barely explored}} ||  || Seems to initialize the values for each microsim based on the provided tile ID. First param is an index into the XLAB map.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ [[Thing]] functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x40132A || 0x4562E0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickSailboat&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Has a rare chance of turning into Nessie&lt;br /&gt;
|-&lt;br /&gt;
| 0x40137F || 0x454EA0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickTornado&#039;&#039;&#039; ||__int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x401992 || 0x4548C0 || void || __usercall || &#039;&#039;&#039;SimulationThingTickMonster&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || The function signature of this one is odd and needs investigation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401B6D || 0x455500 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickTrain&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Used for XTHG_TRAIN_ENGINE and XTHG_UNKNOWN_3&lt;br /&gt;
|-&lt;br /&gt;
| 0x401EBA || 0x452FA0 || int || __cdecl || &#039;&#039;&#039;SimulationSpawnMaxisMan&#039;&#039;&#039; || __int16 iDisasterID || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; || Creates the Thing for Maxis Man and determines based on iDisasterID what his behavior should be&lt;br /&gt;
|-&lt;br /&gt;
| 0x40236F || 0x456760 || void || __usercall || &#039;&#039;&#039;SimulationThingTickCargoShip&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || IDA really doesn&#039;t like this function for some reason&lt;br /&gt;
|-&lt;br /&gt;
| 0x402464 || 0x450890 || int || __stdcall || &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; ||  || {{Barely explored}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; via &#039;&#039;sub_401DBB&#039;&#039; || Does the individual simulation ticks for Things every 30-45 ms.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4024AA || 0x455020 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickMaxisMan&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || If you shoot down a helicopter and it lights something on fire, it&#039;s your own dang fault&lt;br /&gt;
|-&lt;br /&gt;
| 0x4027A2 || 0x453980 || void || __usercall || &#039;&#039;&#039;SimulationThingTickAirplane&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Another one with a bizarre function signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x4028D3 || 0x4546F0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickExplosion&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x402ED2 || 0x4540C0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickHelicopter&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Sound and music functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401096 || 0x4251D0 || int || __thiscall || &#039;&#039;&#039;SoundPlaySound&#039;&#039;&#039; || int* this, int iSoundID || {{Mostly understood}} || Called in so many places || Calls through to &#039;&#039;sub_4802B0&#039;&#039;, which does the buffer loads and calls to &#039;&#039;sndPlaySoundA&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401389 || 0x480890 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicSendMCICommands&#039;&#039;&#039; || unsigned __int16* this, char* szMidiPath || {{Understood}} || Called by &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039; || Sends the actual MCI commands to play/stop a MIDI file&lt;br /&gt;
|-&lt;br /&gt;
| 0x401479 || 0x480770 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039; || unsigned __int16* this, int iSongID || {{Understood}} || Called by &#039;&#039;&#039;MusicPlay&#039;&#039;&#039; || Turns iSongID into szMidiPath&lt;br /&gt;
|-&lt;br /&gt;
| 0x4015FF || 0x480B20 || void || __thiscall || &#039;&#039;&#039;AllocateSoundBuffers&#039;&#039;&#039; || DWORD *this, int a2 || {{Barely explored}} || Called by &#039;&#039;&#039;CMainFrame:OnCreate&#039;&#039;&#039; || Allocates sound buffers; replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x401A9B || 0x425290 || int || __thiscall || &#039;&#039;&#039;MusicPlayNextRefocusSong&#039;&#039;&#039; || unsigned __int16** this || {{Understood}} || Called in a few places || Loops through the non-event music; replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x401CE9 || 0x425220 || int || __thiscall || &#039;&#039;&#039;SoundStopSound&#039;&#039;&#039; || int* this, int iSoundID || {{Understood}} || Called in so many places || Does a few checks then blasts out &#039;&#039;sndPlaySoundA(0, 0)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401F9B || 0x480140 || void || __stdcall || &#039;&#039;&#039;LoadSoundBuffer&#039;&#039;&#039; || int iSoundID, void* lpBuffer || {{Understood}} || Called before a few sound calls || This and many other sound functions are replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x402414 || 0x425260 || int || __thiscall || &#039;&#039;&#039;MusicPlay&#039;&#039;&#039; || unsigned __int16** this, iSongID || {{Understood}} || Called by anything that changes the music || Basically just a trampoline to &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x402BE4 || 0x480AE0 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicStop&#039;&#039;&#039; || int this || {{Understood}} || Called by anything that stops the music || Sends an MCI_CLOSE command to the sequencer device&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Randomness functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401019 || 0x47FC30 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod32&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 32&lt;br /&gt;
|-&lt;br /&gt;
| 0x40116D || 0x47FAA0 || __int16 || __cdecl || &#039;&#039;&#039;RandomWordLCGMod&#039;&#039;&#039; || __int16 iModulus || {{Understood}} ||  || Returns a random word from the LCG modulo iModulus&lt;br /&gt;
|-&lt;br /&gt;
| 0x401415 || 0x47FC70 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod64&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 64&lt;br /&gt;
|-&lt;br /&gt;
| 0x4017AD || 0x47FAE0 || int || __stdcall || &#039;&#039;&#039;GetRandomLFSRState&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns the state of the LFSR&lt;br /&gt;
|-&lt;br /&gt;
| 0x401CAD || 0x47FAF0 || __int16 || __cdecl || &#039;&#039;&#039;RandomWordLFSRMod&#039;&#039;&#039; || __int16 iModulus || {{Understood}} ||  || Returns a random word from the LFSR modulo iModulus&lt;br /&gt;
|-&lt;br /&gt;
| 0x401D9D || 0x47FCF0 || unsigned __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSR&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR&lt;br /&gt;
|-&lt;br /&gt;
| 0x401F19 || 0x47FA80 || int || __cdecl || &#039;&#039;&#039;SeedRandomLCG&#039;&#039;&#039; || int iSeed || {{Understood}} ||  || Sets the LCG state&lt;br /&gt;
|-&lt;br /&gt;
| 0x402261 || 0x47FB70 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod4&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 4&lt;br /&gt;
|-&lt;br /&gt;
| 0x4025E5 || 0x47FBF0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod16&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 16&lt;br /&gt;
|-&lt;br /&gt;
| 0x402626 || 0x47FAD0 || int || __cdecl || &#039;&#039;&#039;SeedRandomLFSR&#039;&#039;&#039; || int iSeed || {{Understood}} ||  || Sets the LFSR state&lt;br /&gt;
|-&lt;br /&gt;
| 0x40288D || 0x47FBB0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod8&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 8&lt;br /&gt;
|-&lt;br /&gt;
| 0x402946 || 0x47FB30 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod2&#039;&#039;&#039; ||  || {{Understood}} || Called by &#039;&#039;&#039;SimulationThingTickTrain&#039;&#039;&#039; and &#039;&#039;&#039;SimulationDoDisasterTick&#039;&#039;&#039; || Returns a random word from the LFSR modulo 2&lt;br /&gt;
|-&lt;br /&gt;
| 0x402B3F || 0x47FCB0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod128&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 128&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Frequently-reused MFC class functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x40219E || 0x4815E0 || INT_PTR || __thiscall || &#039;&#039;&#039;CGameDialog::DoModal&#039;&#039;&#039; || LPCDLGTEMPLATEA* this || {{Understood}} || Called in so many places || Seems to pause the simulation, call CDialog::DoModal(this), then restore the simulation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40281A || 0x481300 || struct CRuntimeClass* || __stdcall || &#039;&#039;&#039;CGameDialog::GetRuntimeClass&#039;&#039;&#039; ||  || {{Understood}} ||  || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Game data]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Function_list&amp;diff=643</id>
		<title>Function list</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Function_list&amp;diff=643"/>
		<updated>2025-03-12T01:48:02Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Heavy construction}}&lt;br /&gt;
&lt;br /&gt;
This is a table of functions in SimCity 2000 that have been at least partially reverse engineered and given names. It is probably going to be unpleasant to update, but at least it looks nice and you can sort it.&lt;br /&gt;
&lt;br /&gt;
When adding new functions to the table, please make sure you insert them into the appropriate order by thunk address (the function that just has a &amp;lt;code&amp;gt;jmp &#039;&#039;&#039;ActualFunctionBody&#039;&#039;&#039;&amp;lt;/code&amp;gt; instruction in it). If/when it gets too unwieldy we can split it out into multiple tables.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Uncategorized functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401262 || 0x468D30 || int || __stdcall || &#039;&#039;&#039;[[SimulationEQ_LE_Processing]]&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 22? || Handles EQ and LE simulation for the month.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40130C || 0x45F760 || {{Win32_BOOL}} || __stdcall || &#039;&#039;&#039;SimulationDoDisasterTick&#039;&#039;&#039; ||  || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x4013ED || 0x42BCA0 || int || __cdecl || &#039;&#039;&#039;SimulationCalculateOrdinanceCost&#039;&#039;&#039; || DWORD dwOrdinance || {{Mostly understood}} ||  || Returns the effective cost of an ordinance&lt;br /&gt;
|-&lt;br /&gt;
| 0x4015E6 || 0x4731E0 || int || __cdecl || &#039;&#039;&#039;SimulationPrepareBudgetDialog&#039;&#039;&#039; || int a1 || {{Mostly understood}} ||  || arg a1 only referenced on line, seems to be more like &amp;quot;BOOL bUseParentWindow&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401672 || 0x441E50 || int || __cdecl || &#039;&#039;&#039;SimulationGrantReward&#039;&#039;&#039; || __int16 iRewardID, BOOL bAddReward || {{Mostly understood}} ||  || Adds a city progression reward if (bAddReward), removes it if (!bAddReward).&lt;br /&gt;
|-&lt;br /&gt;
| 0x40174E || 0x42B4D0 || int || __cdecl || &#039;&#039;&#039;SimulationPrepareDisaster&#039;&#039;&#039; || DWORD *a1, __int16 a2, __int16 a3 || {{Somewhat understood}} ||  || Seems to prepare the starting location for disasters.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401820 || 0x413520 || void || __stdcall || &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; ||  || {{Mostly understood}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; based on game speed || Advances the calendar date and performs all appropriate daily/monthly/etc. tasks. May need better name?&lt;br /&gt;
|-&lt;br /&gt;
| 0x4019EC || 0x4412E0 || int || __cdecl || &#039;&#039;&#039;CenterOnTileCoords&#039;&#039;&#039; || __int16 iTileX, __int16 iTileY || {{Somewhat understood}} || Called from the centering tool and anywhere that needs to center the display || &lt;br /&gt;
|-&lt;br /&gt;
| 0x401CA8 || 0x464550 || int || __stdcall || &#039;&#039;&#039;SimulationUpdateWaterConsumption&#039;&#039;&#039; ||  || {{Barely explored}} || Called whenever tiles are placed and on &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 2 || Vanilla SC2K doesn&#039;t call this when tiles are placed on cities over 50,000 pop.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401E65 || 0x471BC0 || char || __stdcall || &#039;&#039;&#039;SimulationDetermineCityCrisis&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called on the last day of the month and from &#039;&#039;sub_406A50&#039;&#039; || Changes the city status line if there&#039;s a new demand, and also starts disasters.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40217B || 0x468150 || int || __stdcall || &#039;&#039;&#039;[[SimulationRCIDemandUpdates]]&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 22? || Handles all RCI bar updates for &amp;quot;zone balance&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4022FC || 0x4358B0 || int || __cdecl || &#039;&#039;&#039;SimulationGrowthTick&#039;&#039;&#039; || __int16 a1, __int16 a2 || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; on days 4-17 || The arguments and algorithms are not yet understood.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402527 || 0x45CF10 || int || __stdcall || &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; || Calls the appropriate disaster creation function and then runs disaster ticks&lt;br /&gt;
|-&lt;br /&gt;
| 0x4026B2 || 0x4734A0 || int || __usercall || &#039;&#039;&#039;SimulationGrowSpecificZone&#039;&#039;&#039; || int a1@&amp;lt;ebp&amp;gt;, __int16 iX, __int16 iY, __int16 iTileID, __int16 iZoneType || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationGrowthTick&#039;&#039;&#039; || Might be an omit-frame-pointer function?&lt;br /&gt;
|-&lt;br /&gt;
| 0x4026F8 || 0x467860 || int || __stdcall || &#039;&#039;&#039;SimulationUpdatePowerConsumption&#039;&#039;&#039; ||  || {{Barely explored}} || Called whenever tiles are placed and on &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 21 || Vanilla SC2K doesn&#039;t call this when tiles are placed on cities over 50,000 pop.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402A3B || 0x405AB0 || DWORD || __thiscall || &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; || CWinApp* this || {{Somewhat understood}} || Called from &#039;&#039;&#039;CWinApp::OnIdle&#039;&#039;&#039; via the class CWinApp vtable || Could stand to have a better name.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402A9F || 0x40C100 || __int16 || __tstdcall || &#039;&#039;&#039;SimulationProcessTimer&#039;&#039;&#039; ||  || {{Mostly understood}} || Called from the root window&#039;s AFX_MSGMAP to handle WM_TIMER messages ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x402D2E || 0x4734A0 || __int16 || __stdcall || &#039;&#039;&#039;SimulationCalculateBudgetUpdates&#039;&#039;&#039; ||  || {{Barely explored}} ||  || 00&lt;br /&gt;
|-&lt;br /&gt;
| 0x403017 || 0x4142C0 || int || __stdcall || &#039;&#039;&#039;SimulationProposeMilitaryBase&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; on day 23 and from &amp;quot;gilmartin&amp;quot; cheat || &lt;br /&gt;
|-&lt;br /&gt;
| 0x401154 || 0x46A840 || int || __stdcall || &#039;&#039;&#039;[[SimulationLandValueMapCalc]]&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; on day 3 || This is where the land value and pollution simulator lives.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4025A4 || 0x4302E0 || int || __thiscall || &#039;&#039;&#039;LoadSegmentsFromSavedCity&#039;&#039;&#039; || void *this, int *a2, char *Src || {{Barely explored}} ||  || Seems to be related to the loading / parsing of segments from a saved SC2 file&lt;br /&gt;
|-&lt;br /&gt;
| 0x4025A9 || 0x42D940 || int || || &#039;&#039;&#039;ClearMapsAndOtherThingsFromMemory&#039;&#039;&#039; || || {{Barely explored}} ||  || Seems to clear / reinitialize a number of global variables&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ [[MicroSim]] functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401460 || 0x44CF60 || char || __cdecl || &#039;&#039;&#039;SimulationProvisionMicrosim&#039;&#039;&#039; || __int16 a1, int a2, __int16 iTileID || {{Barely explored}} ||  || iTileID is the only argument used; needs some RE work for sure&lt;br /&gt;
|-&lt;br /&gt;
| 0x40158C || 0x44DDC0 || __int16 || __cdecl || &#039;&#039;&#039;SimulationInitializeMicrosim&#039;&#039;&#039; || __int16 iMicroSimIdx, __int16 iTileID || {{Barely explored}} ||  || Seems to initialize the values for each microsim based on the provided tile ID. First param is an index into the XLAB map.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ [[Thing]] functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x40132A || 0x4562E0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickSailboat&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Has a rare chance of turning into Nessie&lt;br /&gt;
|-&lt;br /&gt;
| 0x40137F || 0x454EA0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickTornado&#039;&#039;&#039; ||__int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x401992 || 0x4548C0 || void || __usercall || &#039;&#039;&#039;SimulationThingTickMonster&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || The function signature of this one is odd and needs investigation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401B6D || 0x455500 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickTrain&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Used for XTHG_TRAIN_ENGINE and XTHG_UNKNOWN_3&lt;br /&gt;
|-&lt;br /&gt;
| 0x401EBA || 0x452FA0 || int || __cdecl || &#039;&#039;&#039;SimulationSpawnMaxisMan&#039;&#039;&#039; || __int16 iDisasterID || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; || Creates the Thing for Maxis Man and determines based on iDisasterID what his behavior should be&lt;br /&gt;
|-&lt;br /&gt;
| 0x40236F || 0x456760 || void || __usercall || &#039;&#039;&#039;SimulationThingTickCargoShip&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || IDA really doesn&#039;t like this function for some reason&lt;br /&gt;
|-&lt;br /&gt;
| 0x402464 || 0x450890 || int || __stdcall || &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; ||  || {{Barely explored}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; via &#039;&#039;sub_401DBB&#039;&#039; || Does the individual simulation ticks for Things every 30-45 ms.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4024AA || 0x455020 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickMaxisMan&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || If you shoot down a helicopter and it lights something on fire, it&#039;s your own dang fault&lt;br /&gt;
|-&lt;br /&gt;
| 0x4027A2 || 0x453980 || void || __usercall || &#039;&#039;&#039;SimulationThingTickAirplane&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Another one with a bizarre function signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x4028D3 || 0x4546F0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickExplosion&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x402ED2 || 0x4540C0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickHelicopter&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Sound and music functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401096 || 0x4251D0 || int || __thiscall || &#039;&#039;&#039;SoundPlaySound&#039;&#039;&#039; || int* this, int iSoundID || {{Mostly understood}} || Called in so many places || Calls through to &#039;&#039;sub_4802B0&#039;&#039;, which does the buffer loads and calls to &#039;&#039;sndPlaySoundA&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401389 || 0x480890 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicSendMCICommands&#039;&#039;&#039; || unsigned __int16* this, char* szMidiPath || {{Understood}} || Called by &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039; || Sends the actual MCI commands to play/stop a MIDI file&lt;br /&gt;
|-&lt;br /&gt;
| 0x401479 || 0x480770 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039; || unsigned __int16* this, int iSongID || {{Understood}} || Called by &#039;&#039;&#039;MusicPlay&#039;&#039;&#039; || Turns iSongID into szMidiPath&lt;br /&gt;
|-&lt;br /&gt;
| 0x4015FF || 0x480B20 || void || __thiscall || &#039;&#039;&#039;AllocateSoundBuffers&#039;&#039;&#039; || DWORD *this, int a2 || {{Barely explored}} || Called by &#039;&#039;&#039;CMainFrame:OnCreate&#039;&#039;&#039; || Allocates sound buffers; replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x401A9B || 0x425290 || int || __thiscall || &#039;&#039;&#039;MusicPlayNextRefocusSong&#039;&#039;&#039; || unsigned __int16** this || {{Understood}} || Called in a few places || Loops through the non-event music; replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x401CE9 || 0x425220 || int || __thiscall || &#039;&#039;&#039;SoundStopSound&#039;&#039;&#039; || int* this, int iSoundID || {{Understood}} || Called in so many places || Does a few checks then blasts out &#039;&#039;sndPlaySoundA(0, 0)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401F9B || 0x480140 || void || __stdcall || &#039;&#039;&#039;LoadSoundBuffer&#039;&#039;&#039; || int iSoundID, void* lpBuffer || {{Understood}} || Called before a few sound calls || This and many other sound functions are replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x402414 || 0x425260 || int || __thiscall || &#039;&#039;&#039;MusicPlay&#039;&#039;&#039; || unsigned __int16** this, iSongID || {{Understood}} || Called by anything that changes the music || Basically just a trampoline to &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x402BE4 || 0x480AE0 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicStop&#039;&#039;&#039; || int this || {{Understood}} || Called by anything that stops the music || Sends an MCI_CLOSE command to the sequencer device&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Randomness functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401019 || 0x47FC30 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod32&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 32&lt;br /&gt;
|-&lt;br /&gt;
| 0x40116D || 0x47FAA0 || __int16 || __cdecl || &#039;&#039;&#039;RandomWordLCGMod&#039;&#039;&#039; || __int16 iModulus || {{Understood}} ||  || Returns a random word from the LCG modulo iModulus&lt;br /&gt;
|-&lt;br /&gt;
| 0x401415 || 0x47FC70 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod64&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 64&lt;br /&gt;
|-&lt;br /&gt;
| 0x4017AD || 0x47FAE0 || int || __stdcall || &#039;&#039;&#039;GetRandomLFSRState&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns the state of the LFSR&lt;br /&gt;
|-&lt;br /&gt;
| 0x401CAD || 0x47FAF0 || __int16 || __cdecl || &#039;&#039;&#039;RandomWordLFSRMod&#039;&#039;&#039; || __int16 iModulus || {{Understood}} ||  || Returns a random word from the LFSR modulo iModulus&lt;br /&gt;
|-&lt;br /&gt;
| 0x401D9D || 0x47FCF0 || unsigned __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSR&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR&lt;br /&gt;
|-&lt;br /&gt;
| 0x401F19 || 0x47FA80 || int || __cdecl || &#039;&#039;&#039;SeedRandomLCG&#039;&#039;&#039; || int iSeed || {{Understood}} ||  || Sets the LCG state&lt;br /&gt;
|-&lt;br /&gt;
| 0x402261 || 0x47FB70 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod4&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 4&lt;br /&gt;
|-&lt;br /&gt;
| 0x4025E5 || 0x47FBF0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod16&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 16&lt;br /&gt;
|-&lt;br /&gt;
| 0x402626 || 0x47FAD0 || int || __cdecl || &#039;&#039;&#039;SeedRandomLFSR&#039;&#039;&#039; || int iSeed || {{Understood}} ||  || Sets the LFSR state&lt;br /&gt;
|-&lt;br /&gt;
| 0x40288D || 0x47FBB0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod8&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 8&lt;br /&gt;
|-&lt;br /&gt;
| 0x402946 || 0x47FB30 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod2&#039;&#039;&#039; ||  || {{Understood}} || Called by &#039;&#039;&#039;SimulationThingTickTrain&#039;&#039;&#039; and &#039;&#039;&#039;SimulationDoDisasterTick&#039;&#039;&#039; || Returns a random word from the LFSR modulo 2&lt;br /&gt;
|-&lt;br /&gt;
| 0x402B3F || 0x47FCB0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod128&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 128&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Frequently-reused MFC class functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x40219E || 0x4815E0 || INT_PTR || __thiscall || &#039;&#039;&#039;CGameDialog::DoModal&#039;&#039;&#039; || LPCDLGTEMPLATEA* this || {{Understood}} || Called in so many places || Seems to pause the simulation, call CDialog::DoModal(this), then restore the simulation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40281A || 0x481300 || struct CRuntimeClass* || __stdcall || &#039;&#039;&#039;CGameDialog::GetRuntimeClass&#039;&#039;&#039; ||  || {{Understood}} ||  || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Game data]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Function_list&amp;diff=634</id>
		<title>Function list</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Function_list&amp;diff=634"/>
		<updated>2025-03-11T09:57:12Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Heavy construction}}&lt;br /&gt;
&lt;br /&gt;
This is a table of functions in SimCity 2000 that have been at least partially reverse engineered and given names. It is probably going to be unpleasant to update, but at least it looks nice and you can sort it.&lt;br /&gt;
&lt;br /&gt;
When adding new functions to the table, please make sure you insert them into the appropriate order by thunk address (the function that just has a &amp;lt;code&amp;gt;jmp &#039;&#039;&#039;ActualFunctionBody&#039;&#039;&#039;&amp;lt;/code&amp;gt; instruction in it). If/when it gets too unwieldy we can split it out into multiple tables.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Uncategorized functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401262 || 0x468D30 || int || __stdcall || &#039;&#039;&#039;[[SimulationEQ_LE_Processing]]&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 22? || Handles EQ and LE simulation for the month.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40130C || 0x45F760 || {{Win32_BOOL}} || __stdcall || &#039;&#039;&#039;SimulationDoDisasterTick&#039;&#039;&#039; ||  || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x4013ED || 0x42BCA0 || int || __cdecl || &#039;&#039;&#039;SimulationCalculateOrdinanceCost&#039;&#039;&#039; || DWORD dwOrdinance || {{Mostly understood}} ||  || Returns the effective cost of an ordinance&lt;br /&gt;
|-&lt;br /&gt;
| 0x4015E6 || 0x4731E0 || int || __cdecl || &#039;&#039;&#039;SimulationPrepareBudgetDialog&#039;&#039;&#039; || int a1 || {{Mostly understood}} ||  || arg a1 only referenced on line, seems to be more like &amp;quot;BOOL bUseParentWindow&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401672 || 0x441E50 || int || __cdecl || &#039;&#039;&#039;SimulationGrantReward&#039;&#039;&#039; || __int16 iRewardID, BOOL bAddReward || {{Mostly understood}} ||  || Adds a city progression reward if (bAddReward), removes it if (!bAddReward).&lt;br /&gt;
|-&lt;br /&gt;
| 0x40174E || 0x42B4D0 || int || __cdecl || &#039;&#039;&#039;SimulationPrepareDisaster&#039;&#039;&#039; || DWORD *a1, __int16 a2, __int16 a3 || {{Somewhat understood}} ||  || Seems to prepare the starting location for disasters.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401820 || 0x413520 || void || __stdcall || &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; ||  || {{Mostly understood}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; based on game speed || Advances the calendar date and performs all appropriate daily/monthly/etc. tasks. May need better name?&lt;br /&gt;
|-&lt;br /&gt;
| 0x4019EC || 0x4412E0 || int || __cdecl || &#039;&#039;&#039;CenterOnTileCoords&#039;&#039;&#039; || __int16 iTileX, __int16 iTileY || Called from the centering tool and anywhere that needs to center the display || &lt;br /&gt;
|-&lt;br /&gt;
| 0x401CA8 || 0x464550 || int || __stdcall || &#039;&#039;&#039;SimulationUpdateWaterConsumption&#039;&#039;&#039; ||  || {{Barely explored}} || Called whenever tiles are placed and on &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 2 || Vanilla SC2K doesn&#039;t call this when tiles are placed on cities over 50,000 pop.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401E65 || 0x471BC0 || char || __stdcall || &#039;&#039;&#039;SimulationDetermineCityCrisis&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called on the last day of the month and from &#039;&#039;sub_406A50&#039;&#039; || Changes the city status line if there&#039;s a new demand, and also starts disasters.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40217B || 0x468150 || int || __stdcall || &#039;&#039;&#039;[[SimulationRCIDemandUpdates]]&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 22? || Handles all RCI bar updates for &amp;quot;zone balance&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4022FC || 0x4358B0 || int || __cdecl || &#039;&#039;&#039;SimulationGrowthTick&#039;&#039;&#039; || __int16 a1, __int16 a2 || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; on days 4-17 || The arguments and algorithms are not yet understood.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402527 || 0x45CF10 || int || __stdcall || &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; || Calls the appropriate disaster creation function and then runs disaster ticks&lt;br /&gt;
|-&lt;br /&gt;
| 0x4026B2 || 0x4734A0 || int || __usercall || &#039;&#039;&#039;SimulationGrowSpecificZone&#039;&#039;&#039; || int a1@&amp;lt;ebp&amp;gt;, __int16 iX, __int16 iY, __int16 iTileID, __int16 iZoneType || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationGrowthTick&#039;&#039;&#039; || Might be an omit-frame-pointer function?&lt;br /&gt;
|-&lt;br /&gt;
| 0x4026F8 || 0x467860 || int || __stdcall || &#039;&#039;&#039;SimulationUpdatePowerConsumption&#039;&#039;&#039; ||  || {{Barely explored}} || Called whenever tiles are placed and on &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 21 || Vanilla SC2K doesn&#039;t call this when tiles are placed on cities over 50,000 pop.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402A3B || 0x405AB0 || DWORD || __thiscall || &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; || CWinApp* this || {{Somewhat understood}} || Called from &#039;&#039;&#039;CWinApp::OnIdle&#039;&#039;&#039; via the class CWinApp vtable || Could stand to have a better name.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402A9F || 0x40C100 || __int16 || __tstdcall || &#039;&#039;&#039;SimulationProcessTimer&#039;&#039;&#039; ||  || {{Mostly understood}} || Called from the root window&#039;s AFX_MSGMAP to handle WM_TIMER messages ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x402D2E || 0x4734A0 || __int16 || __stdcall || &#039;&#039;&#039;SimulationCalculateBudgetUpdates&#039;&#039;&#039; ||  || {{Barely explored}} ||  || 00&lt;br /&gt;
|-&lt;br /&gt;
| 0x403017 || 0x4142C0 || int || __stdcall || &#039;&#039;&#039;SimulationProposeMilitaryBase&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; on day 23 and from &amp;quot;gilmartin&amp;quot; cheat || &lt;br /&gt;
|-&lt;br /&gt;
| 0x401154 || 0x46A840 || int || __stdcall || &#039;&#039;&#039;[[SimulationLandValueMapCalc]]&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; on day 3 || This is where the land value and pollution simulator lives.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4025A4 || 0x4302E0 || int || __thiscall || &#039;&#039;&#039;LoadSegmentsFromSavedCity&#039;&#039;&#039; || void *this, int *a2, char *Src || {{Barely explored}} ||  || Seems to be related to the loading / parsing of segments from a saved SC2 file&lt;br /&gt;
|-&lt;br /&gt;
| 0x4025A9 || 0x42D940 || int || || &#039;&#039;&#039;ClearMapsAndOtherThingsFromMemory&#039;&#039;&#039; || || {{Barely explored}} ||  || Seems to clear / reinitialize a number of global variables&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ [[MicroSim]] functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401460 || 0x44CF60 || char || __cdecl || &#039;&#039;&#039;SimulationProvisionMicrosim&#039;&#039;&#039; || __int16 a1, int a2, __int16 iTileID || {{Barely explored}} ||  || iTileID is the only argument used; needs some RE work for sure&lt;br /&gt;
|-&lt;br /&gt;
| 0x40158C || 0x44DDC0 || __int16 || __cdecl || &#039;&#039;&#039;SimulationInitializeMicrosim&#039;&#039;&#039; || __int16 iMicroSimIdx, __int16 iTileID || {{Barely explored}} ||  || Seems to initialize the values for each microsim based on the provided tile ID. First param is an index into the XLAB map.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ [[Thing]] functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x40132A || 0x4562E0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickSailboat&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Has a rare chance of turning into Nessie&lt;br /&gt;
|-&lt;br /&gt;
| 0x40137F || 0x454EA0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickTornado&#039;&#039;&#039; ||__int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x401992 || 0x4548C0 || void || __usercall || &#039;&#039;&#039;SimulationThingTickMonster&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || The function signature of this one is odd and needs investigation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401B6D || 0x455500 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickTrain&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Used for XTHG_TRAIN_ENGINE and XTHG_UNKNOWN_3&lt;br /&gt;
|-&lt;br /&gt;
| 0x401EBA || 0x452FA0 || int || __cdecl || &#039;&#039;&#039;SimulationSpawnMaxisMan&#039;&#039;&#039; || __int16 iDisasterID || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; || Creates the Thing for Maxis Man and determines based on iDisasterID what his behavior should be&lt;br /&gt;
|-&lt;br /&gt;
| 0x40236F || 0x456760 || void || __usercall || &#039;&#039;&#039;SimulationThingTickCargoShip&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || IDA really doesn&#039;t like this function for some reason&lt;br /&gt;
|-&lt;br /&gt;
| 0x402464 || 0x450890 || int || __stdcall || &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; ||  || {{Barely explored}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; via &#039;&#039;sub_401DBB&#039;&#039; || Does the individual simulation ticks for Things every 30-45 ms.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4024AA || 0x455020 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickMaxisMan&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || If you shoot down a helicopter and it lights something on fire, it&#039;s your own dang fault&lt;br /&gt;
|-&lt;br /&gt;
| 0x4027A2 || 0x453980 || void || __usercall || &#039;&#039;&#039;SimulationThingTickAirplane&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Another one with a bizarre function signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x4028D3 || 0x4546F0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickExplosion&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x402ED2 || 0x4540C0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickHelicopter&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Sound and music functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401096 || 0x4251D0 || int || __thiscall || &#039;&#039;&#039;SoundPlaySound&#039;&#039;&#039; || int* this, int iSoundID || {{Mostly understood}} || Called in so many places || Calls through to &#039;&#039;sub_4802B0&#039;&#039;, which does the buffer loads and calls to &#039;&#039;sndPlaySoundA&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401389 || 0x480890 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicSendMCICommands&#039;&#039;&#039; || unsigned __int16* this, char* szMidiPath || {{Understood}} || Called by &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039; || Sends the actual MCI commands to play/stop a MIDI file&lt;br /&gt;
|-&lt;br /&gt;
| 0x401479 || 0x480770 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039; || unsigned __int16* this, int iSongID || {{Understood}} || Called by &#039;&#039;&#039;MusicPlay&#039;&#039;&#039; || Turns iSongID into szMidiPath&lt;br /&gt;
|-&lt;br /&gt;
| 0x4015FF || 0x480B20 || void || __thiscall || &#039;&#039;&#039;AllocateSoundBuffers&#039;&#039;&#039; || DWORD *this, int a2 || {{Barely explored}} || Called by &#039;&#039;&#039;CMainFrame:OnCreate&#039;&#039;&#039; || Allocates sound buffers; replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x401A9B || 0x425290 || int || __thiscall || &#039;&#039;&#039;MusicPlayNextRefocusSong&#039;&#039;&#039; || unsigned __int16** this || {{Understood}} || Called in a few places || Loops through the non-event music; replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x401CE9 || 0x425220 || int || __thiscall || &#039;&#039;&#039;SoundStopSound&#039;&#039;&#039; || int* this, int iSoundID || {{Understood}} || Called in so many places || Does a few checks then blasts out &#039;&#039;sndPlaySoundA(0, 0)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401F9B || 0x480140 || void || __stdcall || &#039;&#039;&#039;LoadSoundBuffer&#039;&#039;&#039; || int iSoundID, void* lpBuffer || {{Understood}} || Called before a few sound calls || This and many other sound functions are replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x402414 || 0x425260 || int || __thiscall || &#039;&#039;&#039;MusicPlay&#039;&#039;&#039; || unsigned __int16** this, iSongID || {{Understood}} || Called by anything that changes the music || Basically just a trampoline to &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x402BE4 || 0x480AE0 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicStop&#039;&#039;&#039; || int this || {{Understood}} || Called by anything that stops the music || Sends an MCI_CLOSE command to the sequencer device&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Randomness functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401019 || 0x47FC30 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod32&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 32&lt;br /&gt;
|-&lt;br /&gt;
| 0x40116D || 0x47FAA0 || __int16 || __cdecl || &#039;&#039;&#039;RandomWordLCGMod&#039;&#039;&#039; || __int16 iModulus || {{Understood}} ||  || Returns a random word from the LCG modulo iModulus&lt;br /&gt;
|-&lt;br /&gt;
| 0x401415 || 0x47FC70 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod64&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 64&lt;br /&gt;
|-&lt;br /&gt;
| 0x4017AD || 0x47FAE0 || int || __stdcall || &#039;&#039;&#039;GetRandomLFSRState&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns the state of the LFSR&lt;br /&gt;
|-&lt;br /&gt;
| 0x401CAD || 0x47FAF0 || __int16 || __cdecl || &#039;&#039;&#039;RandomWordLFSRMod&#039;&#039;&#039; || __int16 iModulus || {{Understood}} ||  || Returns a random word from the LFSR modulo iModulus&lt;br /&gt;
|-&lt;br /&gt;
| 0x401D9D || 0x47FCF0 || unsigned __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSR&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR&lt;br /&gt;
|-&lt;br /&gt;
| 0x401F19 || 0x47FA80 || int || __cdecl || &#039;&#039;&#039;SeedRandomLCG&#039;&#039;&#039; || int iSeed || {{Understood}} ||  || Sets the LCG state&lt;br /&gt;
|-&lt;br /&gt;
| 0x402261 || 0x47FB70 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod4&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 4&lt;br /&gt;
|-&lt;br /&gt;
| 0x4025E5 || 0x47FBF0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod16&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 16&lt;br /&gt;
|-&lt;br /&gt;
| 0x402626 || 0x47FAD0 || int || __cdecl || &#039;&#039;&#039;SeedRandomLFSR&#039;&#039;&#039; || int iSeed || {{Understood}} ||  || Sets the LFSR state&lt;br /&gt;
|-&lt;br /&gt;
| 0x40288D || 0x47FBB0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod8&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 8&lt;br /&gt;
|-&lt;br /&gt;
| 0x402946 || 0x47FB30 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod2&#039;&#039;&#039; ||  || {{Understood}} || Called by &#039;&#039;&#039;SimulationThingTickTrain&#039;&#039;&#039; and &#039;&#039;&#039;SimulationDoDisasterTick&#039;&#039;&#039; || Returns a random word from the LFSR modulo 2&lt;br /&gt;
|-&lt;br /&gt;
| 0x402B3F || 0x47FCB0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod128&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 128&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Frequently-reused MFC class functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x40219E || 0x4815E0 || INT_PTR || __thiscall || &#039;&#039;&#039;CGameDialog::DoModal&#039;&#039;&#039; || LPCDLGTEMPLATEA* this || {{Understood}} || Called in so many places || Seems to pause the simulation, call CDialog::DoModal(this), then restore the simulation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40281A || 0x481300 || struct CRuntimeClass* || __stdcall || &#039;&#039;&#039;CGameDialog::GetRuntimeClass&#039;&#039;&#039; ||  || {{Understood}} ||  || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Game data]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=User:Araxestroy/DOS_version_decompilation_notes&amp;diff=630</id>
		<title>User:Araxestroy/DOS version decompilation notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=User:Araxestroy/DOS_version_decompilation_notes&amp;diff=630"/>
		<updated>2025-03-11T03:32:28Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We&#039;re not doing a full patch or anything on the DOS version but I&#039;ve got an IDA database going for it to compare a few things against. If anyone asks me for a DOS patch I will put them in The Little Box Of Screams along with the Amiga fanboys.&lt;br /&gt;
&lt;br /&gt;
=== Possible thiscall format ===&lt;br /&gt;
&lt;br /&gt;
A lot seems to use __usercall with int a1@&amp;lt;edx&amp;gt; at the start. I&#039;m wondering if this is a __thiscall variant specific to some DOS compiler, where that should actually be int this@&amp;lt;edx&amp;gt; more or less across the board. Watcom perhaps? I don&#039;t have enough experience with DOS C++ compilers to know whether or not that&#039;s accurate.&lt;br /&gt;
&lt;br /&gt;
=== Some functions ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;cseg01:00038BA7&#039;&#039;&#039;: char __usercall SimulationProposeMilitaryBase@&amp;lt;al&amp;gt;(int a1@&amp;lt;edx&amp;gt;, __int16 a2@&amp;lt;di&amp;gt;)&lt;br /&gt;
:: Cities with coastlines seem to have a 50/50 chance of getting a naval base versus getting something else! This is good to know for reimplementation in the Win95 version.&lt;br /&gt;
* &#039;&#039;&#039;cseg01:00049F2A&#039;&#039;&#039;: char __usercall MessageBoxYesNo@&amp;lt;al&amp;gt;(int a1@&amp;lt;edx&amp;gt;, int a2)&lt;br /&gt;
:: Message format is an array of 32-bit near pointers to strings followed by a null pointer for termination.&lt;br /&gt;
&lt;br /&gt;
=== Some variables ===&lt;br /&gt;
&lt;br /&gt;
Booleans all seem to be the C++ bool type, so sizeof(bool) == 1.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000C82E5&#039;&#039;&#039;: char bMilitaryBaseType&lt;br /&gt;
:: Same format as Win95 version&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000C82E6&#039;&#039;&#039;: bool bCityHasOcean&lt;br /&gt;
&lt;br /&gt;
=== Map data ===&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000D64C4&#039;&#039;&#039; dwMapXUND&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000D66C4&#039;&#039;&#039; dwMapXZON&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000D68C4&#039;&#039;&#039; dwMapXTER&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000D6AC4&#039;&#039;&#039; dwMapALTM&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000D6CC4&#039;&#039;&#039; dwMapXBLD&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000D7154&#039;&#039;&#039; dwMapXBIT&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=User:Araxestroy/DOS_version_decompilation_notes&amp;diff=629</id>
		<title>User:Araxestroy/DOS version decompilation notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=User:Araxestroy/DOS_version_decompilation_notes&amp;diff=629"/>
		<updated>2025-03-11T03:31:14Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We&#039;re not doing a full patch or anything on the DOS version but I&#039;ve got an IDA database going for it to compare a few things against. If anyone asks me for a DOS patch I will put them in The Little Box Of Screams along with the Amiga fanboys.&lt;br /&gt;
&lt;br /&gt;
=== Possible thiscall format ===&lt;br /&gt;
&lt;br /&gt;
A lot seems to use __usercall with int a1@&amp;lt;edx&amp;gt; at the start. I&#039;m wondering if this is a __thiscall variant specific to some DOS compiler, where that should actually be int this@&amp;lt;edx&amp;gt; more or less across the board. Watcom perhaps? I don&#039;t have enough experience with DOS C++ compilers to know whether or not that&#039;s accurate.&lt;br /&gt;
&lt;br /&gt;
=== Some functions ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;cseg01:00038BA7&#039;&#039;&#039;: char __usercall SimulationProposeMilitaryBase@&amp;lt;al&amp;gt;(int a1@&amp;lt;edx&amp;gt;, __int16 a2@&amp;lt;di&amp;gt;)&lt;br /&gt;
:: Cities with coastlines seem to have a 50/50 chance of getting a naval base versus getting something else! This is good to know for reimplementation in the Win95 version.&lt;br /&gt;
* &#039;&#039;&#039;cseg01:00049F2A&#039;&#039;&#039;: char __usercall MessageBoxYesNo@&amp;lt;al&amp;gt;(int a1@&amp;lt;edx&amp;gt;, int a2)&lt;br /&gt;
:: Message format is an array of 32-bit near pointers to strings followed by a null pointer for termination.&lt;br /&gt;
&lt;br /&gt;
=== Some variables ===&lt;br /&gt;
&lt;br /&gt;
Booleans all seem to be the C++ bool type, so sizeof(bool) == 1.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000C82E5&#039;&#039;&#039;: char bMilitaryBaseType&lt;br /&gt;
:: Same format as Win95 version&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000C82E6&#039;&#039;&#039;: bool bCityHasOcean&lt;br /&gt;
&lt;br /&gt;
=== Map data ===&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000D66C4&#039;&#039;&#039; dwMapXZON&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000D68C4&#039;&#039;&#039; dwMapXTER&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000D6AC4&#039;&#039;&#039; dwMapALTM&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000D6CC4&#039;&#039;&#039; dwMapXBLD&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000D7154&#039;&#039;&#039; dwMapXBIT&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=User:Araxestroy/DOS_version_decompilation_notes&amp;diff=628</id>
		<title>User:Araxestroy/DOS version decompilation notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=User:Araxestroy/DOS_version_decompilation_notes&amp;diff=628"/>
		<updated>2025-03-11T03:28:57Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We&#039;re not doing a full patch or anything on the DOS version but I&#039;ve got an IDA database going for it to compare a few things against. If anyone asks me for a DOS patch I will put them in The Little Box Of Screams along with the Amiga fanboys.&lt;br /&gt;
&lt;br /&gt;
=== Possible thiscall format ===&lt;br /&gt;
&lt;br /&gt;
A lot seems to use __usercall with int a1@&amp;lt;edx&amp;gt; at the start. I&#039;m wondering if this is a __thiscall variant specific to some DOS compiler, where that should actually be int this@&amp;lt;edx&amp;gt; more or less across the board. Watcom perhaps? I don&#039;t have enough experience with DOS C++ compilers to know whether or not that&#039;s accurate.&lt;br /&gt;
&lt;br /&gt;
=== Some functions ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;cseg01:00038BA7&#039;&#039;&#039;: char __usercall SimulationProposeMilitaryBase@&amp;lt;al&amp;gt;(int a1@&amp;lt;edx&amp;gt;, __int16 a2@&amp;lt;di&amp;gt;)&lt;br /&gt;
:: Cities with coastlines seem to have a 50/50 chance of getting a naval base versus getting something else! This is good to know for reimplementation in the Win95 version.&lt;br /&gt;
* &#039;&#039;&#039;cseg01:00049F2A&#039;&#039;&#039;: char __usercall MessageBoxYesNo@&amp;lt;al&amp;gt;(int a1@&amp;lt;edx&amp;gt;, int a2)&lt;br /&gt;
:: Message format is an array of 32-bit near pointers to strings followed by a null pointer for termination.&lt;br /&gt;
&lt;br /&gt;
=== Some variables ===&lt;br /&gt;
&lt;br /&gt;
Booleans all seem to be the C++ bool type, so sizeof(bool) == 1.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000C82E5&#039;&#039;&#039;: char bMilitaryBaseType&lt;br /&gt;
:: Same format as Win95 version&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000C82E6&#039;&#039;&#039;: bool bCityHasOcean&lt;br /&gt;
&lt;br /&gt;
=== Map data ===&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000D66C4&#039;&#039;&#039; dwMapXZON&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000D68C4&#039;&#039;&#039; dwMapXTER&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000D6CC4&#039;&#039;&#039; dwMapXBLD&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000D7154&#039;&#039;&#039; dwMapXBIT&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=User:Araxestroy/DOS_version_decompilation_notes&amp;diff=624</id>
		<title>User:Araxestroy/DOS version decompilation notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=User:Araxestroy/DOS_version_decompilation_notes&amp;diff=624"/>
		<updated>2025-03-11T03:20:47Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: Created page with &amp;quot;We&amp;#039;re not doing a full patch or anything on the DOS version but I&amp;#039;ve got an IDA database going for it to compare a few things against. If anyone asks me for a DOS patch I will put them in The Little Box Of Screams along with the Amiga fanboys.  === Possible thiscall format ===  A lot seems to use __usercall with int a1@&amp;lt;edx&amp;gt; at the start. I&amp;#039;m wondering if this is a __thiscall variant specific to some DOS compiler, where that should actually be int this@&amp;lt;edx&amp;gt; more or less...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We&#039;re not doing a full patch or anything on the DOS version but I&#039;ve got an IDA database going for it to compare a few things against. If anyone asks me for a DOS patch I will put them in The Little Box Of Screams along with the Amiga fanboys.&lt;br /&gt;
&lt;br /&gt;
=== Possible thiscall format ===&lt;br /&gt;
&lt;br /&gt;
A lot seems to use __usercall with int a1@&amp;lt;edx&amp;gt; at the start. I&#039;m wondering if this is a __thiscall variant specific to some DOS compiler, where that should actually be int this@&amp;lt;edx&amp;gt; more or less across the board. Watcom perhaps? I don&#039;t have enough experience with DOS C++ compilers to know whether or not that&#039;s accurate.&lt;br /&gt;
&lt;br /&gt;
=== Some functions ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;cseg01:00038BA7&#039;&#039;&#039;: char __usercall SimulationProposeMilitaryBase@&amp;lt;al&amp;gt;(int a1@&amp;lt;edx&amp;gt;, __int16 a2@&amp;lt;di&amp;gt;)&lt;br /&gt;
:: Cities with coastlines seem to have a 50/50 chance of getting a naval base versus getting something else! This is good to know for reimplementation in the Win95 version.&lt;br /&gt;
* &#039;&#039;&#039;cseg01:00049F2A&#039;&#039;&#039;: char __usercall MessageBoxYesNo@&amp;lt;al&amp;gt;(int a1@&amp;lt;edx&amp;gt;, int a2)&lt;br /&gt;
:: Message format is an array of 32-bit near pointers to strings followed by a null pointer for termination.&lt;br /&gt;
&lt;br /&gt;
=== Some variables ===&lt;br /&gt;
&lt;br /&gt;
Booleans all seem to be the C++ bool type, so sizeof(bool) == 1.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000C82E5&#039;&#039;&#039;: char bMilitaryBaseType&lt;br /&gt;
:: Same format as Win95 version&lt;br /&gt;
* &#039;&#039;&#039;dseg03:000C82E6&#039;&#039;&#039;: bool bCityHasOcean&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=User:Araxestroy&amp;diff=622</id>
		<title>User:Araxestroy</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=User:Araxestroy&amp;diff=622"/>
		<updated>2025-03-11T03:09:51Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi, I&#039;m Troy. I started and maintain the sc2kfix plugin and project.&lt;br /&gt;
&lt;br /&gt;
=== Notepad ===&lt;br /&gt;
&lt;br /&gt;
[[User:Araxestroy/DOS version decompilation notes]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=MapXBLD&amp;diff=621</id>
		<title>MapXBLD</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=MapXBLD&amp;diff=621"/>
		<updated>2025-03-11T02:55:24Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: Redirected page to Tiles&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Tiles]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Function_list&amp;diff=102</id>
		<title>Function list</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Function_list&amp;diff=102"/>
		<updated>2025-03-09T09:27:04Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Heavy construction}}&lt;br /&gt;
&lt;br /&gt;
This is a table of functions in SimCity 2000 that have been at least partially reverse engineered and given names. It is probably going to be unpleasant to update, but at least it looks nice and you can sort it.&lt;br /&gt;
&lt;br /&gt;
When adding new functions to the table, please make sure you insert them into the appropriate order by thunk address (the function that just has a &amp;lt;code&amp;gt;jmp &#039;&#039;&#039;ActualFunctionBody&#039;&#039;&#039;&amp;lt;/code&amp;gt; instruction in it). If/when it gets too unwieldy we can split it out into multiple tables.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Uncategorized functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401262 || 0x468D30 || int || __stdcall || &#039;&#039;&#039;[[SimulationEQ_LE_Processing]]&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 22? || Handles EQ and LE simulation for the month.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40130C || 0x45F760 || {{Win32_BOOL}} || __stdcall || &#039;&#039;&#039;SimulationDoDisasterTick&#039;&#039;&#039; ||  || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x4013ED || 0x42BCA0 || int || __cdecl || &#039;&#039;&#039;SimulationCalculateOrdinanceCost&#039;&#039;&#039; || DWORD dwOrdinance || {{Mostly understood}} ||  || Returns the effective cost of an ordinance&lt;br /&gt;
|-&lt;br /&gt;
| 0x401460 || 0x44CF60 || char || __cdecl || &#039;&#039;&#039;SimulationProvisionMicrosim&#039;&#039;&#039; || __int16 a1, int a2, __int16 iTileID || {{Barely explored}} ||  || iTileID is the only argument used; needs some RE work for sure&lt;br /&gt;
|-&lt;br /&gt;
| 0x4015E6 || 0x4731E0 || int || __cdecl || &#039;&#039;&#039;SimulationPrepareBudgetDialog&#039;&#039;&#039; || int a1 || {{Mostly understood}} ||  || arg a1 only referenced on line, seems to be more like &amp;quot;BOOL bUseParentWindow&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401672 || 0x441E50 || int || __cdecl || &#039;&#039;&#039;SimulationGrantReward&#039;&#039;&#039; || __int16 iRewardID, BOOL bAddReward || {{Mostly understood}} ||  || Adds a city progression reward if (bAddReward), removes it if (!bAddReward).&lt;br /&gt;
|-&lt;br /&gt;
| 0x40174E || 0x42B4D0 || int || __cdecl || &#039;&#039;&#039;SimulationPrepareDisaster&#039;&#039;&#039; || DWORD *a1, __int16 a2, __int16 a3 || {{Somewhat understood}} ||  || Seems to prepare the starting location for disasters.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401820 || 0x413520 || void || __stdcall || &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; ||  || {{Mostly understood}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; based on game speed || Advances the calendar date and performs all appropriate daily/monthly/etc. tasks. May need better name?&lt;br /&gt;
|-&lt;br /&gt;
| 0x401CA8 || 0x464550 || int || __stdcall || &#039;&#039;&#039;SimulationUpdateWaterConsumption&#039;&#039;&#039; ||  || {{Barely explored}} || Called whenever tiles are placed and on &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 2 || Vanilla SC2K doesn&#039;t call this when tiles are placed on cities over 50,000 pop.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401E65 || 0x471BC0 || char || __stdcall || &#039;&#039;&#039;SimulationDetermineCityCrisis&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called on the last day of the month and from &#039;&#039;sub_406A50&#039;&#039; || Changes the city status line if there&#039;s a new demand, and also starts disasters.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40217B || 0x468150 || int || __stdcall || &#039;&#039;&#039;[[SimulationRCIDemandUpdates]]&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 22? || Handles all RCI bar updates for &amp;quot;zone balance&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4022FC || 0x4358B0 || int || __cdecl || &#039;&#039;&#039;SimulationGrowthTick&#039;&#039;&#039; || __int16 a1, __int16 a2 || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; on days 4-17 || The arguments and algorithms are not yet understood.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402527 || 0x45CF10 || int || __stdcall || &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; || Calls the appropriate disaster creation function and then runs disaster ticks&lt;br /&gt;
|-&lt;br /&gt;
| 0x4026B2 || 0x4734A0 || int || __usercall || &#039;&#039;&#039;SimulationGrowSpecificZone&#039;&#039;&#039; || int a1@&amp;lt;ebp&amp;gt;, __int16 iX, __int16 iY, __int16 iTileID, __int16 iZoneType || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationGrowthTick&#039;&#039;&#039; || Might be an omit-frame-pointer function?&lt;br /&gt;
|-&lt;br /&gt;
| 0x4026F8 || 0x467860 || int || __stdcall || &#039;&#039;&#039;SimulationUpdatePowerConsumption&#039;&#039;&#039; ||  || {{Barely explored}} || Called whenever tiles are placed and on &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 21 || Vanilla SC2K doesn&#039;t call this when tiles are placed on cities over 50,000 pop.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402A3B || 0x405AB0 || DWORD || __thiscall || &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; || CWinApp* this || {{Somewhat understood}} || Called from &#039;&#039;&#039;CWinApp::OnIdle&#039;&#039;&#039; via the class CWinApp vtable || Could stand to have a better name.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402A9F || 0x40C100 || __int16 || __tstdcall || &#039;&#039;&#039;SimulationProcessTimer&#039;&#039;&#039; ||  || {{Mostly understood}} || Called from the root window&#039;s AFX_MSGMAP to handle WM_TIMER messages ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x402D2E || 0x4734A0 || __int16 || __stdcall || &#039;&#039;&#039;SimulationCalculateBudgetUpdates&#039;&#039;&#039; ||  || {{Barely explored}} ||  || 00&lt;br /&gt;
|-&lt;br /&gt;
| 0x403017 || 0x4142C0 || int || __stdcall || &#039;&#039;&#039;SimulationProposeMilitaryBase&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; on day 23 and from &amp;quot;gilmartin&amp;quot; cheat || &lt;br /&gt;
|-&lt;br /&gt;
| 0x401154 || 0x46A840 || int || __stdcall || &#039;&#039;&#039;[[SimulationLandValueMapCalc]]&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; on day 3 || This is where the land value and pollution simulator lives.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ [[Thing]] functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x40132A || 0x4562E0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickSailboat&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Has a rare chance of turning into Nessie&lt;br /&gt;
|-&lt;br /&gt;
| 0x40137F || 0x454EA0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickTornado&#039;&#039;&#039; ||__int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x401992 || 0x4548C0 || void || __usercall || &#039;&#039;&#039;SimulationThingTickMonster&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || The function signature of this one is odd and needs investigation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401B6D || 0x455500 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickTrain&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Used for XTHG_TRAIN_ENGINE and XTHG_UNKNOWN_3&lt;br /&gt;
|-&lt;br /&gt;
| 0x401EBA || 0x452FA0 || int || __cdecl || &#039;&#039;&#039;SimulationSpawnMaxisMan&#039;&#039;&#039; || __int16 iDisasterID || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; || Creates the Thing for Maxis Man and determines based on iDisasterID what his behavior should be&lt;br /&gt;
|-&lt;br /&gt;
| 0x40236F || 0x456760 || void || __usercall || &#039;&#039;&#039;SimulationThingTickCargoShip&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || IDA really doesn&#039;t like this function for some reason&lt;br /&gt;
|-&lt;br /&gt;
| 0x402464 || 0x450890 || int || __stdcall || &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; ||  || {{Barely explored}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; via &#039;&#039;sub_401DBB&#039;&#039; || Does the individual simulation ticks for Things every 30-45 ms.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4024AA || 0x455020 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickMaxisMan&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || If you shoot down a helicopter and it lights something on fire, it&#039;s your own dang fault&lt;br /&gt;
|-&lt;br /&gt;
| 0x4027A2 || 0x453980 || void || __usercall || &#039;&#039;&#039;SimulationThingTickAirplane&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Another one with a bizarre function signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x4028D3 || 0x4546F0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickExplosion&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x402ED2 || 0x4540C0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickHelicopter&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Sound and music functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401096 || 0x4251D0 || int || __thiscall || &#039;&#039;&#039;SoundPlaySound&#039;&#039;&#039; || int* this, int iSoundID || {{Mostly understood}} || Called in so many places || Calls through to &#039;&#039;sub_4802B0&#039;&#039;, which does the buffer loads and calls to &#039;&#039;sndPlaySoundA&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401389 || 0x480890 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicSendMCICommands&#039;&#039;&#039; || unsigned __int16* this, char* szMidiPath || {{Understood}} || Called by &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039; || Sends the actual MCI commands to play/stop a MIDI file&lt;br /&gt;
|-&lt;br /&gt;
| 0x401479 || 0x480770 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039; || unsigned __int16* this, int iSongID || {{Understood}} || Called by &#039;&#039;&#039;MusicPlay&#039;&#039;&#039; || Turns iSongID into szMidiPath&lt;br /&gt;
|-&lt;br /&gt;
| 0x4015FF || 0x480B20 || void || __thiscall || &#039;&#039;&#039;AllocateSoundBuffers&#039;&#039;&#039; || DWORD *this, int a2 || {{Barely explored}} || Called by &#039;&#039;&#039;CMainFrame:OnCreate&#039;&#039;&#039; || Allocates sound buffers; replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x401A9B || 0x425290 || int || __thiscall || &#039;&#039;&#039;MusicPlayNextRefocusSong&#039;&#039;&#039; || unsigned __int16** this || {{Understood}} || Called in a few places || Loops through the non-event music; replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x401CE9 || 0x425220 || int || __thiscall || &#039;&#039;&#039;SoundStopSound&#039;&#039;&#039; || int* this, int iSoundID || {{Understood}} || Called in so many places || Does a few checks then blasts out &#039;&#039;sndPlaySoundA(0, 0)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401F9B || 0x480140 || void || __stdcall || &#039;&#039;&#039;LoadSoundBuffer&#039;&#039;&#039; || int iSoundID, void* lpBuffer || {{Understood}} || Called before a few sound calls || This and many other sound functions are replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x402414 || 0x425260 || int || __thiscall || &#039;&#039;&#039;MusicPlay&#039;&#039;&#039; || unsigned __int16** this, iSongID || {{Understood}} || Called by anything that changes the music || Basically just a trampoline to &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x402BE4 || 0x480AE0 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicStop&#039;&#039;&#039; || int this || {{Understood}} || Called by anything that stops the music || Sends an MCI_CLOSE command to the sequencer device&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Randomness functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401019 || 0x47FC30 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod32&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 32&lt;br /&gt;
|-&lt;br /&gt;
| 0x40116D || 0x47FAA0 || __int16 || __cdecl || &#039;&#039;&#039;RandomWordLCGMod&#039;&#039;&#039; || __int16 iModulus || {{Understood}} ||  || Returns a random word from the LCG modulo iModulus&lt;br /&gt;
|-&lt;br /&gt;
| 0x401415 || 0x47FC70 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod64&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 64&lt;br /&gt;
|-&lt;br /&gt;
| 0x4017AD || 0x47FAE0 || int || __stdcall || &#039;&#039;&#039;GetRandomLFSRState&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns the state of the LFSR&lt;br /&gt;
|-&lt;br /&gt;
| 0x401CAD || 0x47FAF0 || __int16 || __cdecl || &#039;&#039;&#039;RandomWordLFSRMod&#039;&#039;&#039; || __int16 iModulus || {{Understood}} ||  || Returns a random word from the LFSR modulo iModulus&lt;br /&gt;
|-&lt;br /&gt;
| 0x401D9D || 0x47FCF0 || unsigned __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSR&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR&lt;br /&gt;
|-&lt;br /&gt;
| 0x401F19 || 0x47FA80 || int || __cdecl || &#039;&#039;&#039;SeedRandomLCG&#039;&#039;&#039; || int iSeed || {{Understood}} ||  || Sets the LCG state&lt;br /&gt;
|-&lt;br /&gt;
| 0x402261 || 0x47FB70 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod4&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 4&lt;br /&gt;
|-&lt;br /&gt;
| 0x4025E5 || 0x47FBF0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod16&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 16&lt;br /&gt;
|-&lt;br /&gt;
| 0x402626 || 0x47FAD0 || int || __cdecl || &#039;&#039;&#039;SeedRandomLFSR&#039;&#039;&#039; || int iSeed || {{Understood}} ||  || Sets the LFSR state&lt;br /&gt;
|-&lt;br /&gt;
| 0x40288D || 0x47FBB0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod8&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 8&lt;br /&gt;
|-&lt;br /&gt;
| 0x402946 || 0x47FB30 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod2&#039;&#039;&#039; ||  || {{Understood}} || Called by &#039;&#039;&#039;SimulationThingTickTrain&#039;&#039;&#039; and &#039;&#039;&#039;SimulationDoDisasterTick&#039;&#039;&#039; || Returns a random word from the LFSR modulo 2&lt;br /&gt;
|-&lt;br /&gt;
| 0x402B3F || 0x47FCB0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod128&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 128&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Frequently-reused MFC class functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x40219E || 0x4815E0 || INT_PTR || __thiscall || &#039;&#039;&#039;CGameDialog::DoModal&#039;&#039;&#039; || LPCDLGTEMPLATEA* this || {{Understood}} || Called in so many places || Seems to pause the simulation, call CDialog::DoModal(this), then restore the simulation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40281A || 0x481300 || struct CRuntimeClass* || __stdcall || &#039;&#039;&#039;CGameDialog::GetRuntimeClass&#039;&#039;&#039; ||  || {{Understood}} ||  || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Game data]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Function_list&amp;diff=94</id>
		<title>Function list</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Function_list&amp;diff=94"/>
		<updated>2025-03-09T00:24:07Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: Add thunks and function signatures for two functions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Heavy construction}}&lt;br /&gt;
&lt;br /&gt;
This is a table of functions in SimCity 2000 that have been at least partially reverse engineered and given names. It is probably going to be unpleasant to update, but at least it looks nice and you can sort it.&lt;br /&gt;
&lt;br /&gt;
When adding new functions to the table, please make sure you insert them into the appropriate order by thunk address (the function that just has a &amp;lt;code&amp;gt;jmp &#039;&#039;&#039;ActualFunctionBody&#039;&#039;&#039;&amp;lt;/code&amp;gt; instruction in it). If/when it gets too unwieldy we can split it out into multiple tables.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Uncategorized functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401262 || 0x468D30 || int || __stdcall || &#039;&#039;&#039;[[EQ_LE_Processing]]&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 22? || Handles EQ and LE simulation for the month.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40130C || 0x45F760 || {{Win32_BOOL}} || __stdcall || &#039;&#039;&#039;SimulationDoDisasterTick&#039;&#039;&#039; ||  || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x4013ED || 0x42BCA0 || int || __cdecl || &#039;&#039;&#039;SimulationCalculateOrdinanceCost&#039;&#039;&#039; || DWORD dwOrdinance || {{Mostly understood}} ||  || Returns the effective cost of an ordinance&lt;br /&gt;
|-&lt;br /&gt;
| 0x401460 || 0x44CF60 || char || __cdecl || &#039;&#039;&#039;SimulationProvisionMicrosim&#039;&#039;&#039; || __int16 a1, int a2, __int16 iTileID || {{Barely explored}} ||  || iTileID is the only argument used; needs some RE work for sure&lt;br /&gt;
|-&lt;br /&gt;
| 0x4015E6 || 0x4731E0 || int || __cdecl || &#039;&#039;&#039;SimulationPrepareBudgetDialog&#039;&#039;&#039; || int a1 || {{Mostly understood}} ||  || arg a1 only referenced on line, seems to be more like &amp;quot;BOOL bUseParentWindow&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401672 || 0x441E50 || int || __cdecl || &#039;&#039;&#039;SimulationGrantReward&#039;&#039;&#039; || __int16 iRewardID, BOOL bAddReward || {{Mostly understood}} ||  || Adds a city progression reward if (bAddReward), removes it if (!bAddReward).&lt;br /&gt;
|-&lt;br /&gt;
| 0x40174E || 0x42B4D0 || int || __cdecl || &#039;&#039;&#039;SimulationPrepareDisaster&#039;&#039;&#039; || DWORD *a1, __int16 a2, __int16 a3 || {{Somewhat understood}} ||  || Seems to prepare the starting location for disasters.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401820 || 0x413520 || void || __stdcall || &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; ||  || {{Mostly understood}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; based on game speed || Advances the calendar date and performs all appropriate daily/monthly/etc. tasks. May need better name?&lt;br /&gt;
|-&lt;br /&gt;
| 0x401CA8 || 0x464550 || int || __stdcall || &#039;&#039;&#039;SimulationUpdateWaterConsumption&#039;&#039;&#039; ||  || {{Barely explored}} || Called whenever tiles are placed and on &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 2 || Vanilla SC2K doesn&#039;t call this when tiles are placed on cities over 50,000 pop.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401E65 || 0x471BC0 || char || __stdcall || &#039;&#039;&#039;SimulationDetermineCityCrisis&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called on the last day of the month and from &#039;&#039;sub_406A50&#039;&#039; || Changes the city status line if there&#039;s a new demand, and also starts disasters.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40217B || 0x468150 || int || __stdcall || &#039;&#039;&#039;[[RCIDemandUpdates]]&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 22? || Handles all RCI bar updates for &amp;quot;zone balance&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x4022FC || 0x4358B0 || int || __cdecl || &#039;&#039;&#039;SimulationGrowthTick&#039;&#039;&#039; || __int16 a1, __int16 a2 || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; on days 4-17 || The arguments and algorithms are not yet understood.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402527 || 0x45CF10 || int || __stdcall || &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; || Calls the appropriate disaster creation function and then runs disaster ticks&lt;br /&gt;
|-&lt;br /&gt;
| 0x4026B2 || 0x4734A0 || int || __usercall || &#039;&#039;&#039;SimulationGrowSpecificZone&#039;&#039;&#039; || int a1@&amp;lt;ebp&amp;gt;, __int16 iX, __int16 iY, __int16 iTileID, __int16 iZoneType || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationGrowthTick&#039;&#039;&#039; || Might be an omit-frame-pointer function?&lt;br /&gt;
|-&lt;br /&gt;
| 0x4026F8 || 0x467860 || int || __stdcall || &#039;&#039;&#039;SimulationUpdatePowerConsumption&#039;&#039;&#039; ||  || {{Barely explored}} || Called whenever tiles are placed and on &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 21 || Vanilla SC2K doesn&#039;t call this when tiles are placed on cities over 50,000 pop.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402A3B || 0x405AB0 || DWORD || __thiscall || &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; || CWinApp* this || {{Somewhat understood}} || Called from &#039;&#039;&#039;CWinApp::OnIdle&#039;&#039;&#039; via the class CWinApp vtable || Could stand to have a better name.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402D2E || 0x4734A0 || __int16 || __stdcall || &#039;&#039;&#039;SimulationCalculateBudgetUpdates&#039;&#039;&#039; ||  || {{Barely explored}} ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x403017 || 0x4142C0 || int || __stdcall || &#039;&#039;&#039;SimulationProposeMilitaryBase&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 23 and from &amp;quot;gilmartin&amp;quot; cheat || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ [[Thing]] functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x40132A || 0x4562E0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickSailboat&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Has a rare chance of turning into Nessie&lt;br /&gt;
|-&lt;br /&gt;
| 0x40137F || 0x454EA0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickTornado&#039;&#039;&#039; ||__int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x401992 || 0x4548C0 || void || __usercall || &#039;&#039;&#039;SimulationThingTickMonster&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || The function signature of this one is odd and needs investigation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401B6D || 0x455500 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickTrain&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Used for XTHG_TRAIN_ENGINE and XTHG_UNKNOWN_3&lt;br /&gt;
|-&lt;br /&gt;
| 0x401EBA || 0x452FA0 || int || __cdecl || &#039;&#039;&#039;SimulationSpawnMaxisMan&#039;&#039;&#039; || __int16 iDisasterID || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; || Creates the Thing for Maxis Man and determines based on iDisasterID what his behavior should be&lt;br /&gt;
|-&lt;br /&gt;
| 0x40236F || 0x456760 || void || __usercall || &#039;&#039;&#039;SimulationThingTickCargoShip&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || IDA really doesn&#039;t like this function for some reason&lt;br /&gt;
|-&lt;br /&gt;
| 0x402464 || 0x450890 || int || __stdcall || &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; ||  || {{Barely explored}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; via &#039;&#039;sub_401DBB&#039;&#039; || Does the individual simulation ticks for Things every 30-45 ms.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4024AA || 0x455020 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickMaxisMan&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || If you shoot down a helicopter and it lights something on fire, it&#039;s your own dang fault&lt;br /&gt;
|-&lt;br /&gt;
| 0x4027A2 || 0x453980 || void || __usercall || &#039;&#039;&#039;SimulationThingTickAirplane&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Another one with a bizarre function signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x4028D3 || 0x4546F0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickExplosion&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x402ED2 || 0x4540C0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickHelicopter&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Sound and music functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401096 || 0x4251D0 || int || __thiscall || &#039;&#039;&#039;SoundPlaySound&#039;&#039;&#039; || int* this, int iSoundID || {{Mostly understood}} || Called in so many places || Calls through to &#039;&#039;sub_4802B0&#039;&#039;, which does the buffer loads and calls to &#039;&#039;sndPlaySoundA&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401389 || 0x480890 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicSendMCICommands&#039;&#039;&#039; || unsigned __int16* this, char* szMidiPath || {{Understood}} || Called by &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039; || Sends the actual MCI commands to play/stop a MIDI file&lt;br /&gt;
|-&lt;br /&gt;
| 0x401479 || 0x480770 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039; || unsigned __int16* this, int iSongID || {{Understood}} || Called by &#039;&#039;&#039;MusicPlay&#039;&#039;&#039; || Turns iSongID into szMidiPath&lt;br /&gt;
|-&lt;br /&gt;
| 0x4015FF || 0x480B20 || void || __thiscall || &#039;&#039;&#039;AllocateSoundBuffers&#039;&#039;&#039; || DWORD *this, int a2 || {{Barely explored}} || Called by &#039;&#039;&#039;CMainFrame:OnCreate&#039;&#039;&#039; || Allocates sound buffers; replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x401A9B || 0x425290 || int || __thiscall || &#039;&#039;&#039;MusicPlayNextRefocusSong&#039;&#039;&#039; || unsigned __int16** this || {{Understood}} || Called in a few places || Loops through the non-event music; replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x401CE9 || 0x425220 || int || __thiscall || &#039;&#039;&#039;SoundStopSound&#039;&#039;&#039; || int* this, int iSoundID || {{Understood}} || Called in so many places || Does a few checks then blasts out &#039;&#039;sndPlaySoundA(0, 0)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401F9B || 0x480140 || void || __stdcall || &#039;&#039;&#039;LoadSoundBuffer&#039;&#039;&#039; || int iSoundID, void* lpBuffer || {{Understood}} || Called before a few sound calls || This and many other sound functions are replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x402414 || 0x425260 || int || __thiscall || &#039;&#039;&#039;MusicPlay&#039;&#039;&#039; || unsigned __int16** this, iSongID || {{Understood}} || Called by anything that changes the music || Basically just a trampoline to &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x402BE4 || 0x480AE0 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicStop&#039;&#039;&#039; || int this || {{Understood}} || Called by anything that stops the music || Sends an MCI_CLOSE command to the sequencer device&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Randomness functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401019 || 0x47FC30 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod32&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 32&lt;br /&gt;
|-&lt;br /&gt;
| 0x40116D || 0x47FAA0 || __int16 || __cdecl || &#039;&#039;&#039;RandomWordLCGMod&#039;&#039;&#039; || __int16 iModulus || {{Understood}} ||  || Returns a random word from the LCG modulo iModulus&lt;br /&gt;
|-&lt;br /&gt;
| 0x401415 || 0x47FC70 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod64&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 64&lt;br /&gt;
|-&lt;br /&gt;
| 0x4017AD || 0x47FAE0 || int || __stdcall || &#039;&#039;&#039;GetRandomLFSRState&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns the state of the LFSR&lt;br /&gt;
|-&lt;br /&gt;
| 0x401CAD || 0x47FAF0 || __int16 || __cdecl || &#039;&#039;&#039;RandomWordLFSRMod&#039;&#039;&#039; || __int16 iModulus || {{Understood}} ||  || Returns a random word from the LFSR modulo iModulus&lt;br /&gt;
|-&lt;br /&gt;
| 0x401D9D || 0x47FCF0 || unsigned __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSR&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR&lt;br /&gt;
|-&lt;br /&gt;
| 0x401F19 || 0x47FA80 || int || __cdecl || &#039;&#039;&#039;SeedRandomLCG&#039;&#039;&#039; || int iSeed || {{Understood}} ||  || Sets the LCG state&lt;br /&gt;
|-&lt;br /&gt;
| 0x402261 || 0x47FB70 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod4&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 4&lt;br /&gt;
|-&lt;br /&gt;
| 0x4025E5 || 0x47FBF0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod16&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 16&lt;br /&gt;
|-&lt;br /&gt;
| 0x402626 || 0x47FAD0 || int || __cdecl || &#039;&#039;&#039;SeedRandomLFSR&#039;&#039;&#039; || int iSeed || {{Understood}} ||  || Sets the LFSR state&lt;br /&gt;
|-&lt;br /&gt;
| 0x40288D || 0x47FBB0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod8&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 8&lt;br /&gt;
|-&lt;br /&gt;
| 0x402946 || 0x47FB30 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod2&#039;&#039;&#039; ||  || {{Understood}} || Called by &#039;&#039;&#039;SimulationThingTickTrain&#039;&#039;&#039; and &#039;&#039;&#039;SimulationDoDisasterTick&#039;&#039;&#039; || Returns a random word from the LFSR modulo 2&lt;br /&gt;
|-&lt;br /&gt;
| 0x402B3F || 0x47FCB0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod128&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 128&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Frequently-reused MFC class functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x40219E || 0x4815E0 || INT_PTR || __thiscall || &#039;&#039;&#039;CGameDialog::DoModal&#039;&#039;&#039; || LPCDLGTEMPLATEA* this || {{Understood}} || Called in so many places || Seems to pause the simulation, call CDialog::DoModal(this), then restore the simulation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40281A || 0x481300 || struct CRuntimeClass* || __stdcall || &#039;&#039;&#039;CGameDialog::GetRuntimeClass&#039;&#039;&#039; ||  || {{Understood}} ||  || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Game data]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Main_Page&amp;diff=74</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Main_Page&amp;diff=74"/>
		<updated>2025-03-08T05:52:45Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ __NOEDITSECTION__ {{#description2:Welcome to sc2k-reverse, the sc2kfix Project wiki!}}&lt;br /&gt;
[[File:{{#setmainimage:SC2K-reverse Header.png}}|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Welcome to sc2k-reverse, the sc2kfix Project wiki!&#039;&#039;&#039; Pardon our dust, as this wiki is brand new and we haven&#039;t had a chance to do much of anything around here yet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;u&amp;gt;Need an account?&amp;lt;/u&amp;gt;&#039;&#039;&#039; PM araxestroy on the Simtropolis forums or on the libera.chat IRC network.&lt;br /&gt;
&lt;br /&gt;
== Wiki to-do list ==&lt;br /&gt;
&lt;br /&gt;
* More page component templates (see [[:Category:Templates]])&lt;br /&gt;
** Game infoboxes&lt;br /&gt;
** RE related stuff? Not sure what we&#039;ll need&lt;br /&gt;
** Category navboxes&lt;br /&gt;
* Wiki meta pages (categories, help, copyright page, etc)&lt;br /&gt;
* Nicer main page (maybe split it into flex columns?)&lt;br /&gt;
* Get some stub articles written up as a &amp;quot;schema&amp;quot;&lt;br /&gt;
* &amp;lt;s&amp;gt;Make sure the email system actually works&amp;lt;/s&amp;gt; it absolutely does not, I may need to move this thing to a Linode VPS sooner rather than later&lt;br /&gt;
&lt;br /&gt;
== sc2kfix Plugin Information ==&lt;br /&gt;
&lt;br /&gt;
* [https://sc2kfix.net/plugin.html Plugin user guide]&lt;br /&gt;
&lt;br /&gt;
== SimCity 2000 Reverse Engineering ==&lt;br /&gt;
&lt;br /&gt;
* [[Function list]]&lt;br /&gt;
* [[Known global variables]]&lt;br /&gt;
* [[Classes]]&lt;br /&gt;
* [[Map data]]&lt;br /&gt;
* [[Data formats]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Main_Page&amp;diff=73</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Main_Page&amp;diff=73"/>
		<updated>2025-03-08T05:20:20Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ __NOEDITSECTION__ {{#description2:Welcome to sc2k-reverse, the sc2kfix Project wiki!}}&lt;br /&gt;
[[File:{{#setmainimage:SC2K-reverse Header.png}}|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Welcome to sc2k-reverse, the sc2kfix Project wiki!&#039;&#039;&#039; Pardon our dust, as this wiki is brand new and we haven&#039;t had a chance to do much of anything around here yet.&lt;br /&gt;
&lt;br /&gt;
== Wiki to-do list ==&lt;br /&gt;
&lt;br /&gt;
* More page component templates (see [[:Category:Templates]])&lt;br /&gt;
** Game infoboxes&lt;br /&gt;
** RE related stuff? Not sure what we&#039;ll need&lt;br /&gt;
** Category navboxes&lt;br /&gt;
* Wiki meta pages (categories, help, copyright page, etc)&lt;br /&gt;
* Nicer main page (maybe split it into flex columns?)&lt;br /&gt;
* Get some stub articles written up as a &amp;quot;schema&amp;quot;&lt;br /&gt;
* &amp;lt;s&amp;gt;Make sure the email system actually works&amp;lt;/s&amp;gt; it absolutely does not, I may need to move this thing to a Linode VPS sooner rather than later&lt;br /&gt;
&lt;br /&gt;
== sc2kfix Plugin Information ==&lt;br /&gt;
&lt;br /&gt;
* [https://sc2kfix.net/plugin.html Plugin user guide]&lt;br /&gt;
&lt;br /&gt;
== SimCity 2000 Reverse Engineering ==&lt;br /&gt;
&lt;br /&gt;
* [[Function list]]&lt;br /&gt;
* [[Known global variables]]&lt;br /&gt;
* [[Classes]]&lt;br /&gt;
* [[Map data]]&lt;br /&gt;
* [[Data formats]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Function_list&amp;diff=64</id>
		<title>Function list</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Function_list&amp;diff=64"/>
		<updated>2025-03-07T10:21:33Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Heavy construction}}&lt;br /&gt;
&lt;br /&gt;
This is a table of functions in SimCity 2000 that have been at least partially reverse engineered and given names. It is probably going to be unpleasant to update, but at least it looks nice and you can sort it.&lt;br /&gt;
&lt;br /&gt;
When adding new functions to the table, please make sure you insert them into the appropriate order by thunk address (the function that just has a &amp;lt;code&amp;gt;jmp &#039;&#039;&#039;ActualFunctionBody&#039;&#039;&#039;&amp;lt;/code&amp;gt; instruction in it). If/when it gets too unwieldy we can split it out into multiple tables.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Uncategorized functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x40130C || 0x45F760 || {{Win32_BOOL}} || __stdcall || &#039;&#039;&#039;SimulationDoDisasterTick&#039;&#039;&#039; ||  || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x4013ED || 0x42BCA0 || int || __cdecl || &#039;&#039;&#039;SimulationCalculateOrdinanceCost&#039;&#039;&#039; || DWORD dwOrdinance || {{Mostly understood}} ||  || Returns the effective cost of an ordinance&lt;br /&gt;
|-&lt;br /&gt;
| 0x401460 || 0x44CF60 || char || __cdecl || &#039;&#039;&#039;SimulationProvisionMicrosim&#039;&#039;&#039; || __int16 a1, int a2, __int16 iTileID || {{Barely explored}} ||  || iTileID is the only argument used; needs some RE work for sure&lt;br /&gt;
|-&lt;br /&gt;
| 0x4015E6 || 0x4731E0 || int || __cdecl || &#039;&#039;&#039;SimulationPrepareBudgetDialog&#039;&#039;&#039; || int a1 || {{Mostly understood}} ||  || arg a1 only referenced on line, seems to be more like &amp;quot;BOOL bUseParentWindow&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401672 || 0x441E50 || int || __cdecl || &#039;&#039;&#039;SimulationGrantReward&#039;&#039;&#039; || __int16 iRewardID, BOOL bAddReward || {{Mostly understood}} ||  || Adds a city progression reward if (bAddReward), removes it if (!bAddReward).&lt;br /&gt;
|-&lt;br /&gt;
| 0x40174E || 0x42B4D0 || int || __cdecl || &#039;&#039;&#039;SimulationPrepareDisaster&#039;&#039;&#039; || DWORD *a1, __int16 a2, __int16 a3 || {{Somewhat understood}} ||  || Seems to prepare the starting location for disasters.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401820 || 0x413520 || void || __stdcall || &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; ||  || {{Mostly understood}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; based on game speed || Advances the calendar date and performs all appropriate daily/monthly/etc. tasks. May need better name?&lt;br /&gt;
|-&lt;br /&gt;
| 0x401CA8 || 0x464550 || int || __stdcall || &#039;&#039;&#039;SimulationUpdateWaterConsumption&#039;&#039;&#039; ||  || {{Barely explored}} || Called whenever tiles are placed and on &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 2 || Vanilla SC2K doesn&#039;t call this when tiles are placed on cities over 50,000 pop.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401E65 || 0x471BC0 || char || __stdcall || &#039;&#039;&#039;SimulationDetermineCityCrisis&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called on the last day of the month and from &#039;&#039;sub_406A50&#039;&#039; || Changes the city status line if there&#039;s a new demand, and also starts disasters.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4022FC || 0x4358B0 || int || __cdecl || &#039;&#039;&#039;SimulationGrowthTick&#039;&#039;&#039; || __int16 a1, __int16 a2 || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; on days 4-17 || The arguments and algorithms are not yet understood.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402527 || 0x45CF10 || int || __stdcall || &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; || Calls the appropriate disaster creation function and then runs disaster ticks&lt;br /&gt;
|-&lt;br /&gt;
| 0x4026B2 || 0x4734A0 || int || __usercall || &#039;&#039;&#039;SimulationGrowSpecificZone&#039;&#039;&#039; || int a1@&amp;lt;ebp&amp;gt;, __int16 iX, __int16 iY, __int16 iTileID, __int16 iZoneType || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationGrowthTick&#039;&#039;&#039; || Might be an omit-frame-pointer function?&lt;br /&gt;
|-&lt;br /&gt;
| 0x4026F8 || 0x467860 || int || __stdcall || &#039;&#039;&#039;SimulationUpdatePowerConsumption&#039;&#039;&#039; ||  || {{Barely explored}} || Called whenever tiles are placed and on &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 21 || Vanilla SC2K doesn&#039;t call this when tiles are placed on cities over 50,000 pop.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402A3B || 0x405AB0 || DWORD || __thiscall || &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; || CWinApp* this || {{Somewhat understood}} || Called from &#039;&#039;&#039;CWinApp::OnIdle&#039;&#039;&#039; via the class CWinApp vtable || Could stand to have a better name.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402D2E || 0x4734A0 || __int16 || __stdcall || &#039;&#039;&#039;SimulationCalculateBudgetUpdates&#039;&#039;&#039; ||  || {{Barely explored}} ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x403017 || 0x4142C0 || int || __stdcall || &#039;&#039;&#039;SimulationProposeMilitaryBase&#039;&#039;&#039; ||  || {{Somewhat understood}} || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 23 and from &amp;quot;gilmartin&amp;quot; cheat || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ [[Thing]] functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x40132A || 0x4562E0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickSailboat&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Has a rare chance of turning into Nessie&lt;br /&gt;
|-&lt;br /&gt;
| 0x40137F || 0x454EA0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickTornado&#039;&#039;&#039; ||__int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x401992 || 0x4548C0 || void || __usercall || &#039;&#039;&#039;SimulationThingTickMonster&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || The function signature of this one is odd and needs investigation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401B6D || 0x455500 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickTrain&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Used for XTHG_TRAIN_ENGINE and XTHG_UNKNOWN_3&lt;br /&gt;
|-&lt;br /&gt;
| 0x401EBA || 0x452FA0 || int || __cdecl || &#039;&#039;&#039;SimulationSpawnMaxisMan&#039;&#039;&#039; || __int16 iDisasterID || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; || Creates the Thing for Maxis Man and determines based on iDisasterID what his behavior should be&lt;br /&gt;
|-&lt;br /&gt;
| 0x40236F || 0x456760 || void || __usercall || &#039;&#039;&#039;SimulationThingTickCargoShip&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || IDA really doesn&#039;t like this function for some reason&lt;br /&gt;
|-&lt;br /&gt;
| 0x402464 || 0x450890 || int || __stdcall || &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; ||  || {{Barely explored}} || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; via &#039;&#039;sub_401DBB&#039;&#039; || Does the individual simulation ticks for Things every 30-45 ms.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4024AA || 0x455020 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickMaxisMan&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || If you shoot down a helicopter and it lights something on fire, it&#039;s your own dang fault&lt;br /&gt;
|-&lt;br /&gt;
| 0x4027A2 || 0x453980 || void || __usercall || &#039;&#039;&#039;SimulationThingTickAirplane&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Another one with a bizarre function signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x4028D3 || 0x4546F0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickExplosion&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x402ED2 || 0x4540C0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickHelicopter&#039;&#039;&#039; || __int16 iXTHGIndex || {{Barely explored}} || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Sound and music functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401096 || 0x4251D0 || int || __thiscall || &#039;&#039;&#039;SoundPlaySound&#039;&#039;&#039; || int* this, int iSoundID || {{Mostly understood}} || Called in so many places || Calls through to &#039;&#039;sub_4802B0&#039;&#039;, which does the buffer loads and calls to &#039;&#039;sndPlaySoundA&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401389 || 0x480890 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicSendMCICommands&#039;&#039;&#039; || unsigned __int16* this, char* szMidiPath || {{Understood}} || Called by &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039; || Sends the actual MCI commands to play/stop a MIDI file&lt;br /&gt;
|-&lt;br /&gt;
| 0x401479 || 0x480770 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039; || unsigned __int16* this, int iSongID || {{Understood}} || Called by &#039;&#039;&#039;MusicPlay&#039;&#039;&#039; || Turns iSongID into szMidiPath&lt;br /&gt;
|-&lt;br /&gt;
| 0x4015FF || 0x480B20 || void || __thiscall || &#039;&#039;&#039;AllocateSoundBuffers&#039;&#039;&#039; || DWORD *this, int a2 || {{Barely explored}} || Called by &#039;&#039;&#039;CMainFrame:OnCreate&#039;&#039;&#039; || Allocates sound buffers; replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x401A9B || 0x425290 || int || __thiscall || &#039;&#039;&#039;MusicPlayNextRefocusSong&#039;&#039;&#039; || unsigned __int16** this || {{Understood}} || Called in a few places || Loops through the non-event music; replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x401CE9 || 0x425220 || int || __thiscall || &#039;&#039;&#039;SoundStopSound&#039;&#039;&#039; || int* this, int iSoundID || {{Understood}} || Called in so many places || Does a few checks then blasts out &#039;&#039;sndPlaySoundA(0, 0)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401F9B || 0x480140 || void || __stdcall || &#039;&#039;&#039;LoadSoundBuffer&#039;&#039;&#039; || int iSoundID, void* lpBuffer || {{Understood}} || Called before a few sound calls || This and many other sound functions are replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x402414 || 0x425260 || int || __thiscall || &#039;&#039;&#039;MusicPlay&#039;&#039;&#039; || unsigned __int16** this, iSongID || {{Understood}} || Called by anything that changes the music || Basically just a trampoline to &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x402BE4 || 0x480AE0 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicStop&#039;&#039;&#039; || int this || {{Understood}} || Called by anything that stops the music || Sends an MCI_CLOSE command to the sequencer device&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Randomness functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401019 || 0x47FC30 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod32&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 32&lt;br /&gt;
|-&lt;br /&gt;
| 0x40116D || 0x47FAA0 || __int16 || __cdecl || &#039;&#039;&#039;RandomWordLCGMod&#039;&#039;&#039; || __int16 iModulus || {{Understood}} ||  || Returns a random word from the LCG modulo iModulus&lt;br /&gt;
|-&lt;br /&gt;
| 0x401415 || 0x47FC70 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod64&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 64&lt;br /&gt;
|-&lt;br /&gt;
| 0x4017AD || 0x47FAE0 || int || __stdcall || &#039;&#039;&#039;GetRandomLFSRState&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns the state of the LFSR&lt;br /&gt;
|-&lt;br /&gt;
| 0x401CAD || 0x47FAF0 || __int16 || __cdecl || &#039;&#039;&#039;RandomWordLFSRMod&#039;&#039;&#039; || __int16 iModulus || {{Understood}} ||  || Returns a random word from the LFSR modulo iModulus&lt;br /&gt;
|-&lt;br /&gt;
| 0x401D9D || 0x47FCF0 || unsigned __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSR&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR&lt;br /&gt;
|-&lt;br /&gt;
| 0x401F19 || 0x47FA80 || int || __cdecl || &#039;&#039;&#039;SeedRandomLCG&#039;&#039;&#039; || int iSeed || {{Understood}} ||  || Sets the LCG state&lt;br /&gt;
|-&lt;br /&gt;
| 0x402261 || 0x47FB70 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod4&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 4&lt;br /&gt;
|-&lt;br /&gt;
| 0x4025E5 || 0x47FBF0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod16&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 16&lt;br /&gt;
|-&lt;br /&gt;
| 0x402626 || 0x47FAD0 || int || __cdecl || &#039;&#039;&#039;SeedRandomLFSR&#039;&#039;&#039; || int iSeed || {{Understood}} ||  || Sets the LFSR state&lt;br /&gt;
|-&lt;br /&gt;
| 0x40288D || 0x47FBB0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod8&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 8&lt;br /&gt;
|-&lt;br /&gt;
| 0x402946 || 0x47FB30 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod2&#039;&#039;&#039; ||  || {{Understood}} || Called by &#039;&#039;&#039;SimulationThingTickTrain&#039;&#039;&#039; and &#039;&#039;&#039;SimulationDoDisasterTick&#039;&#039;&#039; || Returns a random word from the LFSR modulo 2&lt;br /&gt;
|-&lt;br /&gt;
| 0x402B3F || 0x47FCB0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod128&#039;&#039;&#039; ||  || {{Understood}} ||  || Returns a random word from the LFSR modulo 128&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Frequently-reused MFC class functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x40219E || 0x4815E0 || INT_PTR || __thiscall || &#039;&#039;&#039;CGameDialog::DoModal&#039;&#039;&#039; || LPCDLGTEMPLATEA* this || {{Understood}} || Called in so many places || Seems to pause the simulation, call CDialog::DoModal(this), then restore the simulation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40281A || 0x481300 || struct CRuntimeClass* || __stdcall || &#039;&#039;&#039;CGameDialog::GetRuntimeClass&#039;&#039;&#039; ||  || {{Understood}} ||  || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Game data]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Template:Mostly_understood&amp;diff=63</id>
		<title>Template:Mostly understood</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Template:Mostly_understood&amp;diff=63"/>
		<updated>2025-03-07T10:21:21Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;/noinclude&amp;gt;style=&amp;quot;background:#BBFFCC; color:black; {{{style|}}}&amp;quot; class=&amp;quot;table-yes&amp;quot;|Mostly understood&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Template:Barely_explored&amp;diff=62</id>
		<title>Template:Barely explored</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Template:Barely_explored&amp;diff=62"/>
		<updated>2025-03-07T10:18:40Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: Created page with &amp;quot;&amp;lt;noinclude&amp;gt; {| class=&amp;quot;wikitable&amp;quot; |- |&amp;lt;/noinclude&amp;gt;style=&amp;quot;background:#FFC7C7; color:black; {{{style|}}}&amp;quot; class=&amp;quot;table-yes&amp;quot;|Barely explored&amp;lt;noinclude&amp;gt; |} Category:Templates&amp;lt;/noinclude&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;/noinclude&amp;gt;style=&amp;quot;background:#FFC7C7; color:black; {{{style|}}}&amp;quot; class=&amp;quot;table-yes&amp;quot;|Barely explored&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Template:Somewhat_understood&amp;diff=61</id>
		<title>Template:Somewhat understood</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Template:Somewhat_understood&amp;diff=61"/>
		<updated>2025-03-07T10:18:01Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: Created page with &amp;quot;&amp;lt;noinclude&amp;gt; {| class=&amp;quot;wikitable&amp;quot; |- |&amp;lt;/noinclude&amp;gt;style=&amp;quot;background:#FFFF88; color:black; {{{style|}}}&amp;quot; class=&amp;quot;table-yes&amp;quot;|Somewhat understood&amp;lt;noinclude&amp;gt; |} Category:Templates&amp;lt;/noinclude&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;/noinclude&amp;gt;style=&amp;quot;background:#FFFF88; color:black; {{{style|}}}&amp;quot; class=&amp;quot;table-yes&amp;quot;|Somewhat understood&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Template:Mostly_understood&amp;diff=60</id>
		<title>Template:Mostly understood</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Template:Mostly_understood&amp;diff=60"/>
		<updated>2025-03-07T10:17:24Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: Created page with &amp;quot;&amp;lt;noinclude&amp;gt; {| class=&amp;quot;wikitable&amp;quot; |- |&amp;lt;/noinclude&amp;gt;style=&amp;quot;background:#CCEEFF; color:black; {{{style|}}}&amp;quot; class=&amp;quot;table-yes&amp;quot;|Mostly understood&amp;lt;noinclude&amp;gt; |} Category:Templates&amp;lt;/noinclude&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;/noinclude&amp;gt;style=&amp;quot;background:#CCEEFF; color:black; {{{style|}}}&amp;quot; class=&amp;quot;table-yes&amp;quot;|Mostly understood&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Template:Understood&amp;diff=59</id>
		<title>Template:Understood</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Template:Understood&amp;diff=59"/>
		<updated>2025-03-07T10:16:44Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: Created page with &amp;quot;&amp;lt;noinclude&amp;gt; {| class=&amp;quot;wikitable&amp;quot; |- |&amp;lt;/noinclude&amp;gt;style=&amp;quot;background:#9EFF9E; color:black; {{{style|}}}&amp;quot; class=&amp;quot;table-yes&amp;quot;|Understood&amp;lt;noinclude&amp;gt; |} Category:Templates&amp;lt;/noinclude&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;/noinclude&amp;gt;style=&amp;quot;background:#9EFF9E; color:black; {{{style|}}}&amp;quot; class=&amp;quot;table-yes&amp;quot;|Understood&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[Category:Templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
	<entry>
		<id>https://wiki.sc2kfix.net/w/index.php?title=Function_list&amp;diff=58</id>
		<title>Function list</title>
		<link rel="alternate" type="text/html" href="https://wiki.sc2kfix.net/w/index.php?title=Function_list&amp;diff=58"/>
		<updated>2025-03-07T00:42:28Z</updated>

		<summary type="html">&lt;p&gt;Araxestroy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Heavy construction}}&lt;br /&gt;
&lt;br /&gt;
This is a table of functions in SimCity 2000 that have been at least partially reverse engineered and given names. It is probably going to be unpleasant to update, but at least it looks nice and you can sort it.&lt;br /&gt;
&lt;br /&gt;
When adding new functions to the table, please make sure you insert them into the appropriate order by thunk address (the function that just has a &amp;lt;code&amp;gt;jmp &#039;&#039;&#039;ActualFunctionBody&#039;&#039;&#039;&amp;lt;/code&amp;gt; instruction in it). If/when it gets too unwieldy we can split it out into multiple tables.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Uncategorized functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x40130C || 0x45F760 || {{Win32_BOOL}} || __stdcall || &#039;&#039;&#039;SimulationDoDisasterTick&#039;&#039;&#039; ||  || Barely explored || Called from &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x4013ED || 0x42BCA0 || int || __cdecl || &#039;&#039;&#039;SimulationCalculateOrdinanceCost&#039;&#039;&#039; || DWORD dwOrdinance || Mostly understood ||  || Returns the effective cost of an ordinance&lt;br /&gt;
|-&lt;br /&gt;
| 0x401460 || 0x44CF60 || char || __cdecl || &#039;&#039;&#039;SimulationProvisionMicrosim&#039;&#039;&#039; || __int16 a1, int a2, __int16 iTileID || Barely explored ||  || iTileID is the only argument used; needs some RE work for sure&lt;br /&gt;
|-&lt;br /&gt;
| 0x4015E6 || 0x4731E0 || int || __cdecl || &#039;&#039;&#039;SimulationPrepareBudgetDialog&#039;&#039;&#039; || int a1 || Mostly understood ||  || arg a1 only referenced on line, seems to be more like &amp;quot;BOOL bUseParentWindow&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401672 || 0x441E50 || int || __cdecl || &#039;&#039;&#039;SimulationGrantReward&#039;&#039;&#039; || __int16 iRewardID, BOOL bAddReward || Mostly understood ||  || Adds a city progression reward if (bAddReward), removes it if (!bAddReward).&lt;br /&gt;
|-&lt;br /&gt;
| 0x40174E || 0x42B4D0 || int || __cdecl || &#039;&#039;&#039;SimulationPrepareDisaster&#039;&#039;&#039; || DWORD *a1, __int16 a2, __int16 a3 || Somewhat understood ||  || Seems to prepare the starting location for disasters.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401820 || 0x413520 || void || __stdcall || &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; ||  || Mostly understood || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; based on game speed || Advances the calendar date and performs all appropriate daily/monthly/etc. tasks. May need better name?&lt;br /&gt;
|-&lt;br /&gt;
| 0x401CA8 || 0x464550 || int || __stdcall || &#039;&#039;&#039;SimulationUpdateWaterConsumption&#039;&#039;&#039; ||  || Barely explored || Called whenever tiles are placed and on &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 2 || Vanilla SC2K doesn&#039;t call this when tiles are placed on cities over 50,000 pop.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401E65 || 0x471BC0 || char || __stdcall || &#039;&#039;&#039;SimulationDetermineCityCrisis&#039;&#039;&#039; ||  || Somewhat understood || Called on the last day of the month and from &#039;&#039;sub_406A50&#039;&#039; || Changes the city status line if there&#039;s a new demand, and also starts disasters.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4022FC || 0x4358B0 || int || __cdecl || &#039;&#039;&#039;SimulationGrowthTick&#039;&#039;&#039; || __int16 a1, __int16 a2 || Barely explored || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; on days 4-17 || The arguments and algorithms are not yet understood.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402527 || 0x45CF10 || int || __stdcall || &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; ||  || Somewhat understood || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; || Calls the appropriate disaster creation function and then runs disaster ticks&lt;br /&gt;
|-&lt;br /&gt;
| 0x4026B2 || 0x4734A0 || int || __usercall || &#039;&#039;&#039;SimulationGrowSpecificZone&#039;&#039;&#039; || int a1@&amp;lt;ebp&amp;gt;, __int16 iX, __int16 iY, __int16 iTileID, __int16 iZoneType || Barely explored || Called from &#039;&#039;&#039;SimulationGrowthTick&#039;&#039;&#039; || Might be an omit-frame-pointer function?&lt;br /&gt;
|-&lt;br /&gt;
| 0x4026F8 || 0x467860 || int || __stdcall || &#039;&#039;&#039;SimulationUpdatePowerConsumption&#039;&#039;&#039; ||  || Barely explored || Called whenever tiles are placed and on &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 21 || Vanilla SC2K doesn&#039;t call this when tiles are placed on cities over 50,000 pop.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402A3B || 0x405AB0 || DWORD || __thiscall || &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; || CWinApp* this || Somewhat understood || Called from &#039;&#039;&#039;CWinApp::OnIdle&#039;&#039;&#039; via the class CWinApp vtable || Could stand to have a better name.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402D2E || 0x4734A0 || __int16 || __stdcall || &#039;&#039;&#039;SimulationCalculateBudgetUpdates&#039;&#039;&#039; ||  || Barely explored ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 0x403017 || 0x4142C0 || int || __stdcall || &#039;&#039;&#039;SimulationProposeMilitaryBase&#039;&#039;&#039; ||  || Somewhat understood || Called from &#039;&#039;&#039;SimulationProcessTick&#039;&#039;&#039; day 23 and from &amp;quot;gilmartin&amp;quot; cheat || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ [[Thing]] functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x40132A || 0x4562E0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickSailboat&#039;&#039;&#039; || __int16 iXTHGIndex || Barely explored || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Has a rare chance of turning into Nessie&lt;br /&gt;
|-&lt;br /&gt;
| 0x40137F || 0x454EA0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickTornado&#039;&#039;&#039; ||__int16 iXTHGIndex || Barely explored || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x401992 || 0x4548C0 || void || __usercall || &#039;&#039;&#039;SimulationThingTickMonster&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || Barely explored || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || The function signature of this one is odd and needs investigation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x401B6D || 0x455500 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickTrain&#039;&#039;&#039; || __int16 iXTHGIndex || Barely explored || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Used for XTHG_TRAIN_ENGINE and XTHG_UNKNOWN_3&lt;br /&gt;
|-&lt;br /&gt;
| 0x401EBA || 0x452FA0 || int || __cdecl || &#039;&#039;&#039;SimulationSpawnMaxisMan&#039;&#039;&#039; || __int16 iDisasterID || Barely explored || Called from &#039;&#039;&#039;SimulationStartDisaster&#039;&#039;&#039; || Creates the Thing for Maxis Man and determines based on iDisasterID what his behavior should be&lt;br /&gt;
|-&lt;br /&gt;
| 0x40236F || 0x456760 || void || __usercall || &#039;&#039;&#039;SimulationThingTickCargoShip&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || Barely explored || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || IDA really doesn&#039;t like this function for some reason&lt;br /&gt;
|-&lt;br /&gt;
| 0x402464 || 0x450890 || int || __stdcall || &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; ||  || Barely explored || Called from &#039;&#039;&#039;GameDoIdleUpkeep&#039;&#039;&#039; via &#039;&#039;sub_401DBB&#039;&#039; || Does the individual simulation ticks for Things every 30-45 ms.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4024AA || 0x455020 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickMaxisMan&#039;&#039;&#039; || __int16 iXTHGIndex || Barely explored || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || If you shoot down a helicopter and it lights something on fire, it&#039;s your own dang fault&lt;br /&gt;
|-&lt;br /&gt;
| 0x4027A2 || 0x453980 || void || __usercall || &#039;&#039;&#039;SimulationThingTickAirplane&#039;&#039;&#039; || int a1@&amp;lt;ebx&amp;gt;, __int16 iXTHGIndex || Barely explored || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || Another one with a bizarre function signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x4028D3 || 0x4546F0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickExplosion&#039;&#039;&#039; || __int16 iXTHGIndex || Barely explored || Called &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|-&lt;br /&gt;
| 0x402ED2 || 0x4540C0 || void || __cdecl || &#039;&#039;&#039;SimulationThingTickHelicopter&#039;&#039;&#039; || __int16 iXTHGIndex || Barely explored || Called from &#039;&#039;&#039;SimulationDoThingTick&#039;&#039;&#039; || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Sound and music functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401096 || 0x4251D0 || int || __thiscall || &#039;&#039;&#039;SoundPlaySound&#039;&#039;&#039; || int* this, int iSoundID || Mostly understood || Called in so many places || Calls through to &#039;&#039;sub_4802B0&#039;&#039;, which does the buffer loads and calls to &#039;&#039;sndPlaySoundA&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401389 || 0x480890 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicSendMCICommands&#039;&#039;&#039; || unsigned __int16* this, char* szMidiPath || Understood || Called by &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039; || Sends the actual MCI commands to play/stop a MIDI file&lt;br /&gt;
|-&lt;br /&gt;
| 0x401479 || 0x480770 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039; || unsigned __int16* this, int iSongID || Understood || Called by &#039;&#039;&#039;MusicPlay&#039;&#039;&#039; || Turns iSongID into szMidiPath&lt;br /&gt;
|-&lt;br /&gt;
| 0x4015FF || 0x480B20 || void || __thiscall || &#039;&#039;&#039;AllocateSoundBuffers&#039;&#039;&#039; || DWORD *this, int a2 || Barely explored || Called by &#039;&#039;&#039;CMainFrame:OnCreate&#039;&#039;&#039; || Allocates sound buffers; replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x401A9B || 0x425290 || int || __thiscall || &#039;&#039;&#039;MusicPlayNextRefocusSong&#039;&#039;&#039; || unsigned __int16** this || Understood || Called in a few places || Loops through the non-event music; replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x401CE9 || 0x425220 || int || __thiscall || &#039;&#039;&#039;SoundStopSound&#039;&#039;&#039; || int* this, int iSoundID || Understood || Called in so many places || Does a few checks then blasts out &#039;&#039;sndPlaySoundA(0, 0)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x401F9B || 0x480140 || void || __stdcall || &#039;&#039;&#039;LoadSoundBuffer&#039;&#039;&#039; || int iSoundID, void* lpBuffer || Understood || Called before a few sound calls || This and many other sound functions are replaced by sc2kfix&lt;br /&gt;
|-&lt;br /&gt;
| 0x402414 || 0x425260 || int || __thiscall || &#039;&#039;&#039;MusicPlay&#039;&#039;&#039; || unsigned __int16** this, iSongID || Understood || Called by anything that changes the music || Basically just a trampoline to &#039;&#039;&#039;MusicPlayMidi&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x402BE4 || 0x480AE0 || MCIERROR || __thiscall || &#039;&#039;&#039;MusicStop&#039;&#039;&#039; || int this || Understood || Called by anything that stops the music || Sends an MCI_CLOSE command to the sequencer device&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Randomness functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x401019 || 0x47FC30 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod32&#039;&#039;&#039; ||  || Understood ||  || Returns a random word from the LFSR modulo 32&lt;br /&gt;
|-&lt;br /&gt;
| 0x40116D || 0x47FAA0 || __int16 || __cdecl || &#039;&#039;&#039;RandomWordLCGMod&#039;&#039;&#039; || __int16 iModulus || Understood ||  || Returns a random word from the LCG modulo iModulus&lt;br /&gt;
|-&lt;br /&gt;
| 0x401415 || 0x47FC70 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod64&#039;&#039;&#039; ||  || Understood ||  || Returns a random word from the LFSR modulo 64&lt;br /&gt;
|-&lt;br /&gt;
| 0x4017AD || 0x47FAE0 || int || __stdcall || &#039;&#039;&#039;GetRandomLFSRState&#039;&#039;&#039; ||  || Understood ||  || Returns the state of the LFSR&lt;br /&gt;
|-&lt;br /&gt;
| 0x401CAD || 0x47FAF0 || __int16 || __cdecl || &#039;&#039;&#039;RandomWordLFSRMod&#039;&#039;&#039; || __int16 iModulus || Understood ||  || Returns a random word from the LFSR modulo iModulus&lt;br /&gt;
|-&lt;br /&gt;
| 0x401D9D || 0x47FCF0 || unsigned __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSR&#039;&#039;&#039; ||  || Understood ||  || Returns a random word from the LFSR&lt;br /&gt;
|-&lt;br /&gt;
| 0x401F19 || 0x47FA80 || int || __cdecl || &#039;&#039;&#039;SeedRandomLCG&#039;&#039;&#039; || int iSeed || Understood ||  || Sets the LCG state&lt;br /&gt;
|-&lt;br /&gt;
| 0x402261 || 0x47FB70 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod4&#039;&#039;&#039; ||  || Understood ||  || Returns a random word from the LFSR modulo 4&lt;br /&gt;
|-&lt;br /&gt;
| 0x4025E5 || 0x47FBF0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod16&#039;&#039;&#039; ||  || Understood ||  || Returns a random word from the LFSR modulo 16&lt;br /&gt;
|-&lt;br /&gt;
| 0x402626 || 0x47FAD0 || int || __cdecl || &#039;&#039;&#039;SeedRandomLFSR&#039;&#039;&#039; || int iSeed || Understood ||  || Sets the LFSR state&lt;br /&gt;
|-&lt;br /&gt;
| 0x40288D || 0x47FBB0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod8&#039;&#039;&#039; ||  || Understood ||  || Returns a random word from the LFSR modulo 8&lt;br /&gt;
|-&lt;br /&gt;
| 0x402946 || 0x47FB30 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod2&#039;&#039;&#039; ||  || Understood || Called by &#039;&#039;&#039;SimulationThingTickTrain&#039;&#039;&#039; and &#039;&#039;&#039;SimulationDoDisasterTick&#039;&#039;&#039; || Returns a random word from the LFSR modulo 2&lt;br /&gt;
|-&lt;br /&gt;
| 0x402B3F || 0x47FCB0 || __int16 || __stdcall || &#039;&#039;&#039;RandomWordLFSRMod128&#039;&#039;&#039; ||  || Understood ||  || Returns a random word from the LFSR modulo 128&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|+ Frequently-reused MFC class functions&lt;br /&gt;
|-&lt;br /&gt;
! {{tooltip|Thunk address|The address of the function thunk that other functions call.}} ! {{tooltip|Main address|The address that the thunk function jumps to, where the function actually starts}} ! {{tooltip|Return type|The function&#039;s return type from the C function signature.}} ! {{tooltip|Calling convention|Typically __cdecl, __stdcall, or __thiscall. Sometimes __usercall or __userpurge in IDA. Write __stdcall if it takes zero arguments.}} ! {{tooltip|Function name|Just the name, not the parameters}} ! {{tooltip|Arguments|What parameters the function takes, or blank for void.}} ! {{tooltip|Status|How well we know what goes on inside the function.}} ! {{tooltip|Related functions|If any, and if not too long to list.}} ! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x40219E || 0x4815E0 || INT_PTR || __thiscall || &#039;&#039;&#039;CGameDialog::DoModal&#039;&#039;&#039; || LPCDLGTEMPLATEA* this || Understood || Called in so many places || Seems to pause the simulation, call CDialog::DoModal(this), then restore the simulation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40281A || 0x481300 || struct CRuntimeClass* || __stdcall || &#039;&#039;&#039;CGameDialog::GetRuntimeClass&#039;&#039;&#039; ||  || Understood ||  || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Game data]]&lt;/div&gt;</summary>
		<author><name>Araxestroy</name></author>
	</entry>
</feed>