aud_dmem_init.h
4.2 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/**************************************************************************
* *
* Copyright (C) 1994, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
*************************************************************************/
/*
* File: aud_dmem_init.h
*
* This file sets up and intializes some data and jump tables in DMEM.
*
*/
#
# Initialize vconst; each element a different scalar constant...
#
#define VCONST_OFFSET (RSP_PDATA_OFFSET + 0)
#define VCONST_SIZE8 (16)
.half 0x0000 # 0
.half 0x0001 # 1
.half 0x0002 # 2
.half 0xffff # -1
.half 0x0020 # Scaling for S3.12 representation (adpcm)
.half 0x0800 # Represents 1 (2048) for ADPCM coefficients
.half 0x7fff
.half 0x4000 # Represents 1 (16384) for 2pole filter coefficients
#
# setup a jump table for the optypes:
#
#define OPTYPE_JMP_OFFSET (VCONST_OFFSET + VCONST_SIZE8)
#define OPTYPE_JMP_SIZE8 (16*2)
.half AudDone
.half case_A_ADPCM
.half case_A_CLEARBUFF
.half case_A_ENVMIX
.half case_A_LOADBUFF
.half case_A_RESAMPLE
.half case_A_SAVEBUFF
.half case_A_SEGMENT
.half case_A_SETBUFF
.half case_A_SETVOL
.half case_A_DMMOVE
.half case_A_LOADADPCM
.half case_A_MIXER
.half case_A_INTERLEAVE
.half case_A_POLEF
.half case_A_SETLSTATE
######################################################################
# Constants for Decompressor
#
#define DEC_MASK_OFFSET (OPTYPE_JMP_OFFSET + OPTYPE_JMP_SIZE8)
#define DEC_MASK_SIZE8 (4*4)
.word 0xf0000f00 # Mask
.word 0x00f0000f
.word 0x00010010 # Scale
.word 0x01001000
########################################################################
# Constants for Resampler
#
#define DEFAULT_FRAC_VOL 0xffff
#define RES_PHASE_COUNT 64
#define RES_PHASE_SIZE 4
#define BYTES_PER_SHORT 2
#define BYTES_PER_VECTOR 16
#define COEF_TAB_SIZE (RES_PHASE_COUNT * RES_PHASE_SIZE)
#define C_MULINC (0)
#define C_ONE (C_MULINC + BYTES_PER_VECTOR)
#define C_SHIFT (C_ONE + BYTES_PER_VECTOR)
#define C_ZEROFOUR (C_SHIFT + BYTES_PER_VECTOR)
#define C_ONEFIVE (C_ZEROFOUR + BYTES_PER_VECTOR)
#define C_TWOSIX (C_ONEFIVE + BYTES_PER_VECTOR)
#define C_THREESEVEN (C_TWOSIX + BYTES_PER_VECTOR)
#define C_RAMP (C_THREESEVEN + BYTES_PER_VECTOR)
#define RES_CONST_OFFSET (DEC_MASK_OFFSET + DEC_MASK_SIZE8)
#define RES_CONST_SIZE8 (8 * BYTES_PER_VECTOR )
.word 0x00020004 # vMULINC
.word 0x00060008
.word 0x000a000c
.word 0x000e0010
.word 0x00010001 # vONE
.word 0x00010001
.word 0x00010001
.word 0x00010001
.word 0x00000001 # vSHIFT
.word 0x00020004
.word 0x00080010
.word 0x01000200
.word 0x00010000 # vZEROFOUR
.word 0x00000000
.word 0x00010000
.word 0x00000000
.word 0x00000001 # vONEFIVE
.word 0x00000000
.word 0x00000001
.word 0x00000000
.word 0x00000000 # vTWOSIX
.word 0x00010000
.word 0x00000000
.word 0x00010000
.word 0x00000000 # vTHREESEVEN
.word 0x00000001
.word 0x00000000
.word 0x00000001
.word 0x20004000 # vRAMP for increasing volume
.word 0x60008000
.word 0xa000c000
.word 0xe000ffff
#
# Coefficient table for Resampler
#
#define RES_TABLE_OFFSET (RES_CONST_OFFSET + RES_CONST_SIZE8)
#define RES_TABLE_SIZE8 (COEF_TAB_SIZE * BYTES_PER_SHORT)
#include "coef_tab.h"
#define END_OF_SRC_PDATA (RES_OFFSET_TABLE + (COEF_TAB_SIZE * BYTES_PER_SHORT))
.print "--------------------------------------------------------------------\n"
.print __FILE__
.print " : Total static program data initialized is %d bytes.\n", (RES_TABLE_OFFSET + RES_TABLE_SIZE8)
.print __FILE__
.print " : DMEM program data limit is %d bytes.\n", RSP_PDATA_SIZE8