VOGONS


First post, by niklas1812

User metadata
Rank Newbie
Rank
Newbie

Hi,

i'm currently developing an LPT-Drive within DOSBOX to fit an FT245 Chip to use directly for CNC-Stepmotor-Control.
When I run my CNC-Program (developed by a friend in the early 90s - no source available), the output seems to go to the speakers (even with standard DOSBOX). At least my speakers do some kind of weird noises, and when the stepper motor speed is drastically reduced (in the program) one can hear individual bits (plop-sound).
No my question: At which port within DOSBOX i have to interfer with the sound-driver to get my data? My config says in [sblaster]-section:
sbbase=220
I've tried to store this value (0x220) in BIOS_ADDRESS_LPT1, because i've modified device_lpt1 to accept data and store it (temporarily) in a test-file (that works with every programm accessing LPT1 on 0x378 port). This didn't seem to work and the speaker continued to do weird noises.

Any ideas?
Thanks in advance.

(BTW first post - any rules violated or wrong sub-forum? Let me know 😀)

Reply 1 of 9, by Jorpho

User metadata
Rank l33t++
Rank
l33t++

How do you know there isn't just electrical cross-talk between your parallel port device and your sound card or speakers? This seems to be much more likely.

I would suggest booting your computer into DOS and testing your program there. If you are using a USB-to-parallel adapter that doesn't work in DOS, there's probably no chance of getting it to work with DOSBox either, as these devices are severely limited in their capabilities. (I assume you're using a build of DOSBox that includes parallel port passthrough.) SystemRescueCD provides a quick and easy means of booting into FreeDOS from a USB drive; you can inject any programs you need into the included FreeDOS disk image using Virtual Floppy Drive or DiskExplorer.

And yes, this should be in the DOSBox forum.

Last edited by Jorpho on 2014-02-06, 18:30. Edited 1 time in total.

Reply 2 of 9, by jwt27

User metadata
Rank Oldbie
Rank
Oldbie

Does Dosbox enable Covox emulation by default? You might want to disable that.

Reply 3 of 9, by niklas1812

User metadata
Rank Newbie
Rank
Newbie

The USB-LPT device is developed by me and my classmates, so we know it's working 😀. Currently, it's only about getting the data out of the dosbox. I have no LPT-port attached, so i doubt intereference is the issue here. The dosbox is playing audio signals (verified with several computers) which are sent from the program to the dosbox (Stepmotorcontrol-Data for LM298s). We believe that the dosbox thinks, those were audio data , due to the incorrect port adressing of the programm (it's not sending to standard adresses like 0x3BC, 0x378 or 0x278). When the dosbox recognizes LPT data (e.g. on port 0x378) it doesn't sent those to the speaker, that's why we blame the cnc-programm for improper port handling.
In plus, this happens only with LPT2 set as the output port in the program (actually a port the CNC-Programm believes to bei LPT2, we believe to be the dosbox-internal sound port).
Covox disable did nothing, but to turn the speakers of.

How do i move the post? (i suggest to dosbox-development).

Reply 4 of 9, by Jorpho

User metadata
Rank l33t++
Rank
l33t++
niklas1812 wrote:

The USB-LPT device is developed by me and my classmates, so we know it's working 😀.

This is confusing. If I'm not mistaken, all DOSBox does (or rather the specialized builds of DOSBox) is address a parallel port through PortTalk (or something similar like InpOut32). If it does not behave like an actual parallel port according to Windows, there is no point in expecting DOSBox to address it like an actual parallel port.

Are you using PortTalk and a build of DOSBox that includes parallel port passthrough? Because otherwise DOSBox doesn't emulate a parallel port at all.

Reply 5 of 9, by niklas1812

User metadata
Rank Newbie
Rank
Newbie

Well I am propably confusing you (I'm not a native speaker, neither writer 😀)

Chain is as follows:

Normal:

Test programm decides to sent a byte (let's say 01110111) to LPT1
-> it sents 0x77 (byte above) to the port 0x378
Dosbox catches that and internally forwards byte 0x77 to an instance of device_lpt1 (C++ class)
(the instance is actually newdev3 [created at startup])
We have reprogrammed this device-class to sent this data to a test file (test.dat)
-> That Works! (test.dat contains small "w" which is the ASCII-Character with the HEX-Code 77)

Faulty:

CNC-Programm decides to sent a byte (let's say 01110111) to the set LPT-Port
-> it sents 0x77 (byte above) to the port 0xXXX (we don't know port number)
Dosbox catches that and detects port number NOT as LPT-Port but allegedly as Sound-Device
Dosbox forwards that data to windows-host, which sends it to Soundcard
-> That's not what is supposed to do 🙁

Last edited by niklas1812 on 2014-02-06, 19:49. Edited 2 times in total.

Reply 6 of 9, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

sounds like the disney/covox port you are sending stuff to.
disable it in the options file.. but I don't recall from my head if lpt will pick it up then.
*moved to dosbox general*

Water flows down the stream
How to ask questions the smart way!

Reply 7 of 9, by niklas1812

User metadata
Rank Newbie
Rank
Newbie

Sadly it then doesn't forward (at which port the internal LPT-Device would have to be configured then?) after disabling COVOX/DISNEY in config.
Is there any premade Code, which lists all port Communication between the DOSbox and the running program (With sent data and port). If not, where would such a thing be integrated in the code?
Thanks for moving 😀

I may have misunderstood BIOS_ADDRESS_LPT1- is it storing the Port of the lpt on the host, or the port at which programs in the dosbox ar accessing the emulated lpt device?

Reply 8 of 9, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

the latter.
check disney.cpp for the port numbers

Water flows down the stream
How to ask questions the smart way!

Reply 9 of 9, by niklas1812

User metadata
Rank Newbie
Rank
Newbie

That did the trick 😀
Set some stopping points for debugging in disney_write and the disney.data of the current instance contains my data.
I think I just go from here with remodeling disney/covox stuff.
Thank you very much 😀

Can anyone close this thread or mark it as solved?