diff --git a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj
index 6afb0adf26..6f3cc6daa5 100644
--- a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj
+++ b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj
@@ -542,6 +542,24 @@
+
+ Yabause.cs
+
+
+ Yabause.cs
+
+
+ Yabause.cs
+
+
+ Yabause.cs
+
+
+ Yabause.cs
+
+
+ Yabause.cs
+
diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.IDriveLight.cs b/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.IDriveLight.cs
new file mode 100644
index 0000000000..61a03e64cd
--- /dev/null
+++ b/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.IDriveLight.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+using BizHawk.Emulation.Common;
+
+namespace BizHawk.Emulation.Cores.Sega.Saturn
+{
+ public partial class Yabause : IDriveLight
+ {
+ public bool DriveLightEnabled { get; private set; }
+ public bool DriveLightOn { get; private set; }
+ }
+}
diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.IInputPollable.cs b/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.IInputPollable.cs
new file mode 100644
index 0000000000..65519c8f89
--- /dev/null
+++ b/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.IInputPollable.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+using BizHawk.Emulation.Common;
+
+namespace BizHawk.Emulation.Cores.Sega.Saturn
+{
+ public partial class Yabause : IInputPollable
+ {
+ public int LagCount { get; set; }
+
+ public bool IsLagFrame { get; private set; }
+
+ // TODO: optimize managed to unmanaged using the ActiveChanged event
+ public IInputCallbackSystem InputCallbacks
+ {
+ [FeatureNotImplemented]get { return _inputCallbacks; }
+ }
+
+ private readonly InputCallbackSystem _inputCallbacks = new InputCallbackSystem();
+ }
+}
diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.IMemoryDomains.cs b/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.IMemoryDomains.cs
new file mode 100644
index 0000000000..c5a06657a8
--- /dev/null
+++ b/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.IMemoryDomains.cs
@@ -0,0 +1,55 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+using BizHawk.Emulation.Common;
+
+namespace BizHawk.Emulation.Cores.Sega.Saturn
+{
+ public partial class Yabause : IMemoryDomains
+ {
+ public MemoryDomainList MemoryDomains { get; private set; }
+
+ private void InitMemoryDomains()
+ {
+ var ret = new List();
+ var nmds = LibYabause.libyabause_getmemoryareas_ex();
+ foreach (var nmd in nmds)
+ {
+ int l = nmd.length;
+ IntPtr d = nmd.data;
+ ret.Add(new MemoryDomain(
+ nmd.name,
+ nmd.length,
+ MemoryDomain.Endian.Little,
+ delegate(int addr)
+ {
+ if (addr < 0 || addr >= l)
+ throw new ArgumentOutOfRangeException();
+ unsafe
+ {
+ byte* p = (byte*)d;
+ return p[addr];
+ }
+ },
+ delegate(int addr, byte val)
+ {
+ if (addr < 0 || addr >= l)
+ throw new ArgumentOutOfRangeException();
+ unsafe
+ {
+ byte* p = (byte*)d;
+ p[addr] = val;
+ }
+ }
+ ));
+ }
+
+ // fulfill the prophecy of MainMemory always being MemoryDomains[0]
+ var tmp = ret[2];
+ ret[2] = ret[0];
+ ret[0] = tmp;
+ MemoryDomains = new MemoryDomainList(ret);
+ }
+ }
+}
diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.ISaveram.cs b/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.ISaveram.cs
new file mode 100644
index 0000000000..2bfa01d413
--- /dev/null
+++ b/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.ISaveram.cs
@@ -0,0 +1,74 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using BizHawk.Emulation.Common;
+
+namespace BizHawk.Emulation.Cores.Sega.Saturn
+{
+ public partial class Yabause : ISaveRam
+ {
+ public byte[] CloneSaveRam()
+ {
+ if (Disposed)
+ {
+ if (DisposedSaveRam != null)
+ {
+ return (byte[])DisposedSaveRam.Clone();
+ }
+ else
+ {
+ return new byte[0];
+ }
+ }
+ else
+ {
+ var ms = new MemoryStream();
+ var fp = new FilePiping();
+ fp.Get(ms);
+ bool success = LibYabause.libyabause_savesaveram(fp.GetPipeNameNative());
+ fp.Finish();
+ if (!success)
+ throw new Exception("libyabause_savesaveram() failed!");
+ var ret = ms.ToArray();
+ ms.Dispose();
+ return ret;
+ }
+
+ }
+
+ public void StoreSaveRam(byte[] data)
+ {
+ if (Disposed)
+ {
+ throw new Exception("It's a bit late for that");
+ }
+ else
+ {
+ var fp = new FilePiping();
+ fp.Offer(data);
+ bool success = LibYabause.libyabause_loadsaveram(fp.GetPipeNameNative());
+ fp.Finish();
+ if (!success)
+ {
+ throw new Exception("libyabause_loadsaveram() failed!");
+ }
+ }
+ }
+
+ public bool SaveRamModified
+ {
+ get
+ {
+ if (Disposed)
+ {
+ return DisposedSaveRam != null;
+ }
+ else
+ {
+ return LibYabause.libyabause_saveramodified();
+ }
+ }
+ }
+ }
+}
diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.ISettable.cs b/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.ISettable.cs
new file mode 100644
index 0000000000..be59406e53
--- /dev/null
+++ b/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.ISettable.cs
@@ -0,0 +1,135 @@
+using System;
+using System.ComponentModel;
+using Newtonsoft.Json;
+
+using BizHawk.Common;
+using BizHawk.Emulation.Common;
+
+namespace BizHawk.Emulation.Cores.Sega.Saturn
+{
+ public partial class Yabause : ISettable