Skip to content

Commit 72f9da9

Browse files
committed
fix opl3 exclusive registers
1 parent 31b96b7 commit 72f9da9

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

resetopl.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ int main(int argc, char **argv) {
101101
fprintf(stderr, "OPL not detected at 0x%x\n", base);
102102
exit(1);
103103
}
104+
104105
/* Read status */
105106
val1 = inportb(base);
106107

@@ -134,9 +135,14 @@ int main(int argc, char **argv) {
134135
/* Test/Waveform select */
135136
set_registers(base, 0x01, 0x01, 0, opl3);
136137

137-
/* OPL2 */
138-
write_opl(base, 1, 4, 0);
139-
write_opl(base, 1, 5, 0);
138+
/* OPL3 */
139+
if (opl3) {
140+
/* 4-op enable */
141+
write_opl(base, 1, 4, 0);
142+
143+
/* OPL3 mode */
144+
write_opl(base, 1, 5, 0);
145+
}
140146

141147
return 0;
142-
}
148+
}

0 commit comments

Comments
 (0)