mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-25 01:01:34 +11:00
change name to "get"
This commit is contained in:
parent
37c29b7ec3
commit
7b46bc9703
|
@ -14,7 +14,7 @@ struct Vector2D {
|
||||||
pub fn main() -> ! {
|
pub 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::new();
|
let vblank = agb::interrupt::VBlank::get();
|
||||||
|
|
||||||
let mut input = agb::input::ButtonController::new();
|
let mut input = agb::input::ButtonController::new();
|
||||||
let mut pos = Vector2D {
|
let mut pos = Vector2D {
|
||||||
|
|
|
@ -9,7 +9,7 @@ use agb::display;
|
||||||
pub fn main() -> ! {
|
pub 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::new();
|
let vblank = agb::interrupt::VBlank::get();
|
||||||
|
|
||||||
bitmap.set_palette_entry(1, 0x001F);
|
bitmap.set_palette_entry(1, 0x001F);
|
||||||
bitmap.set_palette_entry(2, 0x03E0);
|
bitmap.set_palette_entry(2, 0x03E0);
|
||||||
|
|
|
@ -45,7 +45,7 @@ pub 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();
|
||||||
let vblank = agb::interrupt::VBlank::new();
|
let vblank = agb::interrupt::VBlank::get();
|
||||||
let mut input = agb::input::ButtonController::new();
|
let mut input = agb::input::ButtonController::new();
|
||||||
|
|
||||||
gfx.set_sprite_palette_raw(&CHICKEN_PALETTE);
|
gfx.set_sprite_palette_raw(&CHICKEN_PALETTE);
|
||||||
|
|
|
@ -15,7 +15,7 @@ const I_WILL_NOT_LET_YOU_LET_ME_DOWN: &[u8] = include_bytes!("i-will-not-let-you
|
||||||
pub fn main() -> ! {
|
pub 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::new();
|
let vblank_provider = agb::interrupt::VBlank::get();
|
||||||
|
|
||||||
let mut mixer = gba.mixer.mixer();
|
let mut mixer = gba.mixer.mixer();
|
||||||
mixer.enable();
|
mixer.enable();
|
||||||
|
|
|
@ -13,7 +13,7 @@ struct Vector2D {
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub fn main() -> ! {
|
pub fn main() -> ! {
|
||||||
let mut gba = agb::Gba::new();
|
let mut gba = agb::Gba::new();
|
||||||
let vblank = agb::interrupt::VBlank::new();
|
let vblank = agb::interrupt::VBlank::get();
|
||||||
let mut input = agb::input::ButtonController::new();
|
let mut input = agb::input::ButtonController::new();
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
extern crate agb;
|
extern crate agb;
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub fn main() -> ! {
|
pub fn main() -> ! {
|
||||||
let vblank = agb::interrupt::VBlank::new();
|
let vblank = agb::interrupt::VBlank::get();
|
||||||
|
|
||||||
let mut count = 0;
|
let mut count = 0;
|
||||||
loop {
|
loop {
|
||||||
|
|
|
@ -45,7 +45,7 @@ pub fn main() -> ! {
|
||||||
backc.row += 1;
|
backc.row += 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
let vblank = agb::interrupt::VBlank::new();
|
let vblank = agb::interrupt::VBlank::get();
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
vblank.wait_for_vblank();
|
vblank.wait_for_vblank();
|
||||||
|
|
|
@ -257,7 +257,7 @@ fn test_vblank_interrupt_handler(_gba: &mut crate::Gba) {
|
||||||
add_interrupt_handler!(Interrupt::VBlank, || *counter.lock() += 1);
|
add_interrupt_handler!(Interrupt::VBlank, || *counter.lock() += 1);
|
||||||
add_interrupt_handler!(Interrupt::VBlank, || *counter_2.lock() += 1);
|
add_interrupt_handler!(Interrupt::VBlank, || *counter_2.lock() += 1);
|
||||||
|
|
||||||
let vblank = VBlank::new();
|
let vblank = VBlank::get();
|
||||||
|
|
||||||
while *counter.lock() < 100 || *counter_2.lock() < 100 {
|
while *counter.lock() < 100 || *counter_2.lock() < 100 {
|
||||||
vblank.wait_for_vblank();
|
vblank.wait_for_vblank();
|
||||||
|
@ -353,7 +353,7 @@ impl<'a, T> DerefMut for MutexRef<'a, T> {
|
||||||
pub struct VBlank {}
|
pub struct VBlank {}
|
||||||
|
|
||||||
impl VBlank {
|
impl VBlank {
|
||||||
pub fn new() -> Self {
|
pub fn get() -> Self {
|
||||||
interrupt_to_root(Interrupt::VBlank).add();
|
interrupt_to_root(Interrupt::VBlank).add();
|
||||||
VBlank {}
|
VBlank {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,7 +164,7 @@ mod test {
|
||||||
|
|
||||||
#[test_case]
|
#[test_case]
|
||||||
fn wait_30_frames(_gba: &mut Gba) {
|
fn wait_30_frames(_gba: &mut Gba) {
|
||||||
let vblank = crate::interrupt::VBlank::new();
|
let vblank = crate::interrupt::VBlank::get();
|
||||||
let mut counter = 0;
|
let mut counter = 0;
|
||||||
loop {
|
loop {
|
||||||
if counter > 30 {
|
if counter > 30 {
|
||||||
|
|
Loading…
Reference in a new issue