Add -tbaud switch: force COM1 RIO baud for high-speed replica boards

-tbaud <rate> (9600-921600) overrides the COM1 baud rate while keeping
old-RIO (type 0) protocol behavior unchanged; independent of -trio.
SetupComm buffers 2/2 -> 1024/1024 only when the override is active.
Rebuilt Release + Profile (0 errors), deployed rel.bin\MW4.exe to MW4\.
run-firestorm driver: game-start now takes optional extra args.
CLAUDE.md: branch notes incl. the CP949 comment-encoding hazard
(mw4 sources must be edited byte-safely).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-12 21:50:10 -05:00
co-authored by Claude Fable 5
parent 1fd489d9a6
commit dbcf4052e2
55 changed files with 63237 additions and 62587 deletions
+6 -1
View File
@@ -107,6 +107,7 @@ static BYTE g_baRIOLengthsB[] = {
int g_nRIOPacketCountB = (sizeof(g_baRIOLengthsB) / sizeof(g_baRIOLengthsB[0]));
int g_nRIOType = 0; // 0: old(original) type, 1: new type
DWORD g_dwRIOBaud = 0; // [tbaud] 0: default by RIO type; else COM1 baud forced by -tbaud (high-speed replica of the original RIO board, protocol unchanged)
int g_nEjectButton = 61; // 61: original, 31: new type
BYTE* g_pbRIOLengths = NULL;
int g_nRIOPacketCount = 0;
@@ -520,6 +521,9 @@ BOOL SetupConnection(HANDLE hCom)
} else {
dcb.BaudRate = (g_nRIOType == 0) ? CBR_9600: CBR_115200;
}
if (g_dwRIOBaud != 0) {
dcb.BaudRate = g_dwRIOBaud; // [tbaud] -tbaud override
}
dcb.ByteSize = 8 ;
dcb.Parity = 0;
dcb.StopBits = 0;
@@ -545,7 +549,8 @@ BOOL SetupConnection(HANDLE hCom)
if(fRetVal==0)return FALSE;
// setup device buffers
fRetVal=SetupComm(hCom, 2, 2 );
// [tbaud] at overridden (higher) rates use real buffers; default 2/2 kept byte-identical for deployed pods
fRetVal=SetupComm(hCom, (g_dwRIOBaud != 0) ? 1024: 2, (g_dwRIOBaud != 0) ? 1024: 2 );
if(fRetVal==0)return FALSE;
// purge any information in the buffer
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -87,6 +87,7 @@ extern Time g_AUX_ADT;
extern bool g_UseMSRSP;
extern int g_nTypeOfMFDs; // 0 - no MFDs, 1 - orginal(5+1=dual & single), 2 - B&W(3 + 1=1 dual), 3 - color(3 + 1=2 dual)
extern int g_nRIOType;
extern DWORD g_dwRIOBaud; // [tbaud]
extern LONG g_ThrottleDir;
extern bool g_bCanSuicideAllways;
extern bool g_f3dtarget;
@@ -1449,6 +1450,13 @@ int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int n
if ((n == 0) || (n == 1))
g_nRIOType = n;
}
token = strstr(all_lower, "-tbaud "); // [tbaud] force COM1 baud; must match the RIO board's UART rate
if (token && token[7])
{
int n = atoi(&token[7]);
if ((9600 <= n) && (n <= 921600))
g_dwRIOBaud = (DWORD)n;
}
g_bCanSuicideAllways = (strstr(all_lower, "-suicide") != NULL);
g_f3dtarget = (strstr(all_lower, "-3dt") != NULL);
g_bOldLOG = (strstr(all_lower, "-olog") != NULL);
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.