simias / rustation

Playstation emulator in the Rust programing language
Other
552 stars 21 forks source link

Windows support #12

Closed simias closed 8 years ago

simias commented 8 years ago

Make sure the emulator works on Windows, write a guide on how to build it there.

simias commented 8 years ago

I managed to build rustation on Windows 7, here's the procedure I followed:

I used the 32bit version but the 64bit version should work as well.

By default the setup doesn't add rustc and cargo to PATH but there's an option in the setup to do it, I enabled it.

https://github.com/alexcrichton/gcc-rs#compile-time-requirements

I installed MinGW 32bits (it must match rust's architecture). You can find an installer here:

http://sourceforge.net/projects/mingw/files/MinGW/

Yes, people still use sourceforge in 2015. Try to avoid the malware.

I used the custom package manager because apparently Windows developpers are still stuck in the dark ages.

For 64bit builds you might need http://mingw-w64.org/doku.php but I haven't tried it.

Don't forget to add the path to gcc.exe to the PATH in your environment variables.

It's possible to use Visual Studio's compiler instead by using a different target triple. I haven't tried it myself because the less I use VS the better. Look at gcc-rs' README above for more info.

You should end up with a linking error since cargo won't find SDL2.dll

Download the 32 or 64bit version depending on the rust/MinGW architecture you chose.

Finally you should be able to run the emulator using cargo run --release path\to\bios [path\to\game.bin]. If you don't provide the game binary image it'll just boot to the BIOS menu.

The result:

rustation-windows

It's not great though, the image flickers a lot and the performance is much worse than on my linux box (even though it has both a weaker CPU and GPU...), probably an OpenGL issue?

simias commented 8 years ago

Hopefully this is not relevant anymore since we moved to libretro.