aboutsummaryrefslogtreecommitdiffstats
path: root/com32/samples/vesa.c
blob: 6d148ae668064fc59305df0c06bd755e99540cc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <stdio.h>
#include <inttypes.h>
#include "../lib/sys/vesa/video.h"

int __vesacon_init(void);
void vesacon_write_at(int row, int col, const char *str, uint8_t attr, int rev);

int main(void)
{
  int row, col;
  int attr;
  char attr_buf[16];

  __vesacon_init();
  vesacon_load_background("stacy.png");

  row = col = 0;
  
  for (attr = 0; attr < 256; attr++) {
    snprintf(attr_buf, sizeof attr_buf, " [%02X] ", attr);
    vesacon_write_at(row, col, attr_buf, attr, attr & 3);
    row++;
    if (row >= 29) {
      row = 0;
      col += 8;
    }
  }  

  while (1)
    asm volatile("hlt");
}