Added base VGA Colour and Size.
This commit is contained in:
parent
15e3a20754
commit
e20c143ebd
28
kernel.nim
28
kernel.nim
@ -0,0 +1,28 @@
|
||||
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
|
||||
|
||||
proc vga_entry_colour(fg: VGA_Colour, bg: VGA_Colour): uint8 =
|
||||
result = uint8(ord(fg) or (ord(bg) shl 4))
|
||||
|
||||
proc vga_entry(c: char, colour: uint8): uint16 =
|
||||
result = uint8(c) or (colour shl 8)
|
||||
|
||||
const
|
||||
vgaWidth = 80
|
||||
vgaHeight = 25
|
Loading…
Reference in New Issue
Block a user