snes9x/apu/bapu/dsp/sdsp.cpp

51 lines
670 B
C++
Raw Normal View History

#include "../snes/snes.hpp"
2011-06-12 06:25:22 +00:00
#define DSP_CPP
namespace SNES {
DSP dsp;
#include "SPC_DSP.cpp"
2011-06-24 11:42:04 +00:00
void DSP::power()
{
2011-06-12 06:25:22 +00:00
spc_dsp.init(smp.apuram);
spc_dsp.reset();
2011-06-27 21:28:45 +00:00
clock = 0;
2011-06-12 06:25:22 +00:00
}
2011-06-24 11:42:04 +00:00
void DSP::reset()
{
2011-06-12 06:25:22 +00:00
spc_dsp.soft_reset();
2011-06-27 21:28:45 +00:00
clock = 0;
2011-06-12 06:25:22 +00:00
}
2011-06-24 11:42:04 +00:00
static void from_dsp_to_state (uint8 **buf, void *var, size_t size)
{
memcpy(*buf, var, size);
*buf += size;
}
static void to_dsp_from_state (uint8 **buf, void *var, size_t size)
{
memcpy(var, *buf, size);
*buf += size;
}
void DSP::save_state (uint8 **ptr)
{
spc_dsp.copy_state(ptr, from_dsp_to_state);
}
void DSP::load_state (uint8 **ptr)
{
spc_dsp.copy_state(ptr, to_dsp_from_state);
}
DSP::DSP()
{
2011-06-27 21:28:45 +00:00
clock = 0;
2011-06-12 06:25:22 +00:00
}
}