mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 16:21:33 +11:00
28 lines
578 B
Rust
28 lines
578 B
Rust
#![no_std]
|
|
#![no_main]
|
|
|
|
extern crate alloc;
|
|
|
|
use agb::sound::mixer::Frequency;
|
|
use agb::Gba;
|
|
use agb_tracker::{include_xm, Track, Tracker};
|
|
|
|
static SPECTRUM: Track = include_xm!("examples/tracks/peak_and_drozerix_-_spectrum.xm");
|
|
|
|
#[agb::entry]
|
|
fn main(mut gba: Gba) -> ! {
|
|
let vblank_provider = agb::interrupt::VBlank::get();
|
|
|
|
let mut mixer = gba.mixer.mixer(Frequency::Hz32768);
|
|
mixer.enable();
|
|
|
|
let mut tracker = Tracker::new(&SPECTRUM);
|
|
|
|
loop {
|
|
tracker.step(&mut mixer);
|
|
mixer.frame();
|
|
|
|
vblank_provider.wait_for_vblank();
|
|
}
|
|
}
|