byuu's message board
For discussion of projects related to www.byuu.org/

FAQ
• Search • Logout [ azamenmon ]

User Control Panel • 0 new messages

Last visit was: 2011-01-18 at 07:58 PM

It is currently 2011-01-19 at 02:56 PM

View unanswered posts | View active topics
View new posts | View your posts

Board index » Site-specific » bsnes

All times are UTC [ DST ]

bsnes compilation guide for Windows

Page 1 of 17

[ 249 posts ]

Go to page 1, 2, 3, 4, 5 ... 17  Next

Subscribe topic | Bookmark topic | Print view | E-mail friend

Previous topic | Next topic

bsnes compilation guide for Windows

Author

Message

Ver Greeneyes

Joined: 2009-04-10 at 04:38 PM

Posts: 1427
Location: The Netherlands

bsnes compilation guide for Windows

This step-by-step guide assumes you're using Windows XP or up, with no previous compilation environment installed.

1a) Download the latest version of the TDM-GCC - either the Bundle or the On-Demand Installer.
1b) Install 'MinGW/TDM (32-bit)' (this guide assumes the default destination of 'C:\MinGW32' is chosen); on the Choose Components screen, enable 'openmp' in the 'gcc' section (this is needed for the multi-threaded HQ2x filter).
Note: The installer adds the MinGW binaries directory ('C:\MinGW32\bin' by default) to your PATH environment variable, but it adds it at the end. Thus you may choose to move it up to the front so that its files get priority over any other software that might include them (e.g. The GIMP).
Note: Tested with 4.5.1 on 9 September 2010.

2a) Download and install the DirectX SDK (June 2010); only the Headers and Libs are strictly required.
Note: Direct link at time of writing (9 September 2010).
2b) Navigate to the DirectX SDK's Include directory and copy and paste all the files there into MinGW's include directory ('C:\MinGW32\include' by default).
2c) Grab MinGW-compatible versions of ddraw.h, dsound.h and xinput.h from here or here and overwrite the versions contained in MinGW's include directory ('C:\MinGW32\include' by default).
Note: As of the June 2010 release, the DirectX SDK no longer contains ddraw.h, so the version linked to above is the one included in the Windows 7 SDK.

3) Download the OpenGL glext.h and drop it in MinGW's include\GL directory ('C:\MinGW32\include\GL' by default).

4a) Download the Qt libraries 4.6.0 beta 1 (source package).
4b) Extract the package to a directory of your choice (this guide will assume a default of 'C:\Qt').
Note: Since the archive includes a base directory, make sure you extract the files inside it to the location you chose, rather than the directory itself.
4c) Add Qt's bin directory ('C:\Qt\bin' by default) to your PATH environment variable.
4d) Create a new environment variable called QTDIR and set it to Qt's base directory ('C:\Qt' by default).
Note: This may or may not be required for the 'configure' command below to work.

5a) Open a cmd window and navigate to the directory where you installed Qt.
5b) Configure and build Qt using the following commands:

Code:

configure -platform win32-g++ -release -opensource -confirm-license -nomake examples -nomake demos -no-exceptions -no-accessibility -ltcg -no-dsp -no-vcproj -no-vcp -no-rtti -no-stl -no-sql-sqlite -qt-style-windowsxp -qt-style-windowsvista -no-style-plastique -no-style-cleanlooks -no-style-motif -no-style-cde -no-qt3support -no-3dnow -no-sse -no-sse2 -no-openssl -no-dbus -no-qdbus -no-phonon -no-phonon-backend -no-multimedia -no-script -no-scripttools -no-webkit -no-cetest -no-s60

mingw32-make -s -j 4 sub-src

6a) Download and extract the latest cross-platform source code for bsnes from here or here (beta versions).
6b) Run 'cc.bat' to compile bsnes.
Note 1: If the package you downloaded included them, remove 'pthreadGC2.dll', 'QtCore4.dll' and 'QtGui4.dll' or replace them with your own.
Note 2: Likewise, bsnes' multithreaded HQ2x filter requires 'libgomp-1.dll', which can be found in MinGW's binaries directory ('C:\MinGW32\bin' by default).
Note 3: If you wish to compile bsnes to use SSE instructions, you must also add -fno-tree-vectorize to the makefile, due to stack alignment issues involving certain SSE instructions and Qt. In addition, consider configuring Qt itself with the -sse flag instead of the -no-sse flag specified above.

7) Profit!
Note: To get the full functionality out of bsnes, you will need to compile the supergameboy, snesfilter and snesreader extensions, all of which are included in the source package. If you have followed this guide, they should compile just fine.

_________________
bsnes compilation guide for Windows (need to add x64 build instructions)
Frequency Test 1.6, or Frequency Test 2.1 (for use with my updated Direct3D driver)

Last edited by Ver Greeneyes on 2010-09-09 at 07:16 AM, edited 110 times in total.

2009-05-11 at 01:34 PM

Jipcy

Joined: 2009-04-11 at 02:31 AM

Posts: 75

Re: bsnes compilation guide for Windows

Just to be sure, what are the main benefits of compiling for oneself? Processor-specific optimizations?

2009-05-11 at 02:58 PM

Ver Greeneyes

Joined: 2009-04-10 at 04:38 PM

Posts: 1427
Location: The Netherlands

Re: bsnes compilation guide for Windows

Jipcy wrote:

Just to be sure, what are the main benefits of compiling for oneself? Processor-specific optimizations?

No benefits, really. Bsnes is pretty optimised as it is. But if you want to mess around with the source code.. (as I have in the past)

_________________
bsnes compilation guide for Windows (need to add x64 build instructions)
Frequency Test 1.6, or Frequency Test 2.1 (for use with my updated Direct3D driver)

2009-05-11 at 03:41 PM

byuu

Joined: 2009-04-10 at 03:00 PM

Posts: 4208

Re: bsnes compilation guide for Windows

Thanks for the guide. If you want to perfectly match my build size, you'd also want to edit the Qt mkspecs to add -Os -fomit-frame-pointer in place of -O2. I wouldn't bother for personal use.

Optimizing for your native architecture (-march=foo) could add up to a ~10-15% speedup over the vanilla builds (amd64 users get most of this by default, since the oldest amd64 chip has eg SSE3), but you'd also have to profile it. Quite a bit of work for an ordinary user.

Quote:

8) Navigate to the DirectX SDK's Lib directory and open the x86 subdirectory, then find 'XInput.lib'. Copy and paste it into MinGW's lib directory, then rename it to 'libxinput.a'.

Yeah, this part sucks. But any time I try and call XInputGetState from a pointer via GetProcAddress, the whole program crashes. It must be conflicting with some other driver already loaded.

EDIT: found it. I was binding to:
DWORD (*XInputGetState)(DWORD, XINPUT_STATE*);

I omitted the WINAPI part, which was corrupting the stack. Needs to be:
DWORD WINAPI (*XInputGetState)(DWORD, XINPUT_STATE*);

WINAPI = __stdcall, it changes the calling convention to Windows' style, whereas -O2 defaults the convention to __fastcall.

Unfortunately, nall::function<> can't bind with different calling conventions specified, so I'll have to do that call the old fashioned way as above.

Next build shouldn't require xinput1_3.dll, but won't support Xbox 360 triggers properly without it. It also won't require libxinput.a either way.

_________________
Morality is simply the attitude we adopt to people we personally dislike. — Oscar Wilde

2009-05-11 at 04:14 PM

Ver Greeneyes

Joined: 2009-04-10 at 04:38 PM

Posts: 1427
Location: The Netherlands

Re: bsnes compilation guide for Windows

Quote:

Optimizing for your native architecture (-march=foo) could add up to a ~10-15% speedup over the vanilla builds (amd64 users get most of this by default, since the oldest amd64 chip has eg SSE3), but you'd also have to profile it. Quite a bit of work for an ordinary user.

I'm not seeing a lot of difference between a build without any processor-specific features and one with all the bells and whistles enabled - is profiling needed before the difference will show up?

_________________
bsnes compilation guide for Windows (need to add x64 build instructions)
Frequency Test 1.6, or Frequency Test 2.1 (for use with my updated Direct3D driver)

2009-05-11 at 07:05 PM

byuu

Joined: 2009-04-10 at 03:00 PM

Posts: 4208

Re: bsnes compilation guide for Windows

Well, I get ~152fps with no profling on Win32 and Linux32, and ~168fps with no profiling on Linux64. Nach's theory was that the default march is higher. It could be the 64-bitness that helps. bsnes should also be compilable as 64-bit on Windows, but I don't have the compiler to do it myself.

_________________
Morality is simply the attitude we adopt to people we personally dislike. — Oscar Wilde

2009-05-11 at 07:07 PM

Ver Greeneyes

Joined: 2009-04-10 at 04:38 PM

Posts: 1427
Location: The Netherlands

Re: bsnes compilation guide for Windows

byuu wrote:

bsnes should also be compilable as 64-bit on Windows, but I don't have the compiler to do it myself.

Pity TDM/MinGW doesn't include x64 support..

_________________
bsnes compilation guide for Windows (need to add x64 build instructions)
Frequency Test 1.6, or Frequency Test 2.1 (for use with my updated Direct3D driver)

2009-05-11 at 07:57 PM

Screwtape

Joined: 2009-04-11 at 04:21 AM

Posts: 902

Re: bsnes compilation guide for Windows

byuu wrote:

It could be the 64-bitness that helps.

I believe the common wisdom is that speed-up from x86_64's reasonably-sized set of general-purpose registers more than compensates for the slow-down caused by L1/L2 cache being wasted on enormous pointers.

In every other architecture with 32-bit and 64-bit variants, the 64-bit version was much slower. The only reason x86 is different is that x86_32 was such a dog to begin with.

2009-05-12 at 01:14 AM

Dullaron

Joined: 2009-04-10 at 06:40 PM

Posts: 101

Re: bsnes compilation guide for Windows

I updated my page with downloads. I notice bsnes.exe size got bigger after I remake it with the newest QT and TDM.

_________________
Window 7 Home Premium 32-bit / Intel Core 2 Quad Q6600 2.40Ghz / 3.00 GB RAM / ATI Radeon HD 4670 1GB Memories
bsnes compilation guide for Windows by Ver Greeneyes - viewtopic.php?f=3&t=74

2009-05-13 at 01:59 AM

Ver Greeneyes

Joined: 2009-04-10 at 04:38 PM

Posts: 1427
Location: The Netherlands

Re: bsnes compilation guide for Windows

Dullaron wrote:

I updated my page with downloads. I notice bsnes.exe size got bigger after I remake it with the newest QT and TDM.

Yeah, that's because of this:

byuu wrote:

If you want to perfectly match my build size, you'd also want to edit the Qt mkspecs to add -Os -fomit-frame-pointer in place of -O2.

I'm not sure how to do that and I figured it wasn't important for the guide.

_________________
bsnes compilation guide for Windows (need to add x64 build instructions)
Frequency Test 1.6, or Frequency Test 2.1 (for use with my updated Direct3D driver)

2009-05-13 at 10:48 AM

Nach

Joined: 2009-04-13 at 05:50 AM

Posts: 92

Re: bsnes compilation guide for Windows

Anyone interested in bget?

_________________
"When we (the MPAA) finally employ unbreakable DRM on our content, it will be using tools provided to us by the free and open source community."

2009-05-13 at 09:02 PM

panzeroceania

Joined: 2009-04-10 at 10:30 PM

Posts: 1188
Location: Salem, Oregon

Re: bsnes compilation guide for Windows

Nach wrote:

Anyone interested in bget?

YES I used to swear by zget, that would be awesome.

and if you're joking.... that's just cruel.

although it really doesn't matter with bsnes considering how byuu releases. basically I'm actually just broken up about zsnes being MIA. zget makes sense for zsnes.

_________________
if you don't know who my avatar is, his name is Paet. He is a mechanic.

2009-05-13 at 09:49 PM

Dullaron

Joined: 2009-04-10 at 06:40 PM

Posts: 101

Re: bsnes compilation guide for Windows

Last time I try zget it no longer let me download the zsnes updates or what ever. Seem totally dead.

But if byuu keep it alive and working then I will use bget.

_________________
Window 7 Home Premium 32-bit / Intel Core 2 Quad Q6600 2.40Ghz / 3.00 GB RAM / ATI Radeon HD 4670 1GB Memories
bsnes compilation guide for Windows by Ver Greeneyes - viewtopic.php?f=3&t=74

2009-05-14 at 05:01 AM

Screwtape

Joined: 2009-04-11 at 04:21 AM

Posts: 902

Re: bsnes compilation guide for Windows

I'm not familiar with zget, but I expect it's based on pulling the latest version from zsnes' public source repository. As far as I know bsnes doesn't have such a thing, so automation would likely be... difficult.

2009-05-14 at 05:34 AM

Jipcy

Joined: 2009-04-11 at 02:31 AM

Posts: 75

Re: bsnes compilation guide for Windows

Also, I think the current ZSNES source is not available to the public. I don't think they use SourceForge or BountySource anymore.

2009-05-15 at 02:06 AM

Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending

Page 1 of 17

[ 249 posts ]

Go to page 1, 2, 3, 4, 5 ... 17  Next

Board index » Site-specific » bsnes

All times are UTC [ DST ]

Who is online

Users browsing this forum: azamenmon, Łukasz Krawczyk and 1 guest

You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You cannot delete your posts in this forum

Search for:

Jump to:

Select a forum
------------------ Site-specific
News
bsnes
Alternative Versions
SNES Preservation
General
General Discussion
Programming
Emulation
ROM Translation and Hacking
SNES Development

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.

Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.