VOGONS


Reply 20 of 22, by digger

User metadata
Rank Oldbie
Rank
Oldbie

It would be a nice improvement if TLPTINT could be enhanced to fetch the I/O address of the parallel port(s) from the BIOS Data Area. (And in addition to that, a command-line argument for an optional port numbe, so 1 for the default LPT1, 2 for LPT2, etc.)

Indeed, on IBM PC and compatibles, the printer ports are almost always at 378h, 278h, and/or 3bch.

But on more modern PCs with PCI Express slots, all the I/O addresses below 1024 are privileged and PCIe cards cannot utilize those. So if you plug in a parallel port PCIe card, it will be reachable at a higher (non-standard) I/O base address.

With the help of a utility like PRTADD, the I/O base address of many PCI and PCIe cards can automatically be registered in the BIOS Data Area (BDA), which is the "proper" source from which applications should fetch the I/O base address of the LPT devices.

If TLPTINT is improved to query the BDA first and then fall back to the hard-coded legacy addresses if it doesn't find any LPT devices registered there, it could be made to work on newer machines (and non-standard) machines as well.

Unfortunately, to my knowledge, there is no way to dynamically obtain the IRQ of the parallel port(s) from the BDA. But most parallel port sound devices (TNDLPT, OPL2LPT, Covox, DSS) don't use the IRQ of the parallel port anyway.

So with this improvement to the TSR, combined with the "CD C0" patch, you'd enable a reasonable level of hardware abstraction when it comes to supporting Tandy sound on more modern hardware. 🙂

Reply 21 of 22, by carlostex

User metadata
Rank l33t
Rank
l33t

I also thought about passing an argument to the TSR but that wasn’t a priority. I might upgrade the current interrupt handler which is actually called INTLPT instead, had to go check, but I won’t make any promises. Honestly patching the current handler for other ports is so trivial that I never bothered, it is pretty much having the same handler patched for the remaining port options 278h and 3BCh which was used in early IBM PC clones.

Reply 22 of 22, by digger

User metadata
Rank Oldbie
Rank
Oldbie

Do you have the INTLPT sources on GitHub somewhere? Couldn't find it with a Google search. Happy to contribute. Thanks!