Add support of SB for PC98 into VoxWare 3.5, and more $FreeBSD$.
Submitted by: T.Yamaoka <taka@windows.squares.net> Pressed to review by: nyan
This commit is contained in:
parent
efb5cc9fac
commit
efacb21bbc
@ -25,6 +25,8 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -697,8 +699,11 @@ opl3_command(int io_addr, u_int addr, u_int val)
|
||||
for (i = 0; i < 2; i++)
|
||||
inb(io_addr);
|
||||
|
||||
#ifdef PC98
|
||||
outb(io_addr + 0x100, (u_char) (val & 0xff));
|
||||
#else
|
||||
outb(io_addr + 1, (u_char) (val & 0xff));
|
||||
|
||||
#endif
|
||||
if (devc->model != 2)
|
||||
DELAY(30);
|
||||
else
|
||||
|
@ -429,6 +429,17 @@ set_irq_hw(int level)
|
||||
int ival;
|
||||
|
||||
switch (level) {
|
||||
#ifdef PC98
|
||||
case 5:
|
||||
ival = 8;
|
||||
break;
|
||||
case 3:
|
||||
ival = 1;
|
||||
break;
|
||||
case 10:
|
||||
ival = 2;
|
||||
break;
|
||||
#else
|
||||
case 5:
|
||||
ival = 2;
|
||||
break;
|
||||
@ -441,6 +452,7 @@ set_irq_hw(int level)
|
||||
case 10:
|
||||
ival = 8;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
printf("SB16_IRQ_LEVEL %d does not exist\n", level);
|
||||
return;
|
||||
@ -492,12 +504,16 @@ sb16_dsp_detect(struct address_info * hw_config)
|
||||
if (sbc_major < 4) /* Set by the plain SB driver */
|
||||
return 0; /* Not a SB16 */
|
||||
|
||||
#ifdef PC98
|
||||
hw_config->dma = sb_config->dma;
|
||||
#else
|
||||
if (hw_config->dma < 4)
|
||||
if (hw_config->dma != sb_config->dma) {
|
||||
printf("SB16 Error: Invalid DMA channel %d/%d\n",
|
||||
sb_config->dma, hw_config->dma);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
dma16 = hw_config->dma;
|
||||
dma8 = sb_config->dma;
|
||||
/* hw_config->irq = 0; sb_config->irq;
|
||||
@ -505,7 +521,11 @@ sb16_dsp_detect(struct address_info * hw_config)
|
||||
*/
|
||||
set_irq_hw(sb_config->irq);
|
||||
|
||||
#ifdef PC98
|
||||
sb_setmixer (DMA_NR, hw_config->dma == 0 ? 1 : 2);
|
||||
#else
|
||||
sb_setmixer(DMA_NR, (1 << hw_config->dma) | (1 << sb_config->dma));
|
||||
#endif
|
||||
|
||||
DEB(printf("SoundBlaster 16: IRQ %d DMA %d OK\n",
|
||||
sb_config->irq, hw_config->dma));
|
||||
|
@ -25,6 +25,8 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
|
||||
#include <i386/isa/sound/sound_config.h>
|
||||
@ -34,9 +36,15 @@
|
||||
|
||||
#include "sb.h"
|
||||
|
||||
#ifdef PC98
|
||||
#define DATAPORT (sb16midi_base)
|
||||
#define COMDPORT (sb16midi_base+0x100)
|
||||
#define STATPORT (sb16midi_base+0x100)
|
||||
#else
|
||||
#define DATAPORT (sb16midi_base)
|
||||
#define COMDPORT (sb16midi_base+1)
|
||||
#define STATPORT (sb16midi_base+1)
|
||||
#endif
|
||||
|
||||
extern sound_os_info *sb_osp;
|
||||
|
||||
@ -54,7 +62,11 @@ extern sound_os_info *sb_osp;
|
||||
#define UART_MODE_ON 0x3F
|
||||
|
||||
static int sb16midi_opened = 0;
|
||||
#ifdef PC98
|
||||
static int sb16midi_base = 0x80d2;
|
||||
#else
|
||||
static int sb16midi_base = 0x330;
|
||||
#endif
|
||||
static int sb16midi_detected = 0;
|
||||
static int my_dev;
|
||||
extern int sbc_base;
|
||||
|
@ -29,6 +29,8 @@
|
||||
* Pro
|
||||
*
|
||||
* JRA Gibson April 1995 Code added for MV ProSonic/Jazz 16 in 16 bit mode
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <i386/isa/sound/sound_config.h>
|
||||
@ -952,6 +954,27 @@ sb_dsp_detect(struct address_info * hw_config)
|
||||
if (!sb_reset_dsp())
|
||||
return 0;
|
||||
#endif
|
||||
#ifdef PC98
|
||||
switch (sbc_irq) {
|
||||
case 3:
|
||||
sb_setmixer (IRQ_NR, 1);
|
||||
break;
|
||||
case 5:
|
||||
sb_setmixer (IRQ_NR, 8);
|
||||
break;
|
||||
case 10:
|
||||
sb_setmixer (IRQ_NR, 2);
|
||||
break;
|
||||
}
|
||||
switch (hw_config->dma) {
|
||||
case 0:
|
||||
sb_setmixer (DMA_NR, 1);
|
||||
break;
|
||||
case 3:
|
||||
sb_setmixer (DMA_NR, 2);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 1; /* Detected */
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
/*
|
||||
* file: sbcard.h
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
|
||||
extern int sbc_major, sbc_minor ;
|
||||
@ -7,6 +10,20 @@ extern int sbc_major, sbc_minor ;
|
||||
* sound blaster registers
|
||||
*/
|
||||
|
||||
#ifdef PC98
|
||||
#define DSP_RESET (sbc_base + 0x600)
|
||||
#define DSP_READ (sbc_base + 0xA00)
|
||||
#define DSP_WRITE (sbc_base + 0xC00)
|
||||
#define DSP_COMMAND (sbc_base + 0xC00)
|
||||
#define DSP_STATUS (sbc_base + 0xC00)
|
||||
#define DSP_DATA_AVAIL (sbc_base + 0xE00)
|
||||
#define DSP_DATA_AVL16 (sbc_base + 0xF00)
|
||||
#define MIXER_ADDR (sbc_base + 0x400)
|
||||
#define MIXER_DATA (sbc_base + 0x500)
|
||||
#define OPL3_LEFT (sbc_base + 0x000)
|
||||
#define OPL3_RIGHT (sbc_base + 0x200)
|
||||
#define OPL3_BOTH (sbc_base + 0x800)
|
||||
#else
|
||||
#define DSP_RESET (sbc_base + 0x6)
|
||||
#define DSP_READ (sbc_base + 0xA)
|
||||
#define DSP_WRITE (sbc_base + 0xC)
|
||||
@ -19,6 +36,7 @@ extern int sbc_major, sbc_minor ;
|
||||
#define OPL3_LEFT (sbc_base + 0x0)
|
||||
#define OPL3_RIGHT (sbc_base + 0x2)
|
||||
#define OPL3_BOTH (sbc_base + 0x8)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DSP Commands. There are many, and in many cases they are used explicitly
|
||||
|
@ -25,6 +25,8 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -83,7 +85,11 @@
|
||||
|
||||
#define DMA_AUTOINIT 0x10 /* XXX never used */
|
||||
|
||||
#ifdef PC98
|
||||
#define FM_MONO 0x28d2
|
||||
#else
|
||||
#define FM_MONO 0x388 /* This is the I/O address used by AdLib */
|
||||
#endif
|
||||
|
||||
#ifndef AWE32_BASE
|
||||
#define AWE32_BASE 0x620 /* Default = 0x620-3, 0xA20-3, 0xE20-3 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user