diff --git a/src/runtime.rs b/src/runtime.rs index 9c94c78..dac69f4 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -1,5 +1,10 @@ use core::panic; -use std::{cmp::Ordering, i16, io::Write, u16, u32, u8, usize}; +use std::{ + cmp::Ordering, + i16, + io::{stdout, Write}, + u16, u32, u8, usize, +}; use crate::Air; use colored::Colorize; @@ -273,6 +278,7 @@ impl RunState { 0x21 => { let chr = (*self.reg(0) & 0xFF) as u8 as char; print!("{chr}"); + stdout().flush().unwrap(); } // puts 0x22 => { @@ -289,6 +295,7 @@ impl RunState { addr += 1; } print!("{string}"); + stdout().flush().unwrap(); } // in 0x23 => {