Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 75391 - games-emulation/darcnes joypad emulation has been broken for some time.
Summary: games-emulation/darcnes joypad emulation has been broken for some time.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-22 19:07 UTC by Alastair Bridgewater
Modified: 2005-03-13 00:30 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alastair Bridgewater 2004-12-22 19:07:11 UTC
At some point in the past, the meaning of a 0-length array at the end of a struct definition in C changed. With this change, static initialization of such an array with an arbitrary amount of data will fail, giving a warning message about excess elements in an initializer. DarcNES uses such an array to store information about the button mapping for joypad controllers.

Reproducible: Always
Steps to Reproduce:
1. emerge darcnes.
2. run darcnes on any NES, SMS, GG, PCE, SG-1000, etc. ROM.
3. try to play.

Actual Results:  
Controller emulation is badly messed up, game is unplayable.

Expected Results:  
Controller emulation should work reasonably well (arrows, a, s, [, and ]), game
should be playable.

Patch to fix problem should be as follows:

diff -Naur old/ui.h new/ui.h
--- old/ui.h	2000-06-28 21:06:05.000000000 -0400
+++ new/ui.h	2003-12-23 23:49:42.000000000 -0500
@@ -37,7 +37,7 @@
 
 struct joypad_button_template {
     int num_buttons;
-    unsigned long buttons[0];
+    unsigned long buttons[];
 };
 
 struct joypad {
Comment 1 Mr. Bones. (RETIRED) gentoo-dev 2005-03-13 00:30:31 UTC
Went ahead and added this to the ebuild.  No rev bump.  resync/remerge to get the chagne.  Thanks for the bug report and patch.