Skip to content

Commit

Permalink
rename gba_fixed methods to match the fixed crate's method names fo…
Browse files Browse the repository at this point in the history
…r the same operation.
  • Loading branch information
Lokathor committed Jun 3, 2024
1 parent deae8ea commit ab424c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/bios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub fn VBlankIntrWait() {
#[inline]
#[instruction_set(arm::t32)]
pub fn ArcTan(theta: crate::i16fx14) -> crate::i16fx14 {
let mut i = theta.into_raw();
let mut i = theta.to_bits();
unsafe {
core::arch::asm! {
"swi #0x09",
Expand All @@ -81,7 +81,7 @@ pub fn ArcTan(theta: crate::i16fx14) -> crate::i16fx14 {
options(pure, nomem, preserves_flags),
}
};
crate::i16fx14::from_raw(i)
crate::i16fx14::from_bits(i)
}

/// `0x0A`: The "2-argument arctangent" ([atan2][wp-atan2]).
Expand All @@ -93,8 +93,8 @@ pub fn ArcTan(theta: crate::i16fx14) -> crate::i16fx14 {
#[inline]
#[instruction_set(arm::t32)]
pub fn ArcTan2(x: crate::i16fx14, y: crate::i16fx14) -> u16 {
let x = x.into_raw();
let y = y.into_raw();
let x = x.to_bits();
let y = y.to_bits();
let output: u16;
unsafe {
core::arch::asm! {
Expand Down
4 changes: 2 additions & 2 deletions src/gba_fixed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ macro_rules! impl_common_fixed_ops {
#[inline]
#[must_use]
#[cfg_attr(feature = "track_caller", track_caller)]
pub const fn from_raw(i: $t) -> Self {
pub const fn from_bits(i: $t) -> Self {
Self(i)
}

/// Unwraps the inner value directly into the base type (no shift).
#[inline]
#[must_use]
#[cfg_attr(feature = "track_caller", track_caller)]
pub const fn into_raw(self) -> $t {
pub const fn to_bits(self) -> $t {
self.0
}

Expand Down

0 comments on commit ab424c8

Please sign in to comment.