From fe894b6ac28fedd70eecf9c4f864530a8f69a9bb Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Mon, 25 Jul 2016 21:20:24 -0700 Subject: [PATCH] Clarify codepaths for my Windoze-weary eyes --- src/audio/mockingboard.c | 84 ++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/src/audio/mockingboard.c b/src/audio/mockingboard.c index 73f48964..b407ee6d 100644 --- a/src/audio/mockingboard.c +++ b/src/audio/mockingboard.c @@ -279,7 +279,7 @@ static const double g_f6522TimerPeriod_NoIRQ = CLK_6502 / 60.0; // Constant wha // External global vars: bool g_bMBTimerIrqActive = false; -#ifdef _DEBUG +#if 0 // _DEBUG uint32_t g_uTimer1IrqCount = 0; // DEBUG #endif @@ -1504,7 +1504,7 @@ static bool MB_DSInit() } #endif -#ifdef APPLE2IX +#if 1 // APPLE2IX hr = SSI263Voice[i]->UnlockStaticBuffer(SSI263Voice[i], dwDSLockedBufferSize); LOG("MB_DSInit: (%02d) Unlock(),hr=0x%08X\n", i, (unsigned int)hr); #else @@ -1519,7 +1519,7 @@ static bool MB_DSInit() SSI263Voice[i]->bActive = false; SSI263Voice[i]->nVolume = MockingboardVoice->nVolume; // Use same volume as MB -#if !defined(APPLE2IX) +#if 0 // !APPLE2IX hr = SSI263Voice[i].lpDSBvoice->SetVolume(SSI263Voice[i].nVolume); LogFileOutput("MB_DSInit: (%02d) SetVolume(), hr=0x%08X\n", i, hr); #endif @@ -1529,7 +1529,7 @@ static bool MB_DSInit() unsigned long dwThreadId; -#ifdef APPLE2IX +#if 1 // APPLE2IX { int err = 0; if ((err = pthread_create(&g_hThread, NULL, SSI263Thread, NULL))) @@ -1577,7 +1577,7 @@ static void MB_DSUninit() { if(g_hThread) { -#ifdef APPLE2IX +#if 1 // APPLE2IX quit_event = true; pthread_cond_signal(&ssi263_cond); @@ -1602,7 +1602,7 @@ static void MB_DSUninit() while(1); #endif -#ifdef APPLE2IX +#if 1 // APPLE2IX g_hThread = 0; pthread_mutex_destroy(&ssi263_mutex); pthread_cond_destroy(&ssi263_cond); @@ -1616,7 +1616,7 @@ static void MB_DSUninit() if(MockingboardVoice && MockingboardVoice->bActive) { -#if !defined(APPLE2IX) +#if 0 // !APPLE2IX MockingboardVoice.lpDSBvoice->Stop(); #endif MockingboardVoice->bActive = false; @@ -1630,7 +1630,7 @@ static void MB_DSUninit() { if(SSI263Voice[i] && SSI263Voice[i]->bActive) { -#if !defined(APPLE2IX) +#if 0 // !APPLE2IX SSI263Voice[i].lpDSBvoice->Stop(); #endif SSI263Voice[i]->bActive = false; @@ -1641,7 +1641,7 @@ static void MB_DSUninit() // -#ifdef APPLE2IX +#if 1 // APPLE2IX FREE(g_nMixBuffer); #else if(g_hSSI263Event[0]) @@ -1668,14 +1668,14 @@ static void MB_DSUninit() void MB_Initialize() { -#ifdef APPLE2IX +#if 1 // APPLE2IX assert(pthread_self() == cpu_thread_id); memset(SSI263Voice, 0x0, sizeof(AudioBuffer_s *) * 64); #endif LOG("MB_Initialize: g_bDisableDirectSound=%d, g_bDisableDirectSoundMockingboard=%d\n", g_bDisableDirectSound, g_bDisableDirectSoundMockingboard); if (g_bDisableDirectSound || g_bDisableDirectSoundMockingboard) { -#if !defined(APPLE2IX) +#if 0 // !APPLE2IX MockingboardVoice.bMute = true; #endif g_SoundcardType = CT_Empty; @@ -1684,7 +1684,7 @@ void MB_Initialize() { memset(&g_MB,0,sizeof(g_MB)); -#ifdef APPLE2IX +#if 1 // APPLE2IX g_bMBAvailable = MB_DSInit(); if (!g_bMBAvailable) { //MockingboardVoice->bMute = true; @@ -1695,7 +1695,7 @@ void MB_Initialize() int i; for(i=0; i= SSI263_Offset) && (nOffset <= (SSI263_Offset+0x05))) return SSI263_Read(nMB, nAddr&0xf); else -#ifdef APPLE2IX +#if 1 // APPLE2IX return MemReadFloatingBus(); #else return MemReadFloatingBus(nCyclesLeft); @@ -1908,20 +1908,20 @@ static BYTE __stdcall MB_Read(WORD PC, WORD nAddr, BYTE bWrite, BYTE nValue, ULO //----------------------------------------------------------------------------- -#ifdef APPLE2IX +#if 1 // APPLE2IX #define nValue b GLUE_C_WRITE(MB_Write) #else static BYTE __stdcall MB_Write(WORD PC, WORD nAddr, BYTE bWrite, BYTE nValue, ULONG nCyclesLeft) #endif { -#ifdef APPLE2IX +#if 1 // APPLE2IX MB_UpdateCycles(); #else MB_UpdateCycles(nCyclesLeft); #endif -#ifdef _DEBUG +#if 0 // _DEBUG if(!IS_APPLE2 && !MemCheckSLOTCXROM()) { _ASSERT(0); // Card ROM disabled, so IORead_Cxxx() returns the internal ROM @@ -1974,14 +1974,14 @@ static BYTE __stdcall MB_Write(WORD PC, WORD nAddr, BYTE bWrite, BYTE nValue, UL //----------------------------------------------------------------------------- -#ifdef APPLE2IX +#if 1 // APPLE2IX GLUE_C_READ(PhasorIO) #else static BYTE __stdcall PhasorIO(WORD PC, WORD nAddr, BYTE bWrite, BYTE nValue, ULONG nCyclesLeft) #endif { if(!g_bPhasorEnable) -#ifdef APPLE2IX +#if 1 // APPLE2IX return MemReadFloatingBus(); #else return MemReadFloatingBus(nCyclesLeft); @@ -1992,7 +1992,7 @@ static BYTE __stdcall PhasorIO(WORD PC, WORD nAddr, BYTE bWrite, BYTE nValue, UL g_PhasorClockScaleFactor = (nAddr & 4) ? 2 : 1; -#ifdef APPLE2IX +#if 1 // APPLE2IX AY8910_InitClock((int)CLK_6502 * g_PhasorClockScaleFactor, SAMPLE_RATE); return MemReadFloatingBus(); @@ -2004,7 +2004,7 @@ static BYTE __stdcall PhasorIO(WORD PC, WORD nAddr, BYTE bWrite, BYTE nValue, UL } //----------------------------------------------------------------------------- -#ifdef APPLE2IX +#if 1 // APPLE2IX #define IO_Null NULL @@ -2072,13 +2072,13 @@ void MB_Mute() if(MockingboardVoice->bActive && !MockingboardVoice->bMute) { -#if !defined(APPLE2IX) +#if 0 // !APPLE2IX MockingboardVoice.lpDSBvoice->SetVolume(DSBVOLUME_MIN); #endif MockingboardVoice->bMute = true; } -#if !defined(APPLE2IX) +#if 0 // !APPLE2IX if(g_nCurrentActivePhoneme >= 0) SSI263Voice[g_nCurrentActivePhoneme].lpDSBvoice->SetVolume(DSBVOLUME_MIN); #endif @@ -2093,13 +2093,13 @@ void MB_Demute() if(MockingboardVoice->bActive && MockingboardVoice->bMute) { -#if !defined(APPLE2IX) +#if 0 // !APPLE2IX MockingboardVoice.lpDSBvoice->SetVolume(MockingboardVoice.nVolume); #endif MockingboardVoice->bMute = false; } -#if !defined(APPLE2IX) +#if 0 // !APPLE2IX if(g_nCurrentActivePhoneme >= 0) SSI263Voice[g_nCurrentActivePhoneme].lpDSBvoice->SetVolume(SSI263Voice[g_nCurrentActivePhoneme].nVolume); #endif @@ -2126,7 +2126,7 @@ void MB_EndOfVideoFrame() //----------------------------------------------------------------------------- // Called by CpuExecute() after every N opcodes (N = ~1000 @ 1MHz) -#ifdef APPLE2IX +#if 1 // APPLE2IX void MB_UpdateCycles(void) #else void MB_UpdateCycles(ULONG uExecutedCycles) @@ -2138,7 +2138,7 @@ void MB_UpdateCycles(ULONG uExecutedCycles) timing_checkpoint_cycles(); unsigned long uCycles = cycles_count_total - g_uLastCumulativeCycles; g_uLastCumulativeCycles = cycles_count_total; -#if defined(APPLE2IX) +#if 1 // APPLE2IX if (uCycles >= 0x10000) { printf("OOPS!!! Mockingboard failed assert!\n"); return; @@ -2162,7 +2162,7 @@ void MB_UpdateCycles(ULONG uExecutedCycles) if( bTimer1Underflow && (g_nMBTimerDevice == i) && g_bMBTimerIrqActive ) { -#ifdef _DEBUG +#if 0 // _DEBUG g_uTimer1IrqCount++; // DEBUG #endif @@ -2238,7 +2238,7 @@ bool MB_IsActive() } //----------------------------------------------------------------------------- -#if defined(APPLE2IX) +#if 1 // APPLE2IX void MB_SetVolumeZeroToTen(unsigned long goesToTen) { samplesScale = goesToTen/10.f; } @@ -2262,7 +2262,7 @@ void MB_SetVolume(DWORD dwVolume, DWORD dwVolumeMax) //=========================================================================== // Called by debugger - Debugger_Display.cpp -#if !defined(APPLE2IX) +#if 0 // !APPLE2IX void MB_GetSnapshot_v1(SS_CARD_MOCKINGBOARD_v1* const pSS, const DWORD dwSlot) { pSS->Hdr.UnitHdr.hdr.v2.Length = sizeof(SS_CARD_MOCKINGBOARD_v1); @@ -2356,7 +2356,7 @@ static __attribute__((constructor)) void _init_mockingboard(void) { prefs_registerListener(PREF_DOMAIN_AUDIO, &mb_prefsChanged); } -#if !defined(APPLE2IX) +#if 0 // !APPLE2IX static UINT DoWriteFile(const HANDLE hFile, const void* const pData, const UINT Length) { DWORD dwBytesWritten;