{"id":24058221,"url":"https://github.com/rust-console/min-gba","last_synced_at":"2025-07-06T17:04:18.099Z","repository":{"id":53052713,"uuid":"289336041","full_name":"rust-console/min-gba","owner":"rust-console","description":"A minimal setup to build Rust into a GBA ROM.","archived":false,"fork":false,"pushed_at":"2021-04-08T17:07:53.000Z","size":14,"stargazers_count":24,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-23T02:47:44.485Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rust-console.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-21T18:15:21.000Z","updated_at":"2024-05-17T16:50:50.000Z","dependencies_parsed_at":"2022-09-04T08:30:58.825Z","dependency_job_id":null,"html_url":"https://github.com/rust-console/min-gba","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-console%2Fmin-gba","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-console%2Fmin-gba/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-console%2Fmin-gba/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-console%2Fmin-gba/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust-console","download_url":"https://codeload.github.com/rust-console/min-gba/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250360251,"owners_count":21417717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-09T05:56:25.562Z","updated_at":"2025-04-23T02:47:57.444Z","avatar_url":"https://github.com/rust-console.png","language":"Rust","readme":"# min-gba\n\nA minimal setup to build Rust into a GBA ROM.\n\nThis crate is not for general use!\n\nIf you'd like to program a GBA game try the [gba](https://github.com/rust-console/gba) crate.\nThe point of this repo is just to ensure that crater runs which break the thumbv4t-none-eabi target get caught.\n\n## What's Needed\n\n* `rustup default nightly` (or run all commands with `cargo +nightly`)\n* `rustup component add rust-src`\n* `arm-none-eabi` binutils (either via [The ARM Website][1], or your linux package manager).\n* The following files:\n  * `.cargo/config.toml`\n  * `src/rsrt0.S`\n  * `linker_script.ld`\n  * `build.rs`\n\n[1]: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm\n\n## Rust Analyzer\n\nIt'll go nuts, here's how you fix it:\n\n`.vscode/settings.json`:\n```json\n{\n  \"rust-analyzer.checkOnSave.allTargets\": false,\n  \"rust-analyzer.checkOnSave.extraArgs\": [\n    \"--lib\"\n  ]\n}\n```\n\n## Final ROM\n\nWhat you get with the project setup is an executable ELF file, but [mgba](https://mgba.io/) can run it directly, so that's fine.\n\nFor a finalized ROM there's some post-processing steps:\n\n* `objcopy` must be used to extact just the binary guts from the ELF file.\n  * The command you want is probably something like this (change `main` to your binary's own name):\n  * `arm-none-eabi-objcopy -O binary target/thumbv4t-none-eabi/release/main target/main.gba`\n\n* `gbafix` should be used to apply the correct header.\n  * You can get a Rust version of `gbafix` via cargo: `cargo install gbafix`\n  * You can also get the C version of gbafix from the DevKitPro folks.\n  * Either way, `gbafix main.gba` will ensure that the gba file has the correct header info.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-console%2Fmin-gba","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-console%2Fmin-gba","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-console%2Fmin-gba/lists"}