summaryrefslogtreecommitdiff
path: root/arm9/source/devices/math.h
blob: ae52a10bc527d782b520d050113390a37a81d76f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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