From 25c67b716015e1a5cf9379ffcb7fd6e8a62766c6 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 8 Jun 2015 21:12:26 -0400 Subject: opl: Change result from OPL_Init() to an enum. This no longer returns a boolean value, but actually returns an integer indicating the type of OPL chip that was detected. Change the return value to have a more meaningful value. --- src/i_oplmusic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/i_oplmusic.c b/src/i_oplmusic.c index f98f2c91..239c9794 100644 --- a/src/i_oplmusic.c +++ b/src/i_oplmusic.c @@ -1651,12 +1651,12 @@ static void I_OPL_ShutdownMusic(void) static boolean I_OPL_InitMusic(void) { char *dmxoption; - int opl_chip_type; + opl_init_result_t chip_type; OPL_SetSampleRate(snd_samplerate); - opl_chip_type = OPL_Init(opl_io_port); - if (!opl_chip_type) + chip_type = OPL_Init(opl_io_port); + if (chip_type == OPL_INIT_NONE) { printf("Dude. The Adlib isn't responding.\n"); return false; @@ -1670,7 +1670,7 @@ static boolean I_OPL_InitMusic(void) dmxoption = snd_dmxoption != NULL ? snd_dmxoption : ""; } - if (opl_chip_type == 2 && strstr(dmxoption, "-opl3") != NULL) + if (chip_type == OPL_INIT_OPL3 && strstr(dmxoption, "-opl3") != NULL) { opl_opl3mode = 1; num_opl_voices = OPL_NUM_VOICES * 2; -- cgit v1.2.3