Moved vga-palette-updating code to func vga_setPalette()
This commit is contained in:
10
src/vga.c
10
src/vga.c
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* Copyright (c) 2016 rxi
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
@@ -34,6 +34,14 @@ void vga_deinit(void) {
|
||||
}
|
||||
|
||||
|
||||
void vga_setPalette(int idx, int r, int g, int b) {
|
||||
outp(0x03c8, idx);
|
||||
outp(0x03c9, (r >> 2) & 0x3f);
|
||||
outp(0x03c9, (g >> 2) & 0x3f);
|
||||
outp(0x03c9, (b >> 2) & 0x3f);
|
||||
}
|
||||
|
||||
|
||||
void vga_update(pixel_t *buffer) {
|
||||
dosmemput(buffer, VGA_WIDTH * VGA_HEIGHT, 0xa0000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user