Updates to support DAC card, no UI yet - missed files

This commit is contained in:
unknown 2015-03-10 21:33:14 +09:00
parent 33372943e0
commit 33d33b71ec
4 changed files with 31 additions and 8 deletions

View File

@ -125,6 +125,7 @@
<ClCompile Include="source\Configuration\PropertySheet.cpp" /> <ClCompile Include="source\Configuration\PropertySheet.cpp" />
<ClCompile Include="source\Configuration\PropertySheetHelper.cpp" /> <ClCompile Include="source\Configuration\PropertySheetHelper.cpp" />
<ClCompile Include="source\CPU.cpp" /> <ClCompile Include="source\CPU.cpp" />
<ClCompile Include="source\DAC.cpp" />
<ClCompile Include="source\Debugger\Debug.cpp" /> <ClCompile Include="source\Debugger\Debug.cpp" />
<ClCompile Include="source\Debugger\Debugger_Assembler.cpp" /> <ClCompile Include="source\Debugger\Debugger_Assembler.cpp" />
<ClCompile Include="source\Debugger\Debugger_Color.cpp" /> <ClCompile Include="source\Debugger\Debugger_Color.cpp" />

View File

@ -51,6 +51,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "..\resource\resource.h" #include "..\resource\resource.h"
#include "Configuration\PropertySheet.h" #include "Configuration\PropertySheet.h"
#include "Debugger\DebugDefs.h" #include "Debugger\DebugDefs.h"
#include "DAC.h"
// Memory Flag // Memory Flag
#define MF_80STORE 0x00000001 #define MF_80STORE 0x00000001
@ -1294,6 +1295,8 @@ void MemInitialize()
{ {
ConfigureSoftcard(pCxRomPeripheral, 5); // $C500 : Z80 card ConfigureSoftcard(pCxRomPeripheral, 5); // $C500 : Z80 card
} }
else
ConfigureDAC(pCxRomPeripheral, 5); // $C500 : Z80 card
DiskLoadRom(pCxRomPeripheral, 6); // $C600 : Disk][ f/w DiskLoadRom(pCxRomPeripheral, 6); // $C600 : Disk][ f/w
HD_Load_Rom(pCxRomPeripheral, 7); // $C700 : HDD f/w HD_Load_Rom(pCxRomPeripheral, 7); // $C700 : HDD f/w

View File

@ -51,11 +51,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// their buffers are running low. // 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 unsigned short g_nSPKR_NumChannels = 1;
static const DWORD g_dwDSSpkrBufferSize = MAX_SAMPLES * sizeof(short) * g_nSPKR_NumChannels; static const DWORD g_dwDSSpkrBufferSize = MAX_SAMPLES * sizeof(short) * g_nSPKR_NumChannels;
@ -66,18 +61,20 @@ static short* g_pSpeakerBuffer = NULL;
// Globals (SOUND_WAVE) // Globals (SOUND_WAVE)
const short SPKR_DATA_INIT = (short)0x8000; 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 UINT g_nBufferIdx = 0;
static short* g_pRemainderBuffer = NULL; static short* g_pRemainderBuffer = NULL;
static UINT g_nRemainderBufferSize; // Setup in SpkrInitialize() static UINT g_nRemainderBufferSize; // Setup in SpkrInitialize()
static UINT g_nRemainderBufferIdx; // Setup in SpkrInitialize() static UINT g_nRemainderBufferIdx; // Setup in SpkrInitialize()
// Application-wide globals: // Application-wide globals:
DWORD soundtype = SOUND_WAVE; DWORD soundtype = SOUND_WAVE;
double g_fClksPerSpkrSample; // Setup in SetClksPerSpkrSample() double g_fClksPerSpkrSample; // Setup in SetClksPerSpkrSample()
// Allow temporary quietening of speaker (8 bit DAC)
UINT g_quieterSpeaker = 0;
// Globals // Globals
static DWORD lastcyclenum = 0; static DWORD lastcyclenum = 0;
static DWORD toggles = 0; static DWORD toggles = 0;
@ -447,7 +444,19 @@ BYTE __stdcall SpkrToggle (WORD, WORD, BYTE, BYTE, ULONG nCyclesLeft)
UpdateSpkr(); 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) else if (soundtype != SOUND_NONE)
{ {
@ -993,6 +1002,7 @@ static void Spkr_SetActive(bool bActive)
// Called by SpkrUpdate() after 0.2s of speaker inactivity // Called by SpkrUpdate() after 0.2s of speaker inactivity
g_bSpkrRecentlyActive = false; g_bSpkrRecentlyActive = false;
SpeakerVoice.bRecentlyActive = false; SpeakerVoice.bRecentlyActive = false;
g_quieterSpeaker = 0; // undo any muting (for 8 bit DAC)
} }
} }

View File

@ -1,7 +1,14 @@
#pragma once #pragma once
#define SOUND_NONE 0
#define SOUND_DIRECT 1
#define SOUND_SMART 2
#define SOUND_WAVE 3
extern DWORD soundtype; extern DWORD soundtype;
extern double g_fClksPerSpkrSample; extern double g_fClksPerSpkrSample;
extern UINT g_quieterSpeaker;
extern short g_nSpeakerData;
void SpkrDestroy (); void SpkrDestroy ();
void SpkrInitialize (); void SpkrInitialize ();
@ -23,3 +30,5 @@ DWORD SpkrGetSnapshot(SS_IO_Speaker* pSS);
DWORD SpkrSetSnapshot(SS_IO_Speaker* pSS); DWORD SpkrSetSnapshot(SS_IO_Speaker* pSS);
BYTE __stdcall SpkrToggle (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nCyclesLeft); BYTE __stdcall SpkrToggle (WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nCyclesLeft);