From 32e8726a98c38e1a6d949ef1ef115d993a8125c3 Mon Sep 17 00:00:00 2001 From: Duncan Date: Thu, 26 Jun 2014 12:50:59 +0100 Subject: [PATCH 01/13] Paint function now uses get_arguments Has not been tested. Possible problem caused by endianess. --- src/window_guest_list.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/src/window_guest_list.c b/src/window_guest_list.c index 42d2b0924d..6eac714474 100644 --- a/src/window_guest_list.c +++ b/src/window_guest_list.c @@ -718,14 +718,11 @@ static void window_guest_list_scrollpaint() gfx_draw_sprite(dpi, 5129, 112, y); // Action - eax = peep->sprite_index; - RCT2_CALLFUNC_X(0x00698B0D, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp); - ebx &= 0xFFFF; - ecx &= 0xFFFF; - - RCT2_GLOBAL(0x013CE952, uint16) = ebx; - RCT2_GLOBAL(0x013CE952 + 2, uint16) = ecx; - RCT2_GLOBAL(0x013CE952 + 4, uint32) = edx; + uint32 argument_1, argument_2; + get_arguments_from_action(peep, &argument_1, &argument_2); + + RCT2_GLOBAL(0x013CE952, uint32) = argument_1; + RCT2_GLOBAL(0x013CE952 + 4, uint32) = argument_2; gfx_draw_string_left_clipped(dpi, format, (void*)0x013CE952, 0, 133, y - 1, 314); break; case VIEW_THOUGHTS: @@ -738,15 +735,12 @@ static void window_guest_list_scrollpaint() continue; if (thought->var_2 > 5) break; + + uint32 argument_1, argument_2; + get_arguments_from_thought(peep->thoughts[j], &argument_1, &argument_2); - ebx = thought->type; - eax = thought->item; - RCT2_CALLFUNC_X(0x00698342, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp); - ebx &= 0xFFFF; - - RCT2_GLOBAL(0x013CE952, uint16) = ebx; - RCT2_GLOBAL(0x013CE952 + 2, uint32) = *((uint32*)esi); - RCT2_GLOBAL(0x013CE952 + 6, uint16) = *((uint16*)(esi + 4)); + RCT2_GLOBAL(0x013CE952, uint32) = argument_1; + RCT2_GLOBAL(0x013CE952 + 4, uint32) = argument_2; gfx_draw_string_left_clipped(dpi, format, (void*)0x013CE952, 0, 118, y - 1, 329); break; } @@ -783,8 +777,7 @@ static void window_guest_list_scrollpaint() gfx_draw_sprite(dpi, _window_guest_list_groups_guest_faces[i * 56 + j] + 5486, j * 8, y + 9); // Draw action - RCT2_GLOBAL(0x013CE952, uint16) = _window_guest_list_groups_argument_1[i] & 0xFFFF; - RCT2_GLOBAL(0x013CE952 + 2, uint16) = _window_guest_list_groups_argument_1[i] >> 16; + RCT2_GLOBAL(0x013CE952, uint32) = _window_guest_list_groups_argument_1[i]; RCT2_GLOBAL(0x013CE952 + 4, uint32) = _window_guest_list_groups_argument_2[i]; RCT2_GLOBAL(0x013CE952 + 10, uint32) = numGuests; gfx_draw_string_left_clipped(dpi, format, (void*)0x013CE952, 0, 0, y - 1, 414); From 578b4eaa448fd24071c01e37bf55fb5f62142a57 Mon Sep 17 00:00:00 2001 From: Duncan Date: Thu, 26 Jun 2014 16:18:38 +0100 Subject: [PATCH 02/13] Re-factor of argument_from_thought to use ridelist Has not been tested. Could use this to work out what Var_4A and Var_4C(32bit) are. --- src/window_guest_list.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/window_guest_list.c b/src/window_guest_list.c index 6eac714474..c9c6f230ad 100644 --- a/src/window_guest_list.c +++ b/src/window_guest_list.c @@ -827,9 +827,8 @@ void get_argument_from_thought(rct_peep_thought thought, uint32* argument_1, uin int esi = 0x9AC86C; if ((RCT2_ADDRESS(0x981DB1, uint16)[thought.type] & 0xFF) == 1){ - uint32 item = thought.item; - item *= 0x260; - esi = 0x1362942 + item; + rct_ride* ride = &(RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST,rct_ride)[thought.item]); + esi = &(ride->var_4A); } else if ((RCT2_ADDRESS(0x981DB1, uint16)[thought.type] & 0xFF) == 2){ if (thought.item < 0x20){ From e48bab50d32a6916928919744807210153772f10 Mon Sep 17 00:00:00 2001 From: Duncan Frost Date: Thu, 26 Jun 2014 18:02:44 +0100 Subject: [PATCH 03/13] Fix errors. Tested code all working --- src/window_guest_list.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/window_guest_list.c b/src/window_guest_list.c index c9c6f230ad..f6f285da0b 100644 --- a/src/window_guest_list.c +++ b/src/window_guest_list.c @@ -135,7 +135,8 @@ static void window_guest_list_find_groups(); static int get_guest_face_sprite_small(rct_peep *peep); static int get_guest_face_sprite_large(rct_peep *peep); static void get_arguments_from_peep(rct_peep *peep, uint32 *argument_1, uint32* argument_2); - +void get_arguments_from_thought(rct_peep_thought thought, uint32* argument_1, uint32* argument_2); +void get_arguments_from_action(rct_peep* peep, uint32* argument_1, uint32* argument_2); /** * * rct2: 0x006992E3 @@ -656,6 +657,7 @@ static void window_guest_list_scrollpaint() rct_drawpixelinfo *dpi; rct_peep *peep; rct_peep_thought *thought; + uint32 argument_1, argument_2; #ifdef _MSC_VER __asm mov w, esi @@ -718,7 +720,7 @@ static void window_guest_list_scrollpaint() gfx_draw_sprite(dpi, 5129, 112, y); // Action - uint32 argument_1, argument_2; + get_arguments_from_action(peep, &argument_1, &argument_2); RCT2_GLOBAL(0x013CE952, uint32) = argument_1; @@ -736,7 +738,6 @@ static void window_guest_list_scrollpaint() if (thought->var_2 > 5) break; - uint32 argument_1, argument_2; get_arguments_from_thought(peep->thoughts[j], &argument_1, &argument_2); RCT2_GLOBAL(0x013CE952, uint32) = argument_1; @@ -823,12 +824,12 @@ static int window_guest_list_is_peep_in_filter(rct_peep* peep) * argument_1 (esi & ebx) * argument_2 (esi+2) */ -void get_argument_from_thought(rct_peep_thought thought, uint32* argument_1, uint32* argument_2){ +void get_arguments_from_thought(rct_peep_thought thought, uint32* argument_1, uint32* argument_2){ int esi = 0x9AC86C; if ((RCT2_ADDRESS(0x981DB1, uint16)[thought.type] & 0xFF) == 1){ rct_ride* ride = &(RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST,rct_ride)[thought.item]); - esi = &(ride->var_4A); + esi = &(ride->var_04A); } else if ((RCT2_ADDRESS(0x981DB1, uint16)[thought.type] & 0xFF) == 2){ if (thought.item < 0x20){ @@ -1003,7 +1004,7 @@ static void get_arguments_from_peep(rct_peep *peep, uint32 *argument_1, uint32* case VIEW_THOUGHTS: if (peep->thoughts[0].var_2 <= 5) { if (peep->thoughts[0].type != PEEP_THOUGHT_TYPE_NONE) { - get_argument_from_thought(peep->thoughts[0], argument_1, argument_2); + get_arguments_from_thought(peep->thoughts[0], argument_1, argument_2); break; } } From ab38c956eb6fc987f04778ee6119edbb8df030b1 Mon Sep 17 00:00:00 2001 From: Duncan Date: Fri, 27 Jun 2014 14:25:37 +0100 Subject: [PATCH 04/13] Added action string ids. --- src/string_ids.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/string_ids.h b/src/string_ids.h index 83d86b7926..1ab3cfbba9 100644 --- a/src/string_ids.h +++ b/src/string_ids.h @@ -299,7 +299,25 @@ enum { STR_FOOTPATH_TIP = 1424, STR_FREE = 1430, - + STR_WALKING = 1431, + STR_HEADING_FOR = 1432, + STR_QUEUING_FOR = 1433, + STR_DROWNING = 1434, + STR_ON_RIDE = 1435, + STR_IN_RIDE = 1436, + STR_AT_RIDE = 1437, + STR_SITTING = 1438, + STR_SELECT_LOCATION = 1439, + STR_MOWING_GRASS = 1440, + STR_SWEEPING_FOOTPATH = 1441, + STR_EMPTYING_LITTER_BIN = 1442, + STR_WATERING_GARDENS = 1443, + STR_WATCHING_RIDE = 1444, + STR_WATCHING_CONSTRUCTION_OF = 1445, + STR_LOOKING_AT_SCENERY = 1446, + STR_LEAVING_PARK = 1447, + STR_WATCHING_NEW_RIDE_BEING_CONSTRUCTED = 1448, + STR_GUESTS = 1463, STR_CONSTRUCT_FOOTPATH_ON_LAND_TIP = 1655, @@ -326,6 +344,11 @@ enum { STR_OFF = 1775, STR_ON = 1776, STR_MUSIC = 1777, + + STR_RESPONDING_TO_RIDE_BREAKDOWN_CALL = 1792, + STR_HEADING_TO_RIDE_FOR_INSPECTION = 1793, + STR_FIXING_RIDE = 1794, + STR_ANSWERING_RADIO_CALL = 1795, STR_ACTIONS = 1814, STR_THOUGHTS = STR_ACTIONS + 1, From 0b9a47ca95d99e743f54e870d1c2a48c98264d5a Mon Sep 17 00:00:00 2001 From: Duncan Date: Fri, 27 Jun 2014 14:27:51 +0100 Subject: [PATCH 05/13] Now uses string id references. This can be used to identify a few more variables. --- src/window_guest_list.c | 48 ++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/window_guest_list.c b/src/window_guest_list.c index f6f285da0b..678097df52 100644 --- a/src/window_guest_list.c +++ b/src/window_guest_list.c @@ -867,115 +867,115 @@ void get_arguments_from_action(rct_peep* peep, uint32 *argument_1, uint32* argum switch (peep->state){ case 0: - *argument_1 = peep->var_71 == 0xB ? 0x59A : 0x597; + *argument_1 = peep->var_71 == 0xB ? STR_DROWNING : STR_WALKING; *argument_2 = 0; break; case 1: - *argument_1 = 0x597; + *argument_1 = STR_WALKING; *argument_2 = 0; break; case 3: case 4: case 7: - *argument_1 = 0x59B; + *argument_1 = STR_ON_RIDE; ride = RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[peep->current_ride]; if (RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + ride.type*8, uint32)& 0x400000){ - (*argument_1)++; + *argument_1 = STR_IN_RIDE; } *argument_1 |= (ride.var_04A << 16); *argument_2 = ride.var_04C; break; case 0x11: ride = RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[peep->current_ride]; - *argument_1 = 0x59D | (ride.var_04A << 16); + *argument_1 = STR_AT_RIDE | (ride.var_04A << 16); *argument_2 = ride.var_04C; break; case 5: case 0x14: if (peep->var_C5 != 0xFF){ ride = RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[peep->var_C5]; - *argument_1 = 0x598 | (ride.var_04A << 16); + *argument_1 = STR_HEADING_FOR | (ride.var_04A << 16); *argument_2 = ride.var_04C; } else{ - *argument_1 = peep->flags & 1 ? 0x5A7 : 0x597; + *argument_1 = peep->flags & 1 ? STR_LEAVING_PARK : STR_WALKING; *argument_2 = 0; } break; case 2: case 6: ride = RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[peep->current_ride]; - *argument_1 = 0x599 | (ride.var_04A << 16); + *argument_1 = STR_QUEUING_FOR | (ride.var_04A << 16); *argument_2 = ride.var_04C; break; case 8: - *argument_1 = 0x59E; + *argument_1 = STR_SITTING; *argument_2 = 0; break; case 0x12: if (peep->current_ride != 0xFF){ ride = RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[peep->current_ride]; - *argument_1 = 0x5A4 | (ride.var_04A << 16); + *argument_1 = STR_WATCHING_RIDE | (ride.var_04A << 16); *argument_2 = ride.var_04C; if (peep->current_seat & 0x1) - *argument_1 = 0x5A5 | (ride.var_04A << 16); + *argument_1 = STR_WATCHING_CONSTRUCTION_OF | (ride.var_04A << 16); else - *argument_1 = 0x5A4 | (ride.var_04A << 16); + *argument_1 = STR_WATCHING_RIDE | (ride.var_04A << 16); } else{ - *argument_1 = peep->current_seat & 0x1 ? 0x5A8 : 0x5A6; + *argument_1 = peep->current_seat & 0x1 ? STR_WATCHING_NEW_RIDE_BEING_CONSTRUCTED : STR_LOOKING_AT_SCENERY; *argument_2 = 0; } break; case 9: - *argument_1 = 0x59F; + *argument_1 = STR_SELECT_LOCATION; *argument_2 = 0; break; case 0xA: case 0xD: case 0xE: - *argument_1 = 0x597; + *argument_1 = STR_WALKING; *argument_2 = 0; break; case 0xB: - *argument_1 = 0x5A0; + *argument_1 = STR_MOWING_GRASS; *argument_2 = 0; break; case 0xC: - *argument_1 = 0x5A1; + *argument_1 = STR_SWEEPING_FOOTPATH; *argument_2 = 0; break; case 0x15: - *argument_1 = 0x5A3; + *argument_1 = STR_WATERING_GARDENS; *argument_2 = 0; break; case 0x13: - *argument_1 = 0x5A2; + *argument_1 = STR_EMPTYING_LITTER_BIN; *argument_2 = 0; break; case 0xF: if (peep->pad_2C == 0){ - *argument_1 = 0x597; + *argument_1 = STR_WALKING; *argument_2 = 0; } else if (peep->pad_2C == 1){ - *argument_1 = 0x703; + *argument_1 = STR_ANSWERING_RADIO_CALL; *argument_2 = 0; } else{ ride = RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[peep->current_ride]; - *argument_1 = 0x700 | (ride.var_04A << 16); + *argument_1 = STR_RESPONDING_TO_RIDE_BREAKDOWN_CALL | (ride.var_04A << 16); *argument_2 = ride.var_04C; } break; case 0x10: ride = RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[peep->current_ride]; - *argument_1 = 0x702 | (ride.var_04A << 16); + *argument_1 = STR_FIXING_RIDE | (ride.var_04A << 16); *argument_2 = ride.var_04C; break; case 0x16: ride = RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[peep->current_ride]; - *argument_1 = 0x701 | (ride.var_04A << 16); + *argument_1 = STR_HEADING_TO_RIDE_FOR_INSPECTION | (ride.var_04A << 16); *argument_2 = ride.var_04C; break; case 0x17: From 025fa816631a6c43e36e41a493c07f74682f54c5 Mon Sep 17 00:00:00 2001 From: Duncan Date: Fri, 27 Jun 2014 15:05:03 +0100 Subject: [PATCH 06/13] Now uses known peep state values. Note peep_state_moWing not moPing. Will require checking to make sure it doesn't break anything. --- src/window_guest_list.c | 46 ++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/window_guest_list.c b/src/window_guest_list.c index 678097df52..d3d88730da 100644 --- a/src/window_guest_list.c +++ b/src/window_guest_list.c @@ -851,7 +851,7 @@ void get_arguments_from_thought(rct_peep_thought thought, uint32* argument_1, ui else{ esi = 0x9AC864; } - *argument_1 = ((thought.type + 0x5C8) & 0xFFFF) | (*((uint16*)esi) << 16); + *argument_1 = ((thought.type + STR_THOUGHT_START) & 0xFFFF) | (*((uint16*)esi) << 16); *argument_2 = *((uint32*)(esi+2)); } @@ -874,9 +874,9 @@ void get_arguments_from_action(rct_peep* peep, uint32 *argument_1, uint32* argum *argument_1 = STR_WALKING; *argument_2 = 0; break; - case 3: - case 4: - case 7: + case PEEP_STATE_ON_RIDE: + case PEEP_STATE_LEAVING_RIDE: + case PEEP_STATE_ENTERING_RIDE: *argument_1 = STR_ON_RIDE; ride = RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[peep->current_ride]; if (RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + ride.type*8, uint32)& 0x400000){ @@ -885,12 +885,12 @@ void get_arguments_from_action(rct_peep* peep, uint32 *argument_1, uint32* argum *argument_1 |= (ride.var_04A << 16); *argument_2 = ride.var_04C; break; - case 0x11: + case PEEP_STATE_BUYING: ride = RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[peep->current_ride]; *argument_1 = STR_AT_RIDE | (ride.var_04A << 16); *argument_2 = ride.var_04C; break; - case 5: + case PEEP_STATE_WALKING: case 0x14: if (peep->var_C5 != 0xFF){ ride = RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[peep->var_C5]; @@ -902,17 +902,17 @@ void get_arguments_from_action(rct_peep* peep, uint32 *argument_1, uint32* argum *argument_2 = 0; } break; - case 2: - case 6: + case PEEP_STATE_QUEUING_FRONT: + case PEEP_STATE_QUEUING: ride = RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[peep->current_ride]; *argument_1 = STR_QUEUING_FOR | (ride.var_04A << 16); *argument_2 = ride.var_04C; break; - case 8: + case PEEP_STATE_SITTING: *argument_1 = STR_SITTING; *argument_2 = 0; break; - case 0x12: + case PEEP_STATE_WATCHING: if (peep->current_ride != 0xFF){ ride = RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[peep->current_ride]; *argument_1 = STR_WATCHING_RIDE | (ride.var_04A << 16); @@ -927,33 +927,33 @@ void get_arguments_from_action(rct_peep* peep, uint32 *argument_1, uint32* argum *argument_2 = 0; } break; - case 9: + case PEEP_STATE_PICKED: *argument_1 = STR_SELECT_LOCATION; *argument_2 = 0; break; - case 0xA: - case 0xD: - case 0xE: + case PEEP_STATE_PATROLLING: + case PEEP_STATE_ENTERING_PARK: + case PEEP_STATE_LEAVING_PARK: *argument_1 = STR_WALKING; *argument_2 = 0; break; - case 0xB: + case PEEP_STATE_MOWING: *argument_1 = STR_MOWING_GRASS; *argument_2 = 0; break; - case 0xC: + case PEEP_STATE_SWEEPING: *argument_1 = STR_SWEEPING_FOOTPATH; *argument_2 = 0; break; - case 0x15: + case PEEP_STATE_WATERING: *argument_1 = STR_WATERING_GARDENS; *argument_2 = 0; break; - case 0x13: + case PEEP_STATE_EMPTYING_BIN: *argument_1 = STR_EMPTYING_LITTER_BIN; *argument_2 = 0; break; - case 0xF: + case PEEP_STATE_ANSWERING: if (peep->pad_2C == 0){ *argument_1 = STR_WALKING; *argument_2 = 0; @@ -968,19 +968,19 @@ void get_arguments_from_action(rct_peep* peep, uint32 *argument_1, uint32* argum *argument_2 = ride.var_04C; } break; - case 0x10: + case PEEP_STATE_FIXING: ride = RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[peep->current_ride]; *argument_1 = STR_FIXING_RIDE | (ride.var_04A << 16); *argument_2 = ride.var_04C; break; - case 0x16: + case PEEP_STATE_HEADING_TO_INSPECTION: ride = RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[peep->current_ride]; *argument_1 = STR_HEADING_TO_RIDE_FOR_INSPECTION | (ride.var_04A << 16); *argument_2 = ride.var_04C; break; - case 0x17: + case PEEP_STATE_INSPECTING: ride = RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[peep->current_ride]; - *argument_1 = 0x75E | (ride.var_04A << 16); + *argument_1 = STR_INSPECTING_RIDE | (ride.var_04A << 16); *argument_2 = ride.var_04C; break; } From 5a32c8770ba6a5c3fa32cb585ae00fe39889453b Mon Sep 17 00:00:00 2001 From: Duncan Date: Fri, 27 Jun 2014 15:06:05 +0100 Subject: [PATCH 07/13] Update string_ids.h --- src/string_ids.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/string_ids.h b/src/string_ids.h index 1ab3cfbba9..88c0d9ff8d 100644 --- a/src/string_ids.h +++ b/src/string_ids.h @@ -318,6 +318,8 @@ enum { STR_LEAVING_PARK = 1447, STR_WATCHING_NEW_RIDE_BEING_CONSTRUCTED = 1448, + STR_THOUGHT_START = 1480, + STR_GUESTS = 1463, STR_CONSTRUCT_FOOTPATH_ON_LAND_TIP = 1655, @@ -380,7 +382,9 @@ enum { STR_GUESTS_FAVOURITE_PLURAL_LABEL = 1843, STR_RIDE_LIST_INFORMATION_TYPE_TIP = 1844, STR_NUM_GUESTS = 1846, - + + STR_INSPECTING_RIDE = 1886, + STR_BUILD_RIDE_TIP = 1895, STR_START_NEW_GAME_TIP = 1921, From c69dec0802dcdcc29f3db3c541ff6b6b20be12c7 Mon Sep 17 00:00:00 2001 From: Duncan Date: Fri, 27 Jun 2014 15:33:31 +0100 Subject: [PATCH 08/13] Fixed logic mistake in thoughts Has not been tested. --- src/window_guest_list.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/window_guest_list.c b/src/window_guest_list.c index d3d88730da..932bd16d51 100644 --- a/src/window_guest_list.c +++ b/src/window_guest_list.c @@ -827,11 +827,11 @@ static int window_guest_list_is_peep_in_filter(rct_peep* peep) void get_arguments_from_thought(rct_peep_thought thought, uint32* argument_1, uint32* argument_2){ int esi = 0x9AC86C; - if ((RCT2_ADDRESS(0x981DB1, uint16)[thought.type] & 0xFF) == 1){ + if ((RCT2_ADDRESS(0x981DB1, uint16)[thought.type] & 0xFF) & 1){ rct_ride* ride = &(RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST,rct_ride)[thought.item]); esi = &(ride->var_04A); } - else if ((RCT2_ADDRESS(0x981DB1, uint16)[thought.type] & 0xFF) == 2){ + else if ((RCT2_ADDRESS(0x981DB1, uint16)[thought.type] & 0xFF) & 2){ if (thought.item < 0x20){ RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + 0x7C4; } @@ -839,7 +839,7 @@ void get_arguments_from_thought(rct_peep_thought thought, uint32* argument_1, ui RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + 0x82A; } } - else if ((RCT2_ADDRESS(0x981DB1, uint16)[thought.type] & 0xFF) == 4){ + else if ((RCT2_ADDRESS(0x981DB1, uint16)[thought.type] & 0xFF) & 4){ if (thought.item < 0x20){ RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + 0x7FC; } From debbe7cc44c3e82f45ee689538901f23d53cb0ff Mon Sep 17 00:00:00 2001 From: Duncan Date: Fri, 27 Jun 2014 15:47:23 +0100 Subject: [PATCH 09/13] Added offsets for item start --- src/string_ids.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/string_ids.h b/src/string_ids.h index 88c0d9ff8d..a13bbe7d2d 100644 --- a/src/string_ids.h +++ b/src/string_ids.h @@ -318,10 +318,10 @@ enum { STR_LEAVING_PARK = 1447, STR_WATCHING_NEW_RIDE_BEING_CONSTRUCTED = 1448, + STR_GUESTS = 1463, + STR_THOUGHT_START = 1480, - STR_GUESTS = 1463, - STR_CONSTRUCT_FOOTPATH_ON_LAND_TIP = 1655, STR_CONSTRUCT_BRIDGE_OR_TUNNEL_FOOTPATH_TIP = 1656, @@ -401,6 +401,11 @@ enum { STR_MARKETING = 1953, STR_RESEARCH_FUNDING = 1954, + STR_ITEM_START = 1988, + STR_ITEM_SINGULAR_START = 2044, + STR_ITEM2_START = 2090, + STR_ITEM2_SINGULAR_START = 2134, + STR_CELSIUS_VALUE = 2216, STR_FAHRENHEIT_VALUE = 2217, From c3eaf36e6ddcf1973c7e2761053691d997d7df7c Mon Sep 17 00:00:00 2001 From: Duncan Date: Fri, 27 Jun 2014 15:48:54 +0100 Subject: [PATCH 10/13] Now uses known item string offsets. --- src/window_guest_list.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/window_guest_list.c b/src/window_guest_list.c index 932bd16d51..a50a3b22d7 100644 --- a/src/window_guest_list.c +++ b/src/window_guest_list.c @@ -833,26 +833,26 @@ void get_arguments_from_thought(rct_peep_thought thought, uint32* argument_1, ui } else if ((RCT2_ADDRESS(0x981DB1, uint16)[thought.type] & 0xFF) & 2){ if (thought.item < 0x20){ - RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + 0x7C4; + RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + STR_ITEM_START; } else{ - RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + 0x82A; + RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + STR_ITEM2_START; } } else if ((RCT2_ADDRESS(0x981DB1, uint16)[thought.type] & 0xFF) & 4){ if (thought.item < 0x20){ - RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + 0x7FC; + RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + STR_SINGULAR_ITEM_START; } else { - RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + 0x856; + RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + STR_SINGULAR_ITEM2_START; } } else{ - esi = 0x9AC864; + esi = 0x9AC864; //No thought? } *argument_1 = ((thought.type + STR_THOUGHT_START) & 0xFFFF) | (*((uint16*)esi) << 16); - *argument_2 = *((uint32*)(esi+2)); + *argument_2 = *((uint32*)(esi+2)); //Always 0 apart from on rides? } /** From 339bfa11980e5c58e08cd35d4afd3e6badab9555 Mon Sep 17 00:00:00 2001 From: Duncan Frost Date: Fri, 27 Jun 2014 18:28:50 +0100 Subject: [PATCH 11/13] Fix little bug in peep thought updates. Fix compile issues --- src/peep.c | 2 +- src/peep.h | 2 +- src/window_guest_list.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/peep.c b/src/peep.c index 7042c04c5d..437bc56c3f 100644 --- a/src/peep.c +++ b/src/peep.c @@ -103,7 +103,7 @@ static void peep_update(rct_peep *peep) peep->thoughts[i].var_2++; ebp--; } - } else if (peep->thoughts[i].var_2 >= 0) { + } else if (peep->thoughts[i].var_2 > 1) { if (++peep->thoughts[i].var_3 > 255) { if (++peep->thoughts[i].var_3 >= 28) { peep->var_45 |= 1; diff --git a/src/peep.h b/src/peep.h index aba18a85e3..2ddc702b7d 100644 --- a/src/peep.h +++ b/src/peep.h @@ -200,7 +200,7 @@ enum PEEP_STATE { PEEP_STATE_SITTING = 8, PEEP_STATE_PICKED = 9, PEEP_STATE_PATROLLING = 10, // Not sure - PEEP_STATE_MOPING = 11, + PEEP_STATE_MOWING = 11, PEEP_STATE_SWEEPING = 12, PEEP_STATE_ENTERING_PARK = 13, PEEP_STATE_LEAVING_PARK = 14, diff --git a/src/window_guest_list.c b/src/window_guest_list.c index a50a3b22d7..209bfb27bc 100644 --- a/src/window_guest_list.c +++ b/src/window_guest_list.c @@ -841,11 +841,11 @@ void get_arguments_from_thought(rct_peep_thought thought, uint32* argument_1, ui } else if ((RCT2_ADDRESS(0x981DB1, uint16)[thought.type] & 0xFF) & 4){ if (thought.item < 0x20){ - RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + STR_SINGULAR_ITEM_START; + RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + STR_ITEM_SINGULAR_START; } else { - RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + STR_SINGULAR_ITEM2_START; + RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + STR_ITEM2_SINGULAR_START; } } else{ From 817c319083fe8699d3a030a8e2739e8599ee12eb Mon Sep 17 00:00:00 2001 From: Duncan Frost Date: Fri, 27 Jun 2014 18:44:41 +0100 Subject: [PATCH 12/13] Fix dropdown mistake added note to prevent other people falling for it --- src/window_dropdown.c | 1 + src/window_guest_list.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/window_dropdown.c b/src/window_dropdown.c index 4b552e7d80..f9b609d453 100644 --- a/src/window_dropdown.c +++ b/src/window_dropdown.c @@ -53,6 +53,7 @@ int _dropdown_highlighted_index; uint16 gDropdownItemsFormat[64]; sint64 gDropdownItemsArgs[64]; +// Replaces 0x009DED38 uint32 gDropdownItemsChecked; static void window_dropdown_emptysub() { } diff --git a/src/window_guest_list.c b/src/window_guest_list.c index 209bfb27bc..9288d620f5 100644 --- a/src/window_guest_list.c +++ b/src/window_guest_list.c @@ -281,7 +281,7 @@ static void window_guest_list_mousedown(int widgetIndex, rct_window*w, rct_widge gDropdownItemsFormat[i] = 1142; gDropdownItemsArgs[i] = STR_PAGE_1 + i; } - RCT2_GLOBAL(0x009DED38, uint32) |= (1 << _window_guest_list_selected_view); + gDropdownItemsChecked = (1 << _window_guest_list_selected_view); break; case WIDX_INFO_TYPE_DROPDOWN_BUTTON: widget = &w->widgets[widgetIndex - 1]; @@ -300,7 +300,7 @@ static void window_guest_list_mousedown(int widgetIndex, rct_window*w, rct_widge gDropdownItemsFormat[i] = 1142; gDropdownItemsArgs[i] = STR_ACTIONS + i; } - RCT2_GLOBAL(0x009DED38, uint32) |= (1 << _window_guest_list_selected_view); + gDropdownItemsChecked = (1 << _window_guest_list_selected_view); break; } } From 9561b9295793d36eaf55bebf9b834f0af83b135e Mon Sep 17 00:00:00 2001 From: Duncan Frost Date: Sat, 28 Jun 2014 12:16:49 +0100 Subject: [PATCH 13/13] Fix small bug caused by dropdown box not being fully reversed --- src/window_guest_list.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/window_guest_list.c b/src/window_guest_list.c index 9288d620f5..bea5fa5863 100644 --- a/src/window_guest_list.c +++ b/src/window_guest_list.c @@ -286,6 +286,11 @@ static void window_guest_list_mousedown(int widgetIndex, rct_window*w, rct_widge case WIDX_INFO_TYPE_DROPDOWN_BUTTON: widget = &w->widgets[widgetIndex - 1]; + for (i = 0; i < 2; i++) { + gDropdownItemsFormat[i] = 1142; + gDropdownItemsArgs[i] = STR_ACTIONS + i; + } + window_dropdown_show_text_custom_width( w->x + widget->left, w->y + widget->top, @@ -296,10 +301,6 @@ static void window_guest_list_mousedown(int widgetIndex, rct_window*w, rct_widge widget->right - widget->left - 3 ); - for (i = 0; i < 2; i++) { - gDropdownItemsFormat[i] = 1142; - gDropdownItemsArgs[i] = STR_ACTIONS + i; - } gDropdownItemsChecked = (1 << _window_guest_list_selected_view); break; }