diff options
| author | Melodi <62381002+Melodi17@users.noreply.github.com> | 2025-08-04 12:07:39 +1000 |
|---|---|---|
| committer | Melodi <62381002+Melodi17@users.noreply.github.com> | 2025-08-04 12:07:39 +1000 |
| commit | 72f297a479b6749674ec80e91be53b8c482123d2 (patch) | |
| tree | 05465784b2b5b5adbd695b50e8394c6f78e3a455 /Program.cs | |
| parent | 86452af2d48e2d1883dbfd67316e371f2a593bfe (diff) | |
crowbar
Diffstat (limited to 'Program.cs')
| -rw-r--r-- | Program.cs | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -5,6 +5,7 @@ using System.Threading; using Microsoft.Xna.Framework; using Q1Emu.Chip; using Q1Emu; +using Q1Emu.Assembler; internal class Program { @@ -31,7 +32,14 @@ internal class Program } private static void AssembleAndRun(string filePath) { + StringReader reader = new(File.ReadAllText(filePath)); + BinaryWriter writer = new(File.Create(Path.ChangeExtension(filePath, ".q1"))); + Assembler assembler = new(reader, writer); + assembler.Assemble(); + writer.Close(); + Console.WriteLine($"Assembled {filePath} to {Path.ChangeExtension(filePath, ".q1")}"); + Run(Path.ChangeExtension(filePath, ".q1")); } private static void Run(string filePath) { @@ -51,6 +59,7 @@ internal class Program cpu.Bus = bus; ram.AttachToBus(bus); + display.AttachToBus(bus); int frameRate = 600; Thread t = new(() => @@ -58,7 +67,6 @@ internal class Program while (true) { cpu.Clock(); - display.Clock(); Thread.Sleep(1000 / frameRate); } }); @@ -70,7 +78,7 @@ internal class Program { display.OutputTexture = tex; Console.WriteLine("Display texture initialized."); - }); + }, () => display.Clock()); game.Run(); } }
\ No newline at end of file |
