-
Notifications
You must be signed in to change notification settings - Fork 4
/
dma_asm.S
53 lines (47 loc) · 1.14 KB
/
dma_asm.S
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
41
42
43
44
45
46
47
48
49
50
51
52
#------------------------------------------------------------------------
# File: dma_asm.s
# Author: Tony Saveski, [email protected]
# Notes: DMA routines implemented in assembler
#------------------------------------------------------------------------
#include "regnames.h"
#------------------------------------------------------------------------
.set noreorder
.text
.globl dma_reset
#------------------------------------------------------------------------
# void dma_reset();
#------------------------------------------------------------------------
# Ripped straight from 3stars or something. Will 'clean up later'.
#------------------------------------------------------------------------
.align 7
.ent dma_reset
dma_reset:
li $2,0x1000A000
nop
sw $0,0x80($2)
sw $0,0($2)
sw $0,0x30($2)
sw $0,0x10($2)
sw $0,0x50($2)
sw $0,0x40($2)
li $2,0xFF1F
sw $2,0x1000E010
lw $2,0x1000E010
li $3,0xFF1F
and $2,$3
sw $2,0x1000E010
sw $0,0x1000E000
sw $0,0x1000E020
sw $0,0x1000E030
sw $0,0x1000E050
sw $0,0x1000E040
li $3,1
lw $2,0x1000E000
ori $3,$2,1
nop
sw $3,0x1000E000
nop
daddu v0,zero,zero # return 0
jr ra
nop
.end dma_reset