mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-22 10:21:57 -05:00
add climate and date
This commit is contained in:
parent
535e62f3aa
commit
c8d2b0bf1e
11 changed files with 218 additions and 15 deletions
|
@ -17,7 +17,9 @@
|
|||
<ItemGroup>
|
||||
<ClInclude Include="..\src\addresses.h" />
|
||||
<ClInclude Include="..\src\audio.h" />
|
||||
<ClInclude Include="..\src\climate.h" />
|
||||
<ClInclude Include="..\src\config.h" />
|
||||
<ClInclude Include="..\src\date.h" />
|
||||
<ClInclude Include="..\src\game.h" />
|
||||
<ClInclude Include="..\src\gfx.h" />
|
||||
<ClInclude Include="..\src\intro.h" />
|
||||
|
@ -40,7 +42,9 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\audio.c" />
|
||||
<ClCompile Include="..\src\climate.c" />
|
||||
<ClCompile Include="..\src\config.c" />
|
||||
<ClCompile Include="..\src\date.c" />
|
||||
<ClCompile Include="..\src\game.c" />
|
||||
<ClCompile Include="..\src\gfx.c" />
|
||||
<ClCompile Include="..\src\intro.c" />
|
||||
|
|
|
@ -84,6 +84,12 @@
|
|||
<ClInclude Include="..\src\map.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\date.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\climate.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\game.c">
|
||||
|
@ -155,6 +161,12 @@
|
|||
<ClCompile Include="..\src\map.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\date.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\climate.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\openrct2.exe">
|
||||
|
|
|
@ -83,6 +83,9 @@
|
|||
|
||||
#define RCT2_ADDRESS_G1_ELEMENTS 0x009EBD28
|
||||
|
||||
#define RCT2_ADDRESS_CURRENT_MONTH_YEAR 0x00F663A8
|
||||
#define RCT2_ADDRESS_CURRENT_DAY 0x00F663AA
|
||||
|
||||
#define RCT2_ADDRESS_MAP_ELEMENTS 0x00F663B8
|
||||
|
||||
#define RCT2_ADDRESS_SPRITE_LIST 0x010E63BC
|
||||
|
@ -99,9 +102,15 @@
|
|||
|
||||
#define RCT2_ADDRESS_MAP_SIZE 0x01358834
|
||||
|
||||
#define RCT2_ADDRESS_CURRENT_TICKS 0x013628F4
|
||||
#define RCT2_ADDRESS_RIDE_LIST 0x013628F8
|
||||
#define RCT2_ADDRESS_RIDE_MEASUREMENTS 0x0138B60C
|
||||
|
||||
#define RCT2_ADDRESS_CLIMATE 0x013CA746
|
||||
#define RCT2_ADDRESS_CURRENT_WEATHER 0x013CA74A
|
||||
#define RCT2_ADDRESS_NEXT_WEATHER 0x013CA74B
|
||||
#define RCT2_ADDRESS_CURRENT_TEMPERATURE 0x013CA74C
|
||||
|
||||
#define RCT2_ADDRESS_NEWS_ITEM_LIST 0x013CA754
|
||||
|
||||
#define RCT2_ADDRESS_SCENARIO_NAME 0x0141F5B8
|
||||
|
|
45
src/climate.c
Normal file
45
src/climate.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "addresses.h"
|
||||
#include "date.h"
|
||||
#include "rct2.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006C45ED
|
||||
*/
|
||||
void climate_reset(int climate)
|
||||
{
|
||||
int eax, ebx, ecx, edx, esi, edi, ebp;
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CLIMATE, sint8) = climate;
|
||||
|
||||
eax = 1;
|
||||
RCT2_CALLFUNC_X(0x006C4672, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_WEATHER, sint8) = eax & 0xFF;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TEMPERATURE, sint8) = ebx & 0xFF;
|
||||
|
||||
RCT2_GLOBAL(0x013CA74E, sint8) = (ebx >> 8) & 0xFF;
|
||||
RCT2_GLOBAL(0x013CA750, sint8) = ecx & 0xFF;
|
||||
RCT2_GLOBAL(0x013CA752, sint8) = (ecx >> 8) & 0xFF;
|
||||
RCT2_CALLPROC_X(0x6C461C, 0, 0, 0, 0, 0, 0, 0);
|
||||
}
|
33
src/climate.h
Normal file
33
src/climate.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*****************************************************************************
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _CLIMATE_H_
|
||||
#define _CLIMATE_H_
|
||||
|
||||
enum {
|
||||
CLIMATE_COOL_AND_WET,
|
||||
CLIMATE_WARM,
|
||||
CLIMATE_HOT_AND_DRY,
|
||||
CLIMATE_COLD
|
||||
};
|
||||
|
||||
void climate_reset(int climate);
|
||||
|
||||
#endif
|
44
src/date.c
Normal file
44
src/date.c
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*****************************************************************************
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "addresses.h"
|
||||
#include "date.h"
|
||||
#include "rct2.h"
|
||||
|
||||
int date_get_month(int months)
|
||||
{
|
||||
return months % MONTH_COUNT;
|
||||
}
|
||||
|
||||
int date_get_year(int months)
|
||||
{
|
||||
return months / MONTH_COUNT;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006C4494
|
||||
*/
|
||||
void date_reset()
|
||||
{
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, sint16) = MONTH_MARCH;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_DAY, sint16) = 0;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TICKS, sint32) = 0;
|
||||
}
|
39
src/date.h
Normal file
39
src/date.h
Normal file
|
@ -0,0 +1,39 @@
|
|||
/*****************************************************************************
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _DATE_H_
|
||||
#define _DATE_H_
|
||||
|
||||
enum {
|
||||
MONTH_MARCH,
|
||||
MONTH_APRIL,
|
||||
MONTH_MAY,
|
||||
MONTH_JUNE,
|
||||
MONTH_JULY,
|
||||
MONTH_AUGUST,
|
||||
MONTH_SEPTEMBER,
|
||||
MONTH_OCTOBER,
|
||||
|
||||
MONTH_COUNT
|
||||
};
|
||||
|
||||
void date_reset();
|
||||
|
||||
#endif
|
20
src/game.c
20
src/game.c
|
@ -109,29 +109,23 @@ void game_logic_update()
|
|||
RCT2_GLOBAL(0x009DEA66, sint16)--;
|
||||
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068B089);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006C44B1);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006C46B1);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006C44B1); // update_objective
|
||||
RCT2_CALLPROC_EBPSAFE(0x006C46B1); // update_climate
|
||||
RCT2_CALLPROC_EBPSAFE(0x006646E1);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006A876D);
|
||||
|
||||
peep_update_all();
|
||||
|
||||
// update ride
|
||||
RCT2_CALLPROC_EBPSAFE(0x006D4204);
|
||||
|
||||
// update text effects
|
||||
RCT2_CALLPROC_EBPSAFE(0x00672AA4);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006ABE4C);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006674F7);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006D4204); // update vehicles
|
||||
RCT2_CALLPROC_EBPSAFE(0x00672AA4); // update text effects
|
||||
RCT2_CALLPROC_EBPSAFE(0x006ABE4C); // update rides
|
||||
RCT2_CALLPROC_EBPSAFE(0x006674F7); // update park
|
||||
RCT2_CALLPROC_EBPSAFE(0x00684C7A);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006B5A2A);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006B6456);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006B6456); // update ride measurements
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068AFAD);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BBC6B);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BD18A);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BCB91);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BD0F8);
|
||||
|
||||
news_item_update_current();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0067009A);
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#include "addresses.h"
|
||||
#include "climate.h"
|
||||
#include "date.h"
|
||||
#include "map.h"
|
||||
|
||||
#define GET_MAP_ELEMENT(x) (&(RCT2_ADDRESS(RCT2_ADDRESS_MAP_ELEMENTS, rct_map_element)[x]))
|
||||
|
@ -32,7 +34,7 @@ void map_init()
|
|||
int i;
|
||||
rct_map_element *map_element;
|
||||
|
||||
RCT2_CALLPROC_EBPSAFE(0x006C4494); // date_init();
|
||||
date_reset();
|
||||
RCT2_GLOBAL(0x0138B580, sint16) = 0;
|
||||
RCT2_GLOBAL(0x010E63B8, sint32) = 0;
|
||||
|
||||
|
@ -58,5 +60,6 @@ void map_init()
|
|||
RCT2_GLOBAL(0x01359208, sint16) = 7;
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068AFFD);
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068ADBC);
|
||||
RCT2_CALLPROC_X(0x006C45ED, 1, 0, 0, 0, 0, 0, 0); // init_climate_and_date
|
||||
|
||||
climate_reset(CLIMATE_WARM);
|
||||
}
|
|
@ -42,6 +42,21 @@ typedef struct {
|
|||
sint8 var_0270[64];
|
||||
} rct_scenario_basic;
|
||||
|
||||
enum {
|
||||
OBJECTIVE_NONE,
|
||||
OBJECTIVE_GUESTS_BY,
|
||||
OBJECTIVE_PARK_VALUE_BY,
|
||||
OBJECTIVE_HAVE_FUN,
|
||||
OBJECTIVE_BUILD_THE_BEST,
|
||||
OBJECTIVE_10_ROLLERCOASTERS,
|
||||
OBJECTIVE_GUESTS_AND_RATING,
|
||||
OBJECTIVE_MONTHLY_RIDE_INCOME,
|
||||
OBJECTIVE_10_ROLLERCOASTERS_LENGTH,
|
||||
OBJECTIVE_FINISH_5_ROLLERCOASTERS,
|
||||
OBJECTIVE_REPLAY_LOAN_AND_PARK_VALUE,
|
||||
OBJECTIVE_MONTHLY_FOOD_INCOME
|
||||
};
|
||||
|
||||
void scenario_load_list();
|
||||
|
||||
#endif
|
|
@ -24,6 +24,11 @@
|
|||
enum {
|
||||
SPR_NONE = -1,
|
||||
|
||||
SPR_COOL_AND_WET = 3290,
|
||||
SPR_WARM = 3291,
|
||||
SPR_HOT_AND_DRY = 3292,
|
||||
SPR_COLD = 3293,
|
||||
|
||||
SPR_RESIZE = 5058,
|
||||
|
||||
SPR_HEARING_VIEWPORT = 5166,
|
||||
|
|
Loading…
Reference in a new issue