Re: [AD] Patch for fixed bugs with Soundscape DOS driver

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sat, Jun 24, 2000 at 04:39:48PM +0200, Angelo Mottola wrote (reformatted):
> I finally had the time to reinstall DOS/Windows and to fix a problem I
> always noticed. With Allegro WIPs, the Soundscape DOS sound driver didn't
> work anymore (it was even failing detection), while with Allegro 3.12
> compiled on the same platform, no error occured. So I compared the old and
> the new code, and I found a really strange bug: the WIP uses outportb()
> and inportb() functions for ports I/O, while the old Allegro 3.12 uses
> inp() and outp(). I've always believed they are equivalent, but eventually
> I was wrong... After a bit of hacks, I discovered the problem was there,
> and changing all occurencies of them back to inp() and outp() made it to
> work! I've also found another small bug in the IRQ handler, that was
> making the sound output a bit distorted, and I've fixed it too.

I'm not sure that this is an OK change to make, but I'm applying
it anyway because it looks harmless, and (at least for you) does
fix the driver. :)  The problem is that someone obviously
changed them in the other direction, and I'm not sure why.  The
rest of Allegro seems to use `outportb' and `inportb' (and
`outportw' and `inportw'), and in `include/allegro/alwatcom.h'
there are even #defined aliases, because that platform doesn't
have these functions.  It does have `outp' and `inp', though, so
your code should be OK there too -- it's just messy to have two
different functions being used, and I'm not convinced that
there's a difference.  One possible problem is that the order of
parameters in `outportb' is different to that in `inp', but
surely if that were the case, the rest of the library would fail
horribly.

Anyway, as I said, I'm applying the patch because it seems
harmless, but I don't like putting too much trust in magic
solutions. :)

> Here's the patch; I hope it comes in time for WIP 3.9.33!!

There are about 10 patches left to apply, which are waiting for
people to reply to emails I've sent them now.

BTW, it's much better if you submit patches in unified (-u) or
context (-c) format.  The default output from `diff' gives no
context, it just lists the changed lines, and this means we have
to apply the patch by hand if someone else has modified the same
file, even if your changes don't clash.

For recursive diffs:

    diff -urN allegro.old allegro > mypatch.diff

For single files:

    diff -u file.old file > file.diff

Even in single file diffs, it's helpful if you include the path
to the file:

    diff -u allegro/src/dos/sndscape.c.old allegro/src/dos/sndscape.c > sndscape.c.diff

because then we can see this exact path by looking at the patch,
and can apply it using `-p 1' just like with recursive diffs.
If you don't do this, we have to cd to the directory containing
the file before applying the patch.  Not such a big problem, but
it got tedious going through all those patches this weekend, so
I noticed it. :)

George

-- 
Random project update:
22/06/2000: AllegroGL documentation:  http://allegrogl.sourceforge.net/
        See under `Documentation' for the AllegroGL Reference Manual in
	various formats.



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/