home *** CD-ROM | disk | FTP | other *** search
/ Computer Installation Guide - Dragon Clan Series / CD2.iso / ucdos70 / 5 / SRC.ZIP / API / APITEST1.C next >
Encoding:
C/C++ Source or Header  |  1996-09-25  |  1.6 KB  |  79 lines

  1. /* ╓≈╠Γú║╔Φ╓├╧╘╩╛─ú╩╜ */
  2. /*
  3.    1    SetDisplayMode  ╔Φ╓├╧╘╩╛─ú╩╜    AH=0
  4.    2    GetDisplayMode  ╢┴╧╘╩╛─ú╩╜      AX=FF00,BL=0
  5. */
  6.  
  7. #include                "dos.h"
  8. #include                "stdio.h"
  9.  
  10. typedef                 unsigned char   BYTE;
  11. typedef                 unsigned int    WORD;
  12.  
  13. void SetDisplayMode(BYTE Mode)
  14. {
  15.    union REGS regs;
  16.  
  17.    regs.h.ah = 0;
  18.    regs.h.al = Mode;
  19.    int86(0x10,®s,®s);
  20. }
  21.  
  22. int GetDisplayMode(void)
  23. {
  24.    union REGS regs;
  25.  
  26.    regs.x.ax = 0xff00;
  27.    regs.h.bl = 0;
  28.    int86(0x10,®s,®s);
  29.    return regs.h.bl;
  30. }
  31.  
  32. void GotoXY(int Row,int Col)
  33. {
  34.    union REGS regs;
  35.  
  36.    regs.h.ah = 2;
  37.    regs.h.bh = 0;
  38.    regs.h.dh = Row;
  39.    regs.h.dl = Col;
  40.    int86(0x10,®s,®s);
  41. }
  42.  
  43. void main()
  44. {
  45.    SetDisplayMode(0x8);
  46.    if (GetDisplayMode() == 0x8) {
  47.       GotoXY(20,20);
  48.       printf("%s","╓º│╓═Γ▓┐─ú╩╜8: ╖╓▒µ┬╩800x600,16╔½");
  49.       getch();
  50.       }
  51.    SetDisplayMode(0x9);
  52.    if (GetDisplayMode() == 0x9) {
  53.       GotoXY(20,20);
  54.       printf("%s","╓º│╓═Γ▓┐─ú╩╜9: ╖╓▒µ┬╩1024x768,16╔½");
  55.       getch();
  56.       }
  57.    SetDisplayMode(0xa);
  58.    if (GetDisplayMode() == 0xa) {
  59.       GotoXY(20,20);
  60.       printf("%s","╓º│╓═Γ▓┐─ú╩╜A: ╖╓▒µ┬╩640x480,256╔½");
  61.       getch();
  62.       }
  63.    SetDisplayMode(0xb);
  64.    if (GetDisplayMode() == 0xb) {
  65.       GotoXY(20,20);
  66.       printf("%s","╓º│╓═Γ▓┐─ú╩╜B: ╖╓▒µ┬╩800x600,256╔½");
  67.       getch();
  68.       }
  69.    SetDisplayMode(0xc);
  70.    if (GetDisplayMode() == 0xc) {
  71.       GotoXY(20,20);
  72.       printf("%s","╓º│╓═Γ▓┐─ú╩╜C: ╖╓▒µ┬╩1024x768,256╔½");
  73.       getch();
  74.       }
  75.  
  76.    SetDisplayMode(0x3);
  77.    exit();
  78. }
  79.