From a783528346ddb3947370b5c5e0266aa186631976 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Sun, 28 Jan 2018 11:04:56 -0500 Subject: Add color.c --- bin/Makefile | 2 ++ bin/color.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 bin/color.c diff --git a/bin/Makefile b/bin/Makefile index 7c4f2c8d..1cd8a5e6 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -13,6 +13,8 @@ atch: dtch pbcopy pbpaste: pbd ln -f pbd $@ +color: color.o fb.o + clean: rm -f $(BINS) diff --git a/bin/color.c b/bin/color.c new file mode 100644 index 00000000..3e6c3b5a --- /dev/null +++ b/bin/color.c @@ -0,0 +1,13 @@ +#include + +static uint32_t color; + +void draw(uint32_t *buf, uint32_t xres, uint32_t yres) { + for (uint32_t i = 0; i < xres * yres; ++i) { + buf[i] = color; + } +} + +void input(char c) { + color = color << 4 | (c & 0xF); +} -- cgit 1.4.1