fix: GPU display at correct resolution, clean up diagnostics

- Add GET_DISPLAY_INFO command to query QEMU's preferred resolution
  (was hardcoded 640x480, QEMU wanted 1280x800)
- Allocate framebuffer matching actual display dimensions
- Remove debug diagnostic output from display server and snake
This commit is contained in:
2026-10-19 00:24:37 +02:00
parent f5ac7189a9
commit 68849f698b
3 changed files with 60 additions and 20 deletions

View File

@@ -14,7 +14,7 @@ use display_server::protocol::DisplayRequest;
const INPUT_EP: CapSlot = CapSlot::const_new(0);
const DISPLAY_EP: CapSlot = CapSlot::const_new(1);
const TICK_DELAY: u64 = 2_000_000;
const TICK_DELAY: u64 = 5_000_000;
const MAX_RENDER_CMDS: usize = 140;
fn display_send(req: &DisplayRequest) {
@@ -50,20 +50,17 @@ extern "C" fn main() {
}
flush();
wait_tick();
handle_input(&mut snake);
snake.tick();
if snake.state() == GameState::GameOver {
let gw = renderer::grid_pixel_width();
let gh = renderer::grid_pixel_height();
draw_rect(gw / 2 - 60, gh / 2 - 12, 120, 24, 0xFF800000);
draw_rect(gw / 2 - 60, gh / 2 - 12, 120, 24, 0xFFCC0000);
flush();
let end = Ticks::from_raw(syscall::get_time().raw() + 50_000_000);
while syscall::get_time().raw() < end.raw() { syscall::yield_now(); }
return;
loop { syscall::yield_now(); }
}
wait_tick();
handle_input(&mut snake);
snake.tick();
}
}