Ejemplo n.º 1
0
void input_menu(void)
{
	NOPH_List_t input_menu_list;
        NOPH_Display_t display = NOPH_Display_getDisplay(NOPH_MIDlet_get());
        NOPH_Displayable_t cur = NOPH_Display_getCurrent(display);
        NOPH_CommandMgr_t cm = NOPH_CommandMgr_getInstance();
        mm_args_t args;
        int i;
        const char *list[] = { "F1", "F3", "F5", "F7",
                               "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A",
                               "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
                               "N", "O", "P", "Q", "R", "S", "T", "U", "V", "X", "Y", "Z" };

        input_menu_list = NOPH_List_new("Choose option", NOPH_Choice_IMPLICIT);
        NOPH_Display_setCurrent(display, input_menu_list);

        for (i = 0; i < sizeof(list) / sizeof(const char *); i++)
                NOPH_List_append(input_menu_list, list[i], 0);


        /* Setup the callback args */
        args.selected = 0;
        args.menu_list = input_menu_list;
        NOPH_CommandMgr_setList(cm, input_menu_list, input_menu_callback, &args);

        while(args.selected == 0)
        {
                NOPH_Thread_sleep(250);
        }

        NOPH_Display_setCurrent(display, cur);
        NOPH_delete(input_menu_list);
}
Ejemplo n.º 2
0
char *cibyl_select_game(char *base_dir)
{
        NOPH_Display_t display = NOPH_Display_getDisplay(NOPH_MIDlet_get());
        NOPH_Displayable_t cur = NOPH_Display_getCurrent(display);
        NOPH_CommandMgr_t cm = NOPH_CommandMgr_getInstance();
        char **p;

        all_games = read_directory(get_current_directory());
        if (!all_games)
                return NULL;

        game_list = NOPH_List_new("Select game", NOPH_Choice_IMPLICIT);

        for (p = all_games; *p; p++)
        {
                NOPH_List_append(game_list, *p, 0);
        }
        NOPH_Display_setCurrent(display, game_list);

        printf("Setting list\n");

        NOPH_CommandMgr_setList(cm, game_list, select_game_callback, NULL);

        while(selected_game == NULL)
        {
                NOPH_Thread_sleep(250);
        }
        free(all_games);

        NOPH_Display_setCurrent(display, cur);
        NOPH_delete(game_list);
        game_list = 0;

        return get_game_directory(selected_game);
}
Ejemplo n.º 3
0
BOOL roadmap_internet_open_browser( const char* url){
#ifdef RIMAPI
	NOPH_FreemapMainScreen_t RimScreen = NOPH_FreemapMainScreen_get();
	NOPH_FreemapMainScreen_openBrowser(RimScreen,url);
	NOPH_delete(RimScreen);
#else	
	NOPH_MIDlet_platformRequest(NOPH_MIDlet_get(),url);
#endif

}
Ejemplo n.º 4
0
const char *cibyl_select_fs_root(void)
{
	NOPH_Display_t display = NOPH_Display_getDisplay(NOPH_MIDlet_get());
	NOPH_Displayable_t cur = NOPH_Display_getCurrent(display);
	NOPH_CommandMgr_t cm = NOPH_CommandMgr_getInstance();
	NOPH_Enumeration_t en = NOPH_FileSystemRegistry_listRoots();
	FILE *conf;
	int i = 0;

	fs_root = NULL;

	fs_list = NOPH_List_new("Select fs root", NOPH_Choice_IMPLICIT);

	while (NOPH_Enumeration_hasMoreElements(en))
	{
		NOPH_Object_t o = NOPH_Enumeration_nextElement(en);

		NOPH_String_toCharPtr(o, roots[i], 40);
		NOPH_List_append(fs_list, roots[i], 0);
		NOPH_delete(o);
		i++;
	}
	NOPH_delete(en);
	NOPH_Display_setCurrent(display, fs_list);
	NOPH_CommandMgr_setList(cm, fs_list, select_fs_callback, NULL);

	while(fs_root == NULL)
	{
		NOPH_Thread_sleep(250);
	}
#if 0
	conf = fopen("recordstore://sarien-conf:1", "w");
	if (conf)
	{
		char buf[40];

		strncpy(buf, fs_root, 40);
		fwrite(buf, 1, 40, conf);
		fclose(conf);
	}
#endif
	NOPH_Display_setCurrent(display, cur);
	NOPH_delete(fs_list);

        return fs_root;
}
Ejemplo n.º 5
0
static void about_callback(void *unused)
{
  NOPH_Display_t display = NOPH_Display_getDisplay(NOPH_MIDlet_get());
//  NOPH_Displayable_t cur = NOPH_Display_getCurrent(display);
  NOPH_Alert_t alert = NOPH_Alert_new("About",
                                      "Sarien is written by Stuart George, Claudio Matsuoka, Felipe Rosinha"
                                      "and others.\n\n"
                                      "J2ME support for Sarien was done by Simon K�gstr�m, tweaked by "
                                      "Zsolt Gurmai, see http://spel.bth.se/index.php/Sarien_for_Cibyl",
                                      0,
                                      NOPH_AlertType_INFO
                                      );

  NOPH_Alert_setTimeout(alert, NOPH_Alert_FOREVER);
  NOPH_Display_setCurrent(display, alert);
//  NOPH_delete(alert);
//  NOPH_Display_setCurrent(display, cur);
}
Ejemplo n.º 6
0
void cibyl_main_menu(void)
{
	NOPH_List_t main_menu_list;
        NOPH_Display_t display = NOPH_Display_getDisplay(NOPH_MIDlet_get());
        NOPH_Displayable_t cur = NOPH_Display_getCurrent(display);
        NOPH_CommandMgr_t cm = NOPH_CommandMgr_getInstance();
        mm_args_t args;
        char buf[80];

        main_menu_list = NOPH_List_new("Choose option", NOPH_Choice_IMPLICIT);

        snprintf(buf, 80, "Swap joysticks (now port %d)", ThePrefs.JoystickSwap ? 1 : 2);
        NOPH_List_append(main_menu_list, buf, 0);
        NOPH_List_append(main_menu_list, "Bind space to GAME_B", 0);
        NOPH_List_append(main_menu_list, "Bind RunStop to GAME_B", 0);
        NOPH_List_append(main_menu_list, "Bind Return to GAME_B", 0);
        NOPH_List_append(main_menu_list, "Bind other to GAME_B", 0);
        NOPH_List_append(main_menu_list, "Load from disk", 0);
        NOPH_List_append(main_menu_list, "Load from tape", 0);
        NOPH_Display_setCurrent(display, main_menu_list);

        /* Setup the callback args */
        args.selected = 0;
        args.menu_list = main_menu_list;
        NOPH_CommandMgr_setList(cm, main_menu_list, main_menu_callback, &args);

        while(args.selected == 0)
        {
                NOPH_Thread_sleep(250);
        }

	if (args.selected == 2)
		input_menu();

        NOPH_Display_setCurrent(display, cur);
        NOPH_delete(main_menu_list);
}