home *** CD-ROM | disk | FTP | other *** search
- /* ╓≈╠Γú║╔Φ╓├╧╘╩╛─ú╩╜ */
- /*
- 1 SetDisplayMode ╔Φ╓├╧╘╩╛─ú╩╜ AH=0
- 2 GetDisplayMode ╢┴╧╘╩╛─ú╩╜ AX=FF00,BL=0
- */
-
- #include "dos.h"
- #include "stdio.h"
-
- typedef unsigned char BYTE;
- typedef unsigned int WORD;
-
- void SetDisplayMode(BYTE Mode)
- {
- union REGS regs;
-
- regs.h.ah = 0;
- regs.h.al = Mode;
- int86(0x10,®s,®s);
- }
-
- int GetDisplayMode(void)
- {
- union REGS regs;
-
- regs.x.ax = 0xff00;
- regs.h.bl = 0;
- int86(0x10,®s,®s);
- return regs.h.bl;
- }
-
- void GotoXY(int Row,int Col)
- {
- union REGS regs;
-
- regs.h.ah = 2;
- regs.h.bh = 0;
- regs.h.dh = Row;
- regs.h.dl = Col;
- int86(0x10,®s,®s);
- }
-
- void main()
- {
- SetDisplayMode(0x8);
- if (GetDisplayMode() == 0x8) {
- GotoXY(20,20);
- printf("%s","╓º│╓═Γ▓┐─ú╩╜8: ╖╓▒µ┬╩800x600,16╔½");
- getch();
- }
- SetDisplayMode(0x9);
- if (GetDisplayMode() == 0x9) {
- GotoXY(20,20);
- printf("%s","╓º│╓═Γ▓┐─ú╩╜9: ╖╓▒µ┬╩1024x768,16╔½");
- getch();
- }
- SetDisplayMode(0xa);
- if (GetDisplayMode() == 0xa) {
- GotoXY(20,20);
- printf("%s","╓º│╓═Γ▓┐─ú╩╜A: ╖╓▒µ┬╩640x480,256╔½");
- getch();
- }
- SetDisplayMode(0xb);
- if (GetDisplayMode() == 0xb) {
- GotoXY(20,20);
- printf("%s","╓º│╓═Γ▓┐─ú╩╜B: ╖╓▒µ┬╩800x600,256╔½");
- getch();
- }
- SetDisplayMode(0xc);
- if (GetDisplayMode() == 0xc) {
- GotoXY(20,20);
- printf("%s","╓º│╓═Γ▓┐─ú╩╜C: ╖╓▒µ┬╩1024x768,256╔½");
- getch();
- }
-
- SetDisplayMode(0x3);
- exit();
- }