2018-12-03 12:26:02 +01:00
|
|
|
/*****************************************************************************\
|
|
|
|
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.
|
|
|
|
\*****************************************************************************/
|
2008-08-06 03:09:59 +02:00
|
|
|
|
|
|
|
|
2010-01-27 23:08:56 +01:00
|
|
|
#include "snes9x.h"
|
|
|
|
#include "memmap.h"
|
|
|
|
#ifdef DEBUGGER
|
|
|
|
#include "missing.h"
|
|
|
|
#endif
|
2008-09-10 07:57:37 +02:00
|
|
|
|
2010-01-27 23:08:56 +01:00
|
|
|
uint8 (*GetDSP) (uint16) = NULL;
|
|
|
|
void (*SetDSP) (uint8, uint16) = NULL;
|
2008-09-10 07:57:37 +02:00
|
|
|
|
2009-11-25 07:35:14 +01:00
|
|
|
|
2010-01-27 23:08:56 +01:00
|
|
|
void S9xResetDSP (void)
|
2009-11-25 07:35:14 +01:00
|
|
|
{
|
2010-01-27 23:08:56 +01:00
|
|
|
memset(&DSP1, 0, sizeof(DSP1));
|
|
|
|
DSP1.waiting4command = TRUE;
|
|
|
|
DSP1.first_parameter = TRUE;
|
2009-11-30 09:14:38 +01:00
|
|
|
|
2010-01-27 23:08:56 +01:00
|
|
|
memset(&DSP2, 0, sizeof(DSP2));
|
|
|
|
DSP2.waiting4command = TRUE;
|
|
|
|
|
|
|
|
memset(&DSP3, 0, sizeof(DSP3));
|
|
|
|
DSP3_Reset();
|
2008-08-06 03:09:59 +02:00
|
|
|
|
2010-01-27 23:08:56 +01:00
|
|
|
memset(&DSP4, 0, sizeof(DSP4));
|
|
|
|
DSP4.waiting4command = TRUE;
|
|
|
|
}
|
2009-11-25 07:35:14 +01:00
|
|
|
|
2010-01-27 23:08:56 +01:00
|
|
|
uint8 S9xGetDSP (uint16 address)
|
2009-11-25 07:35:14 +01:00
|
|
|
{
|
2010-01-27 23:08:56 +01:00
|
|
|
#ifdef DEBUGGER
|
|
|
|
if (Settings.TraceDSP)
|
|
|
|
{
|
|
|
|
sprintf(String, "DSP read: 0x%04X", address);
|
|
|
|
S9xMessage(S9X_TRACE, S9X_TRACE_DSP1, String);
|
|
|
|
}
|
2009-11-30 09:14:38 +01:00
|
|
|
#endif
|
|
|
|
|
2010-01-27 23:08:56 +01:00
|
|
|
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);
|
|
|
|
}
|
2008-08-06 03:09:59 +02:00
|
|
|
#endif
|
|
|
|
|
2010-01-27 23:08:56 +01:00
|
|
|
(*SetDSP)(byte, address);
|
|
|
|
}
|