Adds a way to simulate the programs with spike, to compare PCs and debug
This commit is contained in:
@@ -46,7 +46,7 @@ impl VGA
|
||||
{
|
||||
let c = if (c as u8 > b'~') || ((c as u8) < b' ')
|
||||
{
|
||||
b'?' - b' '
|
||||
b'/' - b' '
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -79,21 +79,9 @@ impl VGA
|
||||
/// The text must have a length that can fit within a `u16`
|
||||
pub unsafe fn draw_string(x: u16, y: u16, str: &str, color: Color)
|
||||
{
|
||||
//str.chars().enumerate().for_each(|(i, c)| unsafe {
|
||||
//Self::draw_char(x + i as u16 * (FONT_WIDTH as u16), y, c, color)
|
||||
//Self::draw_char(x + (i as u16) << 1, y, c, color)
|
||||
//Self::draw_char(x, y, c, color)
|
||||
//});
|
||||
|
||||
for i in 0..2
|
||||
{
|
||||
Self::draw_char(
|
||||
x + (2 - i) as u16 * (FONT_WIDTH as u16),
|
||||
y,
|
||||
str.as_bytes()[i] as char,
|
||||
color,
|
||||
);
|
||||
}
|
||||
str.bytes().enumerate().for_each(|(i, c)| unsafe {
|
||||
Self::draw_char(x + i as u16 * (FONT_WIDTH as u16), y, c as char, color)
|
||||
});
|
||||
}
|
||||
|
||||
unsafe fn font_plate_index(x: u16, y: u16) -> bool
|
||||
|
||||
Reference in New Issue
Block a user