Delete Source/io.c

This commit is contained in:
Anachronaut
2024-10-26 15:33:59 -04:00
committed by GitHub
parent 83d0522722
commit 50d325ae29
-37
View File
@@ -1,37 +0,0 @@
// io.c
// I/O for the SplitBit CPU Emulator
// Written by Anachronaut
// 10/16/2024
#include "io.h"
#include <stdio.h>
uint8_t OutputHandler(uint8_t DataByte, uint8_t Address) {
// This function sends the DataByte to the appropriate place based on the Port Address.
switch(Address) {
case 0x00:
// If data is sent here, it should be written to STDOUT.
// For now, I'll implement this so it simply writes each byte out as it comes in.
// Later, I'll want to use a buffer for this for performance, probably.
putchar(DataByte);
break;
default:
// Writes to unused Output Ports are ignored.
return 1;
break;
}
return 0;
}
uint8_t InputHandler(uint8_t Address) {
switch(Address) {
case 0x00:
// If data is sent here, it should be read from STDIN.
return getchar();
break;
default:
// Reading from an unused port is ignored.
return 0;
break;
}
}