Create Simulator target scaffold

This commit is contained in:
Lukas Höppner
2026-08-09 16:29:38 +02:00
parent 2f48b3efc8
commit 7ea52cb96a
14 changed files with 275 additions and 101 deletions
+42
View File
@@ -0,0 +1,42 @@
using System;
using System.Runtime.InteropServices;
internal static class Nova64Core
{
private const string LibName = "nova64_core";
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool nova64_init_io(IntPtr io_interface);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int nova64_process_tick(uint delta_ms);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern uint nova64_get_version();
}
internal static class Program
{
private static void Main()
{
Console.WriteLine("Nova64 simulator starting...");
try
{
var version = Nova64Core.nova64_get_version();
Console.WriteLine($"Loaded nova64_core native library. Version: 0x{version:X}");
}
catch (DllNotFoundException ex)
{
Console.WriteLine($"Native library not found: {ex.Message}");
}
catch (EntryPointNotFoundException ex)
{
Console.WriteLine($"Native entry point missing: {ex.Message}");
}
catch (Exception ex)
{
Console.WriteLine($"Failed to initialize native library: {ex.Message}");
}
}
}