Advertisement
Ham62

AdapterConfig.c

Aug 10th, 2017
479
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.03 KB | None | 0 0
  1.     // Set adapter mode (AL=03h is 80x25 16 colors, AL=0x07 is 80x25 mono)
  2.     switch (Adapter) {
  3.         case 0 :    // MDA/Hercules
  4.             ScreenSeg = 0xB000;
  5.             regs.h.ah = 0x00;
  6.             regs.h.al = 0x07;
  7.             intr (0x10, &regs);
  8.             outp(0x03B8, 9);    // Disable blink
  9.             break;
  10.            
  11.         case 1 :    // CGA
  12.             ScreenSeg = 0xB800;
  13.             regs.h.ah = 0x00;
  14.             regs.h.al = 0x03;
  15.             intr (0x10, &regs);
  16.             outp(0x03D8, 9);    // Disable blink
  17.             break;
  18.            
  19.         case 2 :    // EGA/VGA+
  20.             ScreenSeg = 0xB800;
  21.             regs.w.ax = 0x0003;
  22.             intr (0x10, &regs);
  23.             regs.h.ah = 0x10;  // disable blink
  24.             regs.w.bx = 0x0000;
  25.             intr (0x10, &regs);
  26.             break;
  27.     }        
  28.  
  29.     //Hide cursor
  30.     regs.h.ah = 0x01;
  31.     regs.h.al = 0x03; // BIOS bug causes some 386s to hang if AL isn't current video mode
  32.     regs.h.ch = 0x20;
  33.     intr (0x10, &regs);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement