2 * Interrupt vectors emulation
4 * Copyright 1995 Alexandre Julliard
11 #include "registers.h"
12 #include "stackframe.h"
16 static SEGPTR INT_Vectors[256];
18 /* Ordinal number for interrupt 0 handler in WINPROCS.DLL */
19 #define FIRST_INTERRUPT_ORDINAL 100
22 /**********************************************************************
28 HMODULE hModule = GetModuleHandle( "WINPROCS" );
30 for (vector = 0; vector < 256; vector++)
32 if (!(INT_Vectors[vector] = MODULE_GetEntryPoint( hModule,
33 FIRST_INTERRUPT_ORDINAL+vector )))
35 fprintf(stderr,"Internal error: no vector for int %02x\n",vector);
43 /**********************************************************************
46 * Return the interrupt vector for a given interrupt.
48 SEGPTR INT_GetHandler( BYTE intnum )
50 return INT_Vectors[intnum];
54 /**********************************************************************
57 * Set the interrupt handler for a given interrupt.
59 void INT_SetHandler( BYTE intnum, SEGPTR handler )
61 dprintf_int( stddeb, "Set interrupt vector %02x <- %04x:%04x\n",
62 intnum, HIWORD(handler), LOWORD(handler) );
63 INT_Vectors[intnum] = handler;
67 /**********************************************************************
70 void INT_DummyHandler( struct sigcontext_struct sigcontext )
72 #define context (&sigcontext)
73 INT_BARF( CURRENT_STACK16->ordinal_number - FIRST_INTERRUPT_ORDINAL );
78 /**********************************************************************
81 * Handler for int 11h (get equipment list).
83 void INT_Int11Handler( struct sigcontext_struct sigcontext )
85 #define context (&sigcontext)
86 AX = DOS_GetEquipment();
91 /**********************************************************************
94 * Handler for int 12h (get memory size).
96 void INT_Int12Handler( struct sigcontext_struct sigcontext )
98 #define context (&sigcontext)
104 /**********************************************************************
107 * Handler for int 15h.
109 void INT_Int15Handler( struct sigcontext_struct sigcontext )
111 #define context (&sigcontext)
117 /**********************************************************************
120 * Handler for int 16h (keyboard).
122 void INT_Int16Handler( struct sigcontext_struct sigcontext )
124 #define context (&sigcontext)