| Crates.io | gba_rumble |
| lib.rs | gba_rumble |
| version | 0.1.2 |
| created_at | 2025-04-17 00:04:11.574456+00 |
| updated_at | 2025-04-18 05:50:04.843953+00 |
| description | Rumble functionality on the Game Boy Advance. |
| homepage | |
| repository | https://github.com/Anders429/gba_rumble |
| max_upload_size | |
| id | 1637069 |
| size | 163,877 |
Library for enabling rumble functionality on the Game Boy Advance.
This crate supports rumble through both the cartridge itself using general purpose I/O (GPIO) and the Game Boy Player's rumble functionality. Functionality is provided for detecting available rumble features and using them fully.
The library is designed to be usable regardless of what other GBA development libraries may be in use. It is usable with popular libraries like gba and agb.
There are two ways to use this library: by using a cartridge's built-in rumble through Gpio and by using the Game Boy Player's rumble functionality through GameBoyPlayer.
To use a cartridge's built-in rumble through general purpose I/O (GPIO), use the Gpio struct.
let gpio = gba_rumble::Gpio;
// Activate the cartridge's rumble. This will continue until `stop()` is called.
gpio.start();
// Deactivate the cartridge's rumble.
gpio.stop();
To use the Game Boy Player's rubmle functionality, detect the Game Boy Player by calling GameBoyPlayer::detect() at the beginning of your program.
if let Some(game_boy_player) = gba_rumble::GameBoyPlayer::detect() {
// When a Game Boy Player is detected, you can interact with it through the returned
// `GameBoyPlayer` object.
//
// To actually use it, you must also call `game_boy_player_interrupt()` when a serial
// interrupt is received. This will be specific to your own code and any frameworks you may
// be using.
// Update the serial connection once a frame.
game_boy_player.update();
// Activate rumble in the controller. This will continue until `stop()` is called.
game_boy_player.start();
// Deactivate rumble in the controller.
game_boy_player.stop();
}
This project is licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.