From 55000ca940266a0fae53a32ae0de2ff51ac3b574 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Sun, 25 Apr 2021 11:29:13 +0800 Subject: [PATCH] Added DisableSpecialAreas option Added a new "fonts" folder for language specific fonts. --- artifacts/ddraw.ini | 7 ++++++- sfall/FalloutFuncOffs_def.h | 36 ++++++++++++++++++++++++++++++++++++ sfall/LoadOrder.cpp | 2 +- sfall/MiscPatches.cpp | 9 ++++++++- sfall/Translate.cpp | 6 +++--- 5 files changed, 54 insertions(+), 6 deletions(-) diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index f6fe51c6..22fd9c66 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -730,9 +730,14 @@ SkipLoadingGameSettings=0 SpecialDeathGVAR=491 ;Set to 1 to disable the special handling of map IDs 19 and 37 in the engine when entering the maps -;Note that enabling this option can break the map changes in Modoc and Vault 15 +;Note that enabling this option will break the map changes in Modoc and Vault 15 in Fallout 2 DisableSpecialMapIDs=0 +;Set to 1 to disable the special handling of city areas 45 and 46 in the engine when visiting Area 45: +;Area 45 automatically disappears from the world map, and Area 46 appears on the world map +;Note that enabling this option will break the location change of the 'Fake Vault 13' in Fallout 2 +DisableSpecialAreas=0 + ;Changes the base value of the duration of the knockout effect (valid range: 35..100; default is 35) ;The formula for the duration in ticks is: 10 * (value - 3 * EN) KnockoutTime=35 diff --git a/sfall/FalloutFuncOffs_def.h b/sfall/FalloutFuncOffs_def.h index 794275d5..6c19cb5e 100644 --- a/sfall/FalloutFuncOffs_def.h +++ b/sfall/FalloutFuncOffs_def.h @@ -131,27 +131,54 @@ FUNC(critter_wake_up_, 0x42E424) FUNC(datafileConvertData_, 0x42EE84) FUNC(db_access_, 0x4390B4) FUNC(db_dir_entry_, 0x4C5D68) +FUNC(db_exit_, 0x4C5D60) FUNC(db_fclose_, 0x4C5EB4) +FUNC(db_feof_, 0x4C60D8) FUNC(db_fgetc_, 0x4C5F24) FUNC(db_fgets_, 0x4C5F70) +FUNC(db_filelength_, 0x4C68BC) FUNC(db_fopen_, 0x4C5EC8) +FUNC(db_fprintf_, 0x4C5ED0) +FUNC(db_fputc_, 0x4C5FE4) +FUNC(db_fputs_, 0x4C5FEC) FUNC(db_freadByteCount_, 0x4C62FC) FUNC(db_freadByte_, 0x4C60E0) FUNC(db_freadIntCount_, 0x4C63BC) FUNC(db_freadInt_, 0x4C614C) +FUNC(db_freadLongCount_, 0x4C6438) FUNC(db_freadShortCount_, 0x4C6330) FUNC(db_freadShort_, 0x4C60F4) FUNC(db_fread_, 0x4C5FFC) FUNC(db_free_file_list_, 0x4C6868) FUNC(db_fseek_, 0x4C60C0) +FUNC(db_ftell_, 0x4C60C8) FUNC(db_fwriteByteCount_, 0x4C6464) FUNC(db_fwriteByte_, 0x4C61AC) +FUNC(db_fwriteFloatCount_, 0x4C65F0) +FUNC(db_fwriteFloat_, 0x4C62C4) +FUNC(db_fwriteIntCount_, 0x4C64F8) FUNC(db_fwriteInt_, 0x4C6214) +FUNC(db_fwriteLongCount_, 0x4C6550) +FUNC(db_fwriteLong_, 0x4C6244) +FUNC(db_fwriteShortCount_, 0x4C6490) +FUNC(db_fwriteShort_, 0x4C61C8) +FUNC(db_fwrite_, 0x4C60B8) FUNC(db_get_file_list_, 0x4C6628) FUNC(db_init_, 0x4C5D30) +FUNC(db_list_compare_, 0x4C68E8) FUNC(db_read_to_buf_, 0x4C5DD4) +FUNC(db_register_callback_, 0x4C68C4) +FUNC(db_rewind_, 0x4C60D0) +FUNC(db_total_, 0x4C5D58) +FUNC(db_ungetc_, 0x4C5FF4) +FUNC(db_vfprintf_, 0x4C5F18) FUNC(dbase_close_, 0x4E5270) +FUNC(dbase_find_, 0x4E5D78) +FUNC(dbase_findclose_, 0x4E541C) +FUNC(dbase_findfirst_, 0x4E5308) +FUNC(dbase_findnext_, 0x4E53A0) FUNC(dbase_open_, 0x4E4F58) +FUNC(dbg_error_, 0x453FD0) FUNC(debug_log_, 0x4C7028) FUNC(debug_printf_, 0x4C6F48) FUNC(debug_register_env_, 0x4C6D90) @@ -598,17 +625,26 @@ FUNC(wmWorldMapFunc_, 0x4BFE10) FUNC(wmWorldMapLoadTempData_, 0x4BD6B4) FUNC(xfclose_, 0x4DED6C) FUNC(xfeof_, 0x4DF780) +FUNC(xferror_, 0x4DF7D4) +FUNC(xfflush_, 0x4DEDD4) FUNC(xfgetc_, 0x4DF22C) +FUNC(xfgetpos_, 0x4DF584) FUNC(xfgets_, 0x4DF280) FUNC(xfilelength_, 0x4DF828) FUNC(xfopen_, 0x4DEE2C) +FUNC(xfprintf_, 0x4DF11C) FUNC(xfputc_, 0x4DF320) FUNC(xfputs_, 0x4DF380) FUNC(xfread_, 0x4DF44C) +FUNC(xfree_filelist_, 0x4DFF48) +FUNC(xfreopen_, 0x4DEFE0) +FUNC(xfscanf_, 0x4DF164) FUNC(xfseek_, 0x4DF5D8) +FUNC(xfsetpos_, 0x4DF63C) FUNC(xftell_, 0x4DF690) FUNC(xfwrite_, 0x4DF4E8) FUNC(xremovepath_, 0x4DFAB4) FUNC(xrewind_, 0x4DF6E4) +FUNC(xsetpath_, 0x4DF878) FUNC(xungetc_, 0x4DF3F4) FUNC(xvfprintf_, 0x4DF1AC) diff --git a/sfall/LoadOrder.cpp b/sfall/LoadOrder.cpp index aa581545..5867fdef 100644 --- a/sfall/LoadOrder.cpp +++ b/sfall/LoadOrder.cpp @@ -287,7 +287,7 @@ static DbFile* __fastcall LoadFont(const char* font, const char* mode) { char file[128]; const char* lang; if (fo_get_game_config_string(&lang, "system", "language") && _stricmp(lang, "english") != 0) { - std::sprintf(file, "%s\\%s", lang, font); + std::sprintf(file, "fonts\\%s\\%s", lang, font); return fo_db_fopen(file, mode); } return nullptr; diff --git a/sfall/MiscPatches.cpp b/sfall/MiscPatches.cpp index 28925bd7..55f4b667 100644 --- a/sfall/MiscPatches.cpp +++ b/sfall/MiscPatches.cpp @@ -766,12 +766,19 @@ void MiscPatches_Init() { // Remove hardcoding for maps with IDs 19 and 37 if (GetConfigInt("Misc", "DisableSpecialMapIDs", 0)) { - dlog("Applying disable special map IDs patch.", DL_INIT); + dlog("Applying disable special maps handling patch.", DL_INIT); const DWORD specialMapIdsAddr[] = {0x4836D6, 0x4836DB}; SafeWriteBatch(0, specialMapIdsAddr); dlogr(" Done", DL_INIT); } + // Remove hardcoding for city areas 45 and 46 (AREA_FAKE_VAULT_13) + if (GetConfigInt("Misc", "DisableSpecialAreas", 0)) { + dlog("Applying disable special areas handling patch.", DL_INIT); + SafeWrite8(0x4C0576, CODETYPE_JumpShort); + dlogr(" Done", DL_INIT); + } + // Highlight "Radiated" in red color when the player is under the influence of negative effects of radiation const DWORD listDrvdStatsAddr[] = {0x43549C, 0x4354BE}; HookCalls(ListDrvdStats_hook, listDrvdStatsAddr); diff --git a/sfall/Translate.cpp b/sfall/Translate.cpp index a3e9dd5f..9946fea1 100644 --- a/sfall/Translate.cpp +++ b/sfall/Translate.cpp @@ -22,7 +22,7 @@ static struct Translation { char def[65]; - char lang[180]; + char lang[170]; bool state; const char* File() { @@ -45,11 +45,11 @@ std::vector Translate_GetList(const char* section, const char* sett //////////////////////////////////////////////////////////////////////////////// static void MakeLangTranslationPath(const char* config) { - char patches[65], language[41]; + char patches[65], language[32]; char fileConfig[65] = ".\\"; std::strcpy(&fileConfig[2], config); - IniGetString("system", "language", "english", language, 41, fileConfig); + IniGetString("system", "language", "english", language, 32, fileConfig); IniGetString("system", "master_patches", "data", patches, 65, fileConfig); const char* iniDef = translationIni.def;