Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ EXE_OBJS = \
src/online_optimizations.o \
src/rage_quit.o \
src/silent_cheer.o \
src/artyr_ini_patch.o \
res/res.o \
sym.o

Expand Down
1 change: 1 addition & 0 deletions inc/RA.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ extern bool RunAutoSS;
extern bool DoingAutoSS;
extern bool UsePNG;
extern bool DisableChat;
extern bool DisableGameSpeed;

void *new(int32_t size);
void __thiscall ScenarioClass_ReadLightingAndBasic(void *this, void *ini);
Expand Down
6 changes: 6 additions & 0 deletions inc/macros/patch.inc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
%endif
%endmacro

; Convenience macro to overwrite a null-terminated ASCII string at an absolute address
; Usage: SETSTRING <addr>, "STRING"
%macro SETSTRING 2
@SET %1, { db %2, 0 }
%endmacro

%macro @ENDPATCH 0
%ifctx __patch
%$end:
Expand Down
5 changes: 5 additions & 0 deletions src/artyr_ini_patch.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
%include "macros/patch.inc"

; Rename ARTMD.INI -> ARTYR.INI at address 0x00826254
; Based on original constant at that address (length 10 incl. NUL)
SETSTRING 0x00826254, "ARTYR.INI"
4 changes: 3 additions & 1 deletion src/spawner/load_spawn.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ int32_t ReconnectTimeout;
bool QuickMatch = false;
bool Ra2Mode = false;
bool RunAutoSS;
bool DisableGameSpeed = false;


int __fastcall InitGame(int argc, char **argv);
Expand Down Expand Up @@ -267,6 +268,7 @@ signed int Initialize_Spawn()
MPSYNCDEBUG = MPDEBUG1 = MPDEBUG = false;

RunAutoSS = INIClass__GetBool(&INIClass_SPAWN, "Settings", "RunAutoSS", false);
DisableGameSpeed = INIClass__GetBool(&INIClass_SPAWN, "Settings", "DisableGameSpeed", false);
ConnTimeout = INIClass__GetInt(&INIClass_SPAWN, "Settings", "ConnTimeout", 3600);
ReconnectTimeout=INIClass__GetInt(&INIClass_SPAWN, "Settings", "ReconnectTimeout", 2400);
if (!DisableChat)
Expand Down Expand Up @@ -473,4 +475,4 @@ void Load_Sides_Stuff()
{
HouseTypeClassArray[i]->vtable->Read_INI(HouseTypeClassArray[i], RulesINI);
}
}
}
30 changes: 29 additions & 1 deletion src/spawner/spectators.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
%include "macros/string.inc"

%include "session.inc"
cextern DisableGameSpeed

; Prevent losing/winning in skirmish spectator mode
; And allow skirmish spectators to control gamespeed
; Show observer loading screen for skirmish spectators
; TODO: Allow multiple spectators to watch an AI fight in multiplayer
@HACK 0x004FCBD0, _HouseClass__Flag_To_Lose_Skirmsh_Spectator_Patch
cmp dword [SessionType], 5
jnz .Normal_Code
Expand Down Expand Up @@ -56,12 +56,40 @@
@ENDHACK

@HACK 0x004E20BA, _Dlg_Stuff_Show_Gamespeed_Slider_Skirmish_Spectator
; If DisableGameSpeed is enabled, hide the GameSpeed (FPS) slider group (IDs 0x529/0x714/0x671)
cmp byte [DisableGameSpeed], 1
jnz .Check_Spectator
; Hide gamespeed group controls
push 0x529
push esi
call edi
push 0
push eax
call ebp
push 0x714
push esi
call edi
push 0
push eax
call ebp
push 0x671
push esi
call edi
push 0
push eax
call ebp
; Continue to initialize the remaining slider path
jmp 0x004E211A

.Check_Spectator:
; When not hiding globally, keep original spectator force-show
cmp dword [SessionType], 5
jnz .Normal_Code

cmp dword [ObserverMode], 1
jnz .Normal_Code

; Force show slider for spectators (original behavior)
jmp 0x004E211A

.Normal_Code:
Expand Down
Loading