VOGONS


First post, by LABS

User metadata
Rank Member
Rank
Member

Hello there!

I'm currently working on a Sound Blaster 2.0-compatible ISA card based on Atmega MCU. My goal is to completely implement original SB's playback functionality using modern, available and better sounding parts (like DAC, op-amps, film capacitors, etc). I only keep genuine YM3812 FM synth and its DAC YM3014B. As with SB2.0, the card supports 8-bit mono PCM and ADPCM 1:2/1:3/1:4 playback in all modes (direct, single-cycle DMA, auto-init DMA, high-speed single-cycle and auto-init), OPL2 FM synth on real YM3812 sound chip, ALL playback-related DSP commands (even rarely used ones) to maximize compatibility with software that use the card for playback. However the card does NOT support sound recording and MIDI I/O (who needs that really?).

I chose Sound Blaster 2.0 because it is so much fun to implement it completely (the playback part) in hardware and software with all DSP commands, run the game like Gabriel Knight or Full Throttle and watch how it is detected and hear how it works... 🤣 And SB 8-bit card can be built on Atmega328P MCU which I'm familiar with. SB Pro is 8-bit as well, but the mixer chip is a pain to implement, but without it the playback functionality will not be full. If I will ever take the challenge - then it will be SB16 anyway 😎

The Adlib part is already finished as a prototype (see pics) and is autodetected by software. DOS games on Pentium 166 MMX plays music perfectly.. 😎 but without sound effects yet. OPL2 was an easy part as it replicates Adlib, but the DAC part is more tricky, as there are no schematics available and I do not have a Sound Blaster card for research. The only source of information is SoundBlaster Programmer's Manual, with all DSP commands described. So it took some time to sythesize inner workings of the card based on that manual and some example code. Nevertheless, the hardware part for DAC is already completed on paper, now I'm finishing software and soon will make a prototype. After finishing and debugging the prototype I will order some factory-made PCBs to make everything look good.

But there is one thing left unresolved - IRQ signal from OPL2. Does anybody know if pin 2 of YM3812 in SB card is connected to anything or not? Does it produce interrupt? If yes - what about IRQ sharing between DAC and OPL2? In Adlib the OPL2 does produce an interrupt and this is how the card is detected as Adlib. What with SB? Visually tried to trace SB PCB's photos found on the net, but with no luck. Looks like it is left unconnected, but not sure. Does anybody know exactly, please?

EDIT: Solved by cyclone3d:

Just looked at my CT1320C and CT1350B and pin 2 of the YM3812 is not connected to anything.

And if anyone knows any bugs in SB 1.0/1.5/2.0 - series of cards which are used as programming tricks, please let me know, so I could implement them as well)))

Thank you!

Attachments

  • IMG_20180607_214105.jpg
    Filename
    IMG_20180607_214105.jpg
    File size
    358.37 KiB
    Views
    3588 views
    File license
    Fair use/fair dealing exception
  • IMG_20180607_214037.jpg
    Filename
    IMG_20180607_214037.jpg
    File size
    341.34 KiB
    Views
    3588 views
    File license
    Fair use/fair dealing exception
Last edited by LABS on 2018-06-08, 09:22. Edited 3 times in total.

Blasterboard: DIY SB2-compatible sound card on ATmega MCU
Sonic Buster 8: New 8-bit ISA sound card

Reply 1 of 37, by cyclone3d

User metadata
Rank l33t++
Rank
l33t++

Cool project!

Just looked at my CT1320C and CT1350B and pin 2 of the YM3812 is not connected to anything.

Yamaha modified setupds and drivers
Yamaha XG repository
YMF7x4 Guide
Aopen AW744L II SB-LINK

Reply 2 of 37, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Cool project! 😁

LABS wrote:

ALL playback-related DSP commands (even rarely used ones) to maximize compatibility with software that use the card for playback.

Also the Thunder Board DSP commands ? 😉
Thunderboard was a decent SB 1.x/2.0 clone, but also had few extra DSP commands.
Nothing spectacluar, but if you like to add them, here's the SDK.
https://github.com/joncampbell123/doslib/issues/8

(The ThunderBoard chipset was also found on the Medis Vision PAS16, the Logiitech SoundMan 16 and the Protak card.)

Edit: Also check out this thread about SB 1.x/SB2.0 analgue mixing (OPL2/DAC audio level balance)..:
FM and PCM Volume Balance of SB Cards

Edit: Edited and typos fixed.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 4 of 37, by LABS

User metadata
Rank Member
Rank
Member
cyclone3d wrote:

Cool project!

Just looked at my CT1320C and CT1350B and pin 2 of the YM3812 is not connected to anything.

Ufff... Thank you, cyclone3d! Well, the digital part is done then))

Jo22 wrote:
Also the Thunder Board DSP commands ? ;) Thunderboard was a decent SB 1.x/2.0 clone, but also had few extra DSP commands. Nothin […]
Show full quote

Also the Thunder Board DSP commands ? 😉
Thunderboard was a decent SB 1.x/2.0 clone, but also had few extra DSP commands.
Nothing spectacluar, but if you like to add them, here's the SDK.
https://github.com/joncampbell123/doslib/issues/8

(The ThunderBoard chipset was also found on the Medis Vision PAS16, the Logiitech SoundMan 16 and the Protak card.)

Edit: Also check out this thread about SB 1.x/SB2.0 analgue mixing (OPL2/DAC audio level balance)..:
viewtopic.php?f=62&t=49683

Thanks for your input, Jo22! Making the card also PAS-compatible...got to think about it) Great post on OPL2/DAC level balance by the way. I just added simple 2-channel analog mixer to the output circuit to manually control the levels of DAC and OPL2, just 2 pots instead of 1 on ISA bracket. I think this the most flexible and simple way to control the balance.

Thanks everyone, will keep you informed about the progress 😀

Blasterboard: DIY SB2-compatible sound card on ATmega MCU
Sonic Buster 8: New 8-bit ISA sound card

Reply 5 of 37, by keropi

User metadata
Rank l33t++
Rank
l33t++

this is very interesting - I will keep my eye on it! great job LABS!

🎵 🎧 PCMIDI MPU , OrpheusII , Action Rewind , Megacard and 🎶GoldLib soundcard website

Reply 6 of 37, by 640K!enough

User metadata
Rank Oldbie
Rank
Oldbie

If I'm not mistaken, the original Ad Lib card didn't make use of the interrupt pin. The officially-documented detection method involved setting an OPL2 timer, then polling the status register to see if the timer had expired. The MSC was a relatively simple design.

Reply 7 of 37, by Jo22

User metadata
Rank l33t++
Rank
l33t++
LABS wrote:

Thanks for your input, Jo22! Making the card also PAS-compatible...got to think about it) Great post on OPL2/DAC level balance by the way. I just added simple 2-channel analog mixer to the output circuit to manually control the levels of DAC and OPL2, just 2 pots instead of 1 on ISA bracket. I think this the most flexible and simple way to control the balance.

Glad to hear! ^^ The PAS16 had it's own, native DAC, TB was fully independed and could be disabled (or used simultanously with PAS native DAC).
ThunderBoard detection was done by sending the SB DSP version retrival command twice (to avoid compatibility issues with SB titles).
- Interestingly, some games like Knights of Xentar claimed to support the PAS16, but in reality used OPL3+TB DAC.
Which meant it also worked in stereo with the SB16 inofficially..
Your approach with the 2 pots is a fine idea, I think. That way, someone could adjust the balance as needed.
I'm speaking under correction, but some later games might use a different balance level, if developed on later hardware.
If we can help you with testing, just say so. ^^

640K!enough wrote:

If I'm not mistaken, the original Ad Lib card didn't make use of the interrupt pin. The officially-documented detection method involved setting an OPL2 timer, then polling the status register to see if the timer had expired. The MSC was a relatively simple design.

I believe that's right. The YM3812's timers/ports we're readable and a delayed response was used to figure out presence of AdLib.
Anyway, I'm just a user. I've never written such detection codes myself and speaking under correction. 😅

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 8 of 37, by Tiido

User metadata
Rank l33t
Rank
l33t

Real Adlib actually has IRQ almost ready for use, it just lacks the pin header (from factory) that actually connects IRQ output to ISA (though a buffer). I'm not aware of any sound card connecting the YM IRQ to ISA except YMF711/715/718/719 cards if the software configures the chip right.

T-04YBSC, a new YMF71x based sound card & Official VOGONS thread about it
Newly made 4MB 60ns 30pin SIMMs ~
mida sa loed ? nagunii aru ei saa 😜

Reply 9 of 37, by 640K!enough

User metadata
Rank Oldbie
Rank
Oldbie
Tiido wrote:

I'm not aware of any sound card connecting the YM IRQ to ISA except YMF711/715/718/719 cards if the software configures the chip right.

The Ad Lib Gold did, indirectly via the control chip.

Did the Media Vision cards not do something similar?

Reply 10 of 37, by LABS

User metadata
Rank Member
Rank
Member
640K!enough wrote:

If I'm not mistaken, the original Ad Lib card didn't make use of the interrupt pin. The officially-documented detection method involved setting an OPL2 timer, then polling the status register to see if the timer had expired. The MSC was a relatively simple design.

Yes, guys, you are right. I was misleaded by an "exact 😎 " Adlib-replica schematics, which actually utilizes connection of IRQ pin to ISA IRQ5 and IRQ7 via selection jumper) - a real Adlib did not use IRQ pin at all. Which is strange, because you just get 2 extra timers with it. Sorry for that.

I looked thru Thunder Board Programmer's Reference (which is much better written than Sound Blaster's) after Jo22's advice and found only 3 functional commands of interest - 0x1E (2bit ADPCM auto-init output w/o reference byte), 0x7E (for 3bit ADPCM), 0x7C (for 4bit). These are easy to implement as well as extension to 0xE1 and diagnostic 0xF2/0xF8. Can't see any reason not to include them, so TB's compatibility will also be there.

For more compatibility I also decided to include all recording commands in all modes (including TB's ADPCM ones), but they will return silence.

Can anyone advice any game or app which use high-speed DMA output mode of SB DSP 2.01? Thanks.

Blasterboard: DIY SB2-compatible sound card on ATmega MCU
Sonic Buster 8: New 8-bit ISA sound card

Reply 12 of 37, by root42

User metadata
Rank l33t
Rank
l33t

Me too. I already have my AdLib clones, so a DIY SoundBlaster would be the next welcome upgrade!

YouTube and Bonus
80486DX@33 MHz, 16 MiB RAM, Tseng ET4000 1 MiB, SnarkBarker & GUSar Lite, PC MIDI Card+X2+SC55+MT32, OSSC

Reply 13 of 37, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Me, too. I really like the design of LABS' prototype (visually has a bit of that charming 60's/70's flair).
It's true to the tradition of the do-it-youself scene (PCB looks like a precious vintage item to me),
despite beeing very clean looking at the same time (soldered traces, lots of surface for ground).

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 14 of 37, by LABS

User metadata
Rank Member
Rank
Member

Recently I started to assemble the DAC part on a breadboard (I know it looks messy). The digital part has 13 ICs in total - MCU, DAC, 2x registers, 1x buffer, 2x D-triggers, and the rest used for address decoding and internal logic. I made wire harness to connect it with Adlib part. First thing to do was to assemble address decoding and control logic and to test Adlib playback again, but this time already "being soundblaster". Unfortunately the resistance of a schematic assembled this way (breadboard+wire harness+dry contacts everywhere), was so high, that ISA supply voltage dropped to 3.8V, which is unacceptable. I tried to connect it to extra +5 supply, taken from IDE HDD power connector. Now it was around 4.5V (acceptable minimum), but was very unstable, sometimes dropped to 4.2 and raised to 4.6. Anyway Adlib was detected and I ran Heretic to test the music. It was playing but some OPL2 commands were lost during playback - some notes were missing and some just hanging. It is understood, that assembling more will make things even worse.
I am suprised, that 250W AT PSU cannot provide enough current to drive this kind of load, but anyway my breadboard experiments are not the way to go. Now I need to create a normal PCB for the DAC part and connect it to OPL2 part using the shortest possible wires. It will take 2-3 days.

Will inform you about my progress and thanks a lot for your interest and support! 😀

Attachments

  • sb2_breadboard.jpg
    Filename
    sb2_breadboard.jpg
    File size
    1.17 MiB
    Views
    3329 views
    File license
    Fair use/fair dealing exception

Blasterboard: DIY SB2-compatible sound card on ATmega MCU
Sonic Buster 8: New 8-bit ISA sound card

Reply 15 of 37, by LABS

User metadata
Rank Member
Rank
Member

Can anyone suggest any game or other app for DOS which uses high-speed DMA transfer mode of Sound Blaster 2.0 (23kHz - 44.1kHz / 8-bit PCM)? Thanks.

PCB for the DAC part is in progress:

Attachments

  • pcb_scr.jpg
    Filename
    pcb_scr.jpg
    File size
    198 KiB
    Views
    3248 views
    File license
    Fair use/fair dealing exception
  • pcb_print.jpg
    Filename
    pcb_print.jpg
    File size
    177.06 KiB
    Views
    3248 views
    File license
    Fair use/fair dealing exception
  • pcb1.jpg
    Filename
    pcb1.jpg
    File size
    167.85 KiB
    Views
    3248 views
    File license
    Fair use/fair dealing exception

Blasterboard: DIY SB2-compatible sound card on ATmega MCU
Sonic Buster 8: New 8-bit ISA sound card

Reply 16 of 37, by Jo22

User metadata
Rank l33t++
Rank
l33t++
LABS wrote:

Can anyone suggest any game or other app for DOS which uses high-speed DMA transfer mode of Sound Blaster 2.0 (23kHz - 44.1kHz / 8-bit PCM)?

Well, I would if if I knew. As a wild guess, I'd say SB 2.0 driver or TB driver on Windows 3.1 if an app (a game, MOD4WIN, etc) is using 22KHz or 44KHz sampling rate.
Or games like Jill of Jungle, Jazz Jackrabbit, Epic Pinball (highest audio settings for SB) *might* use such a transfer mode. Not sure, though.
Sorry, that's all that's comes to mind. I'm more of a tinkerer than a gamer, I'm afraid. 😅

Edit: Forgot to mention the demoscene.. 8088 Corruption required a SB card with DMA Auto-Init, I recall.
Maybe there are others that do utilize more exotic Sound Blaster commands, too.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 17 of 37, by matze79

User metadata
Rank l33t
Rank
l33t

if you get this done, did you ever mind to work together with dreamblaster to add the DAC Part to his OPL2LPT Device
Happy Hacking 😀 A Nice Project!

https://www.retrokits.de - blog, retro projects, hdd clicker, diy soundcards etc
https://www.retroianer.de - german retro computer board

Reply 18 of 37, by root42

User metadata
Rank l33t
Rank
l33t
matze79 wrote:

if you get this done, did you ever mind to work together with dreamblaster to add the DAC Part to his OPL2LPT Device
Happy Hacking 😀 A Nice Project!

I think it would be the other way around. DMA via the LPT will be a bit difficult, especially on older machines.

YouTube and Bonus
80486DX@33 MHz, 16 MiB RAM, Tseng ET4000 1 MiB, SnarkBarker & GUSar Lite, PC MIDI Card+X2+SC55+MT32, OSSC

Reply 19 of 37, by 640K!enough

User metadata
Rank Oldbie
Rank
Oldbie
root42 wrote:

I think it would be the other way around. DMA via the LPT will be a bit difficult, especially on older machines.

Direct DMA transfers to audio hardware via the parallel port would be just about impossible; the parallel port and ISA bus are quite different. The DMA functionality would have to be accomplished with assistance from the software TSR that they have. It has been done before, and can be made to work; it would just depend on whether dreamblaster and LABS consider it a worthwhile collaboration effort, and whether this ends up being the least expensive way for dreamblaster to deliver such a product.