comp_chk.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* $Id$
  2. * MegaZeux
  3. *
  4. * Copyright (C) 1996 Greg Janson
  5. * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. //COMP_CHK.CPP- The function computer_check, which verifies that the
  22. // computer and graphics card are high enough. Returns
  23. // non-0 if not. Make sure to compile anything that could
  24. // run before this function as 8086 code.
  25. //8086 compatible-
  26. #pragma option -1-
  27. #pragma option -2-
  28. #include "detect.h"
  29. #include "dt_data.h"
  30. #include "comp_chk.h"
  31. //Global variable for VGA availability
  32. char vga_avail=0;
  33. //Card/processor
  34. char card;
  35. //Some strings for output
  36. char far *sorry2="\r\n\r\nSorry, MegaZeux requires an EGA graphics card or better.\r\n$";
  37. //Check graphics card and processor.
  38. char computer_check(void) {
  39. card=detect_graphics();
  40. //Uses DOS services to print stuff
  41. if(card<EGA) {
  42. asm push ds
  43. asm mov dx,SEG sorry2
  44. asm mov ds,dx
  45. asm lds dx,ds:sorry2
  46. asm mov ah,9
  47. asm int 21h
  48. asm pop ds
  49. return -1;
  50. }
  51. if(card>=VGAm) vga_avail=1;//VGA/MCGA/SVGA card
  52. return 0;
  53. }