From 1229cbd540cc220a1a06078d5df683a09870d48e Mon Sep 17 00:00:00 2001 From: Ted John Date: Wed, 11 May 2016 22:30:06 +0100 Subject: [PATCH] clean up s6 struct a bit --- src/addresses.h | 1 + src/rct2/S6Exporter.cpp | 4 ++-- src/rct2/S6Importer.cpp | 4 ++-- src/scenario.c | 4 ++-- src/scenario.h | 10 ++++++---- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/addresses.h b/src/addresses.h index 69a3de147a..88f64844a9 100644 --- a/src/addresses.h +++ b/src/addresses.h @@ -308,6 +308,7 @@ #define RCT2_ADDRESS_INCOME_FROM_ADMISSIONS 0x01358748 #define RCT2_ADDRESS_CURRENT_COMPANY_VALUE 0x0135874C #define RCT2_ADDRESS_AWARD_LIST 0x01358760 +#define RCT2_ADDRESS_COMPANY_VALUE_RECORD 0x013587C0 #define RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED 0x013587F8 #define RCT2_ADDRESS_CURRENT_INTEREST_RATE 0x0135934A #define RCT2_ADDRESS_SAME_PRICE_THROUGHOUT 0x01358838 diff --git a/src/rct2/S6Exporter.cpp b/src/rct2/S6Exporter.cpp index 0f1f3fb624..6eeef4acae 100644 --- a/src/rct2/S6Exporter.cpp +++ b/src/rct2/S6Exporter.cpp @@ -345,9 +345,9 @@ void S6Exporter::Export() _s6.construction_rights_price = gConstructionRightsPrice; _s6.word_01358774 = RCT2_GLOBAL(0x01358774, uint16); // pad_01358776 - memcpy(_s6.dword_01358778, RCT2_ADDRESS(0x01358778, uint32), sizeof(_s6.dword_01358778)); + // _s6.cd_key // _s6.game_version_number - _s6.dword_013587C0 = RCT2_GLOBAL(0x013587C0, uint32); + _s6.completed_company_value_record = gScenarioCompanyValueRecord; _s6.loan_hash = RCT2_GLOBAL(RCT2_ADDRESS_LOAN_HASH, uint32); _s6.ride_count = RCT2_GLOBAL(RCT2_ADDRESS_RIDE_COUNT, uint16); // pad_013587CA diff --git a/src/rct2/S6Importer.cpp b/src/rct2/S6Importer.cpp index 9c28cd2e3f..63f83a7fdb 100644 --- a/src/rct2/S6Importer.cpp +++ b/src/rct2/S6Importer.cpp @@ -277,9 +277,9 @@ void S6Importer::Import() gConstructionRightsPrice = _s6.construction_rights_price; RCT2_GLOBAL(0x01358774, uint16) = _s6.word_01358774; // pad_01358776 - memcpy(RCT2_ADDRESS(0x01358778, uint32), _s6.dword_01358778, sizeof(_s6.dword_01358778)); + // _s6.cd_key _gameVersion = _s6.game_version_number; - RCT2_GLOBAL(0x013587C0, uint32) = _s6.dword_013587C0; + gScenarioCompanyValueRecord = _s6.completed_company_value_record; RCT2_GLOBAL(RCT2_ADDRESS_LOAN_HASH, uint32) = _s6.loan_hash; RCT2_GLOBAL(RCT2_ADDRESS_RIDE_COUNT, uint16) = _s6.ride_count; // pad_013587CA diff --git a/src/scenario.c b/src/scenario.c index 5d94e2cd4d..fa6fe7253a 100644 --- a/src/scenario.c +++ b/src/scenario.c @@ -324,7 +324,7 @@ void scenario_success() // Allow name entry gParkFlags |= PARK_FLAGS_SCENARIO_COMPLETE_NAME_INPUT; - RCT2_GLOBAL(0x013587C0, money32) = companyValue; + gScenarioCompanyValueRecord = companyValue; scenario_scores_save(); } } @@ -339,7 +339,7 @@ void scenario_success_submit_name(const char *name) { scenario_index_entry *scenario = scenario_list_find_by_filename(_scenarioFileName); if (scenario != NULL) { - money32 scenarioWinCompanyValue = RCT2_GLOBAL(0x013587C0, money32); + money32 scenarioWinCompanyValue = gScenarioCompanyValueRecord; if (scenario->highscore->company_value == scenarioWinCompanyValue) { scenario->highscore->name = _strdup(name); safe_strcpy(gScenarioCompletedBy, name, 32); diff --git a/src/scenario.h b/src/scenario.h index a0fab0fbcd..c07e33fd13 100644 --- a/src/scenario.h +++ b/src/scenario.h @@ -241,9 +241,10 @@ typedef struct { money16 construction_rights_price; uint16 word_01358774; uint8 pad_01358776[2]; - uint32 dword_01358778[17]; + uint32 cd_key; + uint8 pad_0135877C[64]; uint32 game_version_number; - uint32 dword_013587C0; + money32 completed_company_value_record; uint32 loan_hash; uint16 ride_count; uint8 pad_013587CA[6]; @@ -308,9 +309,9 @@ typedef struct { rct_ride_measurement ride_measurements[8]; uint32 next_guest_index; uint16 grass_and_scenery_tilepos; - uint32 patrol_areas[0x6600]; // 512 bytes per staff peep + uint32 patrol_areas[204 * 128]; uint8 staff_modes[204]; - uint8 unk_13CA73E; + uint8 pad_13CA73E; uint8 pad_13CA73F; uint8 byte_13CA740; uint8 pad_13CA741; @@ -429,6 +430,7 @@ extern const rct_string_id ScenarioCategoryStringIds[SCENARIO_CATEGORY_COUNT]; #define gScenarioParkRatingWarningDays RCT2_GLOBAL(RCT2_ADDRESS_PARK_RATING_WARNING_DAYS, uint16) #define gScenarioCompletedCompanyValue RCT2_GLOBAL(RCT2_ADDRESS_COMPLETED_COMPANY_VALUE, money32) +#define gScenarioCompanyValueRecord RCT2_GLOBAL(RCT2_ADDRESS_COMPANY_VALUE_RECORD, money32) // Scenario list extern int gScenarioListCount;