Reply 60 of 63, by carlostex
- Rank
- l33t
This card has potential to be useful as a poor man's AdLib Gold regarding compatibility, but that would require work on AIL/16, AIL/32 and DIGPAK drivers. I had a thought about this today so i took a look into the AIL/16 source code, DMASOUND.ASM is the assembly source for the digital playback drivers.
ELSEIFDEF ADLIBG ;Ad Lib Gold access routines must ;preserve DS,SI,DI! […]
ELSEIFDEF ADLIBG ;Ad Lib Gold access routines must
;preserve DS,SI,DI!;****************************************************************************
IO_wait PROC
mov cx,500
mov dx,CTRL_ADDR
__wait: in al,dx
and al,01000000b
loopnz __wait
ret
ENDP;****************************************************************************
enable_ctrl PROC RegNum ;Enable access to control chip
mov dx,CTRL_ADDR
mov al,0ffh
out dx,al
ret
ENDP;****************************************************************************
disable_ctrl PROC RegNum ;Disable access to control chip
call IO_wait
mov dx,CTRL_ADDR
mov al,0feh
out dx,al
ret
ENDP;****************************************************************************
get_ctrl_reg PROC RegNum ;Get control chip register value
call IO_wait
mov dx,CTRL_ADDR
mov ax,[RegNum]
out dx,al
call IO_wait
mov dx,CTRL_DATA
in al,dx
ret
ENDP;****************************************************************************
set_ctrl_reg PROC RegNum,Val ;Set control chip register value
call IO_wait
mov dx,CTRL_ADDR
mov ax,[RegNum]
out dx,al
call IO_wait
mov dx,CTRL_DATA
mov ax,[Val]
out dx,al
ret
ENDP;****************************************************************************
MMA_wait PROC ;Wait at least 470 nsec.
mov cx,100
__kill_time: jmp $+2
loop __kill_time
ret
ENDP;****************************************************************************
MMA_write PROC Chan,Reg,Val ;Write byte to MMA register
mov ax,[Reg]
mov dx,DSP_ADDR
out dx,al
call MMA_wait
mov dx,[Chan]
shl dx,1
add dx,DSP_DATA
mov ax,[Val]
out dx,al
call MMA_wait
ret
ENDPENDIF
;****************************************************************************
reset_DSP PROC ;Returns AX=0 if failure
USES ds,si,diIFDEF PAS
mov ax,1
ELSEIFDEF ADLIBG
call MMA_write C,0,9,10000000b
call MMA_write C,0,9,01110110bcall MMA_write C,1,9,10000000b
call MMA_write C,1,9,01110110bmov ax,01110110b
mov PRC_0_shadow,ax
mov ax,1
I have no experience with sound drivers, and very little ASM experience, but by just taking a look it is quite obvious that: "No GOLD CTRL chip, no AdLib Gold". However, it seems this 2themax card has the Yamaha MMA at the required 38Ch port, but failing to go through the GOLD CTRL will prevent any sound attempted out of the MMA chip. So basically i was wondering if this driver could be manipulated to remove any GOLD CTRL dependencies, thus enabling this sound card to playback AdLib Gold stuff. The XMIDI driver probably needs dependencies removed too.
The AdLib Gold seems to have a lot of game support through middleware sound libraries, so this card has potential to be a little more useful.
Any code gurus around? Thoughts on this?