Im having trouble w/ interupts. X-)
I got the code off the web and am modifying it.
here is the code im having trouble w/
struct Ssoundcard card
{
int intcount,autoinit,...
void (interrupt far *oldintvector)(void);
void (interrupt far *inthandler)();//
//**********inthandler wasn't declaired in original code
}
static void interrupt inthandler(Ssoundcard card)
{
card.intcount++;
if (!card.autoinit)/* Start next block first if not using auto-init DMA */
{
startblocksc(card);
copydata(card);
setcurblock(card,!card.curblock); /* Toggle block */
}
updatevoices(card);
mixvoices(card);
if (card.autoinit)
{
copydata(card);
setcurblock(card,!card.curblock);/* Toggle block */
}
inp(card.ackport);//Acknowled interrupt with sound card
outp(0xA0, 0x20);//Acknowledg interrupt with PIC2
outp(0x20, 0x20);//Acknowledg interrupt with PIC1
}
static void installhandler(Ssoundcard card)
{
disable();
outp(card.picmaskport, (inp(card.picmaskport) | card.irqstopmask));
1*:->* card.oldintvector = _dos_getvect(card.irqintvector);
2*:->* _dos_setvect(card.irqintvector, inthandler);
outp(card.picmaskport, (inp(card.picmaskport) & card.irqstartmask));
enable();
card.handlerinstalled = TRUE;
}
static void uninstallhandler(Ssoundcard card)
{
disable();
outp(card.picmaskport, (inp(card.picmaskport) | card.irqstopmask));
3*:->* _dos_setvect(card.irqintvector, card.oldintvector);
enable();
card.handlerinstalled = FALSE;
}
im using borlandc v3.1 and the error messages im recieving
are
1*:->* cannot convert 'void (interrupt far*)(...)' to 'void (interrupt far*)()'
1*:->* cannot convert 'void (interrupt far*)(Ssoundcard)' to 'void (interrupt far*)(...)'
2*:->* type mismatch in parameter '__isr' in call to '_dos_setvect(unsigned int, void (interrupt far*)(...)'
3*:->* cannot convert 'void (interrupt far*)() to void (interrupt far*)(...)'
3*:->* type mismatch in parameter '__isr' in call to '_dos_setvect(unsigned int, void (interrupt far*)(...)'
the original code was writen in C and im compiling in C++.
i understand what the error messages mean yet i don't understand interupt coding very much
any help would be very apprecitated.
I got the code off the web and am modifying it.
here is the code im having trouble w/
struct Ssoundcard card
{
int intcount,autoinit,...
void (interrupt far *oldintvector)(void);
void (interrupt far *inthandler)();//
//**********inthandler wasn't declaired in original code
}
static void interrupt inthandler(Ssoundcard card)
{
card.intcount++;
if (!card.autoinit)/* Start next block first if not using auto-init DMA */
{
startblocksc(card);
copydata(card);
setcurblock(card,!card.curblock); /* Toggle block */
}
updatevoices(card);
mixvoices(card);
if (card.autoinit)
{
copydata(card);
setcurblock(card,!card.curblock);/* Toggle block */
}
inp(card.ackport);//Acknowled interrupt with sound card
outp(0xA0, 0x20);//Acknowledg interrupt with PIC2
outp(0x20, 0x20);//Acknowledg interrupt with PIC1
}
static void installhandler(Ssoundcard card)
{
disable();
outp(card.picmaskport, (inp(card.picmaskport) | card.irqstopmask));
1*:->* card.oldintvector = _dos_getvect(card.irqintvector);
2*:->* _dos_setvect(card.irqintvector, inthandler);
outp(card.picmaskport, (inp(card.picmaskport) & card.irqstartmask));
enable();
card.handlerinstalled = TRUE;
}
static void uninstallhandler(Ssoundcard card)
{
disable();
outp(card.picmaskport, (inp(card.picmaskport) | card.irqstopmask));
3*:->* _dos_setvect(card.irqintvector, card.oldintvector);
enable();
card.handlerinstalled = FALSE;
}
im using borlandc v3.1 and the error messages im recieving
are
1*:->* cannot convert 'void (interrupt far*)(...)' to 'void (interrupt far*)()'
1*:->* cannot convert 'void (interrupt far*)(Ssoundcard)' to 'void (interrupt far*)(...)'
2*:->* type mismatch in parameter '__isr' in call to '_dos_setvect(unsigned int, void (interrupt far*)(...)'
3*:->* cannot convert 'void (interrupt far*)() to void (interrupt far*)(...)'
3*:->* type mismatch in parameter '__isr' in call to '_dos_setvect(unsigned int, void (interrupt far*)(...)'
the original code was writen in C and im compiling in C++.
i understand what the error messages mean yet i don't understand interupt coding very much
any help would be very apprecitated.