-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaudioay.h
55 lines (42 loc) · 1.06 KB
/
audioay.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef AUDIOAY_H
#define AUDIOAY_H
#include "eden.h"
#include <iostream>
#include "binary.h"
using namespace std;
class AudioAY
{
public:
AudioAY();
void SetRegN(uchar N);
void SetRegV(uchar V);
void Clock();
int Sample();
void Reset();
//int ChipClock = 2048000;
int ChipClock = 1773500;
int SampleRate = 44100;
// Czestotliwosc dzwieku: ChipClock / (16 * ChannelPeriod)
// Szum dla ChipClock = 1773500:
// 31 -> 123 probki dzwieku na 20 probek chipu -> 6,167 probek dzwieku
// 15 -> 59 probek dzwieku na 20 probek chipu -> 2,98 probek dzwieku
private:
bool IsSoundGeneration();
int RegN;
int EnvelopePeriod;
int EnvelopeType;
int EnvelopeState;
int EnvelopeCounter;
int EnvelopeCounterPeriod;
int ChannelPeriod[4];
int ChannelVolume[3];
bool ChannelTone[3];
bool ChannelNoise[3];
bool ChannelUseEnvelope[3];
int ChannelState[3];
int ChannelCounter[4];
int ChannelCounterPeriod[4];
int EnvelopePattern[33];
int OutputValue[18];
};
#endif // AUDIOAY_H