Rockbox

Tasklist

FS#5664 - Blackjack Plugin

Attached to Project: Rockbox
Opened by Tom Ross (midgey34) - Saturday, 15 July 2006, 06:47 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

Details

This is a WIP version of Blackjack that I recently looked at again in an attempt to fix as many bugs as I could. The result is less buggy, but still with some issues during splitting. I've decided to release this version since I am going away for a few days and thought it best to share my most current code. This version is newer than the version I posted recently in IRC and I fixed up some stupid bugs caused by debug code I had.

New Features:
* Now supports all current Rockbox targets with bitmap screens. This includes from Recorder and Ondio to newer ports like irivers, iPods, and iAudio X5. Also included is support for Gigabeat and ifp-700.
* Remote support for iriver h1X0 remotes. This code is untested since I don't have a remote and may not work properly. The code may not be the proper way to implement remote support and may be stripped if the plugin is added to CVS post-3.0.
* Now you can bet the minimum
* The game also remembers your previous bet and defaults to that each time it asks for a new amount

Bugs:
* When there are more than 3 cards in the second set of cards in a split, it freezes.
* During a split, sometimes the dealer's cards are drawn instead of the second split set or vice versa. This bug doesn't affect gameplay but is certainly annoying.

I'd like bug reports, feature requests, comments, suggestions, concerns, or improvements posted here or at http://www.misticriver.net/showthread.php?t=36272

More detailed information is available in comments at the top of the code. Please read before using as they provide a more in-depth overview than listed here.
This task depends upon

Closed by  Tom Ross (midgey34)
Wednesday, 17 January 2007, 00:04 GMT
Reason for closing:  Accepted
Additional comments about closing:  I committed this in rev 12030.
Comment by Jonathan Singh (Jon_) - Tuesday, 18 July 2006, 20:34 GMT
Great Job Mr. Ross! This is such a great plug in love it. Keep it up.

Take Care,
Jon
Comment by Tom Ross (midgey34) - Sunday, 06 August 2006, 00:10 GMT
Anyone have any ideas to track down the two remaining bugs? I used logf to output the card values and it seems that some variables in the game_context struct are indeed being overwritten. I tried rearranging the variable order in the game_context struct each resulting in different bugs. Sometimes numbers would go negative or cards would disappear and sometimes the result was a hard lockup.
Comment by Tom Ross (midgey34) - Thursday, 10 August 2006, 20:36 GMT
Here's the latest version of Blackjack with a switch to external bitmaps and code cleanup. Remote support has been removed and may be added back in later. Also the last two bugs mentioned above should be fixed. Turns out I'm an idiot and forgot how to initialize arrays properly :). Enjoy!
Comment by Alex Margolis (almargolis) - Monday, 25 September 2006, 18:45 GMT
Please could i have a proper .patch/.diff file?
Comment by Bobby Graese (TrueJournals) - Wednesday, 18 October 2006, 22:39 GMT
I've made a .diff file that I believe includes everything.. so it should work. I've also added keymappings for the H10 in the blackjack.c file.. but I'm not sure how good they are. You will have to download the bitmaps.zip above and place the bitmaps in the correct places, but you do not need to worry about any SOURCES files... the diff file should do that for you.
Comment by Tom Ross (midgey34) - Thursday, 09 November 2006, 02:23 GMT
Here's the newest version. Some minor bugs were fixed and the drawing routine reworked to be faster and hopefully avoid the occasional flicker. Also included is support for iriver H10 5/6GB and 20GB along with the Sansa e200 and hopefully the Tatung Elio TPJ-1022. The H10 mappings might seem a little strange but should improve when the scrollpad is working better. Hope you all enjoy! Remember, comments are welcome :) .

PS: For anyone wondering, yes, this is a proper patch file. Also, please use bitmaps.zip posted above (you can ignore the SOURCES stuff).
Comment by Jonas Häggqvist (rasher) - Thursday, 09 November 2006, 14:02 GMT
Could you be persuaded to include a manual section (and screenshots) in the patch?

Also, you should use unix line endings (LF rather than CRLF) for the blackjack.c file.

Another thing, clicking the joystick on the H120 is called Navi (while the define is named BUTTON_SELECT)
Comment by Tom Ross (midgey34) - Thursday, 09 November 2006, 16:35 GMT
All right, I'll work on correcting those small problems and creating a manual patch. If I have some difficulty, I'll let you know. For #3, are you referring to the messages displayed when the plugin first runs or something else?
Comment by Jonas Häggqvist (rasher) - Thursday, 09 November 2006, 17:24 GMT
Yes, I was talking about the welcome screen. The manual patch is not a strict requirement, but it'd be nice.
Comment by Marianne Arnold (pixelma) - Thursday, 09 November 2006, 17:47 GMT
I tried in an Ondio sim and it seems to work well... so I'd like to thank first for making it available to all targets but I have two suggestions:

- The "you win/lose" message is very hard to find (literally) because the "Play again?" splash draws all attention. Maybe you can put this message inside the splash? Or another possibilty could be that only the win/lose info is presented in the splash - a button press leads to the game menu and there one would have an additional quit option.

- (Call me biased)... Would you consider using the new Solitaire graphics? This would need some code rework though as it uses one single bitmap for the entire deck but as I understand Blackjack needs the same cards and you already used the old graphics. But I think the drawing code would benefit from it in the end (should be simpler as it doesn't have to combine different bitmap parts).
Comment by Tom Ross (midgey34) - Friday, 17 November 2006, 22:30 GMT
New version of Blackjack (1.5)

1.) Manual patch section and screenshots are included (manual_images.zip)
2.) Using unix line endings (I think...)
3.) Clicking is referred to as NAVI on the H1X0
4.) A simple looking screen when the hand is over for smaller targets
5.) Changed to solitaire bitmaps
6.) Slight code cleanup
7.) Scales to font size

Hope you all enjoy the changes.

Just wondering, would any dev prefer the code to changed into regular ints instead of specifying signed/unsigned?

The graphics can now scale to various sized fonts but the code is still set to SYS_FONT.

Hopefully the Ondio and Recorder should look better. Let me know your thoughts.

PS: I propose that the solitaire graphics be changed from solitaire_ to card_ since they are now being used in more than one plugin.

(Uploaded new patch without my email address...)
Comment by Mustapha Senhaji (DrMoos) - Saturday, 18 November 2006, 12:06 GMT
That seems to be CVS material now, nice job.
Comment by Tom Ross (midgey34) - Wednesday, 22 November 2006, 01:30 GMT
Blackjack 1.6

Slight change in the "win" messages for Archos; it should look nicer now.
Comment by Jonas Häggqvist (rasher) - Saturday, 25 November 2006, 11:50 GMT
This behaves weird on the H120 sim. No start text and no text in the game screen, just the cards.
Comment by Tom Ross (midgey34) - Friday, 05 January 2007, 18:43 GMT
Oops, small mistake that is fixed in this patch. Also, Sansa e200 and Gigabeat F have been added to the manual section.

blackjack1.7.patch is the patch file
manual-images.zip contains the manual graphics that go in /manual/plugins/images
Comment by drumthrasher109 (drumthrasher109) - Monday, 08 January 2007, 22:25 GMT
umm...can someone make this into a .rock file?
Comment by Tom Ross (midgey34) - Saturday, 13 January 2007, 22:56 GMT
There was a slight glitch in the last past the messed up the e200 manual. This patch fixes it.

Files Needed for Blackjack:
blackjack1.8.patch - latest patch
manual-images.zip - image files for building the manual

Loading...