mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-20 04:35:57 +00:00
Log the load time with the world clock start: the line now says how many seconds after the guest started the world clock began, so load times compare across runs without the presents count
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
72253abcc0
commit
4e9322730d
3 files changed
+6
-2
No files matched your search
@@ -34,6 +34,7 @@ static const InitCount inits_143[] = {{"main", 10717}, {"subsdk0", 45}, {"sdk",
|
||||
#define expected_inits (RT_V143 ? inits_143 : inits_121)
|
||||
|
||||
static volatile LONG inits_done, checkpoint_seen;
|
||||
uint64_t rt_guest_start_ns;
|
||||
|
||||
static const RtLoaded *module_named(const char *name) {
|
||||
for (int i = 0; i < ldr_count(); i++)
|
||||
@@ -354,6 +355,7 @@ void rt_boot(void) {
|
||||
n = {.LowPart = now.dwLowDateTime, .HighPart = now.dwHighDateTime};
|
||||
rt_log("boot: guest starts %llu ms after process start (%llu ms of it waiting for the prewarm)",
|
||||
(unsigned long long)((n.QuadPart - c.QuadPart) / 10000), (unsigned long long)held);
|
||||
rt_guest_start_ns = kern_now_ns();
|
||||
kern_run_on_guest_main(guest_main);
|
||||
rt_fatal("boot: the guest main thread ended");
|
||||
}
|
||||
@@ -231,8 +231,9 @@ static void world_clock(double dt, double step) {
|
||||
if (w < 0) {
|
||||
float p[3];
|
||||
if (!player_pos(p) || fabsf(p[0]) + fabsf(p[2]) < 1.0f) return; // a few guest reads, until the load ends
|
||||
rt_log("frame step: world clock starts at present %llu (the player at %.1f %.1f %.1f)",
|
||||
(unsigned long long)presents, p[0], p[1], p[2]);
|
||||
rt_log("frame step: world clock starts at present %llu, %.2f s after the guest started (the player at %.1f %.1f %.1f)",
|
||||
(unsigned long long)presents, rt_guest_start_ns ? (kern_now_ns() - rt_guest_start_ns) / 1e9 : 0.0, p[0],
|
||||
p[1], p[2]);
|
||||
atomic_store_explicit(&world_us, 0, memory_order_relaxed);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -208,6 +208,7 @@ void kern_bind_system_event(Cpu *c, uint64_t ev, int autoclear); // guest thre
|
||||
void kern_signal_system_event(uint64_t ev); // any thread
|
||||
int kern_svc(Cpu *c, uint32_t imm); // thread/sync SVCs; 1 if handled
|
||||
uint64_t kern_now_ns(void);
|
||||
extern uint64_t rt_guest_start_ns; // kern_now_ns when the guest started (boot.c), 0 before
|
||||
typedef struct { uint64_t svcs, threads, host_calls; } RtStats;
|
||||
RtStats rt_stats(void); // host_calls: hostfn_calls()
|
||||
|
||||
|
||||
Reference in new issue
Block a user