schellingb / dosbox-pure

DOSBox Pure is a new fork of DOSBox built for RetroArch/Libretro aiming for simplicity and ease of use.
GNU General Public License v2.0
759 stars 62 forks source link

Visual StudioCompilation in Visual Studio 2019 and newer #419

Closed altiereslima closed 1 year ago

altiereslima commented 1 year ago

I can compile successfully in Visual Studio, but it looks different (theme) and only runs some games. Sem título

schellingb commented 1 year ago

Which games do not run?

altiereslima commented 1 year ago

Theme Park, Theme Hospital, FIFA Soccer 96

altiereslima commented 1 year ago

and more

schellingb commented 1 year ago

In what ways do these games not work? Describing the problem with more details would be much more helpful to actually fix it.

altiereslima commented 1 year ago

The games just don't open. dosbox_pure_libretro.zip

schellingb commented 1 year ago

Using your DLL I get a crash upon game start. It does not happen with the version I compile with Visual Studio myself. Can you open the project in your Visual Studio, switch the build configuration in the top menu bar from "Release" to "Debug" and leave the build platform at "x64" and then select "Build Solution" from the BUILD menu.

Then in your project directory, under \build\Debug_64bit\ you will find 2 files 'dosbox_pure_libretro.dll' and 'dosbox_pure_libretro.pdb' which you can ZIP up and upload here again. With this I can debug your build.

If instead you know yourself how to attach the debugger to RetroArch while running a debug build, you can see yourself where it crashes.

altiereslima commented 1 year ago

Debug_64bit.zip

schellingb commented 1 year ago

What Visual Studio version are you using? Looks like it generates broken code when it comes to the DOSBox dynamic recompilation core. If you really want to use your own compiled build, you can switch the Advanced > CPU Core setting to Normal (Interpreter) in the Core Options > System menu.

EDIT: Alternative would be to switch to a different version of Visual Studio or a different build system like MSYS2 to build.

altiereslima commented 1 year ago

I build it in Visual Studio 2019 and 2022. I'm not sure how to build it in MSYS2.

schellingb commented 1 year ago

Looks like DOSBox-X figured this one out, VS2019 and newer create broken code when compiling with optimizations. The latest version should work for you now. Thanks for reporting!