๐Ÿ“ฆ tolik518 / gba_env

A no_std rust crate for detecting the environment/system in which the Game Boy Advance ROM is currently running ex. GBA/NDS/mGBA/VBA/gpSP.

โ˜… 5 stars โ‘‚ 0 forks ๐Ÿ‘ 5 watching
game-boy-advancegameboy-advancegameboyadvancegbahacktoberfest
๐Ÿ“ฅ Clone https://github.com/tolik518/gba_env.git
HTTPS git clone https://github.com/tolik518/gba_env.git
SSH git clone git@github.com:tolik518/gba_env.git
CLI gh repo clone tolik518/gba_env
Anatolij Vasilev Anatolij Vasilev Update README.md d4b6f72 11 months ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .cargo
๐Ÿ“ examples
๐Ÿ“ src
๐Ÿ“„ .gitignore
๐Ÿ“„ Cargo.lock
๐Ÿ“„ Cargo.toml
๐Ÿ“„ README.md
๐Ÿ“„ README.md

GBA env

A no_std rust crate for detecting the environment/system in which the Game Boy Advance ROM is currently running ex. GBA/NDS/mGBA/VBA/gpSP.

You can find the documentation for gbaenv here.

Usage

You would need to use the nightly rust version and add this to your Cargo.toml:

[dependencies]
gba_env = "1.0"

Then you can use the crate in your code:

use gba_env;
use gba_env::Environment;

fn main() {
    let env = gba_env::get_env();
    if env == Environment::GpSp {
        println!("Sorry, but this ROM is not supported on gpSP.");
    } 
}

License

This project is licensed under the GNU GPLv3 or MIT or Apache-2.0 License. Just pick the one that fits your needs.

Appendix

All the information about the GBA environment detection were taken from the gbadev Discord server. So a huge thanks to the gbadev community!