Installing DeSmuME from source on Windows

From DeSmuME
(Difference between revisions)
Jump to: navigation, search
m
(Retrieving the sources)
 
(10 intermediate revisions by one user not shown)
Line 1: Line 1:
 
== Supported Compilers ==
 
== Supported Compilers ==
Since all of the Windows developers make use of Microsoft Visual C++, only that compiler is supported on Windows.  
+
Since all of the Windows developers make use of Microsoft Visual Studio, only that compiler is supported on Windows.  
  
== Pre-requisites ==
+
== Prerequisites ==
Since DeSmuME source code comes with the necessary DirectX files, installation of the DirectX SDK is unnecessary. Also, all of the other dependencies are included in the source code download. The only things you are required to install is a supported compiler, and (when checking out SVN), a SVN client.
+
All dependencies are included in the source code download. The only things you are required to install is a supported compiler, and (when checking out SVN), a SVN client.
  
== Install Microsoft Visual C++ 2008 Express ==
+
== Install Microsoft Visual Studio Community 2015 ==
For a Windows build, you first have to download and install Microsoft Visual C++ Express Edition (which is free).
+
For a Windows build, you first have to download and install Microsoft Visual Studio Community 2015 (which is free).
Go to http://www.microsoft.com/express/vc/ , choose your language and download it. Unfortunately this leads to 2010 express edition which is troublesome. If you click around there you can find 2008, but if your skills at clicking are handicapped for some reason, then you can use this link directly to the english version: http://download.microsoft.com/download/A/5/4/A54BADB6-9C3F-478D-8657-93B3FC9FE62D/vcsetup.exe
+
Download the web or ISO installer from the links at https://stackoverflow.com/questions/44290672/how-to-download-visual-studio-community-edition-2015-not-2017#answer-44290942
  
== Retrieving the sources ==
+
Change the installation type to Custom and next. Now make sure you select open up Programming Languages > Visual C++ and select "Common Tools for Visual C++ 2015" and "Windows XP Support for C++". The latter option adds significant size, but it's what desmume is using. Now you can unclick "Windows and Web Development".  
There are 2 ways you can get the code.  
+
  
 +
To be clear, this should leave only the two items mentioned above being installed.
  
''Get code from source tarball''
+
From there you can proceed with the installation and you'll have what you need.
  
Go to http://desmume.svn.sourceforge.net/viewvc/desmume/trunk/ and select “Download GNU Tarball”.  
+
== Retrieving the sources ==
 +
There are 2 ways you can get the code.  
  
[[Image:Immagine_2.png]]
+
Download it here https://github.com/TASVideos/desmume/archive/master.zip.
  
Download it and open with your archive manager (if you haven’t one, I suggest 7zip at http://www.7-zip.org/).  
+
Open with your archive manager (if you haven’t one, I suggest 7zip at http://www.7-zip.org/).  
 
+
[[Image:Immagine3.png]]
+
 
+
Inside there is another one archive, open it and you’ll see the source code.
+
 
+
[[Image:Immagine4.png]]
+
  
 
Extract into a folder of your choice. Now are you ready to compile.
 
Extract into a folder of your choice. Now are you ready to compile.
  
'''The main advantage here is you don’t need the SVN client, the disadvantage is that every time a new SVN is released you need to download again the entire source tarball.'''
+
'''The main advantage here is you don’t need the Git client, the disadvantage is that every time a new Git is released you need to redownload the entire source.'''
  
  
''Get code with SVN client''
+
''Get code with Git client''
  
Go to http://tortoisesvn.net/downloads, download TortoiseSVN, install it then reboot.Now create a folder where the code will be downloaded (ex. D:\Desmume\source). Right click on it and select “TortoiseSVN->Checkout…”
+
You can follow guides which you can find anywhere online for how to clone a git repository. But for some reason we chose to write another guide here. This one may not be great.
  
[[Image:Immagine7.png]]
+
Go to http://tortoisesvn.net/downloads, download TortoiseGIT, install it then reboot. Now create a folder where the code will be downloaded (ex. D:\Desmume\source). Right click on it and select “TortoiseGit->Clone...”
  
Add https://desmume.svn.sourceforge.net/svnroot/desmume/trunk/desmume/ to “Url of Depository”, then press OK.
+
Enter https://github.com/TASVideos/desmume.git for the URL, then press OK
 
+
[[Image:Immagine8.png]]
+
 
+
 
+
Wait until TortoiseSVN has downloaded all the source files then press OK.
+
 
+
[[Image:Immagine6.png]]
+
  
 +
Wait until TortoiseGit has downloaded all the source files then press OK.
  
 
Now you’re ready to compile.
 
Now you’re ready to compile.
  
'''The main advantage here is that TortoiseSVN will download only the modified files when you check for a new SVN version, the disadvantage is that the first time take a while to download all the code. When you want to update the source code you only need to do “TortoiseSVN->Update”.'''
+
'''The main advantage here is that TortoiseGit will download only the modified files when you check for a new Git version, the disadvantage is that the first time take a while to download all the code. When you want to update the source code you only need to do “TortoiseGit->Pull and click OK”.'''
  
 
== Compile your SVN ==
 
== Compile your SVN ==
  
In "…/desmume/src/windows" open Desmume2008.vcproj.  
+
In "desmume/src/frontend/windows" open DeSmuME.sln
  
[[Image:Immagine_5.png]]
+
Then Visual Studio should open up. Change "Debug" to "Release" where you can readily see it on the screen. If you see x86 nearby, change it to x64.  Now press CTRL+ALT+F7.
  
Then Visual Studio should open up. Change from the menu to “Release” as showed in the picture then press CTRL+ALT+F7.
+
After the compile completes, the executable should be located in "desmume/src/frontend/windows/__bins/DeSmuME-VS2015-x64-Release.exe".
 
+
[[Image:Immagine_9.png]]
+
 
+
 
+
You mighy have noticed two other options: '''Dev+''' takes less time to build but lacks of some speed optimization on emulation and '''Debug''' that is useful for deeper debugging purpose, using breakpoints and variable watches but much more slower on emulation than Release.
+
 
+
 
+
After the compile completes, the executable should be located in "…/desmume/src/windows \__bins\DeSmuME_VS2008_release.exe".  
+
 
+
[[Image:Immagine_10.png]]
+
  
 
== Useful Tips ==
 
== Useful Tips ==
  
*As of SVN revision 1948, all builds are SSE2 enabled. SSE2 is one of the IA-32 SIMD (Single Instruction, Multiple Data) instruction sets. SSE2 was first introduced by Intel with the initial version of the Pentium 4 in 2001. Rival chip-maker AMD added support for SSE2 with the introduction of their Opteron and Athlon 64 ranges of AMD64 64-bit CPUs in 2003. If your computer does not support SSE2, then you can disable it by defining 'NOSSE2', and change it in the VC++ codegen options too.  
+
If your system can't support Visual Studio 2015, you can use Visual C++ Express 2010 instead. Microsoft has hidden it so you can use this direct URL:
 
+
http://download.microsoft.com/download/1/D/9/1D9A6C0E-FC89-43EE-9658-B9F0E3A76983/vc_web.exe . From there, you'll have to improvise. The steps are very similar to what's above. Use DeSmuME_2010.bat instead of DeSmuME.sln, however.
*If you have done a previous build, and updated the sources via SVN since then, you should first clean the solution by choosing 'Build / Clean Solution' from the menu.
+

Latest revision as of 06:25, 1 July 2018

Contents

Supported Compilers

Since all of the Windows developers make use of Microsoft Visual Studio, only that compiler is supported on Windows.

Prerequisites

All dependencies are included in the source code download. The only things you are required to install is a supported compiler, and (when checking out SVN), a SVN client.

Install Microsoft Visual Studio Community 2015

For a Windows build, you first have to download and install Microsoft Visual Studio Community 2015 (which is free). Download the web or ISO installer from the links at https://stackoverflow.com/questions/44290672/how-to-download-visual-studio-community-edition-2015-not-2017#answer-44290942

Change the installation type to Custom and next. Now make sure you select open up Programming Languages > Visual C++ and select "Common Tools for Visual C++ 2015" and "Windows XP Support for C++". The latter option adds significant size, but it's what desmume is using. Now you can unclick "Windows and Web Development".

To be clear, this should leave only the two items mentioned above being installed.

From there you can proceed with the installation and you'll have what you need.

Retrieving the sources

There are 2 ways you can get the code.

Download it here https://github.com/TASVideos/desmume/archive/master.zip.

Open with your archive manager (if you haven’t one, I suggest 7zip at http://www.7-zip.org/).

Extract into a folder of your choice. Now are you ready to compile.

The main advantage here is you don’t need the Git client, the disadvantage is that every time a new Git is released you need to redownload the entire source.


Get code with Git client

You can follow guides which you can find anywhere online for how to clone a git repository. But for some reason we chose to write another guide here. This one may not be great.

Go to http://tortoisesvn.net/downloads, download TortoiseGIT, install it then reboot. Now create a folder where the code will be downloaded (ex. D:\Desmume\source). Right click on it and select “TortoiseGit->Clone...”

Enter https://github.com/TASVideos/desmume.git for the URL, then press OK

Wait until TortoiseGit has downloaded all the source files then press OK.

Now you’re ready to compile.

The main advantage here is that TortoiseGit will download only the modified files when you check for a new Git version, the disadvantage is that the first time take a while to download all the code. When you want to update the source code you only need to do “TortoiseGit->Pull and click OK”.

Compile your SVN

In "desmume/src/frontend/windows" open DeSmuME.sln

Then Visual Studio should open up. Change "Debug" to "Release" where you can readily see it on the screen. If you see x86 nearby, change it to x64. Now press CTRL+ALT+F7.

After the compile completes, the executable should be located in "desmume/src/frontend/windows/__bins/DeSmuME-VS2015-x64-Release.exe".

Useful Tips

If your system can't support Visual Studio 2015, you can use Visual C++ Express 2010 instead. Microsoft has hidden it so you can use this direct URL: http://download.microsoft.com/download/1/D/9/1D9A6C0E-FC89-43EE-9658-B9F0E3A76983/vc_web.exe . From there, you'll have to improvise. The steps are very similar to what's above. Use DeSmuME_2010.bat instead of DeSmuME.sln, however.

Personal tools