ScummVM API documentation
elvira_atarist.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef AGOS_ELVIRA_ATARIST_H
23#define AGOS_ELVIRA_ATARIST_H
24
25#include "common/array.h"
26#include "common/ptr.h"
27#include "common/stream.h"
28
29namespace YM2149 {
30class YM2149;
31}
32
33namespace AGOS {
34
35class ElviraPrgDriver;
36
38public:
40 ElviraAtariSTPlayer(Common::SeekableReadStream *stream, uint16 elvira1Tune);
42
43 bool isValid() const { return _isValid; }
44
45private:
46 friend class ElviraPrgDriver;
47
48 static const uint32 kDefaultFrameHz = 25;
49 static const uint32 kElvira1PrgFrameHz = 50;
50
53 size_t _pos = 0;
54 uint32 _frameHz = kDefaultFrameHz;
55 bool _ended = false;
56 uint32 _framesLeftInWait = 0;
57 uint16 _elvira1Tune = 1;
58 ElviraPrgDriver *_elviraPrgDriver = nullptr;
59 bool _isValid = true;
60 YM2149::YM2149 *_chip = nullptr;
61
62 enum Mode {
63 kModeElvira2PKD,
64 kModeElvira1PRG
65 };
66
67 Mode _mode = kModeElvira2PKD;
68
69 void resetPlayer();
70 void parseUntilWait();
71 void writeReg(int reg, uint8 data);
72 void onTimer();
73};
74
75} // namespace AGOS
76
77#endif
Definition: elvira_atarist.h:37
Definition: stream.h:745
Definition: ym2149.h:40