UINT32_C Macro Considered Harmful

The C99 family of INTN_C and UINTN_C macros fills a real gap in the language, but it also lays extremely nasty traps for the unwary. The evolution of how the macros are defined in the C99 language standard shows that they were poorly defined from the beginning.

Consider code such as this:

unsigned x =  1024 / UINT32_C(1 << 8);

Depending on how the UINT32_C macro is implemented, the value of x might end up being 262144 or 4, or perhaps something different altogether.

That’s not how the macro is supposed to be used you say? That may be true, but why does the compiler not complain then? No error, not even a warning. Or were the language designers really so foolish as to expect every programmer to know the entire text of the Standard by heart? Say it ain’t so… Continue reading

Posted in C, Development | 2 Comments

Broken Spigot

While searching for an unrelated piece of hardware, I came across an old video capture board. Alarm bells started going off when I heard something rattling in the anti-static wrap.

Sure enough, one of the large capacitors fell off… because it had started leaking and corroded its own solder points as well as some of the surrounding components. Another capacitor only needed a gentle prod to fall off as well. The bad caps used to be C62 and C64. The third capacitor of the same type (C71) is still attached, but it may be beginning to leak as well and probably needs removing:

Damaged Spigot

So what exactly is this card? Let’s see.. Continue reading

Posted in Graphics, PC hardware, PC history | 3 Comments

44-Voice MIDI on Yamaha OPL4

In 1994, sound cards with wavetable synthesizers were all the rage. Typically these supported 24-voice or at most 32-voice polyphony. So 44-voice synthesis sounded fancy. The following text can be found in a README file in the driver package for the MediaTriX Audiotrix Pro sound card:

Now includes 44 voice MIDI compositions FIDLING.MID and TECNOVOX.MID by Gerard Jones and EUROMAN.MID by Henri Chalifour. Combined Wavetable/FM compositions expand General MIDI horizon into imaginative territory. Game developers and amateur musicians take note! Only the Jukebox for Windows is able to play these 44 voice compositions.

The Audiotrix Pro was based on Yamaha’s OPL4 synthesizer (YMF278B plus DAC). The OPL4 wavetable synthesizer supported 24-voice polyphony. That’s a lot less then 44. But the OPL4 also included the OPL3 core, which provided up to 20 voices using classic FM synthesis. 24 + 20 = 44.

The MIDI files mentioned above can actually be found in the Audiotrix driver package. Finding an Audiotrix Pro board is however a lot harder. What to do if you’d like to listen to the 44-voice MIDI files but don’t have an Audiotrix Pro and aren’t satisfied with existing MP3 recordings? Continue reading

Posted in MIDI, Sound | 5 Comments

Bad Month for Laptop Disks

Instead of writing new articles, I recently spent a lot of time fighting laptop hard disks going bad.

The first was a Seagate ST1000LM14 (apparently originally a Samsung design), a hybrid 1TB 5,400rpm disk with 8GB flash. The disk was installed in a Lenovo Z50-75 laptop and started failing after only about 7 or 8 months. The interesting thing is that the disk didn’t have bad sectors but rather CRC errors on the SATA interface during transfers.

The disk was set up for dual booting with Windows and Linux, each using close to 500GB. Linux (Ubuntu 14.04) could somewhat deal with the transfer errors by reducing the SATA transfer speed and retrying very hard. Windows 8.1 on the other hand wouldn’t even boot, couldn’t repair itself, and entirely failed to produce any kind of useful diagnostic. Boo. Continue reading

Posted in PC hardware | 5 Comments

Do You Know This Sound Card?

The guessing game is back, this time with a twist: I don’t know the correct answer. A generic-looking 1997 vintage sound card recently showed up:

Unknown OPTi 931/941 Card

This is what I call a high-end low-end card… it’s a standard low-end sound card, except it also includes a low-end wavetable synthesizer, which makes it a better class of a Made in China cheap card.

The board has more or less zero distinguishing marks. There is no FCC ID, no obvious model number, no manufacturer designation. A tiny ‘S6159′ near the ISA connector may or may not mean something. Continue reading

Posted in PC hardware, Sound | 11 Comments

Sound Blaster 1.0 or 1.5?

According to some sources, a Sound Blaster model CT-1320C is a Sound Blaster 1.5. But according to Creative’s own reference materials (which do contain many inaccuracies and cannot be taken as gospel), the only difference between a Sound Blaster 1.0 and a 1.5 is the presence of C/MS chips which provide Game Blaster compatibility.

For example this card is clearly a Sound Blaster 1.5:

CT1320C (SB 1.5)

Model CT-1320C, no C/MS chips, case closed. But what then is this one?

CT1320C (SB 1.0)

That’s another model CT-1320C, but with C/MS chips. According to Wikipedia, 1320C makes it a SB 1.5. According to Creative, C/MS chips make it a SB 1.0. How to tell who’s right and who’s wrong? Fortunately, there is a way. Continue reading

Posted in Creative Labs, PC hardware, PC history, Sound Blaster | 11 Comments

Intel 420TX Chipset

The OS/2 Museum recently obtained a somewhat unusual board: A 1993 vintage 486 PCI/ISA board equipped with the Intel 420TX chipset.

J-Bond PCI400C-AThe 420TX chipset, codenamed Saturn, was probably Intel’s first PCI chipset available to customers. It was probably first sold in 1992. The 420TX consisted of three chips. 82423TX and 82424TX together formed what would later be called a northbridge, and 82378IB was the southbridge.

Identifying the board took a little while but in the end wasn’t too difficult as it has several very unusual features. A Socket 2 486 board with PCI slots, onboard SCSI controller, but no onboard IDE or floppy—that is a rare sight indeed. Continue reading

Posted in 486, Intel, PC hardware, PCI | 17 Comments

Sound Blaster: The French Connection

Ever been wondering why there are chips labeled MHS on many Sound Blaster cards, and why there usually was some chip with a © Intel marking? For example this one, on a Sound Blaster 1.5 (1991):

DSP 2.00

Or this one, on a Sound Blaster Pro 2 (1994):

DSP 3.02

I was wondering the same… Continue reading

Posted in Intel, PC hardware, Sound Blaster | 14 Comments

Sound Blaster DIAGNOSE and Disabled MPU-401

Today I finally solved a nagging problem that always seemed like it had to have some sort of reasonable solution. Creative’s DIAGNOSE.EXE utility is quite useful when working with any Sound Blaster 16 derivatives (Sound Blaster 16, AWE32, Sound Blaster 32, AWE64). But there’s an annoying oddity related to the fact that many SB16-based cards have an MPUEN jumper which can disable the MPU-401 interface, typically accessible at port 330h. This jumper is very useful when a SB16 is combined with something like a Roland SCC-1 or a Turtle Beach Maui.

When the MPUEN jumper is set to disable the Sound Blaster’s MPU-401 interface, DIAGNOSE stops working:

DIAGNOSE MPU-401 Error This seems very unsatisfactory; the MPUEN jumper is well documented, so why would DIAGNOSE refuse working when the default setting is changed? After all, a user might not care for MPU-401 compatibility at all, or might have a system where ports 300h and 330h are already occupied by other hardware (SCSI HBAs, network cards) and needed to force the SB16’s MPU-401 to be disabled. Well, there is a solution… Continue reading

Posted in Creative Labs, Sound, Sound Blaster, Undocumented | 1 Comment

sips To the Rescue

A few days ago I scanned a document and unwisely used MS Paint on Windows 7 to touch up a small selection of the scanned pages. Once the dozen or so files were re-touched, I combined them into a PDF together with the untouched originals. Today I tried OCRing the resulting PDF in Acrobat Pro, only to be greeted with an error message complaining that “this page” cannot be processed because it’s larger than 45 x 45 inches.

By now I’m used to the fact that Acrobat Pro oscillates between really wonderful and amazingly shoddy, so I wasn’t surprised that there was not the slightest hint which of the 302 pages might be causing trouble.

After pinning down the troublemaking manually, it of course turned out to be one of the edited ones… and the problem was that MS Paint somehow butchered the DPI values stored in the file. Oops… Continue reading

Posted in Graphics, OS X | Leave a comment