home *** CD-ROM | disk | FTP | other *** search
- //=====================================================================
- //
- // pgetrows.cpp
- //
- // get the number of rows on the screen.
- //
- // needed for turbovision to work in protected mode.
- //
- // Copyright (c) 1994, Kevin Morgan, All rights reserved.
- //
- //=====================================================================
- #include <stdio.h>
- #include <dos.h>
- #include "dpmish.h"
-
-
- extern "C" unsigned protGetRows(void);
-
- #pragma warn -asc
-
- unsigned protGetRows(void)
- {
- DPMI_Regs iregs;
- iregs.eax = 0x1130;
- iregs.ebx = 0;
- iregs.edx = 0;
- iregs.reserved = 0;
- iregs.flags = _FLAGS;
-
- iregs.ss = 0;
- iregs.sp = 0;
- Dpmi.simulateRealInterrupt(0x10, &iregs);
- int rows=(iregs.edx&0xff);
- if (rows==0) rows = 24;
- return rows+1;
- }
-
- #pragma warn .asc
-
-
-