1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-04 13:42:55 +01:00

Document various memory addresses

This commit is contained in:
medsouz
2015-08-16 13:05:49 -04:00
parent 905efcd412
commit ca1a1e0ddd
7 changed files with 41 additions and 31 deletions

View File

@@ -75,6 +75,10 @@
// When all sounds reversed replace with gConfigSound.ride_music
#define RCT2_ADDRESS_CONFIG_MUSIC 0x009AAC72
// Is supposed to be set to 0 whenever the screen resolution is changed
// it will then count up 255 ticks before saving the config
// In OpenRCT2 this value is only set to 0 on startup
#define RCT2_ADDRESS_CONFIG_SAVE_TIMER 0x009AAC73
#define RCT2_ADDRESS_CONFIG_FLAGS 0x009AAC74
// MAX vehicle sounds not used anymore
@@ -228,6 +232,8 @@
#define RCT2_ADDRESS_MAP_ARROW_Z 0x009DEA4C
#define RCT2_ADDRESS_MAP_ARROW_DIRECTION 0x009DEA4E
//Counts how many ticks the current screen has been open for
#define RCT2_ADDRESS_SCREEN_AGE 0x009DEA66
#define RCT2_ADDRESS_SCREEN_FLAGS 0x009DEA68
#define RCT2_ADDRESS_SCREENSHOT_COUNTDOWN 0x009DEA6D
// Note: not only the zeroth bit can be set to control pause
@@ -456,6 +462,9 @@
#define RCT2_ADDRESS_RIDE_LIST 0x013628F8
#define RCT2_ADDRESS_RIDE_COUNT 0x013587C8
#define RCT2_ADDRESS_RIDE_FLAGS 0x0097CF40
//How many ticks the scenario has existed for
#define RCT2_ADDRESS_SAVED_AGE 0x01388698
#define RCT2_ADDRESS_SAVED_VIEW_X 0x0138869A
#define RCT2_ADDRESS_SAVED_VIEW_Y 0x0138869C
#define RCT2_ADDRESS_SAVED_VIEW_ZOOM_AND_ROTATION 0x0138869E

View File

@@ -88,7 +88,7 @@ void editor_load()
mainWindow->flags &= ~WF_SCROLLING_TO_LOCATION;
load_palette();
gfx_invalidate_screen();
RCT2_GLOBAL(0x009DEA66, sint16) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, sint16) = 0;
strcpy((char*)RCT2_ADDRESS_SCENARIO_NAME, language_get_string(2749));
}
@@ -166,7 +166,7 @@ void editor_convert_save_to_scenario()
news_item_init_queue();
window_editor_main_open();
editor_finalise_main_view();
RCT2_GLOBAL(0x009DEA66, uint16) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, uint16) = 0;
}
/**
@@ -203,7 +203,7 @@ void trackdesigner_load()
mainWindow->flags &= ~WF_SCROLLING_TO_LOCATION;
load_palette();
gfx_invalidate_screen();
RCT2_GLOBAL(0x009DEA66, sint16) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, sint16) = 0;
}
/**
@@ -240,7 +240,7 @@ void trackmanager_load()
mainWindow->flags &= ~WF_SCROLLING_TO_LOCATION;
load_palette();
gfx_invalidate_screen();
RCT2_GLOBAL(0x009DEA66, sint16) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, sint16) = 0;
}
/**
@@ -295,7 +295,7 @@ static int editor_load_landscape_from_sv4(const char *path)
rct1_fix_landscape();
editor_finalise_main_view();
RCT2_GLOBAL(0x009DEA66, uint16) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, uint16) = 0;
return 1;
}
@@ -313,7 +313,7 @@ static int editor_load_landscape_from_sc4(const char *path)
rct1_fix_landscape();
editor_finalise_main_view();
RCT2_GLOBAL(0x009DEA66, uint16) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, uint16) = 0;
return 1;
}

View File

@@ -330,9 +330,9 @@ void game_update()
RCT2_GLOBAL(0x0141F568, uint8) = RCT2_GLOBAL(0x0013CA740, uint8);
game_handle_input();
if (RCT2_GLOBAL(0x009AAC73, uint8) != 255) {
RCT2_GLOBAL(0x009AAC73, uint8)++;
if (RCT2_GLOBAL(0x009AAC73, uint8) == 255)
if (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SAVE_TIMER, uint8) != 255) {
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SAVE_TIMER, uint8)++;
if (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SAVE_TIMER, uint8) == 255)
config_save_default();
}
}
@@ -341,9 +341,9 @@ void game_logic_update()
{
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TICKS, uint32)++;
RCT2_GLOBAL(RCT2_ADDRESS_SCENARIO_TICKS, uint32)++;
RCT2_GLOBAL(0x009DEA66, sint16)++;
if (RCT2_GLOBAL(0x009DEA66, sint16) == 0)
RCT2_GLOBAL(0x009DEA66, sint16)--;
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, sint16)++;
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, sint16) == 0)
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, sint16)--;
sub_68B089();
scenario_update();
@@ -364,7 +364,7 @@ void game_logic_update()
climate_update_sound();
editor_open_windows_for_current_step();
RCT2_GLOBAL(0x01388698, uint16)++;
RCT2_GLOBAL(RCT2_ADDRESS_SAVED_AGE, uint16)++;
// Update windows
//window_dispatch_update_all();
@@ -392,11 +392,12 @@ static int game_check_affordability(int cost)
{
if (cost <= 0)return cost;
if (RCT2_GLOBAL(0x141F568, uint8) & 0xF0)return cost;
if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32)&(1 << 8))){
if (cost <= (sint32)(DECRYPT_MONEY(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED, sint32))))return cost;
}
RCT2_GLOBAL(0x13CE952, uint32) = cost;
RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS, uint32) = cost;
RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, uint16) = 827;
return MONEY32_UNDEFINED;
}
@@ -648,7 +649,7 @@ static void load_landscape()
gfx_invalidate_screen();
rct2_endupdate();
} else {
RCT2_GLOBAL(0x009DEA66, uint16) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, uint16) = 0;
rct2_endupdate();
}
}
@@ -959,7 +960,7 @@ static void load_game()
gfx_invalidate_screen();
rct2_endupdate();
} else {
RCT2_GLOBAL(0x009DEA66, uint16) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, uint16) = 0;
rct2_endupdate();
}
}

View File

@@ -339,7 +339,7 @@ void scenario_begin()
load_palette();
gfx_invalidate_screen();
RCT2_GLOBAL(0x009DEA66, uint16) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, uint16) = 0;
RCT2_GLOBAL(0x009DEA5C, uint16) = 62000; // (doesn't appear to ever be read)
gGameSpeed = 1;
}
@@ -975,7 +975,7 @@ int scenario_save(SDL_RWops* rw, int flags)
reset_loaded_objects();
gfx_invalidate_screen();
RCT2_GLOBAL(0x009DEA66, uint16) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, uint16) = 0;
return 1;
}

View File

@@ -130,7 +130,7 @@ void title_load()
title_create_windows();
title_init_showcase();
gfx_invalidate_screen();
RCT2_GLOBAL(0x009DEA66, uint16) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, uint16) = 0;
if (gOpenRCT2ShowChangelog) {
gOpenRCT2ShowChangelog = false;
@@ -188,9 +188,9 @@ static int title_load_park(const char *path)
w->saved_view_y = RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_Y, sint16);
{
char _cl = (RCT2_GLOBAL(0x0138869E, sint16) & 0xFF) - w->viewport->zoom;
w->viewport->zoom = RCT2_GLOBAL(0x0138869E, sint16) & 0xFF;
*((char*)(&RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, sint32))) = RCT2_GLOBAL(0x0138869E, sint16) >> 8;
char _cl = (RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_ZOOM_AND_ROTATION, sint16) & 0xFF) - w->viewport->zoom;
w->viewport->zoom = RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_ZOOM_AND_ROTATION, sint16) & 0xFF;
*((char*)(&RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, sint32))) = RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_ZOOM_AND_ROTATION, sint16) >> 8;
if (_cl != 0) {
if (_cl < 0) {
_cl = -_cl;
@@ -213,7 +213,7 @@ static int title_load_park(const char *path)
scenery_set_default_placement_configuration();
news_item_init_queue();
gfx_invalidate_screen();
RCT2_GLOBAL(0x009DEA66, sint16) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, sint16) = 0;
RCT2_GLOBAL(0x009DEA5C, sint16) = 0x0D6D8;
gGameSpeed = 1;
return 1;
@@ -486,14 +486,14 @@ void title_update()
window_map_tooltip_update_visibility();
window_dispatch_update_all();
RCT2_GLOBAL(0x01388698, uint16)++;
RCT2_GLOBAL(RCT2_ADDRESS_SAVED_AGE, uint16)++;
// Input
game_handle_input();
if (RCT2_GLOBAL(0x009AAC73, uint8) != 255) {
RCT2_GLOBAL(0x009AAC73, uint8)++;
if (RCT2_GLOBAL(0x009AAC73, uint8) == 255)
if (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SAVE_TIMER, uint8) != 255) {
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SAVE_TIMER, uint8)++;
if (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SAVE_TIMER, uint8) == 255)
config_save_default();
}
}

View File

@@ -1286,7 +1286,7 @@ static void window_map_place_park_entrance_tool_down(int x, int y)
0x8001,
RCT2_GLOBAL(0x009DEA62, uint16),
RCT2_GLOBAL(0x009DEA64, uint16),
RCT2_GLOBAL(0x009DEA66, uint16)
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, uint16)
);
}

View File

@@ -146,7 +146,7 @@ void window_save_prompt_open()
}
}
if (RCT2_GLOBAL(0x009DEA66, uint16) < 3840) {
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, uint16) < 3840) {
game_load_or_quit_no_save_prompt();
return;
}
@@ -263,7 +263,7 @@ static void window_save_prompt_mouseup(rct_window *w, int widgetIndex)
}
}
if (RCT2_GLOBAL(0x009DEA66, uint16) < 3840) {
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, uint16) < 3840) {
game_load_or_quit_no_save_prompt();
return;
}