Skip to content

Commit 3f40b75

Browse files
committed
Re-enable part of the sidebar hack for TO
1 parent efd5e3c commit 3f40b75

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

src/to_hacks.asm

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,30 @@
4040
; Prevent more than 75 cameos from appearing in a sidebar column and thus crashing the game
4141
;; @SJGE 0x005F463B, 0x005F46A1 ;jge short loc_5F46A1
4242

43+
;
44+
; The following Sidebar Hack-related patches are included in Vinifera compatible builds until the spawner is reimplemented.
45+
;
46+
47+
; Set global variable byte containing side ID to load files for
48+
@SET 0x004E2CFA, {mov byte [0x7E2500], al}
49+
@SET 0x004E2CFF, nop
50+
@SET 0x004E2D00, {add esp, 4}
51+
@SJMP 0x004E2D03, 0x004E2D13 ; jmp short
52+
@SET 0x004E2D05, nop
53+
54+
; Load sidebar MIX files for new sides properly
55+
@SET 0x005DD798, {mov cl, byte [0x007E2500]}
56+
@CLEAR 0x005DD79E, 0x90, 0x005DD7A2
57+
58+
; Load speech MIX files for new sides properly
59+
; Defaults SpeechSide to our hijacked player side value
60+
hack 0x005DD75B
61+
mov eax, [Scen]
62+
xor ecx, ecx
63+
mov cl, byte [0x007E2500] ; PlayerSide (was Session.IsGDI)
64+
mov [eax+0x1E44], ecx ; set SpeechSide
65+
jmp 0x005DD784 ; go back to game code for initializing side
66+
4367

4468
;
4569
; The following patches will not be included in Vinifera compatible builds.
@@ -144,33 +168,13 @@ sstring str_DarkRed, "DarkRed"
144168
@SET 0x00710DA4, {db 0,0,0,0,0,0}
145169
@SET 0x00710DAC, {db 0,0,0,0,0,0}
146170

147-
; Set global variable byte containing side ID to load files for
148-
@SET 0x004E2CFA, {mov byte [0x7E2500], al}
149-
@SET 0x004E2CFF, nop
150-
@SET 0x004E2D00, {add esp, 4}
151-
@SJMP 0x004E2D03, 0x004E2D13 ; jmp short
152-
@SET 0x004E2D05, nop
153-
154171
; Load sidebar MIX files for new sides properly (for saved games)
155172
@SET 0x005D6C4F, {mov cl, [eax+1D91h]}
156173
@CLEAR 0x005D6C55, 0x90, 0x005D6C58
157174

158-
; Load sidebar MIX files for new sides properly
159-
@SET 0x005DD798, {mov cl, byte [0x007E2500]}
160-
@CLEAR 0x005DD79E, 0x90, 0x005DD7A2
161-
162175
; Load speech MIX files for new sides properly (for saved games)
163176
@SET 0x005D6DCE, {xor ecx, ecx}
164177
@SET 0x005D6DD0, {mov cl, [eax+1D91h]}
165178
@CLEAR 0x005D6DD6, 0x90, 0x005D6DDB
166179

167-
; Load speech MIX files for new sides properly
168-
; Defaults SpeechSide to our hijacked player side value
169-
hack 0x005DD75B
170-
mov eax, [Scen]
171-
xor ecx, ecx
172-
mov cl, byte [0x007E2500] ; PlayerSide (was Session.IsGDI)
173-
mov [eax+0x1E44], ecx ; set SpeechSide
174-
jmp 0x005DD784 ; go back to game code for initializing side
175-
176180
%endif

0 commit comments

Comments
 (0)