aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2017-05-04 17:20:00 +0200
committerAlex Auvolat <alex@adnab.me>2017-05-04 17:20:00 +0200
commit45f9f92f51dda29d9181e27eec0261ec3127fda4 (patch)
tree2df755b19115113eb9a2e8f139b3c23d6f540f41 /src/lib
parentc7486a2113171d4d3fe7891ddf898f9f00865cc9 (diff)
downloadkogata-45f9f92f51dda29d9181e27eec0261ec3127fda4.tar.gz
kogata-45f9f92f51dda29d9181e27eec0261ec3127fda4.zip
Stuff works but we need to fix region_alloc.c
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libc/debug.c2
-rw-r--r--src/lib/libkogata/draw.c4
2 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/libc/debug.c b/src/lib/libc/debug.c
index d88b204..29820ac 100644
--- a/src/lib/libc/debug.c
+++ b/src/lib/libc/debug.c
@@ -8,12 +8,14 @@
void sys_panic(const char* msg, const char* file, int line) {
dbg_printf("PANIC in user process\n %s\n at %s:%d\n", msg, file, line);
+ *((uint32_t*)NULL) = 1; //provoke segfault
exit(-1);
while(true);
}
void sys_panic_assert(const char* assert, const char* file, int line) {
dbg_printf("ASSERT FAILED in user process\n %s\n at %s:%d\n", assert, file, line);
+ *((uint32_t*)NULL) = 1; //provoke segfault
exit(-1);
while(true);
}
diff --git a/src/lib/libkogata/draw.c b/src/lib/libkogata/draw.c
index 9ef4031..1b4f225 100644
--- a/src/lib/libkogata/draw.c
+++ b/src/lib/libkogata/draw.c
@@ -633,8 +633,6 @@ void g_region_write(fb_t *fb, fb_region_t *reg, int x, int y, const char* text,
float scale = stbtt_ScaleForPixelHeight(&font->stbtt.info, size);
float xpos = 1;
- dbg_printf("Write TTF %s %d\n", text, size);
-
uint8_t *tmp = (uint8_t*)malloc(size*size*2);
size_t tmp_size = size*size*2;
if (tmp == NULL) return;
@@ -650,8 +648,6 @@ void g_region_write(fb_t *fb, fb_region_t *reg, int x, int y, const char* text,
stbtt_GetCodepointBitmapBoxSubpixel(&font->stbtt.info, codepoint, scale, scale, x_shift, 0, &x0, &y0, &x1, &y1);
int w = x1 - x0, h = y1 - y0;
- dbg_printf("%d %d %d %d\n", x0, y0, x1, y1);
-
if (tmp_size < (size_t)w*h) {
free(tmp);
tmp_size = 2*w*h;