mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-01-10 13:29:56 +00:00
Save-state: Yaml: Removed GetMapValueBOOL()
This commit is contained in:
parent
7f50288bd9
commit
8524f91495
@ -125,7 +125,7 @@ struct HDD
|
|||||||
WORD hd_memblock;
|
WORD hd_memblock;
|
||||||
UINT hd_diskblock;
|
UINT hd_diskblock;
|
||||||
WORD hd_buf_ptr;
|
WORD hd_buf_ptr;
|
||||||
BOOL hd_imageloaded;
|
bool hd_imageloaded;
|
||||||
BYTE hd_buf[HD_BLOCK_SIZE+1]; // Why +1? Probably for erroreous reads beyond the block size (ie. reads from I/O addr 0xC0F8)
|
BYTE hd_buf[HD_BLOCK_SIZE+1]; // Why +1? Probably for erroreous reads beyond the block size (ie. reads from I/O addr 0xC0F8)
|
||||||
|
|
||||||
#if HD_LED
|
#if HD_LED
|
||||||
@ -443,7 +443,7 @@ void HD_Unplug(const int iDrive)
|
|||||||
|
|
||||||
bool HD_IsDriveUnplugged(const int iDrive)
|
bool HD_IsDriveUnplugged(const int iDrive)
|
||||||
{
|
{
|
||||||
return g_HardDisk[iDrive].hd_imageloaded == FALSE;
|
return g_HardDisk[iDrive].hd_imageloaded == false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -726,12 +726,13 @@ static bool HD_LoadSnapshotHDDUnit(YamlLoadHelper& yamlLoadHelper, UINT unit)
|
|||||||
throw std::string("Card: Expected key: ") + hddUnitName;
|
throw std::string("Card: Expected key: ") + hddUnitName;
|
||||||
|
|
||||||
std::string filename = yamlLoadHelper.GetMapValueSTRING(SS_YAML_KEY_FILENAME).c_str();
|
std::string filename = yamlLoadHelper.GetMapValueSTRING(SS_YAML_KEY_FILENAME).c_str();
|
||||||
//strcpy_s(g_HardDisk[Unit].fullname, sizeof(g_HardDisk[unit].fullname), filename.c_str());
|
g_HardDisk[unit].fullname[0] = 0;
|
||||||
|
g_HardDisk[unit].imagename[0] = 0;
|
||||||
g_HardDisk[unit].hd_error = yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_ERROR);
|
g_HardDisk[unit].hd_error = yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_ERROR);
|
||||||
g_HardDisk[unit].hd_memblock = yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_MEMBLOCK);
|
g_HardDisk[unit].hd_memblock = yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_MEMBLOCK);
|
||||||
g_HardDisk[unit].hd_diskblock = yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_DISKBLOCK);
|
g_HardDisk[unit].hd_diskblock = yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_DISKBLOCK);
|
||||||
yamlLoadHelper.GetMapValueBOOL(SS_YAML_KEY_IMAGELOADED); // Consume
|
yamlLoadHelper.GetMapValueBool(SS_YAML_KEY_IMAGELOADED); // Consume
|
||||||
g_HardDisk[unit].hd_imageloaded = FALSE; // Default to FALSE (until image is successfully loaded below)
|
g_HardDisk[unit].hd_imageloaded = false; // Default to false (until image is successfully loaded below)
|
||||||
g_HardDisk[unit].hd_status_next = (Disk_Status_e) yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_STATUS_NEXT);
|
g_HardDisk[unit].hd_status_next = (Disk_Status_e) yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_STATUS_NEXT);
|
||||||
g_HardDisk[unit].hd_status_prev = (Disk_Status_e) yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_STATUS_PREV);
|
g_HardDisk[unit].hd_status_prev = (Disk_Status_e) yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_STATUS_PREV);
|
||||||
g_HardDisk[unit].hd_buf_ptr = yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_BUF_PTR);
|
g_HardDisk[unit].hd_buf_ptr = yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_BUF_PTR);
|
||||||
|
@ -211,7 +211,7 @@ void CMouseInterface::Reset()
|
|||||||
m_iMinY = 0;
|
m_iMinY = 0;
|
||||||
m_iMaxY = 1023;
|
m_iMaxY = 1023;
|
||||||
|
|
||||||
m_bButtons[0] = m_bButtons[1] = FALSE;
|
m_bButtons[0] = m_bButtons[1] = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
@ -448,15 +448,13 @@ void CMouseInterface::OnMouseEvent(bool bEventVBL)
|
|||||||
if ( !( m_byMode & MODE_MOUSE_ON ) ) // Mouse Off
|
if ( !( m_byMode & MODE_MOUSE_ON ) ) // Mouse Off
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BOOL bBtn0 = m_bButtons[0];
|
|
||||||
BOOL bBtn1 = m_bButtons[1];
|
|
||||||
if ( m_nX != m_iX || m_nY != m_iY )
|
if ( m_nX != m_iX || m_nY != m_iY )
|
||||||
{
|
{
|
||||||
byState |= STAT_INT_MOVEMENT|STAT_MOVEMENT_SINCE_READMOUSE; // X/Y moved since last READMOUSE | Movement interrupt
|
byState |= STAT_INT_MOVEMENT|STAT_MOVEMENT_SINCE_READMOUSE; // X/Y moved since last READMOUSE | Movement interrupt
|
||||||
m_byState |= STAT_MOVEMENT_SINCE_READMOUSE; // [TC] Used by CopyII+9.1 and ProTERM3.1
|
m_byState |= STAT_MOVEMENT_SINCE_READMOUSE; // [TC] Used by CopyII+9.1 and ProTERM3.1
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_bBtn0 != bBtn0 || m_bBtn1 != bBtn1 )
|
if ( m_bBtn0 != m_bButtons[0] || m_bBtn1 != m_bButtons[1] )
|
||||||
byState |= STAT_INT_BUTTON; // Button 0/1 interrupt
|
byState |= STAT_INT_BUTTON; // Button 0/1 interrupt
|
||||||
if ( bEventVBL )
|
if ( bEventVBL )
|
||||||
byState |= STAT_INT_VBL;
|
byState |= STAT_INT_VBL;
|
||||||
@ -496,8 +494,8 @@ void CMouseInterface::Clear()
|
|||||||
m_byState = 0;
|
m_byState = 0;
|
||||||
m_nX = 0;
|
m_nX = 0;
|
||||||
m_nY = 0;
|
m_nY = 0;
|
||||||
m_bBtn0 = 0;
|
m_bBtn0 = false;
|
||||||
m_bBtn1 = 0;
|
m_bBtn1 = false;
|
||||||
SetPositionAbs( 0, 0 );
|
SetPositionAbs( 0, 0 );
|
||||||
|
|
||||||
// CpuIrqDeassert(IS_MOUSE);
|
// CpuIrqDeassert(IS_MOUSE);
|
||||||
@ -595,7 +593,7 @@ void CMouseInterface::SetPositionRel(long dX, long dY, int* pOutOfBoundsX, int*
|
|||||||
|
|
||||||
void CMouseInterface::SetButton(eBUTTON Button, eBUTTONSTATE State)
|
void CMouseInterface::SetButton(eBUTTON Button, eBUTTONSTATE State)
|
||||||
{
|
{
|
||||||
m_bButtons[Button]= (State == BUTTON_DOWN) ? TRUE : FALSE;
|
m_bButtons[Button] = (State == BUTTON_DOWN);
|
||||||
OnMouseEvent();
|
OnMouseEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -743,8 +741,8 @@ bool CMouseInterface::LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT sl
|
|||||||
m_byState = yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_MOUSESTATE);
|
m_byState = yamlLoadHelper.GetMapValueUINT(SS_YAML_KEY_MOUSESTATE);
|
||||||
m_nX = yamlLoadHelper.GetMapValueINT(SS_YAML_KEY_X);
|
m_nX = yamlLoadHelper.GetMapValueINT(SS_YAML_KEY_X);
|
||||||
m_nY = yamlLoadHelper.GetMapValueINT(SS_YAML_KEY_Y);
|
m_nY = yamlLoadHelper.GetMapValueINT(SS_YAML_KEY_Y);
|
||||||
m_bBtn0 = yamlLoadHelper.GetMapValueBOOL(SS_YAML_KEY_BTN0);
|
m_bBtn0 = yamlLoadHelper.GetMapValueBool(SS_YAML_KEY_BTN0);
|
||||||
m_bBtn1 = yamlLoadHelper.GetMapValueBOOL(SS_YAML_KEY_BTN1);
|
m_bBtn1 = yamlLoadHelper.GetMapValueBool(SS_YAML_KEY_BTN1);
|
||||||
m_bVBL = yamlLoadHelper.GetMapValueBool(SS_YAML_KEY_VBL);
|
m_bVBL = yamlLoadHelper.GetMapValueBool(SS_YAML_KEY_VBL);
|
||||||
m_iX = yamlLoadHelper.GetMapValueINT(SS_YAML_KEY_IX);
|
m_iX = yamlLoadHelper.GetMapValueINT(SS_YAML_KEY_IX);
|
||||||
m_iMinX = yamlLoadHelper.GetMapValueINT(SS_YAML_KEY_IMINX);
|
m_iMinX = yamlLoadHelper.GetMapValueINT(SS_YAML_KEY_IMINX);
|
||||||
@ -752,8 +750,8 @@ bool CMouseInterface::LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT sl
|
|||||||
m_iY = yamlLoadHelper.GetMapValueINT(SS_YAML_KEY_IY);
|
m_iY = yamlLoadHelper.GetMapValueINT(SS_YAML_KEY_IY);
|
||||||
m_iMinY = yamlLoadHelper.GetMapValueINT(SS_YAML_KEY_IMINY);
|
m_iMinY = yamlLoadHelper.GetMapValueINT(SS_YAML_KEY_IMINY);
|
||||||
m_iMaxY = yamlLoadHelper.GetMapValueINT(SS_YAML_KEY_IMAXY);
|
m_iMaxY = yamlLoadHelper.GetMapValueINT(SS_YAML_KEY_IMAXY);
|
||||||
m_bButtons[0] = yamlLoadHelper.GetMapValueBOOL(SS_YAML_KEY_BUTTON0);
|
m_bButtons[0] = yamlLoadHelper.GetMapValueBool(SS_YAML_KEY_BUTTON0);
|
||||||
m_bButtons[1] = yamlLoadHelper.GetMapValueBOOL(SS_YAML_KEY_BUTTON1);
|
m_bButtons[1] = yamlLoadHelper.GetMapValueBool(SS_YAML_KEY_BUTTON1);
|
||||||
m_bActive = yamlLoadHelper.GetMapValueBool(SS_YAML_KEY_ACTIVE);
|
m_bActive = yamlLoadHelper.GetMapValueBool(SS_YAML_KEY_ACTIVE);
|
||||||
m_bEnabled = yamlLoadHelper.GetMapValueBool(SS_YAML_KEY_ENABLED);
|
m_bEnabled = yamlLoadHelper.GetMapValueBool(SS_YAML_KEY_ENABLED);
|
||||||
|
|
||||||
|
@ -75,8 +75,8 @@ protected:
|
|||||||
BYTE m_byState;
|
BYTE m_byState;
|
||||||
int m_nX;
|
int m_nX;
|
||||||
int m_nY;
|
int m_nY;
|
||||||
BOOL m_bBtn0;
|
bool m_bBtn0;
|
||||||
BOOL m_bBtn1;
|
bool m_bBtn1;
|
||||||
|
|
||||||
bool m_bVBL;
|
bool m_bVBL;
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ protected:
|
|||||||
int m_iMinY;
|
int m_iMinY;
|
||||||
int m_iMaxY;
|
int m_iMaxY;
|
||||||
|
|
||||||
BOOL m_bButtons[2];
|
bool m_bButtons[2];
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@ -132,11 +132,6 @@ public:
|
|||||||
return GetMapValueUINT(key) ? true : false;
|
return GetMapValueUINT(key) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL GetMapValueBOOL(const std::string key)
|
|
||||||
{
|
|
||||||
return GetMapValueUINT(key) ? TRUE : FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string GetMapValueSTRING_NoThrow(const std::string& key, bool& bFound)
|
std::string GetMapValueSTRING_NoThrow(const std::string& key, bool& bFound)
|
||||||
{
|
{
|
||||||
std::string value = m_yamlHelper.GetMapValue(*m_pMapYaml, key, bFound);
|
std::string value = m_yamlHelper.GetMapValue(*m_pMapYaml, key, bFound);
|
||||||
@ -226,8 +221,6 @@ private:
|
|||||||
|
|
||||||
class YamlSaveHelper
|
class YamlSaveHelper
|
||||||
{
|
{
|
||||||
friend class Indent; // Indent can access YamlSaveHelper's private members
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
YamlSaveHelper(std::string pathname) :
|
YamlSaveHelper(std::string pathname) :
|
||||||
m_hFile(NULL),
|
m_hFile(NULL),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user