Removed commented code in the previous commit

Edits to documents and README.md.
This commit is contained in:
NovaRain
2022-03-28 14:57:37 +08:00
parent bdb95c80ec
commit 73e1faae92
7 changed files with 16 additions and 96 deletions
+7 -2
View File
@@ -1,6 +1,8 @@
# sfall
A set of engine modifications for the classic game Fallout 2 in form of a DLL, which modifies executable in memory without changing anything in EXE file itself.
[![License](https://img.shields.io/badge/License-GPL--3.0-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
A set of engine modifications for the classic game Fallout 2 in the form of a DLL, which modifies executable in memory without changing anything in EXE file itself.
**Engine modifications include:**
- Better support for modern operating systems
@@ -10,7 +12,10 @@ A set of engine modifications for the classic game Fallout 2 in form of a DLL, w
- Extended scripting capabilities for modders (many new opcodes to control sfall features as well as previously unavailable vanilla engine functions)
Original author: timeslip
Original author: **Timeslip**
Original description: A set of engine modifications for the classic game Fallout 2 by Interplay. Includes fixes for bugs in the original engine, allows fallout to run correctly on modern operating systems, and adds additional features for modders.
---
#### Fallout Engine IDA Database
**[Download](https://www.dropbox.com/s/tm0nyx0lnk4yui0/Fallout_1_and_2_IDA68.rar "Download from Dropbox")** (comments are in Russian)
+2 -2
View File
@@ -21,5 +21,5 @@ This folder contains documentation about sfall scripting extensions.
hookscripts.md - detailed manual for using hook scripts to modify engine behavior
arrays.md - manual for sfall arrays
If you are/will be using sfall Script Editor, don't forget to check out new compiler documentation in **.\compiler\sslc_readme.txt**.
There are numerious new syntax features and extensions to SSL (Star-Trek Scripting language).
If you are/will be using sfall Script Editor, don't forget to check out new compiler documentation in **.\compiler\sslc_readme.md**.
There are numerious new syntax features and extensions to SSL (Star-Trek Scripting Language).
+2 -2
View File
@@ -21,5 +21,5 @@ This folder contains documentation about sfall scripting extensions.
hookscripts.html - detailed manual for using hook scripts to modify engine behavior
arrays.html - manual for sfall arrays
If you are/will be using sfall Script Editor, don't forget to check out new compiler documentation in .\compiler\sslc_readme.txt.
There are numerious new syntax features and extensions to SSL (Star-Trek Scripting language).
If you are/will be using sfall Script Editor, don't forget to check out new compiler documentation in .\compiler\sslc_readme.html.
There are numerious new syntax features and extensions to SSL (Star-Trek Scripting Language).
+1 -1
View File
@@ -449,7 +449,7 @@ Obj arg1 - The target object
int arg2 - skill being used
int arg3 - skill bonus from items such as first aid kits
int ret0 - overrides hard-coded handler (-1 - use engine handler, any other value - override, with a zero value having a 10% chance of removing the used medical item)
int ret0 - overrides hard-coded handler (-1 - use engine handler, any other value - override; if it is 0, there will be a 10% chance of removing the used medical item)
```
-------------------------------------------
+2 -2
View File
@@ -1401,7 +1401,7 @@ void Graphics::init() {
}
IsWindowedMode = (Graphics::mode >= 5);
if (Graphics::mode) {
if (Graphics::mode != 0) {
dlog("Applying DX9 graphics patch.", DL_INIT);
#define _DLL_NAME "d3dx9_42.dll"
HMODULE h = LoadLibraryExA(_DLL_NAME, 0, LOAD_LIBRARY_AS_DATAFILE);
@@ -1479,7 +1479,7 @@ void Graphics::init() {
}
void Graphics::exit() {
if (Graphics::mode) {
if (Graphics::mode != 0) {
RECT rect;
if (Graphics::mode == 5 && GetWindowRect(window, &rect)) {
int data = rect.top | (rect.left << 16);
+2 -2
View File
@@ -70,7 +70,7 @@ void __stdcall SetShaderMode(DWORD d, DWORD mode) {
}
int __stdcall LoadShader(const char* file) {
if (!Graphics::mode || strstr(file, "..") || strstr(file, ":")) return -1;
if (Graphics::mode == 0 || strstr(file, "..") || strstr(file, ":")) return -1;
char buf[MAX_PATH];
sprintf_s(buf, "%s\\shaders\\%s", (*fo::ptr::master_db_handle)->path, file); // *fo::ptr::patches
for (DWORD d = 0; d < shadersSize; d++) {
@@ -225,7 +225,7 @@ void ScriptShaders::OnGameLoad() {
}
void ScriptShaders::init() {
if (Graphics::mode) {
if (Graphics::mode != 0) {
for each (const std::string& shaderFile in IniReader::GetConfigList("Graphics", "GlobalShaderFile", "", 1024)) {
if (shaderFile.length() > 3) gShaderFiles.push_back(GlobalShader(shaderFile));
}
-85
View File
@@ -976,82 +976,11 @@ static void __declspec(naked) sfxl_init_hook() {
retn;
}
}
/*
static void __declspec(naked) internalSoundFade_hack() {
__asm {
mov ebp, ds:[FO_VAR_deviceInit];
test ebp, ebp;
jz skip;
cmp dword ptr ds:[FO_VAR_masterVol], 0; // check current master volume
je stop;
test ebx, ebx;
jg skip; // to volume > 0
// for fade-out, perform a callback function
cmp dword ptr [eax + 0x88], 0;
je skip;
mov edx, 1;
call dword ptr [eax + 0x88]; // perform callback function
mov dword ptr [eax + 0x88], 0; // remove callback function
mov edx, ebx;
skip:
retn;
stop:
add esp, 4;
mov eax, 0x4AE9AA; // error result
jmp eax;
}
}
static bool fadeProcess = false;
static void __stdcall sf_doTimerEvent(UINT uTimerID, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2) {
if (!fadeProcess && *fo::ptr::fadeEventHandle != -1 && dwUser) {
fadeProcess = true;
__asm call dwUser; // fadeSounds_
fadeProcess = false;
}
}
static void __declspec(naked) internalSoundFade_hack_timer() {
__asm {
lea eax, sf_doTimerEvent;
xchg [esp], eax;
jmp eax;
}
}
static void __declspec(naked) fadeSounds_hook() {
__asm {
//mov dword ptr [eax + 0x88], 0; // remove sound callback function
or word ptr [eax + 0x40], 0x10; // set 'AfterFade' state flag
jmp fo::funcoffs::soundVolume_; // set mute
}
}
static void __declspec(naked) soundContinue_hack() {
__asm {
mov dx, [ebx + 0x40];
test dx, 0x10; // check 'AfterFade' state flag (fix flag set in fadeSounds_hook)
jz skip;
cmp fadeProcess, 1;
je skip;
call fo::funcoffs::soundDelete_;
xor edx, edx;
mov dword ptr [esp], 0x4AD99E;
retn;
skip:
test dl, 0x8; // InPaused flag
retn;
}
}
*/
static const int SampleRate = 44100; // 44.1kHz
//static bool fadeBgMusic = false;
void Sound::OnAfterGameInit() {
*fo::ptr::sampleRate = SampleRate / 2; // Revert to 22kHz for secondary sound buffers
//if (fadeBgMusic) fo::var::setInt(FO_VAR_gsound_background_fade) = 1;
}
void Sound::OnGameLoad() {
@@ -1140,20 +1069,6 @@ void Sound::init() {
const DWORD sfxlInitAddr[] = {0x4A9999, 0x4A9B34};
HookCalls(sfxl_init_hook, sfxlInitAddr);
}
/*if (IniReader::GetConfigInt("Sound", "FadeBackgroundMusic", 1)) {
SafeMemSet(0x45020C, CodeType::Nop, 6); // gsound_reset_
SafeWrite32(0x45212C, 250); // delay start
SafeWrite32(0x450ADE, 500); // delay stop
// fixes
MakeCall(0x4AE991, internalSoundFade_hack, 1);
MakeCall(0x4AEAC6, internalSoundFade_hack_timer);
HookCall(0x4AE929, fadeSounds_hook);
BlockCall(0x4AE910); // fadeSounds_ (block soundStop_)
MakeCall(0x4AD991, soundContinue_hack, 1);
fadeBgMusic = true;
}*/
}
void Sound::exit() {