Skip to content

Commit a62147f

Browse files
committed
Start on display
1 parent 9f41ae9 commit a62147f

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

src/emulator.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
mod display;
2+
13
use std::{
24
cmp::Ordering,
35
collections::HashMap,

src/emulator/display.rs

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
use std::{cell::UnsafeCell, marker::PhantomData, pin::Pin, sync::atomic::{AtomicU16, AtomicU8, Ordering}};
2+
3+
use async_std::task::JoinHandle;
4+
5+
const FONT: &[u8; 1 << 12] = include_bytes!("../vga-font.rom");
6+
7+
pub struct TextBuffer {
8+
data: Pin<Box<[u8; 1 << 12]>>,
9+
handle: JoinHandle<()>,
10+
}
11+
12+
struct BufferPtr(*const [u8; 1 << 12]);
13+
unsafe impl Send for BufferPtr {}
14+
15+
impl TextBuffer {
16+
pub fn spawn() -> TextBuffer {
17+
let data = Box::pin([0; 1 << 12]);
18+
19+
let handle = async_std::task::spawn(run_handle(BufferPtr(&*data)));
20+
21+
TextBuffer {data, handle}
22+
}
23+
}
24+
25+
async fn run_handle(buffer: BufferPtr) {
26+
27+
}

0 commit comments

Comments
 (0)