1#ifndef ALCHEMY_IWRAM_CALL_H
2#define ALCHEMY_IWRAM_CALL_H
17#define Iwram_RatioMulQ14Entry \
18 FIXED_ADDRESS((s32 (*)(s32 divisor, s32 value)), 0x0300013c, IwramRatioMulQ14)
19#define Iwram_ClearWordsEntry \
20 FIXED_ADDRESS((s32 (*)(void *destination, s32 size)), 0x03000164, \
22#define Iwram_FillWordsEntry \
23 FIXED_ADDRESS((s32 (*)(void *destination, s32 size, u32 value)), 0x03000168, \
25#define Iwram_SqrtEntry \
26 FIXED_ADDRESS((s32 (*)(s32 value)), 0x030001d8, IwramSqrt)
27#define Iwram_ExpandBitRuns \
28 FIXED_ADDRESS((s32 (*)(const void *bits, void *destination, s32 value)), \
29 0x03000214, IwramExpandBitRuns)
32#define Iwram_TransformVectorEntry \
33 FIXED_ADDRESS((s32 (*)(const void *vector, s32 *result)), 0x03000250, \
35#define Iwram_TransformMatrixEntry \
36 FIXED_ADDRESS((void (*)(const s32 *matrix)), 0x030002c0, IwramTransformMatrix)
37#define Iwram_SignedDivideEntry \
38 FIXED_ADDRESS((s32 (*)(s32 dividend, s32 divisor)), 0x03000380, \
40#define Iwram_UnsignedDivideEntry \
41 FIXED_ADDRESS((u32 (*)(u32 dividend, u32 divisor)), 0x030003f0, \
43#define Iwram_DecompressEntry \
44 FIXED_ADDRESS((void *(*)(const void *source, void *destination)), \
45 0x030005c0, IwramDecompress)
46#define Iwram_CopyWordsEntry \
47 FIXED_ADDRESS((s32 (*)(void *destination, const void *source, s32 size)), \
48 0x03001388, IwramCopyWords)
86 const volatile void *source,
s32 size) {
93 "a call that returns through ip, which no procedure-call standard produces")
97 __asm__
volatile(
"mov r0, %1\n\t"
104 :
"r"(left),
"r"(right),
"r"(routine)
105 :
"r0",
"r1",
"r2",
"ip",
"cc");
110 "a call that returns through ip, which no procedure-call standard produces")
112 register s32 result __asm__(
"r0") = left;
113 register s32 factor __asm__(
"r1") = right;
115 __asm__
volatile(
".align 2\n\t"
119 :
"r"(factor),
"r"(routine)
120 :
"r1",
"r2",
"ip",
"cc");
127#define Iwram_MulQ16(left, right) \
128 Iwram_Call2((left), (right), IwramMulQ16ReturnIp)
130#define Iwram_CopyWordsOffset FIXED_OFFSET(0x1388, IwramCopyWords, IwramIrqMain)
131#define Iwram_RatioMulQ14Offset \
132 FIXED_OFFSET(0x13c, IwramRatioMulQ14, IwramIrqMain)
133#define Iwram_SqrtOffset FIXED_OFFSET(0x1d8, IwramSqrt, IwramIrqMain)
#define Iwram_ClearWordsEntry
static s32 Iwram_RatioMulQ14(s32 divisor, s32 value)
All calls go through this layer.
static s32 Iwram_CopyWords(volatile void *destination, const volatile void *source, s32 size)
static s32 Iwram_Sqrt(s32 value)
#define Iwram_RatioMulQ14Entry
static __inline__ s32 Iwram_Call2(s32 left, s32 right, void *routine)
#define Iwram_UnsignedDivideEntry
static s32 Iwram_FillWords(void *destination, s32 size, u32 value)
#define Iwram_CopyWordsEntry
#define Iwram_FillWordsEntry
static s32 Iwram_SignedDivide(s32 dividend, s32 divisor)
#define Iwram_TransformVectorEntry
Reads all three word-aligned coordinates before writing the result.
#define Iwram_SignedDivideEntry
#define Iwram_TransformMatrixEntry
static s32 Iwram_TransformVector(const void *vector, s32 *result)
#define Iwram_DecompressEntry
static void * Iwram_Decompress(const void *source, void *destination)
static u32 Iwram_UnsignedDivide(u32 dividend, u32 divisor)
static s32 Iwram_ClearWords(void *destination, s32 size)
static void Iwram_TransformMatrix(const s32 *matrix)
The integer types, TRUE, UNUSED and the fixed-address macros.
#define CAMELOT_ASM(proof)