using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace BizHawk.Emulation.Consoles.Sega.Saturn { public static class LibYabause { /// /// set video buffer /// /// 704x512x32bit, should persist over time [DllImport("libyabause.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void libyabause_setvidbuff(IntPtr buff); /// /// soft reset, or something like that /// [DllImport("libyabause.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void libyabause_softreset(); /// /// /// /// width of framebuffer /// height of framebuffer [DllImport("libyabause.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void libyabause_frameadvance(out int w, out int h); [DllImport("libyabause.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void libyabause_deinit(); /// /// /// /// cd interface. struct need not persist after call, but the function pointers better /// [DllImport("libyabause.dll", CallingConvention = CallingConvention.Cdecl)] public static extern bool libyabause_init(ref CDInterface intf); public struct CDInterface { public int DontTouch; public IntPtr DontTouch2; /// /// init cd functions /// /// /// 0 on success, -1 on failure [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int Init(string unused); public Init InitFunc; /// /// deinit cd functions /// [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void DeInit(); public DeInit DeInitFunc; /// /// 0 = cd present, spinning /// 1 = cd present, not spinning /// 2 = no cd /// 3 = tray open /// /// [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int GetStatus(); public GetStatus GetStatusFunc; /// /// read all TOC entries /// /// place to copy to /// number of bytes written. should be 408 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int ReadTOC(IntPtr dest); public ReadTOC ReadTOCFunc; /// /// read a sector, should be 2352 bytes /// /// /// /// [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int ReadSectorFAD(int FAD, IntPtr dest); public ReadSectorFAD ReadSectorFADFunc; /// /// hint the next sector, for async loading /// /// [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void ReadAheadFAD(int FAD); public ReadAheadFAD ReadAheadFADFunc; } } }