.
This commit is contained in:
FantasyPvP
2023-10-04 23:20:51 +01:00
parent 4a7cf2a634
commit d5e95433da
6 changed files with 27 additions and 17 deletions
+2 -2
View File
@@ -184,7 +184,7 @@ impl Renderer {
self.internal_render();
}
pub fn with_colour(&mut self, cols: ColorCode) {
pub fn set_colour(&mut self, cols: ColorCode) {
self.temp_colour = Some(cols);
}
pub fn reset_colour(&mut self) {
@@ -334,7 +334,7 @@ pub fn write(args: fmt::Arguments, cols: (Color, Color)) {
interrupts::without_interrupts(|| {
let mut writer = RENDERER.lock();
writer.with_colour(colour_code);
writer.set_colour(colour_code);
writer.write_fmt(args).unwrap();
writer.reset_colour();
})
+2 -2
View File
@@ -143,9 +143,9 @@ impl ScanCodeStream {
pub fn try_next(&mut self) -> Option<u8> {
let queue = SCANCODE_QUEUE.try_get().expect("not initialised");
if let Ok(c) = queue.pop() {
return Some(c);
Some(c)
} else {
return None;
None
}
}
}
+1
View File
@@ -4,6 +4,7 @@ use crate::{
};
use alloc::string::String;
use alloc::vec::Vec;
pub use crate::{print, println, serial_print, serial_println};
pub use crate::kernel::render::Color;
+2 -2
View File
@@ -4,7 +4,7 @@ use cmos_rtc::{ReadRTC, Time};
use crate::println;
use super::super::kernel::interrupts::GLOBALTIMER;
use x86_64::instructions::interrupts;
pub fn wait(seconds: i64) {
pub fn wait(seconds: f64) {
let mut start = 0;
interrupts::without_interrupts(||{
start = GLOBALTIMER.lock().val;
@@ -15,7 +15,7 @@ pub fn wait(seconds: i64) {
interrupts::without_interrupts(||{
new = GLOBALTIMER.lock().val;
});
if new + seconds > start {
if new as f64 > start as f64 + seconds * 16.0 {
return
}
};