Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#5839 - Use Menu API in Plugins

Attached to Project: Rockbox
Opened by Tom Ross (midgey34) - Friday, 18 August 2006, 09:57 GMT+2
Task Type Patches
Category Plugins
Status Closed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

I went through and adapted some of the plugins to use the standard Rockbox Menu API instead of their own implementation. The plugins changed were Dice, Disktidy, Minesweeper, Star, and Xobox. Some of the plugins also received slight cleanups and/or removed dead code and defines. One thing that could be improved is adding titles in these new menus since I couldn't figure out the correct way to implement one.
(application/octet-stream)    plugin_menu_api.patch (38.6 KiB)
 dice.c        |  222 ++++++++++++++++++++--------------------------------------
 disktidy.c    |  163 +++++++++++++++---------------------------
 minesweeper.c |  108 ++++++++++------------------
 snake.c       |   87 ++++++++--------------
 star.c        |  200 +++++-----------------------------------------------
 xobox.c       |  103 ++++++++++----------------
 6 files changed, 272 insertions(+), 611 deletions(-)

This task depends upon

Closed by  Tom Ross (midgey34)
Wednesday, 28 March 2007, 09:41 GMT+2
Reason for closing:  Accepted
Comment by Tom Ross (midgey34) - Wednesday, 25 October 2006, 06:59 GMT+2
Updated to CVS and broken into separate patch file
(application/octet-stream)    dice.patch (11.1 KiB)
 ./apps/plugins/dice.c |  222 +++++++++++++++++---------------------------------
 1 file changed, 78 insertions(+), 144 deletions(-)

(application/octet-stream)    disktidy.patch (6.2 KiB)
 ./apps/plugins/disktidy.c |  157 ++++++++++++++++------------------------------
 1 file changed, 55 insertions(+), 102 deletions(-)

(application/octet-stream)    minesweeper.patch (4.3 KiB)
 ./apps/plugins/minesweeper.c |  104 +++++++++++++------------------------------
 1 file changed, 32 insertions(+), 72 deletions(-)

(application/octet-stream)    snake.patch (4 KiB)
 ./apps/plugins/snake.c |   87 +++++++++++++++++++------------------------------
 1 file changed, 34 insertions(+), 53 deletions(-)

(application/octet-stream)    star.patch (8.2 KiB)
 ./apps/plugins/star.c |  200 +++++---------------------------------------------
 1 file changed, 21 insertions(+), 179 deletions(-)

(application/octet-stream)    xobox.patch (5 KiB)
 ./apps/plugins/xobox.c |  103 +++++++++++++++++++------------------------------
 1 file changed, 40 insertions(+), 63 deletions(-)

Comment by Chris (decayed.cell) - Tuesday, 02 January 2007, 08:18 GMT+2
dice.patch, disktidy.patch, minesweeper.patch, needs updating for 20070201 source. Others seem to work fine
Comment by Tom Ross (midgey34) - Friday, 05 January 2007, 20:09 GMT+2
I didn't know there was much of an interest in these patches. Here are updated versions, enjoy.
(application/octet-stream)    dice.patch (11.7 KiB)
 ./apps/plugins/dice.c |  241 +++++++++++++++++---------------------------------
 1 file changed, 86 insertions(+), 155 deletions(-)

(application/octet-stream)    disktidy.patch (8 KiB)
 ./apps/plugins/disktidy.c |  198 +++++++++++++---------------------------------
 1 file changed, 59 insertions(+), 139 deletions(-)

(application/octet-stream)    minesweeper.patch (4.3 KiB)
 ./apps/plugins/minesweeper.c |  106 ++++++++++++-------------------------------
 1 file changed, 32 insertions(+), 74 deletions(-)

Comment by Chris (decayed.cell) - Tuesday, 16 January 2007, 00:36 GMT+2
They need updating for latest SVN again :D coz the Sansa builds have the games now
Comment by Tom Ross (midgey34) - Thursday, 18 January 2007, 02:44 GMT+2
I committed a modified version of the disktidy patch to SVN. Expect more to come soon.
Comment by Chris (decayed.cell) - Tuesday, 06 March 2007, 12:16 GMT+2
Well its now March, have you had time for any updating?
Comment by Tom Ross (midgey34) - Friday, 16 March 2007, 07:29 GMT+2
Here's the newest patches. These versions fix issues with leaking menus and get rid of unnecessary changes. I'll commit these assuming there are no issues that creep up.
(application/octet-stream)    dice.diff (11.4 KiB)
 apps/plugins/dice.c |  232 +++++++++++++++++-----------------------------------
 1 file changed, 79 insertions(+), 153 deletions(-)

Comment by Tom Ross (midgey34) - Friday, 16 March 2007, 07:31 GMT+2
Err, hit the 'Add Comment' button a bit too early...
(application/octet-stream)    minesweeper.diff (4.4 KiB)
 apps/plugins/minesweeper.c |  115 ++++++++++++++-------------------------------
 1 file changed, 37 insertions(+), 78 deletions(-)

(application/octet-stream)    snake.diff (3.6 KiB)
 apps/plugins/snake.c |   90 +++++++++++++++++++--------------------------------
 1 file changed, 34 insertions(+), 56 deletions(-)

(application/octet-stream)    star.diff (14.1 KiB)
 apps/plugins/star.c |  338 ++++++++++++++--------------------------------------
 1 file changed, 91 insertions(+), 247 deletions(-)

(application/octet-stream)    xobox.diff (5.2 KiB)
 apps/plugins/xobox.c |   95 ++++++++++++++++++---------------------------------
 1 file changed, 35 insertions(+), 60 deletions(-)

Comment by Tom Ross (midgey34) - Friday, 16 March 2007, 22:22 GMT+2
Updated snake to fix a warning.
(application/octet-stream)    snake.2.diff (3.6 KiB)
 apps/plugins/snake.c |   90 +++++++++++++++++++--------------------------------
 1 file changed, 34 insertions(+), 56 deletions(-)

Comment by Tom Ross (midgey34) - Friday, 23 March 2007, 20:50 GMT+2
This should be the most up to date version of the patch. It currently uses the old menu API but I haven't been successful on learning the new version with all the macros. Anyway, this also eliminates a nasty global in Star and provides a work-around so that Star won't crash on the Gigabeat. The code that was crashing works fine in the sim, so I'm guessing there's an issue with the LCD driver.
(application/octet-stream)    plugin_menus.diff (41.5 KiB)
 apps/plugins/xobox.c       |   95 ++++-------
 apps/plugins/snake.c       |   94 ++++-------
 apps/plugins/dice.c        |  233 +++++++++-------------------
 apps/plugins/star.c        |  368 +++++++++++++--------------------------------
 apps/plugins/minesweeper.c |  115 ++++----------
 5 files changed, 302 insertions(+), 603 deletions(-)

Comment by Jonathan Gordon (jdgordon) - Sunday, 25 March 2007, 16:33 GMT+2
After much arm twisting in IRC I have commited a converted xobox menu whic is hopefully enough example for you to do the rest "properly" :)
Comment by Tom Ross (midgey34) - Monday, 26 March 2007, 03:34 GMT+2
Here's an updated version that uses as much of the new API as possible. It also converts Disktidy to this new API. Let me know if I broke anything or did something incorrectly.
(application/octet-stream)    plugin_menu.2.diff (36.9 KiB)
 apps/plugins/snake.c       |   89 +++--------
 apps/plugins/dice.c        |  223 ++++++++--------------------
 apps/plugins/star.c        |  357 ++++++++++++---------------------------------
 apps/plugins/minesweeper.c |  111 +++----------
 apps/plugins/disktidy.c    |   17 --
 5 files changed, 238 insertions(+), 559 deletions(-)

Loading...