FS#7174 - Chessbox - Store game history in PGN format
Attached to Project:
Rockbox
Opened by Mauricio Peccorini (mpeccorini) - Tuesday, 15 May 2007, 20:50 GMT
Last edited by Nils Wallménius (nls) - Sunday, 02 September 2007, 10:12 GMT
Opened by Mauricio Peccorini (mpeccorini) - Tuesday, 15 May 2007, 20:50 GMT
Last edited by Nils Wallménius (nls) - Sunday, 02 September 2007, 10:12 GMT
|
DetailsModifications to chessbox.c, gnuchess.c and gnuchess.h so the history of games played is stored in a file called chessbox.pgn. It considers all (up to what I know) rules of PGN annotation including the handling of checks, checkmates, taking pieces, resolution of ambiguous moves by adding the row or column of the moving piece as needed, castling kingside and queenside, promotions (only to queens since the chessbox plugin itself doesn't allow the player to choose), pawns taking "en passant", etc.
Currently, it has some limitations: -The abbreviation of the pieces are always in english regardless of the language the player is using. -The PGN header is constant: [Event "Chessbox Chess Game"] [White "player"] [Black "Chessbox (powered by GnuChess)"] -The players could be swapped but you can swap them in the middle of the game and the header has already been stored at that time. -I didn't find where to get the system date (I don't even know if this is possible at all) -The result could be added but I'm not storing the history in memory but instead storing it as you play. I didn't want to use too much memory for this. It would be relatively easy to change though and that would lead to other improvements like "undo move" (I know, I know, that's cheating !!! ;-) ). -The history is being stored but there's no way of watching previously played matches in the player, you have to download the file to a computer and use a different software for that (I plan to make this possible in the future but that includes adding a menu, a PGN parser and a lot of user interaction so it can take some time) |
This task depends upon
In the mean time, I don't think committing the patch as it is would be any wise.
- The header now has the correct date (assuming the player has the correct date set ;-) )
- The header also includes the "mandatory" 7 tags according to the PGN specification
- The result of the game is stated both at the end of the game and in the header, just like the specification requires (0-1, 1-0, 1/2-1/2 or * for unknown result)
- Watching the games stored in PGN files and using chessbox as a viewer as linuxstb suggested was taken care of in task #7209 which is already committed to the SVN repository.
I'm also including the modifications to the manual so it stays up to date.
Thanks to pixelma for pointing this out.
The patch for the manual is still valid.
I fixed them + converted patch to unix newlines (source in svn is already has unix newlines)