summaryrefslogtreecommitdiff
path: root/opl/examples
diff options
context:
space:
mode:
authorSimon Howard2009-05-28 18:37:31 +0000
committerSimon Howard2009-05-28 18:37:31 +0000
commit6e4f6ab9626d81e4106d3ccc974a76d832fdff13 (patch)
tree297aed4697be1fbfb36679495f21ded18010ccb7 /opl/examples
parentb695843cc549e3de4845e340c611efb0ae98866c (diff)
downloadchocolate-doom-6e4f6ab9626d81e4106d3ccc974a76d832fdff13.tar.gz
chocolate-doom-6e4f6ab9626d81e4106d3ccc974a76d832fdff13.tar.bz2
chocolate-doom-6e4f6ab9626d81e4106d3ccc974a76d832fdff13.zip
Set channel bits for OPL3 so that OPL2 traces will play back properly.
Subversion-branch: /branches/opl-branch Subversion-revision: 1537
Diffstat (limited to 'opl/examples')
-rw-r--r--opl/examples/droplay.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/opl/examples/droplay.c b/opl/examples/droplay.c
index af1a59d9..5f09fe11 100644
--- a/opl/examples/droplay.c
+++ b/opl/examples/droplay.c
@@ -39,6 +39,15 @@ void WriteReg(unsigned int reg, unsigned int val)
{
int i;
+ // This was recorded from an OPL2, but we are probably playing
+ // back on an OPL3, so we need to enable the original OPL2
+ // channels. Doom does this already, but other games don't.
+
+ if ((reg & 0xf0) == OPL_REGS_FEEDBACK)
+ {
+ val |= 0x30;
+ }
+
OPL_WritePort(OPL_REGISTER_PORT, reg);
for (i=0; i<6; ++i)