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
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (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, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #include "agi/agi.h"
24 
25 #include "agi/sound_coco3.h"
26 
27 namespace Agi {
28 
29 static int cocoFrequencies[] = {
30 	 130,  138,  146,  155,  164,  174,  184,  195,  207,  220,  233,  246,
31 	 261,  277,  293,  311,  329,  349,  369,  391,  415,  440,  466,  493,
32 	 523,  554,  587,  622,  659,  698,  739,  783,  830,  880,  932,  987,
33 	1046, 1108, 1174, 1244, 1318, 1396, 1479, 1567, 1661, 1760, 1864, 1975,
34 	2093, 2217, 2349, 2489, 2637, 2793, 2959, 3135, 3322, 3520, 3729, 3951
35 };
36 
SoundGenCoCo3(AgiBase * vm,Audio::Mixer * pMixer)37 SoundGenCoCo3::SoundGenCoCo3(AgiBase *vm, Audio::Mixer *pMixer) : SoundGen(vm, pMixer) {
38 }
39 
~SoundGenCoCo3()40 SoundGenCoCo3::~SoundGenCoCo3() {
41 }
42 
play(int resnum)43 void SoundGenCoCo3::play(int resnum) {
44 	int i = cocoFrequencies[0]; // Silence warning
45 
46 	i = i + 1;
47 
48 #if 0
49 	int i = 0;
50 	CoCoNote note;
51 
52 	do {
53 		note.read(_chn[i].ptr);
54 
55 		if (note.freq != 0xff) {
56 			playNote(0, cocoFrequencies[note.freq], note.volume);
57 
58 			uint32 start_time = _vm->_system->getMillis();
59 
60 			while (_vm->_system->getMillis() < start_time + note.duration) {
61 				_vm->_system->updateScreen();
62 
63 				_vm->_system->delayMillis(10);
64 			}
65 		}
66 	} while (note.freq != 0xff);
67 #endif
68 }
69 
stop()70 void SoundGenCoCo3::stop() {
71 }
72 
readBuffer(int16 * buffer,const int numSamples)73 int SoundGenCoCo3::readBuffer(int16 *buffer, const int numSamples) {
74 	return numSamples;
75 }
76 
77 } // End of namespace Agi
78