libsidplayfp
3.0.0
Main Page
Classes
Files
Examples
File List
src
builders
sidlite-builder
sidlite
SID.h
1
/*
2
* This file is part of libsidplayfp, a SID player engine.
3
*
4
* Copyright (C) 2025-2026 Leandro Nini
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
21
// Based on cRSID lightweight RealSID by Hermit (Mihaly Horvath)
22
23
#ifndef SIDLITE_SID_H
24
#define SIDLITE_SID_H
25
26
#include "ADSR.h"
27
#include "Filter.h"
28
#include "WavGen.h"
29
#include "sl_settings.h"
30
31
#include <array>
32
33
namespace
SIDLite
34
{
35
36
class
SID
37
{
38
public
:
39
enum class
model_t
40
{
41
MOS6581,
42
MOS8580
43
};
44
45
public
:
46
SID();
47
void
reset();
48
void
write(
int
addr,
int
value);
49
int
read(
int
addr)
const
;
50
int
clock(
unsigned
int
cycles,
short
* buf);
51
52
void
setChipModel(model_t model);
53
void
setRealSIDmode(
bool
mode);
54
bool
setSamplingParameters(
unsigned
int
clockFrequency,
unsigned
short
samplingFrequency);
55
56
int
getLevel()
const
{
return
filter.getLevel(); }
57
58
private
:
59
unsigned
char
regs[0x20] = {0};
60
61
ADSR
adsr;
62
Filter
filter;
63
WavGen
wavgen;
64
settings
s;
65
66
short
SampleCycleCnt;
67
68
private
:
69
inline
bool
generateSample(
unsigned
int
&cycles,
short
&output);
70
};
71
72
}
73
74
#endif
// SIDLITE_SID_H
SIDLite::ADSR
Definition
ADSR.h:30
SIDLite::Filter
Definition
Filter.h:32
SIDLite::WavGen
Definition
WavGen.h:37
SIDLite::settings
Definition
sl_settings.h:32
Generated by
1.15.0