From 6473da43b27ea0c87c3a2d0fb45855ddeb9a8c6f Mon Sep 17 00:00:00 2001 From: adrian17 Date: Fri, 29 Aug 2014 11:37:32 +0200 Subject: [PATCH] Decompiled game_command_set_park_entrance_fee --- src/game.c | 3 ++- src/park.c | 36 ++++++++++++++++++++++++++++++++++++ src/park.h | 2 ++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/src/game.c b/src/game.c index f67b6f9279..30f4df92b1 100644 --- a/src/game.c +++ b/src/game.c @@ -29,6 +29,7 @@ #include "news_item.h" #include "object.h" #include "osinterface.h" +#include "park.h" #include "peep.h" #include "sawyercoding.h" #include "scenario.h" @@ -942,7 +943,7 @@ static uint32 game_do_command_table[58] = { 0x006666E7, 0x00666A63, 0x006CD8CE, - 0x00669E30, + (uint32)game_command_set_park_entrance_fee, (uint32)game_command_update_staff_colour, // 40 0x006E519A, 0x006E5597, diff --git a/src/park.c b/src/park.c index 159017c392..da3731efc9 100644 --- a/src/park.c +++ b/src/park.c @@ -581,4 +581,40 @@ uint8 calculate_guest_initial_happiness(uint8 percentage) { void park_update_histories() { RCT2_CALLPROC_EBPSAFE(0x0066A231); +} + +/** +* +* rct2: 0x00669E30 +*/ +void game_command_set_park_entrance_fee() +{ + uint8 _bl; + uint16 new_fee; + + #ifdef _MSC_VER + __asm mov _bl, bl + #else + __asm__("mov %[_bl], bl " : [_bl] "+m" (_bl)); + #endif + + #ifdef _MSC_VER + __asm mov new_fee, di + #else + __asm__("mov %[new_fee], di " : [new_fee] "+m" (new_fee)); + #endif + + RCT2_GLOBAL(0x0141F56C, uint8) = 0x10; + + if (_bl & 1){ + RCT2_GLOBAL(RCT2_ADDRESS_PARK_ENTRANCE_FEE, uint16) = new_fee; + + window_invalidate_by_id(WC_PARK_INFORMATION, 0); + } + + #ifdef _MSC_VER + __asm mov ebx, 0 + #else + __asm__("mov ebx, 0 "); + #endif } \ No newline at end of file diff --git a/src/park.h b/src/park.h index bb7d823e86..5c9a85171a 100644 --- a/src/park.h +++ b/src/park.h @@ -59,4 +59,6 @@ void park_update_histories(); uint8 calculate_guest_initial_happiness(uint8 percentage); +void game_command_set_park_entrance_fee(); + #endif