Mail Archives: djgpp/1996/04/10/00:48:04
Xref: | news2.mv.net comp.os.msdos.djgpp:2567
|
From: | Arash <ei39594 AT ios DOT chalmers DOT se>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | slow interrupts - AGAIN!
|
Date: | 9 Apr 1996 09:22:56 GMT
|
Organization: | Chalmers University of Technology
|
Lines: | 51
|
Message-ID: | <4kda9g$iis@nyheter.chalmers.se>
|
NNTP-Posting-Host: | sv31976.ios.chalmers.se
|
Mime-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Hi' guys
After reading info files in hours, I finally manged to write my own
keyboard-handler at INT 0x9. Since I used a pmode interrupt, my program
does something wired (like pgaing or changing to realmode??) thats causes
my screen refresh rate go down to a value of about 70 screens/sec
compared to original 150 screens/sec (yes, this is what i call FAST
graphics!) when I put my finger on a key :(
I tried to write a realmode handler , I fallowed the libc-info examples
AND the read the FAQ AND looked at some example files, but my program
just crashes, maybe becuase I'm useing a global buffer that will be
accessed both from the pmode program and rmode handler, the code looks
like this ( and worked just fine in pmode):
***********
unsigned char Keyboard[128];
unsigned long save_eax;
..
void my_int9(void){
asm("movl %eax,_save_eax");
int Key = inportb(0x60);
if(Key & 128) Keyboard[Key & 127] = 0; // a break code
else Keyboard[Key] = 1; // a make code
asm("movl _save_eax,%eax");
}
..
// somewhere in main()
if(Keyboard[1]) esc_down(); // read from the keyboard buffer
..
************
(I didn't include interrupt installer since it's exactly the same as the
on in the info-files.)
Hope someone can help
TIA,
Arash
__________________
* Wanna make your old 386 as fast as a Pentium??? Try running Win95 (on
the Pentium)
- Raw text -