fix rename of gba -> agb

This commit is contained in:
Corwin Kuiper 2021-04-15 22:10:00 +01:00 committed by Corwin
parent 12ca9e522c
commit d761714f62
7 changed files with 33 additions and 33 deletions

View file

@ -1,9 +1,9 @@
#![no_std] #![no_std]
#![feature(start)] #![feature(start)]
extern crate gba; extern crate agb;
use gba::display; use agb::display;
struct Vector2D { struct Vector2D {
x: i32, x: i32,
@ -12,11 +12,11 @@ struct Vector2D {
#[start] #[start]
fn main(_argc: isize, _argv: *const *const u8) -> isize { fn main(_argc: isize, _argv: *const *const u8) -> isize {
let mut gba = gba::Gba::new(); let mut gba = agb::Gba::new();
let mut bitmap = gba.display.video.bitmap3(); let mut bitmap = gba.display.video.bitmap3();
let vblank = gba.display.vblank.get(); let vblank = gba.display.vblank.get();
let mut input = gba::input::ButtonController::new(); let mut input = agb::input::ButtonController::new();
let mut pos = Vector2D { let mut pos = Vector2D {
x: display::WIDTH / 2, x: display::WIDTH / 2,
y: display::HEIGHT / 2, y: display::HEIGHT / 2,

View file

@ -1,13 +1,13 @@
#![no_std] #![no_std]
#![feature(start)] #![feature(start)]
extern crate gba; extern crate agb;
use gba::display; use agb::display;
#[start] #[start]
fn main(_argc: isize, _argv: *const *const u8) -> isize { fn main(_argc: isize, _argv: *const *const u8) -> isize {
let mut gba = gba::Gba::new(); let mut gba = agb::Gba::new();
let mut bitmap = gba.display.video.bitmap4(); let mut bitmap = gba.display.video.bitmap4();
let vblank = gba.display.vblank.get(); let vblank = gba.display.vblank.get();

View file

@ -1,12 +1,12 @@
#![no_std] #![no_std]
#![feature(start)] #![feature(start)]
extern crate gba; extern crate agb;
use core::convert::TryInto; use agb::{
use gba::{
display::{object::ObjectStandard, tiled0, HEIGHT, WIDTH}, display::{object::ObjectStandard, tiled0, HEIGHT, WIDTH},
input::Button, input::Button,
}; };
use core::convert::TryInto;
#[derive(PartialEq, Eq)] #[derive(PartialEq, Eq)]
enum State { enum State {
@ -43,10 +43,10 @@ fn main(_argc: isize, _argv: *const *const u8) -> isize {
.unwrap() .unwrap()
}; };
let mut gba = gba::Gba::new(); let mut gba = agb::Gba::new();
let mut gfx = gba.display.video.tiled0(); let mut gfx = gba.display.video.tiled0();
let vblank = gba.display.vblank.get(); let vblank = gba.display.vblank.get();
let mut input = gba::input::ButtonController::new(); let mut input = agb::input::ButtonController::new();
gfx.set_sprite_palette(&CHICKEN_PALETTE); gfx.set_sprite_palette(&CHICKEN_PALETTE);
gfx.set_sprite_tilemap(&CHICKEN_TILES); gfx.set_sprite_tilemap(&CHICKEN_TILES);

View file

@ -1,9 +1,9 @@
#![no_std] #![no_std]
#![feature(start)] #![feature(start)]
extern crate gba; extern crate agb;
use gba::display; use agb::display;
struct Vector2D { struct Vector2D {
x: i32, x: i32,
@ -12,9 +12,9 @@ struct Vector2D {
#[start] #[start]
fn main(_argc: isize, _argv: *const *const u8) -> isize { fn main(_argc: isize, _argv: *const *const u8) -> isize {
let mut gba = gba::Gba::new(); let mut gba = agb::Gba::new();
let mut vblank = gba.display.vblank.get(); let mut vblank = gba.display.vblank.get();
let mut input = gba::input::ButtonController::new(); let mut input = agb::input::ButtonController::new();
loop { loop {
bitmap3_mode(&mut gba.display.video.bitmap3(), &mut vblank, &mut input); bitmap3_mode(&mut gba.display.video.bitmap3(), &mut vblank, &mut input);
@ -25,7 +25,7 @@ fn main(_argc: isize, _argv: *const *const u8) -> isize {
fn bitmap3_mode( fn bitmap3_mode(
bitmap: &mut display::bitmap3::Bitmap3, bitmap: &mut display::bitmap3::Bitmap3,
vblank: &mut display::vblank::VBlank, vblank: &mut display::vblank::VBlank,
input: &mut gba::input::ButtonController, input: &mut agb::input::ButtonController,
) { ) {
let mut pos = Vector2D { let mut pos = Vector2D {
x: display::WIDTH / 2, x: display::WIDTH / 2,
@ -36,7 +36,7 @@ fn bitmap3_mode(
vblank.wait_for_VBlank(); vblank.wait_for_VBlank();
input.update(); input.update();
if input.is_just_pressed(gba::input::Button::B) { if input.is_just_pressed(agb::input::Button::B) {
break; break;
} }
@ -52,7 +52,7 @@ fn bitmap3_mode(
fn bitmap4_mode( fn bitmap4_mode(
bitmap: &mut display::bitmap4::Bitmap4, bitmap: &mut display::bitmap4::Bitmap4,
vblank: &mut display::vblank::VBlank, vblank: &mut display::vblank::VBlank,
input: &mut gba::input::ButtonController, input: &mut agb::input::ButtonController,
) { ) {
bitmap.set_palette_entry(1, 0x001F); bitmap.set_palette_entry(1, 0x001F);
bitmap.set_palette_entry(2, 0x03E0); bitmap.set_palette_entry(2, 0x03E0);
@ -75,7 +75,7 @@ fn bitmap4_mode(
vblank.wait_for_VBlank(); vblank.wait_for_VBlank();
input.update(); input.update();
if input.is_just_pressed(gba::input::Button::B) { if input.is_just_pressed(agb::input::Button::B) {
break; break;
} }

View file

@ -1,11 +1,11 @@
#![no_std] #![no_std]
#![feature(start)] #![feature(start)]
extern crate gba; extern crate agb;
#[start] #[start]
fn main(_argc: isize, _argv: *const *const u8) -> isize { fn main(_argc: isize, _argv: *const *const u8) -> isize {
let mut gba = gba::Gba::new(); let mut gba = agb::Gba::new();
let mut mgba = gba::mgba::Mgba::new().unwrap(); let mut mgba = agb::mgba::Mgba::new().unwrap();
let vblank = gba.display.vblank.get(); let vblank = gba.display.vblank.get();
@ -15,7 +15,7 @@ fn main(_argc: isize, _argv: *const *const u8) -> isize {
mgba.print( mgba.print(
format_args!("Hello, world, frame = {}", count), format_args!("Hello, world, frame = {}", count),
gba::mgba::DebugLevel::Info, agb::mgba::DebugLevel::Info,
) )
.unwrap(); .unwrap();

View file

@ -1,24 +1,24 @@
#![no_std] #![no_std]
#![feature(start)] #![feature(start)]
extern crate gba; extern crate agb;
use gba::display; use agb::display;
#[start] #[start]
fn main(_argc: isize, _argv: *const *const u8) -> isize { fn main(_argc: isize, _argv: *const *const u8) -> isize {
let mut gba = gba::Gba::new(); let mut gba = agb::Gba::new();
let mut bitmap = gba.display.video.bitmap3(); let mut bitmap = gba.display.video.bitmap3();
let mut input = gba::input::ButtonController::new(); let mut input = agb::input::ButtonController::new();
loop { loop {
input.update(); input.update();
// if A is pressed, draw out of range // if A is pressed, draw out of range
if input.is_just_pressed(gba::input::Button::A) { if input.is_just_pressed(agb::input::Button::A) {
bitmap.draw_point(display::WIDTH, 0, 0x05); bitmap.draw_point(display::WIDTH, 0, 0x05);
} }
if input.is_just_pressed(gba::input::Button::B) { if input.is_just_pressed(agb::input::Button::B) {
#[allow(arithmetic_overflow)] #[allow(arithmetic_overflow)]
let _p = core::i32::MAX + 1; let _p = core::i32::MAX + 1;
} }

View file

@ -1,12 +1,12 @@
#![no_std] #![no_std]
#![feature(start)] #![feature(start)]
extern crate gba; extern crate agb;
use gba::{display, syscall}; use agb::{display, syscall};
#[start] #[start]
fn main(_argc: isize, _argv: *const *const u8) -> isize { fn main(_argc: isize, _argv: *const *const u8) -> isize {
let mut gba = gba::Gba::new(); let mut gba = agb::Gba::new();
let mut bitmap = gba.display.video.bitmap3(); let mut bitmap = gba.display.video.bitmap3();
for x in 0..display::WIDTH { for x in 0..display::WIDTH {