okay this is a very advanced topic and i only just recently found out about it myselve with the help of sms_sdl emulator which ran really crap under dingux and i couldn't figure out why.
people should start with reading this :
http://www.ibm.com/developerworks/library/pa-dalign/or
http://lecs.cs.ucla.edu/wiki/index.php/XScale_alignment (even though it's arm related)
now that you know what alignment issues are you might think what does this have to do with dingux
well the problem (we didn't know about until today) is that the mips linux kernel seems to handle aligment issues for us but at the cost of speed. in other words it will decrease performance a lot on software that got affected by it.
so now that we know al of this, how can we check if our software has the problem ? It's really easy add the following include file in your main c/cpp file :
#include <sys/sysmips.h>
and in your main function add the following call :
sysmips(MIPS_FIXADE, 0,0,0);
what this function does is disabling the kernel from intercepting the unalligned memory access and handling it by itselve.
recompile your program and run it.
If the program runs fine without crashing your program is not affected by the problem, however if your program crashes with a "Bus Error" message your program is affected by this issue and you should seek out a way to align your data (examples are given on both sites i mentioned above).
to see what kind of an performance impact this has lets take sms_sdl i had compiled it with and without memory alginement and here are the results :
/boot # ./sms_sdl ./sonic2.sms --fullspeed --fskip 0
SMS Plus/SDL v0.9.4aR7 (Build date Oct 17 2009)
(C) Charles Mac Donald in 1998, 1999, 2000
SDL Version by Gregory Montoir ([email protected])
Loaded `./sonic2.sms'.
Initializing SDL... Ok.
Initializing SDL TIMER SUBSYSTEM... Ok.
Initializing SDL CONTROLS SUBSYSTEM... Ok.
Initializing SDL VIDEO SUBSYSTEM... Ok.
Initializing SDL SOUND SUBSYSTEM... Ok.
Initializing virtual console emulation... Ok.
Starting emulation...
Shutting down virtual console emulation...
Shutting down SDL...
[INFO] Frames rendered = 1658.
[INFO] Average FPS = 52.79 (87%).
[INFO] Play time = 31.41 sec.
/boot # ./sms_sdl_aligned ./sonic2.sms --fullspeed --fskip 0
SMS Plus/SDL v0.9.4aR7 (Build date Oct 17 2009)
(C) Charles Mac Donald in 1998, 1999, 2000
SDL Version by Gregory Montoir ([email protected])
Loaded `./sonic2.sms'.
Initializing SDL... Ok.
Initializing SDL TIMER SUBSYSTEM... Ok.
Initializing SDL CONTROLS SUBSYSTEM... Ok.
Initializing SDL VIDEO SUBSYSTEM... Ok.
Initializing SDL SOUND SUBSYSTEM... Ok.
Initializing virtual console emulation... Ok.
Starting emulation...
Shutting down virtual console emulation...
Shutting down SDL...
[INFO] Frames rendered = 1665.
[INFO] Average FPS = 122.34 (203%).
[INFO] Play time = 13.61 sec.
/boot #
as you can see the unaligned version runs not even fullspeed it runs at 52 fps (87%) (the normal speed is 60 fps) while the alginment version runs at a whooping 122.34 fps average (203%).
So running a program that is affected with this problem will run very very bad with a lot of slowdowns.
I know of at least 1 other emulator that has this problem snes9x-sdl ! so speed could improve in snes9x-sdl as well given we align the data. i'll look into that some time or contact the current author thats currently doing snes9x ports so he knows about this.
Hope this helps !