============================================================================
dqbdatafix.zip - Patch for DQBunpackSound (in DirectQB 1.61)
============================================================================
by Plasma / Jon Petrosky  [05-13-04]
www.phatcode.net


At the request of Hexadecimal Disaster, I have fixed the bug in the
DQBunpackSound function. :)

I actually found two bugs; the first was in Angelo's DQB encoder program
(DQBENC.BAS). The encoder program was storing the entire wave file in the
datafile, instead of just the raw sound data. I modified the program to
strip the wave header and any other non-wave RIFF chunks.

The second bug was, of course, in the DQBunpackSound function...it was
reading the wave size backwards. The size is stored as a 32-bit long int in
the file, but the maximum wave size is 64K. Therefore, the 16 high bits are
always zero. When this is reversed, the 16 low bits become zero. Since DQB
internally stores the length as a 16-bit int, it always thinks the length is
0, and the sound never gets played. I fixed this and reassembled the
datafile module.

To use this fix, simply copy all the files in this zip over to your DQB
directory, overwriting any existing files. Then run the DQB Library manager
(DQBMAN.BAS). Remove the datafile module and build the library. Then run
the library manager again, this time adding the datafile module. (To force
DQB to update the library.)
