Cleaned up commented out sections

This commit is contained in:
JJ Bliss
2026-04-27 18:24:29 -04:00
parent 3e0c4b394c
commit a6d9603b51
+15 -54
View File
@@ -60,8 +60,6 @@ export fn main() void = {
}; };
let path = os::args[1]; let path = os::args[1];
// let console: bufio::scanner = bufio::newscanner(os::stdin);
// defer bufio::finish(&console);
//Setting up pollfds for uni::poll //Setting up pollfds for uni::poll
const consolefd: []unix::poll::pollfd = [unix::poll::pollfd { const consolefd: []unix::poll::pollfd = [unix::poll::pollfd {
fd = os::stdin_file, fd = os::stdin_file,
@@ -110,60 +108,23 @@ export fn main() void = {
}; };
i+=1; //TODO using i here seems inelegant i+=1; //TODO using i here seems inelegant
}; };
// for( state.dev[0x0f] == 0; i+=1 ){ const pollr = unix::poll::poll(consolefd, unix::poll::NONBLOCK);
const pollr = unix::poll::poll(consolefd, unix::poll::NONBLOCK); if(pollr > 0){
if(pollr > 0){ // fmt::println("Input!")!;
// fmt::println("Input!")!; let buf: [MAX_CONSOLE_INPUT]u8 = [0...];
let buf: [MAX_CONSOLE_INPUT]u8 = [0...]; io::read(os::stdin_file, buf)!;
io::read(os::stdin_file, buf)!; for( let b .. buf ){
for( let b .. buf ){ // fmt::printfln("Input: {}",buf[0])!;
// fmt::printfln("Input: {}",buf[0])!; match (uxn::console_input(b,1,state)) {
match (uxn::console_input(b,1,state)) { case done =>
case done => yield done;
yield done; case let val: u8 =>
case let val: u8 => fmt::fatalf("Unhandled Opcode: {:x}", val);
fmt::fatalf("Unhandled Opcode: {:x}", val); };
}; // uxn::console_input(b,1,state);
// uxn::console_input(b,1,state);
};
// match(bufio::read_byte(os::stdin)){
// case let b: u8 =>
// match (uxn::console_input(b,1,state)) {
// case done =>
// yield done;
// case let val: u8 =>
// fmt::fatalf("Unhandled Opcode: {:x}", val);
// };
// case io::EOF =>
// yield;
// case let err: io::error =>
// fmt::fatalf("IO Error: {}", io::strerror(err));
// };
}; };
};
// let buf: [1]u8 = [0];
// fmt::println("About to read input")!;
// let count = io::read(os::stdin, buf)!;
// fmt::println("Read input")!;
// if(count != 0) {
// match (uxn::console_input(buf[0],1,state)) {
// case done =>
// yield done;
// case let val: u8 =>
// fmt::fatalf("Unhandled Opcode: {:x}", val);
// };
// // fmt::println("Retuned from console_input")!;
// };
// };
// fmt::println("Extra input thing?!")!;
// match (uxn::console_input('\n',4,state)) { //TODO should this run?
// case done =>
// yield done;
// case let val: u8 =>
// fmt::fatalf("Unhandled Opcode: {:x}", val);
// };
// fmt::println("Finished Console!")!;
}; };
}; };