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:
@@ -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.
Reference in New Issue
Block a user