diff --git a/src/osdep/dos/dos.c b/src/osdep/dos/dos.c index 24348dc9d..6f33a73e6 100644 --- a/src/osdep/dos/dos.c +++ b/src/osdep/dos/dos.c @@ -1013,15 +1013,11 @@ void os_seed_random(unsigned char **pool, int *pool_size) *pool_size = RANDOM_POOL_SIZE; } +#ifdef CONFIG_ECMASCRIPT _go32_dpmi_seginfo OldISR, NewISR; #define TIMER 8 //Simple Example of chaining interrupt handlers //Adopted from Matthew Mastracci's code - -#include -#include -#include - //macros by Shawn Hargreaves from the Allegro library for locking //functions and variables. #define LOCK_VARIABLE(x) _go32_dpmi_lock_data((void *)&x,(long)sizeof(x)); @@ -1030,15 +1026,14 @@ _go32_dpmi_seginfo OldISR, NewISR; static void TickHandler(void) { -#ifdef CONFIG_ECMASCRIPT static int internal = 0; if (internal++ >= 19) { internal = 0; check_heartbeats(NULL); } -#endif } +#endif void init_osdep(void) { @@ -1071,6 +1066,7 @@ void init_osdep(void) sa.sa_flags = SA_RESTART; EINTRLOOP(rs, sigaction(SIGINT, &sa, NULL)); +#ifdef CONFIG_ECMASCRIPT LOCK_FUNCTION(TickHandler); LOCK_FUNCTION(check_heartbeats); //load the address of the old timer ISR into the OldISR structure @@ -1083,14 +1079,16 @@ void init_osdep(void) //timer ISR //will be called, then the new timer ISR _go32_dpmi_chain_protected_mode_interrupt_vector(TIMER, &NewISR); +#endif } void terminate_osdep(void) { if (screen_backbuffer) mem_free(screen_backbuffer); - +#ifdef CONFIG_ECMASCRIPT _go32_dpmi_set_protected_mode_interrupt_vector(TIMER, &OldISR); +#endif } #define LINKS_BIN_SEARCH(entries, eq, ab, key, result) \