]> icculus.org git repositories - btb/d2x.git/blob - arch/dos/comm/include/allegro.h
This commit was generated by cvs2svn to compensate for changes in r2,
[btb/d2x.git] / arch / dos / comm / include / allegro.h
1 #ifndef _ALLEGRO_H
2 #define _ALLEGRO_H
3
4 // nothing
5 #include <pc.h>
6 #include <go32.h>
7 #define allegro_init()
8 #define install_keyboard()
9 #define keypressed() kbhit()
10 #define readkey() getkey()
11
12 #ifdef DJGPP
13
14 /* for djgpp */
15 #define END_OF_FUNCTION(x)    void x##_end() { }
16 #define LOCK_VARIABLE(x)      _go32_dpmi_lock_data((void *)&x, sizeof(x))
17 #define LOCK_FUNCTION(x)      _go32_dpmi_lock_code(x, (long)x##_end - (long)x)
18
19 #else 
20
21 /* for linux */
22 #define END_OF_FUNCTION(x)
23 #define LOCK_VARIABLE(x)
24 #define LOCK_FUNCTION(x)
25
26 #endif
27
28 #define DISABLE() __asm__ __volatile__("cli");
29 #define ENABLE() __asm__ __volatile__("sti");
30
31
32 int _install_irq(int num, int (*handler)());
33 void _remove_irq(int num);
34 #define FALSE 0
35 #define TRUE (!FALSE)
36
37 #include <dpmi.h>
38 typedef struct _IRQ_HANDLER
39 {
40    int (*handler)();             /* our C handler */
41    int number;                   /* irq number */
42    __dpmi_paddr old_vector;      /* original protected mode vector */
43 } _IRQ_HANDLER;
44
45 #endif