From 903ab0c5c78a231e6b3e4f515a953bcd90bb15ee Mon Sep 17 00:00:00 2001 From: ZivDero Date: Sun, 29 Sep 2024 23:23:59 +0300 Subject: [PATCH] Re-enable part of the sidebar hack for Vinifera builds Temporary solution until the spawner is ported to Vinifera --- src/ts_hacks.asm | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/src/ts_hacks.asm b/src/ts_hacks.asm index 206ae73..a8c840e 100644 --- a/src/ts_hacks.asm +++ b/src/ts_hacks.asm @@ -15,6 +15,29 @@ @SET 0x0062B2E4, {mov dword [esp+1Ch], 0x06} @SET 0x0062C0C1, {mov edi, 0x06} +; +; The following Sidebar Hack-related patches are included in Vinifera compatible builds until the spawner is reimplemented. +; + +; Set global variable byte containing side ID to load files for +@SET 0x004E2CFA, {mov byte [0x7E2500], al} +@SET 0x004E2CFF, nop +@SET 0x004E2D00, {add esp, 4} +@SJMP 0x004E2D03, 0x004E2D13 ; jmp short +@SET 0x004E2D05, nop + +; Load sidebar MIX files for new sides properly +@SET 0x005DD798, {mov cl, byte [0x007E2500]} +@CLEAR 0x005DD79E, 0x90, 0x005DD7A2 + +; Load speech MIX files for new sides properly +; Defaults SpeechSide to our hijacked player side value +hack 0x005DD75B + mov eax, [Scen] + xor ecx, ecx + mov cl, byte [0x007E2500] ; PlayerSide (was Session.IsGDI) + mov [eax+0x1E44], ecx ; set SpeechSide + jmp 0x005DD784 ; go back to game code for initializing side ; ; The following patches will not be included in Vinifera compatible builds. @@ -49,21 +72,10 @@ sstring str_LanguageDLLNotFound, "Language.dll not found, please start TiberianS @SET 0x005899F6, nop @SET 0x005899F7, nop -; Set global variable byte containing side ID to load files for -@SET 0x004E2CFA, {mov byte [0x7E2500], al} -@SET 0x004E2CFF, nop -@SET 0x004E2D00, {add esp, 4} -@SJMP 0x004E2D03, 0x004E2D13 ; jmp short -@SET 0x004E2D05, nop - ; Load sidebar MIX files for new sides properly (for saved games) @SET 0x005D6C4F, {mov cl, [eax+1D91h]} @CLEAR 0x005D6C55, 0x90, 0x005D6C58 -; Load sidebar MIX files for new sides properly -@SET 0x005DD798, {mov cl, byte [0x007E2500]} -@CLEAR 0x005DD79E, 0x90, 0x005DD7A2 - ; Erase NAWALL and GAWALL hardcoding @SET 0x00710DA4, {db 0,0,0,0,0,0} @SET 0x00710DAC, {db 0,0,0,0,0,0} @@ -79,13 +91,4 @@ sstring str_LanguageDLLNotFound, "Language.dll not found, please start TiberianS @SET 0x005D6DD0, {mov cl, [eax+1D91h]} @CLEAR 0x005D6DD6, 0x90, 0x005D6DDB -; Load speech MIX files for new sides properly -; Defaults SpeechSide to our hijacked player side value -hack 0x005DD75B - mov eax, [Scen] - xor ecx, ecx - mov cl, byte [0x007E2500] ; PlayerSide (was Session.IsGDI) - mov [eax+0x1E44], ecx ; set SpeechSide - jmp 0x005DD784 ; go back to game code for initializing side - %endif