From: Ed Carp (erc@unislc.uucp)
Date: 01/29/93


From: erc@unislc.uucp (Ed Carp)
Subject: [PATCH] dosemu-0.4.7 patch for BigMouth voice mail card
Date: Fri, 29 Jan 1993 09:41:51 GMT

Here's a patch to allow the BigMouth voice mail card to work under the
dosemu-0.4.7 emulator.

Please note that if you are running uucp on the same port for dialout, it
will conflict with the voice mail card when it tries to dial out. There
probably needs to be a LCK file created - I've done this for my copy of
the emulator, but Robert probably doesn't want to include it in the release
version, since it's rather ugly - one needs to know what ports are being used
for dialout, etc., and there's no easy way to know which phone line the
BigMouth card is hooked up to.

Also, please note that you might want to put a nice() call in dos.c to up
the priority of the emulator, so that the ports get serviced quickly enough -
why TTI didn't make the card interrupt-driven, I'll never know... :(
The BigMouth software (version 3.10) that I have tends to eat up a lot of
CPU time, since it's essentially polling the I/O port as fast as it can,
and the speech tends to be broken unless the process is nice'd.

This patch should be similar for other I/O devices (like The Complete
Communicator, etc.) that you'd want to use.

Apply with "patch -p1 < file", as usual...
================================= cut here ===================================
*** dosemu47/emu.c Wed Jan 27 19:36:58 1993
--- dosemu-0.4.7/emu.c Fri Jan 29 01:51:08 1993
***************
*** 722,727 ****
--- 723,735 ----
        else
          switch (port)
            {
+ case 0x3e0: /* BigMouth card I/O */
+ case 0x3e1:
+ case 0x3e2:
+ tmp = port_in(port);
+ /* dbug_printf("inb from port 0x%x: 0x%x\n", port, tmp); */
+ return(tmp);
+ break;
            case 0x61:
              dbug_printf("inb from port 0x61: 0x%x\n", port61);
              if (inb_flg) { port61++; inb_flg=0; }
***************
*** 796,802 ****
    port &= 0xffff;
    byte &= 0xff;
  
! dbug_printf("outb [0x%x] 0x%x ", port, byte);
    if ((port == 0x60) || (port == 0x64)) dbug_printf("keyboard outb\n");
    else if (port == 0x61)
      {
--- 804,822 ----
    port &= 0xffff;
    byte &= 0xff;
  
! switch(port)
! {
! case 0x3e0: /* BigMouth card I/O */
! case 0x3e1:
! case 0x3e2:
! /* dbug_printf("outb to port 0x%x: 0x%x\n", port, byte); */
! port_out(byte, port);
! return;
! break;
! default:
! dbug_printf("outb [0x%x] 0x%x ", port, byte);
! break;
! }
    if ((port == 0x60) || (port == 0x64)) dbug_printf("keyboard outb\n");
    else if (port == 0x61)
      {
***************
*** 951,956 ****
--- 971,985 ----
          }
        }
        disk_close();
+ /*
+ * We do the ioperm() call here, rather than on each I/O, because
+ * otherwise, it's too slow.
+ */
+ if(ioperm(0x3e0, 3, 1))
+ {
+ dbug_printf("ERROR: can't get i/o perms for BigMouth card!\n");
+ leavedos(1);
+ }
        _regs.eax = _regs.ebx = _regs.edx = 0;
        _regs.ecx = 0;
        _regs.ebp = _regs.esi = _regs.edi = _regs.esp = 0;

-- 
Ed Carp                 erc@apple.com, erc@saturn.upl.com       801/538-0177

"It is your resistance to 'what is' that causes your suffering." -- Buddha