__putchar() and getchar() moved to their own file.

This commit is contained in:
Scott Duensing 2024-01-24 16:56:40 -06:00
parent 4e79b9567d
commit fb8a2415c2
4 changed files with 3 additions and 26 deletions

View file

@ -33,6 +33,7 @@
#include "graphics.c"
#include "sprite.c"
#include "file.c"
#include "platform.c"
void f256Init(void) {

View file

@ -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

View file

@ -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;
}

View file

@ -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.