Config->Sound: improve UX for extra MB cards when cmd-line is empty

This commit is contained in:
tomcw 2023-04-29 09:47:50 +01:00
parent 5ba153c244
commit 96a386a77a
2 changed files with 23 additions and 2 deletions

View File

@ -42,7 +42,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
bool MockingboardCardManager::IsMockingboard(UINT slot)
{
SS_CARDTYPE type = GetCardMgr().QuerySlot(slot);
return type == CT_MockingboardC || type == CT_Phasor || type == CT_MegaAudio || type == CT_SDMusic;
return type == CT_MockingboardC || type == CT_Phasor || IsMockingboardExtraCardType(slot);
}
bool MockingboardCardManager::IsMockingboardExtraCardType(UINT slot)
{
SS_CARDTYPE type = GetCardMgr().QuerySlot(slot);
return type == CT_MegaAudio || type == CT_SDMusic;
}
void MockingboardCardManager::ReinitializeClock(void)
@ -162,6 +168,20 @@ void MockingboardCardManager::SetVolume(DWORD volume, DWORD volumeMax)
}
}
bool MockingboardCardManager::GetEnableExtraCardTypes(void)
{
// Scan slots for any extra card types
// . eg. maybe started a new AppleWin (with empty cmd line), but with Registry's slot 4 = CT_MegaAudio
// Otherwise, Config->Sound will show slot as "Unavailable"
for (UINT i = SLOT0; i < NUM_SLOTS; i++)
{
if (IsMockingboardExtraCardType(i))
return true;
}
return m_enableExtraCardTypes;
}
#ifdef _DEBUG
void MockingboardCardManager::CheckCumulativeCycles(void)
{

View File

@ -33,7 +33,7 @@ public:
void SetVolume(DWORD volume, DWORD volumeMax);
void OutputToRiff(void) { m_outputToRiff = true; }
void SetEnableExtraCardTypes(bool enable) { m_enableExtraCardTypes = enable; }
bool GetEnableExtraCardTypes(void) { return m_enableExtraCardTypes; }
bool GetEnableExtraCardTypes(void);
void Destroy(void);
void Reset(const bool powerCycle)
@ -52,6 +52,7 @@ private:
bool Init(void);
UINT GenerateAllSoundData(void);
void MixAllAndCopyToRingBuffer(UINT nNumSamples);
bool IsMockingboardExtraCardType(UINT slot);
static const unsigned short NUM_MB_CHANNELS = 2;
static const DWORD SOUNDBUFFER_SIZE = MAX_SAMPLES * sizeof(short) * NUM_MB_CHANNELS;