mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge branch 'update_addresses' of https://github.com/ZedThree/OpenRCT2 into ZedThree-update_addresses
This commit is contained in:
commit
d85e2f8a02
|
@ -202,6 +202,9 @@
|
|||
|
||||
#define RCT2_ADDRESS_SCENARIO_NAME 0x0141F5B8
|
||||
|
||||
#define RCT2_ADDRESS_WATER_RAISE_COST 0x0141F738
|
||||
#define RCT2_ADDRESS_WATER_LOWER_COST 0x0141F73C
|
||||
|
||||
#define RCT2_ADDRESS_WINDOW_LIST 0x01420078
|
||||
#define RCT2_ADDRESS_NEW_WINDOW_PTR 0x014234B8
|
||||
#define RCT2_ADDRESS_VIEWPORT_LIST 0x014234BC
|
||||
|
|
12
src/game.c
12
src/game.c
|
@ -399,8 +399,8 @@ static void game_handle_input_mouse(int x, int y, int state)
|
|||
RCT2_GLOBAL(0x009DE540, sint16) = 1000;
|
||||
dx <<= viewport->zoom + 1;
|
||||
dy <<= viewport->zoom + 1;
|
||||
w->var_4B2 += dx;
|
||||
w->var_4B4 += dy;
|
||||
w->saved_view_x += dx;
|
||||
w->saved_view_y += dy;
|
||||
}
|
||||
}
|
||||
} else if (state == 4) {
|
||||
|
@ -795,11 +795,11 @@ void game_handle_edge_scroll()
|
|||
|
||||
// Scroll viewport
|
||||
if (scrollX != 0) {
|
||||
mainWindow->var_4B2 += scrollX * (12 << mainWindow->viewport->zoom);
|
||||
mainWindow->saved_view_x += scrollX * (12 << mainWindow->viewport->zoom);
|
||||
RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 7);
|
||||
}
|
||||
if (scrollY != 0) {
|
||||
mainWindow->var_4B4 += scrollY * (12 << mainWindow->viewport->zoom);
|
||||
mainWindow->saved_view_y += scrollY * (12 << mainWindow->viewport->zoom);
|
||||
RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 7);
|
||||
}
|
||||
}
|
||||
|
@ -836,11 +836,11 @@ void game_handle_key_scroll()
|
|||
|
||||
// Scroll viewport
|
||||
if (scrollX != 0) {
|
||||
mainWindow->var_4B2 += scrollX * (12 << mainWindow->viewport->zoom);
|
||||
mainWindow->saved_view_x += scrollX * (12 << mainWindow->viewport->zoom);
|
||||
RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 7);
|
||||
}
|
||||
if (scrollY != 0) {
|
||||
mainWindow->var_4B4 += scrollY * (12 << mainWindow->viewport->zoom);
|
||||
mainWindow->saved_view_y += scrollY * (12 << mainWindow->viewport->zoom);
|
||||
RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 7);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -422,8 +422,8 @@ void scenario_load_and_play(rct_scenario_basic *scenario)
|
|||
mainWindow = window_get_main();
|
||||
|
||||
mainWindow->var_4B0 = -1;
|
||||
mainWindow->var_4B2 = RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_X, sint16);
|
||||
mainWindow->var_4B4 = RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_Y, sint16);
|
||||
mainWindow->saved_view_x = RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_X, sint16);
|
||||
mainWindow->saved_view_y = RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_Y, sint16);
|
||||
|
||||
uint8 _cl = (RCT2_GLOBAL(0x0138869E, sint16) & 0xFF) - mainWindow->viewport->zoom;
|
||||
mainWindow->viewport->zoom = RCT2_GLOBAL(0x0138869E, sint16) & 0xFF;
|
||||
|
@ -438,8 +438,8 @@ void scenario_load_and_play(rct_scenario_basic *scenario)
|
|||
mainWindow->viewport->view_height <<= _cl;
|
||||
}
|
||||
}
|
||||
mainWindow->var_4B2 -= mainWindow->viewport->view_width >> 1;
|
||||
mainWindow->var_4B4 -= mainWindow->viewport->view_height >> 1;
|
||||
mainWindow->saved_view_x -= mainWindow->viewport->view_width >> 1;
|
||||
mainWindow->saved_view_y -= mainWindow->viewport->view_height >> 1;
|
||||
window_invalidate(mainWindow);
|
||||
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069E9A7);
|
||||
|
|
|
@ -167,8 +167,8 @@ static void title_update_showcase()
|
|||
|
||||
w = window_get_main();
|
||||
w->var_4B0 = -1;
|
||||
w->var_4B2 = RCT2_GLOBAL(0x0138869A, sint16);
|
||||
w->var_4B4 = RCT2_GLOBAL(0x0138869C, sint16);
|
||||
w->saved_view_x = RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_X, sint16);
|
||||
w->saved_view_y = RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_Y, sint16);
|
||||
|
||||
{
|
||||
char _cl = (RCT2_GLOBAL(0x0138869E, sint16) & 0xFF) - w->viewport->zoom;
|
||||
|
@ -184,8 +184,8 @@ static void title_update_showcase()
|
|||
w->viewport->view_height <<= _cl;
|
||||
}
|
||||
}
|
||||
w->var_4B2 -= w->viewport->view_width >> 1;
|
||||
w->var_4B4 -= w->viewport->view_height >> 1;
|
||||
w->saved_view_x -= w->viewport->view_width >> 1;
|
||||
w->saved_view_y -= w->viewport->view_height >> 1;
|
||||
}
|
||||
|
||||
window_invalidate(w);
|
||||
|
|
|
@ -63,7 +63,7 @@ void viewport_init_all()
|
|||
RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DOWN_WINDOWCLASS, rct_windowclass) = -1;
|
||||
RCT2_GLOBAL(0x009DE550, sint32) = -1;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_NOT_SHOWN_TICKS, sint16) = -1;
|
||||
RCT2_GLOBAL(0x009DE58A, sint16) = 0;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, sint16) = 0;
|
||||
RCT2_GLOBAL(0x009DEA50, sint16) = -1;
|
||||
RCT2_CALLPROC_EBPSAFE(0x006EE3C3);
|
||||
format_string((char*)0x0141FA44, STR_CANCEL, NULL);
|
||||
|
|
|
@ -136,8 +136,8 @@ typedef struct rct_window {
|
|||
sint16 var_4AC;
|
||||
sint16 var_4AE;
|
||||
sint16 var_4B0; // viewport target sprite?
|
||||
sint16 var_4B2; // viewport target x?
|
||||
sint16 var_4B4; // viewport target y?
|
||||
sint16 saved_view_x; // 0x4B2
|
||||
sint16 saved_view_y; // 0x4B4
|
||||
rct_windowclass classification; // 0x4B6
|
||||
uint8 pad_4B7;
|
||||
sint8 var_4B8;
|
||||
|
|
|
@ -223,7 +223,7 @@ static void window_footpath_close()
|
|||
RCT2_CALLPROC_EBPSAFE(0x006A7831);
|
||||
RCT2_CALLPROC_X(0x006CB70A, 0, 0, 0, 0, 0, 0, 0);
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068AB1B);
|
||||
RCT2_GLOBAL(0x009DE58A, uint16) &= ~2;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) &= ~2;
|
||||
window_invalidate_by_id(WC_TOP_TOOLBAR, 0);
|
||||
hide_gridlines();
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ static void window_footpath_mouseup()
|
|||
tool_cancel();
|
||||
RCT2_CALLPROC_EBPSAFE(0x006A7831);
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068AB1B);
|
||||
RCT2_GLOBAL(0x009DE58A, uint16) &= ~2;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) &= ~2;
|
||||
RCT2_GLOBAL(0x00F3EF99, uint8) = PATH_CONSTRUCTION_MODE_LAND;
|
||||
tool_set(w, WIDX_CONSTRUCT_ON_LAND, 17);
|
||||
RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 6);
|
||||
|
@ -273,7 +273,7 @@ static void window_footpath_mouseup()
|
|||
RCT2_CALLPROC_EBPSAFE(0x006EE281);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006A7831);
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068AB1B);
|
||||
RCT2_GLOBAL(0x009DE58A, uint16) &= ~2;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) &= ~2;
|
||||
RCT2_GLOBAL(0x00F3EF99, uint8) = PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL;
|
||||
tool_set(w, WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL, 12);
|
||||
RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 6);
|
||||
|
|
|
@ -800,15 +800,15 @@ static void window_park_entrance_toolupdate()
|
|||
|
||||
if (widgetIndex == WIDX_BUY_LAND_RIGHTS) {
|
||||
RCT2_CALLPROC_X(0x0068AAE1, x, y, 0, 0, w, 0, 0);
|
||||
RCT2_GLOBAL(0x009DE58A, uint16) &= 0xFFFE;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) &= 0xFFFE;
|
||||
screen_pos_to_map_pos(&x, &y);
|
||||
if (x != SPRITE_LOCATION_NULL) {
|
||||
RCT2_GLOBAL(0x009DE58A, uint16) |= 1;
|
||||
RCT2_GLOBAL(0x009DE594, uint16) = 4;
|
||||
RCT2_GLOBAL(0x009DE58C, uint16) = x;
|
||||
RCT2_GLOBAL(0x009DE58E, uint16) = x;
|
||||
RCT2_GLOBAL(0x009DE590, uint16) = y;
|
||||
RCT2_GLOBAL(0x009DE592, uint16) = y;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) |= 1;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_TYPE, uint16) = 4;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_A_X, uint16) = x;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_B_X, uint16) = x;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_A_Y, uint16) = y;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_B_Y, uint16) = y;
|
||||
RCT2_CALLPROC_X(0x0068AAE1, x, y, 0, 0, w, 0, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,8 +102,8 @@ void window_water_open()
|
|||
window_init_scroll_widgets(window);
|
||||
window_push_others_below(window);
|
||||
|
||||
RCT2_GLOBAL(0x0141F738, uint32) = 0x80000000;
|
||||
RCT2_GLOBAL(0x0141F73C, uint32) = 0x80000000;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_WATER_RAISE_COST, uint32) = 0x80000000;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_WATER_LOWER_COST, uint32) = 0x80000000;
|
||||
window->colours[0] = 24;
|
||||
window->colours[1] = 24;
|
||||
window->colours[2] = 24;
|
||||
|
@ -215,12 +215,12 @@ static void window_water_paint()
|
|||
// Draw raise cost amount
|
||||
x = (window_water_widgets[WIDX_PREVIEW].left + window_water_widgets[WIDX_PREVIEW].right) / 2 + w->x;
|
||||
y = window_water_widgets[WIDX_PREVIEW].bottom + w->y + 5;
|
||||
if (RCT2_GLOBAL(0x0141F738, uint32) != 0x80000000 && RCT2_GLOBAL(0x0141F738, uint32) != 0)
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_WATER_RAISE_COST, uint32) != 0x80000000 && RCT2_GLOBAL(RCT2_ADDRESS_WATER_RAISE_COST, uint32) != 0)
|
||||
gfx_draw_string_centred(dpi, 984, x, y, 0, (void*)0x0141F738);
|
||||
y += 10;
|
||||
|
||||
// Draw lower cost amount
|
||||
if (RCT2_GLOBAL(0x0141F73C, uint32) != 0x80000000 && RCT2_GLOBAL(0x0141F73C, uint32) != 0)
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_WATER_LOWER_COST, uint32) != 0x80000000 && RCT2_GLOBAL(RCT2_ADDRESS_WATER_LOWER_COST, uint32) != 0)
|
||||
gfx_draw_string_centred(dpi, 985, x, y, 0, (void*)0x0141F73C);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue