aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-05-30 23:32:52 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-05-30 23:32:52 +0100
commitcbeff523d3c01471fcddfbf713b5d8d9e36dc1a9 (patch)
treeea96fc1371df2abae24b09954997277f762cad57 /src/main.c
parentd6cce83a4c5a6540f0b32e3bca9fb56c1f8855d1 (diff)
downloadgold-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/main.c')
-rw-r--r--src/main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 5b315df..dd3cffa 100644
--- a/src/main.c
+++ b/src/main.c
@@ -7,11 +7,16 @@
#include "vga.h"
+/* embedded data */
+extern const uint8_t binary_palette_start[];
+
int main(int argc, char *argv[])
{
/* set VGA 320x200, 256 col */
set_mode(0x13);
+ set_palette(binary_palette_start);
+
uint8_t *screen = open_framebuffer();
if (!screen)
{
@@ -19,8 +24,11 @@ int main(int argc, char *argv[])
return 1;
}
- for (int i = 0; i < 320 * 200 * 10; i++)
- screen[rand() % (320 * 200)] = rand() % 255;
+ for (int i = 0; i < 16; i++)
+ {
+ memset(screen, i, 320 * 200);
+ getch();
+ }
printf("Hello DOS!\n");