sick bugfix bro

This commit is contained in:
IonutParau 2025-07-02 22:38:42 +02:00
parent 0961fc0ceb
commit 68e0374697
5 changed files with 31 additions and 4 deletions

View File

@ -221,7 +221,8 @@ function tty.keyboard()
-- changes to this design should avoid this on every key hit -- changes to this design should avoid this on every key hit
-- this is expensive (slow!) -- this is expensive (slow!)
window.keyboard = component.invoke(screen, "getKeyboards")[1] or system_keyboard debugprint("screen", type(screen), string.format("%q", screen))
window.keyboard = assert(component.invoke(screen, "getKeyboards"))[1] or system_keyboard
end end
return window.keyboard return window.keyboard

View File

@ -16,3 +16,25 @@ boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth') boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth') boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth') boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')
boot/91_gpu.lua:14: attempt to call a nil value (field 'getDepth')

View File

@ -174,7 +174,7 @@ void nni_gpu_get(nni_gpu *gpu, void *_, nn_component *component, nn_computer *co
void nni_gpu_getScreen(nni_gpu *gpu, void *_, nn_component *component, nn_computer *computer) { void nni_gpu_getScreen(nni_gpu *gpu, void *_, nn_component *component, nn_computer *computer) {
if(gpu->screenAddress == NULL) return; if(gpu->screenAddress == NULL) return;
nn_return_string(computer, gpu->screenAddress, 0); nn_return_string(computer, gpu->screenAddress, strlen(gpu->screenAddress));
} }
void nni_gpu_maxResolution(nni_gpu *gpu, void *_, nn_component *component, nn_computer *computer) { void nni_gpu_maxResolution(nni_gpu *gpu, void *_, nn_component *component, nn_computer *computer) {

View File

@ -1,4 +1,5 @@
#include "screen.h" #include "screen.h"
#include <stdio.h>
#include <string.h> #include <string.h>
nn_screen *nn_newScreen(nn_Alloc *alloc, int maxWidth, int maxHeight, int maxDepth, int editableColors, int paletteColors) { nn_screen *nn_newScreen(nn_Alloc *alloc, int maxWidth, int maxHeight, int maxDepth, int editableColors, int paletteColors) {
@ -87,7 +88,9 @@ void nn_setAspectRatio(nn_screen *screen, int width, int height) {
void nn_addKeyboard(nn_screen *screen, nn_address address) { void nn_addKeyboard(nn_screen *screen, nn_address address) {
if(screen->keyboardCount == NN_MAX_SCREEN_KEYBOARDS) return; if(screen->keyboardCount == NN_MAX_SCREEN_KEYBOARDS) return;
screen->keyboards[screen->keyboardCount++] = nn_strdup(&screen->alloc, address); char *kb = nn_strdup(&screen->alloc, address);
if(kb == NULL) return;
screen->keyboards[screen->keyboardCount++] = kb;
} }
void nn_removeKeyboard(nn_screen *screen, nn_address address) { void nn_removeKeyboard(nn_screen *screen, nn_address address) {

View File

@ -138,8 +138,9 @@ void nn_deleteComputer(nn_computer *computer) {
computer->arch->teardown(computer, computer->archState, computer->arch->userdata); computer->arch->teardown(computer, computer->archState, computer->arch->userdata);
nn_deleteGuard(a, computer->lock); nn_deleteGuard(a, computer->lock);
nn_deallocStr(a, computer->address); nn_deallocStr(a, computer->address);
nn_deallocStr(a, computer->tmpAddress);
nn_dealloc(a, computer->components, sizeof(nn_component) * computer->componentCap); nn_dealloc(a, computer->components, sizeof(nn_component) * computer->componentCap);
nn_dealloc(a, computer->components, sizeof(nn_computer)); nn_dealloc(a, computer, sizeof(nn_computer));
} }
const char *nn_pushSignal(nn_computer *computer, nn_value *values, size_t len) { const char *nn_pushSignal(nn_computer *computer, nn_value *values, size_t len) {