Mail Archives: djgpp/1999/03/17/09:35:22
Thibaut Murez writes:
> I've made a keyb handler for my game which is really basic(left right up
> down printscreen escape and enter) and i'd like to be able to call a set
> of function every time an int is generated. I mean i don't want to check
> my keyb flags in my main loop, i'd like to be able to add and remove
> functions within a "list" as modules...
I really can't recommend you doing this: hardware interrupts are a
very problematic place to run code (must be locked, can't call libc
functions, impossible to debug, prone to subtle synchronisation bugs),
so I think you would be much better off to just set a flag and then
check it from your main program loop.
> when i try to call a C or C++ function from within my keyb handler, all
> i got is a GPF !
Did you lock all the memory that is used by your interrupt handler?
Shawn Hargreaves.
- Raw text -