Preserve retained Jimmy update order on initial story entry
This commit is contained in:
1 parent
4cd62d3627
commit
ea04210f52
24 files changed
+1209
-22
No files matched your search
@@ -0,0 +1,116 @@
|
||||
/* Diagnose the copied original's black startup under the isolated Wine wrapper.
|
||||
Thread suspension perturbs timing: this is not a gameplay timing reference.
|
||||
No code/actor memory writes; every successfully suspended thread is resumed. */
|
||||
#define main observer_unused_main
|
||||
#include "original_state_observer.c"
|
||||
#undef main
|
||||
#include <tlhelp32.h>
|
||||
|
||||
static void threads(HANDLE process, DWORD pid, unsigned elapsed) {
|
||||
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);
|
||||
THREADENTRY32 entry = {0};
|
||||
entry.dwSize = sizeof(entry);
|
||||
if (snapshot == INVALID_HANDLE_VALUE) return;
|
||||
if (Thread32First(snapshot, &entry)) do {
|
||||
if (entry.th32OwnerProcessID != pid) continue;
|
||||
HANDLE thread = OpenThread(THREAD_SUSPEND_RESUME|THREAD_GET_CONTEXT|THREAD_QUERY_INFORMATION,
|
||||
FALSE, entry.th32ThreadID);
|
||||
CONTEXT context = {0};
|
||||
uint32_t stack[64] = {0};
|
||||
int context_ok = 0, stack_ok = 0;
|
||||
if (!thread) continue;
|
||||
DWORD prior = SuspendThread(thread);
|
||||
if (prior != (DWORD)-1) {
|
||||
context.ContextFlags = CONTEXT_CONTROL;
|
||||
context_ok = GetThreadContext(thread, &context);
|
||||
if (context_ok) stack_ok = read_memory(process, context.Esp, stack, sizeof(stack));
|
||||
/* Resume even when context/stack reads fail. Keep prior suspension count. */
|
||||
DWORD resumed = ResumeThread(thread);
|
||||
printf("{\"kind\":\"thread\",\"elapsed_ms\":%u,\"tid\":%lu,\"prior_suspend\":%lu,"
|
||||
"\"resume_ok\":%s,\"context_ok\":%s,\"eip\":%lu,\"esp\":%lu,\"stack_ok\":%s,\"stack\":[",
|
||||
elapsed, entry.th32ThreadID, prior, resumed!=(DWORD)-1?"true":"false",
|
||||
context_ok?"true":"false", context.Eip, context.Esp, stack_ok?"true":"false");
|
||||
for (unsigned i=0; stack_ok && i<sizeof(stack)/sizeof(stack[0]); ++i)
|
||||
printf("%s%lu", i?",":"", (unsigned long)stack[i]);
|
||||
puts("]}");
|
||||
}
|
||||
CloseHandle(thread);
|
||||
} while (Thread32Next(snapshot, &entry));
|
||||
CloseHandle(snapshot);
|
||||
}
|
||||
|
||||
static void modules(DWORD pid) {
|
||||
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pid);
|
||||
MODULEENTRY32 entry = {0};
|
||||
entry.dwSize = sizeof(entry);
|
||||
if (snapshot == INVALID_HANDLE_VALUE) return;
|
||||
if (Module32First(snapshot, &entry)) do {
|
||||
fputs("{\"kind\":\"module\",\"name\":", stdout); json_string(entry.szModule);
|
||||
printf(",\"base\":%lu,\"size\":%lu}\n", (unsigned long)(uintptr_t)entry.modBaseAddr, entry.modBaseSize);
|
||||
} while (Module32Next(snapshot, &entry));
|
||||
CloseHandle(snapshot);
|
||||
}
|
||||
|
||||
static BOOL CALLBACK close_window(HWND window, LPARAM pid) {
|
||||
DWORD actual;
|
||||
GetWindowThreadProcessId(window, &actual);
|
||||
if (actual == (DWORD)pid && IsWindowVisible(window)) PostMessageA(window, WM_CLOSE, 0, 0);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
char cwd[MAX_PATH], digest[65], command[]="NeutronHDnoCD.exe";
|
||||
STARTUPINFOA start = {0}; PROCESS_INFORMATION child = {0};
|
||||
int acknowledge=0, standard=0;
|
||||
unsigned duration=11;
|
||||
for (int i=1; i<argc; ++i) {
|
||||
if (!strcmp(argv[i],"--acknowledge-repaint")) acknowledge=1;
|
||||
else if (!strcmp(argv[i],"--standard-resolution")) standard=1;
|
||||
else if (!strncmp(argv[i],"--seconds=",10)) {
|
||||
char *end; unsigned long n=strtoul(argv[i]+10,&end,10);
|
||||
if (*end || n<3 || n>60) return 7;
|
||||
duration=(unsigned)n;
|
||||
} else if (strcmp(argv[i],"ASE\\jimstop.ase")) return 7;
|
||||
}
|
||||
const Profile *profile=&profiles[standard?3:2];
|
||||
if (standard) strcpy(command,"NeutronNoCD.exe");
|
||||
setbuf(stdout, NULL);
|
||||
if (!GetCurrentDirectoryA(sizeof(cwd),cwd) || _stricmp(cwd,"Z:\\work\\game")) return 2;
|
||||
HANDLE file = CreateFileA(command,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,0,NULL);
|
||||
if (file == INVALID_HANDLE_VALUE) return 3;
|
||||
if (!sha256(file,digest) || strcmp(digest,profile->sha)) { CloseHandle(file); return 4; }
|
||||
start.cb = sizeof(start);
|
||||
if (!CreateProcessA(command,command,NULL,NULL,FALSE,0,NULL,cwd,&start,&child)) { CloseHandle(file); return 5; }
|
||||
CloseHandle(file); CloseHandle(child.hThread);
|
||||
printf("{\"kind\":\"diagnostic_subject\",\"sha256\":\"%s\",\"pid\":%lu,\"timing_perturbed\":true}\n",digest,child.dwProcessId);
|
||||
DWORD began=GetTickCount(); int identified=0;
|
||||
for (unsigned sample=0; GetTickCount()-began<duration*1000; ++sample) {
|
||||
Sleep(1500);
|
||||
identified=runtime_identity(child.hProcess,profile);
|
||||
if (!identified) continue;
|
||||
Registry state;
|
||||
registry_snapshot(child.hProcess,profile,&state);
|
||||
print_registry(&state,GetTickCount()-began);
|
||||
print_sample(child.hProcess,profile,&state,GetTickCount()-began);
|
||||
uint32_t code=0;
|
||||
if (read_memory(child.hProcess,state.current+0x490,&code,4))
|
||||
printf("{\"kind\":\"level_identity\",\"elapsed_ms\":%lu,\"code\":%lu}\n",GetTickCount()-began,(unsigned long)code);
|
||||
modules(child.dwProcessId);
|
||||
threads(child.hProcess,child.dwProcessId,GetTickCount()-began);
|
||||
if (acknowledge && sample == 1) {
|
||||
HWND window=find_window(child.dwProcessId);
|
||||
RECT rect={0};
|
||||
BOOL pending=window&&GetUpdateRect(window,&rect,FALSE);
|
||||
BOOL acknowledged=window&&ValidateRect(window,NULL);
|
||||
printf("{\"kind\":\"window_repaint_acknowledgement\",\"elapsed_ms\":%lu,\"window\":%lu,"
|
||||
"\"pending\":%s,\"acknowledged\":%s,\"rect\":[%ld,%ld,%ld,%ld]}\n",
|
||||
GetTickCount()-began,(unsigned long)(uintptr_t)window,
|
||||
pending?"true":"false",acknowledged?"true":"false",rect.left,rect.top,rect.right,rect.bottom);
|
||||
}
|
||||
}
|
||||
EnumWindows(close_window,child.dwProcessId);
|
||||
CloseHandle(child.hProcess);
|
||||
if (!identified) return 6;
|
||||
puts("ORIGINAL_STARTUP_DIAGNOSTIC_COMPLETE");
|
||||
return 0;
|
||||
}
|
||||
@@ -20,6 +20,7 @@
|
||||
#define CANONICAL_SHA "f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8"
|
||||
#define HD_SHA "b6675b7e7f3fc37512185ddb4d6ce1fbe9a36c8b83f3b4b3ed6979a56db3d2d4"
|
||||
#define HD_NOCD_SHA "8cd5d21997835a40978b8b83e344c97c92217bf6cd6858f7458b76935d64dedb"
|
||||
#define NOCD_SHA "5e1d3bed2d649d16ec62ead02514119a16590380d4d5a6a73103db900a15c62e"
|
||||
|
||||
typedef struct {
|
||||
const char *name, *sha;
|
||||
@@ -28,7 +29,8 @@ typedef struct {
|
||||
static const Profile profiles[] = {
|
||||
{"canonical",CANONICAL_SHA,0x5099e4,0x50999c,0x696030,0x509948,0x4f83e4,0x4f8430,0x4f8198,0x4f8182},
|
||||
{"hd-resolution",HD_SHA,0x5099e4,0x50999c,0x696030,0x509948,0x4f83e4,0x4f8430,0x4f8198,0x4f8182},
|
||||
{"hd-nocd",HD_NOCD_SHA,0x509a04,0x5099bc,0x696050,0x509968,0x4f8404,0x4f8450,0x4f81b8,0x4f81a2}
|
||||
{"hd-nocd",HD_NOCD_SHA,0x509a04,0x5099bc,0x696050,0x509968,0x4f8404,0x4f8450,0x4f81b8,0x4f81a2},
|
||||
{"standard-nocd",NOCD_SHA,0x509a04,0x5099bc,0x696050,0x509968,0x4f8404,0x4f8450,0x4f81b8,0x4f81a2}
|
||||
};
|
||||
|
||||
typedef struct { uint32_t payload, vtable; } Node;
|
||||
|
||||
@@ -58,6 +58,8 @@ def inside(args):
|
||||
frames, mode = 180, ['--smoke-objective-window']
|
||||
elif args.port_regression == 'carl':
|
||||
frames, mode = 60, ['--smoke-carl-cutscene']
|
||||
elif args.port_regression == 'control':
|
||||
frames, mode = 32, ['--smoke-control-phases']
|
||||
elif args.port_jetpack:
|
||||
frames, mode = 300, ['--smoke-jetpack']
|
||||
elif args.port_walk:
|
||||
@@ -126,7 +128,7 @@ def main():
|
||||
p.add_argument('--port-practice', action='store_true', help='Windows port practice modal/input/resize under Wine64')
|
||||
p.add_argument('--port-cutscene-audio', action='store_true', help='Windows port cutscene music lifecycle under Wine64')
|
||||
p.add_argument('--port-jetpack', action='store_true', help='Windows port VR04 powered steering/input/resize under Wine64')
|
||||
p.add_argument('--port-regression', choices=['objectives', 'carl'], help='Windows lab popup or conversation runtime regression under Wine64')
|
||||
p.add_argument('--port-regression', choices=['objectives', 'carl', 'control'], help='Windows lab popup, conversation lock or grounded skip-to-idle regression under Wine64')
|
||||
p.add_argument('--asset-probe', action='store_true', help='Run compiled read-only OMT shape probe inside isolated copy')
|
||||
p.add_argument('--probe-model', default=r'ASE\jimstop.ase')
|
||||
p.add_argument('--probe-arg', action='append', default=[], help='Additional explicit argument for the generated component probe (repeatable)')
|
||||
|
||||
Reference in new issue
Block a user