11#define TRANSFORM_DMA (DMA_COPY_WORDS(12))
23 CAMELOT_ASM(
"the fixed-register identity store of transform.h")
59 CAMELOT_ASM(
"the fixed-register identity store of transform.h")
67 s32 sinX, cosX, sinY, cosY, sinZ, cosZ;
102 CAMELOT_ASM(
"the fixed-register identity store of transform.h")
118 CAMELOT_ASM(
"the fixed-register identity store of transform.h")
134 CAMELOT_ASM(
"the fixed-register identity store of transform.h")
148 CAMELOT_ASM(
"the fixed-register identity store of transform.h")
150 matrix[9] = position[0];
151 matrix[10] = position[1];
152 matrix[11] = position[2];
161 CAMELOT_ASM(
"the fixed-register identity store of transform.h")
163 matrix[0] = scale[0];
164 matrix[4] = scale[1];
165 matrix[8] = scale[2];
172 s32 sinX, cosX, sinY, cosY, sinZ, cosZ;
194 matrix[9] = position[0];
195 matrix[10] = position[1];
196 matrix[11] = position[2];
204 s32 sinX, cosX, sinY, cosY, sinZ, cosZ;
214 axisScale = scale[0];
218 axisScale = scale[1];
226 axisScale = scale[2];
234 matrix[9] = position[0];
235 matrix[10] = position[1];
236 matrix[11] = position[2];
256 u32 num = 0x80000000;
263 dx = target[0] - eye[0];
264 dy = target[1] - eye[1];
265 dz = target[2] - eye[2];
266 t =
Iwram_Sqrt(dot(dx >> 8, dx >> 8, dy >> 8, dy >> 8, dz >> 8, dz >> 8));
305 out[9] = -dot(ex, ux, ez, uz, zero, zero);
309 out[10] = -dot(ex, vx, ey, vy, ez, vz);
313 out[11] = -dot(ex, dx, ey, dy, ez, dz);
340 halfAngle = (
s32)(fieldOfView + (fieldOfView >> 31)) >> 1;
354 projection->
near = nearDepth;
355 projection->
far = farDepth;
374 if (depth >= projection->
near && depth <= projection->
far) {
375 screen[2] = depth >> 16;
376 if (projection->
focal != 0) {
377 u32 shifted = (
u32)depth >> 11;
static __inline__ void Dma_Set(const volatile void *source, volatile void *destination, u32 control, volatile u32 *channel)
Starts a DMA transfer: stores the source, destination and control words into channel's registers with...
const u32 RelocatedQ16DotProduct[]
void * Runtime_AllocateBlock(s32 kind, s32 size)
As Runtime_AllocateHeapBlock, but tries EWRAM first, for blocks that need room more than speed: the b...
@ HEAP_SLOT_TRANSFORM_STACK
The 3D transform's one saved level.
#define DMA_COPY_WORDS(n)
static s32 Iwram_RatioMulQ14(s32 divisor, s32 value)
All calls go through this layer.
static s32 Iwram_Sqrt(s32 value)
#define Iwram_MulQ16(left, right)
static s32 Iwram_TransformVector(const void *vector, s32 *result)
static u32 Iwram_UnsignedDivide(u32 dividend, u32 divisor)
static void Iwram_TransformMatrix(const s32 *matrix)
s32 FixedSqrt(s32 value)
Square root of a 16.16 fixed-point value, in 16.16.
struct Projection gProjection
What every part of the runtime object shares: its includes and the library call two parts make.
The 3D projection onto the screen: its focal length, near and far depths, and the screen point the vi...
#define CAMELOT_ASM(proof)