diff --git a/agb/src/syscall.rs b/agb/src/syscall.rs index 7797ac3d..a5cc1ed2 100644 --- a/agb/src/syscall.rs +++ b/agb/src/syscall.rs @@ -1,4 +1,5 @@ use crate::display::object::AffineMatrixAttributes; +use crate::number::Num; #[allow(non_snake_case)] @@ -105,7 +106,7 @@ pub fn arc_tan2(x: i16, y: i32) -> i16 { result } -pub fn affine_matrix(x_scale: i16, y_scale: i16, rotation: u16) -> AffineMatrixAttributes { +pub fn affine_matrix(x_scale: Num<8>, y_scale: Num<8>, rotation: u8) -> AffineMatrixAttributes { let mut result = AffineMatrixAttributes { p_a: 0, p_b: 0, @@ -120,10 +121,12 @@ pub fn affine_matrix(x_scale: i16, y_scale: i16, rotation: u16) -> AffineMatrixA rotation: u16, } + let rotation_for_input = (rotation as u16) << 8; + let input = Input { - x_scale, - y_scale, - rotation, + y_scale: x_scale.to_raw() as i16, + x_scale: y_scale.to_raw() as i16, + rotation: rotation_for_input, }; unsafe {