From 756fd07bb29942ac2f8ba16a548610790e94dfe2 Mon Sep 17 00:00:00 2001 From: Jason Hilder Date: Wed, 3 Jun 2026 07:13:52 +0200 Subject: [PATCH] No need for display file in machine, gui handles it. --- src/machine/display.odin | 66 ---------------------------------------- 1 file changed, 66 deletions(-) delete mode 100644 src/machine/display.odin diff --git a/src/machine/display.odin b/src/machine/display.odin deleted file mode 100644 index 45ba122..0000000 --- a/src/machine/display.odin +++ /dev/null @@ -1,66 +0,0 @@ -package machine - -import rl "vendor:raylib" - -// Handle the "display" and all of its required functions -// raylib window, rendering, scale constants -SCALE :: 20 -SCREEN_WITDH :: 64 * SCALE -SCREEN_HEIGHT :: 32 * SCALE -CYCLES_PER_FRAME :: 12 - -// Display will handle all the screen drawing with raylib etc -run_system :: proc(s: ^System) { - rl.InitWindow(SCREEN_WITDH, SCREEN_HEIGHT, "raylib") - rl.InitAudioDevice() - - rl.SetTargetFPS(60) - - beep := rl.LoadSound("./beep.wav") - - for !rl.WindowShouldClose() { - rl.BeginDrawing() - rl.ClearBackground(rl.BLACK) - - // Do a cpu cycle - // Cap at 60hz/60fps - for _ in 0.. 0 do s.delay_timer -= 1 - - // Current sound file is around 1s so stop - // immediately when timer is 0 - if s.sound_timer > 0 { - s.sound_timer -= 1 - if !rl.IsSoundPlaying(beep) do rl.PlaySound(beep) - } else { - rl.StopSound(beep) - } - - render_display_buffer(&s.display) - - rl.EndDrawing() - } - - rl.UnloadSound(beep) - rl.CloseAudioDevice() - rl.CloseWindow() -} - - -// update display with display buffer bits -render_display_buffer :: proc(display_buffer: ^[32][64]u8) { - // get row - for y in 0..