Integrate unknown game variables

This commit is contained in:
Ted John 2016-09-10 14:46:53 +01:00
parent f303642ceb
commit 708efdd08c
7 changed files with 16 additions and 10 deletions

View File

@ -67,6 +67,9 @@ bool gInUpdateCode = false;
int gGameCommandNestLevel;
bool gGameCommandIsNetworked;
uint8 gUnk13CA740;
uint8 gUnk141F568;
#ifdef NO_RCT2
uint32 gCurrentTicks;
#endif
@ -342,7 +345,7 @@ void game_update()
window_map_tooltip_update_visibility();
// Input
RCT2_GLOBAL(0x0141F568, uint8) = RCT2_GLOBAL(0x0013CA740, uint8);
gUnk141F568 = gUnk13CA740;
game_handle_input();
}
@ -414,7 +417,7 @@ void game_logic_update()
static int game_check_affordability(int cost)
{
if (cost <= 0)return cost;
if (RCT2_GLOBAL(0x141F568, uint8) & 0xF0)return cost;
if (gUnk141F568 & 0xF0) return cost;
if (cost <= (sint32)(DECRYPT_MONEY(gCashEncrypted)))return cost;
set_format_arg(0, uint32, cost);
@ -545,7 +548,7 @@ int game_do_command_p(int command, int *eax, int *ebx, int *ecx, int *edx, int *
if (!(flags & 0x20)) {
// Update money balance
finance_payment(cost, gCommandExpenditureType);
if (RCT2_GLOBAL(0x0141F568, uint8) == RCT2_GLOBAL(0x013CA740, uint8)) {
if (gUnk141F568 == gUnk13CA740) {
// Create a +/- money text effect
if (cost != 0)
money_effect_create(cost);
@ -570,7 +573,7 @@ int game_do_command_p(int command, int *eax, int *ebx, int *ecx, int *edx, int *
game_command_callback = 0;
// Show error window
if (gGameCommandNestLevel == 0 && (flags & GAME_COMMAND_FLAG_APPLY) && RCT2_GLOBAL(0x0141F568, uint8) == RCT2_GLOBAL(0x013CA740, uint8) && !(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && !(flags & GAME_COMMAND_FLAG_NETWORKED))
if (gGameCommandNestLevel == 0 && (flags & GAME_COMMAND_FLAG_APPLY) && gUnk141F568 == gUnk13CA740 && !(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && !(flags & GAME_COMMAND_FLAG_NETWORKED))
window_error_open(gGameCommandErrorTitle, gGameCommandErrorText);
gGameCommandErrorText = STR_NONE;

View File

@ -145,6 +145,9 @@ extern bool gInUpdateCode;
extern int gGameCommandNestLevel;
extern bool gGameCommandIsNetworked;
extern uint8 gUnk13CA740;
extern uint8 gUnk141F568;
void game_increase_game_speed();
void game_reduce_game_speed();

View File

@ -9664,7 +9664,7 @@ static void peep_spend_money(rct_peep *peep, money16 *peep_expend_type, money32
}
window_invalidate_by_number(WC_PEEP, peep->sprite_index);
RCT2_GLOBAL(0x00141F568, uint8) = RCT2_GLOBAL(0x0013CA740, uint8);
gUnk141F568 = gUnk13CA740;
finance_payment(-amount, gCommandExpenditureType);
audio_play_sound_at_location(SOUND_PURCHASE, peep->x, peep->y, peep->z);

View File

@ -405,7 +405,7 @@ void S6Exporter::Export()
memcpy(_s6.staff_modes, gStaffModes, sizeof(_s6.staff_modes));
// unk_13CA73E
// pad_13CA73F
_s6.byte_13CA740 = RCT2_GLOBAL(0x013CA740, uint8);
_s6.byte_13CA740 = gUnk13CA740;
_s6.climate = gClimate;
// pad_13CA741;
memcpy(_s6.byte_13CA742, RCT2_ADDRESS(0x013CA742, uint8), sizeof(_s6.byte_13CA742));

View File

@ -323,7 +323,7 @@ void S6Importer::Import()
memcpy(gStaffModes, _s6.staff_modes, sizeof(_s6.staff_modes));
// unk_13CA73E
// pad_13CA73F
RCT2_GLOBAL(0x013CA740, uint8) = _s6.byte_13CA740;
gUnk13CA740 = _s6.byte_13CA740;
gClimate = _s6.climate;
// pad_13CA741;
memcpy(RCT2_ADDRESS(0x013CA742, uint8), _s6.byte_13CA742, sizeof(_s6.byte_13CA742));

View File

@ -5119,7 +5119,7 @@ static void loc_6B51C0(int rideIndex)
ride = get_ride(rideIndex);
if (RCT2_GLOBAL(0x0141F568, uint8) != RCT2_GLOBAL(0x013CA740, uint8))
if (gUnk141F568 != gUnk13CA740)
return;
w = window_get_main();
@ -5170,7 +5170,7 @@ static void loc_6B51C0(int rideIndex)
*/
static void ride_scroll_to_track_error(rct_xy_element *trackElement)
{
if (!gGameCommandIsNetworked && RCT2_GLOBAL(0x0141F568, uint8) == RCT2_GLOBAL(0x013CA740, uint8)) {
if (!gGameCommandIsNetworked && gUnk141F568 == gUnk13CA740) {
rct_window *w = window_get_main();
if (w != NULL) {
window_scroll_to_location(w, trackElement->x, trackElement->y, trackElement->element->base_height * 8);

View File

@ -93,7 +93,7 @@ void park_init()
{
int i;
RCT2_GLOBAL(0x013CA740, uint8) = 0;
gUnk13CA740 = 0;
gParkName = STR_UNNAMED_PARK;
gStaffHandymanColour = COLOUR_BRIGHT_RED;
gStaffMechanicColour = COLOUR_LIGHT_BLUE;