summaryrefslogtreecommitdiff
path: root/libmeidogte/applymatrixlv.s
blob: 332a2f877c14dfa5c48da0176a9af1a96253d46b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
.set noreorder

.include "gtereg.h"
.include "inline_s.h"

.section .text


.global ApplyMatrixLV
.type ApplyMatrixLV, @function
ApplyMatrixLV:

	# Load matrix to GTE
	lw		$t0, 0($a0)
	lw		$t1, 4($a0)
	ctc2	$t0, $0
	ctc2	$t1, $1
	lw		$t0, 8($a0)
	lw		$t1, 12($a0)
	lhu		$t2, 16($a0)
	ctc2	$t0, $2
	ctc2	$t1, $3
	ctc2	$t2, $4

	lw		$t0, 0($a1)
	lw		$t1, 4($a1)
	mtc2	$t0, C2_IR1
	lw		$t0, 8($a1)
	mtc2	$t1, C2_IR2
	mtc2	$t0, C2_IR3

	nMVMVA(1, 0, 3, 3, 0)

	swc2	C2_IR1, 0($a2)
	swc2	C2_IR2, 4($a2)
	swc2	C2_IR3, 8($a2)

	jr		$ra
	move	$v0, $a2