-
Notifications
You must be signed in to change notification settings - Fork 0
/
Combined.c
99 lines (86 loc) · 2.04 KB
/
Combined.c
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/** ADAMEm: Coleco ADAM emulator ********************************************/
/** **/
/** Combined.c **/
/** **/
/** Coleco sound hardware emulation via Adlib+SoundBlaster **/
/** **/
/** Copyright (C) Marcel de Kogel 1996,1997,1998,1999 **/
/** You are not allowed to distribute this software commercially **/
/** Please, notify me, if you make any changes to this file **/
/****************************************************************************/
#ifdef SOUND
#include "Coleco.h"
static int Init (void)
{
if (!Adlib_SoundDriver.Init ())
return 0;
if (!SB_SoundDriver.Init ())
{
Adlib_SoundDriver.Reset ();
return 0;
}
return 1;
}
static void Reset (void)
{
SB_SoundDriver.Reset ();
Adlib_SoundDriver.Reset ();
}
static void WriteSoundReg (int r,int v)
{
switch (r)
{
case 0:
case 1:
case 2:
case 3:
case 5:
Adlib_SoundDriver.WriteSoundReg (r,v);
break;
case 4:
Adlib_SoundDriver.WriteSoundReg (r,v);
SB_SoundDriver.WriteSoundReg (r,v);
break;
case 6:
case 7:
SB_SoundDriver.WriteSoundReg (r,v);
break;
}
}
static void Toggle (void)
{
SB_SoundDriver.Toggle ();
Adlib_SoundDriver.Toggle ();
}
static void ToggleChannel (int channel)
{
SB_SoundDriver.ToggleChannel (channel);
Adlib_SoundDriver.ToggleChannel (channel);
}
static void SetMasterVolume (int newvolume)
{
SB_SoundDriver.SetMasterVolume (newvolume);
Adlib_SoundDriver.SetMasterVolume (newvolume);
}
static void Stop (void)
{
SB_SoundDriver.Stop ();
Adlib_SoundDriver.Stop ();
}
static void Resume (void)
{
SB_SoundDriver.Resume ();
Adlib_SoundDriver.Resume ();
}
struct SoundDriver_struct Combined_SoundDriver=
{
Init,
Reset,
WriteSoundReg,
Toggle,
ToggleChannel,
SetMasterVolume,
Stop,
Resume
};
#endif