src/vga.c
/***
 * read data from crt control register at index
 */
read data from crt control register at index
read data from crt control register at index
uchar vga_crt_reg_get(enum vga_crt_reg_index index) {
    uchar res;
    int16_t prev = inb(VGA_CRT_REG_ADR_PORT);
    outb(VGA_CRT_REG_ADR_PORT, (int16_t)index);
    res = inb(VGA_CRT_REG_DATA_PORT);
    outb(VGA_CRT_REG_ADR_PORT, prev);
    return res;
}
uchar vga_crt_reg_get ( enum vga_crt_reg_index index ) { uchar res ; int16_t prev = inb ( VGA_CRT_REG_ADR_PORT ) ; outb ( VGA_CRT_REG_ADR_PORT , ( int16_t ) index ) ; res = inb ( VGA_CRT_REG_DATA_PORT ) ; outb ( VGA_CRT_REG_ADR_PORT , prev ) ; return res ; }
read data from crt control register at index
read data from crt control register at index