CaptainDreamcast / DolmexicaInfinite

Something resembling a Mugen port for Dreamcast.
MIT License
24 stars 5 forks source link

How do I compile it #1

Closed Mike77154 closed 4 years ago

Mike77154 commented 4 years ago

I am new on Dreamcast world, but I want compile this for windows for making a slighltly modifications

CaptainDreamcast commented 4 years ago

Hi Mike,

compiling Dolmexica is a bit difficult, it relies on a wrapper library called prism, which is basically what I call the stuff that carries over between my games.

Compiling prism for Windows requires linking several libraries. The compiled libraries are included in prism/windows/vs17/LIB, but it doesn't have the headers, you'd need to add them to the include path in visual studio yourself. Prism needs SDL2 (2.0.7), SDL2-image (2.0.1), SDL2-mixer (2.0.1), SDL2-ttf (2.0.14), libpng (1632), glew (2.1.0), zstd (master should work), zlib (1.2.11). The versions numbers are what I use, they may not be necessary. Additionally some hardcoded paths in the .vcproj files of Dolmexica and prism will have to be adapted to your new path. If you manage to get all these external dependencies working, you should adapt it with Visual Studio. I personally still use Visual Studio 2017 (15.9.7), but it should work with the newer version.

If you want to compile the Dreamcast version, you will need KallistiOS. After setting up KallistiOS and getting the example projects in there to work, you should check out prism in the /kos/addons folder and DolmexicaInfinite in the /kos folder. To compile prism, you already have SDL2 and everything as part of the KOS ports, but you will still need to compile the Dreamcast version of zstd and link against it when building DolmexicaInfinite. Additionally you will need to adapt the hardcoded paths in prism/Makefile.dc, prism/Makefile.commondc and DolmexicaInfinite/Makefile.dc. After that you can use make to build first prism, then DolmexicaInfinite, analogeous to the example projects in the KallistiOS repo.

On Web, things are a little different again, First off you'll need Emscripten, I personally try to use the newest version, so the newest should work. I compile prism via nmake (I use the one that's part of Visual Studio) via "nmake /f Makefile.web" Same for Dolmexica, that also has a Makefile.web I compile via "nmake /f Makefile.web". Dolmexica has two external dependencies: One is prism, the other is the zstd compression library again. The prism path can be set in Dolmexica's Makefile.web (you will also have to adjust the path to Makefile.commonweb). Zstd is not part of Emscripten, so I quickly adapted its makefile to be compilable with the emscripten compiler, the compiled version is part of the prism repo. Finally, the path to the zstd library is in prism's makefile.commonweb.

Compiling Dolmexica is pretty hard, this setup is basically my dev environment, which is always rapidly changing, so I never put effort into making it portable. Sadly, the maintenance effort for that would be pretty high, so I can't promise that I ever will. I am however currently planning to make Dolmexica independent from prism once version 1.0 comes around, which should hopefully happen around October. Either way, best of luck with adapting Dolmexica!