libsidplayfp  2.15.0
resid-emu.h
1 /*
2  * This file is part of libsidplayfp, a SID player engine.
3  *
4  * Copyright 2011-2019 Leandro Nini <drfiemost@users.sourceforge.net>
5  * Copyright 2007-2010 Antti Lankila
6  * Copyright 2001 Simon White
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef RESID_EMU_H
24 #define RESID_EMU_H
25 
26 #include <stdint.h>
27 
28 #include "sidplayfp/SidConfig.h"
29 #include "sidemu.h"
30 #include "Event.h"
31 #include "resid/sid.h"
32 
33 #include "sidcxx11.h"
34 
35 #ifdef HAVE_CONFIG_H
36 # include "config.h"
37 #endif
38 
39 
40 namespace libsidplayfp
41 {
42 
43 class ReSID final : public sidemu
44 {
45 private:
46  reSID::SID &m_sid;
47  int m_buffersize;
48  uint8_t m_voiceMask;
49 
50 public:
51  static const char* getCredits();
52 
53 public:
54  ReSID(sidbuilder *builder);
55  ~ReSID() override;
56 
57  bool getStatus() const { return m_status; }
58 
59  uint8_t read(uint_least8_t addr) override;
60  void write(uint_least8_t addr, uint8_t data) override;
61 
62  // c64sid functions
63  void reset(uint8_t volume) override;
64 
65  // Standard SID emu functions
66  void clock() override;
67 
68  void sampling(float systemclock, float freq,
69  SidConfig::sampling_method_t method, bool fast) override;
70 
71  void model(SidConfig::sid_model_t model, bool digiboost) override;
72 
73  // Specific to resid
74  void bias(double dac_bias);
75  void filter(bool enable);
76 };
77 
78 }
79 
80 #endif // RESID_EMU_H
sid_model_t
SID chip model.
Definition: SidConfig.h:51
sampling_method_t
Sampling method.
Definition: SidConfig.h:84
Definition: resid-emu.h:44
void clock() override
Definition: resid-emu.cpp:94
void model(SidConfig::sid_model_t model, bool digiboost) override
Definition: resid-emu.cpp:143
Definition: sidemu.h:47
Definition: sid.h:39
Definition: sidbuilder.h:41