English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 31 December 2020, 15:29   #1
Gilloo
Registered User
 
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 218
WinUAE and paraport.dll

Reading the winuae logs, I've notice the test to the paraport.dll
As I want to use the parallel port to simulate a digithing (a digiview in fact ) I think it's a good start point to accomplish that.
So I build my own paraport.dll with the minimal
openPort
closePort
executeCycle
entrypoints

but when I put this paraport.dll in the WinUAE directory I trace this
openPort ("¤ùV Xv3") instead of openPort("LPT1")


What is the problem ? WinUAE or my paraport.dll ?
Gilloo is offline  
Old 31 December 2020, 16:34   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 24,566
I guess dll is compiled with wrong calling convention or wrong character set (should be char but expects wchar?)

Hmm... It probably has not worked for ages because WinUAE side did not have calling convention declaration (it was for tvpicport and winio but not for paraport). Now it has _stdcall. winuae.7z updated.

I can't guarantee it works, it was added ages ago and probably has at least some bit rot..
Toni Wilen is online now  
Old 31 December 2020, 19:10   #3
Gilloo
Registered User
 
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 218
Oh Oh oh ! thanks Toni !
so there is something to do in the file od-win32/ioport.cpp ?
Gilloo is offline  
Old 31 December 2020, 19:29   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 24,566
I did this change which should help. Maybe.

Code:
typedef BOOL (_stdcall* closePort)(HANDLE);
typedef BOOL (_stdcall* executeCycle)(HANDLE, PARAPORT_CYCLE*, int);
typedef BOOL (_stdcall* getPortInfo)(HANDLE, PARAPORT_INFO*);
typedef HANDLE (_stdcall* openPort)(const char*);
Toni Wilen is online now  
Old 31 December 2020, 19:50   #5
Gilloo
Registered User
 
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 218
Quote:
Originally Posted by Toni Wilen View Post
I did this change which should help. Maybe.

Code:
typedef BOOL (_stdcall* closePort)(HANDLE);
typedef BOOL (_stdcall* executeCycle)(HANDLE, PARAPORT_CYCLE*, int);
typedef BOOL (_stdcall* getPortInfo)(HANDLE, PARAPORT_INFO*);
typedef HANDLE (_stdcall* openPort)(const char*);

typedef BOOL (_stdcall * closePort)(HANDLE);
typedef BOOL (_stdcall * executeCycle)(HANDLE, PARAPORT_CYCLE*, int);
typedef BOOL (_stdcall * getPortInfo)(HANDLE, PARAPORT_INFO*);
typedef HANDLE* (_stdcall * openPort)(const char*);

Now I got the "LPT1" in the trace !
Kiitos !
Gilloo is offline  
Old 01 January 2021, 16:16   #6
Gilloo
Registered User
 
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 218
I don't know why but it works better with _cdecl
typedef BOOL (_cdecl * closePort)(HANDLE);
typedef BOOL (_cdecl * executeCycle)(HANDLE, PARAPORT_CYCLE*, int);
typedef BOOL (_cdecl * getPortInfo)(HANDLE, PARAPORT_INFO*);
typedef HANDLE* (_cdecl * openPort)(const char*);

The _stdcall make stack damages during the emulation.

https://stackoverflow.com/questions/...all-on-windows

So I should change my .dll and make a .def file and put _stdcall everywhere or stay with _cdecl ?


Got these traces in winuaelog.txt when I digitize... perhaps paraport is not a good door.
But I will try to hack this in 2021
49-011 [12317 000-017]: PARAPORT: POUT can't be output
49-011 [12317 000-017]: PARAPORT: write CTL=02 DIR=02
49-011 [12317 000-017]: PARAPORT: unsupported mixed i/o attempted, DATA=01 DIR=01, ignored
49-012 [12317 000-017]: PARAPORT: read DATA=6D3F5DF
49-012 [12317 000-017]: PARAPORT: unsupported mixed i/o attempted, DATA=00 DIR=01, ignored
49-015 [12317 222-087]: PARAPORT: unsupported mixed i/o attempted, DATA=01 DIR=01, ignored
49-015 [12317 224-088]: PARAPORT: read DATA=6D3F5DF
49-015 [12317 224-088]: PARAPORT: unsupported mixed i/o attempted, DATA=00 DIR=01, ignored
49-018 [12317 222-133]: PARAPORT: unsupported mixed i/o attempted, DATA=01 DIR=01, ignored
49-018 [12317 226-134]: PARAPORT: read DATA=6D3F5DF
49-018 [12317 226-134]: PARAPORT: unsupported mixed i/o attempted, DATA=00 DIR=01, ignored
49-022 [12317 226-196]: PARAPORT: unsupported mixed i/o attempted, DATA=01 DIR=01, ignored
49-022 [12317 226-196]: PARAPORT: read CTL=0D
49-023 [12317 226-196]: PARAPORT: read CTL=0D
49-023 [12317 226-196]: PARAPORT: read CTL=0D
49-023 [12317 226-196]: PARAPORT: read CTL=0D
49-024 [12317 226-196]: PARAPORT: read CTL=0D
49-024 [12317 006-197]: PARAPORT: read CTL=0D
49-025 [12317 046-197]: PARAPORT: read CTL=0D
49-025 [12317 086-197]: PARAPORT: read CTL=0D
49-025 [12317 126-197]: PARAPORT: read CTL=0D
49-026 [12317 166-197]: PARAPORT: read CTL=0D
49-026 [12317 206-197]: PARAPORT: read CTL=0D

Last edited by Gilloo; 01 January 2021 at 19:45.
Gilloo is offline  
Old 01 January 2021, 18:57   #7
Gilloo
Registered User
 
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 218
I start simple: each time I read something, I increment a counter...
I use AudioMaster to get samples in WinUAE.

There is something strange in the logs...

18-438 [6181 022-087]: PARAPORT: read DATA=9FF1F3
18-438 [6181 187-087]: PARAPORT: read DATA=9FF1F3
18-439 [6181 140-088]: PARAPORT: read DATA=9FF1F3
../..

Toni, can you change this in the file od-win32/ioport.cpp, function parallel_direct_read_data(), *v (value pointed) instead v (pointer value)
para_log (_T("PARAPORT: read DATA=%02X\n"), *v);

It's better to see the values than the addresses
34-260 [2638 036-228]: PARAPORT: read DATA=A4
34-261 [2638 039-229]: PARAPORT: read DATA=A5
34-261 [2638 042-230]: PARAPORT: read DATA=A6
../..

Thanks
Gilloo is offline  
Old 02 January 2021, 19:41   #8
Gilloo
Registered User
 
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 218
So I changed my .dll and make a .def file and put _stdcall everywhere.
I can use AudioMaster to get "samples" via my paraport.dll
I can print via my paraport.dll
My new challenge of 2021 will to "digitize" something with DigiView 4.0

Toni, can you change this line in the file od-win32/ioport.cpp, function parallel_direct_read_data(), *v (value pointed) instead v (pointer value)
para_log (_T("PARAPORT: read DATA=%02X\n"), *v);

And also keep the _stdcall for paraport.dll

Many thanks !
Gilloo is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
WinUAE tools that use x86 dll thellier support.WinUAE 54 28 July 2019 23:07
MSVC100.dll error WinUAE 64 MrX_Cuci support.WinUAE 1 26 February 2013 23:21
WinUAE and Windows dll... Gilloo support.WinUAE 1 19 June 2012 17:46
winuae.net down (as usual). Another place to download portaudio dll? ceztko support.WinUAE 1 12 May 2009 16:22

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 22:13.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.07055 seconds with 13 queries