Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
4fc2ee18f2
2 changed files with 15 additions and 4 deletions
|
@ -120,6 +120,12 @@ void CardManager::RemoveInternal(UINT slot)
|
|||
m_slot[slot] = NULL;
|
||||
}
|
||||
|
||||
void CardManager::RemoveAuxInternal()
|
||||
{
|
||||
delete m_aux;
|
||||
m_aux = NULL;
|
||||
}
|
||||
|
||||
void CardManager::Remove(UINT slot)
|
||||
{
|
||||
RemoveInternal(slot);
|
||||
|
@ -131,6 +137,8 @@ void CardManager::InsertAux(SS_CARDTYPE type)
|
|||
if (type == CT_Empty)
|
||||
return RemoveAux();
|
||||
|
||||
RemoveAuxInternal();
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case CT_80Col:
|
||||
|
@ -146,10 +154,13 @@ void CardManager::InsertAux(SS_CARDTYPE type)
|
|||
_ASSERT(0);
|
||||
break;
|
||||
}
|
||||
|
||||
// for consistency m_aux must never be NULL
|
||||
_ASSERT(m_aux != NULL);
|
||||
}
|
||||
|
||||
void CardManager::RemoveAux(void)
|
||||
{
|
||||
delete m_aux;
|
||||
RemoveAuxInternal();
|
||||
m_aux = new EmptyCard;
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ public:
|
|||
~CardManager(void)
|
||||
{
|
||||
for (UINT i=0; i<NUM_SLOTS; i++)
|
||||
Remove(i);
|
||||
RemoveAux();
|
||||
RemoveInternal(i);
|
||||
RemoveAuxInternal();
|
||||
}
|
||||
|
||||
void Insert(UINT slot, SS_CARDTYPE type);
|
||||
|
@ -34,7 +34,6 @@ public:
|
|||
Card& GetRef(UINT slot)
|
||||
{
|
||||
SS_CARDTYPE t=QuerySlot(slot); _ASSERT((t==CT_SSC || t==CT_MouseInterface || t==CT_Disk2) && m_slot[slot]);
|
||||
if (!m_slot[slot]) throw std::runtime_error("slot/card mismatch");
|
||||
return *m_slot[slot];
|
||||
}
|
||||
Card* GetObj(UINT slot) { SS_CARDTYPE t=QuerySlot(slot); _ASSERT(t==CT_SSC || t==CT_MouseInterface || t==CT_Disk2); return m_slot[slot]; }
|
||||
|
@ -54,6 +53,7 @@ public:
|
|||
|
||||
private:
|
||||
void RemoveInternal(UINT slot);
|
||||
void RemoveAuxInternal();
|
||||
|
||||
Card* m_slot[NUM_SLOTS];
|
||||
Card* m_aux;
|
||||
|
|
Loading…
Add table
Reference in a new issue