mirror of
https://github.com/NeoFlock/neonucleus.git
synced 2025-09-24 09:03:32 +02:00
fixed some theoretical bugs
This commit is contained in:
parent
8f5cfb6be1
commit
230de47515
@ -140,12 +140,9 @@ void nni_gpu_set(nni_gpu *gpu, void *_, nn_component *component, nn_computer *co
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("It is to print: %s\n", s);
|
|
||||||
|
|
||||||
int current = 0;
|
int current = 0;
|
||||||
while(s[current] != 0) {
|
while(s[current] != 0) {
|
||||||
int codepoint = nn_unicode_codepointAt(s, current);
|
int codepoint = nn_unicode_codepointAt(s, current);
|
||||||
printf("char rendered: %i\n", codepoint);
|
|
||||||
nn_setPixel(gpu->currentScreen, x, y, nni_gpu_makePixel(gpu, s + current));
|
nn_setPixel(gpu->currentScreen, x, y, nni_gpu_makePixel(gpu, s + current));
|
||||||
if(isVertical) {
|
if(isVertical) {
|
||||||
y++;
|
y++;
|
||||||
|
@ -502,7 +502,7 @@ int main() {
|
|||||||
.read = (void *)ne_fs_read,
|
.read = (void *)ne_fs_read,
|
||||||
.seek = NULL,
|
.seek = NULL,
|
||||||
};
|
};
|
||||||
nn_addFileSystem(computer, "OpenOS", 1, &genericFS);
|
nn_addFileSystem(computer, "frostos", 1, &genericFS);
|
||||||
|
|
||||||
nn_screen *s = nn_newScreen(80, 32, 16, 16, 256);
|
nn_screen *s = nn_newScreen(80, 32, 16, 16, 256);
|
||||||
nn_addKeyboard(s, "shitty keyboard");
|
nn_addKeyboard(s, "shitty keyboard");
|
||||||
|
@ -65,7 +65,7 @@
|
|||||||
#define NN_CALL_HEAT 0.05
|
#define NN_CALL_HEAT 0.05
|
||||||
#define NN_CALL_COST 1
|
#define NN_CALL_COST 1
|
||||||
#define NN_LABEL_SIZE 128
|
#define NN_LABEL_SIZE 128
|
||||||
#define NN_INDIRECT_CALL_LATENCY 0.005
|
#define NN_INDIRECT_CALL_LATENCY 0.0005
|
||||||
|
|
||||||
typedef struct nn_guard nn_guard;
|
typedef struct nn_guard nn_guard;
|
||||||
typedef atomic_size_t nn_refc;
|
typedef atomic_size_t nn_refc;
|
||||||
|
@ -458,6 +458,18 @@ int testLuaArch_unicode_sub(lua_State *L) {
|
|||||||
if(stop < 0) stop = 0;
|
if(stop < 0) stop = 0;
|
||||||
if(start >= len) start = len - 1;
|
if(start >= len) start = len - 1;
|
||||||
if(stop >= len) stop = len - 1;
|
if(stop >= len) stop = len - 1;
|
||||||
|
if(stop < start) {
|
||||||
|
lua_pushstring(L, "");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if(start < 0) {
|
||||||
|
lua_pushstring(L, "");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if((stop - start) >= len) {
|
||||||
|
lua_pushstring(L, "");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
// there is a way to do it without an allocation
|
// there is a way to do it without an allocation
|
||||||
// however, I'm lazy
|
// however, I'm lazy
|
||||||
unsigned int *points = nn_unicode_codepoints(s);
|
unsigned int *points = nn_unicode_codepoints(s);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user