file gCoreMatrix.z80

description

Matrix manipulation routines.

summary

ROUTINES
gLoadIdentity-Loads the do-nothing matrix
gPushMatrix-Push the current matrix to the stack
gPopMatrix-Pop the top matrix of the stack
gTranspose-Calculates the transpose of a specified matrix
gAngle-Generates the XYZ rotation matrix
gMulVec-Transforms the specified vector with the current matrix

types

gMat3

type gMat3

description

Description

STRUCTURE
gVec3-m[0][0] m[1][0] m[2][0]
gVec3-m[0][1] m[1][1] m[2][1]
gVec3-m[0][2] m[1][2] m[2][2]
gWVec3-vec.x vec.y vec.z

raw gScratchRAM

description

Small (4 bytes) memory region used by some library commands as temporary data storage. Located at $848F.

routine gLoadIdentity

description

Loads the identity matrix into the static library matrix. This matrix as no effect on rotation and translation.

inputs

none

outputs

none

destroyed

A, HL, DE

timings

171 T-States

routine gPushMatrix

description

Push the current matrix onto the stack. It require a minimum of 16 bytes of free stack space. The current stack space can be acquire by a call to gGet routine

warning

Return from the current subroutine level after calling this routine will most likely crash the calculator, as the stack wouldn't proprely set for the return. You should call gPopMatrix at the same subroutine level. Call is allowed within call to these two routine.

inputs

None

outputs

SP-Original SP + 16

destroyed

AF, HL, DE

timings

231 T-States