FidoNet Echomail Archive
c_echo

<<< Previous Index Next >>>

From: Kurt Kuzba
To: All
Date: 2004-11-04 09:37:40
Subject: [C] Primitives for Mode 12h [ 2 of 5 ]

From: "Kurt Kuzba" <kkuzba{at}centurytel.net>


/*_|_|  MODE12VH.C  PUBLIC DOMAIN by Kurt Kuzba (11/04/2004)
_|_|_|  Part 2 of 5  */
/*_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|*/
void clearscr(int color)
{
 unsigned char far *V = (unsigned char far*)0xa0000000l;
 long wipe, value;
 _asm {
  mov dx, 3ceh
  mov al, 04h
  out dx, al
  mov dx, 3c4h
  mov al, 02h
  out dx, al
  mov dx, 3cfh
  mov al, 00h
  out dx, al
  mov dx, 3c5h
  mov al, 01h
  out dx, al
 }
 value = !!(color & 1) * 255;
 for(wipe = 0; wipe < 38400; wipe++)
  *(V + wipe) = (unsigned char)value;
 _asm {
  mov dx, 3cfh
  mov al, 01h
  out dx, al
  mov dx, 3c5h
  mov al, 02h
  out dx, al
 }
 value = !!(color & 2) * 255;
 for(wipe = 0; wipe < 38400; wipe++)
  *(V + wipe) = (unsigned char)value;
 _asm {
  mov dx, 3cfh
  mov al, 02h
  out dx, al
  mov dx, 3c5h
  mov al, 04h
  out dx, al
 }
 value = !!(color & 4) * 255;
 for(wipe = 0; wipe < 38400; wipe++)
  *(V + wipe) = (unsigned char)value;
 _asm {
  mov dx, 3cfh
  mov al, 03h
  out dx, al
  mov dx, 3c5h
  mov al, 08h
  out dx, al
 }
 value = !!(color & 8) * 255;
 for(wipe = 0; wipe < 38400; wipe++)
  *(V + wipe) = (unsigned char)value;
}
/*_|_|  end Part 2 of 5  */

--- BBBS/LiI v4.01 Flag-5
 * Origin: Prism's_Point (1:261/38.1)
SEEN-BY: 633/267 270
@PATH: 261/38 123/500 106/2000 633/267


<<< Previous Index Next >>>