Repository navigation
Conversation
Add a `gba/` frontend that runs the RISC-V core on a GBA. Guest RAM is the upper 16MB of the GamePak window, which flash carts with PSRAM expose as writable memory; the kernel image and DTB are embedded in the ROM and copied there at boot. The interpreter loop runs from IWRAM as ARM code, the guest clock is derived from the instruction count, and the serial console is drawn on the Mode 3 bitmap with buttons typing commands. To make this possible the core and device_interfaces crates are now no_std; the Vec-backed Bus and the `start` loop stay behind a default `std` feature, so the existing frontends are unchanged. The LR/SC reservation is a single Option instead of a HashMap, and Cpu gains bus_mut(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
Adds a
gba/frontend that runs the r2 RISC-V core on a Game Boy Advance and boots the bundled Linux (fixtures/linux.bin+default.dtb) to a shell.RGBA_PSRAM=1, Add flash-cart PSRAM emulation and a headless mode rgba#100). The kernel and DTB are embedded in the ROM and copied there at boot; the DTB memory size is patched the same way mini-rv32ima does.armv4t-none-eabi, ~2.2x faster than Thumb): ~70 ARM instructions per RISC-V instruction, ~110K guest IPS. The login prompt appears after ~6–7 minutes of GBA time.uname -aruns at the first prompt, and each button types a command (A:uname -a, B:ls /, ...).Core changes
coreanddevice_interfacesare nowno_std; the Vec-backedBusandstartstay behind a defaultstdfeature, so app/wasm/wasi are unchanged.Option<(addr, value)>(consumed by SC) instead of aHashMap.Cpu::bus_mut().Notes
gbafix); the logo/checksum are not filled in.gba/is its own workspace (nightly +build-std), so the rootcargo check/CI does not build it.Test plan
cargo check,cargo test -p coremake -C gbabuildstarget/r2-gba.gbaRGBA_PSRAM=1): boots, logs in,uname -a→Linux buildroot 6.1.14 ... riscv32 GNU/Linux🤖 Generated with Claude Code