Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

SBMIX questions (Developers)

posted by unterwulf Homepage, Saint-Petersburg, Russia, 15.11.2024, 13:28

> I'm very interested in both your optimized-ASM version and your Pascal
> patch.

I feel it's better to wait for an answer from the authors before publishing the derived work.

But I don't see how publishing the patch hurts anyone, so here it is:


--- sbmix.pas.orig      2020-01-21 22:13:20.000000000 +0300
+++ sbmix.pas   2024-11-15 14:55:10.294758909 +0300
@@ -45,6 +45,7 @@
   MIX_LINE   = $2E;   { Line input volume port index }
   MIX_CD     = $28;   { CD input volume port index }
   MIX_MIC    = $0A;   { Mic input volume port index }
+  MIX_PCSPKR = $3B;   { PC Speaker volume port index }
   DSP_GETVER = $E1;   { Get DSP Version command }
   DSPTIMEOUT = $4FF;  { Timeout for DSP }

@@ -60,6 +61,7 @@
   cd,         { CD input volume (as above) }
   line,       { Line input volume (as above) }
   mic,        { Mic input volume (mono, range = 0..7) }
+  pcspkr,     { PC Speaker volume (mono, range = 0..3) }
   chg: Byte;  { flag: the mixer needs re-programming }

   flag1, flag2: Integer;  { flags for string to integer conversion }
@@ -222,6 +224,7 @@
   line := getmixreg(MIX_LINE);
   cd   := getmixreg(MIX_CD);
   mic  := getmixreg(MIX_MIC);
+  pcspkr := getmixreg(MIX_PCSPKR);
 end;

 { Set all corresponding mixer registers }
@@ -234,6 +237,7 @@
   setmixreg(MIX_LINE,   line);
   setmixreg(MIX_CD,     cd);
   setmixreg(MIX_MIC,    mic);
+  setmixreg(MIX_PCSPKR, pcspkr);
 end;

 { Display current mixer settings }
@@ -253,17 +257,19 @@
   Writeln(' CD volume (Left, Right)........',
           cd   shr 4: 3, ',', cd   and 15: 3);
   Writeln(' Mic volume.....................', mic  and 7: 3);
+  Writeln(' PC Speaker volume..............', pcspkr shr 6: 3);
 end;

 { Display help message }
 procedure help;
 begin
-  Writeln('SBMIX Version 21-JAN-2020  SBPro mixer control'^M^J +
-          'Copyright (c) 1997-2020 BTTR Software'^M^J +
+  Writeln('SBMIX Version 29-OCT-2024  SBPro mixer control'^M^J +
+          'Copyright (c) 1997-2024 BTTR Software'^M^J +
           '[Under `MODIFIED'' BSD LICENSE]'^M^J +
           ^M^J,
           'Usage: SBMIX [<master>] [/W<wave>] [/F<fm>] [/C<cd>]' +
           ' [/L<line>] [/X<mic>]'^M^J +
+          '             [/S<pcspkr>]'^M^J +
           '       SBMIX [/Help|/?]'^M^J +
           ^M^J +
           '  <master> = <both> | <left>,<right> = master volume,     0..15'^M^J +
@@ -272,6 +278,7 @@
           '  <cd>     = <both> | <left>,<right> = CD input volume,   0..15'^M^J +
           '  <line>   = <both> | <left>,<right> = Line input volume, 0..15'^M^J,
           '  <mic>    = <mono>                  = Mic input volume,  0..7'^M^J +
+          '  <pcspkr> = <mono>                  = PC Speaker volume, 0..3'^M^J +
           ^M^J +
           'Note: `BLASTER'' environment variable must be set correctly!'^M^J +
           ^M^J +
@@ -372,6 +379,16 @@
           else
             errhalt;              { wrong Mic volume }
         end;
+      'S':
+        begin
+          Val(par, vl, flag1);
+          if ((flag1 = 0) and (vl >= 0) and (vl <= 3)) then
+          begin
+            pcspkr := vl shl 6; Inc(chg);  { PC Speaker volume in range, set }
+          end
+          else
+            errhalt;                 { wrong PC Speaker volume }
+        end;
       'H',
       '?': help;
       else

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 54 users online (0 registered, 54 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum