Fast and reasonably complete (framebuffer) terminal emulator (Zig fork)

Drop in_bootloader

mintsuki 91fc01cb b4d3bd1c

Changed files
+3 -9
+3 -8
flanterm.c
···
case ')':
ctx->g_select = c - '\'';
break;
-
case 0x1b:
-
if (ctx->in_bootloader == true) {
-
ctx->raw_putchar(ctx, c);
-
}
-
break;
}
ctx->escape = false;
···
}
static void flanterm_putchar(struct flanterm_context *ctx, uint8_t c) {
-
if (ctx->discard_next || (ctx->in_bootloader == false && (c == 0x18 || c == 0x1a))) {
ctx->discard_next = false;
ctx->escape = false;
ctx->csi = false;
···
}
unicode_error:
-
if (c >= 0xc0 && c <= 0xf7 && ctx->in_bootloader == false) {
if (c >= 0xc0 && c <= 0xdf) {
ctx->unicode_remaining = 1;
ctx->code_point = (c & 0x1f) << 6;
···
break;
}
-
if (ctx->in_bootloader || (c >= 0x20 && c <= 0x7e)) {
ctx->raw_putchar(ctx, c);
}
}
···
case ')':
ctx->g_select = c - '\'';
break;
}
ctx->escape = false;
···
}
static void flanterm_putchar(struct flanterm_context *ctx, uint8_t c) {
+
if (ctx->discard_next || (c == 0x18 || c == 0x1a)) {
ctx->discard_next = false;
ctx->escape = false;
ctx->csi = false;
···
}
unicode_error:
+
if (c >= 0xc0 && c <= 0xf7) {
if (c >= 0xc0 && c <= 0xdf) {
ctx->unicode_remaining = 1;
ctx->code_point = (c & 0x1f) << 6;
···
break;
}
+
if (c >= 0x20 && c <= 0x7e) {
ctx->raw_putchar(ctx, c);
}
}
-1
flanterm.h
···
/* to be set by backend */
size_t rows, cols;
-
bool in_bootloader;
void (*raw_putchar)(struct flanterm_context *, uint8_t c);
void (*clear)(struct flanterm_context *, bool move);
···
/* to be set by backend */
size_t rows, cols;
void (*raw_putchar)(struct flanterm_context *, uint8_t c);
void (*clear)(struct flanterm_context *, bool move);