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

44 lines
976 B
C#
Raw Normal View History

2017-06-15 23:00:41 +00:00
using BizHawk.Common.BizInvoke;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace BizHawk.Emulation.Cores.Consoles.Nintendo.Gameboy
{
public abstract class LibPizza
{
private const CallingConvention CC = CallingConvention.Cdecl;
2017-06-16 01:38:52 +00:00
[Flags]
public enum Buttons : ushort
{
A = 0x01,
B = 0x02,
SELECT = 0x04,
START = 0x08,
RIGHT = 0x10,
LEFT = 0x20,
UP = 0x40,
DOWN = 0x80
}
2017-06-15 23:00:41 +00:00
[StructLayout(LayoutKind.Sequential)]
public class FrameInfo
{
public IntPtr VideoBuffer;
2017-06-16 12:19:03 +00:00
public IntPtr SoundBuffer;
2017-06-15 23:00:41 +00:00
public int Clocks;
2017-06-16 12:19:03 +00:00
public int Samples;
2017-06-16 01:38:52 +00:00
public Buttons Keys;
2017-06-15 23:00:41 +00:00
}
[BizImport(CC)]
public abstract bool Init(byte[] rom, int romlen);
[BizImport(CC)]
public abstract void FrameAdvance([In,Out] FrameInfo frame);
2017-06-16 01:38:52 +00:00
[BizImport(CC)]
public abstract bool IsCGB();
2017-06-15 23:00:41 +00:00
}
}