Open joncampbell123 opened 5 years ago
I just pulled the card out of the box to examine it.
Apart from the C-Bus form, the chips on the board look just like any other Creative product.
From visual examination, despite different I/O port numbers, it provides a Creative DSP chip, mixer, and OPL3 FM.
The board ALSO provides a YM2203 for existing PC-98 games.
As another happy find, the second circuitboard attached to it on the top is the Wave Blaster card! Never seen one before. I wonder if I could disconnect it from the C-Bus version and attach it to the IBM PC versions I have that still have the Wave Blaster card pin header.
The card has a copyright date of 1993.
Just plugged it into a PC-9801FA. Using DEBUG.EXE I can confirm it responds to I/O port 20D2h.
Poking at it, it's fairly obvious the I/O port scheme used by Creative here is XXD2h.
20D2h-2FD2h appear to be the main Sound Blaster I/O port group. They function exactly the same as I/O ports 220h-22Fh do on the IBM PC versions of the Sound Blaster 16.
Not sure yet what 80D2h and C8D2h are.
80D2h, 81D2h appear to be the MPU-401 of the card.
On this particular card the Wave Blaster is attached, so according to documentation the Wave Blaster will receive MIDI output and render it.
C8D2h, C9D2h appears to be the OPL3 FM chip.
The card is also responding to 188h, which is the traditional I/O port base of the OPNA FM chip usually provided by the FM card. However it does NOT respond to port 88h, which means games written against the older FM card (the -26) will not work.
The similarity in function (despite the different I/O ports) means that DOSBox-X can easily adapt to emulate PC-98 Sound Blaster 16 by attaching to different I/O ports.
However SB16 emulation cannot emulate the fact that the card also has an OPNA, because that would conflict with the existing options for FM board emulation. It won't be 100% realistic that way.
I do not know of any PC-98 games that will talk to SB16, except (I think) the PC-98 ports of Doom and Wolfenstein 3D.
I doubt the card supports Plug & Play, since (as far as I know) C-bus didn't implement the Plug & Play protocol that the IBM PC platform did. The dip switches on the card are another clue that PnP is not supported. It also means that unlike the IBM PC version, the PC-98 version may not support reconfiguration of IRQ and DMA resources through mixer byte 80h-81h either. It may not exist, or may be read only (as it is on IBM PC versions of the PnP cards).
There is indeed something at mixer registers 80h-81h.
80h: 0xF8 81h: 0x14
DMA and IRQ values are probably completely different from the IBM PC versions.
When I pull the hardware out again for testing, I need to see if the SB16 card also responds to E0D0h, E0D2h as normal MPU-401 hardware does.
EDIT: Another test is to see if the mixer bytes 80h-81h are writeable. If so, what do the values mean? The PC-98 port of DOOM will write these bytes at startup.
Proposed changes:
Add MPU-401 I/O port base option. In IBM PC mode, that will allow 300h or 330h. In PC-98 mode, that will allow E0D0h or 80D2h which says to use 80XXh where XX is the low 8 bits assigned by the SB16. The default will be E0D0h because that is where PC-98 games look for MIDI output, not 80D2h.
OPL3 emulation in PC-98 mode, if sbtype=sb16, will take I/O ports C8XXh, C9XXh where XX is the base I/O port taken by sbtype=sb16. [DONE]
Sound Blaster emulation sbbase will be modified to accept 220h, 230h, 240h, etc. in IBM PC mode and D2h, D4h, D6h, etc. in PC-98 mode. IBM PC I/O port bases will be translated to the PC-98 equivalent port internally if 220h, etc. are given in PC-98 mode (220h becomes 20D2h, 240h becomes 20D4h) etc. [DONE]
Based on the "screenshot" provided by the website, the BLASTER variable is still there as well.
In the example shown:
SET BLASTER=AD2 I5 D3
Ah, while we're on the subject of giving MPU-401 emulation the option to choose I/O port base...
I noticed that if DOOM cannot locate the MPU-401 as instructed, it will probe C0XXh to F8XXh in steps of 0800h, where XX is D0h then D2h. Interesting.
In fact PC-9801-118 had an OPL3 and a FM chip YMF288 which is OPNA compatible. However, there is almost no DOS games that can make use of 118 sound generator's OPL3.
@yksoft1 At what I/O port did the -118 map the OPL3?
PC-9801-118 is OPN3(OPNA compatible)+OPL3+CS4232+MIDI port I remember.
@yksoft1 At what I/O port did the -118 map the OPL3?
http://www.hi-ho.ne.jp/~y-exp/dustman/118b.htm
番外.YMF-297のOPL部は使えるか?
YMF-297はSOUND BLASTERで使われているOPL3部分を内蔵しています。 DOS上で実際に使えるかどうか。 I/O portは480hを使用しており、 またその部分はマスクされていないので環境変数で、 >SET BLASTER=A0480 I12 D3 T3 と指定すれば使えそうなのですが、 残念ながら私はSOUND BLASTERに対応したソフトを持ってません(^^;
https://www.vector.co.jp/soft/dos/hardware/se069794.html
A tool to initialize PC-9801-118 (PnP mode) under DOS. Inside the archive there is a 118board.doc that had some useful info for 118 card.
in non-PNP mode:
非PnPモードの場合 以下のリソースを消費する 本体1の場合 0480~0487 OPL 1480~148F MIDI IRQ3,5,6,10 MIDI(割り込み使用時のみ) 本体3の場合 0480~0487 OPL 1480~148F MIDI 0188~018E OPN3 IRQ3,5,6,10 MIDI(割り込み使用時のみ) IRQ3,10,12 OPN3 本体2,4,5の場合 0480~0487 OPL 1480~148F MIDI 0188~018E OPN3 A460~A461 WSS 0C24~0C25 WSS 0C2B~0C2C WSS 0C2D~0C2E WSS 0F40~0F4F WSS IRQ3,5,6,10 MIDI(割り込み使用時のみ) IRQ3,10,12 OPN3/WSS DMA0,3 WSS
@joncampbell123 Sound Blaster 16 (PC-98) diagnose program shows that both DMA channel 0 and 3 are "unavailable and might be occupied by other cards" on DOSBox-X PC-98 default settings.
The Sound Blaster 16 (PC-98) driver and utility can be downloaded from https://jp.creative.com/support/downloads/download.asp?MainCategory=1&nRegionFK=&nCountryFK=&nLanguageFK=&sOSName=Windows+3x®ion=2&Product_Name=Sound+Blaster+16&Product_ID=1842&modelnumber=&driverlang=1041&OS=19&drivertype=0&x=47&y=11
The SB16 Windows 3.1 driver complains that "MIDIPORT" value in system.ini [sndblst.drv] section was wrong and refuses to load.
DOSBox-X defaults to E0D0h for general MIDI emulation, not Sound Blaster specific MPU401 emulation.
Add to dosbox conf, the mpu401 section:
mpubase=80D2
And in the sblaster section
sbbase=D2
The low 8 bits of both must match.
General MPU-401 emulation on PC-98 has a base I/O of E0D0h, while the Sound Blaster MPU-401 has a base I/O port with the upper byte 80h and the lower byte matching the base I/O of the Sound Blaster.
In DOSBox-X the default base I/O is D2h, which puts the DSP and mixers at 20D2h to 2FD2h every 100h ports and the MPU-401 at 80D2h and another port.
PC-98 games from my testing are more likely to look for the MPU-401 at E0D0h than the Sound Blaster MPU-401 port.
However the SB16 Windows 3.1 driver seems to require SB16's own MIDI port to work.
Understood. You can set the MPU base to match what it would be for a SB16 card on PC-98 as described.
Good news: The DOSLIB now has a working build of SNDSB and DOSAMP for PC-98, if you have a Sound Blaster 16 card installed.
Despite the different I/O port, IRQ and DMA mapping, it acts exactly like a Sound Blaster 16 would on an IBM PC compatible platform. Right down to that bug on DSP 4.5 boards where specific narrow ranges of sample rate are incorrectly set to the PLL.
The "text GUI" program TEST.EXE in HW/SNDSB cannot be ported to PC-98 because the code there relies too heavily on IBM PC compatible CGA/EGA/VGA video memory layout and keyboard scan codes.
Another DOSLIB library given a PC-98 port is the Adlib OPL3 support library in HW/ADLIB, which now also works on the PC-98 Sound Blaster 16 board.
Again the "text GUI" in TEST.EXE for the Adlib library is heavily VGA dependent and cannot be ported to PC-98 yet.
IRQ and DMA mappings noted in DOSBox-X seem to match real hardware, though bits [7:2] of the DMA select register behave in a predictable but odd pattern (noted in DOSBox-X source code).
I cannot fully verify the IRQ settings because the particular PC-9821 I'm testing on is a newer unit with a PCI bus, and PCI-based Intel chipsets reserve certain IRQs for use with PCI devices and do not pass ISA (or in this case C-Bus) IRQ signals for those, so I was not able to verify anything other than the bit value for IRQ 10 is correct.
Not sure how similar the DSP or mixer interface is to the IBM PC Sound Blaster 16. Obviously it's not on the same I/O port range. According to some documentation, the card has a YM2203 instead of the usual OPL3. The YM2203 and Sound Blaster each have their own IRQ. So emulation of the full card would involve both enabling the FM card emulation and the adapted Sound Blaster emulation.
Not sure if easy or difficult.
Not sure if the I/O layout from 20D2h is simple and linear, considering that the I/O base is only 0002h apart.
Comments welcome.
I have a PC-9821 system and the C-bus version of the SB16 as reference hardware when development of this feature begins.
References:
http://radioc.web.fc2.com/column/pc98bas/ct2720.htm