mirror of https://github.com/OpenRCT2/OpenRCT2.git
Implemented a few functions in editor.c
This commit is contained in:
parent
726c1a2312
commit
1f00ad9110
|
@ -141,6 +141,7 @@
|
|||
#define RCT2_ADDRESS_SPRITES_START_LITTER 0x013573C4
|
||||
|
||||
#define RCT2_ADDRESS_CURRENT_LOAN 0x013573E0
|
||||
#define RCT2_ADDRESS_MAXIMUM_LOAN 0x013580F0
|
||||
#define RCT2_ADDRESS_PARK_FLAGS 0x013573E4
|
||||
#define RCT2_ADDRESS_PARK_ENTRANCE_FEE 0x013573E8
|
||||
#define RCT2_ADDRESS_GUESTS_IN_PARK 0x01357844
|
||||
|
@ -160,6 +161,7 @@
|
|||
#define RCT2_ADDRESS_CURRENT_COMPANY_VALUE 0x0135874C
|
||||
#define RCT2_ADDRESS_AWARD_LIST 0x01358760
|
||||
#define RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED 0x013587F8
|
||||
#define RCT2_ADDRESS_CURRENT_INTEREST_RATE 0x0135934A
|
||||
|
||||
#define RCT2_ADDRESS_MAP_SIZE 0x01358834
|
||||
|
||||
|
|
105
src/editor.c
105
src/editor.c
|
@ -40,19 +40,19 @@ void editor_load()
|
|||
{
|
||||
rct_window *mainWindow;
|
||||
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BABB4); // pause_sounds
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BABD8); // unpause_sounds
|
||||
pause_sounds();
|
||||
unpause_sounds();
|
||||
RCT2_CALLPROC_EBPSAFE(0x006A9CE8);
|
||||
map_init();
|
||||
RCT2_CALLPROC_EBPSAFE(0x006B9CB0);
|
||||
RCT2_CALLPROC_EBPSAFE(0x00667104); // reset_park_entrances
|
||||
RCT2_CALLPROC_EBPSAFE(0x006C4209); // reset_saved_strings
|
||||
reset_park_entrances();
|
||||
reset_saved_strings();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069EB13); // sprites_init
|
||||
ride_init_all();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068F083); // window_guest_list_init_vars_a
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BD3A4);
|
||||
park_init();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069DEFB); // finance_init
|
||||
finance_init();
|
||||
date_reset();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068F050); // window_guest_list_init_vars_b
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BD39C);
|
||||
|
@ -94,14 +94,14 @@ void trackdesigner_load()
|
|||
map_init();
|
||||
set_all_land_owned();
|
||||
RCT2_CALLPROC_EBPSAFE(0x006B9CB0);
|
||||
RCT2_CALLPROC_EBPSAFE(0x00667104); // reset_park_entrances
|
||||
RCT2_CALLPROC_EBPSAFE(0x006C4209); // reset_saved_strings
|
||||
reset_park_entrances();
|
||||
reset_saved_strings();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069EB13); // reset_sprites
|
||||
ride_init_all();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068F083); // window_guest_list_init_vars_a
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BD3A4);
|
||||
park_init();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069DEFB); // finance_init
|
||||
finance_init();
|
||||
date_reset();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068F050); // window_guest_list_init_vars_b
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BD39C);
|
||||
|
@ -132,14 +132,14 @@ void trackmanager_load()
|
|||
map_init();
|
||||
set_all_land_owned();
|
||||
RCT2_CALLPROC_EBPSAFE(0x006B9CB0);
|
||||
RCT2_CALLPROC_EBPSAFE(0x00667104); // reset_park_entrances
|
||||
RCT2_CALLPROC_EBPSAFE(0x006C4209); // reset_saved_strings
|
||||
reset_park_entrances();
|
||||
reset_saved_strings();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069EB13); // reset_sprites
|
||||
ride_init_all();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068F083); // window_guest_list_init_vars_a
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BD3A4);
|
||||
park_init();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069DEFB); // finance_init
|
||||
finance_init();
|
||||
date_reset();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068F050); // window_guest_list_init_vars_b
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BD39C);
|
||||
|
@ -168,3 +168,86 @@ static void set_all_land_owned()
|
|||
|
||||
game_do_command(64, 1, 64, 2, 56, (mapSize - 2) * 32, (mapSize - 2) * 32);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x00667104
|
||||
*/
|
||||
void reset_park_entrances() {
|
||||
RCT2_GLOBAL(0x013573D4, uint16) = 0;
|
||||
|
||||
for (short i = 0; i < 4; i++) {
|
||||
RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_X, uint16)[i] = 0x8000;
|
||||
}
|
||||
|
||||
RCT2_GLOBAL(0x013573F2, uint16) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x013573F8, uint16) = 0xFFFF;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006C4209
|
||||
*/
|
||||
void reset_saved_strings() {
|
||||
for (int i = 0; i < 1024; i++) {
|
||||
RCT2_ADDRESS(0x135A8F4, uint8)[i * 32] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006BABB4
|
||||
*/
|
||||
void pause_sounds() {
|
||||
if (++RCT2_GLOBAL(0x009AF59C, uint8) == 1) {
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BCAE5);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BABDF);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BCA9F);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BD07F);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006BABD8
|
||||
*/
|
||||
void unpause_sounds() {
|
||||
RCT2_GLOBAL(0x009AF59C, uint8)--;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0069DEFB
|
||||
*/
|
||||
void finance_init() {
|
||||
|
||||
for (short i = 0; i < 56; i++) {
|
||||
RCT2_ADDRESS(0x01357848, uint32)[i] = 0;
|
||||
}
|
||||
|
||||
RCT2_GLOBAL(0x0135832C, uint32) = 0;
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, uint32) = 0;
|
||||
|
||||
RCT2_GLOBAL(0x01358334, uint32) = 0;
|
||||
RCT2_GLOBAL(0x01358338, uint16) = 0;
|
||||
|
||||
RCT2_GLOBAL(0x013573DC, uint32) = 100000;
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED, sint32) = ENCRYPT_MONEY(100000);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, sint32) = 100000;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MAXIMUM_LOAN, uint32) = 200000;
|
||||
|
||||
RCT2_GLOBAL(0x013587D0, uint32) = 0;
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_INTEREST_RATE, uint8) = 10;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PARK_VALUE, sint32) = 0;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_COMPANY_VALUE, sint32) = 0;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMPLETED_COMPANY_VALUE, sint32) = 0x80000000;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_TOTAL_ADMISSIONS, uint32) = 0;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_INCOME_FROM_ADMISSIONS, uint32) = 0;
|
||||
|
||||
RCT2_GLOBAL(0x013587D8, uint16) = 0x3F;
|
||||
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069E869);
|
||||
}
|
|
@ -25,5 +25,10 @@ void editor_load();
|
|||
void editor_convert_save_to_scenario();
|
||||
void trackdesigner_load();
|
||||
void trackmanager_load();
|
||||
void reset_park_entrances();
|
||||
void reset_saved_strings();
|
||||
void pause_sounds();
|
||||
void unpause_sounds();
|
||||
void finance_init();
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue