File: dsp.cpp

package info (click to toggle)
libretro-snes9x 1.63%2Bdfsg-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid, trixie
  • size: 8,972 kB
  • sloc: cpp: 86,293; ansic: 6,630; sh: 3,237; makefile: 637
file content (58 lines) | stat: -rw-r--r-- 1,336 bytes parent folder | download | duplicates (2)
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
/*****************************************************************************\
     Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
                This file is licensed under the Snes9x License.
   For further information, consult the LICENSE file in the root directory.
\*****************************************************************************/

#include "snes9x.h"
#include "memmap.h"
#ifdef DEBUGGER
#include "missing.h"
#endif

uint8	(*GetDSP) (uint16)        = NULL;
void	(*SetDSP) (uint8, uint16) = NULL;


void S9xResetDSP (void)
{
	memset(&DSP1, 0, sizeof(DSP1));
	DSP1.waiting4command = TRUE;
	DSP1.first_parameter = TRUE;

	memset(&DSP2, 0, sizeof(DSP2));
	DSP2.waiting4command = TRUE;

	memset(&DSP3, 0, sizeof(DSP3));
	DSP3_Reset();

	memset(&DSP4, 0, sizeof(DSP4));
	DSP4.waiting4command = TRUE;
}

uint8 S9xGetDSP (uint16 address)
{
#ifdef DEBUGGER
	if (Settings.TraceDSP)
	{
		sprintf(String, "DSP read: 0x%04X", address);
		S9xMessage(S9X_TRACE, S9X_TRACE_DSP1, String);
	}
#endif

	return ((*GetDSP)(address));
}

void S9xSetDSP (uint8 byte, uint16 address)
{
#ifdef DEBUGGER
	missing.unknowndsp_write = address;
	if (Settings.TraceDSP)
	{
		sprintf(String, "DSP write: 0x%04X=0x%02X", address, byte);
		S9xMessage(S9X_TRACE, S9X_TRACE_DSP1, String);
	}
#endif

	(*SetDSP)(byte, address);
}