1/*****************************************************************************\
2 Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
3 This file is licensed under the Snes9x License.
4 For further information, consult the LICENSE file in the root directory.
5\*****************************************************************************/
6
7#include "snes9x.h"
8#include "memmap.h"
9#ifdef DEBUGGER
10#include "missing.h"
11#endif
12
13uint8 (*GetDSP) (uint16) = NULL;
14void (*SetDSP) (uint8, uint16) = NULL;
15
16
17void S9xResetDSP (void)
18{
19 memset(&DSP1, 0, sizeof(DSP1));
20 DSP1.waiting4command = TRUE;
21 DSP1.first_parameter = TRUE;
22
23 memset(&DSP2, 0, sizeof(DSP2));
24 DSP2.waiting4command = TRUE;
25
26 memset(&DSP3, 0, sizeof(DSP3));
27 DSP3_Reset();
28
29 memset(&DSP4, 0, sizeof(DSP4));
30 DSP4.waiting4command = TRUE;
31}
32
33uint8 S9xGetDSP (uint16 address)
34{
35#ifdef DEBUGGER
36 if (Settings.TraceDSP)
37 {
38 sprintf(String, "DSP read: 0x%04X", address);
39 S9xMessage(S9X_TRACE, S9X_TRACE_DSP1, String);
40 }
41#endif
42
43 return ((*GetDSP)(address));
44}
45
46void S9xSetDSP (uint8 byte, uint16 address)
47{
48#ifdef DEBUGGER
49 missing.unknowndsp_write = address;
50 if (Settings.TraceDSP)
51 {
52 sprintf(String, "DSP write: 0x%04X=0x%02X", address, byte);
53 S9xMessage(S9X_TRACE, S9X_TRACE_DSP1, String);
54 }
55#endif
56
57 (*SetDSP)(byte, address);
58}
59