snes9x/apu/bapu/dsp/sdsp.cpp

48 lines
629 B
C++
Raw Normal View History

2011-06-12 06:25:22 +00:00
#include <snes/snes.hpp>
#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-24 11:42:04 +00:00
void DSP::reset()
{
2011-06-12 06:25:22 +00:00
spc_dsp.soft_reset();
}
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-12 06:25:22 +00:00
}
}