Mercurial > spc_convert
diff snes_spc/dsp.cpp @ 0:e38dacceb958
initial import
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Fri, 21 Oct 2011 05:53:11 -0700 |
parents | |
children |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/snes_spc/dsp.cpp Fri Oct 21 05:53:11 2011 -0700 1.3 @@ -0,0 +1,48 @@ 1.4 +// snes_spc 0.9.0. http://www.slack.net/~ant/ 1.5 + 1.6 +#include "dsp.h" 1.7 + 1.8 +#include "SPC_DSP.h" 1.9 + 1.10 +/* Copyright (C) 2007 Shay Green. This module is free software; you 1.11 +can redistribute it and/or modify it under the terms of the GNU Lesser 1.12 +General Public License as published by the Free Software Foundation; either 1.13 +version 2.1 of the License, or (at your option) any later version. This 1.14 +module is distributed in the hope that it will be useful, but WITHOUT ANY 1.15 +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 1.16 +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 1.17 +details. You should have received a copy of the GNU Lesser General Public 1.18 +License along with this module; if not, write to the Free Software Foundation, 1.19 +Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ 1.20 + 1.21 +#include "blargg_source.h" 1.22 + 1.23 +SPC_DSP* spc_dsp_new( void ) 1.24 +{ 1.25 + // be sure constants match 1.26 + assert( spc_dsp_voice_count == (int) SPC_DSP::voice_count ); 1.27 + assert( spc_dsp_register_count == (int) SPC_DSP::register_count ); 1.28 + #if !SPC_NO_COPY_STATE_FUNCS 1.29 + assert( spc_dsp_state_size == (int) SPC_DSP::state_size ); 1.30 + #endif 1.31 + 1.32 + return new SPC_DSP; 1.33 +} 1.34 + 1.35 +void spc_dsp_delete ( SPC_DSP* s ) { delete s; } 1.36 +void spc_dsp_init ( SPC_DSP* s, void* ram_64k ) { s->init( ram_64k ); } 1.37 +void spc_dsp_set_output ( SPC_DSP* s, spc_dsp_sample_t* p, int n ) { s->set_output( p, n ); } 1.38 +int spc_dsp_sample_count( SPC_DSP const* s ) { return s->sample_count(); } 1.39 +void spc_dsp_reset ( SPC_DSP* s ) { s->reset(); } 1.40 +void spc_dsp_soft_reset ( SPC_DSP* s ) { s->soft_reset(); } 1.41 +int spc_dsp_read ( SPC_DSP const* s, int addr ) { return s->read( addr ); } 1.42 +void spc_dsp_write ( SPC_DSP* s, int addr, int data ) { s->write( addr, data ); } 1.43 +void spc_dsp_run ( SPC_DSP* s, int clock_count ) { s->run( clock_count ); } 1.44 +void spc_dsp_mute_voices ( SPC_DSP* s, int mask ) { s->mute_voices( mask ); } 1.45 +void spc_dsp_disable_surround( SPC_DSP* s, int disable ) { s->disable_surround( disable ); } 1.46 +void spc_dsp_load ( SPC_DSP* s, unsigned char const regs [spc_dsp_register_count] ) { s->load( regs ); } 1.47 + 1.48 +#if !SPC_NO_COPY_STATE_FUNCS 1.49 +void spc_dsp_copy_state ( SPC_DSP* s, unsigned char** p, spc_dsp_copy_func_t f ) { s->copy_state( p, f ); } 1.50 +int spc_dsp_check_kon ( SPC_DSP* s ) { return s->check_kon(); } 1.51 +#endif