ScummVM API documentation
pc98_audio.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 PC98_AUDIO_H
23#define PC98_AUDIO_H
24
25#include "common/scummsys.h"
26
27namespace Audio {
28class Mixer;
29}
30
31class PC98AudioCoreInternal;
33public:
34 enum EmuType {
35 kTypeTowns = 0,
36 kType26 = 1,
37 kType86 = 2
38 };
39
40 virtual ~PC98AudioPluginDriver() {}
41 virtual void timerCallbackA() {}
42 virtual void timerCallbackB() {}
43};
44
46public:
47 PC98AudioCore(Audio::Mixer *mixer, PC98AudioPluginDriver *driver, PC98AudioPluginDriver::EmuType type);
49
50 bool init();
51 void reset();
52
53 void writeReg(uint8 part, uint8 regAddress, uint8 value);
54 uint8 readReg(uint8 part, uint8 regAddress);
55
56 void writePort(uint16 port, uint8 value);
57 uint8 readPort(uint16 port);
58
59 void setMusicVolume(int volume);
60 void setSoundEffectVolume(int volume);
61
62 // Defines the channels used as sound effect channels for the purpose of ScummVM GUI volume control.
63 // The first 6 bits are the 6 fm channels. The next 3 bits are ssg channels. The next bit is the rhythm channel.
64 void setSoundEffectChanMask(int mask);
65
66 void ssgSetVolume(int volume);
67
68 class MutexLock {
69 friend class PC98AudioCore;
70 public:
71 ~MutexLock();
72 private:
73 MutexLock(PC98AudioCoreInternal *pc98int, int reverse = 0);
74 PC98AudioCoreInternal *_pc98int;
75 int _count;
76 };
77
78 MutexLock stackLockMutex();
79 MutexLock stackUnlockMutex();
80
81private:
82 PC98AudioCoreInternal *_internal;
83};
84
85#endif
Definition: mixer.h:70
Definition: pc98_audio.h:68
Definition: pc98_audio.h:45
Definition: pc98_audio.h:32
Definition: system.h:39