Reply 20 of 43, by mf2hd
But you have to define C_DIRECTLPT 1 somewhere (or hack out all
C_DIRECTLPT ifdefs or so).
I was just trying on the old one h-a-l 's directlpt.diff .
But you have to define C_DIRECTLPT 1 somewhere (or hack out all
C_DIRECTLPT ifdefs or so).
I was just trying on the old one h-a-l 's directlpt.diff .
The "#define C_DIRECTLPT 1" is added by patch in src/platform/visualc/config.h .
I'm using mingw, so the above path should be declared somewhere?
I've added the missed lines to "dosbox/config.h" ,but when ran "./configure" these ones are deleted.
😕 😕
That file is only used by msvc (under *nix/mingw it is generated).
Well just remove all occurences of C_DIRECTLPT (which should be
all like #ifdef DIRECTLPT or similar) or rename that to WIN32 or
something so it succeeds compiling.
put parport.h in /include/automake.am
it's wrong in /src/hardware/serialport.
1+1=10
put parport.h in /include/automake.am
it's wrong in /src/hardware/serialport.
No "automake.am" , Is it the "makefile.am"?
I've made the changes in these last ones.
compiler shows cdirect error.
Well just remove all occurences of C_DIRECTLPT (which should be
all like #ifdef DIRECTLPT or similar)
"directlpt_win32.h" -> compiler errors
in "directlpt_win32.cpp", too -> as above
see attached.
Ok hal uses vc assembler in porttalk.cpp, which doesn't work as
is under mingw. Don't know if this file crucial, looks like it is.
Would require converting these snippets to at&t-style asm.
Did you try it with msvc already? You need to compile a few
libraries for this though.
Did you try it with msvc already? You need to compile a few
libraries for this though.
I supose these one in ".diff" : libpng, zlib,...
I don't have vc installed in this machine: I try soon...
-----
I've followed line by line the ".diff"...
Placed the missing line for the config.h (#define,..) for the undeclared cdlptdirect errors, etc.
Solved some errors relate asm, changed the code syntax in :
__asm (".....");
For the last errors (see attached) I don't understand what the compiler wants, lines are the same as in ".diff", maybe mingw wants other syntax...
Maybe you could post the actual lines that create the errors, as the
line numbers seem to have changed.
Maybe you could post the actual lines that create the errors, as the
line numbers seem to have changed.
Oops I'm sorry...
In attachment there are the mingw errors and the related porttalk.cpp , just tested on my home pc, so the path and the lines aren't the same of above post.
Try adding
#include <winioctl.h>
at the very top of porttalk.cpp. Think it's missing METHOD_BUFFERED and
FILE_ANY_ACCESS which should be in winioctl.h
Don't know if that thing is in mingw.
I've found that the include file it isn't "winioctl.h" but "ioctrl.h".
After"included" this one in "porttalk.cpp", the last errors after "make" are related to a file/s in my "Documents and Settings" folder.😕
The compiler shows:
E:/Documents and Settings..../Temp/ccS8aaaa.s: Assembler messages:
E:/Documents and Settings..../Temp/ccS8aaaa.s:4180: Error: too many memory references for `mov'
E:/Documents and Settings..../Temp/ccS8aaaa.s:4183: Error: too many memory references for `mov'
E:/Documents and Settings..../Temp/ccS8aaaa.s:4186: Error: too many memory references for `out'
etc.
No "exe" was build.
_mf2hd_
Well the at&t style asm (gcc) is different from the intel syntax (msvc)
so it needs a bit rewriting.
Well,
I've tried to force mingw to read the intel's asm with the line:
asm (".intel_syntax noprefix");
but the compiler output is full of asm errors in the at&t form, with statements non present in porttalk.cpp (push,pop,...).
I've understood it doesn't like this format... 🙁
After I've learn many beautiful things about at&t's asm 😵 , I've put the following lines in porttalk.cpp:
asm ("mov portid,%edx");
asm ("mov value,%al");
asm ("out %al,%dx");
...etc
the compiler errors are:
---
undefined reference to `portid'
undefined reference to `value'
---
A line in porttalk.cpp with these ones:
---
void outportb(Bit32u portid, Bit8u value)
---
Any suggestions about these ones?
msVC's help doesn't shows nothing about Bit8u and Bit16u, so, where are they from?
Is there something to "#include"?
"Thanks" are always included. 😀
_mf2hd_
Sorry, didn't look at it yet. But you can browse the dosbox sources,
there you'll find asm blocks where you can compare the both
assembler types, like this:
#if defined (_MSC_VER)
__asm {
__asm finit
__asm fsave dyn_dh_fpu.state[0]
__asm fstcw dyn_dh_fpu.host_cw
}
#else
__asm__ volatile (
"finit \n"
"fsave %0 \n"
"fstcw %1 \n"
:
: "m" (dyn_dh_fpu.state[0]), "m" (dyn_dh_fpu.host_cw)
: "memory"
);
#endif
Try something like the following, but be sure to check the disassembly
for correctness, and maybe test it in the debugger as well.
void outportb(Bit32u portid, Bit8u value) {
__asm__ volatile (
"movl %0,%%edx \n"
"movb %1,%%al \n"
"outb %%al,%%dx "
:
: "r" (portid), "r" (value)
: "edx", "al"
);
}
Bit8u inportb(Bit32u portid) {
Bit8u value;
__asm__ volatile (
"movl %1,%%edx \n"
"inb %%dx,%%al \n"
"movb %%al,%0 "
: "=m" (value)
: "r" (portid)
: "edx", "al", "memory"
);
return value;
}
> but be sure to check the disassembly
for correctness, and maybe test it in the debugger as well.
It's not dangerous, he will get a privileged exception if it tries to access a wrong port.
1+1=10
Yes, but if my asm conversion is wrong at all, well no guarantees 😉
But it should be fine if the disassembly looks ok.
Thank you wd, I've left for the moment the mingw and tried to compile with MSVC2K5exp (see attachment)...
mingw with your assembly lines :
***** --- *****
make[2]: Entering directory `/e/compile12/dosbox/dosbox/include'
cd .. && /bin/sh /e/compile12/dosbox/dosbox/missing --run automake-1.8 --gnu i nclude/Makefile
include/Makefile.am:40: blank line following trailing backslash
make[2]: *** [Makefile.in] Error 1
make[2]: Leaving directory `/e/compile12/dosbox/dosbox/include'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/e/compile12/dosbox/dosbox'
make: *** [all] Error 2
***** --- *****
The last line (40) in "...\include\makefile.am" is:
video.h\
I've deleted the "\" for test:
***** --- ****
make[2]: Entering directory `/e/compile12/dosbox/dosbox/include'
cd .. && /bin/sh ./config.status include/Makefile
config.status: creating include/Makefile
make[2]: Leaving directory `/e/compile12/dosbox/dosbox/include'
make[2]: Entering directory `/e/compile12/dosbox/dosbox/include'
make[2]: *** No rule to make target `control.h', needed by `all-am'. Stop.
make[2]: Leaving directory `/e/compile12/dosbox/dosbox/include'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/e/compile12/dosbox/dosbox'
make: *** [all] Error 2
**** --- ****
_mf2hd_
I've tried to compile with mingw a fresh directory/files because the last ones was full of garbage made during the tests and...compiled succesfully!!!:happy:
I've tried the program and IT SEEMS TO RUN FINE!!!...😁 😁
the screen is hard to read on LCD because it's run only in simple vga resolution: now I'll try to add the svga patch...
The change to cpu.cpp that skips the "stack error" crash is the first that wd suggested.
Thanks again wd and hal for your suggestions and "pieces of code",as well as for your patients in following this "dummy".
_mf2hd_
I'll include your and wd's findings in the patch some time (and will also have to fix it up for latest CVS).
1+1=10