2017-10-21 19:23:17 +01:00
|
|
|
type
|
|
|
|
VGA_Colour* {.pure.} = enum
|
|
|
|
black = 0,
|
|
|
|
blue = 1,
|
|
|
|
green = 2,
|
|
|
|
cyan = 3,
|
|
|
|
red = 4,
|
|
|
|
magenta = 5,
|
|
|
|
brown = 6,
|
|
|
|
lightGrey = 7,
|
|
|
|
darkGrey = 8,
|
|
|
|
lightBlue = 9,
|
|
|
|
lightGreen = 10,
|
|
|
|
lightCyan = 11,
|
|
|
|
lightRed = 12,
|
|
|
|
lightMagenta = 13,
|
|
|
|
lightBrown = 14,
|
|
|
|
white = 15
|
|
|
|
|
2017-10-22 01:54:51 +01:00
|
|
|
VGADoubleByte* = distinct uint16
|
|
|
|
|
2017-10-21 19:23:17 +01:00
|
|
|
proc vgaEntryColour*(fg: VGA_Colour, bg: VGA_Colour): int =
|
|
|
|
result = ord(fg) or (ord(bg) shl 4)
|
|
|
|
|
2017-10-22 01:54:51 +01:00
|
|
|
proc vgaEntry*(c: char, colour: int): VGADoubleByte =
|
|
|
|
result = (uint16(int(c) or (colour shl 8))).VGADoubleByte
|