Home | History | Annotate | Download | only in WinQuake
      1 /*
      2 Copyright (C) 1996-1997 Id Software, Inc.
      3 
      4 This program is free software; you can redistribute it and/or
      5 modify it under the terms of the GNU General Public License
      6 as published by the Free Software Foundation; either version 2
      7 of the License, or (at your option) any later version.
      8 
      9 This program is distributed in the hope that it will be useful,
     10 but WITHOUT ANY WARRANTY; without even the implied warranty of
     11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     12 
     13 See the GNU General Public License for more details.
     14 
     15 You should have received a copy of the GNU General Public License
     16 along with this program; if not, write to the Free Software
     17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
     18 
     19 */
     20 
     21 //
     22 // dosisms.h: I'd call it dos.h, but the name's taken
     23 //
     24 
     25 #ifndef _DOSISMS_H_
     26 #define _DOSISMS_H_
     27 
     28 int dos_lockmem(void *addr, int size);
     29 int dos_unlockmem(void *addr, int size);
     30 
     31 typedef union {
     32 	struct {
     33 		unsigned long edi;
     34 		unsigned long esi;
     35 		unsigned long ebp;
     36 		unsigned long res;
     37 		unsigned long ebx;
     38 		unsigned long edx;
     39 		unsigned long ecx;
     40 		unsigned long eax;
     41 	} d;
     42 	struct {
     43 		unsigned short di, di_hi;
     44 		unsigned short si, si_hi;
     45 		unsigned short bp, bp_hi;
     46 		unsigned short res, res_hi;
     47 		unsigned short bx, bx_hi;
     48 		unsigned short dx, dx_hi;
     49 		unsigned short cx, cx_hi;
     50 		unsigned short ax, ax_hi;
     51 		unsigned short flags;
     52 		unsigned short es;
     53 		unsigned short ds;
     54 		unsigned short fs;
     55 		unsigned short gs;
     56 		unsigned short ip;
     57 		unsigned short cs;
     58 		unsigned short sp;
     59 		unsigned short ss;
     60 	} x;
     61 	struct {
     62 		unsigned char edi[4];
     63 		unsigned char esi[4];
     64 		unsigned char ebp[4];
     65 		unsigned char res[4];
     66 		unsigned char bl, bh, ebx_b2, ebx_b3;
     67 		unsigned char dl, dh, edx_b2, edx_b3;
     68 		unsigned char cl, ch, ecx_b2, ecx_b3;
     69 		unsigned char al, ah, eax_b2, eax_b3;
     70 	} h;
     71 } regs_t;
     72 
     73 unsigned int ptr2real(void *ptr);
     74 void *real2ptr(unsigned int real);
     75 void *far2ptr(unsigned int farptr);
     76 unsigned int ptr2far(void *ptr);
     77 
     78 int	dos_inportb(int port);
     79 int	dos_inportw(int port);
     80 void dos_outportb(int port, int val);
     81 void dos_outportw(int port, int val);
     82 
     83 void dos_irqenable(void);
     84 void dos_irqdisable(void);
     85 void dos_registerintr(int intr, void (*handler)(void));
     86 void dos_restoreintr(int intr);
     87 
     88 int	dos_int86(int vec);
     89 
     90 void *dos_getmemory(int size);
     91 void dos_freememory(void *ptr);
     92 
     93 void	dos_usleep(int usecs);
     94 
     95 int dos_getheapsize(void);
     96 
     97 extern regs_t regs;
     98 
     99 #endif	// _DOSISMS_H_
    100 
    101