VOGONS


OPL2LPT

Topic actions

Reply 460 of 566, by matze79

User metadata
Rank l33t
Rank
l33t

Ok now it works, i missed the thingverse entry, the file above is just the case top..

https://www.retrokits.de - blog, retro projects, hdd clicker, diy soundcards etc
https://www.retroianer.de - german retro computer board

Reply 461 of 566, by dreamblaster

User metadata
Rank Oldbie
Rank
Oldbie
matze79 wrote:

Ok now it works, i missed the thingverse entry, the file above is just the case top..

Oh okay, hope it turned out OK

Visit http://www.serdashop.com for retro sound cards, video converters, ...
DreamBlaster X2, S2, S2P, HDD Clicker, ... many projects !
New X2GS SE & X16GS sound card : https://www.serdashop.com/X2GS-SE ,
Thanks for your support !

Reply 462 of 566, by matze79

User metadata
Rank l33t
Rank
l33t

except for the clamps everything is fine, a screwable version would be much better.

https://www.retrokits.de - blog, retro projects, hdd clicker, diy soundcards etc
https://www.retroianer.de - german retro computer board

Reply 463 of 566, by SteveC

User metadata
Rank Member
Rank
Member

Fancied a bit of DOS action tonight as I have finally acquired a CRT, but couldn't get Descent to work with this - is that too modern a game?

Cheers,
Steve

YouTube: https://www.youtube.com/c/StevesTechShed
Twitter: https://twitter.com/SteveTechShed

Reply 464 of 566, by Scali

User metadata
Rank l33t
Rank
l33t
SteveC wrote:

but couldn't get Descent to work with this - is that too modern a game?

Yes, the TSR for the OPL2LPT only works for 16-bit realmode games (8088-286). Descent is a 32-bit game, and the TSR stops working when an application switches the CPU to 32-bit mode, basically.
The game could be made to work if it were patched directly, but I don't think the patch-utility supports this game yet.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 465 of 566, by noop

User metadata
Rank Member
Rank
Member
SteveC wrote:

Fancied a bit of DOS action tonight as I have finally acquired a CRT, but couldn't get Descent to work with this - is that too modern a game?

Cheers,
Steve

Games like Descent require patching instead of TSR utility. Once patching is done, modified executable will work with OPL2LPT without any additional software, but won't work with "normal" Adlib-compatible cards.
Doom & Heretic worked great for me. Will now check if Descent works.. well, it doesn't.

Check this list for the games that are verified to work. https://github.com/pdewacht/adlipt/wiki/ADPATCH-Tested-Games
Generally, if a game does not work with TSR and is not in this list, it may be not supported. Yet.

Reply 466 of 566, by sayjionix

User metadata
Rank Newbie
Rank
Newbie

Hi!
Just got my OPL2LPT two weeks ago and tried it on several machines after the soldering assembly. While it works like a charm on my IBM Thinkpad 380D (games tested so far: Prince of Persia, LHX Attack Chopper, Monkey Island 1), I have exactly the same issue that also SteveC faces with his PS/2 system on two of my other systems:
On my 486 SX-25 notebook as well as on my 386 DX-40 desktop system, I can only hear very distorted single notes that don't seem to follow any (slowed down) melody. Exact the same issue that SteveC has recorded in his video (linked on page 10). On the DX-40, at least OPL2TEST.EXE plays the correct melody, the problem appears only when the Adlipt TSR is loaded and I try some games. On the SX-25 notebook, even OPL2TEST doesn't work and only plays distorted, screechy frequencies.

Unfortunately, the SX-25 BIOS doesn't let me change much settings, so I only disabled all other peripherals except from the LPT port - still no change. The DX-40 uses a regular LPT/Serial/Gameport controller card.

It makes me wonder if there could be another source of the problem that has nothing to do with the PS/2 models...

Will perform some more tests the next days and try to find out what could cause this issue.

Reply 467 of 566, by noop

User metadata
Rank Member
Rank
Member
sayjionix wrote:

Unfortunately, the SX-25 BIOS doesn't let me change much settings

OPL2LPT uses standard LPT port mode (not bi-dir/EPP/ECP), but the problem is probably caused by notebook outputting 3.3 V levels on LPT. Using lower resistor values (2 long yellow things) could possibly help here.

Reply 468 of 566, by Vipersan

User metadata
Rank Oldbie
Rank
Oldbie

So ..finally got round to assembling my OPL2LPT unit ..as my recent multi OS PC build has no ISA slots ..therefore In pure DOS mode I have no sound ..
I have tested it with the driver TSR and test.exe ..
all working fine .
I guess I need to learn how to patch DOS games next..
I have no knowledge of assembler ..but can follow detailed instructions.
Perhaps someone would be kind enough to detail the steps ?
or point me to a tutorial.
An example would be Wolf3D or Lemmings..
I guess this has to be done on each machine ..so not possible to download pre-patched EXEs ..?
rgds
VS

Reply 469 of 566, by derSammler

User metadata
Rank l33t
Rank
l33t

Wolf3D and Lemmings should work with the TSR and don't require patching.

Also, last time I checked the OPL2LPT drivers and source, there were instructions included how game patching is done.

Reply 470 of 566, by Vipersan

User metadata
Rank Oldbie
Rank
Oldbie
derSammler wrote:

Wolf3D and Lemmings should work with the TSR and don't require patching.

Also, last time I checked the OPL2LPT drivers and source, there were instructions included how game patching is done.

Thanks for the info ...
but I will want to learn the skill of patching ..
I do have other DOS games that may require this.
cheers
VS

Reply 471 of 566, by derSammler

User metadata
Rank l33t
Rank
l33t

Seems in 0.7 the section about how to make patches was removed. Here it is from 0.6:

## Writing patches

The patches are stored in YAML files in the `patterns/` directory.
Each file can have multiple patches, I try to keep related patches
together. Generally each target needs two patches, one for the Adlib
detection routine and one for the actual Adlib I/O.

Each patch consists of a search pattern and a replacement code fragment.

### Search patterns

The search pattern is specified as an assembly fragment, but there are
certain special keywords that can be used.

**ANYBYTE, ANYWORD, ANYDWORD** can be used as a wildcard for an
arbitrary 1/2/4 byte value. For example:

mov dx, word ptr [ANYWORD]
out dx, al

In this pattern, the address of the variable is not important and
might differ in different builds of the game. So it's best to accept
anything.

**BEGIN/ALT/END** mark alternative code sequences. For example:

BEGIN
mov dx, 0x389
ALT
inc dx
END

This is useful to match slight variations in a single pattern.

**BEGIN/REPEAT** marks possible repetition. For example:

BEGIN
in al, dx
REPEAT

The fragment must appear at least once.

**BEGIN/OPTION** marks a fragment that might or might not appear.

BEGIN
nop
OPTION

#### Problems:

ANYBYTE/ANYWORD won't work for relative offsets. So instead of `call
ANYWORD`, you'll have to write `db 0xE8, ANYBYTE, ANYBYTE`. Same for
short jumps.

Surprisingly often x86 instructions have multiple encodings. For
example, `mov ax,bx` might be encoded as `89 D8` or as `8B C3`. If
NASM picks the wrong encoding, you'll have to spell out the bytes
explicitly.

The implementation is a gross hack.
Show last 17 lines

### Replacement code

The replacement code is an ordinary assembly fragment. The keyword
PORT can be used *once* to get the parallel port I/O address.

ADPATCH ships with a few standard replacements that can be `%include`d:

- `standard.s`: the standard OPL2LPT code. Expects the OPL2 register
in AL and the data in AH.
- `standard32.s`: same, as 32-bit code.
- `compact.s`: a slower but smaller version. Will pop register and data
(separately) from the stack.

If the replacement code is shorter than the matched fragment, it will
be padded with NOPs.

Reply 473 of 566, by sayjionix

User metadata
Rank Newbie
Rank
Newbie

Hi again!
today I made some analyses to find out what causes the OPL2LPT to output only distorted screechy sounds on some of my computers / IO-controllers. I think I came to an idea and an option to fix it, but not sure if this is the preferred way, so please let me know what you think.

I started installing a second I/O-controller card to my 386 in parallel to the existing one and configured it as a second LPT port. With this new controller card, I got OPL2LPT running just fine in test mode as well as in TSR mode. So I wondered what's the difference between both controllers and why the first one is only producing screechy sounds. I then configured both cards to have the same LPT address (378h - 37Fh) and in that way, both cards are transmitting the exact same data on their LPT ports. An oscilloscope comparisson of the Data 0-7 lines, the STROBE/A0 line and the Reset/WR line revealed that the timing of both controllers is exactly the same. However, the second (working) controller card is running 3.3V signal levels on the Data0-7 lines, whereas the first (non-working) controller uses 5V levels. As it was the non-working controller using the 5V, it proves that the OPL2LPT is working fine with having only 3.3V levels (as expected), so the voltage levels are not an issue.

What finally revealed the problem was a look at the STROBE line (connected to the YM3812 A0-pin via the resistor network) in combination with the RESET line (connected to the YM3812 WR-pin via the resistor network). RESET is toggled once after STROBE is pulled Low and a second time after STROBE is pulled High again. For whatever reason - the non-working controller card (as well as my 486sx-25 notebook) don't seem to have an internal pull-up, to have a defined edge of STROBE to go High again - leading to a capacitive rising edge and causing RESET to be interpreted by the Yamaha YM3812 before STROBE is interpreted High. I made some screenshots to show the behaviour of 4 reference scenarios (my 386 with the two controllers, my Thinkpad 380D and my 486sx) - STROBE is yellow, RESET is pink:

compare_texted.png
Filename
compare_texted.png
File size
162.02 KiB
Views
1442 views
File license
Fair use/fair dealing exception

Interesting enough is the fact, that the OPL2TEST program was always working on both controller cards. A comparisson between Monkey Island 1 running with ADLIPT TSR and the OPL2 test program shows, that apparently the test program leaves a bit more time in between STROBE going high and RESET toggling, so that it must have been enough to work with the YM3812:

compare2_texted.png
Filename
compare2_texted.png
File size
70.7 KiB
Views
1442 views
File license
Fair use/fair dealing exception

I fixed the problem by installing a 1k resistor on the OPL2LPT board in between +5V and STROBE (pin 1 on the DSUB connector), to act as an external pull-up. This gives a defined edge to the STROBE signal and works perfectly on both controlller cards and also my 486 notebook 😀 So it's finally time to tune in some Adlib game soundtracks 😉

Please let me know if this could be considered as a fix or if it might rise some other issues that I haven't thought of so far. However, I'm wondering why this problem seems to be so rare and I've got bad luck twice with my notebook and my first controller card...

@SteveC: Would be interesting to hear if this can also get the OPL2LPT working on your PS/2 machine!

Cheers, sayjionix

Reply 474 of 566, by 640K!enough

User metadata
Rank Oldbie
Rank
Oldbie

As far as I'm aware, the schematics were never shared, but I asked about this long ago. From what I've read, according to the standard, the control lines should have 1.2k pull-up resistors in place. As we've discovered, there can be significant variations in the many implementations of parallel ports, and the standard suggests that as one way to increase the likelihood that a device will work on the largest number of systems.

Reply 475 of 566, by SteveC

User metadata
Rank Member
Rank
Member

@sayjionix Good work! I'll see if I can have a play with this tonight.

YouTube: https://www.youtube.com/c/StevesTechShed
Twitter: https://twitter.com/SteveTechShed

Reply 476 of 566, by dreamblaster

User metadata
Rank Oldbie
Rank
Oldbie
sayjionix wrote:

Hi again!
I think I came to an idea and an option to fix it, but not sure if this is the preferred way, so please let me know what you think.

Hi,
not many people experience a problem,
this seems a like a great and safe mod to be more compatible, in case you experience this problem.
Well done !
Serge

Visit http://www.serdashop.com for retro sound cards, video converters, ...
DreamBlaster X2, S2, S2P, HDD Clicker, ... many projects !
New X2GS SE & X16GS sound card : https://www.serdashop.com/X2GS-SE ,
Thanks for your support !

Reply 478 of 566, by dreamblaster

User metadata
Rank Oldbie
Rank
Oldbie

OPL2LPT : https://www.serdashop.com/OPL2LPT
OPL3LPT : https://www.serdashop.com/OPL3LPT

good idea to update the first post, i added links.
I will update my signature as well.

Visit http://www.serdashop.com for retro sound cards, video converters, ...
DreamBlaster X2, S2, S2P, HDD Clicker, ... many projects !
New X2GS SE & X16GS sound card : https://www.serdashop.com/X2GS-SE ,
Thanks for your support !

Reply 479 of 566, by TimWolf

User metadata
Rank Member
Rank
Member
dreamblaster wrote:
OPL2LPT : https://www.serdashop.com/OPL2LPT OPL3LPT : https://www.serdashop.com/OPL3LPT […]
Show full quote

OPL2LPT : https://www.serdashop.com/OPL2LPT
OPL3LPT : https://www.serdashop.com/OPL3LPT

good idea to update the first post, i added links.
I will update my signature as well.

😲 You rock!

I'm going to get one of these for my Tandy RLX HD. I'm not going to put the port on it. I'm going to mount it internally and pipe it through the Tandy sound board sharing the volume knob. Goal is to have a switch for the Tandy Sound / LPT port so that I can still use the printer and Tandy sound on one setting, and the Adlib on the other. "Think it'll wouerk?" ~