feat(vapor): add reactive GBA RPG proof of concept - #218
Draft
doodlewind wants to merge 5 commits into
Draft
Conversation
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.
Summary
onFrameandBTNPocketJS APIs, with no device SDK concepts in app codeRpgScreenexplicitly own the full display, and preserve dialogue/battle behaviorArchitecture
Gameplay remains ordinary reactive
ref/computedstate compiled to C. The app stores one deterministicwalkPxpresentation ref:-1while idle and0, 2, ..., 14during an accepted step. Only the final frame commitsplayerXorplayerYand dispatches the destination event. Collision and quest semantics therefore stay on integer cells, while presentation can update every frame.The GBA host maps held hardware state to the shared PocketJS
BTNmask and invokes the compiledapp_on_frame(u32 buttons)hook.RpgScreenreceives fractional player offsets and a derived walk frame; the native renderer selects the correct four-direction atlas frame, scrolls an overscanned 16x11-cell BG1 cache, positions actors against the same pixel camera, and keeps UI in fixed BG0/window space.RpgScreenmust be the only root render unit so generic row clearing cannot invalidate its cached HUD.All display register, BG map, and OAM changes are shadowed and committed during VBlank. The 32x22 active map region and used OAM slots are copied with DMA3.
Pixel art pipeline
/characters/animationswith templatewalking-4-framesproduced four directions with four 88x88 source frames each from the same persistent hero character.y=31.generation.jsonrecords the animation group, background-removal jobs, and SHA-256 hashes without storing the API key.Validation
bunx tsc -p vapor/tsconfig.json --noEmitbun run vapor:rpg:assets:checkbun test vapor/tests/ --max-concurrency 1 --timeout 120000- 94 passed, 0 failed, 57,152 assertionsbun run vapor:rpg0,2,4,6,8,10,12,14,0, OAM advances exactly 2px per frame, and walk tiles cycle through all four authored framesDBG_FRAMEsamples have distinct video hashes across two cell boundariesQUEST: TALK TO THE ELDER; world/dialog/battle hardware captures remain distinct and multi-color; tripwires remain zeroVAPOR QUEST, game codePVPR01, SHA-256d609c808a08773d4a1d4ff03bc0c8a2d69e61a06d31473601671c4cc7ac8b1ddCurrent POC boundary
GBA only, tile-based movement/collision, printable English ASCII, no saves/audio/CJK, and no browser pixel renderer yet. Physical EZ-Flash boot, display, and input acceptance remain the manual real-hardware follow-up.