From f884e578669ff85365b1e838ee8671ddac8ab112 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 18 Jul 2011 21:47:57 +0200 Subject: [PATCH] CGE: Remove a bunch of useless sound related menus --- engines/cge/cge_main.cpp | 2 +- engines/cge/config.cpp | 233 --------------------------------------- engines/cge/config.h | 3 - engines/cge/snail.cpp | 2 +- 4 files changed, 2 insertions(+), 238 deletions(-) diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp index 34768e42a42..cb060891cfd 100644 --- a/engines/cge/cge_main.cpp +++ b/engines/cge/cge_main.cpp @@ -1702,7 +1702,7 @@ bool CGEEngine::showTitle(const char *name) { _vga->_showQ->append(_mouse); _heart->_enable = true; _mouse->on(); - for (selectSound(); !_snail->idle() || Vmenu::_addr;) { + for (; !_snail->idle() || Vmenu::_addr;) { mainLoop(); if (_eventManager->_quitFlag) return false; diff --git a/engines/cge/config.cpp b/engines/cge/config.cpp index 2941d36d2c8..f8d5431ef08 100644 --- a/engines/cge/config.cpp +++ b/engines/cge/config.cpp @@ -33,152 +33,8 @@ namespace CGE { -/* - 51=wska§ typ posiadanej karty d¦wi‘kowej - 52=wybierz numer portu dla karty d¦wi‘kowej - 53=wybierz numer przerwania dla karty d¦wi‘kowej - 54=wybierz numer kana’u DMA dla karty d¦wi‘kowej - 55=wybierz numer portu dla General MIDI - 55=konfiguracja karty d¦wi‘kowej -*/ -#define STYPE_TEXT 51 -#define SPORT_TEXT 52 -#define SIRQ_TEXT 53 -#define SDMA_TEXT 54 -#define MPORT_TEXT 55 #define MENU_TEXT 56 -#define NONE_TEXT 60 -#define SB_TEXT 61 -#define SBM_TEXT 62 -#define GUS_TEXT 63 -#define GUSM_TEXT 64 -#define MIDI_TEXT 65 -#define AUTO_TEXT 66 - -#define DETECT 0xFFFF - - -static int DevName[] = { - NONE_TEXT, SB_TEXT, SBM_TEXT, GUS_TEXT, GUSM_TEXT, - MIDI_TEXT, AUTO_TEXT -}; - -static Choice DevMenu[] = { - { NULL, &CGEEngine::NONE }, - { NULL, &CGEEngine::SB }, - { NULL, &CGEEngine::SBM }, - { NULL, &CGEEngine::GUS }, - { NULL, &CGEEngine::GUSM }, - { NULL, &CGEEngine::MIDI }, - { NULL, &CGEEngine::AUTO }, - { NULL, NULL } -}; - - -static Choice DigiPorts[] = { - { " 210h", &CGEEngine::setPortD }, - { " 220h", &CGEEngine::setPortD }, - { " 230h", &CGEEngine::setPortD }, - { " 240h", &CGEEngine::setPortD }, - { " 250h", &CGEEngine::setPortD }, - { " 260h", &CGEEngine::setPortD }, - { "AUTO ", &CGEEngine::setPortD }, - { NULL, NULL } -}; - -static Choice MIDIPorts[] = { - { " 220h", &CGEEngine::setPortM }, - { " 230h", &CGEEngine::setPortM }, - { " 240h", &CGEEngine::setPortM }, - { " 250h", &CGEEngine::setPortM }, - { " 300h", &CGEEngine::setPortM }, - { " 320h", &CGEEngine::setPortM }, - { " 330h", &CGEEngine::setPortM }, - { " 340h", &CGEEngine::setPortM }, - { " 350h", &CGEEngine::setPortM }, - { " 360h", &CGEEngine::setPortM }, - { "AUTO ", &CGEEngine::setPortM }, - { NULL, NULL } -}; - -static Choice BlsterIRQ[] = { - { "IRQ 2", &CGEEngine::setIRQ }, - { "IRQ 5", &CGEEngine::setIRQ }, - { "IRQ 7", &CGEEngine::setIRQ }, - { "IRQ 10", &CGEEngine::setIRQ }, - { "AUTO ", &CGEEngine::setIRQ }, - { NULL, NULL } -}; - -static Choice GravisIRQ[] = { - { "IRQ 2", &CGEEngine::setIRQ }, - { "IRQ 5", &CGEEngine::setIRQ }, - { "IRQ 7", &CGEEngine::setIRQ }, - { "IRQ 11", &CGEEngine::setIRQ }, - { "IRQ 12", &CGEEngine::setIRQ }, - { "IRQ 15", &CGEEngine::setIRQ }, - { "AUTO ", &CGEEngine::setIRQ }, - { NULL, NULL } -}; - -static Choice GravisDMA[] = { - { "DMA 1", &CGEEngine::setDMA }, - { "DMA 3", &CGEEngine::setDMA }, - { "DMA 5", &CGEEngine::setDMA }, - { "DMA 6", &CGEEngine::setDMA }, - { "DMA 7", &CGEEngine::setDMA }, - { "AUTO ", &CGEEngine::setDMA }, - { NULL, NULL } -}; - -static Choice BlsterDMA[] = { - { "DMA 0", &CGEEngine::setDMA }, - { "DMA 1", &CGEEngine::setDMA }, - { "DMA 3", &CGEEngine::setDMA }, - { "AUTO ", &CGEEngine::setDMA }, - { NULL, NULL } -}; - - -void CGEEngine::selectSound() { - int i; - _sound.close(); - if (Vmenu::_addr) - SNPOST_(SNKILL, -1, 0, Vmenu::_addr); - inf(_text->getText(STYPE_TEXT)); - _talk->gotoxy(_talk->_x, FONT_HIG / 2); - for (i = 0; i < (int)ArrayCount(DevName); i++) - DevMenu[i]._text = _text->getText(DevName[i]); - (new Vmenu(this, DevMenu, SCR_WID / 2, _talk->_y + _talk->_h + TEXT_VM + FONT_HIG))->setName(_text->getText(MENU_TEXT)); -} - - -static void reset() { - _sndDrvInfo._dBase = _sndDrvInfo._dIrq = _sndDrvInfo._dDma = _sndDrvInfo._mBase = DETECT; -} - - -static uint16 deco(const char *str, uint16(*dco)(const char *)) { - while (*str && ! IsDigit(*str)) - ++str; - if (*str) - return dco(str); - else - return DETECT; -} - - -static uint16 ddeco(const char *str) { - return deco(str, atow); -} - - -static uint16 xdeco(const char *str) { - return deco(str, xtow); -} - - static Choice *_cho; static int _hlp; @@ -188,93 +44,4 @@ void CGEEngine::snSelect() { (new Vmenu(this, _cho, SCR_WID / 2, _talk->_y + _talk->_h + TEXT_VM + FONT_HIG))->setName(_text->getText(MENU_TEXT)); } - -static void select(Choice *cho, int hlp) { - _cho = cho; - _hlp = hlp; - SNPOST2(SNEXEC, -1, 0, kSnSelect); -} - - -void CGEEngine::NONE() { - _sndDrvInfo._dDev = DEV_QUIET; - _sndDrvInfo._mDev = DEV_QUIET; - _sound.open(); -} - - -void CGEEngine::SB() { - _sndDrvInfo._dDev = DEV_SB; - _sndDrvInfo._mDev = DEV_SB; - reset(); - select(DigiPorts, SPORT_TEXT); -} - - -void CGEEngine::SBM() { - _sndDrvInfo._dDev = DEV_SB; - _sndDrvInfo._mDev = DEV_GM; - reset(); - select(DigiPorts, SPORT_TEXT); -} - - -void CGEEngine::GUS() { - _sndDrvInfo._dDev = DEV_GUS; - _sndDrvInfo._mDev = DEV_GUS; - reset(); - select(DigiPorts, SPORT_TEXT); -} - - -void CGEEngine::GUSM() { - _sndDrvInfo._dDev = DEV_GUS; - _sndDrvInfo._mDev = DEV_GM; - reset(); - select(DigiPorts, SPORT_TEXT); -} - - -void CGEEngine::MIDI() { - _sndDrvInfo._dDev = DEV_QUIET; - _sndDrvInfo._mDev = DEV_GM; - _sndDrvInfo._mBase = DETECT; - select(MIDIPorts, MPORT_TEXT); -} - - -void CGEEngine::AUTO() { - _sndDrvInfo._dDev = DEV_AUTO; - _sndDrvInfo._mDev = DEV_AUTO; - reset(); - _sound.open(); -} - - -void CGEEngine::setPortD() { - _sndDrvInfo._dBase = xdeco(DigiPorts[Vmenu::_recent]._text); - select((_sndDrvInfo._dDev == DEV_SB) ? BlsterIRQ : GravisIRQ, SIRQ_TEXT); -} - - -void CGEEngine::setPortM() { - _sndDrvInfo._mBase = xdeco(MIDIPorts[Vmenu::_recent]._text); - _sound.open(); -} - - -void CGEEngine::setIRQ() { - _sndDrvInfo._dIrq = ddeco(((_sndDrvInfo._dDev == DEV_SB) ? BlsterIRQ : GravisIRQ)[Vmenu::_recent]._text); - select((_sndDrvInfo._dDev == DEV_SB) ? BlsterDMA : GravisDMA, SDMA_TEXT); -} - - -void CGEEngine::setDMA() { - _sndDrvInfo._dDma = ddeco(((_sndDrvInfo._dDev == DEV_SB) ? BlsterDMA : GravisDMA)[Vmenu::_recent]._text); - if (_sndDrvInfo._mDev != _sndDrvInfo._dDev) - select(MIDIPorts, MPORT_TEXT); - else - _sound.open(); -} - } // End of namespace CGE diff --git a/engines/cge/config.h b/engines/cge/config.h index 4a1e5927e51..d7191a281db 100644 --- a/engines/cge/config.h +++ b/engines/cge/config.h @@ -29,9 +29,6 @@ #define __CGE_CONFIG__ namespace CGE { - -void selectSound(); - } // End of namespace CGE #endif diff --git a/engines/cge/snail.cpp b/engines/cge/snail.cpp index 977103d7a1c..9d5b188fe52 100644 --- a/engines/cge/snail.cpp +++ b/engines/cge/snail.cpp @@ -1068,7 +1068,7 @@ void Snail::runCom() { _vm->xCave(); break; case kSelectSound: - _vm->selectSound(); + warning("TODO: Select sound card"); break; case kSnSelect: _vm->snSelect();