From 722d5509178fa5bdaa488fbbd9196f21377f8775 Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Mon, 18 Nov 2024 14:57:19 +1300 Subject: Initial commit --- arm9/source/devices/math.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 arm9/source/devices/math.h (limited to 'arm9/source/devices/math.h') diff --git a/arm9/source/devices/math.h b/arm9/source/devices/math.h new file mode 100644 index 0000000..ae52a10 --- /dev/null +++ b/arm9/source/devices/math.h @@ -0,0 +1,19 @@ +#ifndef MATH_H_ + #define MATH_H_ + + typedef struct { + u16 op1, op2; + u16 sqrt, atan; u32 prod; u16 quot, rem; // read + bool sqrt_rc, atan_rc, prod_rc, quot_rc, rem_rc; // read cached + } MathDevice ; + + void set_op1_high(MathDevice *math, u8 high); + void set_op1_low(MathDevice *math, u8 low); + void set_op2_high(MathDevice *math, u8 high); + void set_op2_low(MathDevice *math, u8 low); + u16 get_sqrt(MathDevice *math); + u16 get_atan(MathDevice *math); + u32 get_prod(MathDevice *math); + u16 get_quot(MathDevice *math); + u16 get_rem(MathDevice *math); +#endif -- cgit v1.2.3-70-g09d2