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]
#![feature(start)]
extern crate gba;
extern crate agb;
use gba::display;
use agb::display;
struct Vector2D {
x: i32,
@ -12,11 +12,11 @@ struct Vector2D {
#[start]
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 vblank = gba.display.vblank.get();
let mut input = gba::input::ButtonController::new();
let mut input = agb::input::ButtonController::new();
let mut pos = Vector2D {
x: display::WIDTH / 2,
y: display::HEIGHT / 2,

View file

@ -1,13 +1,13 @@
#![no_std]
#![feature(start)]
extern crate gba;
extern crate agb;
use gba::display;
use agb::display;
#[start]
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 vblank = gba.display.vblank.get();

View file

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

View file

@ -1,9 +1,9 @@
#![no_std]
#![feature(start)]
extern crate gba;
extern crate agb;
use gba::display;
use agb::display;
struct Vector2D {
x: i32,
@ -12,9 +12,9 @@ struct Vector2D {
#[start]
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 input = gba::input::ButtonController::new();
let mut input = agb::input::ButtonController::new();
loop {
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(
bitmap: &mut display::bitmap3::Bitmap3,
vblank: &mut display::vblank::VBlank,
input: &mut gba::input::ButtonController,
input: &mut agb::input::ButtonController,
) {
let mut pos = Vector2D {
x: display::WIDTH / 2,
@ -36,7 +36,7 @@ fn bitmap3_mode(
vblank.wait_for_VBlank();
input.update();
if input.is_just_pressed(gba::input::Button::B) {
if input.is_just_pressed(agb::input::Button::B) {
break;
}
@ -52,7 +52,7 @@ fn bitmap3_mode(
fn bitmap4_mode(
bitmap: &mut display::bitmap4::Bitmap4,
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(2, 0x03E0);
@ -75,7 +75,7 @@ fn bitmap4_mode(
vblank.wait_for_VBlank();
input.update();
if input.is_just_pressed(gba::input::Button::B) {
if input.is_just_pressed(agb::input::Button::B) {
break;
}

View file

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

View file

@ -1,24 +1,24 @@
#![no_std]
#![feature(start)]
extern crate gba;
extern crate agb;
use gba::display;
use agb::display;
#[start]
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 input = gba::input::ButtonController::new();
let mut input = agb::input::ButtonController::new();
loop {
input.update();
// 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);
}
if input.is_just_pressed(gba::input::Button::B) {
if input.is_just_pressed(agb::input::Button::B) {
#[allow(arithmetic_overflow)]
let _p = core::i32::MAX + 1;
}

View file

@ -1,12 +1,12 @@
#![no_std]
#![feature(start)]
extern crate gba;
use gba::{display, syscall};
extern crate agb;
use agb::{display, syscall};
#[start]
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();
for x in 0..display::WIDTH {