// Forced-included into blargg's snes_spc 0.9.0 when the referee is built // (scripts/dsp_build_referees.py). Declares the hooks: snes_spc's own // SPC_DSP_WRITE_HOOK and SPC_DSP_OUT_HOOK, and SPC_RAM_WRITE_HOOK, which the // build inserts into a copy of SNES_SPC.cpp (cpu_write, after the store to RAM). // // SPC_DSP_OUT_HOOK replaces the sample store at the end of echo_27, so it does // that store itself, with snes_spc's own WRITE_SAMPLES, after noting the sample // and the DSP's registers. #pragma once void spc_dump_dsp_write(long time, int addr, int data); void spc_dump_ram_write(long time, int addr, int data); void spc_dump_sample(const unsigned char* regs, int left, int right); #define SPC_DSP_WRITE_HOOK(time, addr, data) spc_dump_dsp_write((long)(time), (addr), (data)) #define SPC_RAM_WRITE_HOOK(time, addr, data) spc_dump_ram_write((long)(time), (addr), (data)) #define SPC_DSP_OUT_HOOK(left, right) \ { \ spc_dump_sample(m.regs, (left), (right)); \ sample_t* hook_out = m.out; \ WRITE_SAMPLES((left), (right), hook_out); \ m.out = hook_out; \ }