Notes/mzxrules
From CloudModding OoT Wiki
C Multi-dimensional arrays are row-order. That is to say, each element within a row is assigned a contiguous location in ram
int v[3][2] = {
{0, 1},
{2, 3},
{4, 5}};
//ram
0x00 = 0
0x04 = 1
0x08 = 2
0x0C = 3
0x10 = 4
0x14 = 5
As such, v[3][0] == 4
Matrices
Matrices are defined as a float[4][4]
The following is a list of common matrices generated by the graphics utility functions in the SDK. Layouts are based on how they appear in memory.
Translation
| 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| x | y | z | 1 |
Scalar
| sx | 0 | 0 | 0 |
| 0 | sy | 0 | 0 |
| 0 | 0 | sz | 0 |
| 0 | 0 | 0 | 1 |