| |
Perff Administrator
Posts: 1665 |
Communicating with the parallelport in WinXP
This is not directly c64-coding, but close enough I guess.
Anyone know how to either communicate with the parallelport in "the right way" in XP, or how to cheat XP to bang the IO-addresses?
The problem is that I got a homemade parallelcable PC/Amiga<->c64 and my own transfer routines written in C.
They work fine on amiga, and also fine under linux as ROOT, but I can't get to peek/poke the par-port directly using the IO-addresses in XP, so what to do? (Stop using win I know, but I would like to port it anyway. :) )
I have already searched google etc. which says that you need to write your own driver or similar. hmm.. There must be a simpler way?
What I'm looking for is a ?simple? piece of code (preferably in C) that enables me, either to communicate the "correct" way with the parallelport, or some "hack" that opens up for direct access to the IO-adresses.
Anyone? |
|
| |
Ben Account closed
Registered: Feb 2003 Posts: 163 |
You will need to use IOCTL commands at ring 0 to read/write. I doubt there is a generic driver class for this. Perhaps there are snippets of code out there, yes, but I am afraid you will need to start writing your own VXD for this. There must be some template for this though.
However, reconsider before you start -- you will be da man, but at what expense -- XP does not have a particularly nice message filter so you will run into unexpected problems like other device drivers capturing returned messages et cetera.. :)
|
| |
Raf
Registered: Nov 2003 Posts: 343 |
you can use additional dll libraries that control parport and are NT-line compatible/designed , however I don't remeber name of any I've seen [but not used - yet] so take a ride using google :) . one was supplied with hd74480 lcd control program but again I don't quite remeber its name , it was 'lcd smartie 5.x' probably, latest versions are only NT cabale using some kind of dlls... anyway with 98se I had to use older version when I connected 2x24 lcd to lpt. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11127 |
if the protocoll you are using uses handshaking and isnt timing critical, you can just use something like "giveio.sys" to allow port i/o for a user app |
| |
Perff Administrator
Posts: 1665 |
WEE! I found something that made it work, and quite easily.
Found a little .dll file: inpout32.dll, and I can now access the IO with minor alteration of my old code. (Search for inpout32 on google if anyone is interested)
BUT!! Nothing seems to be easy in Windows. :(
I got this little command-line c-compiler which seems to work fine, but the code it generates have a big problem with reading files. The command fread (and fgetc etc.) acts weird. It dosn't seem to want to read more than max. 32k from a file. I have tried a few different ways to read a file, but nothing seems to work.
Anyone know a good, simple and free C-compiler that actually works? :) (For winXP)
EDIT: I just found out (Cyber found something for me. :) ) that windows runs in text-mode as default. That means that when the file finds a EOF-code it just stops reading. Changing the "r" mode to "rb" in fopen did the trick. :) |
| |
Nightlord
Registered: Jan 2003 Posts: 131 |
www.mingw.org
(i have read bigger-than-32K files with code compiled by this) |
| |
Perff Administrator
Posts: 1665 |
Quote: www.mingw.org
(i have read bigger-than-32K files with code compiled by this)
Thanks for the link, but as it says in the edit in my previous post, I found out that nothing was wrong with my compiler after all. It was just a windwos "feature" I didn't know about. :) |
| |
Devia
Registered: Oct 2004 Posts: 401 |
@Perff: Do you know if inpout32 supports interrupts? ..so you could hook up a XA-1541 or XM-1541 cable to do some 1541/71/81 magic?
|
| |
Perff Administrator
Posts: 1665 |
I don't think it does. As far as I know it only allows you to access the IO directly. But what do I know. :)
Google for inpout32, and check it out. |