2014-09-15 20:12:11 +00:00
|
|
|
|
using System;
|
2017-04-24 16:51:59 +00:00
|
|
|
|
using System.Runtime.InteropServices;
|
2014-09-15 20:12:11 +00:00
|
|
|
|
|
2014-09-29 20:13:26 +00:00
|
|
|
|
using BizHawk.Emulation.Common;
|
2014-09-15 20:12:11 +00:00
|
|
|
|
|
|
|
|
|
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;
|
2014-09-15 20:12:11 +00:00
|
|
|
|
|
|
|
|
|
[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
|
|
|
|
|
2014-10-15 04:58:27 +00:00
|
|
|
|
[DllImport(dllname, CallingConvention = cc)]
|
|
|
|
|
public static extern void SetRotation(IntPtr s, int value);
|
|
|
|
|
|
2014-09-29 18:46:55 +00:00
|
|
|
|
[DllImport(dllname, CallingConvention = cc)]
|
|
|
|
|
public static extern bool GetSaveRamPtr(IntPtr s, out int size, out IntPtr data);
|
|
|
|
|
|
2014-11-02 19:11:19 +00:00
|
|
|
|
[DllImport(dllname, CallingConvention = cc)]
|
|
|
|
|
public static extern void GetReadOnlyCartPtrs(IntPtr s, out int s0, out IntPtr p0, out int s1, out IntPtr p1);
|
|
|
|
|
|
|
|
|
|
|
2014-09-29 20:13:26 +00:00
|
|
|
|
[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);
|
|
|
|
|
|
2014-11-02 19:11:19 +00:00
|
|
|
|
[DllImport(dllname, CallingConvention = cc)]
|
|
|
|
|
public static extern IntPtr GetRamPointer(IntPtr s);
|
2014-09-29 20:13:26 +00:00
|
|
|
|
|
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,
|
|
|
|
|
}
|
2014-09-15 20:12:11 +00:00
|
|
|
|
}
|
|
|
|
|
}
|