- Replaced the opl_onechip cvar with opl_numchips. You can now emulate up to 8 of them for MIDI
playback. (Raw OPL playback will still clamp it to 2, since there's no use for more than that with any of the raw OPL formats.) SVN r3945 (trunk)
This commit is contained in:
parent
54ad69ebad
commit
12ee3271c4
7 changed files with 38 additions and 31 deletions
|
|
@ -68,12 +68,11 @@ void OPLio::OPLwriteReg(int which, uint reg, uchar data)
|
|||
*/
|
||||
void OPLio::OPLwriteChannel(uint regbase, uint channel, uchar data1, uchar data2)
|
||||
{
|
||||
static const uint op_num[] = {
|
||||
0x000, 0x001, 0x002, 0x008, 0x009, 0x00A, 0x010, 0x011, 0x012,
|
||||
0x100, 0x101, 0x102, 0x108, 0x109, 0x10A, 0x110, 0x111, 0x112};
|
||||
static const uint op_num[OPL2CHANNELS] = {
|
||||
0x00, 0x01, 0x02, 0x08, 0x09, 0x0A, 0x10, 0x11, 0x12};
|
||||
|
||||
uint reg = regbase+op_num[channel];
|
||||
uint which = reg>>8;
|
||||
uint which = channel / OPL2CHANNELS;
|
||||
uint reg = regbase + op_num[channel % OPL2CHANNELS];
|
||||
OPLwriteReg (which, reg, data1);
|
||||
OPLwriteReg (which, reg+3, data2);
|
||||
}
|
||||
|
|
@ -84,12 +83,8 @@ void OPLio::OPLwriteChannel(uint regbase, uint channel, uchar data1, uchar data2
|
|||
*/
|
||||
void OPLio::OPLwriteValue(uint regbase, uint channel, uchar value)
|
||||
{
|
||||
static const uint reg_num[] = {
|
||||
0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007, 0x008,
|
||||
0x100, 0x101, 0x102, 0x103, 0x104, 0x105, 0x106, 0x107, 0x108};
|
||||
|
||||
uint reg = regbase+reg_num[channel];
|
||||
uint which = reg>>8;
|
||||
uint which = channel / OPL2CHANNELS;
|
||||
uint reg = regbase + (channel % OPL2CHANNELS);
|
||||
OPLwriteReg (which, reg, value);
|
||||
}
|
||||
|
||||
|
|
@ -254,9 +249,10 @@ void OPLio::OPLwritePan(uint channel, struct OPL2instrument *instr, int pan)
|
|||
OPLwriteValue(0xC0, channel, instr->feedback | bits);
|
||||
|
||||
// Set real panning if we're using emulated chips.
|
||||
if (chips[0] != NULL)
|
||||
int which = channel / OPL2CHANNELS;
|
||||
if (chips[which] != NULL)
|
||||
{
|
||||
chips[channel/9]->SetPanning(channel%9, pan+64);
|
||||
chips[which]->SetPanning(channel % OPL2CHANNELS, pan + 64);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -306,7 +302,7 @@ void OPLio::OPLshutup(void)
|
|||
*/
|
||||
int OPLio::OPLinit(uint numchips, bool stereo)
|
||||
{
|
||||
assert(numchips >= 1 && numchips <= 2);
|
||||
assert(numchips >= 1 && numchips <= countof(chips));
|
||||
uint i;
|
||||
memset(chips, 0, sizeof(chips));
|
||||
for (i = 0; i < numchips; ++i)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue