mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Fallout 1 worldmap sfx implementation (#434)
Implemented FO1 worldmap sfx (#373) Added obj_drop call definition.
This commit is contained in:
@@ -191,6 +191,7 @@ WRAP_WATCOM_FUNC0(long, new_obj_id)
|
||||
WRAP_WATCOM_FUNC2(void, obj_bound, fo::GameObject*, object, fo::BoundRect*, boundRect) // Calculates bounding box (rectangle) for a given object
|
||||
WRAP_WATCOM_FUNC1(long, obj_destroy, fo::GameObject*, object)
|
||||
WRAP_WATCOM_FUNC2(long, obj_dist, fo::GameObject*, obj_src, fo::GameObject*, obj_trg)
|
||||
WRAP_WATCOM_FUNC2(void, obj_drop, fo::GameObject*, dropFrom, fo::GameObject*, objectToDrop)
|
||||
WRAP_WATCOM_FUNC2(long, obj_erase_object, fo::GameObject*, object, fo::BoundRect*, boundRect)
|
||||
WRAP_WATCOM_FUNC0(fo::GameObject*, obj_find_first)
|
||||
WRAP_WATCOM_FUNC0(fo::GameObject*, obj_find_next)
|
||||
|
||||
@@ -774,6 +774,66 @@ static void UseWalkDistancePatch() {
|
||||
}
|
||||
}
|
||||
|
||||
bool wmPressed = false;
|
||||
void __declspec(naked) clickedWMHotspotSound() {
|
||||
__asm {
|
||||
mov eax, 0x503E34 // Ib2p1xx1_1
|
||||
call fo::funcoffs::gsound_play_sfx_file_
|
||||
mov wmPressed, 1
|
||||
mov eax, dword ptr ds : [0x00672E90]
|
||||
mov edx, 0x4C425C
|
||||
jmp edx
|
||||
}
|
||||
}
|
||||
|
||||
void __declspec(naked) releasedWMHotspotSound() {
|
||||
__asm {
|
||||
mov al, wmPressed
|
||||
cmp al, 1
|
||||
jne exit_
|
||||
mov eax, 0x503E40 // Ib2lu1x1_1
|
||||
call fo::funcoffs::gsound_play_sfx_file_
|
||||
mov wmPressed, 0
|
||||
exit_:
|
||||
mov eax, dword ptr ds : [0x00672E88]
|
||||
mov edx, 0x4C425C
|
||||
jmp edx
|
||||
}
|
||||
}
|
||||
|
||||
void __declspec(naked) moveWMSound() {
|
||||
__asm {
|
||||
push eax
|
||||
mov eax, 0x503E14
|
||||
call fo::funcoffs::gsound_play_sfx_file_
|
||||
pop eax
|
||||
call fo::funcoffs::wmPartyInitWalking_
|
||||
mov eax, 0x4C02DF
|
||||
jmp eax
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) townmapButtonSound() {
|
||||
__asm {
|
||||
mov dword ptr ds : [edi + 0x672DD8], eax
|
||||
mov ebx, 0x451990 // gsound_med_butt_release_
|
||||
mov edx, 0x451988 // gsound_med_butt_press_
|
||||
call fo::funcoffs::win_register_button_sound_func_
|
||||
mov eax, 0x4C4B9A
|
||||
jmp eax;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// https://github.com/phobos2077/sfall/issues/373
|
||||
// See https://www.youtube.com/watch?v=dGZjse7uC_0&t=50m for reference on how it works in FO1.
|
||||
static void Fallout1WMSoundChanges() {
|
||||
MakeJump(0x4C02DA, moveWMSound);
|
||||
MakeJump(0x4C4B94, townmapButtonSound);
|
||||
MakeJump(0x4C4250, releasedWMHotspotSound);
|
||||
MakeJump(0x4C4257, clickedWMHotspotSound);
|
||||
}
|
||||
|
||||
static void F1EngineBehaviorPatch() {
|
||||
if (IniReader::GetConfigInt("Misc", "Fallout1Behavior", 0)) {
|
||||
dlog("Applying Fallout 1 engine behavior patch.", DL_INIT);
|
||||
@@ -1027,6 +1087,7 @@ void MiscPatches::init() {
|
||||
if (HRP::Setting::VersionIsValid) SafeWrite8(HRP::Setting::GetAddress(0x10011738), 10);
|
||||
}
|
||||
|
||||
Fallout1WMSoundChanges();
|
||||
F1EngineBehaviorPatch();
|
||||
DialogueFix();
|
||||
AdditionalWeaponAnimsPatch();
|
||||
|
||||
Reference in New Issue
Block a user