From 861ecc626ab33c79dc4aece9f325e00f180eda56 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Sat, 7 Aug 2021 16:36:41 +0100 Subject: [PATCH] Use the new entrypoint macro in all the examples --- agb/examples/beep.rs | 4 ++-- agb/examples/bitmap3.rs | 4 ++-- agb/examples/bitmap4.rs | 4 ++-- agb/examples/chicken.rs | 4 ++-- agb/examples/mixer_basic.rs | 4 ++-- agb/examples/multiple_video.rs | 4 ++-- agb/examples/output.rs | 5 +++-- agb/examples/panic.rs | 4 ++-- agb/examples/syscall.rs | 4 ++-- agb/examples/test_logo.rs | 4 ++-- agb/examples/wave.rs | 4 ++-- 11 files changed, 23 insertions(+), 22 deletions(-) diff --git a/agb/examples/beep.rs b/agb/examples/beep.rs index e6f6cefa..ec377000 100644 --- a/agb/examples/beep.rs +++ b/agb/examples/beep.rs @@ -5,8 +5,8 @@ extern crate agb; use agb::sound; -#[no_mangle] -pub fn main() -> ! { +#[agb::entry] +fn main() -> ! { let gba = agb::Gba::new(); gba.sound.enable(); diff --git a/agb/examples/bitmap3.rs b/agb/examples/bitmap3.rs index 06fb89c6..702dcb82 100644 --- a/agb/examples/bitmap3.rs +++ b/agb/examples/bitmap3.rs @@ -10,8 +10,8 @@ struct Vector2D { y: i32, } -#[no_mangle] -pub fn main() -> ! { +#[agb::entry] +fn main() -> ! { let mut gba = agb::Gba::new(); let mut bitmap = gba.display.video.bitmap3(); let vblank = agb::interrupt::VBlank::get(); diff --git a/agb/examples/bitmap4.rs b/agb/examples/bitmap4.rs index b097e688..09af1688 100644 --- a/agb/examples/bitmap4.rs +++ b/agb/examples/bitmap4.rs @@ -5,8 +5,8 @@ extern crate agb; use agb::display; -#[no_mangle] -pub fn main() -> ! { +#[agb::entry] +fn main() -> ! { let mut gba = agb::Gba::new(); let mut bitmap = gba.display.video.bitmap4(); let vblank = agb::interrupt::VBlank::get(); diff --git a/agb/examples/chicken.rs b/agb/examples/chicken.rs index 8650730d..6cabaccf 100644 --- a/agb/examples/chicken.rs +++ b/agb/examples/chicken.rs @@ -35,8 +35,8 @@ fn frame_ranger(count: u32, start: u32, end: u32, delay: u32) -> u16 { (((count / delay) % (end + 1 - start)) + start) as u16 } -#[no_mangle] -pub fn main() -> ! { +#[agb::entry] +fn main() -> ! { let map_as_grid: &[[u16; 32]; 32] = unsafe { (&MAP_MAP as *const [u16; 1024] as *const [[u16; 32]; 32]) .as_ref() diff --git a/agb/examples/mixer_basic.rs b/agb/examples/mixer_basic.rs index b26deda6..dd1bafb3 100644 --- a/agb/examples/mixer_basic.rs +++ b/agb/examples/mixer_basic.rs @@ -11,8 +11,8 @@ use agb::Gba; // Music - "I will not let you let me down" by Josh Woodward, free download at http://joshwoodward.com const I_WILL_NOT_LET_YOU_LET_ME_DOWN: &[u8] = include_bytes!("i-will-not-let-you-let-me-down.raw"); -#[no_mangle] -pub fn main() -> ! { +#[agb::entry] +fn main() -> ! { let mut gba = Gba::new(); let mut input = ButtonController::new(); let vblank_provider = agb::interrupt::VBlank::get(); diff --git a/agb/examples/multiple_video.rs b/agb/examples/multiple_video.rs index 174241e1..4b1ffd50 100644 --- a/agb/examples/multiple_video.rs +++ b/agb/examples/multiple_video.rs @@ -10,8 +10,8 @@ struct Vector2D { y: i32, } -#[no_mangle] -pub fn main() -> ! { +#[agb::entry] +fn main() -> ! { let mut gba = agb::Gba::new(); let vblank = agb::interrupt::VBlank::get(); let mut input = agb::input::ButtonController::new(); diff --git a/agb/examples/output.rs b/agb/examples/output.rs index 747c806e..b7d17e96 100644 --- a/agb/examples/output.rs +++ b/agb/examples/output.rs @@ -2,8 +2,9 @@ #![no_main] extern crate agb; -#[no_mangle] -pub fn main() -> ! { + +#[agb::entry] +fn main() -> ! { let count = agb::interrupt::Mutex::new(0); agb::add_interrupt_handler!(agb::interrupt::Interrupt::VBlank, |key| { let mut count = count.lock_with_key(&key); diff --git a/agb/examples/panic.rs b/agb/examples/panic.rs index cc45c782..80fd6d7b 100644 --- a/agb/examples/panic.rs +++ b/agb/examples/panic.rs @@ -5,8 +5,8 @@ extern crate agb; use agb::display; -#[no_mangle] -pub fn main() -> ! { +#[agb::entry] +fn main() -> ! { let mut gba = agb::Gba::new(); let mut bitmap = gba.display.video.bitmap3(); diff --git a/agb/examples/syscall.rs b/agb/examples/syscall.rs index 4b99a11d..6bd8c2fe 100644 --- a/agb/examples/syscall.rs +++ b/agb/examples/syscall.rs @@ -4,8 +4,8 @@ extern crate agb; use agb::{display, syscall}; -#[no_mangle] -pub fn main() -> ! { +#[agb::entry] +fn main() -> ! { let mut gba = agb::Gba::new(); let mut bitmap = gba.display.video.bitmap3(); diff --git a/agb/examples/test_logo.rs b/agb/examples/test_logo.rs index 6eddc02b..dad1d98e 100644 --- a/agb/examples/test_logo.rs +++ b/agb/examples/test_logo.rs @@ -5,8 +5,8 @@ extern crate agb; use agb::display::example_logo; -#[no_mangle] -pub fn main() -> ! { +#[agb::entry] +fn main() -> ! { let mut gba = agb::Gba::new(); let mut gfx = gba.display.video.tiled0(); diff --git a/agb/examples/wave.rs b/agb/examples/wave.rs index c25f3260..fdf59877 100644 --- a/agb/examples/wave.rs +++ b/agb/examples/wave.rs @@ -14,8 +14,8 @@ struct BackCosines { row: usize, } -#[no_mangle] -pub fn main() -> ! { +#[agb::entry] +fn main() -> ! { let mut gba = agb::Gba::new(); let mut gfx = gba.display.video.tiled0();