mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-06-26 01:29:30 +00:00
Added GPL header, tweaked other comments
This commit is contained in:
parent
c2b62d26d3
commit
b386c444c3
|
@ -1,10 +1,34 @@
|
||||||
/*
|
/*
|
||||||
Emulate an 8 bit DAC (eg: SAM card) which writes unsigned byte
|
AppleWin : An Apple //e emulator for Windows
|
||||||
data written to its IO area to the audio buffer (as used by the speaker).
|
|
||||||
This merges the data with the speaker stream, reducing the volume
|
|
||||||
of the Apple speaker when active.
|
|
||||||
|
|
||||||
Riccardo Macri Mar 2015
|
Copyright (C) 1994-1996, Michael O'Brien
|
||||||
|
Copyright (C) 1999-2001, Oliver Schmidt
|
||||||
|
Copyright (C) 2002-2005, Tom Charlesworth
|
||||||
|
Copyright (C) 2006-2007, Tom Charlesworth, Michael Pohoreski
|
||||||
|
|
||||||
|
AppleWin is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
AppleWin is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with AppleWin; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
DAC.CPP
|
||||||
|
|
||||||
|
Emulate an 8 bit DAC (eg: SAM card) which writes unsigned byte
|
||||||
|
data written to its IO area to the audio buffer (as used by the speaker).
|
||||||
|
This merges the data with the speaker stream, reducing the volume
|
||||||
|
of the Apple speaker when active.
|
||||||
|
|
||||||
|
Riccardo Macri Mar 2015
|
||||||
*/
|
*/
|
||||||
#include "StdAfx.h"
|
#include "StdAfx.h"
|
||||||
|
|
||||||
|
@ -28,7 +52,7 @@ static BYTE __stdcall IOWrite_DAC(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULON
|
||||||
|
|
||||||
byte mb_res;
|
byte mb_res;
|
||||||
|
|
||||||
if (soundtype == SOUND_WAVE)
|
if (soundtype == SOUND_WAVE)
|
||||||
{
|
{
|
||||||
// use existing speaker code to bring timing up to date
|
// use existing speaker code to bring timing up to date
|
||||||
mb_res = SpkrToggle(pc, addr, bWrite, d, nCyclesLeft);
|
mb_res = SpkrToggle(pc, addr, bWrite, d, nCyclesLeft);
|
||||||
|
@ -40,16 +64,19 @@ static BYTE __stdcall IOWrite_DAC(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULON
|
||||||
// 0x00 0 0x80 -128
|
// 0x00 0 0x80 -128
|
||||||
|
|
||||||
// replace regular speaker output with 8 bit DAC value
|
// replace regular speaker output with 8 bit DAC value
|
||||||
// regular speaker data still audible but muted until speaker
|
// regular speaker data still audible but quieter until speaker
|
||||||
// goes idle
|
// goes idle (so both work simultaneously)
|
||||||
|
|
||||||
g_nSpeakerData = (d ^ 0x80) << 8;
|
g_nSpeakerData = (d ^ 0x80) << 8;
|
||||||
|
|
||||||
|
// make speaker quieter so eg: a metronome click through the
|
||||||
|
// Apple speaker is softer vs. the analogue SAM output
|
||||||
g_quieterSpeaker = 1;
|
g_quieterSpeaker = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mb_res = MemReadFloatingBus(nCyclesLeft);
|
mb_res = MemReadFloatingBus(nCyclesLeft);
|
||||||
|
|
||||||
return mb_res;
|
return mb_res;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigureDAC(LPBYTE pCxRomPeripheral, UINT uSlot)
|
void ConfigureDAC(LPBYTE pCxRomPeripheral, UINT uSlot)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user