BizHawk/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/LibSameboy.cs

66 lines
1.5 KiB
C#
Raw Normal View History

2017-07-16 18:53:03 +00:00
using BizHawk.Common.BizInvoke;
using BizHawk.Emulation.Cores.Waterbox;
using System;
using System.Collections.Generic;
using System.Linq;
2017-07-18 22:19:51 +00:00
using System.Runtime.InteropServices;
2017-07-16 18:53:03 +00:00
using System.Text;
using System.Threading.Tasks;
namespace BizHawk.Emulation.Cores.Consoles.Nintendo.Gameboy
{
public abstract class LibSameboy : LibWaterboxCore
{
2017-07-18 22:19:51 +00:00
[Flags]
public enum Buttons : uint
{
A = 0x01,
B = 0x02,
SELECT = 0x04,
START = 0x08,
RIGHT = 0x10,
LEFT = 0x20,
UP = 0x40,
DOWN = 0x80
}
[StructLayout(LayoutKind.Sequential)]
public new class FrameInfo : LibWaterboxCore.FrameInfo
{
public long Time;
public Buttons Keys;
}
[UnmanagedFunctionPointer(CC)]
public delegate void PrinterCallback(IntPtr image,
byte height,
byte top_margin,
byte bottom_margin,
byte exposure);
2017-07-16 18:53:03 +00:00
[BizImport(CC)]
public abstract bool Init(bool cgb, byte[] spc, int spclen);
[BizImport(CC)]
public abstract void GetGpuMemory(IntPtr[] ptrs);
[BizImport(CC)]
public abstract void SetScanlineCallback(ScanlineCallback callback, int ly);
[BizImport(CC)]
public abstract byte GetIoReg(byte port);
2017-07-19 23:49:23 +00:00
[BizImport(CC)]
public abstract void PutSaveRam();
[BizImport(CC)]
public abstract void GetSaveRam();
[BizImport(CC)]
public abstract bool HasSaveRam();
[BizImport(CC)]
public abstract void SetPrinterCallback(PrinterCallback callback);
2017-07-16 18:53:03 +00:00
}
}