🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.os2.programmer
6 messages
6 total messages Started by Bt Garner Wed, 31 Oct 1990 13:32
if (DosBeep == _WORTHLESS) {plead('Help!);}
#1603
Author: Bt Garner
Date: Wed, 31 Oct 1990 13:32
28 lines
1626 bytes
as you may have guessed from the subject line, this *is* a plead for help.

I am currently in the process of converting a DOS app to OS/2, and the 
results have been very pleasing with one major exception:  the creation
of sounds.  Our App uses a fair amount of "sound" (in a fashion of turn on
the sound, go do something else, change the sound, then go do something
else, then turn off the sound) which just doesn't cut it using the DosBeep
function.

The Plea:  Is there a way to access the speaker without the use of DosBeep?
Examples would be greatly apprecited, any language will do.

I've read about 20 books on OS/2 programming and have yet to see anything
on this subject (or even any ideas, for that matter - gack!)

thanx,

bt garner

(apologies to those who get this as a re-post, the first NewsFeeder I used
 doesn't seem to want to send things outta 'Bama)

--
*  bt garner  *  230 Ross Hall  *  Auburn University  *  Alabama  *  36849   *
*  internet: bt@eng.auburn.edu  *  Opinions: Mine, don't blame (or flame) AU *
*  "'Reality' is the only word in the language that should always be used in *
*  quotes."      -TKK                                                        *
Re: if (DosBeep == _WORTHLESS) {plead('Help!);}
#1608
Author: Terry Freas
Date: Thu, 01 Nov 1990 17:54
13 lines
1268 bytes
In article <10312@milton.u.washington.edu> zyx@milton.u.washington.edu (Bt Garner) writes:
>The Plea:  Is there a way to access the speaker without the use of DosBeep?
>Examples would be greatly apprecited, any language will do.

In _Programming the OS/2 Presentation Mananger_ Petzold writes code for an
IOPL segment to perform exactly the "leave on, leave off" type of speaker
access that you want.  I believe the speaker turns on after receipt of
a WM_MOUSE1DOWN (or something) and turns off with a WM_MOUSE1UP (or
something).  Source code in C is provided.

-- 
oo            - I live for the day earth becomes a domain name -            oo
\/ Jeremy Wohl / wohl@max.physics.sunysb.edu / cfreas@csserv1.ic.sunysb.edu \/
Re: if (DosBeep == _WORTHLESS) {plead('Help!);}
#1609
Author: Jack Hudler
Date: Fri, 02 Nov 1990 04:03
16 lines
1204 bytes
In article <10312@milton.u.washington.edu> zyx@milton.u.washington.edu (Bt Garner) writes:
>
>Our App uses a fair amount of "sound" (in a fashion of turn on
>the sound, go do something else, change the sound, then go do something
>else, then turn off the sound) which just doesn't cut it using the DosBeep
>function.
>
>The Plea:  Is there a way to access the speaker without the use of DosBeep?
>Examples would be greatly apprecited, any language will do.
>
Probably not, but don;t take my word for it. However, why don't you just start
a thread that handles the beeping.

-- 
Jack           Computer Support Corporation             Dallas,Texas
Hudler         Internet: jack@cscdec.cs.com
Re: if (DosBeep == _WORTHLESS) {plead('Help!);}
#1616
Author: Kai-Uwe Rommel
Date: Mon, 05 Nov 1990 09:12
15 lines
1193 bytes
In article <10312@milton.u.washington.edu> zyx@milton.u.washington.edu (Bt Garner) writes:
>The Plea:  Is there a way to access the speaker without the use of DosBeep?
>Examples would be greatly apprecited, any language will do.

Some time ago I read Charles Petzold's "Programming PM" and I think it
contained a sample program called "organ" to produce some sound.
It uses a IOPL segment to access the speaker directly.

Kai Uwe Rommel

--
/* Kai Uwe Rommel
 * Munich
 * rommel@lan.informatik.tu-muenchen.dbp.de
 */
PAX for OS/2 with HPFS
#1617
Author: Kai-Uwe Rommel
Date: Mon, 05 Nov 1990 09:17
42 lines
1835 bytes
To make the recently posted (comp.binaries.os2) PAX 2.0 HPFS-compatible,

- change NAME_MAX and PATH_MAX to 255 in limits.h
- change MAXNAMLEN and MAXPATHLEN to 256 in dir.h
- perhaps remove the strlwr() call in dir_os2.c (this preserves case on
  HPFS file names but leaves FAT file names in upper case)
- add NEWFILES to the first line in pax.def

and recompile.

There is another bug showing up with C 6.0:

in list.c, function tar_entry(), change the declaration of mode to
unsigned instead of int:

*** orig/list.c Tue Jan 16 19:23:24 1990
--- list.c	Sun Oct 28 17:25:10 1990
***************
*** 398,404 ****
      struct tm          *atm;
      int			i;
      Link               *link;
!     int                 mode;
  #ifdef S_IFLNK
      char                symnam[PATH_MAX];
  #endif
--- 398,404 ----
      struct tm          *atm;
      int			i;
      Link               *link;
!     unsigned            mode;
  #ifdef S_IFLNK
      char                symnam[PATH_MAX];
  #endif


Kai Uwe Rommel
--
/* Kai Uwe Rommel
 * Munich
 * rommel@lan.informatik.tu-muenchen.dbp.de
 */
Re: if (DosBeep == _WORTHLESS) {plead('Help!);}
#1621
Author: Mikael Wahlgren
Date: Tue, 06 Nov 1990 16:33
36 lines
1918 bytes
In article <81@cscdec.cs.com> jack@cscdec.cs.com (Jack Hudler) writes:
>In article <10312@milton.u.washington.edu> zyx@milton.u.washington.edu (Bt Garner) writes:

>>The Plea:  Is there a way to access the speaker without the use of DosBeep?
>>Examples would be greatly apprecited, any language will do.
>>
>Probably not, but don;t take my word for it. However, why don't you just start
>a thread that handles the beeping.

It is possible to do this if you have IOPL.  An example in Modula-2:

(*# call (iopl => on) *)
IMPLEMENTATION MODULE IOPsound;
IMPORT SYSTEM;
PROCEDURE BeepProc;
TYPE bs = SET OF [0..7};
CONST freq=3000; PPIport=60H; Timer=42H;
VAR m:bs; delay,j,interval:CARDINAL;
BEGIN
  interval := CARDINAL(1193181 DIV LONGVARD(freq));
  m := bs(SYSTEM.In(PPIport+1));
  IF m*bs{0,1} = bs{} THEN
    SYSTEM.Out(Timer+1,SHORTCARD(m+bs{0,1}));
    SYSTEM.Out(Timer+3,0B6H);
  END;
  SYSTEM.Out(Timer+3,SHORTCARD(interval MOD 256));
  SYSTEM.Out(Timer+2,SHORTCARD(interval DIV 256));
  FOR delay := 1 TO 10000 DO j := delay*delay END;
  m := bs(SYSTEM.In(PPIport+1));
  SYSTEM.Out(PPIport+1,SHORTCARD(m*bs{2,3,4,5,6,7}));
END BeepProc;
END IOPsound.

Example taken from the Modula-2 1.0 OS/2 supplemental documentation.

Mikael Wahlgren      d9mikael@dtek.chalmers.se
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads