Use the new entrypoint macro in all the examples

This commit is contained in:
Gwilym Kuiper 2021-08-07 16:36:41 +01:00
parent d2a4d0d1c3
commit 861ecc626a
11 changed files with 23 additions and 22 deletions

View file

@ -5,8 +5,8 @@ extern crate agb;
use agb::sound; use agb::sound;
#[no_mangle] #[agb::entry]
pub fn main() -> ! { fn main() -> ! {
let gba = agb::Gba::new(); let gba = agb::Gba::new();
gba.sound.enable(); gba.sound.enable();

View file

@ -10,8 +10,8 @@ struct Vector2D {
y: i32, y: i32,
} }
#[no_mangle] #[agb::entry]
pub fn main() -> ! { fn main() -> ! {
let mut gba = agb::Gba::new(); let mut gba = agb::Gba::new();
let mut bitmap = gba.display.video.bitmap3(); let mut bitmap = gba.display.video.bitmap3();
let vblank = agb::interrupt::VBlank::get(); let vblank = agb::interrupt::VBlank::get();

View file

@ -5,8 +5,8 @@ extern crate agb;
use agb::display; use agb::display;
#[no_mangle] #[agb::entry]
pub fn main() -> ! { fn main() -> ! {
let mut gba = agb::Gba::new(); let mut gba = agb::Gba::new();
let mut bitmap = gba.display.video.bitmap4(); let mut bitmap = gba.display.video.bitmap4();
let vblank = agb::interrupt::VBlank::get(); let vblank = agb::interrupt::VBlank::get();

View file

@ -35,8 +35,8 @@ fn frame_ranger(count: u32, start: u32, end: u32, delay: u32) -> u16 {
(((count / delay) % (end + 1 - start)) + start) as u16 (((count / delay) % (end + 1 - start)) + start) as u16
} }
#[no_mangle] #[agb::entry]
pub fn main() -> ! { fn main() -> ! {
let map_as_grid: &[[u16; 32]; 32] = unsafe { let map_as_grid: &[[u16; 32]; 32] = unsafe {
(&MAP_MAP as *const [u16; 1024] as *const [[u16; 32]; 32]) (&MAP_MAP as *const [u16; 1024] as *const [[u16; 32]; 32])
.as_ref() .as_ref()

View file

@ -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 // 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"); const I_WILL_NOT_LET_YOU_LET_ME_DOWN: &[u8] = include_bytes!("i-will-not-let-you-let-me-down.raw");
#[no_mangle] #[agb::entry]
pub fn main() -> ! { fn main() -> ! {
let mut gba = Gba::new(); let mut gba = Gba::new();
let mut input = ButtonController::new(); let mut input = ButtonController::new();
let vblank_provider = agb::interrupt::VBlank::get(); let vblank_provider = agb::interrupt::VBlank::get();

View file

@ -10,8 +10,8 @@ struct Vector2D {
y: i32, y: i32,
} }
#[no_mangle] #[agb::entry]
pub fn main() -> ! { fn main() -> ! {
let mut gba = agb::Gba::new(); let mut gba = agb::Gba::new();
let vblank = agb::interrupt::VBlank::get(); let vblank = agb::interrupt::VBlank::get();
let mut input = agb::input::ButtonController::new(); let mut input = agb::input::ButtonController::new();

View file

@ -2,8 +2,9 @@
#![no_main] #![no_main]
extern crate agb; extern crate agb;
#[no_mangle]
pub fn main() -> ! { #[agb::entry]
fn main() -> ! {
let count = agb::interrupt::Mutex::new(0); let count = agb::interrupt::Mutex::new(0);
agb::add_interrupt_handler!(agb::interrupt::Interrupt::VBlank, |key| { agb::add_interrupt_handler!(agb::interrupt::Interrupt::VBlank, |key| {
let mut count = count.lock_with_key(&key); let mut count = count.lock_with_key(&key);

View file

@ -5,8 +5,8 @@ extern crate agb;
use agb::display; use agb::display;
#[no_mangle] #[agb::entry]
pub fn main() -> ! { fn main() -> ! {
let mut gba = agb::Gba::new(); let mut gba = agb::Gba::new();
let mut bitmap = gba.display.video.bitmap3(); let mut bitmap = gba.display.video.bitmap3();

View file

@ -4,8 +4,8 @@
extern crate agb; extern crate agb;
use agb::{display, syscall}; use agb::{display, syscall};
#[no_mangle] #[agb::entry]
pub fn main() -> ! { fn main() -> ! {
let mut gba = agb::Gba::new(); let mut gba = agb::Gba::new();
let mut bitmap = gba.display.video.bitmap3(); let mut bitmap = gba.display.video.bitmap3();

View file

@ -5,8 +5,8 @@ extern crate agb;
use agb::display::example_logo; use agb::display::example_logo;
#[no_mangle] #[agb::entry]
pub fn main() -> ! { fn main() -> ! {
let mut gba = agb::Gba::new(); let mut gba = agb::Gba::new();
let mut gfx = gba.display.video.tiled0(); let mut gfx = gba.display.video.tiled0();

View file

@ -14,8 +14,8 @@ struct BackCosines {
row: usize, row: usize,
} }
#[no_mangle] #[agb::entry]
pub fn main() -> ! { fn main() -> ! {
let mut gba = agb::Gba::new(); let mut gba = agb::Gba::new();
let mut gfx = gba.display.video.tiled0(); let mut gfx = gba.display.video.tiled0();