mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-12-29 08:30:04 +00:00
Save-state: Keyboard - save 'Key Waiting' flag. (Fixes #591)
This commit is contained in:
parent
c90eb07f17
commit
09ab12d0b6
@ -552,6 +552,7 @@ void KeybSetSnapshot_v1(const BYTE LastKey)
|
||||
//
|
||||
|
||||
#define SS_YAML_KEY_LASTKEY "Last Key"
|
||||
#define SS_YAML_KEY_KEYWAITING "Key Waiting"
|
||||
|
||||
static std::string KeybGetSnapshotStructName(void)
|
||||
{
|
||||
@ -563,14 +564,18 @@ void KeybSaveSnapshot(YamlSaveHelper& yamlSaveHelper)
|
||||
{
|
||||
YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", KeybGetSnapshotStructName().c_str());
|
||||
yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_LASTKEY, keycode);
|
||||
yamlSaveHelper.SaveBool(SS_YAML_KEY_KEYWAITING, keywaiting ? true : false);
|
||||
}
|
||||
|
||||
void KeybLoadSnapshot(YamlLoadHelper& yamlLoadHelper)
|
||||
void KeybLoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version)
|
||||
{
|
||||
if (!yamlLoadHelper.GetSubMap(KeybGetSnapshotStructName()))
|
||||
return;
|
||||
|
||||
keycode = (BYTE) yamlLoadHelper.LoadUint(SS_YAML_KEY_LASTKEY);
|
||||
|
||||
if (version == 2)
|
||||
keywaiting = (BOOL) yamlLoadHelper.LoadBool(SS_YAML_KEY_KEYWAITING);
|
||||
|
||||
yamlLoadHelper.PopMap();
|
||||
}
|
||||
|
@ -20,4 +20,4 @@ BYTE KeybReadData (void);
|
||||
BYTE KeybReadFlag (void);
|
||||
void KeybSetSnapshot_v1(const BYTE LastKey);
|
||||
void KeybSaveSnapshot(class YamlSaveHelper& yamlSaveHelper);
|
||||
void KeybLoadSnapshot(class YamlLoadHelper& yamlLoadHelper);
|
||||
void KeybLoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT version);
|
||||
|
@ -335,7 +335,7 @@ static void ParseUnitApple2(YamlLoadHelper& yamlLoadHelper, UINT version)
|
||||
m_ConfigNew.m_CpuType = GetMainCpu();
|
||||
|
||||
JoyLoadSnapshot(yamlLoadHelper);
|
||||
KeybLoadSnapshot(yamlLoadHelper);
|
||||
KeybLoadSnapshot(yamlLoadHelper, version);
|
||||
SpkrLoadSnapshot(yamlLoadHelper);
|
||||
VideoLoadSnapshot(yamlLoadHelper);
|
||||
MemLoadSnapshot(yamlLoadHelper, version);
|
||||
|
Loading…
Reference in New Issue
Block a user