changed little things in the arduboy-rust crate & added gamelogic of drboy

This commit is contained in:
Zenn 2023-08-21 05:24:03 +02:00
parent ae84c66d13
commit 6be633cc9b
10 changed files with 340 additions and 86 deletions

View file

@ -40,6 +40,7 @@ impl Not for Color {
}
}
/// This struct is used by a few Arduboy functions.
#[derive(Debug, Clone, Copy)]
pub struct Rect {
/// Position X
pub x: i16,
@ -51,6 +52,7 @@ pub struct Rect {
pub height: u8,
}
/// This struct is used by a few Arduboy functions.
#[derive(Debug, Clone, Copy)]
pub struct Point {
/// Position X
pub x: i16,

View file

@ -80,7 +80,7 @@ pub(super) use progmem;
#[macro_export]
macro_rules! get_sprite_addr {
( $s:expr ) => {
addr_of!($s) as *const u8
unsafe { addr_of!($s) as *const u8 }
};
}
pub(super) use get_sprite_addr;
@ -89,7 +89,7 @@ pub(super) use get_sprite_addr;
#[macro_export]
macro_rules! get_tones_addr {
( $s:expr ) => {
addr_of!($s) as *const u16
unsafe { addr_of!($s) as *const u16 }
};
}
pub(super) use get_tones_addr;
@ -99,7 +99,7 @@ pub(super) use get_tones_addr;
macro_rules! get_string_addr {
( $s:expr ) => {
Pstring {
pointer: addr_of!($s) as *const i8,
pointer: unsafe { addr_of!($s) as *const i8 },
}
};
}