Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category Games
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by mpeccorini - 2007-05-24
Last edited by nls - 2007-05-29

FS#7209 - Make chessbox able to view games stored in PGN format

The patch makes chessbox work both as a plugin and as a viewer. If the plugin is started like usual it will have the same behaviour. However, if a PGN file (a file with pgn extension) is selected in the file browser, the plugin will start as a viewer and will show the list of games contained in the file.

After the users selects a file, the board will be shown and the user will be able to replay the match using the left and right buttons (move forward and move backwards respectively)

At any time during the match, if the user presses the menu key combination, a small menu will be shown and it will allow him to restart the same game, choose a new game or quit the viewer.

Limitations:
-simple annotations (i.e.:?,!,?! and so forth are supported, but numeric annotation glyphs are not yet supported).
-variations of the main line of the game are not supported at all.
-full browsing of the game tags (event, site, white/black elo, etc) is not possible. Only white’s name, black’s name and date are shown ATM.
-The game list will be loaded in memory in it’s entirety. While only the players names, date of match and line number in the file will be included in the list, if the number of games exceeds a couple thousand the player may crash.

Notes:
-Efforts to support deviations to the format (like expressing castling with zeros instead of capital “O” letters) have been taken. However, after a game is selected, a file called chessbox.log will be left in the rocks folder. If a game is not parsed correctly, please send it to me (mpeccorini at yahoo dot com) and I will gladly fix the problem.
-To aid the developer in the tests, I’m attaching a PGN file with the history of the games the Salvadorean team played in the Chess Counter-Olympiad in Lybia 1976. They won the gold medal !
-Storing games played against the GNUChess engine will be supported in a future patch as well as switching between plugin and viewer modes.

Closed by  nls
2007-05-29 16:33
Reason for closing:  Accepted
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

comitted

nls commented on 2007-05-26 19:51

The patch breakes compilation, in the cb_menu_viewer() function there’s a variable missing.
If I add a int selection; it compiles fine.

The list where the games are displayed when I open the pgn file you attatched didn’t let me
choose any other game than the first one.

And some minor nitpicks, the color of the selection in the list of games seems to be inversed instead
of reversed. Also we have a sort-of style rule that lines shouldn’t be much longer than 80…

Other than this it seems to work nicely, the one game that i can select works nice and the regular gameplay does work too.

Everything fixed with the exception of a very few lines exceeding 80 characters, it really made sense to leave them that way or it would make them very hard to read.

Fixed the results where black won (0-1) to be passing as valid PGN tokens and making the simulator crash

Use the list widget to show the list of games in the file so it behaves as the rest of the lists in the system (thanks to Nils for the suggestion)

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing