Synacor::Debugger
Inherits Reference < Object
Constants
The value solve_teleporter finds for $7. Hardcoded so we can skip the
~100s brute-force at runtime.
Constructors
Instance methods
Apply the teleporter fix without running the slow check:
- Set $7 to the calibrated value (a later routine derives the printed code from $7, so this must be the genuine value, not faked).
- Patch the confirmation function at 6027 so it returns 6 immediately, since the real recursion is far too deep to actually run. The caller at 5489 only inspects $0 after the call, so: 6027: set $0 6 (1, 32768, 6) 6030: ret (18)
Hand control back to the VM: restore output to the real terminal and run the normal main loop from the current PC. Remaining buffered input (from any --load saves) is consumed first, then op_in falls back to STDIN, so the game continues interactively. HaltError and friends propagate up to RunCommand#execute, which handles them.
The teleporter confirmation routine at address 6027 is a parameterized Ackermann function where register 7 ($7) is the free parameter:
f(0, b) = b + 1 f(a, 0) = f(a - 1, $7) f(a, b) = f(a - 1, f(a, b - 1)) (all mod MAX_VALUE)
The caller at 5483 sets $0=4, $1=1, calls it, and requires f(4, 1) == 6. We brute-force every candidate for $7, memoizing per-candidate so each evaluation is cheap.