mirror of
https://github.com/italicsjenga/gba.git
synced 2025-01-11 11:31:31 +11:00
more proc-macro
This commit is contained in:
parent
cb5d856e00
commit
6cb50aa2eb
|
@ -12,7 +12,7 @@ license = "Apache-2.0"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
gba-proc-macro = "0.2"
|
gba-proc-macro = "0.2.1"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
lto = true
|
lto = true
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
// TODO(lokathor): IO Register newtypes.
|
// TODO(lokathor): IO Register newtypes.
|
||||||
|
|
||||||
use gba_proc_macro::register_bit;
|
use gba_proc_macro::{newtype, register_bit};
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
@ -24,10 +24,11 @@ use super::*;
|
||||||
/// * [gbatek entry](http://problemkaputt.de/gbatek.htm#lcdiodisplaycontrol)
|
/// * [gbatek entry](http://problemkaputt.de/gbatek.htm#lcdiodisplaycontrol)
|
||||||
pub const DISPCNT: VolatilePtr<u16> = VolatilePtr(0x4000000 as *mut u16);
|
pub const DISPCNT: VolatilePtr<u16> = VolatilePtr(0x4000000 as *mut u16);
|
||||||
|
|
||||||
/// A newtype over the various display control options that you have on a GBA.
|
newtype!(
|
||||||
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
|
DisplayControlSetting,
|
||||||
#[repr(transparent)]
|
u16,
|
||||||
pub struct DisplayControlSetting(u16);
|
"A newtype over the various display control options that you have on a GBA."
|
||||||
|
);
|
||||||
|
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
impl DisplayControlSetting {
|
impl DisplayControlSetting {
|
||||||
|
@ -388,11 +389,6 @@ pub const SIODATA8: VolatilePtr<u16> = VolatilePtr(0x400012A as *mut u16);
|
||||||
/// Key Status
|
/// Key Status
|
||||||
pub const KEYINPUT: VolatilePtr<u16> = VolatilePtr(0x4000130 as *mut u16);
|
pub const KEYINPUT: VolatilePtr<u16> = VolatilePtr(0x4000130 as *mut u16);
|
||||||
|
|
||||||
/// A newtype over the key input state of the GBA.
|
|
||||||
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
|
|
||||||
#[repr(transparent)]
|
|
||||||
pub struct KeyInputSetting(u16);
|
|
||||||
|
|
||||||
/// A "tribool" value helps us interpret the arrow pad.
|
/// A "tribool" value helps us interpret the arrow pad.
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
#[repr(i32)]
|
#[repr(i32)]
|
||||||
|
@ -403,6 +399,8 @@ pub enum TriBool {
|
||||||
Plus = 1,
|
Plus = 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newtype!(KeyInputSetting, u16, "A newtype over the key input state of the GBA");
|
||||||
|
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
impl KeyInputSetting {
|
impl KeyInputSetting {
|
||||||
register_bit!(A_BIT, u16, 1 << 0, a_pressed);
|
register_bit!(A_BIT, u16, 1 << 0, a_pressed);
|
||||||
|
|
Loading…
Reference in a new issue