Mail Archives: djgpp/1999/05/21/05:40:16
> 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 -