diff --git a/BizHawk.Emulation.Cores/Libretro/LibretroApi_BRK.cs b/BizHawk.Emulation.Cores/Libretro/LibretroApi_BRK.cs index 1c0711c539..98c89e17e1 100644 --- a/BizHawk.Emulation.Cores/Libretro/LibretroApi_BRK.cs +++ b/BizHawk.Emulation.Cores/Libretro/LibretroApi_BRK.cs @@ -10,10 +10,6 @@ namespace BizHawk.Emulation.Cores.Libretro { switch (msg) { - case eMessage.BRK_InputState: - comm->value = (uint)core.CB_InputState(comm->port, comm->device, comm->index, comm->id); - break; - default: return false; diff --git a/BizHawk.Emulation.Cores/Libretro/LibretroApi_Enums.cs b/BizHawk.Emulation.Cores/Libretro/LibretroApi_Enums.cs index 8b861eb05b..0764d9d083 100644 --- a/BizHawk.Emulation.Cores/Libretro/LibretroApi_Enums.cs +++ b/BizHawk.Emulation.Cores/Libretro/LibretroApi_Enums.cs @@ -28,9 +28,8 @@ namespace BizHawk.Emulation.Cores.Libretro CMD_Unserialize, CMD_LAST, + SIG_InputState, SIG_VideoUpdate, - - BRK_InputState, }; diff --git a/BizHawk.Emulation.Cores/Libretro/LibretroApi_QUERY.cs b/BizHawk.Emulation.Cores/Libretro/LibretroApi_QUERY.cs index 7c25bc5aa5..56470c30c1 100644 --- a/BizHawk.Emulation.Cores/Libretro/LibretroApi_QUERY.cs +++ b/BizHawk.Emulation.Cores/Libretro/LibretroApi_QUERY.cs @@ -6,17 +6,11 @@ namespace BizHawk.Emulation.Cores.Libretro { unsafe partial class LibretroApi { - bool Handle_SIG(eMessage msg) + public Tuple QUERY_GetMemory(RETRO_MEMORY mem) { - switch (msg) - { - default: - return false; - - } //switch(msg) - - Message(eMessage.Resume); - return true; + comm->value = (uint)mem; + Message(eMessage.QUERY_GetMemory); + return Tuple.Create(new IntPtr(comm->buf[(int)BufId.Param0]), comm->buf_size[(int)BufId.Param0]); } } } \ No newline at end of file diff --git a/BizHawk.Emulation.Cores/Libretro/LibretroApi_SIG.cs b/BizHawk.Emulation.Cores/Libretro/LibretroApi_SIG.cs index 3cd7fb888d..6e0ab2afe6 100644 --- a/BizHawk.Emulation.Cores/Libretro/LibretroApi_SIG.cs +++ b/BizHawk.Emulation.Cores/Libretro/LibretroApi_SIG.cs @@ -6,11 +6,29 @@ namespace BizHawk.Emulation.Cores.Libretro { unsafe partial class LibretroApi { - public Tuple QUERY_GetMemory(RETRO_MEMORY mem) + bool Handle_SIG(eMessage msg) { - comm->value = (uint)mem; - Message(eMessage.QUERY_GetMemory); - return Tuple.Create(new IntPtr(comm->buf[(int)BufId.Param0]), comm->buf_size[(int)BufId.Param0]); + //I know, ive done this two completely different ways + //both ways are sloppy glue, anyway + //I havent decided on the final architecture yet + + switch (msg) + { + case eMessage.SIG_InputState: + comm->value = (uint)core.CB_InputState(comm->port, comm->device, comm->index, comm->id); + break; + + case eMessage.SIG_VideoUpdate: + core.SIG_VideoUpdate(); + break; + + default: + return false; + + } //switch(msg) + + Message(eMessage.Resume); + return true; } } } \ No newline at end of file diff --git a/BizHawk.Emulation.Cores/Libretro/LibretroCore.cs b/BizHawk.Emulation.Cores/Libretro/LibretroCore.cs index a25c852283..ccbffb87e1 100644 --- a/BizHawk.Emulation.Cores/Libretro/LibretroCore.cs +++ b/BizHawk.Emulation.Cores/Libretro/LibretroCore.cs @@ -196,6 +196,11 @@ namespace BizHawk.Emulation.Cores.Libretro } } + public void SIG_VideoUpdate() + { + SetVideoBuffer(api.comm->env.fb_width, api.comm->env.fb_height); + } + int IVideoProvider.BufferWidth { get { return vidWidth; } } int IVideoProvider.BufferHeight { get { return vidHeight; } } diff --git a/LibretroBridge/vs2015/LibretroBridge.cpp b/LibretroBridge/vs2015/LibretroBridge.cpp index 3442dc7565..7918b7dbfc 100644 --- a/LibretroBridge/vs2015/LibretroBridge.cpp +++ b/LibretroBridge/vs2015/LibretroBridge.cpp @@ -93,9 +93,8 @@ enum eMessage : s32 CMD_Unserialize, CMD_LAST, + SIG_InputState, SIG_VideoUpdate, - - BRK_InputState, }; enum eStatus : s32 @@ -558,11 +557,11 @@ void retro_video_refresh(const void *data, unsigned width, unsigned height, size comm.env.fb_width = (s32)width; comm.env.fb_height = (s32)height; + //stash pitch if needed //notify c# of these new settings and let it allocate a buffer suitable for receiving the output (so we can work directly into c#'s int[]) //c# can read the settings right out of the comm env - //NOPE: not needed. for now, anyway. may want to notify later - //BREAK(eMessage::SIG_VideoUpdate); + BREAK(eMessage::SIG_VideoUpdate); ////if (BufferWidth != width) BufferWidth = (int)width; @@ -639,7 +638,7 @@ s16 retro_input_state(unsigned port, unsigned device, unsigned index, unsigned i comm.index = index; comm.id = id; - BREAK(eMessage::BRK_InputState); + BREAK(eMessage::SIG_InputState); return (s16)comm.value; } diff --git a/output/dll/LibretroBridge.dll b/output/dll/LibretroBridge.dll index 1b93178174..0c2d20523d 100644 Binary files a/output/dll/LibretroBridge.dll and b/output/dll/LibretroBridge.dll differ