PowerPC economy evidence#
2026-10-09. Economy lane; static inspection of the local Feral Mac PEFs. No original program was run. All addresses below are offsets in expanded section 0 unless explicitly marked as section 1/data. Raw binary sections, original assets and disassembly remain outside Git. Mac findings do not establish the behavior of the Windows patch-2 executable.
The highest-impact finding is that loans use an upfront power expression, not an amortizing annuity. Calendar time, researcher contributions and wear also advance on different schedules. The current daily economy aggregation cannot preserve these independently scheduled operations.
Reproduction and identity#
python3 tools/ppc-analysis/lanes/economy/evidence.py /Users/sander/server/game-assets/mac-feral/bin --sam /Users/sander/server/game-assets/theme-park-world-patch2/Data/levels/Standard.sam --language /Users/sander/server/game-assets/theme-park-world/Data/Language/English
python3 tools/ppc-analysis/lanes/economy/save_bridge_evidence.py /Users/sander/server/game-assets/theme-park-world/Data/levels/jungle/Easymode.TPWI
python3 -m unittest discover -s tools/ppc-analysis/lanes/economy -p 'test_*.py' -v
python3 -m unittest discover -s tools/ppc-analysis -p 'test_*.py' -v
The verifier uses the validated pef.py loader and timer witness helpers. It checks file identities, 54 application and two macdoze function-region hashes, selected operands, branch targets, constants and import relocations. Output is interpreted metadata. These are bounded static witnesses, not formal decompilation proofs. Tests contain synthetic fixtures and independently written arithmetic examples; they never execute original instructions.
| Input | SHA-256 |
|---|---|
SimThemePark.data | 04809cd4ccee5433c7fb0b7c93d32f6a7aa629c1849181c0b7906415e5e295f5 |
bullfrog_shared.data | b67b56b7b2b75962b8b34559e20fd97b623b2d0f7f08a0035f82072ffbf4ec06 |
macdoze_shared.data | ba11331a70bce77140ae6e7fe73145fe4e13cce5f042707a494cb77654b32f0d |
PC baseline and patch-2 global Standard.sam (identical) | 3d39433641df70dba73e6ce0f4ae576a5a334ed93e61adc1cdd570b751a8bf4b |
PC jungle Easy_Standard.sam | 855ca41c493cb91ea41b2ac2d673e6b0163e4ac9b8e8e4ecfa159c310dfbcea0 |
analyze.py encountered an out-of-bounds false-positive traceback candidate, as already documented in FINDINGS.md. Exploratory indexing used a temporary copy with traceback discovery disabled. No shared reader was modified. Function labels generated by heuristics were not used as behavioral proof: the findings below come from serialization operands, actual calls, relocations and inspected arithmetic. Region hashes are reproduced by the lane verifier so the exploratory cache is unnecessary for verification.
Loans: ECON-006, ECON-007 and ECON-039#
The constructor at 0xcb7a8 fills eight 32-byte loan records. Serialization at 0xcba54 couples each field address with an actual debug/save label:
| Offset relative to bank object + 32 × loan index | Meaning | Serializer operand |
|---|---|---|
+20 | available flag | 0xcbbb4 |
+24 | principal offered | 0xcbbd8 |
+28 | APR in percent | 0xcbbfc |
+32 | term in months | 0xcbc20 |
+36 | monthly repayment | 0xcbc44 |
+40 | loan bought | 0xcbc68 |
+44 | months repaid | 0xcbc8c |
+48 | lender name index | 0xcbcb0 |
Thus the constructor arithmetic is connected to field meanings, not merely to an attractive function name. It reads amount/APR/term from the global balance payload at +416/+420/+424, advancing that source by 16 bytes per offer, and stores those values at the labeled loan offsets.
With principal P, percentage APR A, and term N, the expression is:
M = trunc_u32(P × pow(1 + A/100, (N/12) × 0.5) / N).
The constants are doubles at data 0x5428 = 100, 0x5420 = 12, 0x5418 = 1, 0x5410 = 0.5. At 0xcb8bc–0xcb8c8 the constructor forms the exponent and base; 0xcb8cc calls C-library pow through glue 0x1c61a4. It multiplies the result by P at 0xcb8e4, divides by N at 0xcb8e8, calls conversion helper 0x1c3fbc at 0xcb8ec, and stores M at 0xcb8f4. The conversion helper truncates positive finite values toward zero, returning zero below zero and saturating at the unsigned 32-bit upper bound. Ordinary SAM loan inputs are far from those bounds.
Derived examples using the actual PC SAM inputs, in offer order:
| Principal | APR | Months | Mac expression monthly | Total installments |
|---|---|---|---|---|
| 100000 | 20 | 36 | 3651 | 131436 |
| 50000 | 20 | 36 | 1825 | 65700 |
| 25000 | 20 | 36 | 912 | 32832 |
| 10000 | 20 | 36 | 365 | 13140 |
| 18000 | 23 | 24 | 922 | 22128 |
| 30000 | 22 | 30 | 1282 | 38460 |
| 80000 | 18 | 48 | 2320 | 111360 |
| 65000 | 21 | 30 | 2749 | 82470 |
These are mathematical examples, not observed original UI values. At zero APR the same expression is floor(P/N), agreeing with the existing easy-save evidence. PC input-file equality does not prove PC arithmetic equality.
The month handler at 0xcc21c subtracts the same stored M from bank balance for each bought loan (0xcc2d0–0xcc2e4) and increments months repaid. It clears bought and months-repaid flags when the count equals N (0xcc394–0xcc3bc). It does not maintain a declining principal balance or compute monthly APR interest. Message dispatch at 0xcc120 routes message type 12 to this handler; the calendar creates that message through 0x1164a4.
Early payoff at 0xccc78 computes M × (N - months_repaid) at 0xcccc4–0xcccd8, checks affordability, subtracts that full outstanding installment total, and clears bought/months-repaid. Applying at 0xcc904 rejects an already bought loan, then adds the principal and sets bought. There is no permanent spent-offer flag. Availability still depends on 0xcc6d0 / 0xcc9e8, which compare a capacity statistic against outstanding installments; repaid offers are not necessarily always selectable.
mProfitThisYear is explicitly bound to bank +292 by serializer 0xcbb84. Loan acquisition adds principal to the bank/deposit accumulator but cancels it out of this yearly profit field (0xcc9b4–0xcc9cc). Each monthly payment reduces yearly profit by floor((M×N - P)/N), via 0xcc370–0xcc390. Message type 13 resets this field to zero at 0xcc1e4–0xcc1e8: this is a calendar-year accumulator, not the last twelve closed months. The early payoff profit adjustment is especially sensitive: it clears months repaid before the subsequent profit calculation reads that field. Preserve that ordering if a Mac behavior mode is implemented; do not silently reinterpret it as conventional amortization.
Confidence: high for Mac arithmetic and field identities. Removing PC approximation tags still requires executable/capture evidence for that target.
Calendar: ECON-001..004#
Constructor 0xe3c90 stores 15000 at calendar +28; serializer 0xe3d30 names that field mFunnySecsPerRealSec, and labels the timestamp at +0 mFunnyTimeStart. The initializer 0xe4348 passes 2000, 1, 1, 0, 0, 0, 0 to TbTimeStamp::SetTime.
Conversion 0xe4394 loads the turn counter at game +0x1da70c after calling 0x10a9a4. It forms the full unsigned 64-bit product of turn and calendar +28, divides by four through helper 0x1c4100, multiplies the quotient by 10,000,000, then adds that time difference to the epoch timestamp. Therefore:
timestamp = epoch + floor(uint64(turn × 15000)/4) × 10000000.
The four-byte turn is not a 60 Hz OpenTPW tick. The separate clock lane has traced its sole update writer and nominal 248 ms scheduling; consult that lane's witness for pause, catch-up and speed controls. This document proves the date consumer's conversion, not runtime wall-clock stability. For normal construction, one turn adds 3750 simulated seconds. A day requires 23.04 turns mathematically; actual date transitions occur at integer turn samples.
Actual import resolution: app glue 0x1c5e2c imports the setter; bullfrog transition vector data 0x186c resolves it to code 0x1bb50. Its call at 0x1bb94 reaches macdoze SystemTimeToFileTime. Getter vector data 0x1864 resolves to 0x1bbfc, calling FileTimeToSystemTime at 0x1bc70. The app extracts date components through this timestamp API, rather than dividing into fixed 30-day months. The phase-two section follows these imports through macdoze to the actual legacy OS conversion calls and states the environment boundary for civil/leap-calendar interpretation.
Calendar update 0xe3f0c compares extracted day/month with its saved previous values, emits day/month events on changes, and stores the new values. (Executed in the PowerPC oracle, ORACLE.md F30: the day of the month, the 0-based month and the year are compared with the fields at +20, +16 and +24, the messages come day, month, year, the constructor stores day -1, month 0 and year 0, so a new calendar's first update posts a day and a year message, and the conversion 0xe4394 agrees with 2000-01-01 + floor(turn × rate / 4) s.) Year changes generate the separately constructed year event. Initial date arguments are directly established; month/hour extraction is traced below. Runtime calendar environment and Windows equivalence require their own evidence.
Staff, research and maintenance#
Wages, ECON-043. 0xf46bc maps staff role byte +2 into the five role indices and loads grade +484. At 0xf4744–0xf4760 it multiplies global balance +832 + 4×role by +748 + 16×grade. The parallel candidate wage getter 0xf477c uses the same product. Embedded SAM descriptors name BaseWage at data 0x36574 and PayMultiplier at 0x366dc; their runtime schema offsets are verified by the descriptor initializer below. The actual PC SAM values yield monthly grade-0 wages 40/120/60/80/140. Staff event handler 0xf2b5c routes type 12 to debit routine 0xf3364, which calls this wage getter and bank withdrawal. Thus monthly debit cadence and multiplication are independently established. Training manager also routes month type 12 through 0xf7a64 → 0xf7e18 → 0xfc1c4.
Training, ECON-008/013. At 0xfc1c4 the manager counts workers per role, integer-divides each role budget by that count, and calls 0xf3588 once per worker. That routine charges the allotted money, divides it by the grade's training-price field, caps the resulting increment at 100, and adds it to percentage byte +488. Crossing 99 increments grade and subtracts 100 from the accumulated percentage. Grade 4 rejects training. The full allotted money is charged before integer point truncation; leftover money is not automatically refunded. Role-budget division truncation can leave part of the total budget unspent. Newly promoted staff have field +500 restored to 100.
Skill, ECON-037. Function 0xf41dc directly computes trunc_u32(20 × (grade + percentage/100)), using data double 0x5618 = 100 and float 0x5620 = 20. It is called by staff panel builders 0x14adf0, 0x14aff4, and 0x16d91c. This contradicts the prototype's grade × 25 + percentage/4; grade 4 at zero progress returns 80.
Mood/strike, ECON-014. Initialization 0xf29fc stores 100 at +500/+504. The strike/rest routine 0xf4900 has a real transition to strike with actual navigation to the bus stop, and calls the staff-manager strike test. Initial 100 is proven, permanent happiness is contradicted. Complete mood deltas remain in 0xf445c–0xf46bc, 0xf3d8c, and 0xf4900.
Research, ECON-015..018. Researcher update 0xf0284 skips broad states 3/4/5, computes turn modulo 20 at 0xf02b4–0xf02d8, and calls contribution 0xf0728 only at remainder zero. The contribution loads one grade-dependent integer from balance +1052 + 12×grade and passes it to lab 0xf0df0. The descriptor at data 0x36b50 identifies the ResearchAbility lead; the schema mapping is now directly established. It is not called once per calendar day. The broad-state exclusion and workload also matter: this is not an unconditional hired-headcount sum.
For each active, unfinished category project, the lab adds single-precision points equal to ability × category_effort / sum_active_efforts × workload/100. The sum routine is 0xf1238; the calculation is 0xf0e50–0xf0ec0; 0xf2328 adds points to project progress and completion predicate 0xf2494 is progress >= cost. Category effort and workload setters clamp at 100.
Group updater 0xf15b4 counts projects of the same category whose group is less than current_highest_group + 1, and compares integer percent completed with threshold ResearchTech[current_highest_group + 1]. It may repeatedly advance through groups up to 7. Thus it tests cumulative completion through the current group, not only the preceding group's completion. Descriptor PercentageForThisTech is at data 0x373c0; arithmetic/counting at 0xf1618–0xf168c is direct.
Project selection 0xf0ef0 and reverse selector 0xf1088 scan list order with category, group and completion checks. There is no cheapest-cost comparison in these selectors. Project-list creation 0xf0be4 iterates the catalogue; cost comparisons there identify a most-expensive project for UI rate normalization, not a sort. Exact catalogue iteration order and which selector drives each user action remain necessary before replacing all ordering rules. Category 4 has parent-ride/build-availability predicates at 0xf0f54–0xf0fe4; constructors 0xf2178/0xf2224 are the next dependency for upgrade/add-on category membership.
Wear/repair, ECON-021..024. Ride update 0xe077c enters every eight turns for an operating object; it calls wear 0xdec2c. Wear additionally gates on turn modulo 64, nonzero upgrade wear field, a mode predicate and open/flag conditions. It subtracts derived amount D from float object +64 and 0.02×D from float +68, independently clamped to [0,100]. D comes from operating speed/capacity parameters and upgrade fields through 0xde904; simply subtracting raw WearRate each day is contradicted. The runtime equation is recovered below using the established schema offsets and actual speed getter/setter path.
Full repair completion 0xdef2c writes 100 only to +64 (0xdef78–0xdef88) and clears maintenance flags/assignment. It does not restore +68 there. Breakdown path 0xe077c tests the truncated values of both fields; zero remaining-life value reduces +68 by five on the relevant transition and requests breakdown. This corroborates the manual's separate wear/lifetime and reliability warnings without identifying every display label.
(Executed since, ORACLE.md F19: the timer formulas below are confirmed on the routine itself; the DurationOfUpgrade word is Upgrades[level + 1].) Mechanic arrival 0xd9c0c computes upgrade duration as grade work field × DurationOfUpgrade (0xd9d48–0xd9d74), or ordinary repair countdown as floor(work_field × (100 - trunc(repair_state))/100) (0xd9d7c–0xd9dc0). The latter uses integer division by 100. Repair-state handler 0xd9e04 decrements countdown once per call and, at zero, also waits for the object's fix animation predicate before calling full repair. Movement/arrival is a real dependency; instant dispatch and game-hour units are not supported. Cleaner state 0xd60c8 waits until turn > cleaning_start_turn + grade_work_field, then removes litter from its actual assigned map cell via 0xd8950. Park-wide minute-based cleaning is contradicted; toilet cleaning has separate paths 0xd6230/0xd6350.
Guest money and park statistics#
Guest charge 0xeaa80 calls price getter 0xe1f70 (object +400), sends that amount to object receipt 0xe1b60, and subtracts exactly it from guest cash +416. Receipt deposits the same amount into the bank at 0xe1b8c and records object takings/history. Goods cost routine 0xe1e58 increments object costs and withdraws from the bank. Guest completed-use routine 0xeaaf8 invokes those goods-cost calls for category selectors 1 and 2. For selector 2 it also gives the goods-cost amount to guest cash. This needs sideshow-winning/cash-prize semantics traced before treating the effect as a universally paid prize.
Goods getters use the current object cost field +388; shop cost 0xe2094 derives it from current quality/special-ingredient state. Thus InitCostOfGoods is not sufficient as a constant transaction cost. Admission receipt 0xcc568 adds the entrance fee to bank, annual profit and the admission accumulator. All monetary branches must eventually be connected to their original event timing and affordability checks.
The analyzer composite at 0xc7b24 was inspected through its real monthly history caller 0xc163c → 0xc17b8. It combines a capped visitor component, counts of rides/shops/sideshows/features and upgraded rides, and five capped staff-role counts. It does not read the happiness/cleanliness formula used by OpenTPW. Its result is written to analyzer history at +0x213b0. Its mapping to the annual-summary park-rating UI is now established by the control/text/history chain below. Category counters are 0xc5864, staff counters 0xc4064 and current visitors 0xc3684.
Scrap, ECON-025. The actual object deletion/sale path 0xdbfa8 calls 0xe25e8 at 0xdc05c and deposits the result at 0xdc070. This getter multiplies the base catalogue cost at catalogue +440, without summing upgrade costs, by the percentage returned by 0xe2424, then integer-divides by 100. The percentage function uses elapsed timestamp since object +20; its year divisor is exactly 365 days and its initial-period divisor is exactly 30 days. It selects the current upgrade's percentage fields at catalogue +392/+396/+400/+404 + 64×upgrade for age-year buckets 0/1/2/other. An unused object (+412 == 0) in the first 30 days may return 100 when the catalogue's first percentage field is positive. Otherwise it uses the age bucket's percentage. This is a separate quote from analyzer park valuation, which sums costs through the current upgrade and includes weighted map infrastructure. The initial-period predicate and elapsed-day divisors should be retained in any Mac-backed implementation. This getter is executed in the oracle (target object-scrap-value, ORACLE.md F21) and ParkEconomy.ScrapValue follows it.
Approximation disposition and next addresses#
Every ECON ID is listed to make the scope boundary explicit. A proven Mac fact does not authorize silently removing a Windows approximation tag.
| ID | Direct fact or concrete next dependency |
|---|---|
| 001 | Date consumer 0xe4394: floor(turn × 15000 / 4) seconds; turn scheduling belongs to clock lane. |
| 002 | Macdoze conversion delegates to Apple long-date APIs; Gregorian is the documented default, with current script-system dependency. |
| 003 | SYSTEMTIME hour comes directly from LongDateRec hour (0..23); complete copy chain below. |
| 004 | Clock lane owns UI speed factor and active-loop scheduling; economy uses turn field +0x1da70c. |
| 005 | Receipt/cost 0xe1b60/0xe1e58; loan deposit 0xcc904 updates same deposit accumulator as normal deposit, annual profit cancels principal. Financial UI row meanings still required. |
| 006 | Proven power formula, fixed installments, payoff outstanding installment total. |
| 007 | Paid loan bought flag clears; retaking possible if capacity availability 0xcc6d0/0xcc9e8 allows it. |
| 008 | Proven 100 training points per promotion, cap and money truncation 0xf3588. |
| 009 | Ordinary generator 0xf5b64 uses average + random modulo 3 - 1, then byte conversion/clamp; great-candidate path next 0xf732c. |
| 010 | Candidate timeout generator 0xf5db8 uses base timeout + random modulo floor(base/2); update units next 0xf6178, 0xf732c, timestamp helper 0x121098. |
| 011 | Pool fill logic next 0xf732c; finite pool has 32 entries 0xf5e48. No probability claimed. |
| 012 | Hiring candidate path 0xf61d0 and UI command constructor 0x6bfa0; the complete hire path (command executor 0x6c034, completion 0x6c1f4, thing factory 0xb882c, staff constructors) has no debit, the staff charges are the monthly wage 0xf3364 and the dismissal 0xf33ec (executed, ORACLE.md F28). |
| 013 | Equal role budget division followed by per-worker training is proven on month type 12. |
| 014 | Initial 100 and actual strike/rest states proven; mood update 0xf445c–0xf46bc, strike 0xf4900. |
| 015 | Contribution every 20 turns with state filters and workload-weighted active effort split. |
| 016 | Cumulative category completion through current group, threshold 0xf15b4. |
| 017 | List-order selectors 0xf0ef0/0xf1088; catalogue iteration order 0xf0be4 → 0x117fcc/0x117fe4 next. |
| 018 | Category-4 predicates and constructors 0xf2178/0xf2224 next; category membership not fully established. |
| 019 | Manual requires actual scientist; mode initializer 0x1044c8 / researcher allocation 0xf2980 and lab setup 0xf0854 next. |
| 020 | Actual guest-use litter event is inside 0xeaaf8; exact LitterEffect mapping and probability/count next. |
| 021 | Arrival, health-scaled repair countdown, upgrade product and animation completion proven. |
| 022 | Assigned-cell cleaning by turn deadline proven 0xd60c8; toilet jobs separate. |
| 023 | 64-turn inner wear gate, derived decrement and separate 2% life decrement proven; full runtime equation below. |
| 024 | Full repair writes 100 at +64, not +68, proven. |
| 025 | Proven sale 0xdbfa8 → 0xe25e8 → 0xe2424: base cost only × age/upgrade percentage, initial unused-refund branch. |
| 026 | Analyzer valuation includes infrastructure in addition to placed objects; 0xc1d4c rather than sum of scrap values alone (executed in the oracle, ORACLE.md F29: cell points plus the object costs times the state of repair, no scrap values). |
| 027 | Composite 0xc7b24 writes history +0x213b0, read by annual-summary value44450 aligned with UITEXT190 Park rating. Exact count formula below. |
| 028 | Actual bank withdrawal allows negative balances 0xcbfdc; build affordability belongs to callers 0x859b4, 0x8ba34 and object purchase 0xda874. |
| 029 | Manual explicitly supports ticket spending; ticket controller 0xd31d0 and purchase 0xda874 next. |
| 030 | Bank month handler after six elapsed 30-day periods in red emits game-over event 0xcc3d0–0xcc4b0; UI/game state consumer 0x1059e0 next for stop behavior. |
| 031 | Bank/game-load serializer 0x106708; park open flag is analyzer/entrance state, not proven from easy-save locator. |
| 032 | OpenTPW prototype-only shortcut; original allocation/purchase 0xda874 next. |
| 033 | Ticket controller update 0xd31d0, event registration/message dispatch; cadence not yet connected. |
| 034 | Challenge dispatcher 0xcf898 and update values 0xcf700; concrete targets from SAM need predicate mapping. |
| 035 | Offer 0xcfff0, follow-up 0xd0190, win 0xd083c, lose 0xd0b24. |
| 036 | Challenge predicate/update 0xcf898/0xcf700; upgrade-state fields +76 are proven but specific type 28 condition remains open. |
| 037 | Staff panel skill getter uses 20 × (grade + percentage/100), not grade×25. |
| 038 | Global ticket controller 0xd3b98, analyzer land/camera counters; thresholds need direct branch mapping. |
| 039 | Named annual profit field resets on calendar-year event; loan interest-only profit adjustments proven. |
| 040 | Manual three tickets per key correction retained; key progression 0xd3900/0xd3b98/0xd406c; initial key count remains unknown. |
| 041 | Research category and buildability predicates 0xf0be4/0xf0ef0, menu catalog function 0x117fcc; no directory-based conclusion claimed. |
| 042 | Dynamic goods cost 0xe2094; category-2 cash/prize effects 0xeaaf8 need completed-use/win-path proof. |
| 043 | Wage product and monthly debit proven. |
| 044 | Actual balloon/costume use paths 0xeaaf8/0xef700 contradict permanent-zero item state; guests lane owns implementation. |
| 045 | Loan serialization field order proven at 0xcba54; file framing/second fixture still required for general save locating. |
| 046 | Upgrade purchase/availability 0xdf928; follow its real menu callers and count predicate for mechanic requirement. Tag remains. |
Descriptor-to-runtime proof (phase two)#
The scoped naming dependency is now closed. CMainBalance virtual descriptor getter 0x19950 multiplies index by 60 and loads a relocated pointer to data 0x34d10; its payload getter 0x19960 returns balance object +8. Shared initializer 0x16f4c starts a slot cursor at 1 (0x16f90). Each scalar descriptor creates a lookup entry at payload + 4×cursor, then increments the cursor. Array delimiters store child stride/count and reserve a trailing count word: closing an array advances the cursor by (capacity - 1)×stride + 1. Each lookup record contains destination pointer, element stride in words and optional count pointer. Integer SAM load 0x18c54 computes destination + index×stride×4 at 0x1961c–0x19634, then passes it to integer store 0x182a0, which writes the checked parsed value at 0x18354. Names are thus connected to the actual stored operands.
Ride getter 0x119fe8 resolves to data 0x39b64; payload getter 0x119ff8 also returns object +8. The catalogue loader embeds that balance object at catalogue +4 (0x1194a0/0x1194a4), so catalogue consumers see another four-byte shift. Omitting it would mislabel WearRate as QueueWaitTimeConstant and shift all scrap fields.
| SAM path | Descriptor index | Runtime byte offset | Array stride/capacity |
|---|---|---|---|
LoanInfo[].LoanAmount | 50 | balance +416 | 16 / 10 |
LoanInfo[].APRInPercent | 51 | balance +420 | 16 / 10 |
LoanInfo[].RepaymentPeriodInMonths | 52 | balance +424 | 16 / 10 |
PerGradeStaffConsts[].BaseWage | 104 | balance +748 | 16 / 5 |
PerTypeStaffConsts[].PayMultiplier | 110 | balance +832 | 4 / 5 |
HandymanConstsPerGrade[].WorkDuration | 119 | balance +940 | 12 / 5 |
MechanicConstsPerGrade[].WorkDuration | 124 | balance +1004 | 8 / 5 |
ResearcherConstsPerGrade[].ResearchAbility | 129 | balance +1052 | 12 / 5 |
ResearchTech[].PercentageForThisTech | 165 | balance +1276 | 4 / 10 |
Upgrades[].ScrapValueYear1..4 | 103..106 | catalogue +392/+396/+400/+404 | 64 / 3 |
UsageInfo.MaxCapacity / MaxSpeed | 75 / 79 | catalogue +296 / +312 | scalar |
Upgrades[].RedLineCapacity / RedLineSpeed | 108 / 112 | catalogue +412 / +428 | 64 / 3 |
Upgrades[].WearRate | 113 | catalogue +432 | 64 / 3 |
Upgrades[].CostOfUpgrade | 115 | catalogue +440 | 64 / 3 |
Upgrades[].DurationOfUpgrade | 116 | catalogue +444 | 64 / 3 |
Loan schema capacity is ten; the constructor uses only eight. Descriptor region identities: main data [0x34d10,0x38fa0) hashes to 775aaa73be12c71658d7b26147807416cd4415ef54fabf5bfd57c10ba69f70c8; ride data [0x39b64,0x3ba54) hashes to eb137c713ebb51bede258b87c9aa759f7a42f25530c8b7fd137474a83ef5ae0f. The bounded schema.py helper interprets metadata and rejects unmatched scopes, nested arrays, invalid counts, unsupported tags and out-of-bounds records. Synthetic tests check embedding, strides and count-word reservation.
APR's kind-6 descriptor has inclusive integer bounds 0 and 100; integer store 0x182a0 enforces them. Amount and term are kind 5: negative parsed values are rejected, zero accepted. There is no constructor guard before floating division by term. The ordinary formula therefore assumes positive terms; zero-term/NaN behavior is outside the proven ordinary rule. The arithmetic-example helper rejects zero terms independently.
Monthly profit bookkeeping uses unsigned 32-bit (M×N - P)/N. This matters even with plausible zero-APR inputs: P=100000,N=36,M=2777 makes the subtraction wrap to 4,294,967,268 and yields 119,304,646 as the amount treated as monthly interest in that adjustment. This is a static consequence of the operands and unsigned division, not a captured bug. Whether that configuration is reachable requires mode/loan-availability evidence; the manual forbids Instant Action loans. Do not silently normalize it to zero interest while claiming the Mac arithmetic is preserved.
Actual park-rating formula and UI (phase two)#
The UI lane traced annual-summary builder 0x16eeb0 and the embedded layout at data 0x4f81c. Current value control 44450 and label control 44451 occupy the same row; last-year value 44461 occupies the last-year column. At 0x16f078, the builder looks up label 44451; 0x16f0c4/0x16f0c8 passes string index 190 to UITEXT accessor 0x138504. It reads current analyzer history +0x213b0 at 0x16f3a8 and assigns it to control 44450. At 0x16f450 it reads that history twelve periods earlier for 44461. Title index 186, column indices 188/187 and row 190 independently decode from the actual English BFST/BFMU corpus as “End Of Year Summary”, “This Year”, “Last Year” and “Park rating”. This proves the statistic's role.
English table identities: UITEXT 3fe8b89c994bdd177b7226a51f24222621cc7e27beee94668942dc1f821137cf; BFMU 69f23492ef61a27ed79dd4df67978536720d403f7e2733acb6b43e6f4f78c587. --language reproduces only these five selected label records using the repository's documented BFST/BFMU interpretation, without exporting assets. Mac code/layout binding and PC English label cross-check are distinct from a captured original screen or proof of Windows executable arithmetic.
Let V be visitors currently in the park, R/S/A/F the eligible placed ride/shop/sideshow/feature counts, U rides at upgrade level >=2, and H/M/E/G/Q the eligible handyman/mechanic/entertainer/guard/researcher counts. For stable eligible counts without low-word multiplication overflow, the integer park rating at 0xc7b24 is:
floor(min(V,1000)/50) + min(floor(3R/2),20) + min(2S,10) + min(2A,10)
+ min(F,10) + min(U,10) + min(H,4)+min(M,4)+min(E,4)+min(G,4)+min(Q,4).
The maximum on that domain is 100. Arithmetic witnesses are visitor scaling 0xc7bec–0xc7c24, ride scaling 0xc7cdc–0xc7d10, category components 0xc7dc4–0xc8074, staff components 0xc817c–0xc8624, and final sum 0xc8628–0xc864c. Counters use object/actor categories and subtype filters: rides use a minimum upgrade-level bound of zero, upgraded rides require >=2, and staff loops count subtype zero. Preserve those eligibility predicates, rather than counting every allocation or candidate. There is no direct happiness or cleanliness component. Monthly history writer 0xc163c calls this function at 0xc17b8; serialization at 0xc0778/0xc0f3c serializes the same history without an explicit statistic name. UI binding, rather than a guessed serializer label, supplies the semantic identification.
Complete runtime wear equation (phase two)#
For the normal runtime call 0xded80 → 0xde904, let S be current speed from special getter 0xb5b40, and let C be script variable 5 clipped to [0,UsageInfo.MaxCapacity]. The speed setter 0xdc5c4 calls 0xb5af0 and prints its actual speed label; setter and getter access the same signed halfword at script-controller +192. The rides lane identifies variable 5 as VAR_ONRIDE in actual script tables; interpreting it as seating capacity alone would omit the current-load dependence.
Define x = 0.9 × S / UsageInfo.MaxSpeed and y = 0.9 × C / UsageInfo.MaxCapacity. Then:
a = 0.1 + x if S < Upgrades[level].RedLineSpeed, otherwise a = 0.5 × (1.1 + x).
b = 0.1 + y if C/10 < Upgrades[level].RedLineCapacity, otherwise b = 0.5 × (1.1 + y).
D = 0.5 × (a + b) × Upgrades[level].WearRate.
The C/10 comparison is direct arithmetic at 0xdeb3c–0xdeb5c; do not replace it with a conventional occupancy percentage. These are ordered single-precision operations (constants round to binary float), with speed branch 0xdea20–0xdea58, load ratio 0xdeabc–0xdeaf8, load branch 0xdeb58–0xdeb78, and combination 0xdeb90–0xdebc8. The caller skips decrement when script variable 5 is zero (0xdecf0–0xded00) and still requires the 64-turn and open/flag gates previously identified. Positive MaxSpeed/MaxCapacity are ordinary catalogue prerequisites; zero denominators are not guarded in this equation. The separate preview caller 0xdebf0 sets a flag that changes load-ratio sourcing; this runtime equation should not be reused as that preview's exact behavior.
Calendar conversion and annual-profit caller chain (phase two)#
Macdoze export resolution closes the previous API boundary: FileTimeToSystemTime vector data 0x7a4 resolves to code 0x4180; SystemTimeToFileTime vector data 0x79c resolves to 0x4270. The former calls actual InterfaceLib import LongSecondsToDate at 0x4210 through glue 0xa938; the latter calls LongDateToSeconds at 0x42c4 through 0xa920. It scales between integer seconds and 10,000,000 units per second, adding/subtracting the epoch offset 95,616,288,000,000,000. This confirms the time-difference units used by the application's calendar.
| LongDateRec offset | SYSTEMTIME offset | TbTimeStamp GetTime argument |
|---|---|---|
| +2 year | +0 | first output pointer |
| +4 month | +2 | second |
| +6 day | +6 | third |
| +14 weekday | +4 | fourth |
| +8 hour | +8 | fifth |
| +10 minute | +10 | sixth |
| +12 second | +12 | seventh |
Macdoze copies these fields at 0x4218–0x4250; bullfrog forwards them at 0x1bc88–0x1bd04. It sets SYSTEMTIME milliseconds to zero. Apple's LongDateRec reference defines the corresponding month/day/hour ranges and leap-day conversion; the hour is maintained as 0..23. Apple documents Gregorian as the default calendar and 86,400-second days, while conversion routines depend on the current script system. Thus default Gregorian month lengths/leap handling are API-supported evidence, conditional on that environment; there is no local hardcoded 30-day calendar. Apple conversion documentation
The setter fills the year-through-weekday fields of a stack LongDateRec; it does not explicitly initialize the era/reserved fields before the OS call. No original execution establishes their contents or selected script system. These remain precise environmental dependencies, rather than grounds to assert every historical/alternate-calendar edge is proven.
Nominal scheduling is the independent clock lane's eight 31-ms substeps per turn. Combining that witness with calendar conversion gives nominal 3750 simulated seconds per 248-ms turn, approximately 5.71392 real seconds per simulated day at unit speed. Date transitions occur at sampled turns; catch-up, speed factor, pause and dropped debt remain clock-lane rules.
Day constructor 0x116488 installs the day vtable whose type getter 0xe4808 returns 11; month constructor 0x1164a4 installs type getter 0xe4800 returning 12; year constructor 0x1164c0 uses 0xe47f8 returning
These correct the phase-one month-constructor reference. Calendar day change calls the first at
0xe3fb0, month change calls the second at0xe4088, and extracted year change calls the third at0xe4148. Each is posted through0x11688c. The bank registers for type 13 at0xcb9f4–0xcba00; dispatcher0xfab68reaches the bank handler0xcc120through0xfac04; its type-13 branch clears namedmProfitThisYearat0xcc1e4–0xcc1e8. The reset therefore follows actual calendar-year change, not a twelve-month rolling-window statistic.
Recommended implementation follow-up#
First add an explicit source/platform distinction before changing behavior that only the Mac executable proves. In a Mac-backed rule set, replace annuity principal amortization with fixed M, store months repaid, and quote early payoff as remaining installments. Keep annual profit bookkeeping separate from bank balance and loans received. Add tests for all eight SAM offers and repayment completion/retake/early-payoff ordering.
Replace the prototype skill calculation and preserve the proven training money/point truncation. Use the independently proved turn schedule to drive calendar, research and wear separately; do not convert all of them to day-end operations. Preserve distinct repair/life fields, health-scaled repair duration, assigned-cell cleaner jobs, state-filtered research and workload distribution. Replace the rating approximation only in a rule set with an explicit source/platform distinction, preserving the proved count filters. Exact research order, preview wear behavior, initial keys and Windows equivalence remain explicit evidence dependencies.
The manual supports monthly wages, real scientists, staff rest/strikes, preventive maintenance and three tickets per key. It does not prove the quantitative formulas above. startingkey1 remains unknown; no claim in this lane restores the superseded four-ticket earning interval.
Reviewed PC save-reader correction (phase three)#
The independent review confirmed the serializer's seven bank words and eight-word loans against the actual PC Easymode.TPWI fixture. Its file SHA-256 is 6d89303d098900364bf5e80b236b64bd85976fb947e9e4609d088547f430b39a. Decoded payload bank offset is 1,411,362; loans start at 1,411,390. The previous reader started four bytes late, read amount/APR together as i64, required lender to equal record order and included the following available flag as an opaque trailing word.
SaveEconomyRecords now exposes SaveBankRecord and all eight loan fields. Loan Index is the inferred ordinal, independent of LenderNameIndex. Import cross-checks the saved APR and lender as well as amount, term and repayment against settings. It reports the decoded bank values and preserves the existing initial-cash/no-active-loan simulation behavior. This correction does not port the Mac loan arithmetic into the PC runtime. Locator bounds remain explicitly heuristic under ECON-045; no new variant format is claimed.
Tests were added before implementation and reproduced failures with positive APR, reordered lenders and invalid flags. The final focused run passes 14 tests, including typed fields of the actual PC fixture, bank-prefix and loan truncation boundaries, independent-table ambiguity and APR/lender settings mismatch. The broader run with the installed PC corpus passes 761 tests, fails none and skips 54 optional language/MTR/bonus/native gates (815 total). Build/type checking succeeds; pre-existing compiler/package warnings remain. Formatting verification exposes the existing tracked-LF/editorconfig-CRLF conflict; files retain the tracked LF convention to avoid whole-file churn.
Standalone reviewed loan-operation model#
tools/ppc-analysis/lanes/economy/OriginalLoanRules.cs is an independently written C# model of the reviewed loan operands. Its console regression project has no package or project references and is not linked to gameplay. It never reads or executes an original binary. Run:
dotnet run --project tools/ppc-analysis/lanes/economy/OriginalLoanRules.Tests.csproj --configuration Release
dotnet run --project tools/ppc-analysis/lanes/economy/OriginalLoanRules.Tests.csproj --configuration Debug
The source exposes raw loan words, the touched bank words, a host repayment estimate, unsigned-division qualification and immutable operation results. All integer products, subtractions, additions and display-bit casts use explicit modulo-2^32 arithmetic, checked against a separate BigInteger reference over 1,296 operand combinations. The project enables checked arithmetic globally so accidental omissions of unchecked fail tests.
The floating constructor calculation preserves the inspected operation order. Its final conversion maps negative values to zero, truncates finite nonnegative values below 2^32, and maps NaN, positive infinity and larger values to uint.MaxValue. Thus positive-principal/zero-term gives saturated infinity; zero-principal/zero-term gives saturated NaN. The preceding pow comes from the host .NET math library, not the original library. Ordinary SAM examples match the reviewed values on this host, but original libm precision, rounding state, NaN propagation and edge-case reachability remain unqualified; matching these examples does not establish PC behavior.
Monthly operations keep the fixed installment, increase months repaid even when withdrawals are disabled, and complete only on equality with the term. The profit adjustment uses the unsigned wrapped interest numerator. Early payoff tests affordability against unsigned balance bits and clears the loan before reading months repaid for profit adjustment, preserving the reviewed whole-term interest charge. Disabled withdrawals skip only the debit/profit subtraction, not those subsequent state/profit operations.
DivideUnsigned deliberately returns no qualified quotient for divisor zero; it does not invent PowerPC DIVWU zero results. The actual monthly and payoff routines guard the interest division when the term is zero. Their modeled continuation is marked AssumesZeroTermDiagnosticReturns, because the preceding original diagnostic call is not executed by this helper. A null interest-division result means skipped/not reached, not interest zero. The model omits batch flushing, calendar/year events, other financial statistics, credit-capacity updates, red-entry timestamps and diagnostic side effects. Caller order and mode restrictions remain evidence dependencies.
The 15 regression groups cover 5,437 assertions: all eight ordinary APR offers; all eight zero-APR bookkeeping cases; full-term completion; disabled withdrawals; signed-display/unsigned-affordability distinctions; clearing order; inactive/refused paths; 32-bit overflow; equality-only completion; NaN/infinity/zero terms; guarded versus unqualified division; and the bounded BigInteger cross-check. For the 100,000/36 zero-APR example the first monthly profit change is −119,304,646; after 36 isolated calls without a year reset, the wrapped profit field is +40 and cash retains 28. These are arithmetic model results, not original runtime captures or realistic accounting conventions.
Standalone rating and staff-skill contract#
OriginalParkRatingRules.cs extends the same dependency-free console project; it has no production references and reads no original tables. Every count must be supplied by a caller with separately qualified selection logic. There are no SAM setting reads in 0xc7b24: its scales and caps are literal operands. Arbitrarily substituting configuration/percentage scales would describe a different rule set and is not part of this contract.
The native routine first counts inline to select the cap branch, then recounts through a provider only below the cap. RatingCountPass keeps those two observations explicit. CalculateStableSnapshot is a convenience that expressly assumes both counts agree; it is not evidence that every production statistic or traversal already supplies the right value.
| Caller-supplied component input | Native selection / below-cap provider | Provider call | Cap-check operation |
|---|---|---|---|
| Visitors | actor type 1, predicate 0xe6c6c != 0; 0xc3684 repeats it | 0xc7bf8 | signed population <1000; cap population, then low-word ×20 and signed /1000 |
| Rides | actor type 3, catalogue category 0; 0xc5864(0,0) | 0xc7cfc | low-word ×3, signed /2, compare <20 |
| Shops | actor type 3, catalogue category 1; 0xc5864(1,0) | 0xc7ddc | low-word ×2, compare <10 |
| Sideshows | actor type 3, catalogue category 2; 0xc5864(2,0) | 0xc7eb4 | low-word ×2, compare <10 |
| Features | actor type 3, catalogue category 3; 0xc5864(3,0) | 0xc7f88 | count <10 |
| Upgraded rides | actor type 3, catalogue category 0, upgrade byte >=2; 0xc5864(0,2) | 0xc8068 | count <10 |
| Handymen | native type 5, subtype 0; 0xc4064(5) | 0xc818c | count <4 |
| Mechanics | native type 4, subtype 0; 0xc4064(4) | 0xc82b0 | count <4 |
| Entertainers | native type 6, subtype 0; 0xc4064(6) | 0xc83d4 | count <4 |
| Guards | native type 7, subtype 0; 0xc4064(7) | 0xc84f8 | count <4 |
| Researchers | native type 8, subtype 0; 0xc4064(8) | 0xc861c | count <4 |
The second provider argument is a minimum upgrade bound applied only to native category 0. These native numeric selectors are pinned evidence; equating them with existing OpenTPW count properties is not established by this helper. It neither traverses the current world nor filters objects, candidates or staff itself.
evidence.py now checks all eleven signed comparisons, cap branches, literal caps, linked provider targets and selector operands. It also pins the provider regions [0xc3684,0xc3758), [0xc5864,0xc5968) and [0xc4064,0xc41a4), alongside the previously pinned composite/UI regions. Synthetic branch tests reject wrong conditions and targets. No original instructions are executed or copied into the repository.
All component calculations preserve low-word products and signed truncation toward zero. Ride multiplication precedes division and cap checking. The recount result is not capped again; final addition follows the original order, with visitors last, and has no final [0,100] normalization. Synthetic inconsistent passes can therefore exceed 100, and very large/raw negative count words can produce signed overflow results. Tests cover those operands to distinguish operation ordering; they do not claim such counts occur in the original game.
OriginalStaffSkill.Calculate follows code 0xf41dc precisely on the host's default floating mode: byte percentage at staff +488 is divided by double 100; the signed grade word at +484 is rounded to f32; the double sum is rounded to f32; then single-precision multiplication by 20 precedes the reviewed saturating unsigned truncation helper. The operand verifier checks 0xf4220 double divide, 0xf4228 single grade conversion, 0xf422c double add, 0xf4230 single rounding and 0xf4234 single multiplication. Neither grade nor percentage is normalized/clamped to the ordinary range. For example grade 4/percentage 0 returns 80, and grade 4/byte 255 returns 131.
The all-f32 rewrite loses the native operation order: the synthetic grade −1/percentage 105 case yields 0 with early single division, whereas the inspected double-fraction/late-rounding order yields 1. That input is not asserted reachable. The reviewed grade 0..5 and full byte domain has 1,536 checked combinations, matching integer floor((100×grade+pct)/5). Original rounding state, production field bindings and PC equivalence remain separate qualifications.
The combined Release/Debug runner now has 25 groups and 11,183 assertions. Rating cases include zero and isolated components, truncation, threshold ordering, caps, pass disagreement, low-word overflow and 2,048 bounded BigInteger reference comparisons. Staff cases cover raw bytes, lack of percentage normalization, f32 order and the reviewed bounded domain. The production rating and staff calculations remain unwired and unchanged.
Migration contract before gameplay wiring#
This plan uses reviewed standalone contract 974f546, reader correction ab3c74d, consumer qualification c7bedf1, and independent review of the Mac/PC save copy. It does not select a compatibility policy, port formulas, or change state import. The proposed name OriginalMacReference would mean an explicitly selected Mac arithmetic/timing contract, not inferred Windows fidelity. Difficulty, Instant Action/Full Simulation and arithmetic provenance are separate properties; the scenario/factory lane owns mode selection. Matching SAM inputs or saved words does not select a rule set.
Concrete world and save ownership#
World writer 0x105d3c and reader 0x106708 serialize mBankAccount as a u16 object ID at world +0x1da726 (operand/call pairs 0x105eac/0x105eb0, 0x10683c/0x106840), and mGameTick as u32 at +0x1da70c (0x105efc/0x105f00, 0x10688c/0x106890). Getter 0x108424 reads the bank ID at 0x108440, multiplies by 20 at 0x108464, and loads the object pointer from ThingArray, data 0xecef4, at 0x108468. These are field/call/relocation references, not symbol guesses.
World bank write dispatch calls 0xcba54 at 0x10663c. The read table's type-16 relocation points to 0x107620, which allocates 296 bytes; the case restores the actor ID, calls 0xcba54 at 0x10765c, and stores the pointer in its actor entry. Base actor serializer 0xfa808, called at 0xcba78, emits X/Y/MapChild/MapParent as four 16-bit fields before the bank words. Each actor is preceded by the next used-object ID and 32-bit model type (0x106394/0x1063c4; mirrored readers 0x106c9c/0x106cf0). The fixture's word 7 before bank model 16 therefore names the next actor, not current bank ID 8. A full actor walk must establish the current ID through the chain.
The formats lane establishes the leading action recording as u32 published flag, u32 size, size bytes, followed by the world prefix. Our identity-bounded witness repeats this on the PC save: flag 0, recording size 1,171, world start 1,179, version 2. Selected fields are:
| PC payload offset | Value | Native world field |
|---|---|---|
| 1,189 | 8 | bank ID, +0x1da726 |
| 1,193 | 755 | game tick, +0x1da70c |
| 1,197 | 2 | mechanic HQ ID, +0x1da71a |
| 1,199 | 5 | analyser ID, +0x1da720 |
| 1,201 | 0 | park-closed word, +0x1da710 |
| 1,217 | 6 | research-lab ID, +0x1da722 |
| 1,219 | 1 | staff-HQ ID, +0x1da718 |
| 1,227 | 0 | world-state word, +0x1da738; not GameType |
World write/read call composite 0xd6710 at 0x1062a4/0x106bdc before the map. It calls candidate-pool serializer 0xf5f1c at 0xd6734, calendar serializer 0xe3d30 with world +672 at 0xd675c, and arrival serializer 0xcb050 with world +708 at 0xd6784. Map serialization follows with world +728 at 0x106c04. Calendar persisted widths/order are 8,8,4,4,4:
| Calendar runtime offset | Field | Write/read call sites | Persisted bytes |
|---|---|---|---|
| +0 | FunnyTimeStart | 0xe3d80/0xe3e48 | 8 |
| +8 | SessionStart | 0xe3da4/0xe3e6c | 8 |
| +16 | MonthAtLastUpdate | 0xe3dc8/0xe3e90 | 4 |
| +20 | DayAtLastUpdate | 0xe3dec/0xe3eb4 | 4 |
| +28 | FunnySecsPerRealSec | 0xe3e10/0xe3ed8 | 4 |
Year cache +24 is not serialized. Initialization calls 0xe42b0 through 0x104920 -> 0xd67b0 -> 0xd67d8; it sets cached month to current month minus one and recomputes year. A corresponding post-load reset is not established: direct world load ends through actor free-list repair 0x107780 -> 0x1077fc. Do not silently execute the initialization reset on restored state. The remaining dependency is outer restore continuation 0x11b5ac after 0x11b680 -> 0x106708, plus indirect reset paths.
The sole epoch/rate candidate in the identified PC payload is at 6,719: FunnyTimeStart 125,911,584,000,000,000; SessionStart 125,850,128,932,900,000; month cache 1; day cache 2; rate 15,000. Host Gregorian conversion of the Mac equation with tick 755 gives 2000-02-02T18:27:30, consistent with the month/day caches. Calendar end 6,747 plus arrival's 18 persisted bytes reaches the formats lane's verified map start 6,765. The 18-byte width follows 0xcb050's three 4-byte numbers, one 4-byte timer (0x121000), and two bytes. This is a coherent candidate with a traced suffix, not a fully framed production calendar locator: preceding control-manager/candidate-pool lengths remain unverified (0xd1a60, 0xf5f1c). Agreement with this fixture does not prove the PC runtime equation. SessionStart is not grounds for inventing offline elapsed simulation time.
save_bridge_evidence.py validates exact container identity, bounded BILZ decompression, decoded identity and selected metadata. The decoded SHA is a3c9a28252c37ad49a8eb78e4a0c5e1d5229d01548fa35801db67015d2589173 (1,608,309 bytes). It accepts only this identified save and prints metadata; it does not mutate state or offer a production locator. evidence.py adds 16 owner/serializer/restore regions and operand/call/relocation checks. Four new synthetic groups exercise truncation/size/trailing-data limits, unsigned tick preservation, unnormalized caches, candidate ambiguity and identity rejection (13 Python groups total). No original code executes.
Evidence and port boundaries#
| Proposed binding | PC/shared-data/manual support | Mac-only operations | Bridge qualification |
|---|---|---|---|
| Live cash/admission | Reviewed PC bank 87,987/fee 25; exact Mac HFS save copy; manual admission controls | Deposit/debit/profit 0xcbf50/0xcbfdc, admission 0xcc568 | Retain raw bank snapshot, pending batch and annual profit without inventing category history |
| Loan offer/state | PC eight-word records; exact amount/APR/term/lender SAM check; zero-APR saved floor(P/N); manual mode restriction | Power repayment, fixed installments, unsigned bookkeeping/payoff 0xcb7a8/0xcc21c/0xccc78 | Preserve stored M and independent Available/Bought/Repaid; PC positive APR/bookkeeping remain unqualified |
| Calendar/cadence | PC tick 755 and coherent candidate; manual days/monthly wages/year graphs | Product/rate/4 0xe4394; civil OS conversion; nominal 8×31 ms park turn in clock lane | Separate original u32 tick from 60 Hz engine tick; qualify event phase/year-cache restore and clock mode gates |
| Staff wages | Actual PC SAM names/values; baseline/patch-2 global SAM identical; manual monthly wages | Product 0xf46bc; month debit 0xf2b5c -> 0xf3364 | Map native type/grade and employee records; preserve multiplication bounds/callback order |
| Staff skill/training | Manual training budget improves skill over time; SAM grade/price inputs | Exact skill 0xf41dc; allocation/charge order 0xfc1c4/0xf3588 | Preserve grade and percentage byte separately; qualify actor/state binding and reachability |
| Park rating | PC language label 190; manual qualitative popularity supplies no equation | Eleven provider counts, cap/recount/order 0xc7b24, monthly history/annual UI | Map every selector/predicate, subtype/upgrade gates; retain two-pass/stable-snapshot precondition |
SAM/copy facts establish inputs or saved layout, not Windows algorithm equality. This lane does not prove Mac/PC SAM byte identity; the reviewed copy is Easymode.TPWI. Pure data import may use reviewed PC fields without adopting Mac formulas. Explicitly chosen Mac reference simulation may use the standalone rules after bindings and persisted provenance are accepted. No automatic policy follows from difficulty, filename, matching repayment, or a byte-identical save.
Current import gap and staged acceptance#
SaveReader.ReadFile -> SaveEconomyRecords.Parse -> OriginalEconomyImport.Apply already carries the PC bank through OriginalEconomyImport.Records.Bank. OriginalEconomyImport.cs:84 reports cash 87,987, last 87,787, annual profit −12,013 and fee 25. It preserves settings InitialCash 100,000 and the constructor fee; the real-data regression explicitly asserts cash 100,000. Records.Loans retains Available/Bought/MonthsRepaid without creating runtime loans. Metadata is available now; absence of state restoration is reported. Parent integration may move this ownership into its level factory; follow the data path rather than a stale filename.
First qualify a raw original snapshot. Keep all seven bank words and eight independent loan words, source container/payload/settings identities and per-field qualification. Decode actor-chain ownership so a plausible loan run cannot select another object: ECON-045 remains a heuristic locator. This fixture has Available only at offer 3, Bought false throughout and MonthsRepaid 0; Available is not the inverse of Bought or TakenLoanOffers.
Do not map LastBalance 87,787 to ledger month opening: actual withdrawal 0xcbfdc updates LastBalance after each debit at 0xcc044. Balance minus initial cash and ProfitThisYear cannot manufacture monthly category totals. ParkLedger.Restore requires opening balance/month/totals/history, which the bank prefix does not supply; it has no pending batch/withdrawal flag/ red-entry/year-profit storage. Cash/fee restoration can be a qualified partial import only if unsupported financial history is marked unavailable and separately retained native words have defined consumers.
Do not invent annuity RemainingBalance from native loan fields. Current LoanAccount requires RemainingBalance/MonthsRemaining; native state keeps original principal, fixed M, term and repaid count. Native early-payoff amount is low-word M*(N-Repaid), not inferred remaining principal. Preserve signed-display/unsigned-bit distinctions until the chosen policy consumes them. Never recalculate a saved positive-APR M with annuity or the Mac power formula as a PC validity gate. Disabled withdrawals, zero-term diagnostic continuation, libm and FPSCR qualifications remain explicit.
Next qualify calendar framing/lifecycle, then employee/analyser restoration through world IDs. Staff serializer 0xf2c28 names grade at +484 (0xf2c80/0xf2ec0, helpers 0xf530c/0xf5114) and percentage at +488 (0xf2da4/0xf2fbc, byte helpers 0xcabc4/0xca9bc), after base serializer 0xe4a54. Those operands/calls are pinned; complete inherited/type-specific staff record framing and actual PC actor offsets are pending. Analyser serialization and history caller 0xc163c -> 0xc17b8 are the next rating state dependencies. Current wage clamps grade and widens product to long; native wage uses raw grade/32-bit product. Current rating filters open/ non-broken objects and adds happiness/cleanliness, unlike native providers. Qualify each component before replacing consumers.
M2 denotes the requested restore milestone, not an approved JSON version. ParkSaveFile.CurrentVersion is 1, strictly rejects unknown/missing members, and validates month index with the fixed calendar. A separately reviewed versioned provenance/original snapshot representation is required before persisting imported native state. Version 1 migration must retain existing approximations and must not synthesize original bank/calendar/loan fields. Scenario GameType and arithmetic policy must round-trip independently.
| Acceptance test | Required result | Status / next dependency |
|---|---|---|
| Current metadata | Actual Bank 87,987/fee 25 and eight exact loans; cash still100,000; positive APR accepted with uncertainty; exact settings mismatches rejected | Existing focused production tests and new fixture witness |
| Snapshot actor identity | Bank ID 8 resolves to type 16 through full chain; next ID 7 remains independent; ambiguity/truncation rejects before mutation | Owner/type operands pinned; full PC chain framing pending |
| Partial cash/fee import | Cash 87,987/fee 25 restored once; imported objects uncharged; unknown ledger/history marked unavailable; batch/annualprofit retained | Proposed; parent acceptance and target representation needed |
| Full loan state | Available/Bought combinations independent; repaid 0/middle/term/raw boundaries survive; saved M never recalculated; Mac policy has no final-remainder settlement | Standalone tests pass; production representation pending |
| Calendar event phase | Tick 755/rate 15000/epoch yields qualified reference date; save/load across day/month/year neither duplicates nor skips debits; unsaved-year lifecycle and pause/catch-up gates tested | Candidate coherent; 0xd1a60/0xf5f1c framing and 0x11b5ac continuation pending |
| Staff/rating binding | Grade 4 / pct 0 yields skill 80; full byte domain retained; each of 11 selector/cap and eligible/ineligible actors tested; two-pass assumption explicit | 974f tests pass; actual employee/actor binding pending |
| M2 save continuity | Policy/identities/raw words/availability/event phase round-trip; original/restored continuation identical; version1 retains existing rules | Extend SaveRoundTripRestoresTheCompleteState; version/schema decision pending |
Confidence is high for reviewed bank/loan fields and pinned native owner/ caller operations, medium for the bounded calendar candidate, and unqualified for PC numerical algorithms beyond the zero-APR fixture. Gameplay/factory/state-import source is unchanged by this plan.
Staff cadence, real saved researcher and bankruptcy gate#
Run the additional owned witness with:
python3 tools/ppc-analysis/lanes/economy/staff_evidence.py /Users/sander/server/game-assets/mac-feral/bin --save /Users/sander/server/game-assets/theme-park-world/Data/levels/jungle/Easymode.TPWI
It pins 20 additional operation/serializer regions, verifies 22 leaf-helper write widths through their actual LbFile_Write imports, composes eight serializer call sequences and checks fixed loop limits. It emits identities, addresses, widths and interpreted fields only. The earlier application witness and these checks together qualify the framing below; no original instructions execute. Both normal and python3 -O runs agree.
Cadence and state/vital transitions#
Regular world update 0x10536c increments mGameTick, then visits the used actor chain and calls 0xfa9b0 at 0x10541c for non-null actors with byte +3 == 0. Researcher dispatch calls 0xf0284 at 0xfaa48, immediately followed by state processing 0xf0304 at 0xfaa50. These are park-turn operations. World-state 4 skips that actor pass, but still reaches 0x10563c -> 0xd67f0 -> 0xd6818 -> 0xe3f0c calendar updates (independently pinned by the clock lane). Do not equate this world state with GameType, or assume that actor suspension alone freezes calendar events.
0xf4170 maps raw staff +412 states to broad UI/eligibility states: raw 0→0, raw 1→1, raw 3→3, raw 4/5→4, raw 7→5, and the remaining raw values (including research state 15)→2. Thus researcher contribution every 20 turns is excluded during broad 3/4/5, not restricted to raw 15. The raw state must survive import; a broad-state enum alone loses this distinction.
Vital semantics are identified by the grievance traversals, which read +504 in the fatigue branch and +500 in the unhappiness branch, in addition to the grade/SAM recovery operations. Both are runtime f32 values. They are not permanently 100:
| Native routine / caller | Per-call operation | Actual input references |
|---|---|---|
Rest 0xf3d8c; researcher raw 3 at 0xf035c | Energy += f32 recuperation; happiness += f32 happiness recuperation; each clamps to [0,100] | staff grade+484; SAM +756/+760 +16×grade; loads 0xf3db8/0xf3dfc |
Idle/moving 0xf44c0; researcher 0xf0530 on navigation-in-progress branch | Energy -= f32(0.012×(6−grade)); happiness -= f32(0.005×(6−grade)); each clamps | double constants data 0x5610/0x5608; final subtract is f32 |
Working 0xf459c; researcher raw 15 at 0xf0568 | Energy -= f32(f32(0.025)×(6−grade)); happiness -= f32(0.01×(6−grade)); each clamps | float data 0x5600, double 0x55f8; grade conversion and rounding order differ |
No reachable rest area, 0xf4ad0–0xf4b50 | On RNG() &15 ==0, subtract SAM HappyHitCosNoRestArea from happiness and clamp | setting+744; energy threshold uses+740; this is an RNG gate, not a fixed 16-turn interval |
Actual PC global SAM recovery rates by grade 0..4 are energy 0.2/0.3/0.4/0.5/0.75 and happiness 1/2/2/3/3. IdleDuration is 40/30/20/10/5 turns; researcher WorkDuration is 10/20/30/40/50 turns. Descriptor-derived bindings are +752 and +1048 (strides16/12). RestLevel is 1 and the missing rest-area happiness hit is 2. These are PC input values; the operations and turn domain above are Mac evidence. There is no inferred fixed-day cadence or claim that every mod/raw grade is reachable.
Rest completes when truncated low-byte energy equals 100 (0xf3e2c–0xf3e44), then 0xf4d00 releases the rest-area association and researcher callback 0xf0380 attempts its next action. Below/at RestLevel, 0xf4900 searches rest areas: 0xf47a0 selects the nearest squared grid distance among eligible objects; 0xf4c18 attempts navigation, stores rest ID+516 on success, and only then changes raw staff state to 2 at 0xf4ab8. A nearest unreachable area can fail this attempt; the function does not establish a search through all reachable alternatives. Arrival/state 2 processing 0xf3b78 is still required before equating walking-to-rest with raw 3 rest.
Research raw 15 records start tick+528. 0xf054c depletes vitals, then compares current tick strictly greater than low-word start+WorkDuration at 0xf0594. After navigation/mode checks it transitions through raw 1 or resets the work-start tick. Raw0/idle processing 0xf0610 similarly waits until current tick > low-word idling-start+IdleDuration before checking strike/rest and attempting research. These fields cannot map to current BusyTicks without preserving native state and comparison order.
Strike decision and activation are separate#
0xf7e18 performs training first (0xf7e48 -> 0xfc1c4) on its month-event path, then considers each present role. Normal consideration requires park open; HQ +100 bypasses that gate and makes grievance predicate 0xf8410 return true. Per-role state is at HQ +36+12r, active strike flag at +40+12r (0xf8bc0), last-considered tick at +44+12r. If already active, the next consideration clears the active flag instead of escalating again.
0xf8410 normally requires more than three employees in a role and unsigned integer average of their truncated low-byte energy or happiness below 15. Each traversal follows role-linked staff +524, including all members in that chain, not an arbitrary available-worker list. Handymen have an additional analyser-statistic ratio > f32(0.2) grievance at 0xf84a8–0xf84fc; the two statistic meanings remain dependencies 0xc21f4/0xc2264. All five roles, including researchers at 0xf8a44–0xf8b90, have fatigue and unhappiness tests. Empty/three-member roles bypass division; there is no divisor-zero policy to invent here.
Escalation 0xf7fe0 is gated until elapsed calendar time reaches 24 fixed 30-day units (0xf803c–0xf805c), then uses grievance state 0→warning1, 1→strike2, 2→strike3, 3→strike4, and4→repeated strike4. The non-warning branches set active flag +40 and emit role messages through 0x116590. Diagnostic text describes one week, two weeks and one month, but actual timed release outside the monthly active-flag clearing remains untraced; those strings alone are not quantitative duration proof.
When a role is active and gate state 0x1091b8 equals1, individual staff 0xf4900 set generic field+392=1, choose a random position from the schema- proven StrikeAreaStart/Size fields +1452/+1456/+1460/+1464, attempt navigation at 0xf4a34, and enter raw 4 through 0xf4a48 only on success. The saved researcher's happiness 97/energy 93 therefore supplies real input, but does not imply a present strike or prescribe a synthetic strike state.
Framed PC researcher, without invented staff#
Inherited serializer sizes are established from actual primitive writes and fixed-loop limits, not runtime allocation sizes:
| Serialized component | Bytes | Width/order witnesses |
|---|---|---|
Base thing 0xfa808 | 8 | X/Y/MapChild/MapParent, four 2-byte fields |
Sprite animation 0xd2144 | 12 | three 4-byte fields |
Navigation 0xfcbcc | 177 | fixed scalar/vector fields; five 8+4 subpath entries at 0xfcf80 |
Thoughts 0xfb304 | 144 | index4 +32×event4 +lastThought4 +script4 +shownTick4; 0xfb398 |
Person 0xe4a54, including the above | 390 | selected scalars 15+34 plus8+12+177+144 |
Staff suffix 0xf2c28 | 105 | grade4, happiness4, jobs4, 33×UTF16 name, patrol4, percentage1, restID2, state 4, idleTick4, hiredTimestamp8, energy4 |
Guest suffix 0xe7f34 | 135 | scalar fields plus four pairs of previous object IDs (0xe8338) |
Researcher suffix 0xf00f0 | 6 | researching-start tick4 and researcher-next ID2 |
Starting at the formats lane's verified map end 1,385,521, UsedThingHead is 42. Twelve successive type 1 guest records, each 8-byte next/model header plus525 body bytes, walk IDs 42→41→…→31→30. The next record is actor 30, native model 8, next used actor 29, at 1,391,921. Its body is 501 bytes and ends at 1,392,430. World FirstResearcher at 1,239 also equals 30; its separate researcher-linked next ID is 0. This establishes the first researcher in the actual PC save, without a pattern scan, ordinal-as-ID assumption or fabricated employee. The bounded walker intentionally stops here; the remaining whole actor chain and other model widths remain unparsed.
| Actual PC payload offset | Field | Value |
|---|---|---|
| 1,392,319 | Grade | 2 |
| 1,392,323 | Happiness, saved f32 | 97 |
| 1,392,401 | Percentage-through-grade byte | 0 |
| 1,392,402 | Rest-area ID | 0 |
| 1,392,404 | Raw staff state | 1 |
| 1,392,408 | Idling-start tick | 0 |
| 1,392,412 | Hired timestamp | 125,935,884,000,000,000 |
| 1,392,420 | Energy, saved f32 | 93 |
| 1,392,424 | Researching-start tick | 697 |
| 1,392,428 | Researcher-linked next ID | 0 |
The native writer truncates each runtime vital, keeps the low byte, converts that integer back to f32, then writes four bytes (0xf2ce0/0xf2e94). Readers restore those floats into +500/+504 at 0xf2f14/0xf3094. This lossy save encoding must not be mistaken for one-byte framing or evidence of unchanging happiness. The 33 UTF16 name units are stored inline at 1,392,331; there is no serialized NameIndex in this suffix. Mapping that name to the current indexed-name API requires separately qualified matching, or an explicit inline-name field, rather than inventing an index.
These facts support a future real researcher import for a mode that consumes this save. They do not choose Instant Action/Full Simulation or infer that the saved actor was created by a particular mode. Native GameType and the scenario factory remain the parent/scenario lane's responsibility. The same save container/payload identities listed above qualify all offsets. The new prefix tests preserve next/current IDs, raw grade/percentage/state, u32 ticks/u64 timestamps and both saved floats; they reject unsupported models, cycles, truncation and bounded-prefix exhaustion. Total owned Python tests now 16; the real fixture and normal/optimized witnesses pass.
Bankruptcy blocker 0x105c6c resolved#
The predicate compares winning-sequence object ID at data 0xecdcc against null-ID sentinel 0. Start routine 0x105b50 allocates the configured feature and copies its real actor ID into that global through 0x105bf0 -> 0xfa9a4; failure stores 0. End routine 0x105c94 diagnoses an unmatched EndWinningSequence, deletes the associated object at 0x105d08, and clears the ID at 0x105d18. Thus the predicate blocks a loss transition during an active winning sequence; it is not a money/loan eligibility query.
Month handler 0xcc21c checks current Balance<0, uses LastBalance and TurnEnteredRed to obtain elapsed time through 0xcc434 -> 0xe4750, divides by the fixed 30-day unit, and emits type 19/subtype2 once elapsed quotient ≥6. Bank message handler 0xcc120 handles that subtype only if worldState !=4 and 0x105c6c ==false, then calls loss transition 0x1059e0 at 0xcc1b8. The transition sets worldState4 (0x105a30/0x105a40), runs the failure sequence, handles affected ride objects, and closes the park through 0x105b38 -> 0x108ee4. Subsequent world ticks skip ordinary actors while the calendar path remains, subject to the clock lane's separate gates.
Cash/fee partial-import proof still does not supply ledger history, general calendar framing, unsaved-year initialization, or a PC bankruptcy algorithm. The concrete next bridge is now the framed researcher record and its inline name/state/vitals, plus loss/winning-sequence state qualification; retain the independently accepted reference formulas as a separate opt-in contract.
Source: docs/reverse/PPC-economy.md in the project repository.