snes9x/apu/bapu/dsp/sdsp.cpp

48 lines
629 B
C++
Raw Normal View History

2011-06-12 08:25:22 +02:00
#include <snes/snes.hpp>
#define DSP_CPP
namespace SNES {
DSP dsp;
#include "SPC_DSP.cpp"
2011-06-24 13:42:04 +02:00
void DSP::power()
{
2011-06-12 08:25:22 +02:00
spc_dsp.init(smp.apuram);
spc_dsp.reset();
}
2011-06-24 13:42:04 +02:00
void DSP::reset()
{
2011-06-12 08:25:22 +02:00
spc_dsp.soft_reset();
}
2011-06-24 13:42:04 +02: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 08:25:22 +02:00
}
}