Skip to content

Commit

Permalink
partly fix the examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lokathor committed Aug 27, 2024
1 parent 1578771 commit ec4104a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/game_vblank_draw.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![no_std]
#![no_main]

use gba::prelude::*;
use gba::{prelude::*, RUST_IRQ_HANDLER};

#[panic_handler]
fn panic_handler(info: &core::panic::PanicInfo) -> ! {
Expand Down
8 changes: 4 additions & 4 deletions examples/hello.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#![no_main]

use core::fmt::Write;
use gba::prelude::*;
use gba::{prelude::*, RUST_IRQ_HANDLER};

#[panic_handler]
fn panic_handler(info: &core::panic::PanicInfo) -> ! {
Expand Down Expand Up @@ -36,16 +36,16 @@ extern "C" fn main() -> ! {
writeln!(logger, "hello!").ok();

let fx_u: Fixed<u32, 8> =
Fixed::<u32, 8>::wrapping_from(7) + Fixed::<u32, 8>::from_raw(12);
Fixed::<u32, 8>::wrapping_from(7) + Fixed::<u32, 8>::from_bits(12);
writeln!(logger, "fixed unsigned: {fx_u:?}").ok();

let fx_i1: Fixed<i32, 8> =
Fixed::<i32, 8>::wrapping_from(8) + Fixed::<i32, 8>::from_raw(15);
Fixed::<i32, 8>::wrapping_from(8) + Fixed::<i32, 8>::from_bits(15);
writeln!(logger, "fixed signed positive: {fx_i1:?}").ok();

let fx_i2: Fixed<i32, 8> = Fixed::<i32, 8>::wrapping_from(0)
- Fixed::<i32, 8>::wrapping_from(3)
- Fixed::<i32, 8>::from_raw(17);
- Fixed::<i32, 8>::from_bits(17);
writeln!(logger, "fixed signed negative: {fx_i2:?}").ok();
}

Expand Down
2 changes: 1 addition & 1 deletion examples/mode3_pong_example_game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#![no_std]
#![no_main]

use gba::{mem_fns::__aeabi_memset, prelude::*};
use gba::{prelude::*, RUST_IRQ_HANDLER};

const SCREEN_WIDTH: u16 = 240;
const SCREEN_HEIGHT: u16 = 160;
Expand Down
2 changes: 1 addition & 1 deletion examples/video3_test.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![no_std]
#![no_main]

use gba::{mem_fns::__aeabi_memcpy, prelude::*};
use gba::prelude::*;

#[panic_handler]
fn panic_handler(info: &core::panic::PanicInfo) -> ! {
Expand Down
2 changes: 1 addition & 1 deletion examples/video4_test.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![no_std]
#![no_main]

use gba::{mem_fns::__aeabi_memcpy, prelude::*};
use gba::prelude::*;

#[panic_handler]
fn panic_handler(info: &core::panic::PanicInfo) -> ! {
Expand Down

0 comments on commit ec4104a

Please sign in to comment.