summaryrefslogtreecommitdiff
path: root/apps/plugins/solitaire.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/solitaire.c')
-rw-r--r--apps/plugins/solitaire.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c
index 5283e40f4b..2260599bc3 100644
--- a/apps/plugins/solitaire.c
+++ b/apps/plugins/solitaire.c
@@ -32,6 +32,7 @@ use F3 to put card on top of the remains' stack on one of the 4 final stacks
32*****************************************************************************/ 32*****************************************************************************/
33 33
34#include "plugin.h" 34#include "plugin.h"
35#include "playback_control.h"
35#include "configfile.h" 36#include "configfile.h"
36#include "button.h" 37#include "button.h"
37#include "lcd.h" 38#include "lcd.h"
@@ -247,7 +248,7 @@ static struct plugin_api* rb;
247static int helplines; 248static int helplines;
248static int displaylines; 249static int displaylines;
249 250
250static char helptext[] = 251static char helptext[] =
251 /* Use single spaces only! Close each line with one \0. */ 252 /* Use single spaces only! Close each line with one \0. */
252 "-- Navigation --\0" 253 "-- Navigation --\0"
253 HK_LR ": Move the cursor to the previous/ next column.\0" 254 HK_LR ": Move the cursor to the previous/ next column.\0"
@@ -263,7 +264,7 @@ static char helptext[] =
263/** 264/**
264 * Misc constants, graphics and other defines 265 * Misc constants, graphics and other defines
265 */ 266 */
266 267
267#include "card_back.h" 268#include "card_back.h"
268#include "card_deck.h" 269#include "card_deck.h"
269#include "solitaire_suitsi.h" 270#include "solitaire_suitsi.h"
@@ -443,7 +444,7 @@ static void init_help(void)
443 para_len = rb->strlen(para); 444 para_len = rb->strlen(para);
444 445
445 while (para_len) 446 while (para_len)
446 { 447 {
447 bool first = true; 448 bool first = true;
448 int x = 0; 449 int x = 0;
449 char *next, *store; 450 char *next, *store;
@@ -546,7 +547,7 @@ enum help solitaire_help( void )
546/** 547/**
547 * Custom menu / options 548 * Custom menu / options
548 */ 549 */
549 550
550#define CFGFILE_VERSION 0 551#define CFGFILE_VERSION 0
551 552
552struct sol_config { 553struct sol_config {
@@ -606,6 +607,7 @@ int solitaire_menu(bool in_game)
606 } 607 }
607 items[i++].desc = unhide_option_string; 608 items[i++].desc = unhide_option_string;
608 items[i++].desc = "Help"; 609 items[i++].desc = "Help";
610 items[i++].desc = "Audio Playback";
609 items[i++].desc = "Quit"; 611 items[i++].desc = "Quit";
610 612
611 create_draw_option_string(); 613 create_draw_option_string();
@@ -652,6 +654,10 @@ int solitaire_menu(bool in_game)
652 break; 654 break;
653 655
654 case 4: 656 case 4:
657 playback_control(rb);
658 break;
659
660 case 5:
655 result = MENU_QUIT; 661 result = MENU_QUIT;
656 break; 662 break;
657 } 663 }
@@ -1024,7 +1030,7 @@ enum { SOLITAIRE_WIN, SOLITAIRE_QUIT, SOLITAIRE_USB };
1024/** 1030/**
1025 * Bouncing cards at the end of the game 1031 * Bouncing cards at the end of the game
1026 */ 1032 */
1027 1033
1028#define BC_ACCEL ((1<<16)*LCD_HEIGHT/128) 1034#define BC_ACCEL ((1<<16)*LCD_HEIGHT/128)
1029#define BC_MYSPEED (6*BC_ACCEL) 1035#define BC_MYSPEED (6*BC_ACCEL)
1030#define BC_MXSPEED (6*LCD_HEIGHT/128) 1036#define BC_MXSPEED (6*LCD_HEIGHT/128)
@@ -1139,10 +1145,10 @@ int solitaire( void )
1139 j++; 1145 j++;
1140 } 1146 }
1141 c = deck[c].next; 1147 c = deck[c].next;
1142 } 1148 }
1143 /* make column distinguishable from an empty column, 1149 /* make column distinguishable from an empty column,
1144 * and avoid division by zero while displaying */ 1150 * and avoid division by zero while displaying */
1145 if( j == 0 ) 1151 if( j == 0 )
1146 j = 1; 1152 j = 1;
1147 } 1153 }
1148 if( j > biggest_col_length ) 1154 if( j > biggest_col_length )
@@ -1595,7 +1601,7 @@ enum plugin_status plugin_start( struct plugin_api* api, void* parameter )
1595 * Keep playing if a game was won (that means display the menu after 1601 * Keep playing if a game was won (that means display the menu after
1596 * winning instead of quiting) */ 1602 * winning instead of quiting) */
1597 while( ( result = solitaire() ) == SOLITAIRE_WIN ); 1603 while( ( result = solitaire() ) == SOLITAIRE_WIN );
1598 1604
1599 if (rb->memcmp(&sol, &sol_disk, sizeof(sol))) /* save settings if changed */ 1605 if (rb->memcmp(&sol, &sol_disk, sizeof(sol))) /* save settings if changed */
1600 { 1606 {
1601 rb->memcpy(&sol_disk, &sol, sizeof(sol)); 1607 rb->memcpy(&sol_disk, &sol, sizeof(sol));