diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-05-30 23:32:52 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-05-30 23:32:52 +0100 |
commit | cbeff523d3c01471fcddfbf713b5d8d9e36dc1a9 (patch) | |
tree | ea96fc1371df2abae24b09954997277f762cad57 /src/vga.c | |
parent | d6cce83a4c5a6540f0b32e3bca9fb56c1f8855d1 (diff) | |
download | gold-mine-run-cbeff523d3c01471fcddfbf713b5d8d9e36dc1a9.tar.gz gold-mine-run-cbeff523d3c01471fcddfbf713b5d8d9e36dc1a9.zip |
pngpal tool and first stab at embedding data on the EXE
WIP; the embedded data has an "environ" symbol that will cause issues
when we embed more than one piece of data.
Diffstat (limited to 'src/vga.c')
-rw-r--r-- | src/vga.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -2,6 +2,7 @@ #include <stdint.h> #include <dpmi.h> #include <sys/nearptr.h> +#include <pc.h> uint8_t *open_framebuffer() { @@ -22,3 +23,10 @@ void set_mode(uint8_t mode) regs.x.ax = mode; __dpmi_int(0x10, ®s); } + +void set_palette(const uint8_t *palette) +{ + outportb(0x3c8, 0); + for (int i = 0; i < 768; i++) + outportb(0x3c9, (palette[i] * 63) / 255); +} |