992413f4053d9470046876b234fe094062b730b7Garrett D'Amore//
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore// Copyright 2009 Sun Microsystems, Inc. All rights reserved.
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore// Use is subject to license terms.
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore//
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore// Copyright (C) 4Front Technologies 1996-2008.
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore//
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore// CDDL HEADER START
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore//
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore// The contents of this file are subject to the terms of the
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore// Common Development and Distribution License (the "License").
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore// You may not use this file except in compliance with the License.
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore//
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore// You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore// or http://www.opensolaris.org/os/licensing.
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore// See the License for the specific language governing permissions
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore// and limitations under the License.
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore//
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore// When distributing Covered Code, include this CDDL HEADER in each
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore// file and include the License file at usr/src/OPENSOLARIS.LICENSE.
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore// If applicable, add the following below this CDDL HEADER, with the
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore// fields enclosed by brackets "[]" replaced with your own identifying
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore// information: Portions Copyright [yyyy] [name of copyright owner]
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore//
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore// CDDL HEADER END
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore // Constants for EMU 10k2 (SB Audigy)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore // Inputs
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .input IN_AC97_L 0
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .input IN_AC97_R 1
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .input IN_DIGCD_L 2
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .input IN_DIGCD_R 3
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .input IN_SPDIF1_L 4 // TOSLink
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .input IN_SPDIF1_R 5
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .input IN_MYSTERY_L 6
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .input IN_MYSTERY_R 7
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .input IN_LINE2_L 8 // LiveDrive
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .input IN_LINE2_R 9
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .input IN_SPDIF2_L 10 // Coaxial SPDIF
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .input IN_SPDIF2_R 11
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .input IN_AUX2_L 12 // LiveDrive
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .input IN_AUX2_R 13
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore // Outputs
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_SPDIF_L 0
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_SPDIF_R 1
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_DCENTER 2 // Digital Center channel
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_DLFE 3 // Digital LFE
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_HEADPH_L 4 // LiveDrive headphone out
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_HEADPH_R 5
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_DSURR_L 6 // Surround output (digital)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_DSURR_R 7
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_FRONT_L 8
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_FRONT_R 9
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_ACENTER 10 // Analog center channel
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_ALFE 11 // Analog LFE output
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_SIDE_L 12 // Side surround
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_SIDE_R 13
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_SURR_L 14 // Surround output
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_SURR_R 15
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_AC97_L 16 // Send to the AC97 front channel
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_AC97_R 17
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_ADC_L 22 // Send to the ADC recording channel
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_ADC_R 23
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_MICREC_L 24 // Send to the mic recording buffer
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .output OUT_MICREC_R 25 // ??????? (maybe not in use at all)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore // Temporaries
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .gpr PCM_FRONT_L
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .gpr PCM_FRONT_R
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .gpr PCM_SURR_L
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .gpr PCM_SURR_R
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .gpr PCM_SIDE_L
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .gpr PCM_SIDE_R
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .gpr PCM_CEN
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .gpr PCM_LFE
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .gpr PCM_REC_L
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .gpr PCM_REC_R
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore .gpr SPDIF_DELAY
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore // Code
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore // Load up the PCM inputs.
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore // We apply the PCM volume at the same time.
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(PCM_FRONT_L, 0, FX_FRONT_L, VOL_PCM)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(PCM_FRONT_R, 0, FX_FRONT_R, VOL_PCM)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(PCM_SURR_L, 0, FX_SURR_L, VOL_PCM)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(PCM_SURR_R, 0, FX_SURR_R, VOL_PCM)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(PCM_SIDE_L, 0, FX_SIDE_L, VOL_PCM)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(PCM_SIDE_R, 0, FX_SIDE_R, VOL_PCM)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(PCM_CEN, 0, FX_CEN, VOL_PCM)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(PCM_LFE, 0, FX_LFE, VOL_PCM)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore // Mix any monitor sources into the front PCM
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore // AC'97 (includes Line-In, analog CD, and Mic)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(PCM_FRONT_L, PCM_FRONT_L, IN_AC97_L, MON_AC97_L)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(PCM_FRONT_R, PCM_FRONT_R, IN_AC97_R, MON_AC97_R)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore // DIGCD
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(PCM_FRONT_L, PCM_FRONT_L, IN_DIGCD_L, MON_DIGCD_L)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(PCM_FRONT_R, PCM_FRONT_R, IN_DIGCD_R, MON_DIGCD_R)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore // SPDIF1
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(PCM_FRONT_L, PCM_FRONT_L, IN_SPDIF1_L, MON_SPDIF1_L)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(PCM_FRONT_R, PCM_FRONT_R, IN_SPDIF1_R, MON_SPDIF1_R)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore // SPDIF2
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(PCM_FRONT_L, PCM_FRONT_L, IN_SPDIF2_L, MON_SPDIF2_L)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(PCM_FRONT_R, PCM_FRONT_R, IN_SPDIF2_R, MON_SPDIF2_R)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore // Line2/Mic2 (Live! Drive)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(PCM_FRONT_L, PCM_FRONT_L, IN_LINE2_L, MON_LINE2_L)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(PCM_FRONT_R, PCM_FRONT_R, IN_LINE2_R, MON_LINE2_R)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore // Aux2 (Live! Drive)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(PCM_FRONT_L, PCM_FRONT_L, IN_AUX2_L, MON_AUX2_L)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(PCM_FRONT_R, PCM_FRONT_R, IN_AUX2_R, MON_AUX2_R)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore // Outputs
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(OUT_FRONT_L, 0, PCM_FRONT_L, VOL_FRONT_L)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(OUT_FRONT_R, 0, PCM_FRONT_R, VOL_FRONT_R)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(OUT_SPDIF_L, 0, PCM_FRONT_L, VOL_FRONT_L)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore // delay SPDIF right channel one sample to fix a bug
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore ACC3(OUT_SPDIF_R, 0, 0, SPDIF_DELAY)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(SPDIF_DELAY, 0, PCM_FRONT_R, VOL_FRONT_R)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(OUT_HEADPH_L, 0, PCM_FRONT_L, VOL_HEADPH_L)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(OUT_HEADPH_R, 0, PCM_FRONT_R, VOL_HEADPH_R)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(OUT_SURR_L, 0, PCM_SURR_L, VOL_SURR_L)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(OUT_SURR_R, 0, PCM_SURR_R, VOL_SURR_R)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(OUT_DSURR_L, 0, PCM_SURR_L, VOL_SURR_L)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(OUT_DSURR_R, 0, PCM_SURR_R, VOL_SURR_R)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(OUT_SIDE_L, 0, PCM_SIDE_L, VOL_SIDE_L)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(OUT_SIDE_R, 0, PCM_SIDE_R, VOL_SIDE_R)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(OUT_ACENTER, 0, PCM_CEN, VOL_CEN)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(OUT_DCENTER, 0, PCM_CEN, VOL_CEN)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(OUT_ALFE, 0, PCM_LFE, VOL_LFE)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(OUT_DLFE, 0, PCM_LFE, VOL_LFE)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore // Inputs (Recording) -- the source variables are treated as
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore // simple boolean enables.
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACINTS(PCM_REC_L, PCM_REC_R, IN_AC97_L, REC_AC97)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACINTS(PCM_REC_R, PCM_REC_L, IN_AC97_R, REC_AC97)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACINTS(PCM_REC_L, PCM_REC_L, IN_DIGCD_L, REC_DIGCD)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACINTS(PCM_REC_R, PCM_REC_R, IN_DIGCD_R, REC_DIGCD)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACINTS(PCM_REC_L, PCM_REC_L, IN_SPDIF1_L, REC_SPDIF1)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACINTS(PCM_REC_R, PCM_REC_R, IN_SPDIF1_R, REC_SPDIF1)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACINTS(PCM_REC_L, PCM_REC_L, IN_SPDIF2_L, REC_SPDIF2)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACINTS(PCM_REC_R, PCM_REC_R, IN_SPDIF2_R, REC_SPDIF2)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACINTS(PCM_REC_L, PCM_REC_L, IN_AUX2_L, REC_AUX2)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACINTS(PCM_REC_R, PCM_REC_R, IN_AUX2_R, REC_AUX2)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACINTS(PCM_REC_L, PCM_REC_L, IN_LINE2_L, REC_LINE2)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACINTS(PCM_REC_R, PCM_REC_R, IN_LINE2_R, REC_LINE2)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACINTS(PCM_REC_L, PCM_REC_L, PCM_FRONT_L, REC_PCM)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACINTS(PCM_REC_R, PCM_REC_R, PCM_FRONT_R, REC_PCM)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore // Apply master record gain
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(OUT_ADC_L, 0, PCM_REC_L, VOL_REC_L)
992413f4053d9470046876b234fe094062b730b7Garrett D'Amore MACS(OUT_ADC_R, 0, PCM_REC_R, VOL_REC_R)