2023-07-13 00:38:09 +10:00
|
|
|
#![no_std]
|
|
|
|
#![no_main]
|
|
|
|
|
2024-06-05 18:55:07 +10:00
|
|
|
extern crate alloc;
|
|
|
|
|
2023-07-13 00:38:09 +10:00
|
|
|
use agb::sound::mixer::Frequency;
|
|
|
|
use agb::Gba;
|
2023-07-24 05:22:22 +10:00
|
|
|
use agb_tracker::{include_xm, Track, Tracker};
|
2023-07-13 00:38:09 +10:00
|
|
|
|
2024-08-29 02:46:35 +10:00
|
|
|
static SPECTRUM: Track = include_xm!("examples/tracks/peak_and_drozerix_-_spectrum.xm");
|
2023-07-13 00:38:09 +10:00
|
|
|
|
|
|
|
#[agb::entry]
|
|
|
|
fn main(mut gba: Gba) -> ! {
|
|
|
|
let vblank_provider = agb::interrupt::VBlank::get();
|
|
|
|
|
2023-09-06 08:22:50 +10:00
|
|
|
let mut mixer = gba.mixer.mixer(Frequency::Hz32768);
|
2023-07-13 00:38:09 +10:00
|
|
|
mixer.enable();
|
|
|
|
|
2024-08-29 02:46:35 +10:00
|
|
|
let mut tracker = Tracker::new(&SPECTRUM);
|
2023-07-13 02:36:41 +10:00
|
|
|
|
2023-07-13 00:38:09 +10:00
|
|
|
loop {
|
2023-07-13 02:36:41 +10:00
|
|
|
tracker.step(&mut mixer);
|
2023-07-13 00:38:09 +10:00
|
|
|
mixer.frame();
|
2023-07-19 07:49:56 +10:00
|
|
|
|
2023-07-13 00:38:09 +10:00
|
|
|
vblank_provider.wait_for_vblank();
|
|
|
|
}
|
|
|
|
}
|