2002-06-24 08:51:28 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2002 Robert Hak
|
|
|
|
*
|
|
|
|
* All files in this archive are subject to the GNU General Public License.
|
|
|
|
* See the file COPYING in the source tree root for full license agreement.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include "config.h"
|
2002-09-06 09:08:23 +00:00
|
|
|
#include "options.h"
|
|
|
|
|
2002-06-24 08:57:59 +00:00
|
|
|
#ifdef HAVE_LCD_BITMAP
|
2002-09-01 05:47:38 +00:00
|
|
|
#ifdef USE_GAMES
|
|
|
|
|
2002-06-24 08:51:28 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include "menu.h"
|
|
|
|
#include "games_menu.h"
|
2002-09-18 14:08:05 +00:00
|
|
|
#include "lang.h"
|
2003-06-29 16:33:04 +00:00
|
|
|
#include "plugin.h"
|
2002-09-18 14:08:05 +00:00
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
static bool tetris(void)
|
|
|
|
{
|
|
|
|
if (plugin_load("/.rockbox/rocks/tetris.rock",NULL)==PLUGIN_USB_CONNECTED)
|
|
|
|
return true;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool sokoban(void)
|
|
|
|
{
|
|
|
|
if (plugin_load("/.rockbox/rocks/sokoban.rock",NULL)==PLUGIN_USB_CONNECTED)
|
|
|
|
return true;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool wormlet(void)
|
|
|
|
{
|
|
|
|
if (plugin_load("/.rockbox/rocks/wormlet.rock",NULL)==PLUGIN_USB_CONNECTED)
|
|
|
|
return true;
|
|
|
|
return false;
|
|
|
|
}
|
2002-06-24 08:51:28 +00:00
|
|
|
|
2003-06-30 04:36:57 +00:00
|
|
|
static bool flipit(void)
|
|
|
|
{
|
|
|
|
if (plugin_load("/.rockbox/rocks/flipit.rock",NULL)==PLUGIN_USB_CONNECTED)
|
|
|
|
return true;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool othelo(void)
|
|
|
|
{
|
|
|
|
if (plugin_load("/.rockbox/rocks/othelo.rock",NULL)==PLUGIN_USB_CONNECTED)
|
|
|
|
return true;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool sliding_puzzle(void)
|
|
|
|
{
|
|
|
|
if (plugin_load("/.rockbox/rocks/sliding_puzzle.rock",
|
|
|
|
NULL)==PLUGIN_USB_CONNECTED)
|
|
|
|
return true;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool star(void)
|
|
|
|
{
|
|
|
|
if (plugin_load("/.rockbox/rocks/star.rock",NULL)==PLUGIN_USB_CONNECTED)
|
|
|
|
return true;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2002-09-24 17:22:12 +00:00
|
|
|
bool games_menu(void)
|
2002-06-24 08:51:28 +00:00
|
|
|
{
|
|
|
|
int m;
|
2002-09-24 17:22:12 +00:00
|
|
|
bool result;
|
2002-06-24 08:51:28 +00:00
|
|
|
|
|
|
|
struct menu_items items[] = {
|
2002-09-18 14:08:05 +00:00
|
|
|
{ str(LANG_TETRIS), tetris },
|
|
|
|
{ str(LANG_SOKOBAN), sokoban },
|
|
|
|
{ str(LANG_WORMLET), wormlet },
|
2003-06-30 04:36:57 +00:00
|
|
|
{ str(LANG_FLIPIT), flipit },
|
|
|
|
{ str(LANG_OTHELO), othelo },
|
|
|
|
{ str(LANG_SLIDING_PUZZLE), sliding_puzzle },
|
|
|
|
{ str(LANG_STAR), star },
|
2002-06-24 08:51:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
m=menu_init( items, sizeof items / sizeof(struct menu_items) );
|
2002-08-23 12:32:52 +00:00
|
|
|
result = menu_run(m);
|
2002-06-24 08:51:28 +00:00
|
|
|
menu_exit(m);
|
2002-08-23 12:32:52 +00:00
|
|
|
|
|
|
|
return result;
|
2002-06-24 08:51:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
2002-09-01 05:47:38 +00:00
|
|
|
#endif
|