summaryrefslogtreecommitdiffstats
path: root/rsnix/src/vt.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--rsnix/src/vt.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/rsnix/src/vt.rs b/rsnix/src/vt.rs
index 709ea71..53821b7 100644
--- a/rsnix/src/vt.rs
+++ b/rsnix/src/vt.rs
@@ -224,7 +224,13 @@ fn put_byte(b: u8) {
224} 224}
225 225
226fn param(i: usize, default: usize) -> usize { 226fn param(i: usize, default: usize) -> usize {
227 unsafe { if i < NPARAMS { PARAMS[i] } else { default } } 227 unsafe {
228 if i < NPARAMS {
229 PARAMS[i]
230 } else {
231 default
232 }
233 }
228} 234}
229 235
230/// Place a printable glyph at the cursor and advance (wrapping/scrolling). 236/// Place a printable glyph at the cursor and advance (wrapping/scrolling).
@@ -409,7 +415,7 @@ fn newline() {
409/// only the newly-exposed rows. 415/// only the newly-exposed rows.
410const SCROLL_BATCH: usize = 16; 416const SCROLL_BATCH: usize = 16;
411static mut PENDING_SCROLLS: usize = 0; 417static mut PENDING_SCROLLS: usize = 0;
412static mut LAST_SYNC_TICK: u16 = 0; 418static mut LAST_SYNC_TICK: u64 = 0;
413 419
414/// Shift the logical grid up one row; defer the framebuffer shift. 420/// Shift the logical grid up one row; defer the framebuffer shift.
415fn scroll_up() { 421fn scroll_up() {
@@ -424,7 +430,7 @@ fn scroll_up() {
424 // Batch: sync when enough scrolls piled up, or when the stream 430 // Batch: sync when enough scrolls piled up, or when the stream
425 // pauses (~40 ms at the 100 Hz timer) so interactive output still 431 // pauses (~40 ms at the 100 Hz timer) so interactive output still
426 // appears promptly. 432 // appears promptly.
427 const TICK_LIMIT: u16 = 4; 433 const TICK_LIMIT: u64 = 4;
428 let now = crate::interrupts::TICKS.load(core::sync::atomic::Ordering::Relaxed); 434 let now = crate::interrupts::TICKS.load(core::sync::atomic::Ordering::Relaxed);
429 if PENDING_SCROLLS >= SCROLL_BATCH || now.wrapping_sub(LAST_SYNC_TICK) > TICK_LIMIT { 435 if PENDING_SCROLLS >= SCROLL_BATCH || now.wrapping_sub(LAST_SYNC_TICK) > TICK_LIMIT {
430 sync_scroll(); 436 sync_scroll();