Dolphin, the GameCube and Wii emulator - Forums

Full Version: [patches] FreeBSD support
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
Hi everybody,

Trying to make a FreeBSD port of Dolphin, I have had to use the attached patches to be able to build and run it. They apply to SVN rev. 5215.

Dolphin successfully builds on FreeBSD 8-STABLE and 9-CURRENT on i386 and amd64 architectures with videoSoftware plugin (Cg is not available on FreeBSD).

Unfortunately, I don't own much games, so I could only test Mario Kart and Zelda.

On a 32bit system I can get the Wii welcome screen of Mario Kart, but the game quickly crashes with the following message :

Assertion failed: (c->out.request == c->out.request_written), function
xcb_take_socket, file xcb_out.c, line 272.

I have had no time to go further this error message.

On a 64bit system, Mario Kart does not start at all and I get the following message :

31:46:040 Source/Core/Common/Src/MsgHandler.cpp:53 E[*]: Warning: CALL out of
range (0x805dfc020 calls 0x4c4a80)

Zelda does not start at all.

I hope the attached patches will be useful to you, and be a first step towards
FreeBSD support. The ones marked -TOTEST- should be double-checked before being
applied.

Please, also note that the port will not be ready until per-user configuration is supported.

Best regards.

pollito

Hi martymac.

Sorry to bump an old thread. Good news about the FreeBSD port. Smile I would love to test your patch on my system (FreeBSD 8.0 / i386), but I'm not a programmer and don't know how to apply it. Is there a guide around that I might find useful?

Regards,
pollito.
Hi pollito,

No, there is no guide, but I have a beta-version of a port of Dolphin, including all of those patches. If you want to test it, I think it will be easier for you.

Remember that it is work in progress ; the port is not finished and Dolphin does not seem to work yet. Anyway, if you want to test it, download this tarball :

http://contribs.martymac.org/FreeBSD-ports/sandbox/dolphin-emu-r5215-port.tgz

then, as root, do the following :

- extract it to /usr/ports/emulators (to get a dolphin-emu/ sub-directory)
- go into /usr/ports/emulators/dolphin-emu/ and type 'make' (not 'make install' !)

The port should fetch the SVN snapshot I worked on and try to buid Dolphin.

- once built, chown -R <your login> the work/ directory

then, as <your login> :

- go to the work/dolphin-emu-r5215/Binary/FreeBSD-i386/ directory
- run ./dolphin-emu

Configure Dolphin and try to run either a backup ISO or an original DVD (not tested).

To clean everything up, return to the port's main directory and type 'make clean'. Remember not to 'make install' the port as the pkg-plist is not up-to-date (you will spread files on your system), and Dolphin is not ready for per-user configuration files.

Tell us how your tests went...

Good luck ;-)
Hi everyone,

I've been able to update the port. It now runs fine on i386 with software rendering (only).

You can give the port a try here :

http://contribs.martymac.org/FreeBSD-ports/sandbox/dolphin-emu-3.0.r7627-port.tgz

# cd /usr/ports/emulators && tar xvzf dolphin-emu-3.0.r7627-port.tgz
# cd dolphin-emu && make install clean

Note that you should have previously installed a patched version of devel/sfml, see this PR :

http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/158721

Unfortunately, I am still unable to get it working on amd64 ; it may be related to the fact that FreeBSD misses the MAP_32BIT flag for mmap(2). I've tried a workaround using MAP_FIXED (see files/patch-TOTEST-Source-Core-Common-Src-MemoryUtil.cpp patch), but it does not seem to work anyway : the game starts without warnings but shows a black screen and immediately crashes.

Also, OpenGL rendering makes dolphin crash at game startup, even on i386.

I would be happy to get comment on this work ; fixes are also welcome :)

Best regards,

Martymac.
You should try talking with some of the devs on IRC about comitting your FreeBSD support. (#dolphin-emu on efnet)
(07-13-2011, 04:06 PM)Toad King Wrote: [ -> ]You should try talking with some of the devs on IRC about comitting your FreeBSD support. (#dolphin-emu on efnet)

Thanks, I'll try to get in touch with one of Dolphin's devs.

Meanwhile, I've found the the OpenGL crash is probably due to the lack of support of GL_EXT_framebufer_object on my laptop : dolphin crashes at the first call of glGenFramebuffersEXT() (at Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp:143).

Here are Dolphin logs :

Code:
00:04:195 /files/Ports/ports/emulators/dolphin-emu/work/dolphin-emu-3.0.r7627/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp:272 I[Video]: Supported OpenGL Extensions:
00:04:195 /files/Ports/ports/emulators/dolphin-emu/work/dolphin-emu-3.0.r7627/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp:273 I[Video]: GL_ARB_depth_texture GL_ARB_fragment_program GL_ARB_multisample GL_ARB_multitexture GL_ARB_point_parameters GL_ARB_shadow GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_mirrored_repeat GL_ARB_texture_non_power_of_two GL_ARB_texture_rectangle GL_ARB_transpose_matrix GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_window_pos GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_logic_op GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_clip_volume_hint GL_EXT_cull_vertex GL_EXT_compiled_vertex_array GL_EXT_copy_texture GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_pixels GL_EXT_point_parameters GL_EXT_polygon_offset GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_
00:04:196 /files/Ports/ports/emulators/dolphin-emu/work/dolphin-emu-3.0.r7627/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp:274 I[Video]:

00:04:216 /files/Ports/ports/emulators/dolphin-emu/work/dolphin-emu-3.0.r7627/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp:306 E[Video]: GPU: ERROR: Need GL_EXT_framebufer_object for multiple render targets.
GPU: Does your video card support OpenGL 2.x?
00:04:216 /files/Ports/ports/emulators/dolphin-emu/work/dolphin-emu-3.0.r7627/Source/Plugins/Plugin_VideoOGL/Src/PixelShaderCache.cpp:82 I[Video]: pixel max_alu=64, max_inst=96, max_attrib=11

I'll try to test the emulator on another machine.

Best regards.
(07-12-2011, 04:52 PM)martymac Wrote: [ -> ]Unfortunately, I am still unable to get it working on amd64 ; it may be related to the fact that FreeBSD misses the MAP_32BIT flag for mmap(2). I've tried a workaround using MAP_FIXED (see files/patch-TOTEST-Source-Core-Common-Src-MemoryUtil.cpp patch), but it does not seem to work anyway : the game starts without warnings but shows a black screen and immediately crashes.

Also, OpenGL rendering makes dolphin crash at game startup, even on i386.

Hi everyone. Here is a new version of the port :

http://contribs.martymac.org/FreeBSD-ports/sandbox/dolphin-emu-3.0.r7627_2-port.tgz

This version builds and run fine on amd64, using MAP_FIXED instead of MAP_32BIT. The previous patch was mmap'ing several times to the same address ; this is now fixed.

OpenGL rendering also seems to work, but this is still to be confirmed.

Best regards,
I have updated the port to a git snapshot taken yesterday. I have also cleant a few dependencies.

You can download it here :

http://contribs.martymac.org/FreeBSD-ports/sandbox/dolphin-emu-3.0.r20110823-port.tgz

Dolphin now seems to run fine on FreeBSD x86 and amd64, but I still need feedback for OpenGL rendering (does it work on your box ?). MAP_FIXED hack seems to work ; software rendering and sound work fine.

Note: manually patching devel/sfml before installation is no more needed since ports/158721 has been committed.

Comments/help welcome...

Best regards,
(08-25-2011, 04:19 PM)martymac Wrote: [ -> ]I have updated the port to a git snapshot taken yesterday. I have also cleant a few dependencies.

You can download it here :

http://contribs.martymac.org/FreeBSD-ports/sandbox/dolphin-emu-3.0.r20110823-port.tgz

Dolphin now seems to run fine on FreeBSD x86 and amd64, but I still need feedback for OpenGL rendering (does it work on your box ?). MAP_FIXED hack seems to work ; software rendering and sound work fine.

Note: manually patching devel/sfml before installation is no more needed since ports/158721 has been committed.

Comments/help welcome...

Best regards,

Hello martymac

I appreciate the work you're doing for us bsd users. I was able to compile your port of dolphin successfully after updating my ports. However when I tried to play a gamecube ISO dolphin crashed on me. This was the console output:
Quote:$ dolphin-emu
The selected language is not supported by your system. Falling back to system default.
31:14:461 /usr/ports/emulators/dolphin-emu/work/dolphin-emu-3.0.r20110823/Source/Core/Common/Src/FileUtil.cpp:100 W[COMMON]: IsDirectory: stat failed on /home/froid/.dolphin-emu/Wii/title/00000001/00000002/content/: No such file or directory
31:14:462 /usr/ports/emulators/dolphin-emu/work/dolphin-emu-3.0.r20110823/Source/Core/DiscIO/Src/NANDContentLoader.cpp:225 E[DIO]: CreateFromDirectory: error opening /home/froid/.dolphin-emu/Wii/title/00000001/00000002/content/
31:14:610 /usr/ports/emulators/dolphin-emu/work/dolphin-emu-3.0.r20110823/Source/Core/Common/Src/FileUtil.cpp:100 W[COMMON]: IsDirectory: stat failed on /home/froid/.dolphin-emu/Wii/title/00000001/00000002/content/: No such file or directory
31:14:610 /usr/ports/emulators/dolphin-emu/work/dolphin-emu-3.0.r20110823/Source/Core/DiscIO/Src/NANDContentLoader.cpp:225 E[DIO]: CreateFromDirectory: error opening /home/froid/.dolphin-emu/Wii/title/00000001/00000002/content/
Failed to initialize GEM. Falling back to classic.
31:16:926 /usr/ports/emulators/dolphin-emu/work/dolphin-emu-3.0.r20110823/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp:468 N[Video]: glX-Version 1.2
31:16:926 /usr/ports/emulators/dolphin-emu/work/dolphin-emu-3.0.r20110823/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp:490 N[Video]: Got double buffered visual!
31:16:969 /usr/ports/emulators/dolphin-emu/work/dolphin-emu-3.0.r20110823/Source/Core/Core/Src/Boot/Boot.cpp:196 N[BOOT]: Booting /home/froid/qBT_dir/Zelda-The wind waker.iso
31:17:411 /usr/ports/emulators/dolphin-emu/work/dolphin-emu-3.0.r20110823/Source/Core/Core/Src/HLE/HLE_OS.cpp:52 N[OSREPORT]: 81200500->81300000| Apploader Initialized. $Revision: 31 $.
31:17:411 /usr/ports/emulators/dolphin-emu/work/dolphin-emu-3.0.r20110823/Source/Core/Core/Src/HLE/HLE_OS.cpp:52 N[OSREPORT]: 8120051c->81300000| This Apploader built Sep 5 2002 05:58:53
Abort trap (core dumped)
And here's gdb:
Quote:$ gdb
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd".
(gdb) core dolphin-emu.core
Core was generated by `dolphin-emu'.
Program terminated with signal 6, Aborted.
#0 0x2a31466b in ?? ()
(gdb)

Dolphin works slightly better for me when using
Quote:LIBGL_ALWAYS_INDIRECT=1
(stays up longer, prints hardware info+fps before crashing) but there's still no gl rendering.
Can you compile a debug build and post a backtrace of the crash?
Pages: 1 2 3 4 5