mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-16 01:02:03 +00:00
- The raw OPL music player no longer checks against the chip count for writing to the second
OPL2; OPLwriteReg() will now do nothing when called to act on a chip that doesn't exist. This is so that it can use the second half of a single OPL3. SVN r3949 (trunk)
This commit is contained in:
parent
b513931473
commit
8670d6e4f4
2 changed files with 7 additions and 10 deletions
|
@ -68,8 +68,11 @@ void OPLio::OPLwriteReg(int which, uint reg, uchar data)
|
|||
reg |= (which & 1) << 8;
|
||||
which >>= 1;
|
||||
}
|
||||
if (chips[which] != NULL)
|
||||
{
|
||||
chips[which]->WriteReg(reg, data);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Write to an operator pair. To be used for register bases of 0x20, 0x40,
|
||||
|
|
|
@ -411,10 +411,7 @@ int OPLmusicFile::PlayTick ()
|
|||
break;
|
||||
|
||||
default: // It's something to stuff into the OPL chip
|
||||
if (WhichChip < NumChips)
|
||||
{
|
||||
io->OPLwriteReg(WhichChip, reg, data);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -454,11 +451,8 @@ int OPLmusicFile::PlayTick ()
|
|||
{
|
||||
data = *score++;
|
||||
}
|
||||
if (WhichChip < NumChips)
|
||||
{
|
||||
io->OPLwriteReg(WhichChip, reg, data);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case DosBox2:
|
||||
|
@ -485,7 +479,7 @@ int OPLmusicFile::PlayTick ()
|
|||
{
|
||||
return (data + 1) << 8;
|
||||
}
|
||||
else if (code < to_reg_size && which < NumChips)
|
||||
else if (code < to_reg_size)
|
||||
{
|
||||
io->OPLwriteReg(which, to_reg[code], data);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue