libsidplayfp 3.0.0
residfp-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 RESIDFP_EMU_H
24#define RESIDFP_EMU_H
25
26#include <cstdint>
27
28#include "residfp/residfp.h"
29#include "sidplayfp/SidConfig.h"
30#include "sidemu.h"
31#include "Event.h"
32
33#include "sidcxx11.h"
34
35
36class sidbuilder;
37
38namespace libsidplayfp
39{
40
41class reSIDfpEmu final : public sidemu
42{
43private:
44 reSIDfp::residfp &m_sid;
45
46public:
47 static const char* getCredits();
48
49public:
50 explicit reSIDfpEmu(sidbuilder *builder);
51 ~reSIDfpEmu() override;
52
53 bool getStatus() const { return m_status; }
54
55 uint8_t read(uint_least8_t addr) override;
56 void write(uint_least8_t addr, uint8_t data) override;
57
58 // c64sid functions
59 void reset(uint8_t volume) override;
60
61 // Standard SID emu functions
62 void clock() override;
63
64 void sampling(float systemclock, float freq,
65 SidConfig::sampling_method_t method) override;
66
67 void model(SidConfig::sid_model_t model, bool digiboost) override;
68
69 // Specific to residfp
70 void enableFilter(bool enable) { m_sid.enableFilter(enable); }
71
72 void filter6581Curve(double filterCurve) { m_sid.setFilter6581Curve(filterCurve); }
73
74 void filter6581Range(double adjustment) { m_sid.setFilter6581Range(adjustment); }
75
76 void filter8580Curve(double filterCurve) { m_sid.setFilter8580Curve(filterCurve); }
77
78 void enableOld6581caps(bool enable) { m_sid.enableOld6581caps(enable); }
79
80 void combinedWaveforms(SidConfig::sid_cw_t cws);
81};
82
83}
84
85#endif // RESIDFP_EMU_H
sid_model_t
SID chip model.
Definition SidConfig.h:44
sampling_method_t
Sampling method.
Definition SidConfig.h:77
sid_cw_t
SID combined waveforms strength.
Definition SidConfig.h:51
void clock() override
Definition residfp-emu.cpp:83
void model(SidConfig::sid_model_t model, bool digiboost) override
Definition residfp-emu.cpp:126
Definition sidbuilder.h:41