diff --git a/src/addresses.h b/src/addresses.h index 1b69c339d4..f426ed80e4 100644 --- a/src/addresses.h +++ b/src/addresses.h @@ -75,24 +75,10 @@ #define RCT2_ADDRESS_BTM_TOOLBAR_DIRTY_FLAGS 0x009A9804 #define RCT2_ADDRESS_MAP_TOOLTIP_ARGS 0x009A9808 -// #define RCT2_ADDRESS_SCENARIO_LIST 0x009A9FF4 -// #define RCT2_ADDRESS_NUM_SCENARIOS 0x009AA008 - #define RCT2_ADDRESS_APP_PATH 0x009AA214 -#define RCT2_ADDRESS_DSOUND_GUID 0x009AAC5D - -#define RCT2_ADDRESS_CONFIG_SOUND_SW_BUFFER 0x009AAC6E -// When all sounds reversed replace with gConfigSound.ride_music -#define RCT2_ADDRESS_CONFIG_MUSIC 0x009AAC72 - #define RCT2_ADDRESS_CONFIG_FLAGS 0x009AAC74 -// MAX vehicle sounds not used anymore -#define RCT2_ADDRESS_CONFIG_MAX_VEHICLE_SOUNDS 0x009AAC75 - -#define RCT2_ADDRESS_CONFIG_MAX_NO_SOUNDS 0x009AAC76 -#define RCT2_ADDRESS_CONFIG_SOUND_QUALITY 0x009AAC77 #define RCT2_ADDRESS_CONFIG_METRIC 0x009AAC78 #define RCT2_ADDRESS_CONFIG_TEMPERATURE 0x009AAC79 #define RCT2_ADDRESS_CONFIG_KEYBOARD_SHORTCUTS 0x009AAC7A @@ -269,15 +255,6 @@ #define RCT2_ADDRESS_TEXTINPUT_WINDOWNUMBER 0x009DEB8A #define RCT2_ADDRESS_TEXTINPUT_WINDOWCLASS 0x009DEB8C -#define RCT2_ADDRESS_DSOUND_BUFFERS 0x009E1AB0 -#define RCT2_ADDRESS_NUM_DSOUND_DEVICES 0x009E2B88 -#define RCT2_ADDRESS_DSOUND_DEVICES 0x009E2B8C -#define RCT2_ADDRESS_SOUND_EFFECTS_MAPPING 0x009E2B94 -#define RCT2_ADDRESS_SOUNDLIST_BEGIN 0x009E2B98 -#define RCT2_ADDRESS_SOUNDLIST_END 0x009E2B9C -#define RCT2_ADDRESS_DIRECTSOUND 0x009E2BA0 -#define RCT2_ADDRESS_DSOUND_DEVICES_COUNTER 0x009E2BAC - #define RCT2_ADDRESS_CMDLINE 0x009E2D98 #define RCT2_ADDRESS_MOUSE_WRITE_INDEX 0x009E2DE4 @@ -636,8 +613,6 @@ #define RCT2_ADDRESS_AUDIO_INFO 0x01425B40 -#define RCT2_ADDRESS_SOUND_CHANNEL_LIST 0x014262E0 - #define RCT2_ADDRESS_COMMON_FORMAT_ARGS 0x013CE952 #define RCT2_ADDRESS_STAFF_MODE_ARRAY 0x013CA672 diff --git a/src/config.c b/src/config.c index 33dfde27e2..a293bac650 100644 --- a/src/config.c +++ b/src/config.c @@ -821,9 +821,6 @@ void config_apply_to_old_addresses() RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_METRIC, sint8) = gConfigGeneral.measurement_format; RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_TEMPERATURE, sint8) = gConfigGeneral.temperature_format; RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CONSTRUCTION_MARKER, uint8) = gConfigGeneral.construction_marker_colour; - // Force best sound quality and software buffering, for original code. - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_QUALITY, sint8) = 2; - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_SW_BUFFER, sint8) = 1; RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS, sint16) = (gConfigGeneral.measurement_format + 1) * 256; if (gConfigGeneral.show_height_as_units) RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS, sint16) = 0; @@ -841,107 +838,6 @@ void config_apply_to_old_addresses() RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) = configFlags; } -// The following functions are related to the original configuration file. This has now been replaced with a new configuration -// INI file located in the user's OpenRCT2 home directory. - -/** - * Reads the config file data/config.cfg - * rct2: 0x006752D5 - */ -/*void config_dat_load() -{ - FILE *fp=NULL; - - const char *path = get_file_path(PATH_ID_GAMECFG); - - fp = fopen(path, "rb"); - - if (fp != NULL) { - // Read and check magic number - fread(RCT2_ADDRESS(0x013CE928, void), 1, 4, fp); - - if (RCT2_GLOBAL(0x013CE928, int) == MagicNumber) { - // Read options - fread((void*)0x009AAC5C, 1, 2155, fp); - fclose(fp); - - //general configuration - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_EDGE_SCROLLING, sint8) = gConfigGeneral.edge_scrolling; - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CURRENCY, sint8) = gConfigGeneral.currency_format; - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_METRIC, sint8) = gConfigGeneral.measurement_format; - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_TEMPERATURE, sint8) = gConfigGeneral.temperature_format; - - // always show gridlines - if (gConfigGeneral.always_show_gridlines){ - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) |= CONFIG_FLAG_ALWAYS_SHOW_GRIDLINES; - } - else { - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) &= !CONFIG_FLAG_ALWAYS_SHOW_GRIDLINES; - } - - // landscape smoothing - if (!gConfigGeneral.landscape_smoothing){ - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) |= CONFIG_FLAG_DISABLE_SMOOTH_LANDSCAPE; - } - else { - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) &= !CONFIG_FLAG_DISABLE_SMOOTH_LANDSCAPE; - } - - // show height as units - if (gConfigGeneral.show_height_as_units){ - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) |= CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS; - } - else { - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) &= !CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS; - } - - // save plugin data - if (gConfigGeneral.save_plugin_data){ - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) |= CONFIG_FLAG_SAVE_PLUGIN_DATA; - } - else { - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) &= !CONFIG_FLAG_SAVE_PLUGIN_DATA; - } - - //sound configuration: force software buffering and best quality - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_QUALITY, sint8) = 2; - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_SW_BUFFER, sint8) = 1; - - // Line below is temporarily disabled until all config is in the new format. - //if (RCT2_GLOBAL(0x009AB4C6, sint8) == 1) - // return; - - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FIRST_TIME_LOAD_CONFIG, sint8) = 1; // Marks config as first time loaded - - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS, sint16) = (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_METRIC, sint8) + 2) * 256; - if (!(RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) & CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS)) - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS, sint16) = (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_METRIC, sint8) + 1) * 256; - } - - } - - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_MAX_VEHICLE_SOUNDS, sint8) = RCT2_ADDRESS(0x009AF601, sint8)[RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_QUALITY, sint8)]; - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_MAX_NO_SOUNDS, sint8) = RCT2_ADDRESS(0x009AF604, sint8)[RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_QUALITY, sint8)]; - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS, sint16) = 0; - if (!(RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) & CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS)) - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS, sint16) = (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_METRIC, sint8) + 1) * 256; - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FIRST_TIME_LOAD_OBJECTS, sint8) = 1; -}*/ - -/** - * Save configuration to the data/config.cfg file - * rct2: 0x00675487 - */ -/*void config_dat_save() -{ - FILE *fp = fopen(get_file_path(PATH_ID_GAMECFG), "wb"); - if (fp != NULL){ - fwrite(&MagicNumber, 4, 1, fp); - fwrite((void*)0x009AAC5C, 2155, 1, fp); - fclose(fp); - } -}*/ - #pragma endregion #pragma region Shortcuts diff --git a/src/openrct2.c b/src/openrct2.c index 04e9dca7c5..a48b5ef83f 100644 --- a/src/openrct2.c +++ b/src/openrct2.c @@ -217,7 +217,6 @@ bool openrct2_initialise() if (!gOpenRCT2Headless) { audio_init(); audio_get_devices(); - //get_dsound_devices(); } language_open(gConfigGeneral.language); http_init(); diff --git a/src/platform/platform.h b/src/platform/platform.h index f69eae5507..7c71c3ea64 100644 --- a/src/platform/platform.h +++ b/src/platform/platform.h @@ -151,7 +151,6 @@ bool platform_check_steam_overlay_attached(); // Windows specific definitions #ifdef _WIN32 - // Defining WIN32_LEAN_AND_MEAN breaks dsound.h in audio.h (uncomment when dsound is finally removed) #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif diff --git a/src/ride/ride.c b/src/ride/ride.c index e9af8a942c..4e6188f5a1 100644 --- a/src/ride/ride.c +++ b/src/ride/ride.c @@ -3537,8 +3537,6 @@ void ride_music_update_final() offset = 0; } Mixer_Channel_SetOffset(ride_music->sound_channel, offset); - } else { - //RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_MUSIC, uint8) = 0; } return; } diff --git a/src/ride/vehicle.c b/src/ride/vehicle.c index ca188b2251..8f8e9ed6fa 100644 --- a/src/ride/vehicle.c +++ b/src/ride/vehicle.c @@ -146,10 +146,10 @@ int sub_6BC2F3(rct_vehicle* vehicle) } result += ((uint16)v4) >> 13; rct_vehicle_sound* vehicle_sound = &gVehicleSoundList[0]; - //rct_vehicle_sound* vehicle_sound = RCT2_ADDRESS(RCT2_ADDRESS_VEHICLE_SOUND_LIST, rct_vehicle_sound); + while (vehicle_sound->id != vehicle->sprite_index) { vehicle_sound++; - //if (vehicle_sound >= RCT2_GLOBAL(0x009AF42C, rct_vehicle_sound*)) { + if (vehicle_sound >= &gVehicleSoundList[countof(gVehicleSoundList)]) { return result; }