00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef RESID_EMU_H
00024 #define RESID_EMU_H
00025
00026 #include <string>
00027
00028 #include "sidplayfp/sidemu.h"
00029 #include "sidplayfp/EventScheduler.h"
00030 #include "resid/sid.h"
00031
00032 #ifdef HAVE_CONFIG_H
00033 # include "config.h"
00034 #endif
00035
00036
00037 #define RESID_NAMESPACE reSID
00038
00039 #ifdef RESID_NAMESPACE
00040 # define RESID_NS ::RESID_NAMESPACE
00041 #else
00042 # define RESID_NS
00043 #endif
00044
00045 enum {
00046 OUTPUTBUFFERSIZE = 32768
00047 };
00048
00049 class ReSID: public sidemu
00050 {
00051 private:
00052 EventContext *m_context;
00053 RESID_NS::SID &m_sid;
00054 event_clock_t m_accessClk;
00055 const char *m_error;
00056 bool m_status;
00057 bool m_locked;
00058 uint8_t m_voiceMask;
00059
00060 static std::string m_credit;
00061
00062 public:
00063 static const char* getCredits();
00064
00065 public:
00066 ReSID(sidbuilder *builder);
00067 ~ReSID();
00068
00069
00070 const char *credits () const { return getCredits(); }
00071
00072 void reset() { sidemu::reset (); }
00073 void reset(uint8_t volume);
00074
00075 uint8_t read(uint_least8_t addr);
00076 void write(uint_least8_t addr, uint8_t data);
00077
00078 const char *error() const { return m_error; }
00079
00080
00081 void clock();
00082 void filter(bool enable);
00083 void voice(unsigned int num, bool mute);
00084
00085 bool getStatus() const { return m_status; }
00086
00087
00088 void sampling(float systemclock, float freq,
00089 SidConfig::sampling_method_t method, bool fast);
00090
00091 void bias(double dac_bias);
00092 void model(SidConfig::sid_model_t model);
00093
00094
00095 bool lock(EventContext *env);
00096 void unlock();
00097 };
00098
00099 #endif // RESID_EMU_H