using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace BizHawk.Emulation.Consoles.Nintendo.GBA { /// /// bindings into libmeteor.dll /// public static class LibMeteor { /// /// reset the emulation core /// [DllImport("libmeteor.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void libmeteor_reset(); /// /// signal that you are removing data from the sound buffer. /// the next time frameadvance() is called, writing will start from the beginning /// /// the valid length of the buffer, in bytes [DllImport("libmeteor.dll", CallingConvention = CallingConvention.Cdecl)] public static extern uint libmeteor_emptysound(); /// /// set up buffers for libmeteor to dump data to. these must be valid before every frameadvance /// /// buffer to hold video data as BGRA32 /// length in bytes. must be at least 240 * 160 * 4 /// buffer to hold audio data as stereo s16le /// length in bytes. must be 0 mod 4 (hold a full stereo sample set) /// false if some problem. buffers will not be valid in this case [DllImport("libmeteor.dll", CallingConvention = CallingConvention.Cdecl)] public static extern bool libmeteor_setbuffers(IntPtr vid, uint vidlen, IntPtr aud, uint audlen); /// /// initialize the library /// [DllImport("libmeteor.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void libmeteor_init(); /// /// run emulation for one frame, updating sound and video along the way /// [DllImport("libmeteor.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void libmeteor_frameadvance(); /// /// load a rom image /// /// raw rom data. need not persist past this call /// length of data in bytes [DllImport("libmeteor.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void libmeteor_loadrom(byte[] data, uint datalen); /// /// load a bios image /// /// raw bios data. need not persist past this call /// length of data in bytes [DllImport("libmeteor.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void libmeteor_loadbios(byte[] data, uint datalen); } }