1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 03:23:15 +01:00

add callfunc wrappers for the last three remaining game commands and remove original call table

This commit is contained in:
IntelOrca
2015-10-10 20:26:17 +01:00
parent 6c84b06fbd
commit 8ec4d61739
5 changed files with 44 additions and 90 deletions

View File

@@ -404,7 +404,6 @@ static int game_check_affordability(int cost)
return MONEY32_UNDEFINED;
}
static uint32 game_do_command_table[58];
static GAME_COMMAND_POINTER* new_game_command_table[58];
/**
@@ -456,12 +455,8 @@ int game_do_command_p(int command, int *eax, int *ebx, int *ecx, int *edx, int *
*ebx &= ~GAME_COMMAND_FLAG_APPLY;
// Primary command
if (game_do_command_table[command] == 0) {
new_game_command_table[command](eax, ebx, ecx, edx, esi, edi, ebp);
} else {
RCT2_CALLFUNC_X(game_do_command_table[command], eax, ebx, ecx, edx, esi, edi, ebp);
}
// First call for validity and price check
new_game_command_table[command](eax, ebx, ecx, edx, esi, edi, ebp);
cost = *ebx;
if (cost != MONEY32_UNDEFINED) {
@@ -495,12 +490,8 @@ int game_do_command_p(int command, int *eax, int *ebx, int *ecx, int *edx, int *
}
}
// Secondary command
if (game_do_command_table[command] == 0) {
new_game_command_table[command](eax, ebx, ecx, edx, esi, edi, ebp);
} else {
RCT2_CALLFUNC_X(game_do_command_table[command], eax, ebx, ecx, edx, esi, edi, ebp);
}
// Second call to actually perform the operation
new_game_command_table[command](eax, ebx, ecx, edx, esi, edi, ebp);
if (game_command_callback) {
game_command_callback(*eax, *ebx, *ecx, *edx, *esi, *edi, *ebp);
@@ -1127,71 +1118,6 @@ void game_load_or_quit_no_save_prompt()
}
}
#pragma region Game command function table
static uint32 game_do_command_table[58] = {
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0, // 10
0,
0,
0,
0,
0,
0,
0,
0,
0,
0, // 20
0,
0,
0,
0,
0x0068BC01,
0,
0,
0,
0, // use new_game_command_table, original: 0x006BEFA1, 29
0, // 30
0,
0,
0,
0,
0,//0x006649BD, //buy_land_rights
0,
0,
0x006CD8CE,
0,
0, // 40
0,
0,
0,
0,
0,
0,
0,
0,
0x006CDEE4,
0, // 50
0,
0,
0,
0,
0,
0,
0
};
void game_command_emptysub(int* eax, int* ebx, int* ecx, int* edx, int* esi, int* edi, int* ebp) {}
static GAME_COMMAND_POINTER* new_game_command_table[58] = {
game_command_set_ride_appearance,
game_command_set_land_height,
@@ -1203,7 +1129,7 @@ static GAME_COMMAND_POINTER* new_game_command_table[58] = {
game_command_demolish_ride,
game_command_set_ride_status,
game_command_set_ride_vehicles,
game_command_set_ride_name, // 10
game_command_set_ride_name,
game_command_set_ride_setting,
game_command_place_ride_entrance_or_exit,
game_command_remove_ride_entrance_or_exit,
@@ -1213,27 +1139,27 @@ static GAME_COMMAND_POINTER* new_game_command_table[58] = {
game_command_place_footpath,
game_command_place_footpath_from_track,
game_command_remove_footpath,
game_command_change_surface_style, // 20
game_command_change_surface_style,
game_command_set_ride_price,
game_command_set_peep_name,
game_command_raise_land,
game_command_lower_land,
game_command_emptysub,
game_command_smooth_land,
game_command_raise_water,
game_command_lower_water,
game_command_set_brakes_speed,
game_command_hire_new_staff_member, //game_command_emptysub,
game_command_set_staff_patrol, // 30
game_command_hire_new_staff_member,
game_command_set_staff_patrol,
game_command_fire_staff_member,
game_command_set_staff_order,
game_command_set_park_name,
game_command_set_park_open,
game_command_buy_land_rights, //game_command_emptysub,//game_command_buy_land_rights,
game_command_buy_land_rights,
game_command_place_park_entrance,
game_command_remove_park_entrance,
game_command_emptysub,
game_command_set_maze_track,
game_command_set_park_entrance_fee,
game_command_update_staff_colour, // 40
game_command_update_staff_colour,
game_command_place_fence,
game_command_remove_fence,
game_command_place_large_scenery,
@@ -1242,8 +1168,8 @@ static GAME_COMMAND_POINTER* new_game_command_table[58] = {
game_command_set_research_funding,
game_command_place_track_design,
game_command_start_campaign,
game_command_emptysub,
game_command_place_banner, // 50
game_command_place_maze_design,
game_command_place_banner,
game_command_remove_banner,
game_command_set_scenery_colour,
game_command_set_fence_colour,
@@ -1252,5 +1178,3 @@ static GAME_COMMAND_POINTER* new_game_command_table[58] = {
game_command_set_land_ownership,
game_command_clear_scenery
};
#pragma endregion

View File

@@ -3340,6 +3340,15 @@ void game_command_place_track_design(int* eax, int* ebx, int* ecx, int* edx, int
*edi = rideIndex;
}
/**
*
* rct2: 0x006CDEE4
*/
void game_command_place_maze_design(int* eax, int* ebx, int* ecx, int* edx, int* esi, int* edi, int* ebp)
{
RCT2_CALLFUNC_X(0x006CDEE4, eax, ebx, ecx, edx, esi, edi, ebp);
}
/**
*
* rct2: 0x006D3026
@@ -4658,6 +4667,15 @@ void game_command_remove_track(int *eax, int *ebx, int *ecx, int *edx, int *esi,
return;
}
/**
*
* rct2: 0x006CD8CE
*/
void game_command_set_maze_track(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp)
{
RCT2_CALLFUNC_X(0x006CD8CE, eax, ebx, ecx, edx, esi, edi, ebp);
}
/**
*
* rct2: 0x006C5AE9

View File

@@ -518,6 +518,7 @@ int save_track_design(uint8 rideIndex);
int install_track(char* source_path, char* dest_name);
void window_track_list_format_name(utf8 *dst, const utf8 *src, int colour, bool quotes);
void game_command_place_track_design(int* eax, int* ebx, int* ecx, int* edx, int* esi, int* edi, int* ebp);
void game_command_place_maze_design(int* eax, int* ebx, int* ecx, int* edx, int* esi, int* edi, int* ebp);
void track_save_reset_scenery();
void track_save_select_nearby_scenery(int rideIndex);
@@ -529,6 +530,7 @@ const rct_track_coordinates *get_track_coord_from_ride(rct_ride *ride, int track
void game_command_place_track(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp);
void game_command_remove_track(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp);
void game_command_set_maze_track(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp);
void game_command_set_brakes_speed(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp);
void track_circuit_iterator_begin(track_circuit_iterator *it, rct_xy_element first);

View File

@@ -2051,6 +2051,15 @@ void game_command_lower_land(int* eax, int* ebx, int* ecx, int* edx, int* esi, i
);
}
/**
*
* rct2: 0x0068BC01
*/
void game_command_smooth_land(int* eax, int* ebx, int* ecx, int* edx, int* esi, int* edi, int* ebp)
{
RCT2_CALLFUNC_X(0x0068BC01, eax, ebx, ecx, edx, esi, edi, ebp);
}
/**
*
* rct2: 0x006E66A0

View File

@@ -323,6 +323,7 @@ void game_command_clear_scenery(int* eax, int* ebx, int* ecx, int* edx, int* esi
void game_command_change_surface_style(int* eax, int* ebx, int* ecx, int* edx, int* esi, int* edi, int* ebp);
void game_command_raise_land(int* eax, int* ebx, int* ecx, int* edx, int* esi, int* edi, int* ebp);
void game_command_lower_land(int* eax, int* ebx, int* ecx, int* edx, int* esi, int* edi, int* ebp);
void game_command_smooth_land(int* eax, int* ebx, int* ecx, int* edx, int* esi, int* edi, int* ebp);
void game_command_raise_water(int* eax, int* ebx, int* ecx, int* edx, int* esi, int* edi, int* ebp);
void game_command_lower_water(int* eax, int* ebx, int* ecx, int* edx, int* esi, int* edi, int* ebp);
void game_command_set_water_height(int* eax, int* ebx, int* ecx, int* edx, int* esi, int* edi, int* ebp);