openMSX
Main Page
Namespaces
Classes
Files
File List
File Members
sound
Y8950.hh
Go to the documentation of this file.
1
#ifndef Y8950_HH
2
#define Y8950_HH
3
4
#include "
EmuTime.hh
"
5
#include "
openmsx.hh
"
6
#include <string>
7
#include <memory>
8
9
namespace
openmsx {
10
11
class
MSXAudio
;
12
class
MSXMotherBoard;
13
class
DeviceConfig;
14
15
class
Y8950
16
{
17
public
:
18
static
const
int
CLOCK_FREQ
= 3579545;
19
static
const
int
CLOCK_FREQ_DIV
= 72;
20
21
// Bitmask for register 0x04
22
// Timer1 Start.
23
static
const
int
R04_ST1
= 0x01;
24
// Timer2 Start.
25
static
const
int
R04_ST2
= 0x02;
26
// not used
27
//static const int R04 = 0x04;
28
// Mask 'Buffer Ready'.
29
static
const
int
R04_MASK_BUF_RDY
= 0x08;
30
// Mask 'End of sequence'.
31
static
const
int
R04_MASK_EOS
= 0x10;
32
// Mask Timer2 flag.
33
static
const
int
R04_MASK_T2
= 0x20;
34
// Mask Timer1 flag.
35
static
const
int
R04_MASK_T1
= 0x40;
36
// IRQ RESET.
37
static
const
int
R04_IRQ_RESET
= 0x80;
38
39
// Bitmask for status register
40
static
const
int
STATUS_EOS
=
R04_MASK_EOS
;
41
static
const
int
STATUS_BUF_RDY
=
R04_MASK_BUF_RDY
;
42
static
const
int
STATUS_T2
=
R04_MASK_T2
;
43
static
const
int
STATUS_T1
=
R04_MASK_T1
;
44
45
Y8950
(
const
std::string& name,
const
DeviceConfig
& config,
46
unsigned
sampleRam,
EmuTime::param
time,
MSXAudio
& audio);
47
~Y8950
();
48
49
void
setEnabled
(
bool
enabled,
EmuTime::param
time);
50
void
clearRam
();
51
void
reset
(
EmuTime::param
time);
52
void
writeReg
(
byte
reg,
byte
data,
EmuTime::param
time);
53
byte
readReg
(
byte
reg,
EmuTime::param
time);
54
byte
peekReg
(
byte
reg,
EmuTime::param
time)
const
;
55
byte
readStatus
(
EmuTime::param
time);
56
byte
peekStatus
(
EmuTime::param
time)
const
;
57
58
// for ADPCM
59
void
setStatus
(
byte
flags);
60
void
resetStatus
(
byte
flags);
61
byte
peekRawStatus
()
const
;
62
63
template
<
typename
Archive>
64
void
serialize
(Archive& ar,
unsigned
version);
65
66
private
:
67
class
Impl
;
68
const
std::unique_ptr<Impl> pimpl;
69
};
70
71
}
// namespace openmsx
72
73
#endif
Generated on Mon May 20 2013 12:17:01 for openMSX by
1.8.1.2