Repository navigation
Forward-port #68 stereoscopic battle sprites to integration - #312
Open
mkrieger95 wants to merge 26 commits into
Open
mkrieger95 wants to merge 26 commits into
mkrieger95 wants to merge 26 commits into
Conversation
Start a new draft forward-port based on upstream integration, preserving original work and full attribution to darkmattericecoffee's ZallaxDev#68. Import the independent pack format, generators, pure C decoder and synthetic host tests; exercise Python tests on both pinned interpreters. Modernize deprecated Pillow getdata calls and correct test import path. Keep runtime battle rendering and options untouched until reconciled with the newer 3DS engine, localization, and weather semantics. Original implementation: ZallaxDev#68 Original author: darkmattericecoffee (d188bc7)
The production export uses fill_transparent after packing planes, but the original ZallaxDev#68 test asserted against the pre-fill intermediate containing 0xFF at background pixels. Update expected bytes to match the documented final on-disk outline-free format; keep all semantic assertions.
…oper flag Preserve the current integration renderer and all game/graphics paths. Import darkmattericecoffee's native plane reader, battle compositor and game-side battler identification. Compile/link in dedicated feature-on CI build with STEREO_BATTLE=1. Keep ordinary builds identical in behavior by leaving the new sources out by default and adding no rendering hooks. Default the internal battle option OFF until UI and genuine runtime integration are audited. No asset or old patch number is imported. Upstream work by darkmattericecoffee, PR ZallaxDev#68 (d188bc7).
The original ZallaxDev#68 battle source depends on CtrStereoMon_ParseHeader, CtrStereoMon_Find and ComposeTile from 3ds_stereo_mon_decode.c. Ensure feature-enabled full builds link these functions, while ordinary builds continue to exclude every ZallaxDev#68 runtime translation unit.
Gate every runtime hook behind a developer-only build switch and a runtime setting that defaults OFF. Use original depth-plane match only for validated battler OAM while composing an actual stereo eye. Keep ordinary 2D, other sprites, weather wrapping and current slot logic unchanged. Draw full scenes per eye only with matched depth battlers, avoiding duplicate flat sprites. No release asset packaging or public options yet. The original stereoscopic implementation is credited to darkmattericecoffee (ZallaxDev#68).
… developer builds Allow explicit local STEREO_MONS_PACK and STEREO_BACKS_PACK paths to be copied through the original fill-only validator. With no files given, create legal header-only empty containers; ordinary builds include none. No artwork, download behavior, normal runtime options or user-visible features changed. Credit remains with darkmattericecoffee (ZallaxDev#68).
Exercise actual Pillow image loading rather than mocked generator calls: RGBA transparency and q5 colors, four-plane grayscale depths, and two-frame indexed front sprites. Synthetic fixtures only, no ROM or Pokémon art. Run on both normal audit interpreters to guard the 3.15 migration.
…aults Add a BATTLE/STEREO options group only to experimental feature builds with actual depth packs. Support on/off, spread and pivot in seven locales; keep it OFF by default and grey tuning controls until enabled. Hide absent/empty packs, explicitly enforce missing-pack fallback even if a stale settings.txt says to enable, and preserve all other menus. Original implementation design credit: darkmattericecoffee PR ZallaxDev#68.
Validate entire EM3DSTM1 index and payload before staging authored packs: unique ascending IDs, valid frame/plane counts, contiguous bounded data, no surplus bytes and correct pixel depth values. Mirror bounds checks in native file loader so malformed RomFS assets cannot expose settings. Preserve deterministic, idempotent transparency filling and add negative synthetic fixtures; default rendering remains untouched.
Ensure invalid-pack tests exercise real one-byte plane values and valid 64x64 frame lengths, not escaped-text representations.
…e assets Rebuild authored packs whenever the selected local source paths change; keep that config separate from engine compilation. Prune old stereo RomFS files when returning to normal builds to prevent asset leakage. Assert engine-only classification and ABI/optional-asset isolation in synthetic tests, without requiring a ROM or author binaries.
Only replace explicitly validated battler OAM in a real left/right 3D eye; cover all 128 indices, masks, flat mode and weather classifications with SDK-free host tests. Preserve the current battle clear color in the experimental whole-eye path and reset OBJ-window/edge state before its early return. Other rendering paths remain byte-for-byte unchanged. Original stereo feature credited to darkmattericecoffee PR ZallaxDev#68.
…nal pixels Exercise both synthetic animation frames, 2/3/4 plane groups, alternate palette tints, silhouette transparency and 2-pixel depth skirts. Far-to-near composition at no eye shift must reconstruct all original RGBA5551 pixels exactly, catching visual and palette regressions without redistributing ROM or sprite artwork.
… tints The pack's (0,0) pixel is deliberately plane NONE in the inherited fixture; keep its source artwork transparent for both palette variants so the zero-parallax parity assertion tests valid matching silhouettes.
After testing the experimental build, rebuild and verify a genuine STEREO_BATTLE=0 release in the pinned toolchain. Assert stereo macro is absent, stale depth packs were pruned, and publication audit passes on both configurations. Upload the ordinary default-off engine artifact. No game changes; regression checks are mandatory for this draft.
Gate the entire BATTLE/STEREO group and its rows behind the developer macro, not just runtime absence checks. Restore original RowExists and ExtraLive logic literally in normal builds so no extra groups or option-lookup work can affect the base game. In feature-on builds keep all seven-language controls and pack gating.
The new flat-eye clear branch is compiled only with CTR_STEREO_BATTLE; therefore the baseline-off build has an otherwise unused parameter under -Werror. Mark it unused only in that build. Preserve all rendering logic, stereo eye clear behavior and existing OAM fallback unchanged.
…on OAM collisions
… depth reader handoff
mkrieger95
marked this pull request as ready for review
November 23, 2026 01:37
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Forward-port #68: opt-in stereoscopic Pokémon battle sprites
Target:
integrationOriginal work and credit: @darkmattericecoffee — original PR #68 and original depth-pack release.
I'm bringing the original author's stereoscopic battle-sprite work forward to the current Emerald3DS architecture so it can be reviewed and tested rather than remain stalled. This is a forward-port and compatibility integration, not my original feature. I have retained the attribution to @darkmattericecoffee, whose original work made this possible.
What I implemented
integrationcodebase.video/*.incarchitecture. The experimental path only replaces validated battler sprites; unrelated sprites, weather, OBJ windows, HUD, and other rendering retain their existing paths or fall back to the original flat sprites.STEREO_BATTLE=1) and OFF by default at runtime (3D POKÉMON). Normal builds (STEREO_BATTLE=0) exclude the new native renderer and its runtime hooks.mons.bin/backs.binas optional, locally supplied developer-build inputs. No Pokémon art, authored depth packs, or downloaded binaries are included in this PR. Missing/invalid packs or failed texture allocation do not enable depth rendering.The original #68 wild-only gameplay patch is not enabled or recreated here. I deliberately kept gameplay modifications outside this renderer-focused port.
Automated verification
CI #948 passed all five jobs on the latest commit (
6e3af73):I also added a strict dual-eye capture comparison script to support baseline-vs-feature-OFF and feature-ON visual reviews.
Required before merge — real rendering and hardware QA
I'm marking this PR Ready for Review so maintainers and the original author can review the implementation now. I am explicitly not asking for it to be merged until these checks have been performed and reviewed. Passing CI proves builds and synthetic tests, not real-ROM visual correctness or device performance.
integrationrendering against feature-OFF builds using matched real-game captures; confirm no visual regressions in existing functionality.Status: ready for code review; hardware/real-ROM validation outstanding; not cleared for merge. The feature remains OFF by default, and the normal build retains the existing renderer.
Additional technical notes and test instructions: docs/STEREO_68_FORWARD_PORT.md in the PR's Files changed tab.