OpenTPW

Classic Mac PowerPC evidence#

2026-10-09. Static metadata inspection only; the original program was not run. The Feral corpus is referred to below as $FERAL_BIN (the directory holding the extracted .data files, with libraries/ below it). Original .data, .bin, disk images, expanded sections and disassembly stay outside this repository.

Reproduce#

From the repository root, with Python 3 and no third-party packages:

python3 -m unittest discover -s tools/ppc-analysis -p 'test_*.py' -v
python3 tools/ppc-analysis/inventory.py $FERAL_BIN/*.data $FERAL_BIN/libraries/*.data
python3 tools/ppc-analysis/inventory.py --symbols UTimer $FERAL_BIN/*.data $FERAL_BIN/libraries/*.data
python3 tools/ppc-analysis/inventory.py --symbols LbTime_GetClock $FERAL_BIN/*.data $FERAL_BIN/libraries/*.data

The JSON inventory sorts input paths and keys and contains file identities, section sizes, entry vectors, imports, exports and symbolic relocation counts. --symbols adds case-insensitive name matches with demangled display names. Export offsets are offsets in the stated section; a tvector export is a transition vector, not the code entry address. Symbol names establish an interface, not its implementation or time unit.

Observed corpus#

All 16 containers parse successfully: 2,392 import records, 3,979 exports and 38,072 relocated words. Imports include repeated interfaces across containers; these counts are not distinct functions. All have three sections: code, pattern-initialised data and loader. The executable has no exported symbols.

ContainerImportsExportsRelocated words
SimThemePark716017,393
bullfrog_shared1805293,146
c_c++_shared2737503,593
engine_shared1421981,493
indirectx_shared8087602
libjpeg_shared31101846
ltms_shared41245851
macdoze_shared1541871,032
mail_shared4011151
more_files_shared132160475
online_shared64124591
runtime_shared557229
sams_utils_shared3364942,911
sound_shared919513,915
winsock_shared8659646
zlib_shared2126198

Selected SHA-256 identities:

Clock leads, not behavioral proof#

SimThemePark.data imports LbTime_GetClock__Fv from bullfrog shared and GetAbsolute__Q213SamsUtilities6UTimerFv and SetRate__Q213SamsUtilities6UTimerFRCQ213SamsUtilities13UMicrosecondsUc from sams utils shared. The matching exports are:

Demangled interfaceContainerSectionTransition-vector offset
LbTime_GetClock()bullfrog_shared17,444
SamsUtilities::UTimer::GetAbsolute()sams_utils_shared14,580
SamsUtilities::UTimer::GetAbsoluteCycles()sams_utils_shared14,588
SamsUtilities::UTimer::GetElapsed()sams_utils_shared14,596
SamsUtilities::UTimer::SetRate(const SamsUtilities::UMicroseconds&, unsigned char)sams_utils_shared14,564
SamsUtilities::UTimer::HasTicked()sams_utils_shared14,572

This narrows the timer investigation but does not connect those interfaces to the MD2/RSE animation frame advance or park calendar. No animation-clock or economy approximation is resolved by this inventory. ECON-001 and all other unverified rates/formulas retain their approximation status.

Reader validation and limits#

The reader expands all five supported pidata forms and zero-fills instantiated sections. Relocations are interpreted symbolically into section/import targets; no original machine instructions are executed. Tests use synthetic fixtures only, covering pidata encoding overhead, repeats/interleave, truncation, invalid sizes/strings, relocation failures, and deterministic inventory output.

Bounds checks reject truncated container/loader tables and section payloads, out-of-range import/section references, truncated relocation instructions and output exceeding declared sizes. Explicit limits are 64 MiB of total section size, 1,000,000 symbolic relocation steps, 32 recursive repeat levels and export hash power 20. These are toolkit resource limits, not claims about PEF format limits. Every current local corpus member fits within them.

The reader is a bounded analysis aid, not a complete PEF verifier. Successful parsing does not independently validate every relocation opcode's semantics, loader version compatibility, instantiated-section ordering, export hash keys or execution behavior. The existing analyze.py heuristic function/RTTI/TOC and value tracking remains exploratory; its pickle cache is outside the repository and must only be used with trusted local cache files. Inventory runs bypass that cache and do not use heuristic function discovery.

Next evidence needed: trace the animation/calendar caller paths to these timer interfaces and verify conversion constants against an original runtime capture.

Direct timer-call evidence (2026-10-09 follow-up)#

Run the dependency-free, identity-pinned operand verifier:

python3 tools/ppc-analysis/timer_evidence.py $FERAL_BIN
python3 -m unittest discover -s tools/ppc-analysis -p 'test_*.py' -v

It verifies the three SHA-256 identities listed above, resolves transition vectors and selected import relocations, and checks selected branch targets, register operands and constants. It outputs interpreted metadata only. The inspection never executes original instructions and bypasses the heuristic function-discovery/cache layer. A locally available disassembler was used to review the control flow, but is not a dependency of the checked-in verifier; no original disassembly or binary bytes are stored here. The checks are bounded witnesses for these exact binaries, not a general decompiler or formal proof.

ExportContainerTransition vector (section 1)Code entry (section 0)TOC offset (section 1)
LbTime_GetClock__Fvbullfrog_shared0x1d140x38bb80
GetAbsolute__Q213SamsUtilities6UTimerFvsams_utils_shared0x11e40xa4f80
SetRate__Q213SamsUtilities6UTimerFRCQ213SamsUtilities13UMicrosecondsUcsams_utils_shared0x11d40xa7380

Verified local fact: the low-level clock wrapper divides a 64-bit absolute timer result by 1,000 and returns the low 32 bits of the integer quotient. At bullfrog code 0x38bc8, the wrapper calls import glue 0x5ad60; its TOC slot 0x10 relocates to UTimer::GetAbsolute() from sams utils shared. The wrapper reads both result words, supplies the two-word denominator (0, 1000) and calls the local arithmetic helper at code 0x59d98 from 0x38be0. It then returns the low quotient register. Static review of helper range [0x59d98, 0x59e84) identifies unsigned long division: leading-zero normalization, repeated carry shifts and trial subtraction of the two-word denominator produce quotient bits; an input smaller than the divisor returns zero. Its SHA-256 is 9a130bd65ecb0edbca64d29fd90f712e96be72cd7089a05b7e64a2fe4af41d83. The helper's arithmetic meaning was reviewed manually; the verifier checks its identity and caller operands rather than executing or formally verifying it.

Verified conditional unit: the fallback route supplies microseconds. In sams GetAbsolute, code 0xa664 calls glue 0x1f6cc; TOC slot 0x2a0 relocates to Microseconds from InterfaceLib. That route reads the returned high/low words and copies them unchanged to the output at 0xa674–0xa678. Apple's Unsigned Wide Record documentation defines that API's result as microseconds since system startup, with high and low 32-bit fields. Consequently, when this fallback route is selected, the wrapper expression is floor(system_microseconds / 1000) modulo 2^32, a millisecond counter with a wrap period of about 49.71 days. The branch is conditional on earlier timer capability flags/pointers; no original runtime was observed selecting it. This is a clock representation, not a simulation rate, pause policy or deterministic update schedule.

Other GetAbsolute routes read hardware time or dynamically resolved timer services and apply conversions. Literal doubles in sams section 1 include 0x8c0 = 1000.0, 0x8d0 = 60.15, and 0x8d8 = 60000000.0. The latter two occur in initialization/calibration involving LMGetTicks (its import glue is code 0x1f714, TOC slot 0x1e4). Their literal values and local arithmetic use are established; they do not establish animation or park-calendar Hz. The selected dynamic route, calibration result and environmental accuracy remain runtime dependencies. Apple also documents the hardware-dependent relationship between Microseconds, UpTime and the native Time Manager in Technical Note TN1063.

Verified application initialization: one timer receives raw interval 100,000 and flag 1. In SimThemePark.data, code 0x310–0x334 constructs (2 << 16) - 0x7960 = 100000, stores high word zero and that low word in a stack record, and passes it to a timer object at offset 0x5c from the surrounding object's pointer. The call at 0x338 reaches import glue 0x1c4524; the executable's TOC base is 0x8000, and the relocated import slot is section 1 0x6f4. It imports the SetRate export above. That callee copies the interval words unchanged to object offsets 0x0c/0x10 and the flag byte to 0x08, without a scaling operation. The verifier establishes the interval and field-copy fact, but the surrounding object's role and consumer path have not been recovered. It would be unjustified to call this a 10 Hz gameplay/animation update merely because 100,000 microseconds is one tenth of a second.

Confidence: high for identities, transition-vector resolution, imports, operand values and field copies; high, conditional for the API-backed fallback millisecond interpretation; the division-helper semantics rely on manual static reasoning. No original execution/capture corroborates the selected timer route or application consumer.

No ADVISOR, RIDES or ECON timing approximation can yet be removed. Concrete dependencies remain:

The heuristic analyze.Analysis path hit a false-positive traceback-table candidate while examining bullfrog_shared; it attempted an out-of-range name read. The evidence above uses explicit exports and loader relocations instead. General heuristic function boundaries remain untrusted, as already noted in the reader limitations.

Game types and the Easy_/Online_ settings layers (2026-10-09)#

Static analysis of the same SimThemePark.data (SHA-256 04809cd4…e295f5, here the data fork of Theme Park Data/SimTheme Park from the Mac CD) with Ghidra 11.4.2 headless (PEF loader, default analysis). Addresses are Ghidra's, with the code section at 0x10000000; the TOC register r2 is 0x101F4AB0 at every function entry. Strings are reached through TOC slots holding a pool base plus an immediate offset; they were resolved with local scripts. Decompiler output, memory dumps and scripts stay outside the repository; below are descriptions in our own words.

Game type 2 is Instant Action#

Instant Action rules traced so far#

RuleFunctionObservation
Easy balance layers0x1010474C, 0x10119328<theme>/Easy_Standard.sam after the two Standard.sam files; each object's Easy_<file>.sam after the object file, both only when present
No loans0x10154AA0the "Available Loans" window (UITEXT 170) is only built when the type is not 2
No upgrades0x10165A0Cthe ride upgrade list is only filled when the type is not 2; type 2 shows UITEXT 27 "Upgrades are not available in Instant Action mode"
Research message0x10161910the research panel shows UITEXT 468 "Research is automatic in Instant Action mode." in type 2 (467 "hire some researchers" otherwise)
Completion message0x1013D708type 2 shows UITEXT 471 (finished Instant Action, try Full Simulation)
Easymode park0x10137600copied into a player's saves only for Instant Action players

Research needs researchers in every type: the research point sink 0x100F0DF0 has one caller, reached only from the per-researcher cycle 0x100F0284 with the researcher's grade ability (docs/reverse/PPC-review.md, section 57). The Instant Action seed ships a researcher; SAVE-I decodes its staff record and imports it (docs/reverse/SAVE-plan.md), so the former stand-in ECON-019 is gone. Not traced: what several type-2 branches in the finance, ticket-price and staff-training panels (0x10150C54, 0x1014EC48, 0x10168D8C) clear exactly.

Object settings layers#

The object loader (0x10119328) loads, per object: a base .sam named by its caller, then in the online type its Online_ variant; then the object's own .sam; then Online_<file>.sam (online type) or Easy_<file>.sam (type 2) when that file exists. Online settings replace Standard.sam (online_Standard.sam) but are layered on object files.

Applied in OpenTPW: the front end's game mode now selects the balance: Instant Action loads the Easy_ layers (missing files are skipped as in the original) and imports the Easymode park; Full Simulation loads neither. The loans/upgrades rules and the layer order cite these functions with [BIN:STP-PPC:…] labels. RIDES-009 keeps only the open question of where shared non-Info.Id .sam files sit in the object layer order.

User interface map#

UI-MAP.md describes 97 screens, their controls and 570 candidate rules, drafted by subagents from the 242 UI functions and checked mechanically against the cited functions (control ids, UITEXT indices, game-type tests). It is a lead list: only rules that are traced and reviewed may carry a [BIN:STP-PPC:…] label.

Golden keys#

The profile's key count (0x10128B60) is mExtraKeys plus the number of earned tickets divided by 3 (truncated). Earned tickets are the four global ticket flags, the per-theme tickets and the two secret-ticket flags; mSpentTickets is not subtracted, so buying mystery items does not cost keys. This confirms the manual's "one key for every third ticket" (REFERENCE-MANUAL.md). The starting value of mExtraKeys is not traced, so ECON-040 (one starting key) stays an approximation.

Advisor drawing in the Windows executable (2026-10-10)#

BIN:TPW-EXE labels cite the decrypted Windows Sim Theme Park World v2.0 tp.exe (SHA-256 5472f97b…1b805, docs/COMPLETION-PLAN.md), analysed statically in Ghidra. The Mac application links the advisor's light, not its mesh, into the scene manager and leaves the mesh draw path unresolved; the Windows build has the engine linked in, so the whole path can be followed:

So the advisor is placed in the screen space that follows Q, x right and y down. The scale k and the consumer of the transformed vertices are not traced; OpenTPW reads that space as −1..1 across the screen (ADVISOR-023), which puts the model in the bottom right at about a third of the screen height (docs/LIPS.md).

See also#

RIDE-WEAR.md: SAM schema records and slot layout, and the ride wear functions found with Ghidra in SimThemePark.data (ECON-023 evidence).

Source: docs/reverse/FINDINGS.md in the project repository.