diff --git a/f256lib/f256.c b/f256lib/f256.c index c848f3e..fa5ad5b 100644 --- a/f256lib/f256.c +++ b/f256lib/f256.c @@ -33,6 +33,7 @@ #include "graphics.c" #include "sprite.c" #include "file.c" +#include "platform.c" void f256Init(void) { diff --git a/f256lib/f256.h b/f256lib/f256.h index a1b1759..9b68555 100644 --- a/f256lib/f256.h +++ b/f256lib/f256.h @@ -166,6 +166,7 @@ void FAR_POKE(uint32_t address, byte value); #include "graphics.h" #include "sprite.h" #include "file.h" +#include "platform.h" #ifdef __cplusplus diff --git a/f256lib/file.c b/f256lib/file.c index 0a58c77..dc73da0 100644 --- a/f256lib/file.c +++ b/f256lib/file.c @@ -33,7 +33,6 @@ static char _dirStream[MAX_DRIVES]; static bool findName(char *name, int16_t *offset); -static char getIn(void); // This isn't the best place for this. static int16_t kernelRead(uint8_t fd, void *buf, uint16_t nbytes); static int16_t kernelWrite(uint8_t fd, void *buf, uint16_t nbytes); static char *pathWithoutDrive(char *path, char *drive); @@ -364,29 +363,13 @@ static bool findName(char *name, int16_t *offset) { } -static char getIn(void) { - while (1) { - kernelNextEvent(); - if (kernelError) { - kernelCall(Yield); - continue; - } - - if (kernelEventData.type != kernelEvent(key.PRESSED)) continue; - if (kernelEventData.key.flags) continue; // Meta key. - - return kernelEventData.key.ascii; - } -} - - #pragma push_macro("EOF") #undef EOF static int16_t kernelRead(uint8_t fd, void *buf, uint16_t nbytes) { // STDIN if (fd == 0) { - *(char *)buf = getIn(); + *(char *)buf = getchar(); return 1; } diff --git a/f256lib/text.c b/f256lib/text.c index eaf524c..4f788c4 100644 --- a/f256lib/text.c +++ b/f256lib/text.c @@ -54,14 +54,6 @@ static byte _bcolor = 0; static byte _ccolor = 240; -// printf() support. -void __putchar(char c) { - static char s[2] = { 0, 0 }; - s[0] = c; - textPrint(s); -} - - // Clear screen to current text attributes. void textClear(void) { byte mmu = PEEK(MMU_IO_CTRL); // Get current MMU state.