libx86emu icon indicating copy to clipboard operation
libx86emu copied to clipboard

Adapt master so that it also produces a Windows DLL (code is still "C")

Open plolcott opened this issue 4 years ago • 3 comments

The "Compile.bat" files were the simplest way to build for people accustomed to Linux make files that I could create without learning nmake. I was very careful to only make the minimum changes. About half of the changes were merely to address Visual Studio warnings. It passed all the regression tests and I also tested "x86emu-demo.c" with my own test data. libx86emu.dll must be copied to ..\demo before it will run.

Compiled under Microsoft Visual Studio Community 2017 Version 15.9.5 as "C". Requires Visual Studio 2015 version 14.0 or newer for the port access functions: __inbyte(addr); __inword(addr); __indword(addr); __outbyte(val, addr); __outword(val, addr); __outdword(val, addr);

I am not sure if you care about a C++ version or not. The big advantage of C++ is that it has std::vectors. I figured out an easy way to adapt the library to produce a full disassembly listing of its input. This is much easier for my own project than requiring Intel XED. My initial approach was to use a std::vector of std::string for the disassembly listing. libx86emu is easily adapted to compile under C++ it only requires a few more type casts. Please let me know what you think. Your help has been crucial to the success of my own project. I really appreciate this help very much.

plolcott avatar Jul 03 '20 03:07 plolcott

OK, from looking at it so far, 3 things:

  1. please separate out the one-line functional chage (32 bit stack)
  2. there's a huge amount of white-space changes, please do these also separately
  3. you add a file x86emu-demo.c with just a comment; I don't see why

wfeldt avatar Jul 09 '20 14:07 wfeldt

(1) I think that you must mean that I should have done the commit for the one line function change separately from the commit for the conversion to Windows DLL.
(2) I did not mean to make any unnecessary white space changes. (3) I added x86emu-demo.c with one comment because I added it by mistake earlier and the system would not let me delete it and the system would not build without deleting it.

To fix all these things I have to find out how to do a revert to the original and then repeat the process. I set my "Beyond Compare" to not Ignore Unimportant Differences and got rid of the extraneous white space changes.

I think that I only need to find out how to do a revert to finish your items. One upload and one commit for x86emu-demo.c to the right place this time. Then some more uploads and one more commit.

plolcott avatar Jul 09 '20 15:07 plolcott

I find it usually easiest in these situations to go back with 'git reset' and then use 'git add -p' to re-structure the changes.

And it's perfectly fine to use 'git push --force' in pull requests to rewrite history.

wfeldt avatar Jul 10 '20 07:07 wfeldt