summaryrefslogtreecommitdiff
path: root/arm9/source/devices/math.h
diff options
context:
space:
mode:
authorBen Bridle <ben@derelict.engineering>2024-11-18 14:57:19 +1300
committerBen Bridle <ben@derelict.engineering>2024-11-18 14:57:19 +1300
commit722d5509178fa5bdaa488fbbd9196f21377f8775 (patch)
tree112b39cd80cb8e074d9e71d1def4d8de33c9eefa /arm9/source/devices/math.h
downloadbedrock-nds-722d5509178fa5bdaa488fbbd9196f21377f8775.zip
Initial commit
Diffstat (limited to 'arm9/source/devices/math.h')
-rw-r--r--arm9/source/devices/math.h19
1 files changed, 19 insertions, 0 deletions
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