Publish VCC Plus OSS source distribution for 3.6.2 build 60
This commit is contained in:
commit
c652a5276d
1192 files changed
+272368
No files matched your search
@@ -0,0 +1,52 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#include <vcc/ssc.h>
|
||||
|
||||
// C2 mode and level occupy bits 5..3. Bits 2..0 select the PIA data
|
||||
// register, interrupt edge and interrupt enable. Bits 7..6 are IRQ flags.
|
||||
#define PIA_MUX_LOW (*(unsigned char *)0xFF01)
|
||||
#define PIA_MUX_HIGH (*(unsigned char *)0xFF03)
|
||||
#define PIA_SOUND (*(unsigned char *)0xFF23)
|
||||
#define C2_LOW 0x30
|
||||
#define C2_HIGH 0x38
|
||||
|
||||
unsigned int ssc_route_audio(void)
|
||||
{
|
||||
unsigned char flags, low, high, sound;
|
||||
unsigned int saved;
|
||||
// Keep an interrupt handler from changing a control register between our
|
||||
// read and write. The exact incoming interrupt masks are restored.
|
||||
asm {
|
||||
tfr cc,a
|
||||
orcc #$50
|
||||
sta :flags
|
||||
}
|
||||
low = PIA_MUX_LOW;
|
||||
high = PIA_MUX_HIGH;
|
||||
sound = PIA_SOUND;
|
||||
saved = ((unsigned int)(low & 0x38) << 3) | (high & 0x38) | ((sound & 0x38) >> 3);
|
||||
PIA_MUX_LOW = (low & 7) | C2_LOW;
|
||||
PIA_MUX_HIGH = (high & 7) | C2_HIGH;
|
||||
PIA_SOUND = (sound & 7) | C2_HIGH;
|
||||
asm {
|
||||
lda :flags
|
||||
tfr a,cc
|
||||
}
|
||||
return saved;
|
||||
}
|
||||
|
||||
void ssc_restore_audio(unsigned int saved)
|
||||
{
|
||||
unsigned char flags;
|
||||
asm {
|
||||
tfr cc,a
|
||||
orcc #$50
|
||||
sta :flags
|
||||
}
|
||||
PIA_MUX_LOW = (PIA_MUX_LOW & 7) | (unsigned char)((saved >> 3) & 0x38);
|
||||
PIA_MUX_HIGH = (PIA_MUX_HIGH & 7) | (unsigned char)(saved & 0x38);
|
||||
PIA_SOUND = (PIA_SOUND & 7) | (unsigned char)((saved << 3) & 0x38);
|
||||
asm {
|
||||
lda :flags
|
||||
tfr a,cc
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user