VOGONS


OPL2LPT

Topic actions

Reply 100 of 514, by Scali

User metadata
Rank l33t
Rank
l33t
Jo22 wrote:

Thanks for the explanation! 😀
So I assume it's not possible to write a software-based TSR that uses polling method to monitor
a given i/o port and then sends a copy of that data to another location ?

Not without patching the software.
However, for the Tandy sound card we had a similar issue: software assumes the SN76489 chip is at address C0h. Problem is, that is not possible on any AT or newer system, since they have a second DMA controller at that address. So you configure the card to be at a different address, eg 1E0h (which is what later Tandys use for the same reason) or 2C0h.
The solution we created is quite simple:
Whenever software writes to the card, it uses the following instruction:
out C0h, al

We can find all occurences of that instruction, and replace them with:
int C0h

This instruction is the same size, and differs by only one byte.
Instead of writing to port C0h, it now calls the handler for interrupt C0h.
A simple TSR can install that C0h handler, and write whatever value is in the al-register to the correct address of the card.

OPL2 commands are slightly more complicated in nature, but the basic idea can probably also be applied to OPL2: just patch the proper out-instructions with int instructions, and use a TSR to write to the LPT.
This works on any CPU, 8088 or higher.

scalibq.wordpress.com/just-keeping-it-r ... ogramming/

Reply 101 of 514, by dreamblaster

User metadata
Rank Oldbie
Rank
Oldbie
konc wrote:

5?

hehe no, sorry
I gave E hint already
now I give a hextra hint

Visit www.serdashop.com for retro sound cards, video converters, ...
OPL2LPT, OPL3LPT, X2, S2, S2P, MCE2VGA, ... many projects !
Special vogons LPT bundle : https://www.serdashop.com/Parallel-port ... und-bundle
Thanks for your support !

Reply 102 of 514, by Malvineous

User metadata
Rank Oldbie
Rank
Oldbie
Jo22 wrote:

I believe there's at least one "USB to LPT" project that aims to provide a true parallel port.

Converter From USB To Parallel
https://www-user.tu-chemnitz.de/~heha/b ... C/USB2LPT/

You can get cheap USB to Parallel converters on eBay using the PL-2305 chipset which has been available for many years. This chipset has a special mode it can be switched into which allows pin-level control of most of the pins. Last I looked (5+ years ago) there were no drivers that did this, but all it needs is for someone to write one. It's probably the cheapest way to get a full Parallel port connected via USB.

dreamblaster wrote:

none of these
I give E hint

I take that to mean 14? What a shame I'm in Australia 😀

By the way, where are you sourcing the OPL chips and DACs from?

Reply 103 of 514, by dreamblaster

User metadata
Rank Oldbie
Rank
Oldbie
Malvineous wrote:

I take that to mean 14? What a shame I'm in Australia

Hehe yeah, you are right, but so sorry - only for EU - I'd love quick feedback.
Well no more guessing, first EU solderer that answers gets it.

Malvineous wrote:

By the way, where are you sourcing the OPL chips and DACs from?

https://www.utsource.net/

Visit www.serdashop.com for retro sound cards, video converters, ...
OPL2LPT, OPL3LPT, X2, S2, S2P, MCE2VGA, ... many projects !
Special vogons LPT bundle : https://www.serdashop.com/Parallel-port ... und-bundle
Thanks for your support !

Reply 105 of 514, by dreamblaster

User metadata
Rank Oldbie
Rank
Oldbie
killerclems wrote:

Im a french solderer 😉

hehe
and can you type quatorze in numbers ?
Then the kit is yours 😀
pm me your address, also

Visit www.serdashop.com for retro sound cards, video converters, ...
OPL2LPT, OPL3LPT, X2, S2, S2P, MCE2VGA, ... many projects !
Special vogons LPT bundle : https://www.serdashop.com/Parallel-port ... und-bundle
Thanks for your support !

Reply 107 of 514, by dreamblaster

User metadata
Rank Oldbie
Rank
Oldbie
killerclems wrote:

14 ! 😉

oh, we have a winner !
Send me a pm with your shipping address, i will send you an opl2lpt KIT right away.

Visit www.serdashop.com for retro sound cards, video converters, ...
OPL2LPT, OPL3LPT, X2, S2, S2P, MCE2VGA, ... many projects !
Special vogons LPT bundle : https://www.serdashop.com/Parallel-port ... und-bundle
Thanks for your support !

Reply 108 of 514, by dreamblaster

User metadata
Rank Oldbie
Rank
Oldbie

Okay
I uploaded the soldering instructions and DOS utilities here : serdaco.com/downloads/OPL2LPT/

Visit www.serdashop.com for retro sound cards, video converters, ...
OPL2LPT, OPL3LPT, X2, S2, S2P, MCE2VGA, ... many projects !
Special vogons LPT bundle : https://www.serdashop.com/Parallel-port ... und-bundle
Thanks for your support !

Reply 109 of 514, by matze79

User metadata
Rank Oldbie
Rank
Oldbie

hehe today i will build your device,
does the tsr work together with win 3.x adlib driver ? 😁

btw. where the hell can i purchase OPL2 IC's ? looking for ages to build a adlib isa clone 😳

https://dosreloaded.de - The German Retro DOS PC Community
https://www.retroianer.de - under constructing since ever

Reply 110 of 514, by Scali

User metadata
Rank l33t
Rank
l33t
matze79 wrote:

btw. where the hell can i purchase OPL2 IC's ?

https://www.utsource.net/itm/p/816077.html
https://www.utsource.net/itm/p/1714079.html (the DAC you need, YM3812 only outputs digital audio)

scalibq.wordpress.com/just-keeping-it-r ... ogramming/

Reply 111 of 514, by matze79

User metadata
Rank Oldbie
Rank
Oldbie

Thanks Scali 😁

I build it 😀 and it actually works very well.
The 386SX 33Mhz Laptop is a bit too slow for running wolf3d with lpt adlib 😀

Windows 3.x does not work with the Adlib Driver 😒 maybe there is some driver in place which also access lpt ?

Merci beaucoup 😀

i really enjoy this!

Can you tell me what the TSR exactly does ?
Some Games can be patched to work native with LPT2OPL..
Maybe Wolfenstein 3D, its source is avaible as far as i remember 😁

https://dosreloaded.de - The German Retro DOS PC Community
https://www.retroianer.de - under constructing since ever

Reply 112 of 514, by pdw

User metadata
Rank Newbie
Rank
Newbie

Lots of questions 😀

Technique: The TSR uses the "I/O port virtualization" feature of EMM386 & QEMM. This allows a TSR to emulate I/O port accesses. I don't know why this feature was originally designed but it's exactly what's needed to emulate an Adlib card. For programming information, see here (yeah, there's minimal documentation online).

Performance: This emulation does come with a cost. Unfortunately this is pretty much all EMM386 overhead, so there's little that can be done. One possibility is using JEMM, an alternative to EMM386 that's quite a bit faster. This should help games which play almost-but-not-quite fast enough when using EMM386. A version of the TSR that works with JEMM is nearly done.

Windows support: I think the TSR might work with Windows 3.x if you run Windows in "Standard Mode" (i.e. 286-compatible mode) using the command "WIN /S". But it won't work in the normal "386 Enhanced Mode". In general the TSR won't work with protected mode software.

Writing a Windows driver might be possible. I believe Microsoft released their Adlib driver as sample code in the Windows 3.1 Multimedia SDK. But 16-bit Windows driver development is a pretty arcane subject...

Wolfenstein: I've found this article and I'll attempt to build a OPT2LPT version 😀
I fear patching in general might be tricky... I haven't investigated it yet.

Reply 113 of 514, by matze79

User metadata
Rank Oldbie
Rank
Oldbie

Simply redirecting Port will not work ?
Status Lines are used for WR and other Stuff ?
So the TSR does more then just redirection of port access.

yeah impact of performance can easily seen in games like wolf3d on slow cpu's 😀
also hocus pocus is getting a performance penalty.

i will try win 3.x standard mode 😀 and report.
i don't think win 3.x can enter std mode with being already in vm86 mode ?

hopefully i don't write senseless stuff, my grammars are horrible.

https://dosreloaded.de - The German Retro DOS PC Community
https://www.retroianer.de - under constructing since ever

Reply 114 of 514, by Scali

User metadata
Rank l33t
Rank
l33t
matze79 wrote:

Simply redirecting Port will not work ?
Status Lines are used for WR and other Stuff ?
So the TSR does more then just redirection of port access.

The OPL2 chip has two ports:
388h is the index port
389h is the data port

Any register write is done by first writing the index of the register to 388h, and then writing the byte of data for that register to 389h.
Since the printer port is just a single 8-bit port, you would need some way to differentiate between the two ports on the OPL2.
I suppose one of the status lines controls this.

If you would want to do an OPL3 version, it has two pairs of index and data ports, so 4 ports in total.
Doable, but would require another status line for selecting.

scalibq.wordpress.com/just-keeping-it-r ... ogramming/

Reply 115 of 514, by Jepael

User metadata
Rank Oldbie
Rank
Oldbie
Scali wrote:
The OPL2 chip has two ports: 388h is the index port 389h is the data port […]
Show full quote
matze79 wrote:

Simply redirecting Port will not work ?
Status Lines are used for WR and other Stuff ?
So the TSR does more then just redirection of port access.

The OPL2 chip has two ports:
388h is the index port
389h is the data port

Any register write is done by first writing the index of the register to 388h, and then writing the byte of data for that register to 389h.
Since the printer port is just a single 8-bit port, you would need some way to differentiate between the two ports on the OPL2.
I suppose one of the status lines controls this.

Exactly. So each time the game writes to index/data port, the trap is run, and that amounts to 4 writes to LPT port.
First, the LPT control port is written to select address bit to select either index or data write to OPL2.
Second, the LPT control port is written to enable writing, by setting OPL2 write pin low.
Third, the LPT data port is written to set OPL2 data bus with correct data.
Fourth, the LPT control port is written to terminate the write cycle, by setting OPL2 write pin high.

If you are wondering why 3 writes is not enough, well, it may or may not be. The address bit needs to be correct and stable for some time before setting write pin low (and during the whole write cycle), and the data pins must be correct and stable for some time before setting write pin high. If it can be guaranteed with hardware such as RC filter that even if address and write pins are written at the same time, the write will be delayed enough so it works.

Scali wrote:

If you would want to do an OPL3 version, it has two pairs of index and data ports, so 4 ports in total.
Doable, but would require another status line for selecting.

Yes, it needs one more address bit to select if you are writing to the high or low bank when writing the index port, but there's only one data port, as the chip does not care if you are writing to high or low data port. That might enable some new hardware features if someone wants to do an OPL3 version, as the chip can be used with three ports, so one is free for something else.

Reply 116 of 514, by matze79

User metadata
Rank Oldbie
Rank
Oldbie

nice so miles soundsystem driver can be hacked to run nativ without tsr also.
too bad i'm not a good programmer at all 😒

Its Opensource now:
www.ke5fx.com/
Download Link:
www.thegleam.com/ke5fx/misc/AIL2.ZIP

i tested the OPL2LPT now on modern Machines with lpt and it also works here very well 😀
For Slow Machines the DSS is still a better choice. 7khz Output has less impact on Performance.

https://dosreloaded.de - The German Retro DOS PC Community
https://www.retroianer.de - under constructing since ever

Reply 117 of 514, by dr.zeissler

User metadata
Rank Oldbie
Rank
Oldbie

But DSS means "Digisound only", OPL2LPT means FM-Music and no Digisound, two complete different things, or am I wrong here?

Greetings
Doc

CPU: PII 133-333 MOBO: SNI-D981 RAM: 512- FDD: Dualfloppy 3,5"HD/5,25"HD - 3,5"HD - 5,25"DD ISA-Catweasel HDD: 2x40GB - DVD
ISA(3): Audician32-S2Dreamblaster - GusACE PCI(3): Monster3D- Intel NW AGP(1): 3dfx V3-3000

Reply 118 of 514, by dr.zeissler

User metadata
Rank Oldbie
Rank
Oldbie

OPL2LPT would be a "killer-feature" for my HP-NX6125 Laptop. With it, I could play lots of very old games that support adlib.
The problem is, I would have to choose if I put the covox in to have digi-sound and "tandy-emulation" or to have fm-music
with the opl2lpt.

CPU: PII 133-333 MOBO: SNI-D981 RAM: 512- FDD: Dualfloppy 3,5"HD/5,25"HD - 3,5"HD - 5,25"DD ISA-Catweasel HDD: 2x40GB - DVD
ISA(3): Audician32-S2Dreamblaster - GusACE PCI(3): Monster3D- Intel NW AGP(1): 3dfx V3-3000

Reply 119 of 514, by Scali

User metadata
Rank l33t
Rank
l33t
dr.zeissler wrote:

But DSS means "Digisound only", OPL2LPT means FM-Music and no Digisound, two complete different things, or am I wrong here?

Yes... however...
There is a trick to make OPL2 play digital samples as well.
Some games use this (I believe Supaplex is one).
In theory you could create a TSR that simulates Covox and DSS through an OPL2LPT.

scalibq.wordpress.com/just-keeping-it-r ... ogramming/