Search code examples
windowsdllbuildopen-sourceexecutable

How do I compile PCSXR source code on Windows into an executable?


TLDR at the bottom.

I've been running an application I've found on codeplex.com called PCSXR. However, I believe a Windows update has caused the program not to function properly or it's missing some Windows Visual Basic add-on since it was fine before I cleaned installed Windows 10 for fixing a problem that recovery couldn't fix.

I've tried version 1.9.92 executable but it has crash issues playing cinematics.

Version 1.9.93, which is most stable and I was using, no longer can read the DLL plugins in the folder. Making it unusable.

After browsing around. I found this post that this person solved the problem using Dev C++ to compile the source code. I've attempted to build it but I keep getting thrown errors. Wrong architecture which I've solved by setting it to 32 bit compile but other errors prevented it compiling.

After Googling how-to around and talking with some other programmers. I've been going back and forth with different tools on how to compile it. Code Blocks, Dev C++, MinGW and an old Git program on Windows to run Bash. I even ended up having missing config.h which is in the header and even winres.h missing.

I somehow managed to compile it through WSL (Windows Subsystem for Linux) with Ubuntu, XFCE4 Desktop through VcXsrv to display XFCE4 through a window. PCSXR starts, has plugins but crashes when I run it. From what I've been told, the error due to WSL not supporting sound. So WSL failed.

I've tried Ubuntu "Try It" CD environment but fails to compile at all.

VirutalBox on latest version no longer works since they disabled it working on my machine since it doesn't have BIOS virtualization setting.


TLDR

I've been following their program documentation but it's not really detailed for Windows users.

So my question is: How do I build, in detailed steps, PCSXR either from updated source code here or 1.9.93 source here into a working Windows executable with its DLL plugins working? What programs I need, what do I type in what, what settings, where I find missing files etc.

I know this isn't probably the best question here but I've been at this for 2 whole days, Googling and asking.

I'm using Windows 10, AMD CPU, 64 bit with no BIOS virtualization support.


Solution

  • I managed to do it by following these steps on this forum post:

    You need Dev C++ 5.11.

    1).Go to File>Open>Directory of Pcsxr>win32>pcsxr.dev

    2).Under Project select pcsxr. Right click and select project options.

    3.In Project Options select compiler. Set Base compiler to "TDM-GCC 4.9.2 32bit Release" then click ok.

    4).In the main menu of Dev C++ 5.11 look for Execute. Select Compile.

    5).Wait for it to compile. If you were successful there should a pcsxr.exe in pcsxr source directory>win32.

    After following the steps and trying out all the most recent versions of the source codes available. This is my research results I posted after.

    Thanks for the reply. It really helped a lot.

    I've tried the 1.9.93 beta source code "pcsxr-1.9.93.tar.bz2" (extracted with 7zip) and got a compile error about "#include " not found.

    I've tried the 1.9.94 alpha source code "pcsxr-1.9.94.zip" and it compiled successfully. I got a "pcsxr\libpcsxcore\gte_divider.h" missing error when loading the dev file in win32 folder but it seems to work okay.

    I've tried the up-to-date source code (last modification Feb 18, 2017) and it compiled successfully. I got a "pcsxr\libpcsxcore\gte_divider.h" missing error when loading the dev file in win32 folder but it seems to work also. The background logo that covers the main window seems to be blank grey until I start a game.

    I solved the winres.h issue by getting this missing Windows h Sample file from github here: https://github.com/Microsoft/Window...les/Win7Samples/winui/tsf/tsfcompart/winres.h and just added it to the root of the project folder. I had to replace '#include ' with '#include "winres.h"'.

    I don't know about the built-in plugins source code. Some don't have a dev file and they always throw errors when compiling. I've managed to add working third party ones from emulator zone and the ones from 1.9.93 beta release "pcsxr-1.9.93-win32.zip" and managed to get 1.9.93 working great.