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

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


Angelo Mottola <a.mottola@xxxxxxxxxx> writes:

> Have you tested if it still works for you with my patch applied? I've sent the patch to another guy via ICQ, that owns
> a SB 128 PCI, just to ensure if it works also for him now (before it wasn't working for him as for me). Hopefully I'll
> soon get a reply, and I'll let you know. If now it works for you and for us, I think we should make the changes
> permanent... What do you think?

I don't think we should replace inportb(outportb) kind of functions
with inp(outp) without understanding why they don't work for you.

There is almost no difference between inp(outp) and inportb(outportb).
inp(outp) just jumps to the inportb(outportb) and DJGPP usually uses
inline code for inportb(outportb).

There is one difference, inp(outp) are longer than inportb(outportb).
Instead of replacing inportb with inp, try to add delays after port
accesses, or look in your BIOS setup for ISA-bus speed option.  There
are some strange computers with non standard ISA-bus speed, where some
ISA-cards may work faster, but some cards just don't work correctly.

I'm using the following replacement for port access functions in my
own programs:

static void _tiny_delay (void)
{
  volatile int i;
  for (i = 0; i < 10; i++)
    ;
}

unsigned char
_my_inb (unsigned short port)
{
  unsigned char data = MY_INB (port);
  _tiny_delay ();
  return data;
}

...

MY_INB is a compatibility macro for different compilers.

-- 
Michael Bukin



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