Combined/widescreen and runtime fixes + KONG letter tracking
MA
17h ago+9638+9638+0123456789012345678901234567890123456789-223-223-012345678901234567890123456789
Combined today's work.
Summary by cubic
Fixes widescreen rendering, the balanced interpreter, and Windows desktop edge cases raised during combined testing, and tracks KONG letter progress per save slot.
New Features
- The world map draws "KONG" beside levels whose four letters are collected and beside the Northern Kremisphere once its five levels are done. Letters are recorded in a host-side sidecar (
saves/kong_letters.dat) so the battery save stays byte-identical; the sidecar is replaced atomically, adopting SRAM never clears flags, and quick loads re-adopt the restored letters. - A Settings > Gameplay checkbox (on by default) toggles the badges without stopping recording; Restore Defaults re-enables it, and headless runs opt in with
DKC3_KONG_TRACKER. - A Settings > Assist Tools option (off by default) spawns an animal buddy crate from the in-game pause state — Up for Squawks, Down for Enguarde; the selector stays off during ending credits, which freeze the game without a player in control.
- A Settings > Assist Tools option (off by default) reveals sprites the game keeps alive but undrawn, like hidden bear coins; Kongs, the ridden buddy, and the defeated K. Rool stay hidden. The reveal fails closed unless every sprite-renderer marker is wrapped.
DKC3_SHOW_HIDDEN_OBJECTS=1enables it headless.
Bug Fixes
- Widescreen now fills the Northern Kremisphere overworld from its fully resident 512-pixel map, held through hovercraft row streaming; margins are camera-locked, clamped to the map, and blacked when the tilemap hash changes. The KAOS arena and the K. Roolenstein phase likewise fill wide aspects from the static 512-pixel room plane.
- Fast PPU windows honor
WBGLOG/WOBJLOGcombine logic, shift un-pinned edges bywsPresentationXBias, and keep windowed 32-column BG3 layers physically wide — fixing Poisonous Pipeline's wrapped water-surface patterns. Edge-parked 1-pixel windows are treated as empty so off-screen hollow tree trunks no longer black out the forest background, while Ripsaw Rage's legitimate[255,255]trunk spans draw from the routine's unclamped world spans. - The glide and margin clamp take walls from the camera's current region and its linked neighbours, and shrink to the room in bonus rooms; margins that narrow at a wall are blacked before rendering, the presented bias re-snaps when the edge policy changes, margins stay continuous across camera-region changes, and the structural wall rule applies only to margin tiles outside the camera's reach.
- Added a configurable widescreen spawn lead (
DKC3_SPAWN_LEAD) to placement activation and sprite culls, and wrapped the static banana/star grid walk span so "Collect the Stars!" bonus levels no longer skip left-wall stars. - When the palette allocator overflows, widescreen serves the sprite's true palette from host extended OBJ CGRAM without mutating guest WRAM, with an opt-in
DKC3_EXT_PAL_TRACEdiagnostic. Quick loads recover a sprite's palette from its bank-$FF init scripts when those scripts agree on one. - Balanced interpreter dispatch now unwinds to the owning interpreter when a compiled callee discards its guest return frame, and nested interpreter runs unwind on their master deadline — fixing black screens, off-rails crashes, and SRAM corruption.
- Anchoring the APU guest timeline at frame start prevents audio starvation after reset, savestate load, or rewind.
- Windows now pauses emulation, audio, and fullscreen OpenGL swaps on focus loss and minimization, paces frames with a high-resolution waitable timer instead of busy-spinning, and routes Win32 menu commands through a dedicated SDL user event.
- Holding Start during boot skips the rolling-logo and developer-credit states (
DKC3_SKIP_INTRO_START).
Testing adds a 247-case ROM-free PPU window oracle test against the legacy scalar PPU, plus unit tests for spawn/cull helpers, palette-overflow routing, runtime patch hunks, background-pause policy, intro skip, crate spawning, hidden-sprite reveals, trunk-spawn overrides, and the KONG tracker, including sidecar rejection, ambiguous copies, and quick-save adoption. DKC3_USER_DIR isolates Windows smoke-test saves from the installed config.