00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef SIDEMU_H
00024 #define SIDEMU_H
00025
00026 #include "SidConfig.h"
00027 #include "component.h"
00028 #include "sidplayfp/c64/Banks/Bank.h"
00029 #include "sidplayfp/siddefs.h"
00030
00031 class sidbuilder;
00032 class EventContext;
00033
00037 class sidemu : public component, public Bank
00038 {
00039 private:
00040 sidbuilder *m_builder;
00041
00042 protected:
00043 short *m_buffer;
00044 int m_bufferpos;
00045
00046 public:
00047 sidemu(sidbuilder *builder) :
00048 m_builder (builder), m_buffer(0) {}
00049 virtual ~sidemu() {}
00050
00051
00052 void reset() { reset (0); }
00053
00054 virtual void reset(uint8_t volume) = 0;
00055
00056 virtual void clock() = 0;
00057
00058 virtual bool lock(EventContext *env) = 0;
00059 virtual void unlock() = 0;
00060
00061
00062 virtual void voice(unsigned int num, bool mute) = 0;
00063 virtual void model(SidConfig::sid_model_t model) = 0;
00064
00065 sidbuilder *builder() const { return m_builder; }
00066
00067 virtual void sampling(float systemfreq SID_UNUSED, float outputfreq SID_UNUSED,
00068 SidConfig::sampling_method_t method SID_UNUSED, bool fast SID_UNUSED) {}
00069
00070 int bufferpos() const { return m_bufferpos; }
00071 void bufferpos(int pos) { m_bufferpos = pos; }
00072 short *buffer() const { return m_buffer; }
00073
00074 void poke(uint_least16_t address, uint8_t value) { write(address & 0x1f, value); }
00075 uint8_t peek(uint_least16_t address) { return read(address & 0x1f); }
00076 };
00077
00078 #endif // SIDEMU_H