From 6e4f6ab9626d81e4106d3ccc974a76d832fdff13 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Thu, 28 May 2009 18:37:31 +0000 Subject: Set channel bits for OPL3 so that OPL2 traces will play back properly. Subversion-branch: /branches/opl-branch Subversion-revision: 1537 --- opl/examples/droplay.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'opl/examples/droplay.c') 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) -- cgit v1.2.3