summaryrefslogtreecommitdiff
path: root/docs/DSP/Zelda.txt
blob: b07590f4039f3201943923145e7e133ba12cbcac (plain)
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
CPU:
---------------------------------------------------------------------------------------

void DSPSendCommands2(_pBuffer, _NumberOfMessages, _StartWork)
{

	while (!DSP_Running_Check());
	
	OldInterrupts = OSDisableInterrupts();

	if (DSPCheckMailToDSP() != 0)
	{
		OSRestoreInterrupts();
		return -1;
	}

	DSPSendMailToDSP(_NumberOfMessages)
	
	DSPAssertInt()

	while (DSPCheckMailToDSP() != 0) {}

	if (_NumberOfMessages == 0)
		_NumberOfMessages = 1


	if (_StartWork != 0)
	{
		r28 = DSPStartWork(*_pBuffer, _StartWork)				
	}
	_StartWork = 0


	while(Count != _NumberOfMessages)
	{
		DSPSendMailToDSP(Buffer[Count])
		while (DSPCheckMailToDSP() != 0) {}
		Count++
	}

	OSRestoreInterrupts(OldInterrupts)

	return r28;
}