diff --git a/projects/openrct2.vcxproj b/projects/openrct2.vcxproj index 0660d091d7..ed5c5a5c55 100644 --- a/projects/openrct2.vcxproj +++ b/projects/openrct2.vcxproj @@ -20,12 +20,16 @@ + + + + @@ -34,11 +38,17 @@ + + + + + + diff --git a/projects/openrct2.vcxproj.filters b/projects/openrct2.vcxproj.filters index 3e5e73f25b..2d18f28aab 100644 --- a/projects/openrct2.vcxproj.filters +++ b/projects/openrct2.vcxproj.filters @@ -13,6 +13,9 @@ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + {611458dc-7dd2-4c37-af0f-306cf9d85fb9} + @@ -54,6 +57,18 @@ Header Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + @@ -83,6 +98,24 @@ Source Files + + Source Files + + + Source Files + + + Windows + + + Windows + + + Windows + + + Windows + diff --git a/src/addresses.h b/src/addresses.h index 95d47e3924..52ca4bc08b 100644 --- a/src/addresses.h +++ b/src/addresses.h @@ -76,6 +76,8 @@ #define RCT2_ADDRESS_SPRITES_START_TEXTFX 0x013573C2 #define RCT2_ADDRESS_SPRITES_START_LITTER 0x013573C4 +#define RCT2_ADDRESS_NEWS_ITEM_LIST 0x013CA754 + #define RCT2_ADDRESS_WINDOW_LIST 0x01420078 #define RCT2_ADDRESS_NEW_WINDOW_PTR 0x014234B8 #define RCT2_ADDRESS_VIEWPORT_LIST 0x014234BC diff --git a/src/gfx.c b/src/gfx.c index 54512d6ba4..f4dd3bd29b 100644 --- a/src/gfx.c +++ b/src/gfx.c @@ -23,9 +23,9 @@ #include "rct2.h" /** -* Clears the screen with the specified colour. -* rct2: 0x00678A9F -*/ + * Clears the screen with the specified colour. + * rct2: 0x00678A9F + */ void gfx_clear(rct_drawpixelinfo *dpi, int colour) { int y, w, h; @@ -42,37 +42,37 @@ void gfx_clear(rct_drawpixelinfo *dpi, int colour) } /** -* -* rct2: 0x00678AD4 -* left (ax) -* top (cx) -* right (bx) -* bottom (dx) -* colour (ebp) -*/ + * + * rct2: 0x00678AD4 + * left (ax) + * top (cx) + * right (bx) + * bottom (dx) + * colour (ebp) + */ void gfx_fill_rect(rct_drawpixelinfo *dpi, int left, int top, int right, int bottom, int colour) { RCT2_CALLPROC_X(0x00678AD4, left, right, top, bottom, 0, dpi, colour); } /** -* -* rct2: 0x0067A28E -* image_id (ebx) -* x (cx) -* y (dx) -*/ + * + * rct2: 0x0067A28E + * image_id (ebx) + * x (cx) + * y (dx) + */ void gfx_draw_sprite(rct_drawpixelinfo *dpi, int image_id, int x, int y) { RCT2_CALLPROC_X(0x0067A28E, 0, image_id, x, y, 0, dpi, 0); } /** -* -* rct2: 0x00683854 -* a1 (ebx) -* product (cl) -*/ + * + * rct2: 0x00683854 + * a1 (ebx) + * product (cl) + */ void gfx_transpose_palette(int pal, unsigned char product) { int eax, ebx, ebp; @@ -96,24 +96,24 @@ void gfx_transpose_palette(int pal, unsigned char product) } /** -* Draws i formatted text string centred at i specified position. -* rct2: 0x006C1D6C -* dpi (edi) -* format (bx) -* x (cx) -* y (dx) -* colour (al) -* args (esi) -*/ + * Draws i formatted text string centred at i specified position. + * rct2: 0x006C1D6C + * dpi (edi) + * format (bx) + * x (cx) + * y (dx) + * colour (al) + * args (esi) + */ void gfx_draw_string_centred(rct_drawpixelinfo *dpi, int format, int x, int y, int colour, void *args) { RCT2_CALLPROC_X(0x006C1D6C, colour, format, x, y, args, dpi, 0); } /** -* -* rct2: 0x006ED7E5 -*/ + * + * rct2: 0x006ED7E5 + */ void gfx_invalidate_screen() { RCT2_CALLPROC_EBPSAFE(0x006ED7E5); diff --git a/src/gfx.h b/src/gfx.h index ab908e7fbb..8be5912171 100644 --- a/src/gfx.h +++ b/src/gfx.h @@ -1,22 +1,22 @@ /***************************************************************************** -* Copyright (c) 2014 Ted John -* OpenRCT2, an open source clone of Roller Coaster Tycoon 2. -* -* This file is part of OpenRCT2. -* -* OpenRCT2 is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. - -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. - -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -*****************************************************************************/ + * Copyright (c) 2014 Ted John + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * This file is part of OpenRCT2. + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *****************************************************************************/ #ifndef _GFX_H_ #define _GFX_H_ diff --git a/src/intro.c b/src/intro.c index e7ecf5e7bc..fd91386b3f 100644 --- a/src/intro.c +++ b/src/intro.c @@ -277,9 +277,9 @@ static void screen_intro_process_mouse_input() } /** -* -* rct2: 0x006E3AEC -*/ + * + * rct2: 0x006E3AEC + */ static void screen_intro_process_keyboard_input() { if (gLastKeyPressed != 0) diff --git a/src/news_item.c b/src/news_item.c new file mode 100644 index 0000000000..f0037c5b21 --- /dev/null +++ b/src/news_item.c @@ -0,0 +1,40 @@ +/***************************************************************************** + * Copyright (c) 2014 Ted John + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * This file is part of OpenRCT2. + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *****************************************************************************/ + +#include "addresses.h" +#include "news_item.h" +#include "rct2.h" + +/** + * + * rct2: 0x0066DF32 + */ +void news_item_init_queue() +{ + int i; + rct_news_item *newsItems = RCT2_ADDRESS(RCT2_ADDRESS_NEWS_ITEM_LIST, rct_news_item); + + newsItems[0].type = NEWS_ITEM_NULL; + newsItems[11].type = NEWS_ITEM_NULL; + for (i = 0; i < 16; i++) + RCT2_ADDRESS(0x01358750, uint8)[i] = 0; + + RCT2_CALLPROC_EBPSAFE(0x0066BB79); // window_game_bottom_toolbar_invalidate_news_item(); +} \ No newline at end of file diff --git a/src/news_item.h b/src/news_item.h new file mode 100644 index 0000000000..c7effe25a8 --- /dev/null +++ b/src/news_item.h @@ -0,0 +1,58 @@ +/***************************************************************************** + * Copyright (c) 2014 Ted John + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * This file is part of OpenRCT2. + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *****************************************************************************/ + +#ifndef _NEWS_ITEM_H_ +#define _NEWS_ITEM_H_ + +#include "rct2.h" + +enum { + NEWS_ITEM_NULL, + NEWS_ITEM_RIDE, + NEWS_ITEM_PEEP_1, + NEWS_ITEM_PEEP_2, + NEWS_ITEM_MONEY, + NEWS_ITEM_BLANK, + NEWS_ITEM_SCENERY, + NEWS_ITEM_PEEPS, + NEWS_ITEM_AWARD, + NEWS_ITEM_GRAPH +}; + +/** + * News item structure. + * size: 0x10C + */ +typedef struct { + uint8 type; // 0x00 + uint8 flags; // 0x01 + uint32 assoc; // 0x02 + uint16 ticks; // 0x06 + uint8 month; // 0x08 + uint8 pad_09; // 0x09 + uint8 day; // 0x0A + uint8 pad_0B; // 0x0B + uint8 colour; // 0x0C + char text[255]; // 0x0D +} rct_news_item; + +void news_item_init_queue(); + +#endif \ No newline at end of file diff --git a/src/osinterface.c b/src/osinterface.c index 4f6e02728b..4f39c7efaa 100644 --- a/src/osinterface.c +++ b/src/osinterface.c @@ -113,7 +113,7 @@ static void osinterface_resize(int width, int height) if (_screenBuffer == NULL) { memset(newScreenBuffer, 0, newScreenBufferSize); } else { - memcpy(newScreenBuffer, _screenBuffer, _screenBufferSize); + memcpy(newScreenBuffer, _screenBuffer, min(_screenBufferSize, newScreenBufferSize)); if (newScreenBufferSize - _screenBufferSize > 0) memset((uint8*)newScreenBuffer + _screenBufferSize, 0, newScreenBufferSize - _screenBufferSize); free(_screenBuffer); diff --git a/src/peep.c b/src/peep.c index 9e64685470..d44e7acf74 100644 --- a/src/peep.c +++ b/src/peep.c @@ -24,9 +24,9 @@ #include "sprite.h" /** -* -* rct2: 0x0068F0A9 -*/ + * + * rct2: 0x0068F0A9 + */ void peep_update_all() { int i; diff --git a/src/peep.h b/src/peep.h index ea199cb67d..5027d5ece6 100644 --- a/src/peep.h +++ b/src/peep.h @@ -1,22 +1,22 @@ /***************************************************************************** -* Copyright (c) 2014 Ted John -* OpenRCT2, an open source clone of Roller Coaster Tycoon 2. -* -* This file is part of OpenRCT2. -* -* OpenRCT2 is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. - -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. - -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -*****************************************************************************/ + * Copyright (c) 2014 Ted John + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * This file is part of OpenRCT2. + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *****************************************************************************/ #ifndef _PEEP_H_ #define _PEEP_H_ diff --git a/src/rct2.c b/src/rct2.c index dd73ed5898..d2b3376122 100644 --- a/src/rct2.c +++ b/src/rct2.c @@ -125,7 +125,7 @@ void rct2_init() RCT2_CALLPROC_EBPSAFE(0x0068F050); RCT2_CALLPROC_EBPSAFE(0x006BD39C); - RCT2_CALLPROC_EBPSAFE(0x0068E8DA); // screen_title_load(); + title_load(); gfx_clear(RCT2_ADDRESS(RCT2_ADDRESS_SCREEN_DPI, rct_drawpixelinfo), 10); RCT2_GLOBAL(RCT2_ADDRESS_RUN_INTRO_TICK_PART, int) = 8; diff --git a/src/rct2.h b/src/rct2.h index 00f5073c4c..3e2b5b57a1 100644 --- a/src/rct2.h +++ b/src/rct2.h @@ -21,6 +21,8 @@ #ifndef _SDL_RCT2_H_ #define _SDL_RCT2_H_ +#define NULL 0 + typedef signed char sint8; typedef signed short sint16; typedef signed long sint32; diff --git a/src/sprite.h b/src/sprite.h index ff55d3cc87..6903c5434f 100644 --- a/src/sprite.h +++ b/src/sprite.h @@ -1,22 +1,22 @@ /***************************************************************************** -* Copyright (c) 2014 Ted John -* OpenRCT2, an open source clone of Roller Coaster Tycoon 2. -* -* This file is part of OpenRCT2. -* -* OpenRCT2 is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. - -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. - -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -*****************************************************************************/ + * Copyright (c) 2014 Ted John + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * This file is part of OpenRCT2. + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *****************************************************************************/ #ifndef _SPRITE_H_ #define _SPRITE_H_ @@ -46,9 +46,9 @@ typedef struct { } rct_litter; /** -* Sprite structure. -* size: 0x0100 -*/ + * Sprite structure. + * size: 0x0100 + */ typedef union { uint8 pad_00[0x100]; rct_unk_sprite unknown; diff --git a/src/sprites.h b/src/sprites.h new file mode 100644 index 0000000000..c04072bb17 --- /dev/null +++ b/src/sprites.h @@ -0,0 +1,135 @@ +/***************************************************************************** + * Copyright (c) 2014 Ted John + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * This file is part of OpenRCT2. + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *****************************************************************************/ + +#ifndef _SPRITES_H_ +#define _SPRITES_H_ + +enum { + SPR_NONE = -1, + + SPR_RESIZE = 5058, + + SPR_HEARING_VIEWPORT = 5166, + SPR_LOCATE = 5167, + SPR_RENAME = 5168, + + SPR_BUY_LAND_RIGHTS = 5176, + SPR_BUY_CONSTRUCTION_RIGHTS = 5177, + SPR_NO_ENTRY = 5178, + SPR_CLOSED = 5179, + SPR_OPEN = 5180, + SPR_TESTING = 5181, + + SPR_RIDE = 5187, + SPR_TRACK_PEEP = 5188, + SPR_SCENERY = 5189, + SPR_FINANCE = 5190, + SPR_NEW_RIDE = 5191, + SPR_MAP = 5192, + SPR_GUESTS = 5193, + SPR_AWARD = 5194, + SPR_GRAPH = 5195, + + SPR_LAND_TOOL_DECREASE = 5499, + + SPR_LAND_TOOL_INCREASE = 5501, + + SPR_LAND_TOOL_SIZE_0 = 5503, + SPR_LAND_TOOL_SIZE_1 = SPR_LAND_TOOL_SIZE_0 + 1, + SPR_LAND_TOOL_SIZE_2 = SPR_LAND_TOOL_SIZE_0 + 2, + SPR_LAND_TOOL_SIZE_3 = SPR_LAND_TOOL_SIZE_0 + 3, + SPR_LAND_TOOL_SIZE_4 = SPR_LAND_TOOL_SIZE_0 + 4, + SPR_LAND_TOOL_SIZE_5 = SPR_LAND_TOOL_SIZE_0 + 5, + SPR_LAND_TOOL_SIZE_6 = SPR_LAND_TOOL_SIZE_0 + 6, + SPR_LAND_TOOL_SIZE_7 = SPR_LAND_TOOL_SIZE_0 + 7, + + SPR_TAB_OBJECTIVE_0 = 5511, + SPR_TAB_OBJECTIVE_1 = SPR_TAB_OBJECTIVE_0 + 1, + SPR_TAB_OBJECTIVE_2 = SPR_TAB_OBJECTIVE_0 + 2, + SPR_TAB_OBJECTIVE_3 = SPR_TAB_OBJECTIVE_0 + 3, + SPR_TAB_OBJECTIVE_4 = SPR_TAB_OBJECTIVE_0 + 4, + SPR_TAB_OBJECTIVE_5 = SPR_TAB_OBJECTIVE_0 + 5, + SPR_TAB_OBJECTIVE_6 = SPR_TAB_OBJECTIVE_0 + 6, + SPR_TAB_OBJECTIVE_7 = SPR_TAB_OBJECTIVE_0 + 7, + SPR_TAB_OBJECTIVE_8 = SPR_TAB_OBJECTIVE_0 + 8, + SPR_TAB_OBJECTIVE_9 = SPR_TAB_OBJECTIVE_0 + 9, + SPR_TAB_OBJECTIVE_10 = SPR_TAB_OBJECTIVE_0 + 10, + SPR_TAB_OBJECTIVE_11 = SPR_TAB_OBJECTIVE_0 + 11, + SPR_TAB_OBJECTIVE_12 = SPR_TAB_OBJECTIVE_0 + 12, + SPR_TAB_OBJECTIVE_13 = SPR_TAB_OBJECTIVE_0 + 13, + SPR_TAB_OBJECTIVE_14 = SPR_TAB_OBJECTIVE_0 + 14, + SPR_TAB_OBJECTIVE_15 = SPR_TAB_OBJECTIVE_0 + 15, + + SPR_TOOLBAR_PAUSE = 5597, + SPR_TOOLBAR_FILE = 5599, + SPR_TOOLBAR_ZOOM_OUT = 5601, + SPR_TOOLBAR_ZOOM_IN = 5604, + SPR_TOOLBAR_ROTATE = 5607, + SPR_TOOLBAR_LAND = 5609, + SPR_TOOLBAR_MAP = 5611, + SPR_TOOLBAR_GUESTS = 5613, + SPR_TOOLBAR_SCENERY = 5615, + SPR_TOOLBAR_WATER = 5617, + SPR_TOOLBAR_RIDES = 5619, + SPR_TOOLBAR_VIEW = 5621, + SPR_TOOLBAR_FOOTPATH = 5623, + SPR_TOOLBAR_STAFF = 5627, + SPR_TOOLBAR_PARK = 5629, + SPR_TOOLBAR_CONSTRUCT_RIDE = 5631, + SPR_TOOLBAR_CLEAR_SCENERY = 5633, + + SPR_NEXT_WEATHER = 23189, + SPR_WEATHER_SUN = 23190, + SPR_WEATHER_SUN_CLOUD = 23191, + SPR_WEATHER_CLOUD = 23192, + SPR_WEATHER_LIGHT_RAIN = 23193, + SPR_WEATHER_HEAVY_RAIN = 23194, + SPR_WEATHER_STORM = 23195, + SPR_WEATHER_UNKNOWN = 23196, + + SPR_RATING_LOW = 23197, + SPR_RATING_HIGH = 23198, + + SPR_MENU_NEW_GAME = 23207, + SPR_MENU_LOAD_GAME = 23208, + SPR_MENU_TUTORIAL = 23209, + SPR_MENU_EXIT = 23210, + SPR_MENU_TOOLBOX = 23211, + SPR_MENU_LOGO = 23212, + SPR_CREDITS_LOGO_SMALL = 23213, + SPR_CREDITS_CHRIS_SAWYER_SMALL = 23214, + SPR_INTRO_CHRIS_SAWYER_00 = 23215, + SPR_INTRO_CHRIS_SAWYER_10 = SPR_INTRO_CHRIS_SAWYER_00 + 1, + SPR_INTRO_LOGO_00 = 23218, + SPR_INTRO_LOGO_10 = SPR_INTRO_LOGO_00 + 1, + SPR_INTRO_LOGO_20 = SPR_INTRO_LOGO_00 + 2, + SPR_INTRO_LOGO_01 = SPR_INTRO_LOGO_00 + 3, + SPR_INTRO_LOGO_11 = SPR_INTRO_LOGO_00 + 4, + SPR_INTRO_LOGO_21 = SPR_INTRO_LOGO_00 + 5, + + SPR_SIX_FLAGS = 23225, + SPR_INTRO_INFOGRAMES_00 = 23226, + SPR_INTRO_INFOGRAMES_10 = SPR_INTRO_INFOGRAMES_00 + 1, + SPR_INTRO_INFOGRAMES_01 = SPR_INTRO_INFOGRAMES_00 + 2, + SPR_INTRO_INFOGRAMES_11 = SPR_INTRO_INFOGRAMES_00 + 3, + SPR_CREDITS_INFOGRAMES = 23230, +}; + +#endif \ No newline at end of file diff --git a/src/strings.h b/src/strings.h index 77436bb9a1..a76f5f3d1c 100644 --- a/src/strings.h +++ b/src/strings.h @@ -1,22 +1,22 @@ /***************************************************************************** -* Copyright (c) 2014 Ted John -* OpenRCT2, an open source clone of Roller Coaster Tycoon 2. -* -* This file is part of OpenRCT2. -* -* OpenRCT2 is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. - -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. - -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -*****************************************************************************/ + * Copyright (c) 2014 Ted John + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * This file is part of OpenRCT2. + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *****************************************************************************/ #ifndef _STRINGS_H_ #define _STRINGS_H_ diff --git a/src/title.c b/src/title.c index 0301e87c20..282cccff60 100644 --- a/src/title.c +++ b/src/title.c @@ -20,8 +20,79 @@ #include "addresses.h" #include "game.h" +#include "gfx.h" +#include "news_item.h" #include "rct2.h" #include "intro.h" +#include "viewport.h" + +static void title_create_windows(); +static void title_init_showcase(); + +void window_main_open(); +void window_title_menu_open(); +void window_title_exit_open(); +void window_title_logo_open(); + +/** + * + * rct2: 0x0068E8DA + */ +void title_load() +{ + if (RCT2_GLOBAL(0x009DEA6E, uint8) & 1) + RCT2_CALLPROC_X(0x00667C15, 0, 1, 0, 0, 0, 0, 0); + + RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) = SCREEN_FLAGS_TITLE_DEMO; + + RCT2_CALLPROC_EBPSAFE(0x00667104); + RCT2_CALLPROC_EBPSAFE(0x006C4209); + RCT2_CALLPROC_EBPSAFE(0x0069EB13); + RCT2_CALLPROC_EBPSAFE(0x006ACA89); + RCT2_CALLPROC_EBPSAFE(0x0068F083); + RCT2_CALLPROC_EBPSAFE(0x006BD3A4); + RCT2_CALLPROC_EBPSAFE(0x0068AB4C); + RCT2_CALLPROC_EBPSAFE(0x00667132); + RCT2_CALLPROC_EBPSAFE(0x006C4494); + RCT2_CALLPROC_X(0x006C45ED, 0, 0, 0, 0, 0, 0, 0); + RCT2_CALLPROC_EBPSAFE(0x006DFEE4); + RCT2_CALLPROC_EBPSAFE(0x006ACA58); + RCT2_CALLPROC_EBPSAFE(0x0068F050); + RCT2_CALLPROC_EBPSAFE(0x006BD39C); + RCT2_CALLPROC_EBPSAFE(0x0068AFFD); + RCT2_CALLPROC_EBPSAFE(0x0069EBE4); + viewport_init_all(); + news_item_init_queue(); + title_create_windows(); + title_init_showcase(); + gfx_invalidate_screen(); + RCT2_GLOBAL(0x009DEA66, uint16) = 0; +} + +/** + * Creates the windows shown on the title screen; New game, load game, + * tutorial, toolbox and exit. + * rct2: 0x0066B5C0 (part of 0x0066B3E8) + */ +static void title_create_windows() +{ + // RCT2_CALLPROC_EBPSAFE(0x0066B3E8); + + window_main_open(); + window_title_menu_open(); + window_title_exit_open(); + window_title_logo_open(); + RCT2_CALLPROC_EBPSAFE(0x0066B905); +} + +/** + * + * rct2: 0x00678680 + */ +static void title_init_showcase() +{ + RCT2_CALLPROC_EBPSAFE(0x00678680); +} void title_update() { diff --git a/src/title.h b/src/title.h index 3616841aef..87dbcfa6c5 100644 --- a/src/title.h +++ b/src/title.h @@ -21,6 +21,7 @@ #ifndef _TITLE_H_ #define _TITLE_H_ +void title_load(); void title_update(); #endif \ No newline at end of file diff --git a/src/viewport.c b/src/viewport.c new file mode 100644 index 0000000000..08edd0f6c5 --- /dev/null +++ b/src/viewport.c @@ -0,0 +1,27 @@ +/***************************************************************************** + * Copyright (c) 2014 Ted John + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * This file is part of OpenRCT2. + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *****************************************************************************/ + +#include "addresses.h" +#include "viewport.h" + +void viewport_init_all() +{ + RCT2_CALLPROC_EBPSAFE(0x006E6EAC); +} \ No newline at end of file diff --git a/src/viewport.h b/src/viewport.h new file mode 100644 index 0000000000..762e14bc4c --- /dev/null +++ b/src/viewport.h @@ -0,0 +1,26 @@ +/***************************************************************************** + * Copyright (c) 2014 Ted John + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * This file is part of OpenRCT2. + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *****************************************************************************/ + +#ifndef _VIEWPORT_H_ +#define _VIEWPORT_H_ + +void viewport_init_all(); + +#endif \ No newline at end of file diff --git a/src/widget.h b/src/widget.h new file mode 100644 index 0000000000..a65ba755dd --- /dev/null +++ b/src/widget.h @@ -0,0 +1,45 @@ +/***************************************************************************** + * Copyright (c) 2014 Ted John + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * This file is part of OpenRCT2. + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *****************************************************************************/ + +#ifndef _WIDGET_H_ +#define _WIDGET_H_ + +typedef enum { + WWT_EMPTY = 0, + WWT_FRAME = 1, + WWT_RESIZE = 2, + WWT_IMGBTN = 3, + WWT_4 = 4, + WWT_TRNBTN = 7, + WWT_TAB = 8, + WWT_FLATBTN = 9, + WWT_DROPDOWN_BUTTON = 10, + WWT_12 = 12, + WWT_DROPDOWN = 16, + WWT_VIEWPORT = 17, + WWT_CAPTION = 20, + WWT_CLOSEBOX = 21, + WWT_SCROLL = 22, + WWT_25 = 25, + WWT_LAST = 26, +} WINDOW_WIDGET_TYPES; +#define WIDGETS_END WWT_LAST, 0, 0, 0, 0, 0, 0, 0 + +#endif \ No newline at end of file diff --git a/src/window.c b/src/window.c index 64ef45a60b..8ba3ba10b0 100644 --- a/src/window.c +++ b/src/window.c @@ -19,10 +19,12 @@ *****************************************************************************/ #include "addresses.h" +#include "rct2.h" #include "window.h" #define RCT2_FIRST_WINDOW (RCT2_ADDRESS(RCT2_ADDRESS_WINDOW_LIST, rct_window)) #define RCT2_LAST_WINDOW (RCT2_GLOBAL(RCT2_ADDRESS_NEW_WINDOW_PTR, rct_window*) - 1) +#define RCT2_NEW_WINDOW (RCT2_GLOBAL(RCT2_ADDRESS_NEW_WINDOW_PTR, rct_window*)) // rct2: 0x006ED7B0 void window_update_all() @@ -36,4 +38,172 @@ void window_update_all() } RCT2_CALLPROC_EBPSAFE(0x006EE411); +} + +/** + * Opens a new window. + * rct2: 0x006EACA4 + * + * @param x (ax) + * @param y (eax >> 16) + * @param width (bx) + * @param height (ebx >> 16) + * @param events (edx) + * @param flags (ch) + * @param class (cl) + */ +rct_window *window_create(int x, int y, int width, int height, uint32 *event_handlers, rct_windowclass cls, uint16 flags) +{ + rct_window *w, *v; + + // Check if there are any window slots left + if (RCT2_NEW_WINDOW == &(RCT2_FIRST_WINDOW[12])) { + // Close least recently used window + for (w = RCT2_FIRST_WINDOW; w < RCT2_NEW_WINDOW; w++) + if (!(w->flags & 0x203)) + break; + + window_close(w); + } + + w = RCT2_NEW_WINDOW; + + // Flags + if (flags & 0x01) { + for (; w >= RCT2_FIRST_WINDOW + 1; w--) + if (((w - 1)->flags & 0x01) && !((w - 1)->flags & 0x02)) + break; + } + else if (flags & 0x02) { + for (; w >= RCT2_FIRST_WINDOW + 1; w--) + if (!((w - 1)->flags & 0x02)) + break; + } + + // Move w to new window slot + if (w != RCT2_NEW_WINDOW) + *RCT2_NEW_WINDOW = *w; + + // Setup window + w->classification = cls; + w->var_4B8 = -1; + w->var_4B9 = -1; + w->flags = 0; + w->flags |= flags; + + // Play sound + if (!(flags & 0x03)) + RCT2_CALLPROC_X(0x006BB76E, 40, x + (width / 2), 0, 0, 0, 0, 0); + + w->number = 0; + w->x = x; + w->y = y; + w->width = width; + w->height = height; + w->viewport = NULL; + w->event_handlers = event_handlers; + w->enabled_widgets = 0; + w->disabled_widgets = 0; + w->pressed_widgets = 0; + w->var_020 = 0; + w->var_480 = 0; + w->var_482 = 0; + w->var_484 = 0; + w->var_486 = 0; + w->var_488 = 0; + w->var_48A = 0; + w->var_48C = 0; + w->var_48E = 0; + w->var_490 = 0; + w->var_492 = 0; + w->var_4AC = 0; + w->var_4AE = 0; + RCT2_NEW_WINDOW++; + + return w; +} + +/** + * Closes the specified window. + * rct2: 0x006ECD4C + * + * @param window The window to close (esi). + */ +void window_close(rct_window* window) +{ + int num_windows; + + if (window == NULL) + return; + + // Call close event of window + // window_call_basic_event(window, WE_CLOSE); + + window = window_find_by_id(window->classification, window->number); + + // Remove viewport + if (window->viewport != NULL) { + window->viewport->width = 0; + window->viewport = NULL; + } + + // Invalidate the window (area) + window_invalidate(window); + + // Remove window from list and reshift all windows + RCT2_NEW_WINDOW--; + num_windows = (RCT2_NEW_WINDOW - window); + if (num_windows > 0) + memmove(window, window + 1, num_windows * sizeof(rct_window)); + + // ? + RCT2_CALLPROC(0x006EE510); +} + +/** + * + * rct2: 0x006EA8A0 + * @param cls (cl) + * @param number (dx) + */ +rct_window *window_find_by_id(rct_windowclass cls, rct_windownumber number) +{ + rct_window *w; + + if (cls & 0x80) { + for (w = RCT2_FIRST_WINDOW; w < RCT2_NEW_WINDOW; w++) + if (w->classification == cls) + return w; + } else { + for (w = RCT2_FIRST_WINDOW; w < RCT2_NEW_WINDOW; w++) + if (w->classification == cls && w->number == number) + return w; + } + + return NULL; +} + +/** + * Invalidates the specified window. + * rct2: 0x006EB31A + * + * @param window The window to invalidate (esi). + */ +void window_invalidate(rct_window *window) +{ + RCT2_CALLPROC_X(0x006EB31A, 0, 0, 0, 0, window, 0, 0); + + // if (window != NULL) + // gfx_set_dirty_blocks(window->x, window->y, window->x + window->width, window->y + window->height); +} + +/** + * Invalidates the specified window. + * rct2: 0x006EAEB8 + * + * @param window The window (esi). + */ +void window_init_scroll_widgets(rct_window *w) +{ + RCT2_CALLPROC_X(0x006EAEB8, 0, 0, 0, 0, w, 0, 0); } \ No newline at end of file diff --git a/src/window.h b/src/window.h index 585d7f480f..db2d55871f 100644 --- a/src/window.h +++ b/src/window.h @@ -1,22 +1,22 @@ /***************************************************************************** -* Copyright (c) 2014 Ted John -* OpenRCT2, an open source clone of Roller Coaster Tycoon 2. -* -* This file is part of OpenRCT2. -* -* OpenRCT2 is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. - -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. - -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -*****************************************************************************/ + * Copyright (c) 2014 Ted John + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * This file is part of OpenRCT2. + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *****************************************************************************/ #ifndef _WINDOW_H_ #define _WINDOW_H_ @@ -29,9 +29,9 @@ union rct_window_event; typedef void wndproc(struct rct_window*, union rct_window_event*); /** -* Widget structure -* size: 0x10 -*/ + * Widget structure + * size: 0x10 + */ typedef struct { uint8 type; // 0x00 uint8 colour; // 0x01 @@ -57,9 +57,9 @@ typedef struct { } widget_identifier; /** -* Viewport structure -* size: 0x14 -*/ + * Viewport structure + * size: 0x14 + */ typedef struct { sint16 width; // 0x00 sint16 height; // 0x02 @@ -115,9 +115,9 @@ typedef struct { } rct_scroll; /** -* Window structure -* size: 0x4C0 -*/ + * Window structure + * size: 0x4C0 + */ typedef struct rct_window { uint32* event_handlers; // 0x000 rct_viewport* viewport; // 0x004 @@ -267,5 +267,10 @@ enum { } WINDOW_CLASS; void window_update_all(); +rct_window *window_create(int x, int y, int width, int height, uint32 *event_handlers, rct_windowclass cls, uint16 flags); +void window_close(rct_window *window); +rct_window *window_find_by_id(rct_windowclass cls, rct_windownumber number); +void window_invalidate(rct_window *window); +void window_init_scroll_widgets(rct_window *w); #endif \ No newline at end of file diff --git a/src/window_main.c b/src/window_main.c new file mode 100644 index 0000000000..d9e5d079f6 --- /dev/null +++ b/src/window_main.c @@ -0,0 +1,65 @@ +/***************************************************************************** + * Copyright (c) 2014 Ted John + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * This file is part of OpenRCT2. + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *****************************************************************************/ + +#include "addresses.h" +#include "widget.h" +#include "window.h" + +rct_widget window_main_widgets[] = { + { WWT_VIEWPORT, 0, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0xFFFFFFFF, 0xFFFF }, + { WIDGETS_END }, +}; + +/** + * Creates the main window and the toolbars or title screen buttons. + * rct2: 0x0066B3E8 + */ +void window_main_open() +{ + rct_window* window; + rct_widget* main_widgets = 0x009A9414; + + main_widgets[0].right = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, sint16); + main_widgets[0].bottom = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_HEIGHT, sint16); + window = window_create(0, 0, window_main_widgets[0].right, window_main_widgets[0].bottom, 0x0097C0BC, WC_MAIN_WINDOW, 0x01); + window->widgets = main_widgets; + + // RCT2_CALLPROC_X(0x006EB009, window->x, window->y, 0x4000000, 0x0FFF0FFF, window, 0, 0); + __asm { + mov esi, window + mov edx, 0FFF0FFFh + mov eax, [esi+2Ch] + mov ebx, [esi+30h] + mov ecx, 4000000h + push ebp + mov ebp, 6EB009h + call ebp + } + __asm { + pop ebp + or word ptr [edi+12h], 400h + } + + RCT2_GLOBAL(0x0141E9E0, sint32) = 0; + RCT2_GLOBAL(0x009E32B0, uint8) = 0; + RCT2_GLOBAL(0x009E32B2, uint8) = 0; + RCT2_GLOBAL(0x009E32B3, uint8) = 0; + RCT2_GLOBAL(0x00F3EFA2, uint8) = 0; +} \ No newline at end of file diff --git a/src/window_title_exit.c b/src/window_title_exit.c new file mode 100644 index 0000000000..f663179b4c --- /dev/null +++ b/src/window_title_exit.c @@ -0,0 +1,52 @@ +/***************************************************************************** + * Copyright (c) 2014 Ted John + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * This file is part of OpenRCT2. + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *****************************************************************************/ + +#include "addresses.h" +#include "sprites.h" +#include "strings.h" +#include "widget.h" +#include "window.h" + +static rct_widget window_title_exit_widgets[] = { + { WWT_IMGBTN, 2, 0, 39, 0, 63, SPR_MENU_EXIT, STR_EXIT }, + { WIDGETS_END }, +}; + +/** + * Creates the window containing the exit button on the title screen. + * rct2: 0x0066B624 (part of 0x0066B3E8) + */ +void window_title_exit_open() +{ + rct_window* window; + + window = window_create( + RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, sint16) - 40, + RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_HEIGHT, sint16) - 64, + 40, 64, 0x0097BEFC, WC_TITLE_EXIT, 0x02 + ); + window->widgets = 0x009A9644; + window->enabled_widgets |= 1; + window_init_scroll_widgets(window); + window->flags |= 16; + window->colours[0] = 140; + window->colours[1] = 140; + window->colours[2] = 140; +} \ No newline at end of file diff --git a/src/window_title_logo.c b/src/window_title_logo.c new file mode 100644 index 0000000000..0304854533 --- /dev/null +++ b/src/window_title_logo.c @@ -0,0 +1,54 @@ +/***************************************************************************** + * Copyright (c) 2014 Ted John + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * This file is part of OpenRCT2. + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *****************************************************************************/ + +#include "addresses.h" +#include "strings.h" +#include "widget.h" +#include "window.h" + +static rct_widget window_title_logo_widgets[] = { + { WWT_EMPTY, 0, 0, 0, 0, 0, 0xFFFFFFFF, STR_NONE }, + { WIDGETS_END }, +}; + +/** + * Creates the window containing the logo and the expansion packs on the title screen. + * rct2: 0x0066B679 (part of 0x0066B3E8) + */ +void window_title_logo_open() +{ + int i, packs; + rct_window *window; + + // Count number of expansion packs + packs = 0; + for (i = 0; i < 16; i++) + if (RCT2_GLOBAL(0x009AB4C0, uint16) & (1 << i)) + packs++; + + // Create the window + window = window_create(0, 0, 200, 106 + (10 * packs), 0x0097BF6C, WC_TITLE_LOGO, 0x02); + window->widgets = window_title_logo_widgets; + window_init_scroll_widgets(window); + window->flags |= 16; + window->colours[0] = 129; + window->colours[1] = 129; + window->colours[2] = 129; +} \ No newline at end of file diff --git a/src/window_title_menu.c b/src/window_title_menu.c new file mode 100644 index 0000000000..89a72fe670 --- /dev/null +++ b/src/window_title_menu.c @@ -0,0 +1,62 @@ +x/***************************************************************************** + * Copyright (c) 2014 Ted John + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * This file is part of OpenRCT2. + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *****************************************************************************/ + +#include "addresses.h" +#include "strings.h" +#include "sprites.h" +#include "widget.h" +#include "window.h" + +enum { + WIDX_START_NEW_GAME, + WIDX_CONTINUE_SAVED_GAME, + WIDX_SHOW_TUTORIAL, + WIDX_GAME_TOOLS, +}; + +static rct_widget window_title_menu_widgets[] = { + { WWT_IMGBTN, 2, 0, 81, 0, 81, SPR_MENU_NEW_GAME, STR_START_NEW_GAME_TIP }, + { WWT_IMGBTN, 2, 82, 163, 0, 81, SPR_MENU_LOAD_GAME, STR_CONTINUE_SAVED_GAME_TIP }, + { WWT_IMGBTN, 2, 164, 245, 0, 81, SPR_MENU_TUTORIAL, STR_SHOW_TUTORIAL_TIP }, + { WWT_IMGBTN, 2, 246, 327, 0, 81, SPR_MENU_TOOLBOX, STR_GAME_TOOLS }, + { WIDGETS_END }, +}; + +/** + * Creates the window containing the menu buttons on the title screen. + * rct2: 0x0066B5C0 (part of 0x0066B3E8) + */ +void window_title_menu_open() +{ + rct_window* window; + + window = window_create( + (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, sint16) - 328) / 2, + RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_HEIGHT, sint16) - 142, + 328, 82, 0x0097BE8C, WC_TITLE_MENU, 0x02 + ); + window->widgets = 0x009A9600; + window->enabled_widgets |= (8 | 4 | 2 | 1); + window_init_scroll_widgets(window); + window->flags |= 16; + window->colours[0] = 140; + window->colours[1] = 140; + window->colours[2] = 140; +} \ No newline at end of file