mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-22 00:59:18 +01:00
nsyskbd: Stub KBDGetKey
Fixes MSX VC games freezing on boot
This commit is contained in:
parent
1672f969bb
commit
d4c2c3d209
@ -3,6 +3,11 @@
|
|||||||
|
|
||||||
namespace nsyskbd
|
namespace nsyskbd
|
||||||
{
|
{
|
||||||
|
bool IsValidChannel(uint32 channel)
|
||||||
|
{
|
||||||
|
return channel >= 0 && channel < 4;
|
||||||
|
}
|
||||||
|
|
||||||
uint32 KBDGetChannelStatus(uint32 channel, uint32be* status)
|
uint32 KBDGetChannelStatus(uint32 channel, uint32be* status)
|
||||||
{
|
{
|
||||||
static bool loggedError = false;
|
static bool loggedError = false;
|
||||||
@ -16,8 +21,38 @@ namespace nsyskbd
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma pack(push, 1)
|
||||||
|
struct KeyState
|
||||||
|
{
|
||||||
|
uint8be channel;
|
||||||
|
uint8be ukn1;
|
||||||
|
uint8be _padding[2];
|
||||||
|
uint32be ukn4;
|
||||||
|
uint32be ukn8;
|
||||||
|
uint16be uknC;
|
||||||
|
};
|
||||||
|
#pragma pack(pop)
|
||||||
|
static_assert(sizeof(KeyState) == 0xE); // actual size might be padded to 0x10?
|
||||||
|
|
||||||
|
uint32 KBDGetKey(uint32 channel, KeyState* keyState)
|
||||||
|
{
|
||||||
|
// used by MSX VC
|
||||||
|
if(!IsValidChannel(channel) || !keyState)
|
||||||
|
{
|
||||||
|
cemuLog_log(LogType::APIErrors, "KBDGetKey(): Invalid parameter");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
keyState->channel = channel;
|
||||||
|
keyState->ukn1 = 0;
|
||||||
|
keyState->ukn4 = 0;
|
||||||
|
keyState->ukn8 = 0;
|
||||||
|
keyState->uknC = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void nsyskbd_load()
|
void nsyskbd_load()
|
||||||
{
|
{
|
||||||
cafeExportRegister("nsyskbd", KBDGetChannelStatus, LogType::Placeholder);
|
cafeExportRegister("nsyskbd", KBDGetChannelStatus, LogType::Placeholder);
|
||||||
|
cafeExportRegister("nsyskbd", KBDGetKey, LogType::Placeholder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user