mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-12-23 00:30:17 +00:00
Updates to support DAC card, no UI yet - missed files
This commit is contained in:
parent
33372943e0
commit
33d33b71ec
@ -125,6 +125,7 @@
|
||||
<ClCompile Include="source\Configuration\PropertySheet.cpp" />
|
||||
<ClCompile Include="source\Configuration\PropertySheetHelper.cpp" />
|
||||
<ClCompile Include="source\CPU.cpp" />
|
||||
<ClCompile Include="source\DAC.cpp" />
|
||||
<ClCompile Include="source\Debugger\Debug.cpp" />
|
||||
<ClCompile Include="source\Debugger\Debugger_Assembler.cpp" />
|
||||
<ClCompile Include="source\Debugger\Debugger_Color.cpp" />
|
||||
|
@ -51,6 +51,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "..\resource\resource.h"
|
||||
#include "Configuration\PropertySheet.h"
|
||||
#include "Debugger\DebugDefs.h"
|
||||
#include "DAC.h"
|
||||
|
||||
// Memory Flag
|
||||
#define MF_80STORE 0x00000001
|
||||
@ -1294,6 +1295,8 @@ void MemInitialize()
|
||||
{
|
||||
ConfigureSoftcard(pCxRomPeripheral, 5); // $C500 : Z80 card
|
||||
}
|
||||
else
|
||||
ConfigureDAC(pCxRomPeripheral, 5); // $C500 : Z80 card
|
||||
|
||||
DiskLoadRom(pCxRomPeripheral, 6); // $C600 : Disk][ f/w
|
||||
HD_Load_Rom(pCxRomPeripheral, 7); // $C700 : HDD f/w
|
||||
|
@ -51,11 +51,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
// their buffers are running low.
|
||||
//
|
||||
|
||||
#define SOUND_NONE 0
|
||||
#define SOUND_DIRECT 1
|
||||
#define SOUND_SMART 2
|
||||
#define SOUND_WAVE 3
|
||||
|
||||
static const unsigned short g_nSPKR_NumChannels = 1;
|
||||
static const DWORD g_dwDSSpkrBufferSize = MAX_SAMPLES * sizeof(short) * g_nSPKR_NumChannels;
|
||||
|
||||
@ -66,18 +61,20 @@ static short* g_pSpeakerBuffer = NULL;
|
||||
// Globals (SOUND_WAVE)
|
||||
const short SPKR_DATA_INIT = (short)0x8000;
|
||||
|
||||
static short g_nSpeakerData = SPKR_DATA_INIT;
|
||||
short g_nSpeakerData = SPKR_DATA_INIT;
|
||||
static UINT g_nBufferIdx = 0;
|
||||
|
||||
static short* g_pRemainderBuffer = NULL;
|
||||
static UINT g_nRemainderBufferSize; // Setup in SpkrInitialize()
|
||||
static UINT g_nRemainderBufferIdx; // Setup in SpkrInitialize()
|
||||
|
||||
|
||||
// Application-wide globals:
|
||||
DWORD soundtype = SOUND_WAVE;
|
||||
double g_fClksPerSpkrSample; // Setup in SetClksPerSpkrSample()
|
||||
|
||||
// Allow temporary quietening of speaker (8 bit DAC)
|
||||
UINT g_quieterSpeaker = 0;
|
||||
|
||||
// Globals
|
||||
static DWORD lastcyclenum = 0;
|
||||
static DWORD toggles = 0;
|
||||
@ -447,7 +444,19 @@ BYTE __stdcall SpkrToggle (WORD, WORD, BYTE, BYTE, ULONG nCyclesLeft)
|
||||
|
||||
UpdateSpkr();
|
||||
|
||||
g_nSpeakerData = ~g_nSpeakerData;
|
||||
// quieten the speaker if 8 bit DAC in use
|
||||
|
||||
// g_nSpeakerData = ~g_nSpeakerData;
|
||||
if (g_quieterSpeaker)
|
||||
if (g_nSpeakerData == (SPKR_DATA_INIT >> 2))
|
||||
g_nSpeakerData = ~g_nSpeakerData;
|
||||
else
|
||||
g_nSpeakerData = SPKR_DATA_INIT>>2;
|
||||
else
|
||||
if (g_nSpeakerData == SPKR_DATA_INIT)
|
||||
g_nSpeakerData = ~g_nSpeakerData;
|
||||
else
|
||||
g_nSpeakerData = SPKR_DATA_INIT;
|
||||
}
|
||||
else if (soundtype != SOUND_NONE)
|
||||
{
|
||||
@ -993,6 +1002,7 @@ static void Spkr_SetActive(bool bActive)
|
||||
// Called by SpkrUpdate() after 0.2s of speaker inactivity
|
||||
g_bSpkrRecentlyActive = false;
|
||||
SpeakerVoice.bRecentlyActive = false;
|
||||
g_quieterSpeaker = 0; // undo any muting (for 8 bit DAC)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#define SOUND_NONE 0
|
||||
#define SOUND_DIRECT 1
|
||||
#define SOUND_SMART 2
|
||||
#define SOUND_WAVE 3
|
||||
|
||||
extern DWORD soundtype;
|
||||
extern double g_fClksPerSpkrSample;
|
||||
extern UINT g_quieterSpeaker;
|
||||
extern short g_nSpeakerData;
|
||||
|
||||
void SpkrDestroy ();
|
||||
void SpkrInitialize ();
|
||||
@ -23,3 +30,5 @@ DWORD SpkrGetSnapshot(SS_IO_Speaker* pSS);
|
||||
DWORD SpkrSetSnapshot(SS_IO_Speaker* pSS);
|
||||
|
||||
BYTE __stdcall SpkrToggle (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nCyclesLeft);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user