From 02e888e0012878eb2513ecfc8f521dde3c1b6b61 Mon Sep 17 00:00:00 2001 From: Sjoerd van der Berg Date: Fri, 18 Oct 2002 09:03:23 +0000 Subject: [PATCH] Removed the hardware manager functions. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@333 --- src/hardware/adlib.cpp | 51 ++-------------------------------- src/hardware/gameblaster.cpp | 54 ++---------------------------------- 2 files changed, 4 insertions(+), 101 deletions(-) diff --git a/src/hardware/adlib.cpp b/src/hardware/adlib.cpp index 83a49cd5..87e36302 100644 --- a/src/hardware/adlib.cpp +++ b/src/hardware/adlib.cpp @@ -126,7 +126,6 @@ static void write_p389(Bit32u port,Bit8u val) { } -static HWBlock hw_adlib; static bool adlib_enabled; static void ADLIB_Enable(bool enable) { @@ -153,48 +152,10 @@ static void ADLIB_Enable(bool enable) { } -static void ADLIB_InputHandler(char * line) { - bool s_off=ScanCMDBool(line,"OFF"); - bool s_on=ScanCMDBool(line,"ON"); - char * rem=ScanCMDRemain(line); - if (rem) { - sprintf(line,"Illegal Switch"); - return; - } - if (s_on && s_off) { - sprintf(line,"Can't use /ON and /OFF at the same time"); - return; - } - if (s_on) { - ADLIB_Enable(true); - sprintf(line,"Adlib has been enabled"); - return; - } - if (s_off) { - ADLIB_Enable(false); - sprintf(line,"Adlib has been disabled"); - return; - } - return; -} - -static void ADLIB_OutputHandler (char * towrite) { - if(adlib_enabled) { - sprintf(towrite,"IO %X",0x388); - } else { - sprintf(towrite,"Disabled"); - } -}; - - - - - - - void ADLIB_Init(Section* sec) { Section_prop * section=static_cast(sec); - if(!section->Get_bool("STATUS")) return; + if(!section->Get_bool("adlib")) return; + timer1.isMasked=true; timer1.base=0; timer1.count=0; @@ -212,14 +173,6 @@ void ADLIB_Init(Section* sec) { adlib_chan=MIXER_AddChannel(ADLIB_CallBack,ADLIB_FREQ,"ADLIB"); MIXER_SetMode(adlib_chan,MIXER_16MONO); - - hw_adlib.dev_name="ADLIB"; - hw_adlib.full_name="Adlib FM Synthesizer"; - hw_adlib.next=0; - hw_adlib.help="/ON Enables Adlib\n/OFF Disables Adlib\n"; - hw_adlib.get_input=ADLIB_InputHandler; - hw_adlib.show_status=ADLIB_OutputHandler; - HW_Register(&hw_adlib); ADLIB_Enable(true); }; diff --git a/src/hardware/gameblaster.cpp b/src/hardware/gameblaster.cpp index 6ddd6969..c6494f50 100644 --- a/src/hardware/gameblaster.cpp +++ b/src/hardware/gameblaster.cpp @@ -36,8 +36,6 @@ #define PI 3.14159265358979323846 #endif - - struct CMS { struct { Bit32u freq_pos; @@ -157,7 +155,6 @@ static void CMS_CallBack(Bit8u * stream,Bit32u len) { } -static HWBlock hw_cms; static bool cms_enabled; static void CMS_Enable(bool enable) { @@ -178,60 +175,14 @@ static void CMS_Enable(bool enable) { } } - -static void CMS_InputHandler(char * line) { - bool s_off=ScanCMDBool(line,"OFF"); - bool s_on=ScanCMDBool(line,"ON"); - char * rem=ScanCMDRemain(line); - if (rem) { - sprintf(line,"Illegal Switch"); - return; - } - if (s_on && s_off) { - sprintf(line,"Can't use /ON and /OFF at the same time"); - return; - } - if (s_on) { - CMS_Enable(true); - sprintf(line,"Creative Music System has been enabled"); - return; - } - if (s_off) { - CMS_Enable(false); - sprintf(line,"Creative Music System has been disabled"); - return; - } - return; -} - -static void CMS_OutputHandler (char * towrite) { - if(cms_enabled) { - sprintf(towrite,"IO %X",0x220); - } else { - sprintf(towrite,"Disabled"); - } -}; - - - - void CMS_Init(Section* sec) { Section_prop * section=static_cast(sec); - if(!section->Get_bool("STATUS")) return; + if(!section->Get_bool("cms")) return; Bits i; /* Register the Mixer CallBack */ cms_chan=MIXER_AddChannel(CMS_CallBack,CMS_RATE,"CMS"); MIXER_SetMode(cms_chan,MIXER_16STEREO); MIXER_Enable(cms_chan,false); -/* Register with the hardware setup tool */ - hw_cms.dev_name="CMS"; - hw_cms.full_name="Creative Music System"; - hw_cms.next=0; - hw_cms.help="/ON Enables CMS\n/OFF Disables CMS\n"; - hw_cms.get_input=CMS_InputHandler; - hw_cms.show_status=CMS_OutputHandler; - HW_Register(&hw_cms); - CMS_Enable(false); /* Make the frequency/octave table */ double log_start=log10(27.34375); double log_add=(log10(54.609375)-log10(27.34375))/256; @@ -254,7 +205,6 @@ void CMS_Init(Section* sec) { out /= 1.1; } } - - + CMS_Enable(true); }