1 // RF5C68 sound chip emulator interface 2 3 // Game_Music_Emu $vers 4 #ifndef RF5C68_EMU_H 5 #define RF5C68_EMU_H 6 7 class Rf5C68_Emu { 8 void* chip; 9 public: 10 Rf5C68_Emu(); 11 ~Rf5C68_Emu(); 12 13 // Sets output sample rate and chip clock rates, in Hz. Returns non-zero 14 // if error. 15 int set_rate(); 16 17 // Resets to power-up state 18 void reset(); 19 20 // Mutes voice n if bit n (1 << n) of mask is set 21 enum { channel_count = 8 }; 22 void mute_voices( int mask ); 23 24 // Writes data to addr 25 void write( int addr, int data ); 26 27 // Writes to memory 28 void write_mem( int addr, int data ); 29 30 // Writes length bytes from data at start offset in RAM 31 void write_ram( int start, int length, void * data ); 32 33 // Runs and writes pair_count*2 samples to output 34 typedef short sample_t; 35 enum { out_chan_count = 2 }; // stereo 36 void run( int pair_count, sample_t* out ); 37 }; 38 39 #endif 40