aboutsummaryrefslogtreecommitdiff
path: root/src/graphics
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-01-23 12:59:27 -0700
committerChristian Cunningham <cc@localhost>2022-01-23 12:59:27 -0700
commit5bb02975ac5f541245af9b4f6c0be4ffaa2d8463 (patch)
tree6e101458a5d763cb3fd66d7dc0baeef409a81d47 /src/graphics
parentbb09366a7cafeb8ab91b55b98f15934f0f512d47 (diff)
Draw Exception info to screen
Diffstat (limited to 'src/graphics')
-rw-r--r--src/graphics/lfb.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/graphics/lfb.c b/src/graphics/lfb.c
index c3a3cac..20053bc 100644
--- a/src/graphics/lfb.c
+++ b/src/graphics/lfb.c
@@ -107,6 +107,26 @@ void lfb_showpicture(void)
}
}
+void draw_cpixel(unsigned long lx, unsigned long ly, unsigned int c)
+{
+ unsigned char* ptr = lfb;
+ ptr += (gpitch*ly+lx*4);
+ *((unsigned int*)ptr) = gisrgb ? (unsigned int)((c&0xFF)<<16 | (c&0xFF00) | (c&0xFF0000)>>16) : c;
+}
+
+void draw_cbox(unsigned long lx, unsigned long ly, unsigned char dx, unsigned char dy, unsigned int c)
+{
+ unsigned char* ptr = lfb;
+ ptr += (gpitch*ly+lx*4);
+ for(int y = 0; y < dy; y++) {
+ for(int x = 0; x < dx; x++) {
+ *((unsigned int*)ptr) = gisrgb ? (unsigned int)((c&0xFF)<<16 | (c&0xFF00) | (c&0xFF0000)>>16) : c;
+ ptr += 4;
+ }
+ ptr += gpitch - dx*4;
+ }
+}
+
void draw_cbyte(unsigned char lx, unsigned char ly, unsigned char letter, unsigned int c)
{
unsigned int x, y;