BizHawk/BizHawk.Emulation.Cores/Consoles/Atari/lynx/LibLynx.cs

64 lines
2.1 KiB
C#
Raw Normal View History

using System;
2017-04-24 16:51:59 +00:00
using System.Runtime.InteropServices;
using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.Atari.Lynx
{
public static class LibLynx
{
2017-04-24 16:51:59 +00:00
private const string dllname = "bizlynx.dll";
private const CallingConvention cc = CallingConvention.Cdecl;
[DllImport(dllname, CallingConvention = cc)]
public static extern IntPtr Create(byte[] game, int gamesize, byte[] bios, int biossize, int pagesize0, int pagesize1, bool lowpass);
[DllImport(dllname, CallingConvention = cc)]
public static extern void Destroy(IntPtr s);
[DllImport(dllname, CallingConvention = cc)]
public static extern void Reset(IntPtr s);
[DllImport(dllname, CallingConvention = cc)]
2014-09-29 18:53:53 +00:00
public static extern bool Advance(IntPtr s, Buttons buttons, int[] vbuff, short[] sbuff, ref int sbuffsize);
2014-09-16 00:40:15 +00:00
[DllImport(dllname, CallingConvention = cc)]
public static extern void SetRotation(IntPtr s, int value);
[DllImport(dllname, CallingConvention = cc)]
public static extern bool GetSaveRamPtr(IntPtr s, out int size, out IntPtr data);
[DllImport(dllname, CallingConvention = cc)]
public static extern void GetReadOnlyCartPtrs(IntPtr s, out int s0, out IntPtr p0, out int s1, out IntPtr p1);
[DllImport(dllname, CallingConvention = cc)]
public static extern int BinStateSize(IntPtr s);
[DllImport(dllname, CallingConvention = cc)]
public static extern bool BinStateSave(IntPtr s, byte[] data, int length);
[DllImport(dllname, CallingConvention = cc)]
public static extern bool BinStateLoad(IntPtr s, byte[] data, int length);
[DllImport(dllname, CallingConvention = cc)]
public static extern void TxtStateSave(IntPtr s, [In]ref TextStateFPtrs ff);
[DllImport(dllname, CallingConvention = cc)]
public static extern void TxtStateLoad(IntPtr s, [In]ref TextStateFPtrs ff);
[DllImport(dllname, CallingConvention = cc)]
public static extern IntPtr GetRamPointer(IntPtr s);
2014-09-16 00:40:15 +00:00
[Flags]
public enum Buttons : ushort
{
2014-09-16 03:04:11 +00:00
Up = 0x0040,
Down = 0x0080,
2014-09-16 00:40:15 +00:00
Left = 0x0010,
Right = 0x0020,
Option_1 = 0x008,
Option_2 = 0x004,
B = 0x002,
A = 0x001,
Pause = 0x100,
}
}
}