Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Communicating with the parallelport in WinXP
2005-09-18 22:05
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?
2005-09-18 22:54
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.. :)

2005-09-19 04:40
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.
2005-09-19 04:41
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
2005-09-19 20:16
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. :)
2005-09-19 21:13
Nightlord

Registered: Jan 2003
Posts: 131
www.mingw.org

(i have read bigger-than-32K files with code compiled by this)
2005-09-19 21:35
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. :)
2005-09-19 23:24
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?
2005-09-20 05:29
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.
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
csabanw
Exile/Anubis
Board Rider/Commodor..
wil
E$G/hOKUtO fOrcE
TheRyk/MYD!
Airwolf/F4CG
Guests online: 178
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Wafer Demo  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 MWS  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.042 sec.