delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/21/05:40:16

From: Mark Phillips <umphill5 AT cs DOT umanitoba DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: newbie interrupt programmer
Date: Thu, 20 May 1999 18:35:25 -0500
Organization: The University of Manitoba
Lines: 50
Message-ID: <Pine.GSO.3.96.990520183301.17561A-100000@gold.cs.umanitoba.ca>
References: <Pine DOT GSO DOT 3 DOT 96 DOT 990520155027 DOT 16539A-100000 AT gold DOT cs DOT umanitoba DOT ca> <3744A978 DOT 6C1EED3F AT rocketmail DOT com>
NNTP-Posting-Host: gold.cs.umanitoba.ca
Mime-Version: 1.0
X-Trace: canopus.cc.umanitoba.ca 927243334 25623 130.179.24.1 (20 May 1999 23:35:34 GMT)
X-Complaints-To: Postmaster AT cc DOT umanitoba DOT ca
NNTP-Posting-Date: 20 May 1999 23:35:34 GMT
In-Reply-To: <3744A978.6C1EED3F@rocketmail.com>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> while ( !donePlaying ) {}
> 
> for this to exit the loop, donePlaying has to go TRUE.
> 

yeah, whoops, i said false didn't i?  i meant to say true.
but in my interrupt function i _did_ set the value to true,
so shouldn't that function get called when the sample is 
finished playing and then shouldn't the loop terminate?

mark

> > i've never done anything with interrupts before, let alone worrying about
> > protected mode and all that other garbage, so forgive me if i completely
> > fail to know what i'm talking about.  i'm trying to write a program that
> > will play a buffer of data to the soundblaster, and then quit when it's
> > done.  it works fine, except that it doesn't quit when it's done.  here's
> > the loop it gets stuck in:
> > 
> > while ( !donePlaying ) {}
> > 
> > donePlaying is a global bool.  my interrupt function looks like this:
> > 
> > static void interrupt_handler()
> > {
> >    inportb(interptAcknowlg8);   // sb acknowledge
> >    donePlaying = true;
> >    outportb(0x20,0x20);         // acknowledge interrupt
> >    outportb(0xA0,0x20);
> > }
> > 
> > i would have expected that when the buffer is played, donePlaying gets
> > assigned false, and the program would quit.  i set up the interrupt like
> > this:
> > 
> > newInterrupt.selector = _my_cs();
> > newInterrupt.offset32 = (int)interrupt_handler;
> > __dpmi_set_protected_mode_interrupt_vector(endOfIRQVector, &newInterrupt);
> > 
> > so if someone could solve my problem for me or wants me to give them more
> > code that would be cool.
> > 
> > and endOfIRQVector is set to 15 (which is what it should be for IRQ 7,
> > right?).  i saw one example where the guy multiplied it by 4 for some
> > reason so i tried that and it didn't work either. thanks a lot.
> > 
> > mark phillips.
> 
> 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019