FS#6509 - Plugin for playing reversi game

Attached to Project: Rockbox
Opened by Alexander Levin (fml2) - Friday, 05 January 2007, 22:12 GMT
Last edited by Antoine Cellerier (dionoea) - Saturday, 30 June 2007, 20:05 GMT
Task Type Patches
Category Games
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Since I like the game but mostly as an exercise in programming RB, I've coded up the plugin for reversi game. It should work on all targets with a bitmap display.

As moves are made, they are stored in the game history so that it's possible to save the track. It should be also possible to choose the playing strategy for each player.


- Really implement the automatic playing strategies (take them from hinversi?)
- Implement loading/saving a game from/to a file
- Implement robot players (provisions are made but the main loop should be adjusted)
- Make nicer GUI
- ...

Anyone interested?

The contents of the ZIP file should be placed to the 'plugins' directory, and the patch should also be applied.
This task depends upon

Closed by  Antoine Cellerier (dionoea)
Saturday, 30 June 2007, 20:05 GMT
Reason for closing:  Accepted
Additional comments about closing:  Applied. Thanks.
Comment by Robert Kukla (roolku) - Monday, 15 January 2007, 17:57 GMT
This works fine on my h140, but on the gigabeat I don't get any black pieces and as a result cannot make a move with the white pieces. Any idea what is going on? Cheers
Comment by Alexander Levin (fml2) - Tuesday, 16 January 2007, 08:12 GMT
> Any idea what is going on?

No ideas on my side. I've only tested this on my H120 and with the simulator for ipod video (IIRC). Is it a problem with drawing (i.e. the internal game state is ok) or is the game itself is broken? In the former case I would blame gigabeat LCD driver or its graphics routines. Or maybe the GUI code of the plugin. In the latter case... I don't know, I hope it's not the latter case since the game logic is not platform specific.

BTW, there's a typo in this task's subject. It should read 'plugin', not 'pluging.'
Comment by Alexander Levin (fml2) - Tuesday, 16 January 2007, 16:01 GMT
From SVN log: 16 Jan 14:58 Fix inversevid mono drawing. Does this also fix the problem with the plugin on gigabeat?
Comment by Robert Kukla (roolku) - Wednesday, 17 January 2007, 10:02 GMT
No, still the same. No black pieces. Not be able to make any move as a result. Nothing happens when I select "Pass the move" in the menu either.
Comment by Dave Chapman (linuxstb) - Thursday, 25 January 2007, 23:12 GMT
Does this still have problems on the Gigabeat?
Comment by Dave Chapman (linuxstb) - Thursday, 25 January 2007, 23:26 GMT
I just tried this on my ipod, and got the same problem roolku reported on the gigabeat - no black pieces.

The problem is the definition of struct reversi_board_t - it uses a plain "char" type, which on ARM platforms is unsigned (the C language allows "char" to be either signed or unsigned, depending on the platform). Changing this to an explicit "signed char" type fixes the bug.

But it's looking good so far.
Comment by Robert Kukla (roolku) - Thursday, 25 January 2007, 23:29 GMT
Unfortunately yes. It works in the simulator, but not on target (see attachment). And like I said it is curious that the black square on the top left is there, so it doesn't seem to be just a drawing problem.
Comment by Alexander Levin (fml2) - Monday, 29 January 2007, 08:35 GMT
> Changing this to an explicit "signed char" type fixes the bug.

Me being silly. Sure! Thanks Dave!
Comment by Alexander Levin (fml2) - Saturday, 17 February 2007, 21:07 GMT
Updated the patch:

- implemented Dave's idea
- better graphics (now also works with vertical displays)
Comment by Alexander Levin (fml2) - Sunday, 18 February 2007, 10:13 GMT
More improvements:

- removed unneeded #define's
- thicker cell lines on large displays