2022-03-11 19:51:47 +00:00
|
|
|
use vga::{
|
|
|
|
colors::Color16,
|
|
|
|
writers::{Graphics640x480x16, GraphicsWriter},
|
2022-01-13 14:54:33 +00:00
|
|
|
};
|
2022-01-07 16:31:47 +00:00
|
|
|
|
2022-04-11 22:23:11 +00:00
|
|
|
pub static VGAE_BUFF_OFFSET_X: spin::Mutex<u8> = spin::Mutex::new(0);
|
|
|
|
pub static VGAE_BUFF_OFFSET_Y: spin::Mutex<u8> = spin::Mutex::new(0);
|
2022-04-11 20:51:54 +00:00
|
|
|
pub static VGAE: spin::Mutex<Graphics640x480x16> = {
|
|
|
|
let xyz = Graphics640x480x16::new();
|
2022-06-02 11:00:26 +00:00
|
|
|
// xyz.set_mode();
|
2022-04-11 20:51:54 +00:00
|
|
|
spin::Mutex::new(xyz)
|
|
|
|
};
|
2022-01-18 12:15:51 +00:00
|
|
|
|
2022-01-27 04:06:04 +00:00
|
|
|
/// Converts a number to ... i forgor 💀
|
2022-04-11 22:23:11 +00:00
|
|
|
pub const fn num_to_vga16(num: u8) -> Color16 {
|
2022-02-18 18:25:54 +00:00
|
|
|
use Color16::*;
|
2022-06-02 11:00:26 +00:00
|
|
|
|
2022-02-18 18:25:54 +00:00
|
|
|
match num {
|
|
|
|
0 => Black,
|
|
|
|
1 => Blue,
|
|
|
|
2 => Green,
|
|
|
|
3 => Cyan,
|
|
|
|
4 => Red,
|
|
|
|
5 => Magenta,
|
|
|
|
6 => Brown,
|
|
|
|
7 => LightGrey,
|
|
|
|
8 => DarkGrey,
|
|
|
|
9 => LightBlue,
|
|
|
|
10 => LightGreen,
|
|
|
|
11 => LightCyan,
|
|
|
|
12 => LightRed,
|
|
|
|
13 => Pink,
|
|
|
|
14 => Yellow,
|
|
|
|
15 => White,
|
|
|
|
// NOTE: Leasve the in
|
|
|
|
_ => Color16::Pink,
|
|
|
|
}
|
2022-01-18 14:30:09 +00:00
|
|
|
}
|