diff --git a/vm/nga-c/retro.c b/vm/nga-c/retro.c index ed85655..11a12d1 100644 --- a/vm/nga-c/retro.c +++ b/vm/nga-c/retro.c @@ -29,6 +29,8 @@ #include "config.h" #include "devices.h" +#include "utf32.c" + #define ACTIVE vm->cpu[vm->active] #define TIB vm->memory[7] #define TIB_END vm->memory[8] diff --git a/vm/nga-c/utf32.c b/vm/nga-c/utf32.c new file mode 100644 index 0000000..0571401 --- /dev/null +++ b/vm/nga-c/utf32.c @@ -0,0 +1,5 @@ +int utf32_length(int *s, int max) { + int l = 0; + while (*s++ != 0 && l < max) l++; + return l; +}