libretro: fix some scrambled framebuffers
This commit is contained in:
parent
ded1c2d7b7
commit
112e6ca1f2
|
@ -10,10 +10,6 @@ namespace BizHawk.Emulation.Cores.Libretro
|
||||||
{
|
{
|
||||||
switch (msg)
|
switch (msg)
|
||||||
{
|
{
|
||||||
case eMessage.BRK_InputState:
|
|
||||||
comm->value = (uint)core.CB_InputState(comm->port, comm->device, comm->index, comm->id);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -28,9 +28,8 @@ namespace BizHawk.Emulation.Cores.Libretro
|
||||||
CMD_Unserialize,
|
CMD_Unserialize,
|
||||||
CMD_LAST,
|
CMD_LAST,
|
||||||
|
|
||||||
|
SIG_InputState,
|
||||||
SIG_VideoUpdate,
|
SIG_VideoUpdate,
|
||||||
|
|
||||||
BRK_InputState,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,17 +6,11 @@ namespace BizHawk.Emulation.Cores.Libretro
|
||||||
{
|
{
|
||||||
unsafe partial class LibretroApi
|
unsafe partial class LibretroApi
|
||||||
{
|
{
|
||||||
bool Handle_SIG(eMessage msg)
|
public Tuple<IntPtr, int> QUERY_GetMemory(RETRO_MEMORY mem)
|
||||||
{
|
{
|
||||||
switch (msg)
|
comm->value = (uint)mem;
|
||||||
{
|
Message(eMessage.QUERY_GetMemory);
|
||||||
default:
|
return Tuple.Create(new IntPtr(comm->buf[(int)BufId.Param0]), comm->buf_size[(int)BufId.Param0]);
|
||||||
return false;
|
|
||||||
|
|
||||||
} //switch(msg)
|
|
||||||
|
|
||||||
Message(eMessage.Resume);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -6,11 +6,29 @@ namespace BizHawk.Emulation.Cores.Libretro
|
||||||
{
|
{
|
||||||
unsafe partial class LibretroApi
|
unsafe partial class LibretroApi
|
||||||
{
|
{
|
||||||
public Tuple<IntPtr,int> QUERY_GetMemory(RETRO_MEMORY mem)
|
bool Handle_SIG(eMessage msg)
|
||||||
{
|
{
|
||||||
comm->value = (uint)mem;
|
//I know, ive done this two completely different ways
|
||||||
Message(eMessage.QUERY_GetMemory);
|
//both ways are sloppy glue, anyway
|
||||||
return Tuple.Create(new IntPtr(comm->buf[(int)BufId.Param0]), comm->buf_size[(int)BufId.Param0]);
|
//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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -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.BufferWidth { get { return vidWidth; } }
|
||||||
int IVideoProvider.BufferHeight { get { return vidHeight; } }
|
int IVideoProvider.BufferHeight { get { return vidHeight; } }
|
||||||
|
|
||||||
|
|
|
@ -93,9 +93,8 @@ enum eMessage : s32
|
||||||
CMD_Unserialize,
|
CMD_Unserialize,
|
||||||
CMD_LAST,
|
CMD_LAST,
|
||||||
|
|
||||||
|
SIG_InputState,
|
||||||
SIG_VideoUpdate,
|
SIG_VideoUpdate,
|
||||||
|
|
||||||
BRK_InputState,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eStatus : s32
|
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_width = (s32)width;
|
||||||
comm.env.fb_height = (s32)height;
|
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[])
|
//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
|
//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;
|
////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.index = index;
|
||||||
comm.id = id;
|
comm.id = id;
|
||||||
|
|
||||||
BREAK(eMessage::BRK_InputState);
|
BREAK(eMessage::SIG_InputState);
|
||||||
|
|
||||||
return (s16)comm.value;
|
return (s16)comm.value;
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue