1 /*************************************************************************** 2 resid.h - ReSid Builder 3 ------------------- 4 begin : Fri Apr 4 2001 5 copyright : (C) 2001 by Simon White 6 email : s_a_white@email.com 7 ***************************************************************************/ 8 9 /*************************************************************************** 10 * * 11 * This program is free software; you can redistribute it and/or modify * 12 * it under the terms of the GNU General Public License as published by * 13 * the Free Software Foundation; either version 2 of the License, or * 14 * (at your option) any later version. * 15 * * 16 ***************************************************************************/ 17 18 #ifndef _resid_h_ 19 #define _resid_h_ 20 21 /* Since ReSID is not part of this project we are actually 22 * creating a wrapper instead of implementing a SID emulation 23 */ 24 25 #include <sidplay/sidbuilder.h> 26 #include <sidplay/event.h> 27 28 29 /*************************************************************************** 30 * ReSID Builder Class 31 ***************************************************************************/ 32 // Create the SID builder object 33 class ReSIDBuilder: public sidbuilder 34 { 35 private: 36 static const char *ERR_FILTER_DEFINITION; 37 char m_errorBuffer[100]; 38 const char *m_error; 39 enum { MAX_SIDOBJS = 10 }; 40 sidemu * sidobjs[MAX_SIDOBJS]; 41 int n_sidobjs; 42 43 public: getsidemu(int i)44 sidemu *getsidemu (int i) { 45 if (i >= n_sidobjs) { 46 return NULL; 47 } 48 return sidobjs[i]; 49 } 50 ReSIDBuilder (const char * const name); 51 ~ReSIDBuilder (void); 52 // true will give you the number of used devices. 53 // return values: 0 none, positive is used sids 54 // false will give you all available sids. 55 // return values: 0 endless, positive is available sids. 56 // use bool operator to determine error 57 uint devices (bool used); 58 uint create (uint sids); 59 sidemu *lock (c64env *env, sid2_model_t model); 60 void unlock (sidemu *device); 61 void remove (void); error(void)62 const char *error (void) const { return m_error; } 63 const char *credits (void); 64 65 // Settings that effect all SIDs 66 void filter (bool enable); 67 void filter (const sid_filter_t *filter); 68 void sampling (uint_least32_t freq); 69 }; 70 71 #endif // _resid_h_ 72