annotate snes_spc/dsp.cpp @ 2:c3248c71ae74

begin convert program
author Robert McIntyre <rlm@mit.edu>
date Fri, 21 Oct 2011 06:21:33 -0700
parents e38dacceb958
children
rev   line source
rlm@0 1 // snes_spc 0.9.0. http://www.slack.net/~ant/
rlm@0 2
rlm@0 3 #include "dsp.h"
rlm@0 4
rlm@0 5 #include "SPC_DSP.h"
rlm@0 6
rlm@0 7 /* Copyright (C) 2007 Shay Green. This module is free software; you
rlm@0 8 can redistribute it and/or modify it under the terms of the GNU Lesser
rlm@0 9 General Public License as published by the Free Software Foundation; either
rlm@0 10 version 2.1 of the License, or (at your option) any later version. This
rlm@0 11 module is distributed in the hope that it will be useful, but WITHOUT ANY
rlm@0 12 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
rlm@0 13 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
rlm@0 14 details. You should have received a copy of the GNU Lesser General Public
rlm@0 15 License along with this module; if not, write to the Free Software Foundation,
rlm@0 16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
rlm@0 17
rlm@0 18 #include "blargg_source.h"
rlm@0 19
rlm@0 20 SPC_DSP* spc_dsp_new( void )
rlm@0 21 {
rlm@0 22 // be sure constants match
rlm@0 23 assert( spc_dsp_voice_count == (int) SPC_DSP::voice_count );
rlm@0 24 assert( spc_dsp_register_count == (int) SPC_DSP::register_count );
rlm@0 25 #if !SPC_NO_COPY_STATE_FUNCS
rlm@0 26 assert( spc_dsp_state_size == (int) SPC_DSP::state_size );
rlm@0 27 #endif
rlm@0 28
rlm@0 29 return new SPC_DSP;
rlm@0 30 }
rlm@0 31
rlm@0 32 void spc_dsp_delete ( SPC_DSP* s ) { delete s; }
rlm@0 33 void spc_dsp_init ( SPC_DSP* s, void* ram_64k ) { s->init( ram_64k ); }
rlm@0 34 void spc_dsp_set_output ( SPC_DSP* s, spc_dsp_sample_t* p, int n ) { s->set_output( p, n ); }
rlm@0 35 int spc_dsp_sample_count( SPC_DSP const* s ) { return s->sample_count(); }
rlm@0 36 void spc_dsp_reset ( SPC_DSP* s ) { s->reset(); }
rlm@0 37 void spc_dsp_soft_reset ( SPC_DSP* s ) { s->soft_reset(); }
rlm@0 38 int spc_dsp_read ( SPC_DSP const* s, int addr ) { return s->read( addr ); }
rlm@0 39 void spc_dsp_write ( SPC_DSP* s, int addr, int data ) { s->write( addr, data ); }
rlm@0 40 void spc_dsp_run ( SPC_DSP* s, int clock_count ) { s->run( clock_count ); }
rlm@0 41 void spc_dsp_mute_voices ( SPC_DSP* s, int mask ) { s->mute_voices( mask ); }
rlm@0 42 void spc_dsp_disable_surround( SPC_DSP* s, int disable ) { s->disable_surround( disable ); }
rlm@0 43 void spc_dsp_load ( SPC_DSP* s, unsigned char const regs [spc_dsp_register_count] ) { s->load( regs ); }
rlm@0 44
rlm@0 45 #if !SPC_NO_COPY_STATE_FUNCS
rlm@0 46 void spc_dsp_copy_state ( SPC_DSP* s, unsigned char** p, spc_dsp_copy_func_t f ) { s->copy_state( p, f ); }
rlm@0 47 int spc_dsp_check_kon ( SPC_DSP* s ) { return s->check_kon(); }
rlm@0 48 #endif