Files
Nova64/simulator/Nova64Core.cs
T
Lukas Höppner 93fc058120 Cleanup
2026-08-09 19:39:53 +02:00

44 lines
1.6 KiB
C#

using System.Runtime.InteropServices;
internal static class Nova64Core
{
private const string LibName = "nova64_core";
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void DisplayFlushDelegate(IntPtr buffer, ushort width, ushort height);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void AudioOutputDelegate(IntPtr samples, uint count);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate bool SdReadSectorDelegate(uint sectorIdx, IntPtr destinationBuffer, uint sectorCount);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void CartridgeStatusDelegate(uint slotIdx, bool isInserted);
[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
public delegate void LogMessageDelegate([MarshalAs(UnmanagedType.LPStr)] string message);
[StructLayout(LayoutKind.Sequential)]
public struct Nova64IoInterface
{
public IntPtr display_flush;
public IntPtr audio_output;
public IntPtr sd_read_sector;
public IntPtr cartridge_status;
public IntPtr log_message;
}
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool nova64_init(IntPtr io_interface);
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int nova64_main();
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool nova64_shutdown();
[DllImport(LibName, CallingConvention = CallingConvention.Cdecl)]
public static extern uint nova64_get_version();
}