2008-08-07 14:26:07 +02:00
|
|
|
|
/****************************************************************************
|
2008-12-11 18:38:29 +01:00
|
|
|
|
* menu.c
|
2008-08-07 14:26:07 +02:00
|
|
|
|
*
|
2010-11-01 19:13:17 +01:00
|
|
|
|
* Genesis Plus GX menu
|
2008-12-11 18:38:29 +01:00
|
|
|
|
*
|
2010-11-01 19:13:17 +01:00
|
|
|
|
* Eke-Eke (2009,2010)
|
2008-08-07 14:26:07 +02:00
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
*
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "shared.h"
|
2010-05-06 14:59:43 +02:00
|
|
|
|
#include "menu.h"
|
2008-08-07 14:26:07 +02:00
|
|
|
|
#include "font.h"
|
2009-05-13 16:26:55 +02:00
|
|
|
|
#include "gui.h"
|
2008-12-14 13:38:52 +01:00
|
|
|
|
#include "filesel.h"
|
2010-11-01 19:13:17 +01:00
|
|
|
|
#include "cheats.h"
|
|
|
|
|
#include "file_load.h"
|
|
|
|
|
#include "file_slot.h"
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2010-05-28 17:47:45 +02:00
|
|
|
|
#include <ogc/lwp_threads.h>
|
|
|
|
|
|
2010-11-01 19:13:17 +01:00
|
|
|
|
/* Credits */
|
|
|
|
|
extern const u8 Bg_credits_png[];
|
|
|
|
|
|
|
|
|
|
/* Main menu */
|
|
|
|
|
extern const u8 Main_load_png[];
|
|
|
|
|
extern const u8 Main_options_png[];
|
|
|
|
|
extern const u8 Main_quit_png[];
|
|
|
|
|
extern const u8 Main_file_png[];
|
|
|
|
|
extern const u8 Main_reset_png[];
|
|
|
|
|
extern const u8 Main_ggenie_png[];
|
|
|
|
|
extern const u8 Main_showinfo_png[];
|
|
|
|
|
extern const u8 Main_takeshot_png[];
|
|
|
|
|
#ifdef HW_RVL
|
|
|
|
|
extern const u8 Main_play_wii_png[];
|
|
|
|
|
#else
|
|
|
|
|
extern const u8 Main_play_gcn_png[];
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Options menu */
|
|
|
|
|
extern const u8 Option_menu_png[];
|
|
|
|
|
extern const u8 Option_ctrl_png[];
|
|
|
|
|
extern const u8 Option_sound_png[];
|
|
|
|
|
extern const u8 Option_video_png[];
|
|
|
|
|
extern const u8 Option_system_png[];
|
|
|
|
|
|
|
|
|
|
/* Load ROM menu */
|
|
|
|
|
extern const u8 Load_recent_png[];
|
|
|
|
|
extern const u8 Load_sd_png[];
|
|
|
|
|
extern const u8 Load_dvd_png[];
|
|
|
|
|
#ifdef HW_RVL
|
|
|
|
|
extern const u8 Load_usb_png[];
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Save Manager menu */
|
|
|
|
|
extern const u8 Button_load_png[];
|
|
|
|
|
extern const u8 Button_load_over_png[];
|
|
|
|
|
extern const u8 Button_save_png[];
|
|
|
|
|
extern const u8 Button_save_over_png[];
|
|
|
|
|
extern const u8 Button_special_png[];
|
|
|
|
|
extern const u8 Button_special_over_png[];
|
|
|
|
|
extern const u8 Button_delete_png[];
|
|
|
|
|
extern const u8 Button_delete_over_png[];
|
|
|
|
|
|
|
|
|
|
/* Controller Settings */
|
|
|
|
|
extern const u8 Ctrl_4wayplay_png[];
|
|
|
|
|
extern const u8 Ctrl_gamepad_png[];
|
|
|
|
|
extern const u8 Ctrl_justifiers_png[];
|
|
|
|
|
extern const u8 Ctrl_menacer_png[];
|
|
|
|
|
extern const u8 Ctrl_mouse_png[];
|
|
|
|
|
extern const u8 Ctrl_none_png[];
|
|
|
|
|
extern const u8 Ctrl_teamplayer_png[];
|
|
|
|
|
extern const u8 Ctrl_pad3b_png[];
|
|
|
|
|
extern const u8 Ctrl_pad6b_png[];
|
|
|
|
|
extern const u8 Ctrl_config_png[];
|
|
|
|
|
extern const u8 ctrl_option_off_png[];
|
|
|
|
|
extern const u8 ctrl_option_on_png[];
|
|
|
|
|
extern const u8 ctrl_gamecube_png[];
|
|
|
|
|
#ifdef HW_RVL
|
|
|
|
|
extern const u8 ctrl_classic_png[];
|
|
|
|
|
extern const u8 ctrl_nunchuk_png[];
|
|
|
|
|
extern const u8 ctrl_wiimote_png[];
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Generic images */
|
|
|
|
|
extern const u8 Button_sm_blue_png[];
|
|
|
|
|
extern const u8 Button_sm_grey_png[];
|
|
|
|
|
extern const u8 Button_sm_yellow_png[];
|
|
|
|
|
|
2009-03-15 20:11:01 +01:00
|
|
|
|
/*****************************************************************************/
|
2010-05-06 14:59:43 +02:00
|
|
|
|
/* Specific Menu Callbacks */
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
static void ctrlmenu_cb(void);
|
|
|
|
|
static void savemenu_cb(void);
|
2010-11-01 19:13:17 +01:00
|
|
|
|
static void mainmenu_cb(void);
|
2010-05-06 14:59:43 +02:00
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/* Generic Buttons data */
|
2009-03-29 20:56:36 +02:00
|
|
|
|
/*****************************************************************************/
|
2009-04-20 00:31:08 +02:00
|
|
|
|
static butn_data arrow_up_data =
|
|
|
|
|
{
|
|
|
|
|
{NULL,NULL},
|
|
|
|
|
{Button_up_png,Button_up_over_png}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static butn_data arrow_down_data =
|
|
|
|
|
{
|
|
|
|
|
{NULL,NULL},
|
|
|
|
|
{Button_down_png,Button_down_over_png}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static butn_data button_text_data =
|
|
|
|
|
{
|
|
|
|
|
{NULL,NULL},
|
|
|
|
|
{Button_text_png,Button_text_over_png}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static butn_data button_icon_data =
|
|
|
|
|
{
|
|
|
|
|
{NULL,NULL},
|
|
|
|
|
{Button_icon_png,Button_icon_over_png}
|
|
|
|
|
};
|
2009-03-29 20:56:36 +02:00
|
|
|
|
|
2009-05-02 17:00:13 +02:00
|
|
|
|
static butn_data button_icon_sm_data =
|
|
|
|
|
{
|
|
|
|
|
{NULL,NULL},
|
|
|
|
|
{Button_icon_sm_png,Button_icon_sm_over_png}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static butn_data button_player_data =
|
|
|
|
|
{
|
|
|
|
|
{NULL,NULL},
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{Button_sm_blue_png,Button_sm_yellow_png}
|
2009-05-02 17:00:13 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static butn_data button_player_none_data =
|
|
|
|
|
{
|
|
|
|
|
{NULL,NULL},
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{Button_sm_grey_png,NULL}
|
2009-05-02 17:00:13 +02:00
|
|
|
|
};
|
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
static butn_data button_load_data =
|
|
|
|
|
{
|
|
|
|
|
{NULL,NULL},
|
|
|
|
|
{Button_load_png,Button_load_over_png}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static butn_data button_save_data =
|
|
|
|
|
{
|
|
|
|
|
{NULL,NULL},
|
|
|
|
|
{Button_save_png,Button_save_over_png}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static butn_data button_special_data =
|
|
|
|
|
{
|
|
|
|
|
{NULL,NULL},
|
|
|
|
|
{Button_special_png,Button_special_over_png}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static butn_data button_delete_data =
|
|
|
|
|
{
|
|
|
|
|
{NULL,NULL},
|
|
|
|
|
{Button_delete_png,Button_delete_over_png}
|
|
|
|
|
};
|
|
|
|
|
|
2009-03-29 20:56:36 +02:00
|
|
|
|
/*****************************************************************************/
|
2009-04-20 00:31:08 +02:00
|
|
|
|
/* Generic GUI items */
|
2009-03-29 20:56:36 +02:00
|
|
|
|
/*****************************************************************************/
|
2009-04-20 00:31:08 +02:00
|
|
|
|
static gui_item action_cancel =
|
2009-03-15 20:11:01 +01:00
|
|
|
|
{
|
2009-05-19 18:14:43 +02:00
|
|
|
|
NULL,Key_B_png,"","Back",10,422,28,28
|
2009-03-15 20:11:01 +01:00
|
|
|
|
};
|
|
|
|
|
|
2009-04-20 00:31:08 +02:00
|
|
|
|
static gui_item action_select =
|
2009-03-15 20:11:01 +01:00
|
|
|
|
{
|
2009-05-19 18:14:43 +02:00
|
|
|
|
NULL,Key_A_png,"","",602,422,28,28
|
2009-03-15 20:11:01 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2009-04-16 14:19:12 +02:00
|
|
|
|
/*****************************************************************************/
|
2010-11-01 19:13:17 +01:00
|
|
|
|
/* GUI backgrounds images */
|
2009-04-16 14:19:12 +02:00
|
|
|
|
/*****************************************************************************/
|
2009-04-20 00:31:08 +02:00
|
|
|
|
static gui_image bg_main[4] =
|
2009-04-16 14:19:12 +02:00
|
|
|
|
{
|
2010-05-28 17:47:45 +02:00
|
|
|
|
{NULL,Bg_main_png,IMAGE_VISIBLE,178,74,284,288,255},
|
2009-05-04 23:43:16 +02:00
|
|
|
|
{NULL,Bg_overlay_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,255},
|
|
|
|
|
{NULL,Banner_main_png,IMAGE_VISIBLE|IMAGE_SLIDE_BOTTOM,0,340,640,140,255},
|
|
|
|
|
{NULL,Main_logo_png,IMAGE_VISIBLE|IMAGE_SLIDE_BOTTOM,202,362,232,56,255}
|
2009-04-16 14:19:12 +02:00
|
|
|
|
};
|
|
|
|
|
|
2009-04-20 00:31:08 +02:00
|
|
|
|
static gui_image bg_misc[5] =
|
2009-04-16 14:19:12 +02:00
|
|
|
|
{
|
2010-04-15 14:01:14 +02:00
|
|
|
|
{NULL,Bg_main_png,IMAGE_VISIBLE,178,96,284,288,255},
|
2009-05-04 23:43:16 +02:00
|
|
|
|
{NULL,Bg_overlay_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,255},
|
2009-05-12 14:27:19 +02:00
|
|
|
|
{NULL,Banner_top_png,IMAGE_VISIBLE|IMAGE_SLIDE_TOP,0,0,640,108,255},
|
|
|
|
|
{NULL,Banner_bottom_png,IMAGE_VISIBLE|IMAGE_SLIDE_BOTTOM,0,380,640,100,255},
|
|
|
|
|
{NULL,Main_logo_png,IMAGE_VISIBLE|IMAGE_SLIDE_TOP,466,40,152,44,255}
|
2009-04-16 14:19:12 +02:00
|
|
|
|
};
|
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
static gui_image bg_ctrls[8] =
|
2009-05-02 17:00:13 +02:00
|
|
|
|
{
|
2010-03-22 15:07:25 +01:00
|
|
|
|
{NULL,Bg_main_png,IMAGE_VISIBLE,374,140,284,288,255},
|
2009-05-04 23:43:16 +02:00
|
|
|
|
{NULL,Bg_overlay_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,255},
|
|
|
|
|
{NULL,Banner_top_png,IMAGE_VISIBLE,0,0,640,108,255},
|
|
|
|
|
{NULL,Banner_bottom_png,IMAGE_VISIBLE,0,380,640,100,255},
|
|
|
|
|
{NULL,Main_logo_png,IMAGE_VISIBLE,466,40,152,44,255},
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{NULL,Frame_s2_png,IMAGE_VISIBLE,38,72,316,168,128},
|
|
|
|
|
{NULL,Frame_s2_png,IMAGE_VISIBLE,38,242,316,168,128},
|
2009-05-04 23:43:16 +02:00
|
|
|
|
{NULL,Frame_s3_png,IMAGE_SLIDE_RIGHT,400,134,292,248,128}
|
2009-05-02 17:00:13 +02:00
|
|
|
|
};
|
|
|
|
|
|
2009-04-20 00:31:08 +02:00
|
|
|
|
static gui_image bg_list[6] =
|
2009-04-16 14:19:12 +02:00
|
|
|
|
{
|
2010-03-22 15:07:25 +01:00
|
|
|
|
{NULL,Bg_main_png,IMAGE_VISIBLE,374,140,284,288,255},
|
2009-05-04 23:43:16 +02:00
|
|
|
|
{NULL,Bg_overlay_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,255},
|
|
|
|
|
{NULL,Banner_top_png,IMAGE_VISIBLE,0,0,640,108,255},
|
|
|
|
|
{NULL,Banner_bottom_png,IMAGE_VISIBLE,0,380,640,100,255},
|
|
|
|
|
{NULL,Main_logo_png,IMAGE_VISIBLE,466,40,152,44,255},
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{NULL,Frame_s1_png,IMAGE_VISIBLE,8,70,372,336,76}
|
2009-04-16 14:19:12 +02:00
|
|
|
|
};
|
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
static gui_image bg_saves[8] =
|
|
|
|
|
{
|
|
|
|
|
{NULL,NULL,0,0,0,0,0,255},
|
|
|
|
|
{NULL,Bg_main_png,IMAGE_VISIBLE,374,140,284,288,255},
|
|
|
|
|
{NULL,Bg_overlay_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,255},
|
|
|
|
|
{NULL,Banner_top_png,IMAGE_VISIBLE|IMAGE_SLIDE_TOP,0,0,640,108,255},
|
|
|
|
|
{NULL,Banner_bottom_png,IMAGE_VISIBLE|IMAGE_SLIDE_BOTTOM,0,380,640,100,255},
|
|
|
|
|
{NULL,Main_logo_png,IMAGE_VISIBLE|IMAGE_SLIDE_TOP,466,40,152,44,255},
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{NULL,Frame_s1_png,IMAGE_VISIBLE,8,70,372,336,76},
|
|
|
|
|
{NULL,Frame_s1_png,IMAGE_SLIDE_RIGHT,468,108,372,296,76}
|
2010-05-06 14:59:43 +02:00
|
|
|
|
};
|
|
|
|
|
|
2009-03-29 20:56:36 +02:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/* Menu Items description */
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2010-11-01 19:13:17 +01:00
|
|
|
|
/* Main menu */
|
|
|
|
|
static gui_item items_main[10] =
|
2009-04-20 19:41:54 +02:00
|
|
|
|
{
|
2010-05-28 17:47:45 +02:00
|
|
|
|
{NULL,Main_load_png ,"","",114,162,80,92},
|
|
|
|
|
{NULL,Main_options_png ,"","",290,166,60,88},
|
|
|
|
|
{NULL,Main_quit_png ,"","",460,170,52,84},
|
2009-04-20 19:41:54 +02:00
|
|
|
|
{NULL,Main_file_png ,"","",114,216,80,92},
|
|
|
|
|
{NULL,Main_reset_png ,"","",282,224,76,84},
|
|
|
|
|
{NULL,Main_ggenie_png ,"","",450,224,72,84},
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{NULL,NULL ,"","", 10,334,84,32},
|
2009-04-21 03:05:56 +02:00
|
|
|
|
#ifdef HW_RVL
|
2009-05-01 14:56:48 +02:00
|
|
|
|
{NULL,Main_play_wii_png,"","", 10,372,84,32},
|
2009-04-21 03:05:56 +02:00
|
|
|
|
#else
|
2009-05-01 14:56:48 +02:00
|
|
|
|
{NULL,Main_play_gcn_png,"","", 10,372,84,32},
|
2009-04-21 03:05:56 +02:00
|
|
|
|
#endif
|
2009-05-01 14:56:48 +02:00
|
|
|
|
{NULL,Main_takeshot_png,"","",546,334,84,32},
|
|
|
|
|
{NULL,Main_showinfo_png,"","",546,372,84,32}
|
2009-04-20 19:41:54 +02:00
|
|
|
|
};
|
|
|
|
|
|
2010-11-01 19:13:17 +01:00
|
|
|
|
/* Controllers menu */
|
2009-05-04 23:43:16 +02:00
|
|
|
|
static gui_item items_ctrls[13] =
|
2009-05-02 17:00:13 +02:00
|
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
|
{NULL,NULL,"","", 0, 0, 0, 0},
|
|
|
|
|
{NULL,NULL,"","", 0, 0, 0, 0},
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{NULL,NULL,"","",305, 0, 24, 0},
|
|
|
|
|
{NULL,NULL,"","",305, 0, 24, 0},
|
|
|
|
|
{NULL,NULL,"","",305, 0, 24, 0},
|
|
|
|
|
{NULL,NULL,"","",305, 0, 24, 0},
|
|
|
|
|
{NULL,NULL,"","",305, 0, 24, 0},
|
|
|
|
|
{NULL,NULL,"","",305, 0, 24, 0},
|
|
|
|
|
{NULL,NULL,"","",305, 0, 24, 0},
|
|
|
|
|
{NULL,NULL,"","",305, 0, 24, 0},
|
2009-05-04 23:43:16 +02:00
|
|
|
|
{NULL,NULL,"","", 0, 0, 0, 0},
|
|
|
|
|
{NULL,NULL,"","", 0, 0, 0, 0},
|
2009-05-19 18:14:43 +02:00
|
|
|
|
{NULL,Ctrl_config_png,"Keys\nConfig","Configure Controller Keys",530,306,32,32}
|
2009-05-02 17:00:13 +02:00
|
|
|
|
};
|
|
|
|
|
|
2010-11-01 19:13:17 +01:00
|
|
|
|
/* Load menu */
|
2009-04-20 19:41:54 +02:00
|
|
|
|
static gui_item items_load[4] =
|
|
|
|
|
{
|
2010-03-22 15:07:25 +01:00
|
|
|
|
#ifdef HW_RVL
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{NULL,Load_recent_png,"","Load recent ROM files" ,276,120,88,96},
|
|
|
|
|
{NULL,Load_sd_png ,"","Load ROM files from SD card" ,110,266,88,96},
|
|
|
|
|
{NULL,Load_usb_png ,"","Load ROM files from USB drive" ,276,266,88,96},
|
2009-05-06 16:47:22 +02:00
|
|
|
|
{NULL,Load_dvd_png ,"","Load ROM files from DVD" ,442,266,88,96}
|
2010-05-28 17:47:45 +02:00
|
|
|
|
#else
|
|
|
|
|
{NULL,Load_recent_png,"","Load recent ROM files (USB/SD)" ,110,192,88,96},
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{NULL,Load_sd_png ,"","Load ROM files from SD card" ,276,192,88,96},
|
2010-05-28 17:47:45 +02:00
|
|
|
|
{NULL,Load_dvd_png ,"","Load ROM files from DVD" ,442,192,88,96}
|
|
|
|
|
#endif
|
2009-04-20 19:41:54 +02:00
|
|
|
|
};
|
|
|
|
|
|
2010-11-01 19:13:17 +01:00
|
|
|
|
/* Option menu */
|
2009-04-20 19:41:54 +02:00
|
|
|
|
static gui_item items_options[5] =
|
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
{NULL,Option_system_png,"","System settings", 114,142,80,92},
|
|
|
|
|
{NULL,Option_video_png ,"","Video settings", 288,150,64,84},
|
|
|
|
|
{NULL,Option_sound_png ,"","Audio settings", 464,154,44,80},
|
|
|
|
|
{NULL,Option_ctrl_png ,"","Controllers settings", 192,286,88,92},
|
|
|
|
|
{NULL,Option_menu_png ,"","Menu settings", 370,286,60,92}
|
2009-04-20 19:41:54 +02:00
|
|
|
|
};
|
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
/* Audio options */
|
|
|
|
|
static gui_item items_audio[12] =
|
2009-03-15 20:11:01 +01:00
|
|
|
|
{
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{NULL,NULL,"High-Quality FM: ON", "Enable/disable YM2612 resampling", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"FM Roll-off: 0.999", "Adjust FIR low-pass filtering", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"FM Resolution: MAX", "Adjust YM2612 DAC precision", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"FM Volume: 1.00", "Adjust YM2612 output level", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"PSG Volume: 2.50", "Adjust SN76489 output level", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"PSG Noise Boost: OFF", "Boost SN76489 Noise Channel", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"Filtering: 3-BAND EQ", "Setup Audio filtering", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"Low Gain: 1.00", "Adjust EQ Low Band Gain", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"Mid Gain: 1.00", "Adjust EQ Mid Band Gain", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"High Gain: 1.00", "Adjust EQ High BandGain", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"Low Freq: 200 Hz", "Adjust EQ Lowest Frequency", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"High Freq: 20000 Hz", "Adjust EQ Highest Frequency", 56,132,276,48}
|
2009-03-15 20:11:01 +01:00
|
|
|
|
};
|
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
/* System options */
|
2009-10-16 13:32:55 +02:00
|
|
|
|
static gui_item items_system[7] =
|
2009-03-15 20:11:01 +01:00
|
|
|
|
{
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{NULL,NULL,"Console Region: AUTO", "Select system region", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"System Lockups: OFF", "Enable/disable original system lock-ups", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"68k Address Error: ON", "Enable/disable 68k Address Error", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"System BIOS: OFF", "Enable/disable TMSS BIOS support", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"Lock-on: OFF", "Select Lock-On cartridge type", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"Cartridge Swap: OFF", "Enable/disable cartridge hot swap", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"SVP Cycles: 1500", "Adjust SVP chip emulation speed", 56,132,276,48}
|
2009-03-15 20:11:01 +01:00
|
|
|
|
};
|
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
/* Video options */
|
|
|
|
|
#ifdef HW_RVL
|
|
|
|
|
static gui_item items_video[10] =
|
|
|
|
|
#else
|
2009-03-15 20:11:01 +01:00
|
|
|
|
static gui_item items_video[8] =
|
2010-02-28 20:55:43 +01:00
|
|
|
|
#endif
|
2009-03-15 20:11:01 +01:00
|
|
|
|
{
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{NULL,NULL,"Display: PROGRESSIVE", "Select video mode", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"TV mode: 50/60Hz", "Select video refresh rate", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"GX Bilinear Filter: OFF", "Enable/disable texture hardware filtering", 56,132,276,48},
|
2010-02-28 20:55:43 +01:00
|
|
|
|
#ifdef HW_RVL
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{NULL,NULL,"VI Trap Filter: ON", "Enable/disable video hardware filtering", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"VI Gamma Correction: 1.0","Adjust video hardware gamma correction", 56,132,276,48},
|
2010-02-28 20:55:43 +01:00
|
|
|
|
#endif
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{NULL,NULL,"NTSC Filter: COMPOSITE", "Enable/disable NTSC software filtering", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"Borders: OFF", "Enable/disable overscan emulation", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"Aspect: ORIGINAL (4:3)", "Select display aspect ratio", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"Screen Position (+0,+0)", "Adjust display position", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"Screen Scaling (+0,+0)", "Adjust display scaling", 56,132,276,48}
|
2009-03-15 20:11:01 +01:00
|
|
|
|
};
|
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
/* Menu options */
|
2010-12-04 18:15:36 +01:00
|
|
|
|
static gui_item items_prefs[9] =
|
2009-04-23 03:01:07 +02:00
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
{NULL,NULL,"Auto ROM Load: OFF","Enable/Disable automatic ROM loading on startup", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"Auto Cheats: OFF", "Enable/Disable automatic cheats activation", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"Auto Saves: OFF", "Enable/Disable automatic saves", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"Saves Device: FAT", "Configure default device for saves", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"SFX Volume: 100", "Adjust sound effects volume", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"BGM Volume: 100", "Adjust background music volume", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"BG Color: DEFAULT", "Select background color", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"BG Overlay: ON", "Enable/disable background overlay", 56,132,276,48},
|
|
|
|
|
{NULL,NULL,"Screen Width: 658", "Adjust menu screen width in pixels", 56,132,276,48},
|
2009-04-23 03:01:07 +02:00
|
|
|
|
};
|
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
/* Save Manager */
|
|
|
|
|
static gui_item items_saves[9] =
|
|
|
|
|
{
|
|
|
|
|
{NULL,NULL,"","" ,0,0,0,0},
|
|
|
|
|
{NULL,NULL,"","" ,0,0,0,0},
|
|
|
|
|
{NULL,NULL,"","" ,0,0,0,0},
|
|
|
|
|
{NULL,NULL,"","" ,0,0,0,0},
|
|
|
|
|
{NULL,NULL,"","" ,0,0,0,0},
|
|
|
|
|
{NULL,NULL,"","Load file" ,0,0,0,0},
|
|
|
|
|
{NULL,NULL,"","Set as default file",0,0,0,0},
|
|
|
|
|
{NULL,NULL,"","Delete file" ,0,0,0,0},
|
|
|
|
|
{NULL,NULL,"","Save file" ,0,0,0,0}
|
|
|
|
|
};
|
|
|
|
|
|
2009-03-15 20:11:01 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/* Menu Buttons description */
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2009-04-20 00:31:08 +02:00
|
|
|
|
/* Generic Buttons for list menu */
|
2010-05-06 14:59:43 +02:00
|
|
|
|
static gui_butn arrow_up = {&arrow_up_data,BUTTON_ACTIVE|BUTTON_OVER_SFX,{0,0,0,0},14,76,360,32};
|
|
|
|
|
static gui_butn arrow_down = {&arrow_down_data,BUTTON_ACTIVE|BUTTON_OVER_SFX,{0,0,0,0},14,368,360,32};
|
2009-04-20 00:31:08 +02:00
|
|
|
|
|
2009-03-29 20:56:36 +02:00
|
|
|
|
/* Generic list menu */
|
2009-04-20 00:31:08 +02:00
|
|
|
|
static gui_butn buttons_list[4] =
|
2009-03-15 20:11:01 +01:00
|
|
|
|
{
|
2010-05-06 14:59:43 +02:00
|
|
|
|
{&button_text_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{1,1,0,0},56,132,276,48},
|
|
|
|
|
{&button_text_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{1,1,0,0},56,188,276,48},
|
|
|
|
|
{&button_text_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{1,1,0,0},56,244,276,48},
|
|
|
|
|
{&button_text_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{1,1,0,0},56,300,276,48}
|
|
|
|
|
};
|
2009-03-15 20:11:01 +01:00
|
|
|
|
|
2009-03-29 20:56:36 +02:00
|
|
|
|
/* Main menu */
|
2010-11-01 19:13:17 +01:00
|
|
|
|
static gui_butn buttons_main[10] =
|
2009-03-15 20:11:01 +01:00
|
|
|
|
{
|
2010-05-30 20:42:03 +02:00
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,0,0,1}, 80,140,148,132},
|
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,0,1,1},246,140,148,132},
|
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,0,1,0},412,140,148,132},
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{&button_icon_data, BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{3,4,0,1}, 80,194,148,132},
|
|
|
|
|
{&button_icon_data, BUTTON_OVER_SFX ,{3,4,1,1},246,194,148,132},
|
|
|
|
|
{&button_icon_data, BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{3,3,1,0},412,194,148,132},
|
|
|
|
|
{NULL , BUTTON_OVER_SFX ,{3,1,0,2}, 10,334, 84, 32},
|
|
|
|
|
{NULL , BUTTON_OVER_SFX ,{4,0,0,2}, 10,372, 84, 32},
|
|
|
|
|
{NULL , BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{3,1,1,0},546,334, 84, 32},
|
|
|
|
|
{NULL , BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,0,2,0},546,372, 84, 32}
|
2009-03-15 20:11:01 +01:00
|
|
|
|
};
|
|
|
|
|
|
2009-05-02 17:00:13 +02:00
|
|
|
|
/* Controllers Menu */
|
2009-05-04 23:43:16 +02:00
|
|
|
|
static gui_butn buttons_ctrls[13] =
|
2009-05-02 17:00:13 +02:00
|
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
|
{&button_icon_data ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX ,{0,1,0,2}, 60, 88,148,132},
|
|
|
|
|
{&button_icon_data ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX ,{1,0,0,5}, 60,258,148,132},
|
|
|
|
|
{NULL ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,1,2,0},250, 79, 84, 32},
|
|
|
|
|
{NULL ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,1,3,0},250,117, 84, 32},
|
|
|
|
|
{NULL ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,1,4,0},250,155, 84, 32},
|
|
|
|
|
{NULL ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,1,5,0},250,193, 84, 32},
|
|
|
|
|
{NULL ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,1,5,0},250,249, 84, 32},
|
|
|
|
|
{NULL ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,1,6,0},250,287, 84, 32},
|
|
|
|
|
{NULL ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,1,7,0},250,325, 84, 32},
|
|
|
|
|
{NULL ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,0,8,0},250,363, 84, 32},
|
|
|
|
|
{&button_icon_sm_data ,BUTTON_SLIDE_RIGHT|BUTTON_OVER_SFX ,{0,1,1,0},436,168,160, 52},
|
|
|
|
|
{&button_icon_sm_data ,BUTTON_SLIDE_RIGHT|BUTTON_OVER_SFX ,{1,1,0,0},436,232,160, 52},
|
|
|
|
|
{&button_icon_sm_data ,BUTTON_SLIDE_RIGHT|BUTTON_OVER_SFX|BUTTON_SELECT_SFX ,{1,0,0,0},436,296,160, 52}
|
2009-05-02 17:00:13 +02:00
|
|
|
|
};
|
2009-04-20 19:41:54 +02:00
|
|
|
|
|
2009-03-29 20:56:36 +02:00
|
|
|
|
/* Load Game menu */
|
2009-03-15 20:11:01 +01:00
|
|
|
|
static gui_butn buttons_load[4] =
|
|
|
|
|
{
|
2010-05-28 17:47:45 +02:00
|
|
|
|
#ifdef HW_RVL
|
2010-04-15 14:01:14 +02:00
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,2,0,1},246,102,148,132},
|
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,0,1,1}, 80,248,148,132},
|
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{2,0,1,1},246,248,148,132},
|
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{3,0,1,0},412,248,148,132}
|
2009-03-15 20:11:01 +01:00
|
|
|
|
#else
|
2010-05-28 17:47:45 +02:00
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,2,0,1}, 80,174,148,132},
|
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,0,1,1},246,174,148,132},
|
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{3,0,1,0},412,174,148,132}
|
2009-03-15 20:11:01 +01:00
|
|
|
|
#endif
|
2010-03-22 15:07:25 +01:00
|
|
|
|
};
|
2009-03-15 20:11:01 +01:00
|
|
|
|
|
2009-03-29 20:56:36 +02:00
|
|
|
|
/* Options menu */
|
2009-03-15 20:11:01 +01:00
|
|
|
|
static gui_butn buttons_options[5] =
|
|
|
|
|
{
|
2010-04-15 14:01:14 +02:00
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,3,0,1}, 80,120,148,132},
|
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,3,1,1},246,120,148,132},
|
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,2,1,1},412,120,148,132},
|
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{3,0,1,1},162,264,148,132},
|
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{2,0,1,0},330,264,148,132}
|
2009-03-15 20:11:01 +01:00
|
|
|
|
};
|
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
/* Save Manager Menu */
|
|
|
|
|
static gui_butn buttons_saves[9] =
|
|
|
|
|
{
|
|
|
|
|
{&button_text_data ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{0,1,0,0}, 56,102,276,48},
|
|
|
|
|
{&button_text_data ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{1,1,0,0}, 56,158,276,48},
|
|
|
|
|
{&button_text_data ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{1,1,0,0}, 56,214,276,48},
|
|
|
|
|
{&button_text_data ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{1,1,0,0}, 56,270,276,48},
|
|
|
|
|
{&button_text_data ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{1,0,0,0}, 56,326,276,48},
|
|
|
|
|
{&button_load_data ,BUTTON_ACTIVE|BUTTON_SLIDE_RIGHT|BUTTON_OVER_SFX,{0,1,0,0},530,130, 56,56},
|
|
|
|
|
{&button_special_data,BUTTON_ACTIVE|BUTTON_SLIDE_RIGHT|BUTTON_OVER_SFX,{1,1,0,0},530,196, 56,56},
|
|
|
|
|
{&button_delete_data ,BUTTON_ACTIVE|BUTTON_SLIDE_RIGHT|BUTTON_OVER_SFX,{1,1,0,0},530,262, 56,56},
|
|
|
|
|
{&button_save_data ,BUTTON_ACTIVE|BUTTON_SLIDE_RIGHT|BUTTON_OVER_SFX,{1,0,0,0},530,328, 56,56}
|
|
|
|
|
};
|
|
|
|
|
|
2009-03-15 20:11:01 +01:00
|
|
|
|
/*****************************************************************************/
|
2009-03-29 20:56:36 +02:00
|
|
|
|
/* Menu descriptions */
|
2009-03-15 20:11:01 +01:00
|
|
|
|
/*****************************************************************************/
|
2009-03-29 20:56:36 +02:00
|
|
|
|
|
|
|
|
|
/* Main menu */
|
|
|
|
|
static gui_menu menu_main =
|
2009-03-15 20:11:01 +01:00
|
|
|
|
{
|
2009-03-31 09:11:25 +02:00
|
|
|
|
"",
|
2009-04-20 00:31:08 +02:00
|
|
|
|
0,0,
|
2010-11-01 19:13:17 +01:00
|
|
|
|
10,10,4,0,
|
2009-03-15 20:11:01 +01:00
|
|
|
|
items_main,
|
|
|
|
|
buttons_main,
|
2009-04-20 00:31:08 +02:00
|
|
|
|
bg_main,
|
2009-04-21 03:05:56 +02:00
|
|
|
|
{NULL,NULL},
|
2010-05-06 14:59:43 +02:00
|
|
|
|
{NULL,NULL},
|
|
|
|
|
NULL
|
2009-03-15 20:11:01 +01:00
|
|
|
|
};
|
|
|
|
|
|
2009-05-02 17:00:13 +02:00
|
|
|
|
/* Main menu */
|
2009-05-19 18:14:43 +02:00
|
|
|
|
gui_menu menu_ctrls =
|
2009-05-02 17:00:13 +02:00
|
|
|
|
{
|
|
|
|
|
"Controller Settings",
|
|
|
|
|
0,0,
|
2009-12-30 16:31:50 +01:00
|
|
|
|
13,13,8,0,
|
2009-05-02 17:00:13 +02:00
|
|
|
|
items_ctrls,
|
|
|
|
|
buttons_ctrls,
|
|
|
|
|
bg_ctrls,
|
2009-05-05 13:09:40 +02:00
|
|
|
|
{&action_cancel, &action_select},
|
2010-05-06 14:59:43 +02:00
|
|
|
|
{NULL,NULL},
|
|
|
|
|
ctrlmenu_cb
|
2009-05-02 17:00:13 +02:00
|
|
|
|
};
|
|
|
|
|
|
2009-03-29 20:56:36 +02:00
|
|
|
|
/* Load Game menu */
|
|
|
|
|
static gui_menu menu_load =
|
2009-03-15 20:11:01 +01:00
|
|
|
|
{
|
2009-03-29 20:56:36 +02:00
|
|
|
|
"Load Game",
|
2009-04-20 00:31:08 +02:00
|
|
|
|
0,0,
|
2009-03-15 20:11:01 +01:00
|
|
|
|
#ifdef HW_RVL
|
2009-12-30 16:31:50 +01:00
|
|
|
|
4,4,5,0,
|
2009-03-15 20:11:01 +01:00
|
|
|
|
#else
|
2009-12-30 16:31:50 +01:00
|
|
|
|
3,3,5,0,
|
2009-03-15 20:11:01 +01:00
|
|
|
|
#endif
|
|
|
|
|
items_load,
|
|
|
|
|
buttons_load,
|
2009-04-20 00:31:08 +02:00
|
|
|
|
bg_misc,
|
2009-03-15 20:11:01 +01:00
|
|
|
|
{&action_cancel, &action_select},
|
2010-05-06 14:59:43 +02:00
|
|
|
|
{NULL,NULL},
|
|
|
|
|
NULL
|
2009-03-15 20:11:01 +01:00
|
|
|
|
};
|
|
|
|
|
|
2009-03-29 20:56:36 +02:00
|
|
|
|
/* Options menu */
|
|
|
|
|
static gui_menu menu_options =
|
2009-02-22 20:57:41 +01:00
|
|
|
|
{
|
2009-03-30 15:08:01 +02:00
|
|
|
|
"Settings",
|
2009-04-20 00:31:08 +02:00
|
|
|
|
0,0,
|
2009-12-30 16:31:50 +01:00
|
|
|
|
5,5,5,0,
|
2009-03-15 20:11:01 +01:00
|
|
|
|
items_options,
|
|
|
|
|
buttons_options,
|
2009-04-20 00:31:08 +02:00
|
|
|
|
bg_misc,
|
2009-03-15 20:11:01 +01:00
|
|
|
|
{&action_cancel, &action_select},
|
2010-05-06 14:59:43 +02:00
|
|
|
|
{NULL,NULL},
|
|
|
|
|
NULL
|
2009-02-22 20:57:41 +01:00
|
|
|
|
};
|
|
|
|
|
|
2009-03-29 20:56:36 +02:00
|
|
|
|
/* System Options menu */
|
|
|
|
|
static gui_menu menu_system =
|
2009-03-15 20:11:01 +01:00
|
|
|
|
{
|
2009-04-24 01:24:40 +02:00
|
|
|
|
"System Settings",
|
2009-04-20 00:31:08 +02:00
|
|
|
|
0,0,
|
2009-12-30 16:31:50 +01:00
|
|
|
|
6,4,6,0,
|
2009-03-15 20:11:01 +01:00
|
|
|
|
items_system,
|
2009-04-20 00:31:08 +02:00
|
|
|
|
buttons_list,
|
|
|
|
|
bg_list,
|
2009-03-15 20:11:01 +01:00
|
|
|
|
{&action_cancel, &action_select},
|
2010-05-06 14:59:43 +02:00
|
|
|
|
{&arrow_up,&arrow_down},
|
|
|
|
|
NULL
|
2009-03-15 20:11:01 +01:00
|
|
|
|
};
|
|
|
|
|
|
2009-03-29 20:56:36 +02:00
|
|
|
|
/* Video Options menu */
|
|
|
|
|
static gui_menu menu_video =
|
2009-03-15 20:11:01 +01:00
|
|
|
|
{
|
2009-04-24 01:24:40 +02:00
|
|
|
|
"Video Settings",
|
2009-04-20 00:31:08 +02:00
|
|
|
|
0,0,
|
2009-12-30 16:31:50 +01:00
|
|
|
|
8,4,6,0,
|
2009-03-15 20:11:01 +01:00
|
|
|
|
items_video,
|
2009-04-20 00:31:08 +02:00
|
|
|
|
buttons_list,
|
|
|
|
|
bg_list,
|
2009-03-15 20:11:01 +01:00
|
|
|
|
{&action_cancel, &action_select},
|
2010-05-06 14:59:43 +02:00
|
|
|
|
{&arrow_up,&arrow_down},
|
|
|
|
|
NULL
|
2009-03-15 20:11:01 +01:00
|
|
|
|
};
|
|
|
|
|
|
2009-03-29 20:56:36 +02:00
|
|
|
|
/* Sound Options menu */
|
|
|
|
|
static gui_menu menu_audio =
|
2009-03-15 20:11:01 +01:00
|
|
|
|
{
|
2009-05-06 16:47:22 +02:00
|
|
|
|
"Audio Settings",
|
2009-04-20 00:31:08 +02:00
|
|
|
|
0,0,
|
2010-02-28 20:55:43 +01:00
|
|
|
|
8,4,6,0,
|
2009-03-15 20:11:01 +01:00
|
|
|
|
items_audio,
|
2009-04-20 00:31:08 +02:00
|
|
|
|
buttons_list,
|
|
|
|
|
bg_list,
|
2009-03-15 20:11:01 +01:00
|
|
|
|
{&action_cancel, &action_select},
|
2010-05-06 14:59:43 +02:00
|
|
|
|
{&arrow_up,&arrow_down},
|
|
|
|
|
NULL
|
2009-03-15 20:11:01 +01:00
|
|
|
|
};
|
|
|
|
|
|
2009-04-23 03:01:07 +02:00
|
|
|
|
/* Sound Options menu */
|
|
|
|
|
static gui_menu menu_prefs =
|
|
|
|
|
{
|
2009-04-24 01:24:40 +02:00
|
|
|
|
"Menu Settings",
|
2009-04-23 03:01:07 +02:00
|
|
|
|
0,0,
|
2010-12-04 18:15:36 +01:00
|
|
|
|
9,4,6,0,
|
2009-04-23 03:01:07 +02:00
|
|
|
|
items_prefs,
|
|
|
|
|
buttons_list,
|
|
|
|
|
bg_list,
|
|
|
|
|
{&action_cancel, &action_select},
|
2010-05-06 14:59:43 +02:00
|
|
|
|
{&arrow_up,&arrow_down},
|
|
|
|
|
NULL
|
2009-04-23 03:01:07 +02:00
|
|
|
|
};
|
|
|
|
|
|
2009-04-24 01:24:40 +02:00
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
/* Save Manager menu */
|
|
|
|
|
static gui_menu menu_saves =
|
2008-08-07 14:26:07 +02:00
|
|
|
|
{
|
2010-05-06 14:59:43 +02:00
|
|
|
|
"Save Manager",
|
|
|
|
|
0,0,
|
|
|
|
|
9,9,8,0,
|
|
|
|
|
items_saves,
|
|
|
|
|
buttons_saves,
|
|
|
|
|
bg_saves,
|
|
|
|
|
{&action_cancel, &action_select},
|
|
|
|
|
{NULL,NULL},
|
|
|
|
|
savemenu_cb
|
|
|
|
|
};
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2009-04-23 03:01:07 +02:00
|
|
|
|
/****************************************************************************
|
2009-05-04 23:43:16 +02:00
|
|
|
|
* GUI Settings menu
|
2009-04-23 03:01:07 +02:00
|
|
|
|
*
|
|
|
|
|
****************************************************************************/
|
2009-05-25 12:41:16 +02:00
|
|
|
|
static void update_screen_w(void)
|
|
|
|
|
{
|
|
|
|
|
vmode->viWidth = config.screen_w;
|
|
|
|
|
vmode->viXOrigin = (VI_MAX_WIDTH_NTSC -config.screen_w)/2;
|
|
|
|
|
VIDEO_Configure(vmode);
|
|
|
|
|
VIDEO_Flush();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void update_bgm(void)
|
|
|
|
|
{
|
|
|
|
|
SetVolumeOgg(((int)config.bgm_volume * 255) / 100);
|
|
|
|
|
}
|
|
|
|
|
|
2009-04-23 03:01:07 +02:00
|
|
|
|
static void prefmenu ()
|
|
|
|
|
{
|
|
|
|
|
int ret, quit = 0;
|
|
|
|
|
gui_menu *m = &menu_prefs;
|
|
|
|
|
gui_item *items = m->items;
|
2010-05-06 14:59:43 +02:00
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
sprintf (items[0].text, "Auto ROM Load: %s", config.autoload ? "ON":"OFF");
|
|
|
|
|
sprintf (items[1].text, "Auto Cheats: %s", config.autocheat ? "ON":"OFF");
|
|
|
|
|
if (config.s_auto == 3) sprintf (items[2].text, "Auto Saves: ALL");
|
|
|
|
|
else if (config.s_auto == 2) sprintf (items[2].text, "Auto Saves: STATE ONLY");
|
|
|
|
|
else if (config.s_auto == 1) sprintf (items[2].text, "Auto Saves: SRAM ONLY");
|
|
|
|
|
else sprintf (items[2].text, "Auto Saves: NONE");
|
|
|
|
|
if (config.s_device == 1) sprintf (items[3].text, "Saves Device: MCARD A");
|
|
|
|
|
else if (config.s_device == 2) sprintf (items[3].text, "Saves Device: MCARD B");
|
|
|
|
|
else sprintf (items[3].text, "Saves Device: FAT");
|
|
|
|
|
sprintf (items[4].text, "SFX Volume: %1.1f", config.sfx_volume);
|
|
|
|
|
sprintf (items[5].text, "BGM Volume: %1.1f", config.bgm_volume);
|
|
|
|
|
if (config.bg_type) sprintf (items[6].text, "BG Type: COLOR %d", config.bg_type - 1);
|
|
|
|
|
else sprintf (items[6].text, "BG Type: DEFAULT");
|
|
|
|
|
sprintf (items[7].text, "BG Overlay: %s", config.bg_overlay ? "ON":"OFF");
|
|
|
|
|
sprintf (items[8].text, "Screen Width: %d", config.screen_w);
|
2009-05-01 14:56:48 +02:00
|
|
|
|
|
2009-04-23 03:01:07 +02:00
|
|
|
|
GUI_InitMenu(m);
|
2009-04-24 01:24:40 +02:00
|
|
|
|
GUI_SlideMenuTitle(m,strlen("Menu "));
|
2009-04-23 03:01:07 +02:00
|
|
|
|
|
|
|
|
|
while (quit == 0)
|
|
|
|
|
{
|
|
|
|
|
ret = GUI_RunMenu(m);
|
|
|
|
|
|
|
|
|
|
switch (ret)
|
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
case 0: /* Auto load last ROM file on startup */
|
2010-05-07 20:25:27 +02:00
|
|
|
|
config.autoload ^= 1;
|
2010-12-04 18:15:36 +01:00
|
|
|
|
sprintf (items[0].text, "Auto ROM Load: %s", config.autoload ? "ON":"OFF");
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 1: /* Cheats automatic activation */
|
|
|
|
|
config.autocheat ^= 1;
|
|
|
|
|
sprintf (items[1].text, "Auto Cheats: %s", config.autocheat ? "ON":"OFF");
|
2010-05-07 20:25:27 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
case 2: /*** Auto load/save STATE & SRAM files ***/
|
2010-05-06 14:59:43 +02:00
|
|
|
|
config.s_auto = (config.s_auto + 1) % 4;
|
2010-12-04 18:15:36 +01:00
|
|
|
|
if (config.s_auto == 3) sprintf (items[2].text, "Auto Saves: ALL");
|
|
|
|
|
else if (config.s_auto == 2) sprintf (items[2].text, "Auto Saves: STATE ONLY");
|
|
|
|
|
else if (config.s_auto == 1) sprintf (items[2].text, "Auto Saves: SRAM ONLY");
|
|
|
|
|
else sprintf (items[2].text, "Auto Saves: NONE");
|
2009-04-23 03:01:07 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
case 3: /*** Default saves device ***/
|
2010-05-06 14:59:43 +02:00
|
|
|
|
config.s_device = (config.s_device + 1) % 3;
|
2010-12-04 18:15:36 +01:00
|
|
|
|
if (config.s_device == 1) sprintf (items[3].text, "Saves Device: MCARD A");
|
|
|
|
|
else if (config.s_device == 2) sprintf (items[3].text, "Saves Device: MCARD B");
|
|
|
|
|
else sprintf (items[3].text, "Saves Device: FAT");
|
2009-04-23 03:01:07 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
case 4: /*** Sound effects volume ***/
|
2009-05-25 12:41:16 +02:00
|
|
|
|
GUI_OptionBox(m,0,"SFX Volume",(void *)&config.sfx_volume,10.0,0.0,100.0,0);
|
2010-12-04 18:15:36 +01:00
|
|
|
|
sprintf (items[4].text, "SFX Volume: %1.1f", config.sfx_volume);
|
2009-04-23 03:01:07 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
case 5: /*** Background music volume ***/
|
2009-05-25 12:41:16 +02:00
|
|
|
|
GUI_OptionBox(m,update_bgm,"BGM Volume",(void *)&config.bgm_volume,10.0,0.0,100.0,0);
|
2010-12-04 18:15:36 +01:00
|
|
|
|
sprintf (items[5].text, "BGM Volume: %1.1f", config.bgm_volume);
|
2009-04-23 03:01:07 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
case 6: /*** Background type ***/
|
2010-07-06 16:03:50 +02:00
|
|
|
|
if (ret < 0) config.bg_type --;
|
|
|
|
|
else config.bg_type++;
|
|
|
|
|
if (config.bg_type < 0) config.bg_type = BG_COLOR_MAX;
|
|
|
|
|
else if (config.bg_type > BG_COLOR_MAX) config.bg_type = 0;
|
2010-12-04 18:15:36 +01:00
|
|
|
|
if (config.bg_type) sprintf (items[6].text, "BG Type: COLOR %d", config.bg_type - 1);
|
|
|
|
|
else sprintf (items[6].text, "BG Type: DEFAULT");
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_DeleteMenu(m);
|
2010-07-06 16:03:50 +02:00
|
|
|
|
menu_configure();
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_InitMenu(m);
|
2009-04-23 03:01:07 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
case 7: /*** Background overlay ***/
|
2010-03-22 15:07:25 +01:00
|
|
|
|
config.bg_overlay ^= 1;
|
2010-12-04 18:15:36 +01:00
|
|
|
|
sprintf (items[7].text, "BG Overlay: %s", config.bg_overlay ? "ON":"OFF");
|
2010-07-06 16:03:50 +02:00
|
|
|
|
menu_configure();
|
2010-03-22 15:07:25 +01:00
|
|
|
|
break;
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
case 8: /*** Screen Width ***/
|
2009-05-25 12:41:16 +02:00
|
|
|
|
GUI_OptionBox(m,update_screen_w,"Screen Width",(void *)&config.screen_w,2,640,VI_MAX_WIDTH_NTSC,1);
|
2010-12-04 18:15:36 +01:00
|
|
|
|
sprintf (items[8].text, "Screen Width: %d", config.screen_w);
|
2009-05-26 15:14:33 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2009-04-23 03:01:07 +02:00
|
|
|
|
case -1:
|
|
|
|
|
quit = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GUI_DeleteMenu(m);
|
|
|
|
|
}
|
|
|
|
|
|
2008-08-07 14:26:07 +02:00
|
|
|
|
/****************************************************************************
|
2009-05-04 23:43:16 +02:00
|
|
|
|
* Audio Settings menu
|
2008-08-07 14:26:07 +02:00
|
|
|
|
*
|
|
|
|
|
****************************************************************************/
|
2010-02-28 20:55:43 +01:00
|
|
|
|
static int update_snd_items(void)
|
2008-08-07 14:26:07 +02:00
|
|
|
|
{
|
2009-03-30 09:05:34 +02:00
|
|
|
|
gui_menu *m = &menu_audio;
|
|
|
|
|
gui_item *items = m->items;
|
2010-02-28 20:55:43 +01:00
|
|
|
|
int offset;
|
2009-08-11 10:18:46 +02:00
|
|
|
|
float fm_volume = (float)config.fm_preamp/100.0;
|
2010-02-28 20:55:43 +01:00
|
|
|
|
float psg_volume = (float)config.psg_preamp/100.0;
|
2010-03-07 18:56:02 +01:00
|
|
|
|
float rolloff = config.rolloff * 100.0;
|
2010-05-17 12:55:37 +02:00
|
|
|
|
float lg = (float)config.lg/100.0;
|
|
|
|
|
float mg = (float)config.mg/100.0;
|
2010-05-30 20:42:03 +02:00
|
|
|
|
float hg = (float)config.hg/100.0;
|
2010-02-28 20:55:43 +01:00
|
|
|
|
|
|
|
|
|
if (config.hq_fm)
|
|
|
|
|
{
|
|
|
|
|
sprintf (items[0].text, "High-Quality FM: ON");
|
2010-03-07 18:56:02 +01:00
|
|
|
|
sprintf (items[1].text, "FM Roll-off: %1.2f %%",rolloff);
|
2010-02-28 20:55:43 +01:00
|
|
|
|
strcpy (items[1].comment, "Adjust FIR low-pass filtering");
|
|
|
|
|
offset = 2;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
sprintf (items[0].text, "High-Quality FM: OFF");
|
|
|
|
|
offset = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
strcpy(items[offset].comment, "Adjust YM2612 DAC precision");
|
|
|
|
|
strcpy(items[offset+1].comment, "Adjust YM2612 output level");
|
|
|
|
|
strcpy(items[offset+2].comment, "Adjust SN76489 output level");
|
|
|
|
|
strcpy(items[offset+3].comment, "Boost SN76489 Noise Channel");
|
|
|
|
|
strcpy(items[offset+4].comment, "Configure Audio filtering");
|
|
|
|
|
|
|
|
|
|
if (config.dac_bits < 14)
|
|
|
|
|
sprintf (items[offset].text, "FM Resolution: %d bits", config.dac_bits);
|
|
|
|
|
else
|
|
|
|
|
sprintf (items[offset].text, "FM Resolution: MAX");
|
|
|
|
|
|
|
|
|
|
sprintf (items[offset+1].text, "FM Volume: %1.2f", fm_volume);
|
|
|
|
|
sprintf (items[offset+2].text, "PSG Volume: %1.2f", psg_volume);
|
|
|
|
|
sprintf (items[offset+3].text, "PSG Noise Boost: %s", config.psgBoostNoise ? "ON":"OFF");
|
2009-03-30 09:05:34 +02:00
|
|
|
|
|
2009-08-11 10:18:46 +02:00
|
|
|
|
if (config.filter == 2)
|
|
|
|
|
{
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[offset+4].text, "Filtering: 3-BAND EQ");
|
2010-05-17 12:55:37 +02:00
|
|
|
|
sprintf (items[offset+5].text, "Low Gain: %1.2f", lg);
|
2010-02-28 20:55:43 +01:00
|
|
|
|
m->max_items = offset + 10;
|
2009-08-11 10:18:46 +02:00
|
|
|
|
}
|
|
|
|
|
else if (config.filter == 1)
|
|
|
|
|
{
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[offset+4].text, "Filtering: LOW-PASS");
|
|
|
|
|
sprintf (items[offset+5].text, "Low-Pass Rate: %d %%", config.lp_range);
|
|
|
|
|
strcpy (items[offset+5].comment, "Adjust Low Pass filter");
|
|
|
|
|
m->max_items = offset + 6;
|
2009-08-11 10:18:46 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
2010-02-28 20:55:43 +01:00
|
|
|
|
{
|
|
|
|
|
sprintf (items[offset+4].text, "Filtering: OFF");
|
|
|
|
|
m->max_items = offset + 5;
|
|
|
|
|
}
|
|
|
|
|
|
2010-05-17 12:55:37 +02:00
|
|
|
|
sprintf (items[offset+6].text, "Middle Gain: %1.2f", mg);
|
|
|
|
|
sprintf (items[offset+7].text, "High Gain: %1.2f", hg);
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[offset+8].text, "Low Freq: %d", config.low_freq);
|
|
|
|
|
sprintf (items[offset+9].text, "High Freq: %d", config.high_freq);
|
|
|
|
|
strcpy (items[offset+5].comment, "Adjust EQ Low Band Gain");
|
|
|
|
|
strcpy (items[offset+6].comment, "Adjust EQ Mid Band Gain");
|
|
|
|
|
strcpy (items[offset+7].comment, "Adjust EQ High Band Gain");
|
|
|
|
|
strcpy (items[offset+8].comment, "Adjust EQ Lowest Frequency");
|
|
|
|
|
strcpy (items[offset+9].comment, "Adjust EQ Highest Frequency");
|
|
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
|
}
|
2009-05-26 18:40:35 +02:00
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
static void soundmenu ()
|
|
|
|
|
{
|
|
|
|
|
int ret, quit = 0;
|
|
|
|
|
u8 *temp;
|
|
|
|
|
gui_menu *m = &menu_audio;
|
|
|
|
|
gui_item *items = m->items;
|
|
|
|
|
float fm_volume = (float)config.fm_preamp/100.0;
|
|
|
|
|
float psg_volume = (float)config.psg_preamp/100.0;
|
2010-03-07 18:56:02 +01:00
|
|
|
|
float rolloff = config.rolloff * 100.0;
|
2010-05-17 12:55:37 +02:00
|
|
|
|
float lg = (float)config.lg/100.0;
|
|
|
|
|
float mg = (float)config.mg/100.0;
|
2010-05-30 20:42:03 +02:00
|
|
|
|
float hg = (float)config.hg/100.0;
|
2010-02-28 20:55:43 +01:00
|
|
|
|
int offset = update_snd_items();
|
|
|
|
|
GUI_InitMenu(m);
|
2009-05-06 16:47:22 +02:00
|
|
|
|
GUI_SlideMenuTitle(m,strlen("Audio "));
|
2008-12-10 19:16:30 +01:00
|
|
|
|
|
|
|
|
|
while (quit == 0)
|
|
|
|
|
{
|
2009-04-20 00:31:08 +02:00
|
|
|
|
ret = GUI_RunMenu(m);
|
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
/* special case */
|
|
|
|
|
if (config.hq_fm)
|
|
|
|
|
{
|
|
|
|
|
if (ret == 1)
|
|
|
|
|
{
|
2010-03-07 18:56:02 +01:00
|
|
|
|
GUI_OptionBox(m,0,"FM Roll-off",(void *)&rolloff,0.1,95.0,99.9,0);
|
|
|
|
|
sprintf (items[1].text, "FM Roll-off: %1.2f %%",rolloff);
|
|
|
|
|
config.rolloff = rolloff / 100.0;
|
2010-02-28 20:55:43 +01:00
|
|
|
|
ret = 255;
|
|
|
|
|
if (cart.romsize)
|
|
|
|
|
{
|
|
|
|
|
temp = memalign(32,YM2612GetContextSize());
|
|
|
|
|
if (temp)
|
|
|
|
|
{
|
|
|
|
|
/* save YM2612 context */
|
|
|
|
|
memcpy(temp, YM2612GetContextPtr(), YM2612GetContextSize());
|
|
|
|
|
|
|
|
|
|
/* reinitialize audio timings */
|
|
|
|
|
audio_init(snd.sample_rate,snd.frame_rate);
|
|
|
|
|
sound_init();
|
|
|
|
|
|
|
|
|
|
/* restore YM2612 context */
|
|
|
|
|
YM2612Restore(temp);
|
|
|
|
|
free(temp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (ret > 1)
|
|
|
|
|
{
|
|
|
|
|
ret--;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
|
switch (ret)
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
2009-07-22 19:25:41 +02:00
|
|
|
|
config.hq_fm ^= 1;
|
2010-02-28 20:55:43 +01:00
|
|
|
|
offset = update_snd_items();
|
|
|
|
|
|
2009-08-06 20:31:05 +02:00
|
|
|
|
if (cart.romsize)
|
2008-12-10 19:16:30 +01:00
|
|
|
|
{
|
2010-02-28 20:55:43 +01:00
|
|
|
|
temp = memalign(32,YM2612GetContextSize());
|
|
|
|
|
if (temp)
|
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* save YM2612 context */
|
2010-02-28 20:55:43 +01:00
|
|
|
|
memcpy(temp, YM2612GetContextPtr(), YM2612GetContextSize());
|
2010-01-24 12:41:53 +01:00
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* reinitialize audio timings */
|
|
|
|
|
audio_init(snd.sample_rate,snd.frame_rate);
|
|
|
|
|
sound_init();
|
2010-01-24 12:41:53 +01:00
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* restore YM2612 context */
|
2009-04-15 17:33:51 +02:00
|
|
|
|
YM2612Restore(temp);
|
|
|
|
|
free(temp);
|
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2009-05-26 18:40:35 +02:00
|
|
|
|
case 1:
|
2010-02-28 20:55:43 +01:00
|
|
|
|
config.dac_bits++;
|
|
|
|
|
if (config.dac_bits > 14)
|
|
|
|
|
config.dac_bits = 7;
|
|
|
|
|
if (config.dac_bits < 14)
|
|
|
|
|
sprintf (items[offset].text, "FM Resolution: %d bits", config.dac_bits);
|
|
|
|
|
else
|
|
|
|
|
sprintf (items[offset].text, "FM Resolution: MAX");
|
|
|
|
|
|
|
|
|
|
if (cart.romsize)
|
|
|
|
|
{
|
|
|
|
|
temp = memalign(32,YM2612GetContextSize());
|
|
|
|
|
if (temp)
|
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* save YM2612 context */
|
2010-02-28 20:55:43 +01:00
|
|
|
|
memcpy(temp, YM2612GetContextPtr(), YM2612GetContextSize());
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* reinitialize audio timings */
|
|
|
|
|
audio_init(snd.sample_rate,snd.frame_rate);
|
|
|
|
|
sound_init();
|
2010-02-28 20:55:43 +01:00
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* restore YM2612 context */
|
|
|
|
|
YM2612Restore(temp);
|
2010-02-28 20:55:43 +01:00
|
|
|
|
free(temp);
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-05-27 16:07:14 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 2:
|
2010-02-28 20:55:43 +01:00
|
|
|
|
GUI_OptionBox(m,0,"FM Volume",(void *)&fm_volume,0.01,0.0,5.0,0);
|
|
|
|
|
sprintf (items[offset+1].text, "FM Volume: %1.2f", fm_volume);
|
2010-11-01 19:13:17 +01:00
|
|
|
|
config.fm_preamp = (int)(fm_volume * 100.0 + 0.5);
|
2009-05-26 18:40:35 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2009-05-27 16:07:14 +02:00
|
|
|
|
case 3:
|
2010-02-28 20:55:43 +01:00
|
|
|
|
GUI_OptionBox(m,0,"PSG Volume",(void *)&psg_volume,0.01,0.0,5.0,0);
|
|
|
|
|
sprintf (items[offset+2].text, "PSG Volume: %1.2f", psg_volume);
|
2010-11-01 19:13:17 +01:00
|
|
|
|
config.psg_preamp = (int)(psg_volume * 100.0 + 0.5);
|
2009-05-26 18:40:35 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2009-05-27 16:07:14 +02:00
|
|
|
|
case 4:
|
2010-02-28 20:55:43 +01:00
|
|
|
|
config.psgBoostNoise ^= 1;
|
|
|
|
|
sprintf (items[offset+3].text, "PSG Noise Boost: %s", config.psgBoostNoise ? "ON":"OFF");
|
|
|
|
|
SN76489_BoostNoise(config.psgBoostNoise);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 5:
|
|
|
|
|
config.filter = (config.filter + 1) % 3;
|
2009-05-26 18:40:35 +02:00
|
|
|
|
if (config.filter == 2)
|
2009-08-11 10:18:46 +02:00
|
|
|
|
{
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[offset+4].text, "Filtering: 3-BAND EQ");
|
2010-05-17 12:55:37 +02:00
|
|
|
|
sprintf (items[offset+5].text, "Low Gain: %1.2f", lg);
|
2010-02-28 20:55:43 +01:00
|
|
|
|
strcpy (items[offset+5].comment, "Adjust EQ Low Band Gain");
|
|
|
|
|
m->max_items = offset + 10;
|
|
|
|
|
audio_set_equalizer();
|
2009-08-11 10:18:46 +02:00
|
|
|
|
}
|
2009-05-26 18:40:35 +02:00
|
|
|
|
else if (config.filter == 1)
|
2009-08-11 10:18:46 +02:00
|
|
|
|
{
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[offset+4].text, "Filtering: LOW-PASS");
|
|
|
|
|
sprintf (items[offset+5].text, "Low-Pass Rate: %d %%", config.lp_range);
|
|
|
|
|
strcpy (items[offset+5].comment, "Adjust Low Pass filter");
|
|
|
|
|
m->max_items = offset + 6;
|
2009-08-11 10:18:46 +02:00
|
|
|
|
}
|
2009-05-26 18:40:35 +02:00
|
|
|
|
else
|
2009-08-11 10:18:46 +02:00
|
|
|
|
{
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[offset+4].text, "Filtering: OFF");
|
|
|
|
|
m->max_items = offset + 5;
|
2009-08-11 10:18:46 +02:00
|
|
|
|
}
|
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
while ((m->offset + 4) > m->max_items)
|
|
|
|
|
{
|
|
|
|
|
m->offset --;
|
|
|
|
|
m->selected++;
|
|
|
|
|
}
|
2009-08-11 10:18:46 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
case 6:
|
2009-08-11 10:18:46 +02:00
|
|
|
|
if (config.filter == 1)
|
2009-05-26 18:40:35 +02:00
|
|
|
|
{
|
2009-08-11 10:18:46 +02:00
|
|
|
|
GUI_OptionBox(m,0,"Low-Pass Rate",(void *)&config.lp_range,1,0,100,1);
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[offset+5].text, "Low-Pass Rate: %d %%", config.lp_range);
|
2009-05-26 18:40:35 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-05-17 12:55:37 +02:00
|
|
|
|
GUI_OptionBox(m,0,"Low Gain",(void *)&lg,0.01,0.0,2.0,0);
|
|
|
|
|
sprintf (items[offset+5].text, "Low Gain: %1.2f", lg);
|
|
|
|
|
config.lg = (int)(lg * 100.0);
|
2009-07-30 09:15:54 +02:00
|
|
|
|
audio_set_equalizer();
|
2009-05-26 18:40:35 +02:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
case 7:
|
2010-05-17 12:55:37 +02:00
|
|
|
|
GUI_OptionBox(m,0,"Middle Gain",(void *)&mg,0.01,0.0,2.0,0);
|
|
|
|
|
sprintf (items[offset+6].text, "Middle Gain: %1.2f", mg);
|
|
|
|
|
config.mg = (int)(mg * 100.0);
|
2009-05-26 18:40:35 +02:00
|
|
|
|
audio_set_equalizer();
|
|
|
|
|
break;
|
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
case 8:
|
2010-05-17 12:55:37 +02:00
|
|
|
|
GUI_OptionBox(m,0,"High Gain",(void *)&hg,0.01,0.0,2.0,0);
|
|
|
|
|
sprintf (items[offset+7].text, "High Gain: %1.2f", hg);
|
|
|
|
|
config.hg = (int)(hg * 100.0);
|
2009-07-30 09:15:54 +02:00
|
|
|
|
audio_set_equalizer();
|
|
|
|
|
break;
|
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
case 9:
|
2009-08-11 10:18:46 +02:00
|
|
|
|
GUI_OptionBox(m,0,"Low Frequency",(void *)&config.low_freq,10,0,config.high_freq,1);
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[offset+8].text, "Low Freq: %d", config.low_freq);
|
2009-07-30 09:15:54 +02:00
|
|
|
|
audio_set_equalizer();
|
|
|
|
|
break;
|
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
case 10:
|
2009-08-11 10:18:46 +02:00
|
|
|
|
GUI_OptionBox(m,0,"High Frequency",(void *)&config.high_freq,100,config.low_freq,30000,1);
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[offset+9].text, "High Freq: %d", config.high_freq);
|
2009-05-26 18:40:35 +02:00
|
|
|
|
audio_set_equalizer();
|
|
|
|
|
break;
|
|
|
|
|
|
2008-08-07 14:26:07 +02:00
|
|
|
|
case -1:
|
2008-12-10 19:16:30 +01:00
|
|
|
|
quit = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-04-20 00:31:08 +02:00
|
|
|
|
|
|
|
|
|
GUI_DeleteMenu(m);
|
2008-08-07 14:26:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
2009-05-04 23:43:16 +02:00
|
|
|
|
* System Settings menu
|
2008-08-07 14:26:07 +02:00
|
|
|
|
*
|
|
|
|
|
****************************************************************************/
|
2009-03-30 09:05:34 +02:00
|
|
|
|
static void systemmenu ()
|
2008-08-07 14:26:07 +02:00
|
|
|
|
{
|
2010-02-28 20:55:43 +01:00
|
|
|
|
int ret, quit = 0;
|
|
|
|
|
float framerate;
|
|
|
|
|
u8 *temp;
|
2009-03-30 09:05:34 +02:00
|
|
|
|
gui_menu *m = &menu_system;
|
|
|
|
|
gui_item *items = m->items;
|
|
|
|
|
|
2009-12-30 16:31:50 +01:00
|
|
|
|
if (config.region_detect == 0)
|
|
|
|
|
sprintf (items[0].text, "Console Region: AUTO");
|
|
|
|
|
else if (config.region_detect == 1)
|
2010-11-01 19:13:17 +01:00
|
|
|
|
sprintf (items[0].text, "Console Region: USA");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else if (config.region_detect == 2)
|
2010-11-01 19:13:17 +01:00
|
|
|
|
sprintf (items[0].text, "Console Region: EUR");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else if (config.region_detect == 3)
|
2010-11-01 19:13:17 +01:00
|
|
|
|
sprintf (items[0].text, "Console Region: JAPAN");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
|
2009-05-01 14:56:48 +02:00
|
|
|
|
sprintf (items[1].text, "System Lockups: %s", config.force_dtack ? "OFF" : "ON");
|
2009-06-17 09:58:56 +02:00
|
|
|
|
sprintf (items[2].text, "68k Address Error: %s", config.addr_error ? "ON" : "OFF");
|
2010-06-14 10:05:45 +02:00
|
|
|
|
sprintf (items[3].text, "System TMSS: %s", (config.tmss & 1) ? "ON":"OFF");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
|
|
|
|
|
if (config.lock_on == TYPE_GG)
|
|
|
|
|
sprintf (items[4].text, "Lock-On: GAME GENIE");
|
|
|
|
|
else if (config.lock_on == TYPE_AR)
|
|
|
|
|
sprintf (items[4].text, "Lock-On: ACTION REPLAY");
|
|
|
|
|
else if (config.lock_on == TYPE_SK)
|
2010-05-17 12:55:37 +02:00
|
|
|
|
sprintf (items[4].text, "Lock-On: SONIC&KNUCKLES");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else
|
|
|
|
|
sprintf (items[4].text, "Lock-On: OFF");
|
|
|
|
|
|
2009-10-16 13:32:55 +02:00
|
|
|
|
sprintf (items[5].text, "Cartridge Swap: %s", config.hot_swap ? "ON":"OFF");
|
2009-06-17 09:58:56 +02:00
|
|
|
|
|
|
|
|
|
if (svp)
|
|
|
|
|
{
|
2009-10-16 13:32:55 +02:00
|
|
|
|
sprintf (items[6].text, "SVP Cycles: %d", SVP_cycles);
|
|
|
|
|
m->max_items = 7;
|
2009-06-17 09:58:56 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2009-10-16 13:32:55 +02:00
|
|
|
|
m->max_items = 6;
|
2009-06-17 09:58:56 +02:00
|
|
|
|
}
|
2009-05-01 14:56:48 +02:00
|
|
|
|
|
2009-04-20 00:31:08 +02:00
|
|
|
|
GUI_InitMenu(m);
|
2009-04-24 01:24:40 +02:00
|
|
|
|
GUI_SlideMenuTitle(m,strlen("System "));
|
2009-03-15 20:11:01 +01:00
|
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
|
while (quit == 0)
|
|
|
|
|
{
|
2009-04-20 00:31:08 +02:00
|
|
|
|
ret = GUI_RunMenu(m);
|
2009-03-30 09:05:34 +02:00
|
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
|
switch (ret)
|
|
|
|
|
{
|
2010-08-08 20:09:37 +02:00
|
|
|
|
case 0: /*** Force Region ***/
|
2008-12-10 19:16:30 +01:00
|
|
|
|
config.region_detect = (config.region_detect + 1) % 4;
|
2009-12-30 16:31:50 +01:00
|
|
|
|
if (config.region_detect == 0)
|
|
|
|
|
sprintf (items[0].text, "Console Region: AUTO");
|
|
|
|
|
else if (config.region_detect == 1)
|
2010-11-01 19:13:17 +01:00
|
|
|
|
sprintf (items[0].text, "Console Region: USA");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else if (config.region_detect == 2)
|
2010-11-01 19:13:17 +01:00
|
|
|
|
sprintf (items[0].text, "Console Region: EUR");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else if (config.region_detect == 3)
|
2010-11-01 19:13:17 +01:00
|
|
|
|
sprintf (items[0].text, "Console Region: JAPAN");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
|
2009-08-06 20:31:05 +02:00
|
|
|
|
if (cart.romsize)
|
2008-12-10 19:16:30 +01:00
|
|
|
|
{
|
2010-05-28 14:08:00 +02:00
|
|
|
|
/* reset console region */
|
|
|
|
|
region_autodetect();
|
2009-07-30 09:15:54 +02:00
|
|
|
|
|
2010-01-24 12:41:53 +01:00
|
|
|
|
/* save YM2612 context */
|
2010-02-28 20:55:43 +01:00
|
|
|
|
temp = memalign(32,YM2612GetContextSize());
|
2009-12-30 16:31:50 +01:00
|
|
|
|
if (temp)
|
2010-12-04 18:15:36 +01:00
|
|
|
|
{
|
2009-12-30 16:31:50 +01:00
|
|
|
|
memcpy(temp, YM2612GetContextPtr(), YM2612GetContextSize());
|
2010-12-04 18:15:36 +01:00
|
|
|
|
}
|
2010-01-24 12:41:53 +01:00
|
|
|
|
|
|
|
|
|
/* reinitialize all timings */
|
2010-08-08 20:09:37 +02:00
|
|
|
|
framerate = vdp_pal ? 50.0 : ((config.tv_mode == 1) ? 60.0 : ((config.render || interlaced) ? 59.94 : (1000000.0/16715.0)));
|
2010-01-24 12:41:53 +01:00
|
|
|
|
audio_init(snd.sample_rate, framerate);
|
|
|
|
|
system_init();
|
|
|
|
|
|
|
|
|
|
/* restore YM2612 context */
|
2009-05-01 14:56:48 +02:00
|
|
|
|
if (temp)
|
|
|
|
|
{
|
|
|
|
|
YM2612Restore(temp);
|
|
|
|
|
free(temp);
|
|
|
|
|
}
|
2009-02-28 18:49:31 +01:00
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* restore SRAM */
|
|
|
|
|
if (config.s_auto & 1)
|
|
|
|
|
{
|
|
|
|
|
slot_autoload(0,config.s_device);
|
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* reinitialize VC max value */
|
|
|
|
|
vc_max = 0xEA + 24*vdp_pal;
|
|
|
|
|
if (reg[1] & 8)
|
|
|
|
|
{
|
|
|
|
|
vc_max += (28 - 20*vdp_pal);
|
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 1: /*** force DTACK ***/
|
|
|
|
|
config.force_dtack ^= 1;
|
2009-05-01 14:56:48 +02:00
|
|
|
|
sprintf (items[1].text, "System Lockups: %s", config.force_dtack ? "OFF" : "ON");
|
2008-12-10 19:16:30 +01:00
|
|
|
|
break;
|
|
|
|
|
|
2009-06-17 09:58:56 +02:00
|
|
|
|
case 2: /*** 68k Address Error ***/
|
|
|
|
|
config.addr_error ^= 1;
|
|
|
|
|
cart_hw_init ();
|
|
|
|
|
sprintf (items[2].text, "68k Address Error: %s", config.addr_error ? "ON" : "OFF");
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 3: /*** BIOS support ***/
|
2010-06-14 10:05:45 +02:00
|
|
|
|
config.tmss ^= 1;
|
|
|
|
|
sprintf (items[3].text, "System TMSS: %s", (config.tmss & 1) ? "ON":"OFF");
|
2009-08-06 20:31:05 +02:00
|
|
|
|
if (cart.romsize)
|
2008-11-13 08:24:30 +01:00
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* restart emulation */
|
2010-01-24 12:41:53 +01:00
|
|
|
|
system_init();
|
|
|
|
|
system_reset();
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
|
|
|
|
/* restore SRAM */
|
2010-05-06 14:59:43 +02:00
|
|
|
|
if (config.s_auto & 1)
|
2010-12-04 18:15:36 +01:00
|
|
|
|
{
|
2010-05-06 14:59:43 +02:00
|
|
|
|
slot_autoload(0,config.s_device);
|
2010-12-04 18:15:36 +01:00
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
|
}
|
2008-11-13 08:24:30 +01:00
|
|
|
|
break;
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2009-07-29 17:34:25 +02:00
|
|
|
|
case 4: /*** Cart Lock-On ***/
|
|
|
|
|
config.lock_on++;
|
2009-12-30 16:31:50 +01:00
|
|
|
|
if (config.lock_on > TYPE_SK)
|
|
|
|
|
config.lock_on = 0;
|
|
|
|
|
if (config.lock_on == TYPE_GG)
|
|
|
|
|
sprintf (items[4].text, "Lock-On: GAME GENIE");
|
|
|
|
|
else if (config.lock_on == TYPE_AR)
|
|
|
|
|
sprintf (items[4].text, "Lock-On: ACTION REPLAY");
|
|
|
|
|
else if (config.lock_on == TYPE_SK)
|
2010-05-17 12:55:37 +02:00
|
|
|
|
sprintf (items[4].text, "Lock-On: SONIC&KNUCKLES");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else
|
|
|
|
|
sprintf (items[4].text, "Lock-On: OFF");
|
2010-11-01 19:13:17 +01:00
|
|
|
|
|
2009-08-06 20:31:05 +02:00
|
|
|
|
if (cart.romsize)
|
2009-07-30 09:15:54 +02:00
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* restart emulation */
|
2010-01-24 12:41:53 +01:00
|
|
|
|
system_init();
|
|
|
|
|
system_reset();
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
|
|
|
|
/* restore SRAM */
|
2010-05-06 14:59:43 +02:00
|
|
|
|
if (config.s_auto & 1)
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{
|
2010-05-06 14:59:43 +02:00
|
|
|
|
slot_autoload(0,config.s_device);
|
2010-11-01 19:13:17 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Action Replay switch */
|
|
|
|
|
if (areplay_get_status() < 0)
|
|
|
|
|
{
|
|
|
|
|
menu_main.buttons[6].state &= ~(BUTTON_VISIBLE | BUTTON_ACTIVE);
|
|
|
|
|
menu_main.items[6].data = NULL;
|
|
|
|
|
menu_main.cb = NULL;
|
|
|
|
|
menu_main.buttons[3].shift[1] = 4;
|
|
|
|
|
menu_main.buttons[7].shift[0] = 4;
|
|
|
|
|
menu_main.buttons[8].shift[2] = 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
menu_main.buttons[6].state |= (BUTTON_VISIBLE | BUTTON_ACTIVE);
|
|
|
|
|
menu_main.items[6].data = Button_sm_grey_png;
|
|
|
|
|
menu_main.cb = mainmenu_cb;
|
|
|
|
|
menu_main.buttons[3].shift[1] = 3;
|
|
|
|
|
menu_main.buttons[7].shift[0] = 1;
|
|
|
|
|
menu_main.buttons[8].shift[2] = 2;
|
|
|
|
|
}
|
2009-07-30 09:15:54 +02:00
|
|
|
|
}
|
|
|
|
|
break;
|
2009-07-29 17:34:25 +02:00
|
|
|
|
|
2009-10-16 13:32:55 +02:00
|
|
|
|
case 5: /*** Cartridge Hot Swap ***/
|
|
|
|
|
config.hot_swap ^= 1;
|
|
|
|
|
sprintf (items[5].text, "Cartridge Swap: %s", config.hot_swap ? "ON":"OFF");
|
|
|
|
|
break;
|
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
case 6: /*** SVP cycles per line ***/
|
2009-05-25 12:41:16 +02:00
|
|
|
|
GUI_OptionBox(m,0,"SVP Cycles",(void *)&SVP_cycles,1,1,1500,1);
|
2009-10-16 13:32:55 +02:00
|
|
|
|
sprintf (items[6].text, "SVP Cycles: %d", SVP_cycles);
|
2008-12-10 19:16:30 +01:00
|
|
|
|
break;
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
|
|
|
|
case -1:
|
2008-12-10 19:16:30 +01:00
|
|
|
|
quit = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-04-20 00:31:08 +02:00
|
|
|
|
|
|
|
|
|
GUI_DeleteMenu(m);
|
2008-08-07 14:26:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
2009-05-04 23:43:16 +02:00
|
|
|
|
* Video Settings menu
|
2008-08-07 14:26:07 +02:00
|
|
|
|
*
|
|
|
|
|
****************************************************************************/
|
2010-02-28 20:55:43 +01:00
|
|
|
|
#ifdef HW_RVL
|
|
|
|
|
#define VI_OFFSET 5
|
|
|
|
|
static void update_gamma(void)
|
|
|
|
|
{
|
|
|
|
|
VIDEO_SetGamma((int)(config.gamma * 10.0));
|
|
|
|
|
VIDEO_Flush();
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
#define VI_OFFSET 3
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-03-30 09:05:34 +02:00
|
|
|
|
static void videomenu ()
|
2008-08-07 14:26:07 +02:00
|
|
|
|
{
|
2009-12-30 16:31:50 +01:00
|
|
|
|
u16 state[2];
|
2009-03-30 09:05:34 +02:00
|
|
|
|
int ret, quit = 0;
|
2010-02-28 20:55:43 +01:00
|
|
|
|
float framerate;
|
|
|
|
|
u8 *temp;
|
2009-03-30 09:05:34 +02:00
|
|
|
|
gui_menu *m = &menu_video;
|
|
|
|
|
gui_item *items = m->items;
|
|
|
|
|
|
2009-12-30 16:31:50 +01:00
|
|
|
|
if (config.render == 1)
|
|
|
|
|
sprintf (items[0].text,"Display: INTERLACED");
|
|
|
|
|
else if (config.render == 2)
|
|
|
|
|
sprintf (items[0].text, "Display: PROGRESSIVE");
|
|
|
|
|
else
|
|
|
|
|
sprintf (items[0].text, "Display: ORIGINAL");
|
|
|
|
|
|
|
|
|
|
if (config.tv_mode == 0)
|
|
|
|
|
sprintf (items[1].text, "TV Mode: 60HZ");
|
|
|
|
|
else if (config.tv_mode == 1)
|
|
|
|
|
sprintf (items[1].text, "TV Mode: 50HZ");
|
|
|
|
|
else
|
|
|
|
|
sprintf (items[1].text, "TV Mode: 50/60HZ");
|
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[2].text, "GX Bilinear Filter: %s", config.bilinear ? " ON" : "OFF");
|
|
|
|
|
|
|
|
|
|
#ifdef HW_RVL
|
|
|
|
|
sprintf (items[3].text, "VI Trap Filter: %s", config.trap ? " ON" : "OFF");
|
|
|
|
|
sprintf (items[4].text, "VI Gamma Correction: %1.1f", config.gamma);
|
|
|
|
|
#endif
|
2009-12-30 16:31:50 +01:00
|
|
|
|
|
|
|
|
|
if (config.ntsc == 1)
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[VI_OFFSET].text, "NTSC Filter: COMPOSITE");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else if (config.ntsc == 2)
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[VI_OFFSET].text, "NTSC Filter: S-VIDEO");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else if (config.ntsc == 3)
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[VI_OFFSET].text, "NTSC Filter: RGB");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[VI_OFFSET].text, "NTSC Filter: OFF");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
|
2010-06-10 09:57:18 +02:00
|
|
|
|
if (config.overscan == 3)
|
|
|
|
|
sprintf (items[VI_OFFSET+1].text, "Borders: ALL");
|
|
|
|
|
else if (config.overscan == 2)
|
|
|
|
|
sprintf (items[VI_OFFSET+1].text, "Borders: H ONLY");
|
|
|
|
|
else if (config.overscan == 1)
|
|
|
|
|
sprintf (items[VI_OFFSET+1].text, "Borders: V ONLY");
|
|
|
|
|
else
|
|
|
|
|
sprintf (items[VI_OFFSET+1].text, "Borders: NONE");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
|
|
|
|
|
if (config.aspect == 1)
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[VI_OFFSET+2].text,"Aspect: ORIGINAL (4:3)");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else if (config.aspect == 2)
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[VI_OFFSET+2].text, "Aspect: ORIGINAL (16:9)");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else
|
2010-11-01 19:13:17 +01:00
|
|
|
|
sprintf (items[VI_OFFSET+2].text, "Aspect: SCALED");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[VI_OFFSET+3].text, "Screen Position: (%s%02d,%s%02d)",
|
2009-12-30 16:31:50 +01:00
|
|
|
|
(config.xshift < 0) ? "":"+", config.xshift,
|
|
|
|
|
(config.yshift < 0) ? "":"+", config.yshift);
|
2010-02-28 20:55:43 +01:00
|
|
|
|
|
|
|
|
|
sprintf (items[VI_OFFSET+4].text, "Screen Scaling: (%s%02d,%s%02d)",
|
2009-12-30 16:31:50 +01:00
|
|
|
|
(config.xscale < 0) ? "":"+", config.xscale,
|
|
|
|
|
(config.yscale < 0) ? "":"+", config.yscale);
|
2009-05-01 14:56:48 +02:00
|
|
|
|
|
2009-05-26 18:40:35 +02:00
|
|
|
|
if (config.aspect)
|
2010-02-28 20:55:43 +01:00
|
|
|
|
m->max_items = VI_OFFSET+4;
|
2009-05-26 18:40:35 +02:00
|
|
|
|
else
|
2010-02-28 20:55:43 +01:00
|
|
|
|
m->max_items = VI_OFFSET+5;
|
2009-05-26 18:40:35 +02:00
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
GUI_InitMenu(m);
|
2009-04-24 01:24:40 +02:00
|
|
|
|
GUI_SlideMenuTitle(m,strlen("Video "));
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
|
while (quit == 0)
|
|
|
|
|
{
|
2009-04-20 00:31:08 +02:00
|
|
|
|
ret = GUI_RunMenu(m);
|
|
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
|
switch (ret)
|
|
|
|
|
{
|
2009-05-14 14:32:20 +02:00
|
|
|
|
case 0: /*** rendering ***/
|
2008-12-10 19:16:30 +01:00
|
|
|
|
config.render = (config.render + 1) % 3;
|
|
|
|
|
if (config.render == 2)
|
|
|
|
|
{
|
|
|
|
|
if (VIDEO_HaveComponentCable())
|
|
|
|
|
{
|
2008-08-07 14:26:07 +02:00
|
|
|
|
/* progressive mode (60hz only) */
|
|
|
|
|
config.tv_mode = 0;
|
2009-12-30 16:31:50 +01:00
|
|
|
|
sprintf (items[1].text, "TV Mode: 60HZ");
|
2008-08-07 14:26:07 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* do nothing if component cable is not detected */
|
|
|
|
|
config.render = 0;
|
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-08 20:09:37 +02:00
|
|
|
|
if (!vdp_pal && cart.romsize)
|
2010-01-24 12:41:53 +01:00
|
|
|
|
{
|
|
|
|
|
/* save YM2612 context */
|
2010-02-28 20:55:43 +01:00
|
|
|
|
temp = memalign(32,YM2612GetContextSize());
|
2010-01-24 12:41:53 +01:00
|
|
|
|
if (temp)
|
2010-12-04 18:15:36 +01:00
|
|
|
|
{
|
2010-01-24 12:41:53 +01:00
|
|
|
|
memcpy(temp, YM2612GetContextPtr(), YM2612GetContextSize());
|
2010-12-04 18:15:36 +01:00
|
|
|
|
}
|
2010-01-24 12:41:53 +01:00
|
|
|
|
|
|
|
|
|
/* reinitialize audio timings */
|
2010-08-08 20:09:37 +02:00
|
|
|
|
framerate = (config.tv_mode == 1) ? 60.0 : ((config.render || interlaced) ? 59.94 : (1000000.0/16715.0));
|
2010-01-24 12:41:53 +01:00
|
|
|
|
audio_init(snd.sample_rate, framerate);
|
|
|
|
|
sound_init();
|
|
|
|
|
|
|
|
|
|
/* restore YM2612 context */
|
|
|
|
|
if (temp)
|
|
|
|
|
{
|
|
|
|
|
YM2612Restore(temp);
|
|
|
|
|
free(temp);
|
|
|
|
|
}
|
2010-08-08 20:09:37 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (config.render == 1)
|
|
|
|
|
sprintf (items[0].text,"Display: INTERLACED");
|
|
|
|
|
else if (config.render == 2)
|
|
|
|
|
sprintf (items[0].text, "Display: PROGRESSIVE");
|
|
|
|
|
else
|
|
|
|
|
sprintf (items[0].text, "Display: ORIGINAL");
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 1: /*** tv mode ***/
|
|
|
|
|
if (config.render != 2)
|
|
|
|
|
{
|
|
|
|
|
config.tv_mode = (config.tv_mode + 1) % 3;
|
|
|
|
|
|
|
|
|
|
if (!vdp_pal && cart.romsize)
|
|
|
|
|
{
|
|
|
|
|
/* save YM2612 context */
|
|
|
|
|
temp = memalign(32,YM2612GetContextSize());
|
|
|
|
|
if (temp)
|
2010-12-04 18:15:36 +01:00
|
|
|
|
{
|
2010-08-08 20:09:37 +02:00
|
|
|
|
memcpy(temp, YM2612GetContextPtr(), YM2612GetContextSize());
|
2010-12-04 18:15:36 +01:00
|
|
|
|
}
|
2010-08-08 20:09:37 +02:00
|
|
|
|
|
|
|
|
|
/* reinitialize audio timings */
|
|
|
|
|
framerate = (config.tv_mode == 1) ? 60.0 : ((config.render || interlaced) ? 59.94 : (1000000.0/16715.0));
|
|
|
|
|
audio_init(snd.sample_rate, framerate);
|
|
|
|
|
sound_init();
|
|
|
|
|
|
|
|
|
|
/* restore YM2612 context */
|
|
|
|
|
if (temp)
|
|
|
|
|
{
|
|
|
|
|
YM2612Restore(temp);
|
|
|
|
|
free(temp);
|
|
|
|
|
}
|
|
|
|
|
}
|
2010-01-24 12:41:53 +01:00
|
|
|
|
|
|
|
|
|
if (config.tv_mode == 0)
|
|
|
|
|
sprintf (items[1].text, "TV Mode: 60HZ");
|
|
|
|
|
else if (config.tv_mode == 1)
|
|
|
|
|
sprintf (items[1].text, "TV Mode: 50HZ");
|
|
|
|
|
else
|
|
|
|
|
sprintf (items[1].text, "TV Mode: 50/60HZ");
|
|
|
|
|
}
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else
|
2010-01-24 12:41:53 +01:00
|
|
|
|
{
|
|
|
|
|
GUI_WaitPrompt("Error","Progressive Mode is 60hz only !\n");
|
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
|
break;
|
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
case 2: /*** GX Texture filtering ***/
|
2008-12-10 19:16:30 +01:00
|
|
|
|
config.bilinear ^= 1;
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[2].text, "GX Bilinear Filter: %s", config.bilinear ? " ON" : "OFF");
|
2008-12-10 19:16:30 +01:00
|
|
|
|
break;
|
2008-10-20 17:50:13 +02:00
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
#ifdef HW_RVL
|
|
|
|
|
case 3: /*** VIDEO Trap filtering ***/
|
|
|
|
|
config.trap ^= 1;
|
|
|
|
|
sprintf (items[3].text, "VI Trap Filter: %s", config.trap ? " ON" : "OFF");
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 4: /*** VIDEO Gamma correction ***/
|
|
|
|
|
if (cart.romsize)
|
|
|
|
|
{
|
|
|
|
|
update_gamma();
|
|
|
|
|
state[0] = m->arrows[0]->state;
|
|
|
|
|
state[1] = m->arrows[1]->state;
|
|
|
|
|
m->max_buttons = 0;
|
|
|
|
|
m->max_images = 0;
|
|
|
|
|
m->arrows[0]->state = 0;
|
|
|
|
|
m->arrows[1]->state = 0;
|
|
|
|
|
m->screenshot = 255;
|
|
|
|
|
strcpy(m->title,"");
|
|
|
|
|
GUI_OptionBox(m,update_gamma,"VI Gamma Correction",(void *)&config.gamma,0.1,0.1,3.0,0);
|
|
|
|
|
m->max_buttons = 4;
|
|
|
|
|
m->max_images = 6;
|
|
|
|
|
m->arrows[0]->state = state[0];
|
|
|
|
|
m->arrows[1]->state = state[1];
|
|
|
|
|
m->screenshot = 0;
|
|
|
|
|
strcpy(m->title,"Video Settings");
|
|
|
|
|
sprintf (items[4].text, "VI Gamma Correction: %1.1f", config.gamma);
|
|
|
|
|
VIDEO_SetGamma(VI_GM_1_0);
|
|
|
|
|
VIDEO_Flush();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
GUI_WaitPrompt("Error","Please load a game first !\n");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
case VI_OFFSET: /*** NTSC filter ***/
|
2009-12-30 16:31:50 +01:00
|
|
|
|
config.ntsc = (config.ntsc + 1) % 4;
|
|
|
|
|
if (config.ntsc == 1)
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[VI_OFFSET].text, "NTSC Filter: COMPOSITE");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else if (config.ntsc == 2)
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[VI_OFFSET].text, "NTSC Filter: S-VIDEO");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else if (config.ntsc == 3)
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[VI_OFFSET].text, "NTSC Filter: RGB");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[VI_OFFSET].text, "NTSC Filter: OFF");
|
2008-12-10 19:16:30 +01:00
|
|
|
|
break;
|
2008-10-03 16:14:20 +02:00
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
case VI_OFFSET+1: /*** overscan emulation ***/
|
2010-06-10 09:57:18 +02:00
|
|
|
|
config.overscan = (config.overscan + 1) % 4;
|
|
|
|
|
if (config.overscan == 3)
|
|
|
|
|
sprintf (items[VI_OFFSET+1].text, "Borders: ALL");
|
|
|
|
|
else if (config.overscan == 2)
|
|
|
|
|
sprintf (items[VI_OFFSET+1].text, "Borders: H ONLY");
|
|
|
|
|
else if (config.overscan == 1)
|
|
|
|
|
sprintf (items[VI_OFFSET+1].text, "Borders: V ONLY");
|
|
|
|
|
else
|
|
|
|
|
sprintf (items[VI_OFFSET+1].text, "Borders: NONE");
|
2009-05-14 14:32:20 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
case VI_OFFSET+2: /*** aspect ratio ***/
|
2009-12-30 16:31:50 +01:00
|
|
|
|
config.aspect = (config.aspect + 1) % 3;
|
|
|
|
|
if (config.aspect == 1)
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[VI_OFFSET+2].text,"Aspect: ORIGINAL (4:3)");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else if (config.aspect == 2)
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[VI_OFFSET+2].text, "Aspect: ORIGINAL (16:9)");
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else
|
2010-11-01 19:13:17 +01:00
|
|
|
|
sprintf (items[VI_OFFSET+2].text, "Aspect: SCALED");
|
2008-12-10 19:16:30 +01:00
|
|
|
|
|
2009-05-26 18:40:35 +02:00
|
|
|
|
if (config.aspect)
|
|
|
|
|
{
|
|
|
|
|
/* disable items */
|
2010-02-28 20:55:43 +01:00
|
|
|
|
m->max_items = VI_OFFSET+4;
|
2009-05-26 18:40:35 +02:00
|
|
|
|
|
|
|
|
|
/* reset menu selection */
|
2010-02-28 20:55:43 +01:00
|
|
|
|
if (m->offset > VI_OFFSET)
|
2009-05-26 18:40:35 +02:00
|
|
|
|
{
|
2010-02-28 20:55:43 +01:00
|
|
|
|
m->offset = VI_OFFSET;
|
2009-05-26 18:40:35 +02:00
|
|
|
|
m->selected = 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* enable items */
|
2010-02-28 20:55:43 +01:00
|
|
|
|
m->max_items = VI_OFFSET+5;
|
2009-05-26 18:40:35 +02:00
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
|
|
|
|
|
|
break;
|
2009-05-25 12:41:16 +02:00
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
case VI_OFFSET+3: /*** screen position ***/
|
2009-12-30 16:31:50 +01:00
|
|
|
|
if (cart.romsize)
|
|
|
|
|
{
|
|
|
|
|
state[0] = m->arrows[0]->state;
|
|
|
|
|
state[1] = m->arrows[1]->state;
|
|
|
|
|
m->max_buttons = 0;
|
|
|
|
|
m->max_images = 0;
|
|
|
|
|
m->arrows[0]->state = 0;
|
|
|
|
|
m->arrows[1]->state = 0;
|
|
|
|
|
m->screenshot = 255;
|
|
|
|
|
strcpy(m->title,"");
|
|
|
|
|
GUI_OptionBox2(m,"X Offset","Y Offset",&config.xshift,&config.yshift,1,-99,99);
|
|
|
|
|
m->max_buttons = 4;
|
|
|
|
|
m->max_images = 6;
|
|
|
|
|
m->arrows[0]->state = state[0];
|
|
|
|
|
m->arrows[1]->state = state[1];
|
|
|
|
|
m->screenshot = 0;
|
|
|
|
|
strcpy(m->title,"Video Settings");
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[VI_OFFSET+3].text, "Screen Position: (%s%02d,%s%02d)",
|
2009-12-30 16:31:50 +01:00
|
|
|
|
(config.xshift < 0) ? "":"+", config.xshift,
|
|
|
|
|
(config.yshift < 0) ? "":"+", config.yshift);
|
|
|
|
|
}
|
2010-01-24 12:41:53 +01:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
GUI_WaitPrompt("Error","Please load a game first !\n");
|
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
|
break;
|
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
case VI_OFFSET+4: /*** screen scaling ***/
|
2009-12-30 16:31:50 +01:00
|
|
|
|
if (cart.romsize)
|
|
|
|
|
{
|
|
|
|
|
state[0] = m->arrows[0]->state;
|
|
|
|
|
state[1] = m->arrows[1]->state;
|
|
|
|
|
m->max_buttons = 0;
|
|
|
|
|
m->max_images = 0;
|
|
|
|
|
m->arrows[0]->state = 0;
|
|
|
|
|
m->arrows[1]->state = 0;
|
|
|
|
|
m->screenshot = 255;
|
|
|
|
|
strcpy(m->title,"");
|
|
|
|
|
GUI_OptionBox2(m,"X Scale","Y Scale",&config.xscale,&config.yscale,1,-99,99);
|
|
|
|
|
m->max_buttons = 4;
|
|
|
|
|
m->max_images = 6;
|
|
|
|
|
m->arrows[0]->state = state[0];
|
|
|
|
|
m->arrows[1]->state = state[1];
|
|
|
|
|
m->screenshot = 0;
|
|
|
|
|
strcpy(m->title,"Video Settings");
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf (items[VI_OFFSET+4].text, "Screen Scaling: (%s%02d,%s%02d)",
|
2009-12-30 16:31:50 +01:00
|
|
|
|
(config.xscale < 0) ? "":"+", config.xscale,
|
|
|
|
|
(config.yscale < 0) ? "":"+", config.yscale);
|
|
|
|
|
}
|
2010-01-24 12:41:53 +01:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
GUI_WaitPrompt("Error","Please load a game first !\n");
|
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
|
break;
|
2009-05-26 18:40:35 +02:00
|
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
|
case -1:
|
|
|
|
|
quit = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-04-20 00:31:08 +02:00
|
|
|
|
|
|
|
|
|
GUI_DeleteMenu(m);
|
2008-08-07 14:26:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
2009-05-04 23:43:16 +02:00
|
|
|
|
* Controllers Settings menu
|
2008-08-07 14:26:07 +02:00
|
|
|
|
****************************************************************************/
|
2010-05-06 14:59:43 +02:00
|
|
|
|
static int player = 0;
|
|
|
|
|
static void ctrlmenu_cb(void)
|
|
|
|
|
{
|
2010-11-01 19:13:17 +01:00
|
|
|
|
int i, cnt = 1;
|
2010-05-06 14:59:43 +02:00
|
|
|
|
char msg[16];
|
|
|
|
|
gui_menu *m = &menu_ctrls;
|
|
|
|
|
|
|
|
|
|
if (m->bg_images[7].state & IMAGE_VISIBLE)
|
|
|
|
|
{
|
2010-11-01 19:13:17 +01:00
|
|
|
|
/* draw device port number */
|
2010-05-06 14:59:43 +02:00
|
|
|
|
if (config.input[player].device != -1)
|
|
|
|
|
{
|
|
|
|
|
sprintf(msg,"%d",config.input[player].port + 1);
|
|
|
|
|
if (m->selected == 11)
|
2010-11-01 19:13:17 +01:00
|
|
|
|
FONT_write(msg,16,m->items[11].x+m->items[11].w+2,m->items[11].y+m->items[11].h+2,640,(GXColor)DARK_GREY);
|
2010-05-06 14:59:43 +02:00
|
|
|
|
else
|
|
|
|
|
FONT_write(msg,14,m->items[11].x+m->items[11].w,m->items[11].y+m->items[11].h,640,(GXColor)DARK_GREY);
|
|
|
|
|
}
|
|
|
|
|
}
|
2010-11-01 19:13:17 +01:00
|
|
|
|
|
|
|
|
|
/* draw players index */
|
|
|
|
|
for (i=2; i<MAX_DEVICES+2; i++)
|
|
|
|
|
{
|
|
|
|
|
if (m->selected == i)
|
|
|
|
|
{
|
|
|
|
|
FONT_writeCenter("Player", 16, m->buttons[i].x + 2, m->buttons[i].x + 54, m->buttons[i].y + (m->buttons[i].h - 16)/2 + 16, (GXColor)DARK_GREY);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
FONT_writeCenter("Player", 14, m->buttons[i].x + 4, m->buttons[i].x + 54, m->buttons[i].y + (m->buttons[i].h - 14)/2 + 14, (GXColor)DARK_GREY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (input.dev[i-2] != NO_DEVICE)
|
|
|
|
|
{
|
|
|
|
|
sprintf(msg,"%d",cnt++);
|
|
|
|
|
if (m->selected == i)
|
|
|
|
|
{
|
|
|
|
|
FONT_writeCenter(msg,18,m->items[i].x+2,m->items[i].x+m->items[i].w+2,m->buttons[i].y+(m->buttons[i].h-18)/2+18,(GXColor)DARK_GREY);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
FONT_writeCenter(msg,16,m->items[i].x,m->items[i].x+m->items[i].w,m->buttons[i].y+(m->buttons[i].h - 16)/2+16,(GXColor)DARK_GREY);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2010-05-06 14:59:43 +02:00
|
|
|
|
}
|
2009-05-02 17:00:13 +02:00
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* Set menu elements depending on current system configuration */
|
|
|
|
|
static void ctrlmenu_raz(void)
|
2008-08-07 14:26:07 +02:00
|
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
|
int i,max = 0;
|
2009-05-02 17:00:13 +02:00
|
|
|
|
gui_menu *m = &menu_ctrls;
|
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* update players buttons */
|
2009-05-02 17:00:13 +02:00
|
|
|
|
for (i=0; i<MAX_DEVICES; i++)
|
|
|
|
|
{
|
|
|
|
|
if (input.dev[i] == NO_DEVICE)
|
|
|
|
|
{
|
|
|
|
|
m->buttons[i+2].data = &button_player_none_data;
|
|
|
|
|
m->buttons[i+2].state &= ~BUTTON_ACTIVE;
|
2009-05-04 23:43:16 +02:00
|
|
|
|
strcpy(m->items[i+2].comment,"");
|
2009-05-02 17:00:13 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m->buttons[i+2].data = &button_player_data;
|
|
|
|
|
m->buttons[i+2].state |= BUTTON_ACTIVE;
|
2010-05-28 14:08:00 +02:00
|
|
|
|
if (cart.jcart && (i > 4))
|
2009-05-06 12:03:33 +02:00
|
|
|
|
sprintf(m->items[i+2].comment,"Configure Player %d (J-CART) settings", max + 1);
|
|
|
|
|
else
|
|
|
|
|
sprintf(m->items[i+2].comment,"Configure Player %d settings", max + 1);
|
2009-05-02 17:00:13 +02:00
|
|
|
|
max++;
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-05-03 20:40:51 +02:00
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* update buttons navigation */
|
2009-12-30 16:31:50 +01:00
|
|
|
|
if (input.dev[0] != NO_DEVICE)
|
|
|
|
|
m->buttons[0].shift[3] = 2;
|
|
|
|
|
else if (input.dev[4] != NO_DEVICE)
|
|
|
|
|
m->buttons[0].shift[3] = 6;
|
2010-07-28 14:01:03 +02:00
|
|
|
|
else if (input.dev[5] != NO_DEVICE)
|
|
|
|
|
m->buttons[0].shift[3] = 7;
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else
|
|
|
|
|
m->buttons[0].shift[3] = 0;
|
|
|
|
|
if (input.dev[4] != NO_DEVICE)
|
|
|
|
|
m->buttons[1].shift[3] = 5;
|
2010-07-28 14:01:03 +02:00
|
|
|
|
else if (input.dev[5] != NO_DEVICE)
|
|
|
|
|
m->buttons[1].shift[3] = 6;
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else if (input.dev[0] != NO_DEVICE)
|
|
|
|
|
m->buttons[1].shift[3] = 1;
|
|
|
|
|
else
|
|
|
|
|
m->buttons[1].shift[3] = 0;
|
2010-07-28 14:01:03 +02:00
|
|
|
|
|
2009-12-30 16:31:50 +01:00
|
|
|
|
if (input.dev[1] != NO_DEVICE)
|
|
|
|
|
m->buttons[2].shift[1] = 1;
|
|
|
|
|
else if (input.dev[4] != NO_DEVICE)
|
|
|
|
|
m->buttons[2].shift[1] = 4;
|
2010-07-28 14:01:03 +02:00
|
|
|
|
else if (input.dev[5] != NO_DEVICE)
|
|
|
|
|
m->buttons[2].shift[1] = 5;
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else
|
|
|
|
|
m->buttons[2].shift[1] = 0;
|
2010-07-28 14:01:03 +02:00
|
|
|
|
|
|
|
|
|
if (input.dev[4] != NO_DEVICE)
|
|
|
|
|
m->buttons[5].shift[1] = 1;
|
|
|
|
|
else if (input.dev[5] != NO_DEVICE)
|
|
|
|
|
m->buttons[5].shift[1] = 2;
|
|
|
|
|
else
|
|
|
|
|
m->buttons[5].shift[1] = 0;
|
|
|
|
|
|
2009-12-30 16:31:50 +01:00
|
|
|
|
if (input.dev[3] != NO_DEVICE)
|
|
|
|
|
m->buttons[6].shift[0] = 1;
|
|
|
|
|
else if (input.dev[0] != NO_DEVICE)
|
|
|
|
|
m->buttons[6].shift[0] = 4;
|
|
|
|
|
else
|
|
|
|
|
m->buttons[6].shift[0] = 0;
|
|
|
|
|
|
2009-05-05 14:58:25 +02:00
|
|
|
|
if (input.dev[5] != NO_DEVICE)
|
2009-05-03 20:40:51 +02:00
|
|
|
|
m->buttons[6].shift[1] = 1;
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else
|
|
|
|
|
m->buttons[6].shift[1] = 0;
|
2010-07-28 14:01:03 +02:00
|
|
|
|
|
|
|
|
|
if (input.dev[6] != NO_DEVICE)
|
|
|
|
|
m->buttons[7].shift[1] = 1;
|
|
|
|
|
else
|
|
|
|
|
m->buttons[7].shift[1] = 0;
|
|
|
|
|
|
|
|
|
|
if (input.dev[7] != NO_DEVICE)
|
|
|
|
|
m->buttons[8].shift[1] = 1;
|
|
|
|
|
else
|
|
|
|
|
m->buttons[8].shift[1] = 0;
|
|
|
|
|
|
|
|
|
|
if (input.dev[4] != NO_DEVICE)
|
|
|
|
|
m->buttons[7].shift[0] = 1;
|
|
|
|
|
else if (input.dev[3] != NO_DEVICE)
|
|
|
|
|
m->buttons[7].shift[0] = 2;
|
|
|
|
|
else if (input.dev[0] != NO_DEVICE)
|
|
|
|
|
m->buttons[7].shift[0] = 5;
|
|
|
|
|
else
|
|
|
|
|
m->buttons[7].shift[0] = 0;
|
2009-05-02 17:00:13 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void ctrlmenu(void)
|
|
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
|
int old_player = -1;
|
2008-12-10 19:16:30 +01:00
|
|
|
|
int i = 0;
|
2009-05-04 23:43:16 +02:00
|
|
|
|
int update = 0;
|
|
|
|
|
gui_item *items = NULL;
|
|
|
|
|
u8 *special = NULL;
|
2008-08-07 14:26:07 +02:00
|
|
|
|
u32 exp;
|
|
|
|
|
|
2009-05-02 17:00:13 +02:00
|
|
|
|
/* System devices */
|
|
|
|
|
gui_item items_sys[2][7] =
|
2009-05-01 14:56:48 +02:00
|
|
|
|
{
|
|
|
|
|
{
|
2009-05-02 17:00:13 +02:00
|
|
|
|
{NULL,Ctrl_none_png ,"","Select Port 1 device",110,130,48,72},
|
|
|
|
|
{NULL,Ctrl_gamepad_png ,"","Select Port 1 device", 87,117,96,84},
|
|
|
|
|
{NULL,Ctrl_mouse_png ,"","Select Port 1 device", 97,113,64,88},
|
|
|
|
|
{NULL,Ctrl_menacer_png ,"","Select Port 1 device", 94,113,80,88},
|
|
|
|
|
{NULL,Ctrl_justifiers_png ,"","Select Port 1 device", 88,117,80,84},
|
|
|
|
|
{NULL,Ctrl_teamplayer_png ,"","Select Port 1 device", 94,109,80,92},
|
|
|
|
|
{NULL,Ctrl_4wayplay_png ,"","Select Port 1 device", 98,110,72,92}
|
2009-05-01 14:56:48 +02:00
|
|
|
|
},
|
|
|
|
|
{
|
2009-05-05 14:58:25 +02:00
|
|
|
|
{NULL,Ctrl_none_png ,"","Select Port 2 device",110,300,48,72},
|
|
|
|
|
{NULL,Ctrl_gamepad_png ,"","Select Port 2 device", 87,287,96,84},
|
|
|
|
|
{NULL,Ctrl_mouse_png ,"","Select Port 2 device", 97,283,64,88},
|
|
|
|
|
{NULL,Ctrl_menacer_png ,"","Select Port 2 device", 94,283,80,88},
|
|
|
|
|
{NULL,Ctrl_justifiers_png ,"","Select Port 2 device", 88,287,80,84},
|
|
|
|
|
{NULL,Ctrl_teamplayer_png ,"","Select Port 2 device", 94,279,80,92},
|
|
|
|
|
{NULL,Ctrl_4wayplay_png ,"","Select Port 2 device", 98,280,72,92}
|
2009-05-01 14:56:48 +02:00
|
|
|
|
}
|
|
|
|
|
};
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2009-05-02 17:00:13 +02:00
|
|
|
|
/* Player Configuration special items */
|
|
|
|
|
gui_item items_special[3][2] =
|
|
|
|
|
{
|
2008-08-07 14:26:07 +02:00
|
|
|
|
{
|
2009-05-02 17:00:13 +02:00
|
|
|
|
/* Gamepad options */
|
2009-05-06 16:47:22 +02:00
|
|
|
|
{NULL,Ctrl_pad3b_png,"Pad\nType","Use 3-buttons Pad",528,180,44,28},
|
|
|
|
|
{NULL,Ctrl_pad6b_png,"Pad\nType","Use 6-buttons Pad",528,180,44,28}
|
2009-05-02 17:00:13 +02:00
|
|
|
|
},
|
2008-08-07 14:26:07 +02:00
|
|
|
|
{
|
2009-05-02 17:00:13 +02:00
|
|
|
|
/* Mouse options */
|
2009-05-05 14:58:25 +02:00
|
|
|
|
{NULL,ctrl_option_off_png,"Invert\nMouse","Enable/Disable Mouse Y-Axis inversion",534,180,24,24},
|
|
|
|
|
{NULL,ctrl_option_on_png ,"Invert\nMouse","Enable/Disable Mouse Y-Axis inversion",534,180,24,24},
|
2009-05-02 17:00:13 +02:00
|
|
|
|
},
|
2008-08-07 14:26:07 +02:00
|
|
|
|
{
|
2009-05-02 17:00:13 +02:00
|
|
|
|
/* Gun options */
|
2009-05-05 14:58:25 +02:00
|
|
|
|
{NULL,ctrl_option_off_png,"Show\nCursor","Enable/Disable Lightgun cursor",534,180,24,24},
|
|
|
|
|
{NULL,ctrl_option_on_png ,"Show\nCursor","Enable/Disable Lightgun cursor",534,180,24,24},
|
2008-08-07 14:26:07 +02:00
|
|
|
|
}
|
2009-05-02 17:00:13 +02:00
|
|
|
|
};
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2009-05-02 17:00:13 +02:00
|
|
|
|
/* Player Configuration device items */
|
|
|
|
|
#ifdef HW_RVL
|
|
|
|
|
gui_item items_device[5] =
|
|
|
|
|
{
|
2009-05-05 14:58:25 +02:00
|
|
|
|
{NULL,ctrl_option_off_png ,"Input\nDevice","Select Input Controller",534,244,24,24},
|
2009-05-04 23:43:16 +02:00
|
|
|
|
{NULL,ctrl_gamecube_png ,"Input\nDevice","Select Input Controller",530,246,36,24},
|
|
|
|
|
{NULL,ctrl_wiimote_png ,"Input\nDevice","Select Input Controller",526,250,40,12},
|
|
|
|
|
{NULL,ctrl_nunchuk_png ,"Input\nDevice","Select Input Controller",532,242,32,32},
|
|
|
|
|
{NULL,ctrl_classic_png ,"Input\nDevice","Select Input Controller",526,242,40,32},
|
2009-05-02 17:00:13 +02:00
|
|
|
|
};
|
|
|
|
|
#else
|
|
|
|
|
gui_item items_device[2] =
|
|
|
|
|
{
|
2009-05-05 14:58:25 +02:00
|
|
|
|
{NULL,ctrl_option_off_png ,"Input\nDevice","Select Input Controller",534,244,24,24},
|
2009-05-04 23:43:16 +02:00
|
|
|
|
{NULL,ctrl_gamecube_png ,"Input\nDevice","Select Input Controller",530,246,36,24}
|
2009-05-02 17:00:13 +02:00
|
|
|
|
};
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* initialize menu */
|
2009-05-02 17:00:13 +02:00
|
|
|
|
gui_menu *m = &menu_ctrls;
|
|
|
|
|
GUI_InitMenu(m);
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2009-05-02 17:00:13 +02:00
|
|
|
|
/* initialize custom buttons */
|
|
|
|
|
button_player_data.texture[0] = gxTextureOpenPNG(button_player_data.image[0],0);
|
|
|
|
|
button_player_data.texture[1] = gxTextureOpenPNG(button_player_data.image[1],0);
|
|
|
|
|
button_player_none_data.texture[0] = gxTextureOpenPNG(button_player_none_data.image[0],0);
|
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* initialize custom images */
|
2009-05-02 17:00:13 +02:00
|
|
|
|
items_sys[1][0].texture = items_sys[0][0].texture = gxTextureOpenPNG(items_sys[0][0].data,0);
|
|
|
|
|
items_sys[1][1].texture = items_sys[0][1].texture = gxTextureOpenPNG(items_sys[0][1].data,0);
|
|
|
|
|
items_sys[1][2].texture = items_sys[0][2].texture = gxTextureOpenPNG(items_sys[0][2].data,0);
|
|
|
|
|
items_sys[1][3].texture = items_sys[0][3].texture = gxTextureOpenPNG(items_sys[0][3].data,0);
|
|
|
|
|
items_sys[1][4].texture = items_sys[0][4].texture = gxTextureOpenPNG(items_sys[0][4].data,0);
|
|
|
|
|
items_sys[1][5].texture = items_sys[0][5].texture = gxTextureOpenPNG(items_sys[0][5].data,0);
|
|
|
|
|
items_sys[1][6].texture = items_sys[0][6].texture = gxTextureOpenPNG(items_sys[0][6].data,0);
|
2009-05-04 23:43:16 +02:00
|
|
|
|
items_special[0][0].texture = gxTextureOpenPNG(items_special[0][0].data,0);
|
|
|
|
|
items_special[0][1].texture = gxTextureOpenPNG(items_special[0][1].data,0);
|
|
|
|
|
items_special[2][0].texture = items_special[1][0].texture = gxTextureOpenPNG(items_special[1][0].data,0);
|
|
|
|
|
items_special[2][1].texture = items_special[1][1].texture = gxTextureOpenPNG(items_special[1][1].data,0);
|
|
|
|
|
items_device[0].texture = items_special[1][0].texture;
|
2009-05-02 17:00:13 +02:00
|
|
|
|
items_device[1].texture = gxTextureOpenPNG(items_device[1].data,0);
|
2009-05-04 23:43:16 +02:00
|
|
|
|
#ifdef HW_RVL
|
2009-05-02 17:00:13 +02:00
|
|
|
|
items_device[2].texture = gxTextureOpenPNG(items_device[2].data,0);
|
|
|
|
|
items_device[3].texture = gxTextureOpenPNG(items_device[3].data,0);
|
|
|
|
|
items_device[4].texture = gxTextureOpenPNG(items_device[4].data,0);
|
2008-08-07 14:26:07 +02:00
|
|
|
|
#endif
|
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* restore current menu elements */
|
2010-05-06 14:59:43 +02:00
|
|
|
|
player = 0;
|
2009-05-04 23:43:16 +02:00
|
|
|
|
ctrlmenu_raz();
|
2009-05-02 17:00:13 +02:00
|
|
|
|
memcpy(&m->items[0],&items_sys[0][input.system[0]],sizeof(gui_item));
|
|
|
|
|
memcpy(&m->items[1],&items_sys[1][input.system[1]],sizeof(gui_item));
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* menu title slide effect */
|
2009-05-05 14:58:25 +02:00
|
|
|
|
m->selected = 0;
|
2009-05-02 17:00:13 +02:00
|
|
|
|
GUI_SlideMenuTitle(m,strlen("Controller "));
|
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
while (update != -1)
|
2009-05-02 17:00:13 +02:00
|
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* draw menu */
|
|
|
|
|
GUI_DrawMenu(m);
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* update menu */
|
|
|
|
|
update = GUI_UpdateMenu(m);
|
2009-05-02 17:00:13 +02:00
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
if (update > 0)
|
|
|
|
|
{
|
|
|
|
|
switch (m->selected)
|
|
|
|
|
{
|
2009-05-06 12:03:33 +02:00
|
|
|
|
case 0: /* update port 1 system */
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{
|
2009-12-30 16:31:50 +01:00
|
|
|
|
if (input.system[0] == SYSTEM_MOUSE)
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{
|
|
|
|
|
/* lightguns are never used on Port 1 */
|
|
|
|
|
input.system[0] += 3;
|
|
|
|
|
}
|
2009-12-30 16:31:50 +01:00
|
|
|
|
else
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{
|
|
|
|
|
/* next connected device */
|
2009-12-30 16:31:50 +01:00
|
|
|
|
input.system[0]++;
|
2010-11-01 19:13:17 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* allow only one connected mouse */
|
2009-12-30 16:31:50 +01:00
|
|
|
|
if ((input.system[0] == SYSTEM_MOUSE) && (input.system[1] == SYSTEM_MOUSE))
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{
|
|
|
|
|
input.system[0] += 3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 4-wayplay uses both ports */
|
2009-12-30 16:31:50 +01:00
|
|
|
|
if (input.system[0] == SYSTEM_WAYPLAY)
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{
|
2009-12-30 16:31:50 +01:00
|
|
|
|
input.system[1] = SYSTEM_WAYPLAY;
|
2010-11-01 19:13:17 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* loop back */
|
2009-05-04 23:43:16 +02:00
|
|
|
|
if (input.system[0] > SYSTEM_WAYPLAY)
|
|
|
|
|
{
|
|
|
|
|
input.system[0] = NO_SYSTEM;
|
|
|
|
|
input.system[1] = SYSTEM_GAMEPAD;
|
|
|
|
|
}
|
2010-11-01 19:13:17 +01:00
|
|
|
|
|
|
|
|
|
/* reset I/O ports */
|
2009-08-09 11:33:48 +02:00
|
|
|
|
io_init();
|
2010-07-28 14:01:03 +02:00
|
|
|
|
input_reset();
|
2010-11-01 19:13:17 +01:00
|
|
|
|
|
|
|
|
|
/* save current configuration */
|
2009-05-04 23:43:16 +02:00
|
|
|
|
old_system[0] = input.system[0];
|
|
|
|
|
old_system[1] = input.system[1];
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* update menu elements */
|
|
|
|
|
ctrlmenu_raz();
|
|
|
|
|
memcpy(&m->items[0],&items_sys[0][input.system[0]],sizeof(gui_item));
|
|
|
|
|
memcpy(&m->items[1],&items_sys[1][input.system[1]],sizeof(gui_item));
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
if (m->bg_images[7].state & IMAGE_VISIBLE)
|
2008-08-07 14:26:07 +02:00
|
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* slide out configuration window */
|
|
|
|
|
GUI_DrawMenuFX(m, 20, 1);
|
|
|
|
|
|
|
|
|
|
/* remove configuration window */
|
|
|
|
|
m->bg_images[7].state &= ~IMAGE_VISIBLE;
|
|
|
|
|
|
|
|
|
|
/* disable configuration buttons */
|
|
|
|
|
m->buttons[10].state &= (~BUTTON_VISIBLE & ~BUTTON_ACTIVE);
|
|
|
|
|
m->buttons[11].state &= (~BUTTON_VISIBLE & ~BUTTON_ACTIVE);
|
|
|
|
|
m->buttons[12].state &= (~BUTTON_VISIBLE & ~BUTTON_ACTIVE);
|
|
|
|
|
|
|
|
|
|
/* update directions */
|
|
|
|
|
m->buttons[2].shift[3] = 0;
|
|
|
|
|
m->buttons[3].shift[3] = 0;
|
|
|
|
|
m->buttons[4].shift[3] = 0;
|
|
|
|
|
m->buttons[5].shift[3] = 0;
|
|
|
|
|
m->buttons[6].shift[3] = 0;
|
|
|
|
|
m->buttons[7].shift[3] = 0;
|
|
|
|
|
m->buttons[8].shift[3] = 0;
|
|
|
|
|
m->buttons[9].shift[3] = 0;
|
2009-05-05 14:58:25 +02:00
|
|
|
|
|
|
|
|
|
/* update title */
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf(m->title,"Controller Settings");
|
2008-08-07 14:26:07 +02:00
|
|
|
|
}
|
2009-05-04 23:43:16 +02:00
|
|
|
|
break;
|
2010-11-01 19:13:17 +01:00
|
|
|
|
}
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2009-05-06 12:03:33 +02:00
|
|
|
|
case 1: /* update port 2 system */
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{
|
|
|
|
|
/* J-CART uses fixed configuration */
|
2010-05-28 14:08:00 +02:00
|
|
|
|
if (cart.jcart) break;
|
2010-11-01 19:13:17 +01:00
|
|
|
|
|
|
|
|
|
/* next connected device */
|
2009-05-04 23:43:16 +02:00
|
|
|
|
input.system[1] ++;
|
2010-11-01 19:13:17 +01:00
|
|
|
|
|
|
|
|
|
/* allow only one connected mouse */
|
2009-12-30 16:31:50 +01:00
|
|
|
|
if ((input.system[0] == SYSTEM_MOUSE) && (input.system[1] == SYSTEM_MOUSE))
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{
|
2009-12-30 16:31:50 +01:00
|
|
|
|
input.system[1] ++;
|
2010-11-01 19:13:17 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 4-wayplay uses both ports */
|
2009-12-30 16:31:50 +01:00
|
|
|
|
if (input.system[1] == SYSTEM_WAYPLAY)
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{
|
2009-12-30 16:31:50 +01:00
|
|
|
|
input.system[0] = SYSTEM_WAYPLAY;
|
2010-11-01 19:13:17 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* loop back */
|
2009-05-04 23:43:16 +02:00
|
|
|
|
if (input.system[1] > SYSTEM_WAYPLAY)
|
2008-08-07 14:26:07 +02:00
|
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
|
input.system[1] = NO_SYSTEM;
|
|
|
|
|
input.system[0] = SYSTEM_GAMEPAD;
|
2008-08-07 14:26:07 +02:00
|
|
|
|
}
|
2010-11-01 19:13:17 +01:00
|
|
|
|
|
|
|
|
|
/* reset I/O ports */
|
2009-08-09 11:33:48 +02:00
|
|
|
|
io_init();
|
2010-07-28 14:01:03 +02:00
|
|
|
|
input_reset();
|
2010-11-01 19:13:17 +01:00
|
|
|
|
|
|
|
|
|
/* save current configuration */
|
2009-05-04 23:43:16 +02:00
|
|
|
|
old_system[0] = input.system[0];
|
|
|
|
|
old_system[1] = input.system[1];
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* update menu elements */
|
|
|
|
|
ctrlmenu_raz();
|
|
|
|
|
memcpy(&m->items[0],&items_sys[0][input.system[0]],sizeof(gui_item));
|
|
|
|
|
memcpy(&m->items[1],&items_sys[1][input.system[1]],sizeof(gui_item));
|
|
|
|
|
|
|
|
|
|
if (m->bg_images[7].state & IMAGE_VISIBLE)
|
2008-08-11 20:02:04 +02:00
|
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* slide out configuration window */
|
|
|
|
|
GUI_DrawMenuFX(m, 20, 1);
|
|
|
|
|
|
|
|
|
|
/* remove configuration window */
|
|
|
|
|
m->bg_images[7].state &= ~IMAGE_VISIBLE;
|
|
|
|
|
|
|
|
|
|
/* disable configuration buttons */
|
|
|
|
|
m->buttons[10].state &= (~BUTTON_VISIBLE & ~BUTTON_ACTIVE);
|
|
|
|
|
m->buttons[11].state &= (~BUTTON_VISIBLE & ~BUTTON_ACTIVE);
|
|
|
|
|
m->buttons[12].state &= (~BUTTON_VISIBLE & ~BUTTON_ACTIVE);
|
|
|
|
|
|
|
|
|
|
/* update directions */
|
|
|
|
|
m->buttons[2].shift[3] = 0;
|
|
|
|
|
m->buttons[3].shift[3] = 0;
|
|
|
|
|
m->buttons[4].shift[3] = 0;
|
|
|
|
|
m->buttons[5].shift[3] = 0;
|
|
|
|
|
m->buttons[6].shift[3] = 0;
|
|
|
|
|
m->buttons[7].shift[3] = 0;
|
|
|
|
|
m->buttons[8].shift[3] = 0;
|
|
|
|
|
m->buttons[9].shift[3] = 0;
|
2009-05-05 14:58:25 +02:00
|
|
|
|
|
|
|
|
|
/* update title */
|
2010-02-28 20:55:43 +01:00
|
|
|
|
sprintf(m->title,"Controller Settings");
|
2008-08-11 20:02:04 +02:00
|
|
|
|
}
|
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
break;
|
2010-11-01 19:13:17 +01:00
|
|
|
|
}
|
2009-05-02 17:00:13 +02:00
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
case 2:
|
|
|
|
|
case 3:
|
|
|
|
|
case 4:
|
|
|
|
|
case 5:
|
|
|
|
|
case 6:
|
|
|
|
|
case 7:
|
|
|
|
|
case 8:
|
|
|
|
|
case 9:
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* remove duplicate assigned inputs */
|
|
|
|
|
for (i=0; i<MAX_INPUTS; i++)
|
2008-08-11 20:02:04 +02:00
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
if ((i!=player) && (config.input[i].port == config.input[player].port) &&
|
|
|
|
|
((config.input[i].device == config.input[player].device) || ((config.input[i].device * config.input[player].device) == 2)))
|
2008-08-11 20:02:04 +02:00
|
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
|
config.input[i].device = -1;
|
|
|
|
|
config.input[i].port = i%4;
|
2008-08-11 20:02:04 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2009-05-04 23:43:16 +02:00
|
|
|
|
|
|
|
|
|
/* update player index */
|
|
|
|
|
old_player = player;
|
|
|
|
|
player = 0;
|
|
|
|
|
for (i=0; i<(m->selected-2); i++)
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
|
if (input.dev[i] != NO_DEVICE) player ++;
|
2010-11-01 19:13:17 +01:00
|
|
|
|
}
|
2009-05-04 23:43:16 +02:00
|
|
|
|
|
|
|
|
|
if (m->bg_images[7].state & IMAGE_VISIBLE)
|
|
|
|
|
{
|
2010-11-01 19:13:17 +01:00
|
|
|
|
/* if already displayed, do nothing */
|
2009-05-05 14:58:25 +02:00
|
|
|
|
if (old_player == player) break;
|
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* slide out configuration window */
|
|
|
|
|
GUI_DrawMenuFX(m, 20, 1);
|
|
|
|
|
}
|
2009-05-02 17:00:13 +02:00
|
|
|
|
else
|
2008-08-11 20:02:04 +02:00
|
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* append configuration window */
|
|
|
|
|
m->bg_images[7].state |= IMAGE_VISIBLE;
|
|
|
|
|
|
2009-05-05 14:58:25 +02:00
|
|
|
|
/* enable configuration buttons */
|
2009-05-04 23:43:16 +02:00
|
|
|
|
m->buttons[10].state |= (BUTTON_VISIBLE | BUTTON_ACTIVE);
|
|
|
|
|
m->buttons[11].state |= (BUTTON_VISIBLE | BUTTON_ACTIVE);
|
|
|
|
|
m->buttons[12].state |= (BUTTON_VISIBLE | BUTTON_ACTIVE);
|
|
|
|
|
|
|
|
|
|
/* update directions */
|
|
|
|
|
m->buttons[2].shift[3] = 8;
|
|
|
|
|
m->buttons[3].shift[3] = 7;
|
|
|
|
|
m->buttons[4].shift[3] = 6;
|
|
|
|
|
m->buttons[5].shift[3] = 5;
|
|
|
|
|
m->buttons[6].shift[3] = 4;
|
|
|
|
|
m->buttons[7].shift[3] = 3;
|
|
|
|
|
m->buttons[8].shift[3] = 2;
|
|
|
|
|
m->buttons[9].shift[3] = 1;
|
2008-08-11 20:02:04 +02:00
|
|
|
|
}
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* retrieve current player informations */
|
|
|
|
|
if (input.dev[m->selected-2] == DEVICE_LIGHTGUN)
|
|
|
|
|
{
|
|
|
|
|
items = items_special[2];
|
2009-05-05 16:07:47 +02:00
|
|
|
|
special = &config.gun_cursor[m->selected & 1];
|
2009-05-04 23:43:16 +02:00
|
|
|
|
}
|
|
|
|
|
else if (input.dev[m->selected-2] == DEVICE_MOUSE)
|
|
|
|
|
{
|
|
|
|
|
items = items_special[1];
|
|
|
|
|
special = &config.invert_mouse;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
items = items_special[0];
|
|
|
|
|
special = &config.input[player].padtype;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
memcpy(&m->items[10],&items[*special],sizeof(gui_item));
|
|
|
|
|
memcpy(&m->items[11],&items_device[config.input[player].device + 1],sizeof(gui_item));
|
|
|
|
|
|
|
|
|
|
/* slide in configuration window */
|
2009-05-05 14:58:25 +02:00
|
|
|
|
m->buttons[10].shift[2] = 10 - m->selected;
|
|
|
|
|
m->buttons[11].shift[2] = 11 - m->selected;
|
|
|
|
|
m->buttons[12].shift[2] = 12 - m->selected;
|
2009-05-07 15:00:57 +02:00
|
|
|
|
m->selected = 10;
|
2009-05-19 18:14:43 +02:00
|
|
|
|
GUI_DrawMenuFX(m, 20, 0);
|
2009-05-05 14:58:25 +02:00
|
|
|
|
|
|
|
|
|
/* update title */
|
2010-05-28 14:08:00 +02:00
|
|
|
|
if (cart.jcart && (player > 1))
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{
|
2009-05-06 16:47:22 +02:00
|
|
|
|
sprintf(m->title,"Controller Settings (Player %d) (J-CART)",player+1);
|
2010-11-01 19:13:17 +01:00
|
|
|
|
}
|
2009-05-06 16:47:22 +02:00
|
|
|
|
else
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{
|
2009-05-06 16:47:22 +02:00
|
|
|
|
sprintf(m->title,"Controller Settings (Player %d)",player+1);
|
2010-11-01 19:13:17 +01:00
|
|
|
|
}
|
2009-05-04 23:43:16 +02:00
|
|
|
|
break;
|
2010-11-01 19:13:17 +01:00
|
|
|
|
}
|
2009-05-04 23:43:16 +02:00
|
|
|
|
|
|
|
|
|
case 10: /* specific option */
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{
|
2009-05-07 15:00:57 +02:00
|
|
|
|
if (special == &config.input[player].padtype)
|
2009-05-06 12:03:33 +02:00
|
|
|
|
{
|
2009-05-07 15:00:57 +02:00
|
|
|
|
if (config.input[player].device == 1) break;
|
|
|
|
|
config.input[player].padtype ^= 1;
|
2009-08-09 11:33:48 +02:00
|
|
|
|
input_init();
|
|
|
|
|
input_reset();
|
2009-05-07 15:00:57 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
*special ^= 1;
|
2009-05-06 12:03:33 +02:00
|
|
|
|
}
|
2009-05-02 17:00:13 +02:00
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* update menu items */
|
|
|
|
|
memcpy(&m->items[10],&items[*special],sizeof(gui_item));
|
|
|
|
|
break;
|
2010-11-01 19:13:17 +01:00
|
|
|
|
}
|
2009-05-04 23:43:16 +02:00
|
|
|
|
|
|
|
|
|
case 11: /* input controller selection */
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{
|
2009-05-06 16:47:22 +02:00
|
|
|
|
/* no input device */
|
2009-10-16 13:32:55 +02:00
|
|
|
|
if (config.input[player].device < 0)
|
2008-08-11 20:02:04 +02:00
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* always try gamecube controllers first */
|
2009-10-16 13:32:55 +02:00
|
|
|
|
config.input[player].device = 0;
|
|
|
|
|
config.input[player].port = 0;
|
2009-05-06 16:47:22 +02:00
|
|
|
|
}
|
2009-05-07 15:00:57 +02:00
|
|
|
|
else
|
2009-05-06 16:47:22 +02:00
|
|
|
|
{
|
2009-10-16 13:32:55 +02:00
|
|
|
|
/* try next port */
|
|
|
|
|
config.input[player].port ++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* autodetect connected gamecube controllers */
|
|
|
|
|
if (config.input[player].device == 0)
|
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* find first connected controller */
|
2009-10-16 13:32:55 +02:00
|
|
|
|
exp = 0;
|
2010-12-04 18:15:36 +01:00
|
|
|
|
while ((config.input[player].port < 4) && !exp)
|
2009-10-16 13:32:55 +02:00
|
|
|
|
{
|
|
|
|
|
exp = PAD_ScanPads() & (1<<config.input[player].port);
|
|
|
|
|
if (!exp) config.input[player].port ++;
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* no more gamecube controller */
|
2009-10-16 13:32:55 +02:00
|
|
|
|
if (config.input[player].port >= 4)
|
|
|
|
|
{
|
|
|
|
|
#ifdef HW_RVL
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* test wiimote */
|
2009-10-16 13:32:55 +02:00
|
|
|
|
config.input[player].port = 0;
|
|
|
|
|
config.input[player].device = 1;
|
|
|
|
|
#else
|
|
|
|
|
/* no input controller left */
|
|
|
|
|
config.input[player].device = -1;
|
|
|
|
|
config.input[player].port = player%4;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
2008-08-11 20:02:04 +02:00
|
|
|
|
}
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2009-10-16 13:32:55 +02:00
|
|
|
|
#ifdef HW_RVL
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* autodetect connected wiimotes (without nunchuk) */
|
|
|
|
|
if (config.input[player].device == 1)
|
2008-08-11 20:02:04 +02:00
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* test current port */
|
|
|
|
|
exp = 255;
|
|
|
|
|
if (config.input[player].port < 4)
|
2008-08-11 20:02:04 +02:00
|
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
|
WPAD_Probe(config.input[player].port,&exp);
|
2008-08-11 20:02:04 +02:00
|
|
|
|
}
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* find first connected controller */
|
|
|
|
|
while ((config.input[player].port < 4) && (exp == 255))
|
2009-05-02 17:00:13 +02:00
|
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* try next port */
|
|
|
|
|
config.input[player].port ++;
|
2010-12-04 18:15:36 +01:00
|
|
|
|
if (config.input[player].port < 4)
|
2009-05-04 23:43:16 +02:00
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
exp = 255;
|
2009-05-04 23:43:16 +02:00
|
|
|
|
WPAD_Probe(config.input[player].port,&exp);
|
2009-05-06 16:47:22 +02:00
|
|
|
|
}
|
2009-05-04 23:43:16 +02:00
|
|
|
|
}
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* no more wiimote */
|
2009-05-04 23:43:16 +02:00
|
|
|
|
if (config.input[player].port >= 4)
|
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* test wiimote+nunchuk */
|
2009-05-04 23:43:16 +02:00
|
|
|
|
config.input[player].port = 0;
|
|
|
|
|
config.input[player].device = 2;
|
2009-05-02 17:00:13 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2009-05-04 23:43:16 +02:00
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* autodetect connected wiimote+nunchuk */
|
2009-05-04 23:43:16 +02:00
|
|
|
|
if (config.input[player].device == 2)
|
2008-08-11 20:02:04 +02:00
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* test current port */
|
|
|
|
|
exp = 255;
|
|
|
|
|
if (config.input[player].port < 4)
|
2009-05-04 23:43:16 +02:00
|
|
|
|
{
|
|
|
|
|
WPAD_Probe(config.input[player].port,&exp);
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* find first connected controller */
|
|
|
|
|
while ((config.input[player].port < 4) && (exp != WPAD_EXP_NUNCHUK))
|
2009-05-04 23:43:16 +02:00
|
|
|
|
{
|
|
|
|
|
/* try next port */
|
|
|
|
|
config.input[player].port ++;
|
2010-12-04 18:15:36 +01:00
|
|
|
|
if (config.input[player].port < 4)
|
2009-05-04 23:43:16 +02:00
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
exp = 255;
|
2009-05-04 23:43:16 +02:00
|
|
|
|
WPAD_Probe(config.input[player].port,&exp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* no more wiimote+nunchuk */
|
2009-05-04 23:43:16 +02:00
|
|
|
|
if (config.input[player].port >= 4)
|
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* test classic controllers */
|
2009-05-04 23:43:16 +02:00
|
|
|
|
config.input[player].port = 0;
|
|
|
|
|
config.input[player].device = 3;
|
|
|
|
|
}
|
2008-08-11 20:02:04 +02:00
|
|
|
|
}
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* autodetect connected classic controllers */
|
|
|
|
|
if (config.input[player].device == 3)
|
2008-08-07 14:26:07 +02:00
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* test current port */
|
|
|
|
|
exp = 255;
|
|
|
|
|
if (config.input[player].port < 4)
|
2009-05-04 23:43:16 +02:00
|
|
|
|
{
|
|
|
|
|
WPAD_Probe(config.input[player].port,&exp);
|
|
|
|
|
}
|
2009-05-02 17:00:13 +02:00
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* find first connected controller */
|
2009-05-04 23:43:16 +02:00
|
|
|
|
while ((config.input[player].port<4) && (exp != WPAD_EXP_CLASSIC))
|
|
|
|
|
{
|
|
|
|
|
/* try next port */
|
|
|
|
|
config.input[player].port ++;
|
2010-12-04 18:15:36 +01:00
|
|
|
|
if (config.input[player].port < 4)
|
2009-05-04 23:43:16 +02:00
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
exp = 255;
|
2009-05-04 23:43:16 +02:00
|
|
|
|
WPAD_Probe(config.input[player].port,&exp);
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-05-02 17:00:13 +02:00
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
if (config.input[player].port >= 4)
|
|
|
|
|
{
|
2009-10-16 13:32:55 +02:00
|
|
|
|
/* no input controller left */
|
|
|
|
|
config.input[player].device = -1;
|
2009-05-07 15:00:57 +02:00
|
|
|
|
config.input[player].port = player%4;
|
2009-05-04 23:43:16 +02:00
|
|
|
|
}
|
2009-05-03 12:14:56 +02:00
|
|
|
|
}
|
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* force 3-buttons gamepad when using Wiimote */
|
|
|
|
|
if (config.input[player].device == 1)
|
2009-05-06 12:03:33 +02:00
|
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
|
config.input[player].padtype = DEVICE_3BUTTON;
|
2009-05-06 12:03:33 +02:00
|
|
|
|
memcpy(&m->items[10],&items[*special],sizeof(gui_item));
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* update menu items */
|
|
|
|
|
memcpy(&m->items[11],&items_device[config.input[player].device + 1],sizeof(gui_item));
|
2010-11-01 19:13:17 +01:00
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
break;
|
2010-11-01 19:13:17 +01:00
|
|
|
|
}
|
2009-05-02 17:00:13 +02:00
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
case 12: /* Controller Keys Configuration */
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{
|
2009-05-06 16:47:22 +02:00
|
|
|
|
if (config.input[player].device < 0) break;
|
2010-11-01 19:13:17 +01:00
|
|
|
|
|
2009-05-23 19:29:53 +02:00
|
|
|
|
GUI_MsgBoxOpen("Keys Configuration", "",0);
|
2010-11-01 19:13:17 +01:00
|
|
|
|
|
2009-05-06 16:47:22 +02:00
|
|
|
|
if (config.input[player].padtype == DEVICE_6BUTTON)
|
2009-05-04 23:43:16 +02:00
|
|
|
|
{
|
2009-05-06 16:47:22 +02:00
|
|
|
|
/* 6-buttons gamepad */
|
|
|
|
|
if (config.input[player].device == 0)
|
2009-05-04 23:43:16 +02:00
|
|
|
|
{
|
2009-05-06 16:47:22 +02:00
|
|
|
|
/* Gamecube PAD: 6-buttons w/o MODE */
|
|
|
|
|
gx_input_Config(config.input[player].port, config.input[player].device, 7);
|
2009-05-04 23:43:16 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2009-05-06 16:47:22 +02:00
|
|
|
|
gx_input_Config(config.input[player].port, config.input[player].device, 8);
|
2009-05-04 23:43:16 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2009-05-06 16:47:22 +02:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* 3-Buttons gamepad, mouse, lightgun */
|
|
|
|
|
gx_input_Config(config.input[player].port, config.input[player].device, 4);
|
|
|
|
|
}
|
2010-11-01 19:13:17 +01:00
|
|
|
|
|
2009-05-19 18:14:43 +02:00
|
|
|
|
GUI_MsgBoxClose();
|
2009-05-04 23:43:16 +02:00
|
|
|
|
break;
|
2010-11-01 19:13:17 +01:00
|
|
|
|
}
|
2009-05-04 23:43:16 +02:00
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
|
}
|
2009-10-16 13:32:55 +02:00
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
/* Close Window */
|
2009-05-19 18:14:43 +02:00
|
|
|
|
else if (update < 0)
|
|
|
|
|
{
|
|
|
|
|
if (m->bg_images[7].state & IMAGE_VISIBLE)
|
|
|
|
|
{
|
|
|
|
|
/* slide out configuration window */
|
|
|
|
|
GUI_DrawMenuFX(m, 20, 1);
|
|
|
|
|
|
|
|
|
|
/* disable configuration window */
|
|
|
|
|
m->bg_images[7].state &= ~IMAGE_VISIBLE;
|
|
|
|
|
|
|
|
|
|
/* disable configuration buttons */
|
|
|
|
|
m->buttons[10].state &= (~BUTTON_VISIBLE & ~BUTTON_ACTIVE);
|
|
|
|
|
m->buttons[11].state &= (~BUTTON_VISIBLE & ~BUTTON_ACTIVE);
|
|
|
|
|
m->buttons[12].state &= (~BUTTON_VISIBLE & ~BUTTON_ACTIVE);
|
|
|
|
|
|
|
|
|
|
/* clear directions */
|
|
|
|
|
m->buttons[2].shift[3] = 0;
|
|
|
|
|
m->buttons[3].shift[3] = 0;
|
|
|
|
|
m->buttons[4].shift[3] = 0;
|
|
|
|
|
m->buttons[5].shift[3] = 0;
|
|
|
|
|
m->buttons[6].shift[3] = 0;
|
|
|
|
|
m->buttons[7].shift[3] = 0;
|
|
|
|
|
m->buttons[8].shift[3] = 0;
|
|
|
|
|
m->buttons[9].shift[3] = 0;
|
|
|
|
|
|
|
|
|
|
/* update selector */
|
|
|
|
|
m->selected -= m->buttons[m->selected].shift[2];
|
|
|
|
|
|
2010-02-28 20:55:43 +01:00
|
|
|
|
/* restore title */
|
|
|
|
|
sprintf(m->title,"Controller Settings");
|
|
|
|
|
|
2009-05-19 18:14:43 +02:00
|
|
|
|
/* stay in menu */
|
|
|
|
|
update = 0;
|
|
|
|
|
}
|
2010-05-06 14:59:43 +02:00
|
|
|
|
else
|
2009-10-16 13:32:55 +02:00
|
|
|
|
{
|
2010-05-06 14:59:43 +02:00
|
|
|
|
/* check we have at least one connected input before leaving */
|
|
|
|
|
old_player = player;
|
|
|
|
|
player = 0;
|
|
|
|
|
for (i=0; i<MAX_DEVICES; i++)
|
2009-10-16 13:32:55 +02:00
|
|
|
|
{
|
2010-05-06 14:59:43 +02:00
|
|
|
|
/* check inputs */
|
|
|
|
|
if (input.dev[i] != NO_DEVICE)
|
|
|
|
|
{
|
|
|
|
|
if (config.input[player].device != -1)
|
|
|
|
|
break;
|
|
|
|
|
player++;
|
|
|
|
|
}
|
2009-10-16 13:32:55 +02:00
|
|
|
|
}
|
2010-05-06 14:59:43 +02:00
|
|
|
|
player = old_player;
|
2009-10-16 13:32:55 +02:00
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
/* no input connected */
|
|
|
|
|
if (i == MAX_DEVICES)
|
|
|
|
|
{
|
|
|
|
|
/* stay in menu */
|
|
|
|
|
GUI_WaitPrompt("Error","No input connected !");
|
|
|
|
|
update = 0;
|
|
|
|
|
}
|
2009-10-16 13:32:55 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
|
}
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2009-05-06 16:47:22 +02:00
|
|
|
|
/* remove duplicate assigned inputs before leaving */
|
2010-05-28 14:08:00 +02:00
|
|
|
|
for (i=0; i<MAX_INPUTS; i++)
|
2009-05-04 23:43:16 +02:00
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
if ((i!=player) && (config.input[i].port == config.input[player].port) &&
|
|
|
|
|
((config.input[i].device == config.input[player].device) || ((config.input[i].device * config.input[player].device) == 2)))
|
2009-05-04 23:43:16 +02:00
|
|
|
|
{
|
|
|
|
|
config.input[i].device = -1;
|
|
|
|
|
config.input[i].port = i%4;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-05-06 12:03:33 +02:00
|
|
|
|
/* disable configuration window */
|
2009-05-04 23:43:16 +02:00
|
|
|
|
m->bg_images[7].state &= ~IMAGE_VISIBLE;
|
|
|
|
|
|
|
|
|
|
/* disable configuration buttons */
|
|
|
|
|
m->buttons[10].state &= (~BUTTON_VISIBLE & ~BUTTON_ACTIVE);
|
|
|
|
|
m->buttons[11].state &= (~BUTTON_VISIBLE & ~BUTTON_ACTIVE);
|
|
|
|
|
m->buttons[12].state &= (~BUTTON_VISIBLE & ~BUTTON_ACTIVE);
|
|
|
|
|
|
2009-05-06 12:03:33 +02:00
|
|
|
|
/* clear directions */
|
2009-05-04 23:43:16 +02:00
|
|
|
|
m->buttons[2].shift[3] = 0;
|
|
|
|
|
m->buttons[3].shift[3] = 0;
|
|
|
|
|
m->buttons[4].shift[3] = 0;
|
|
|
|
|
m->buttons[5].shift[3] = 0;
|
|
|
|
|
m->buttons[6].shift[3] = 0;
|
|
|
|
|
m->buttons[7].shift[3] = 0;
|
|
|
|
|
m->buttons[8].shift[3] = 0;
|
|
|
|
|
m->buttons[9].shift[3] = 0;
|
|
|
|
|
|
|
|
|
|
/* clear menu items */
|
2009-05-06 12:03:33 +02:00
|
|
|
|
memset(&m->items[0],0,sizeof(gui_item));
|
|
|
|
|
memset(&m->items[1],0,sizeof(gui_item));
|
|
|
|
|
memset(&m->items[10],0,sizeof(gui_item));
|
|
|
|
|
memset(&m->items[11],0,sizeof(gui_item));
|
|
|
|
|
|
|
|
|
|
/* clear player buttons */
|
2010-11-01 19:13:17 +01:00
|
|
|
|
m->buttons[2].data = NULL;
|
|
|
|
|
m->buttons[3].data = NULL;
|
|
|
|
|
m->buttons[4].data = NULL;
|
|
|
|
|
m->buttons[5].data = NULL;
|
|
|
|
|
m->buttons[6].data = NULL;
|
|
|
|
|
m->buttons[7].data = NULL;
|
|
|
|
|
m->buttons[8].data = NULL;
|
|
|
|
|
m->buttons[9].data = NULL;
|
2009-05-04 23:43:16 +02:00
|
|
|
|
|
|
|
|
|
/* delete menu */
|
2009-05-02 17:00:13 +02:00
|
|
|
|
GUI_DeleteMenu(m);
|
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* delete custom buttons */
|
2009-05-02 17:00:13 +02:00
|
|
|
|
gxTextureClose(&button_player_data.texture[0]);
|
|
|
|
|
gxTextureClose(&button_player_data.texture[1]);
|
|
|
|
|
gxTextureClose(&button_player_none_data.texture[0]);
|
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
/* delete custom images */
|
2009-05-02 17:00:13 +02:00
|
|
|
|
gxTextureClose(&items_sys[0][0].texture);
|
|
|
|
|
gxTextureClose(&items_sys[0][1].texture);
|
|
|
|
|
gxTextureClose(&items_sys[0][2].texture);
|
|
|
|
|
gxTextureClose(&items_sys[0][3].texture);
|
|
|
|
|
gxTextureClose(&items_sys[0][4].texture);
|
|
|
|
|
gxTextureClose(&items_sys[0][5].texture);
|
|
|
|
|
gxTextureClose(&items_sys[0][6].texture);
|
2009-05-04 23:43:16 +02:00
|
|
|
|
gxTextureClose(&items_special[0][0].texture);
|
|
|
|
|
gxTextureClose(&items_special[0][1].texture);
|
|
|
|
|
gxTextureClose(&items_special[1][0].texture);
|
|
|
|
|
gxTextureClose(&items_special[1][1].texture);
|
2009-05-02 17:00:13 +02:00
|
|
|
|
gxTextureClose(&items_device[1].texture);
|
2009-05-04 23:43:16 +02:00
|
|
|
|
#ifdef HW_RVL
|
2009-05-02 17:00:13 +02:00
|
|
|
|
gxTextureClose(&items_device[2].texture);
|
|
|
|
|
gxTextureClose(&items_device[3].texture);
|
|
|
|
|
gxTextureClose(&items_device[4].texture);
|
|
|
|
|
#endif
|
2008-08-07 14:26:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
|
* Main Option menu
|
|
|
|
|
*
|
|
|
|
|
****************************************************************************/
|
2009-03-30 09:05:34 +02:00
|
|
|
|
static void optionmenu(void)
|
2008-08-07 14:26:07 +02:00
|
|
|
|
{
|
2009-03-30 09:05:34 +02:00
|
|
|
|
int ret, quit = 0;
|
|
|
|
|
gui_menu *m = &menu_options;
|
2008-12-10 19:16:30 +01:00
|
|
|
|
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_InitMenu(m);
|
|
|
|
|
GUI_DrawMenuFX(m,30,0);
|
|
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
|
while (quit == 0)
|
2008-08-07 14:26:07 +02:00
|
|
|
|
{
|
2009-04-20 00:31:08 +02:00
|
|
|
|
ret = GUI_RunMenu(m);
|
2009-05-12 14:27:19 +02:00
|
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
|
switch (ret)
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_DeleteMenu(m);
|
2009-03-30 09:05:34 +02:00
|
|
|
|
systemmenu();
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_InitMenu(m);
|
2008-12-10 19:16:30 +01:00
|
|
|
|
break;
|
|
|
|
|
case 1:
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_DeleteMenu(m);
|
2009-03-30 09:05:34 +02:00
|
|
|
|
videomenu();
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_InitMenu(m);
|
2008-12-10 19:16:30 +01:00
|
|
|
|
break;
|
|
|
|
|
case 2:
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_DeleteMenu(m);
|
2009-03-15 20:11:01 +01:00
|
|
|
|
soundmenu();
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_InitMenu(m);
|
2008-12-10 19:16:30 +01:00
|
|
|
|
break;
|
|
|
|
|
case 3:
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_DeleteMenu(m);
|
2009-05-02 17:00:13 +02:00
|
|
|
|
ctrlmenu();
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_InitMenu(m);
|
2008-12-10 19:16:30 +01:00
|
|
|
|
break;
|
|
|
|
|
case 4:
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_DeleteMenu(m);
|
2009-04-23 03:01:07 +02:00
|
|
|
|
prefmenu();
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_InitMenu(m);
|
2008-12-10 19:16:30 +01:00
|
|
|
|
break;
|
|
|
|
|
case -1:
|
|
|
|
|
quit = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2010-05-28 14:08:00 +02:00
|
|
|
|
config_save();
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_DrawMenuFX(m,30,1);
|
|
|
|
|
GUI_DeleteMenu(m);
|
2008-08-07 14:26:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
2010-05-06 14:59:43 +02:00
|
|
|
|
* Save Manager menu
|
2008-08-07 14:26:07 +02:00
|
|
|
|
*
|
|
|
|
|
****************************************************************************/
|
2010-05-06 14:59:43 +02:00
|
|
|
|
static t_slot slots[5];
|
|
|
|
|
static void savemenu_cb(void)
|
2008-08-07 14:26:07 +02:00
|
|
|
|
{
|
2010-05-06 14:59:43 +02:00
|
|
|
|
int i;
|
|
|
|
|
char msg[16];
|
|
|
|
|
gx_texture *star = gxTextureOpenPNG(Star_full_png,0);
|
|
|
|
|
|
|
|
|
|
if (sram.on)
|
|
|
|
|
{
|
|
|
|
|
FONT_write("Backup Memory",16,buttons_saves[0].x+16,buttons_saves[0].y+(buttons_saves[0].h-16)/2+16,buttons_saves[0].x+buttons_saves[0].w,(GXColor)DARK_GREY);
|
|
|
|
|
if (slots[0].valid)
|
|
|
|
|
{
|
|
|
|
|
sprintf(msg,"%d/%02d/%02d",slots[0].day,slots[0].month,slots[0].year);
|
|
|
|
|
FONT_alignRight(msg,12,buttons_saves[0].x+buttons_saves[0].w-16,buttons_saves[0].y+(buttons_saves[0].h-28)/2+12,(GXColor)DARK_GREY);
|
|
|
|
|
sprintf(msg,"%02d:%02d",slots[0].hour,slots[0].min);
|
|
|
|
|
FONT_alignRight(msg,12,buttons_saves[0].x+buttons_saves[0].w-16,buttons_saves[0].y+(buttons_saves[0].h-28)/2+28,(GXColor)DARK_GREY);
|
|
|
|
|
}
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
if (sram.crc != crc32(0, &sram.sram[0], 0x10000))
|
|
|
|
|
gxDrawTexture(star,22,buttons_saves[0].y+(buttons_saves[0].h-star->height)/2,star->width,star->height,255);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
FONT_writeCenter("Backup Memory disabled",16,buttons_saves[0].x,buttons_saves[0].x+buttons_saves[0].w,buttons_saves[0].y+(buttons_saves[0].h-16)/2+16,(GXColor)DARK_GREY);
|
|
|
|
|
}
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
for (i=1; i<5; i++)
|
2008-08-07 14:26:07 +02:00
|
|
|
|
{
|
2010-05-06 14:59:43 +02:00
|
|
|
|
if (slots[i].valid)
|
|
|
|
|
{
|
|
|
|
|
sprintf(msg,"Slot %d",i);
|
|
|
|
|
FONT_write(msg,16,buttons_saves[i].x+16,buttons_saves[i].y+(buttons_saves[i].h-16)/2+16,buttons_saves[i].x+buttons_saves[i].w,(GXColor)DARK_GREY);
|
|
|
|
|
sprintf(msg,"%d/%02d/%02d",slots[i].day,slots[i].month,slots[i].year);
|
|
|
|
|
FONT_alignRight(msg,12,buttons_saves[i].x+buttons_saves[i].w-16,buttons_saves[i].y+(buttons_saves[i].h-28)/2+12,(GXColor)DARK_GREY);
|
|
|
|
|
sprintf(msg,"%02d:%02d",slots[i].hour,slots[i].min);
|
|
|
|
|
FONT_alignRight(msg,12,buttons_saves[i].x+buttons_saves[i].w-16,buttons_saves[i].y+(buttons_saves[i].h-28)/2+28,(GXColor)DARK_GREY);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
FONT_write("Empty Slot",16,buttons_saves[i].x+16,buttons_saves[i].y+(buttons_saves[i].h-16)/2+16,buttons_saves[i].x+buttons_saves[i].h,(GXColor)DARK_GREY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (i == config.s_default)
|
|
|
|
|
gxDrawTexture(star,22,buttons_saves[i].y+(buttons_saves[i].h-star->height)/2,star->width,star->height,255);
|
2008-08-07 14:26:07 +02:00
|
|
|
|
}
|
2010-05-06 14:59:43 +02:00
|
|
|
|
gxTextureClose(&star);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int savemenu(void)
|
|
|
|
|
{
|
|
|
|
|
int i, update = 0;
|
|
|
|
|
int ret = 0;
|
|
|
|
|
int slot = -1;
|
|
|
|
|
char filename[MAXPATHLEN];
|
|
|
|
|
gui_menu *m = &menu_saves;
|
|
|
|
|
FILE *snap;
|
|
|
|
|
|
|
|
|
|
GUI_InitMenu(m);
|
|
|
|
|
GUI_DrawMenuFX(m,30,0);
|
2010-11-01 19:13:17 +01:00
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
m->bg_images[3].state &= ~IMAGE_SLIDE_TOP;
|
|
|
|
|
m->bg_images[4].state &= ~IMAGE_SLIDE_BOTTOM;
|
|
|
|
|
m->bg_images[5].state &= ~IMAGE_SLIDE_TOP;
|
|
|
|
|
|
|
|
|
|
/* detect existing files */
|
|
|
|
|
for (i=0; i<5; i++)
|
|
|
|
|
slot_autodetect(i, config.s_device, &slots[i]);
|
|
|
|
|
|
|
|
|
|
/* SRAM disabled */
|
|
|
|
|
if (sram.on)
|
2010-05-09 03:15:40 +02:00
|
|
|
|
{
|
2010-05-06 14:59:43 +02:00
|
|
|
|
m->buttons[0].state |= BUTTON_ACTIVE;
|
2010-05-09 03:15:40 +02:00
|
|
|
|
m->buttons[1].shift[0] = 1;
|
|
|
|
|
}
|
2008-08-07 14:26:07 +02:00
|
|
|
|
else
|
|
|
|
|
{
|
2010-05-06 14:59:43 +02:00
|
|
|
|
m->buttons[0].state &= ~BUTTON_ACTIVE;
|
2010-05-09 03:15:40 +02:00
|
|
|
|
m->buttons[1].shift[0] = 0;
|
2010-05-06 14:59:43 +02:00
|
|
|
|
if (m->selected == 0)
|
|
|
|
|
m->selected = 1;
|
2008-08-07 14:26:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
while (update != -1)
|
2008-12-10 19:16:30 +01:00
|
|
|
|
{
|
2010-05-06 14:59:43 +02:00
|
|
|
|
/* slot selection */
|
|
|
|
|
if ((m->selected < 5) && (slot != m->selected))
|
2008-12-10 19:16:30 +01:00
|
|
|
|
{
|
2010-05-06 14:59:43 +02:00
|
|
|
|
/* update slot */
|
|
|
|
|
slot = m->selected;
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
/* delete previous texture if any */
|
|
|
|
|
gxTextureClose(&bg_saves[0].texture);
|
|
|
|
|
bg_saves[0].state &= ~IMAGE_VISIBLE;
|
|
|
|
|
bg_saves[1].state |= IMAGE_VISIBLE;
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
/* state slot */
|
2010-05-07 10:19:32 +02:00
|
|
|
|
if (!config.s_device && slot && slots[slot].valid)
|
2010-05-06 14:59:43 +02:00
|
|
|
|
{
|
|
|
|
|
/* open screenshot file */
|
|
|
|
|
sprintf (filename, "%s/saves/%s__%d.png", DEFAULT_PATH, rom_filename, slot - 1);
|
|
|
|
|
snap = fopen(filename, "rb");
|
|
|
|
|
if (snap)
|
|
|
|
|
{
|
|
|
|
|
/* load texture from file */
|
|
|
|
|
bg_saves[0].texture = gxTextureOpenPNG(0,snap);
|
|
|
|
|
if (bg_saves[0].texture)
|
|
|
|
|
{
|
|
|
|
|
/* set menu background */
|
|
|
|
|
bg_saves[0].w = bg_saves[0].texture->width * 2;
|
2010-06-15 08:14:35 +02:00
|
|
|
|
if (config.aspect & 2) bg_saves[0].w = (bg_saves[0].w * 3) / 4;
|
2010-05-06 14:59:43 +02:00
|
|
|
|
bg_saves[0].h = bg_saves[0].texture->height * 2;
|
|
|
|
|
bg_saves[0].x = (vmode->fbWidth - bg_saves[0].w) / 2;
|
|
|
|
|
bg_saves[0].y = (vmode->efbHeight - bg_saves[0].h) / 2;
|
|
|
|
|
bg_saves[0].state |= IMAGE_VISIBLE;
|
|
|
|
|
bg_saves[1].state &= ~IMAGE_VISIBLE;
|
|
|
|
|
}
|
|
|
|
|
fclose(snap);
|
|
|
|
|
}
|
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
|
}
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
/* draw menu */
|
|
|
|
|
GUI_DrawMenu(m);
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
/* update menu */
|
|
|
|
|
update = GUI_UpdateMenu(m);
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
if (update > 0)
|
|
|
|
|
{
|
|
|
|
|
switch (m->selected)
|
|
|
|
|
{
|
2010-11-01 19:13:17 +01:00
|
|
|
|
case 0:
|
|
|
|
|
case 1:
|
|
|
|
|
case 2:
|
|
|
|
|
case 3:
|
|
|
|
|
case 4: /* Slot selection */
|
|
|
|
|
{
|
|
|
|
|
/* enable right window */
|
|
|
|
|
m->bg_images[7].state |= IMAGE_VISIBLE;
|
|
|
|
|
m->buttons[5].state |= BUTTON_VISIBLE;
|
|
|
|
|
m->buttons[6].state |= BUTTON_VISIBLE;
|
|
|
|
|
m->buttons[7].state |= BUTTON_VISIBLE;
|
|
|
|
|
m->buttons[8].state |= BUTTON_VISIBLE;
|
|
|
|
|
|
|
|
|
|
/* only enable valid options */
|
|
|
|
|
if (slots[slot].valid)
|
|
|
|
|
{
|
|
|
|
|
m->buttons[5].state |= BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[7].state |= BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[6].shift[0] = 1;
|
|
|
|
|
m->buttons[6].shift[1] = 1;
|
|
|
|
|
m->buttons[8].shift[0] = 1;
|
|
|
|
|
m->selected = 5;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m->buttons[5].state &= ~BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[7].state &= ~BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[6].shift[0] = 0;
|
|
|
|
|
m->buttons[6].shift[1] = 2;
|
|
|
|
|
m->buttons[8].shift[0] = (slot > 0) ? 2 : 0;
|
|
|
|
|
m->selected = 8;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* state slot 'only' button */
|
|
|
|
|
if (slot > 0)
|
|
|
|
|
{
|
|
|
|
|
m->buttons[6].state |= BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[5].shift[1] = 1;
|
|
|
|
|
m->buttons[7].shift[0] = 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m->buttons[6].state &= ~BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[5].shift[1] = 2;
|
|
|
|
|
m->buttons[7].shift[0] = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* disable left buttons */
|
|
|
|
|
m->buttons[0].state &= ~BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[1].state &= ~BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[2].state &= ~BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[3].state &= ~BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[4].state &= ~BUTTON_ACTIVE;
|
|
|
|
|
|
|
|
|
|
/* keep current selection highlighted */
|
|
|
|
|
m->buttons[slot].state |= BUTTON_SELECTED;
|
|
|
|
|
|
|
|
|
|
/* slide in window */
|
|
|
|
|
GUI_DrawMenuFX(m, 20, 0);
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
case 5: /* load file */
|
|
|
|
|
{
|
|
|
|
|
if (slots[slot].valid)
|
|
|
|
|
{
|
|
|
|
|
ret = slot_load(slot,config.s_device);
|
|
|
|
|
|
|
|
|
|
/* force exit */
|
|
|
|
|
if (ret > 0)
|
|
|
|
|
{
|
|
|
|
|
GUI_DrawMenuFX(m, 20, 1);
|
|
|
|
|
m->buttons[slot].state &= ~BUTTON_SELECTED;
|
|
|
|
|
m->bg_images[7].state &= ~IMAGE_VISIBLE;
|
|
|
|
|
if (sram.on)
|
|
|
|
|
m->buttons[0].state |= BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[1].state |= BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[2].state |= BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[3].state |= BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[4].state |= BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[5].state &= ~BUTTON_VISIBLE;
|
|
|
|
|
m->buttons[6].state &= ~BUTTON_VISIBLE;
|
|
|
|
|
m->buttons[7].state &= ~BUTTON_VISIBLE;
|
|
|
|
|
m->buttons[8].state &= ~BUTTON_VISIBLE;
|
|
|
|
|
m->selected = slot;
|
|
|
|
|
update = -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
case 6: /* set default slot */
|
|
|
|
|
{
|
|
|
|
|
config.s_default = slot;
|
2010-05-28 14:08:00 +02:00
|
|
|
|
config_save();
|
2010-05-06 14:59:43 +02:00
|
|
|
|
break;
|
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
case 7: /* delete file */
|
|
|
|
|
{
|
|
|
|
|
if (slots[slot].valid)
|
|
|
|
|
{
|
|
|
|
|
if (slot_delete(slot,config.s_device) >= 0)
|
|
|
|
|
{
|
|
|
|
|
/* hide screenshot */
|
|
|
|
|
gxTextureClose(&bg_saves[0].texture);
|
|
|
|
|
bg_saves[0].state &= ~IMAGE_VISIBLE;
|
|
|
|
|
slots[slot].valid = 0;
|
|
|
|
|
update = -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case 8: /* save file */
|
|
|
|
|
{
|
|
|
|
|
ret = slot_save(slot,config.s_device);
|
|
|
|
|
|
|
|
|
|
/* force exit */
|
|
|
|
|
if (ret > 0)
|
|
|
|
|
{
|
|
|
|
|
GUI_DrawMenuFX(m, 20, 1);
|
|
|
|
|
m->buttons[slot].state &= ~BUTTON_SELECTED;
|
|
|
|
|
m->bg_images[7].state &= ~IMAGE_VISIBLE;
|
|
|
|
|
if (sram.on)
|
|
|
|
|
m->buttons[0].state |= BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[1].state |= BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[2].state |= BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[3].state |= BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[4].state |= BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[5].state &= ~BUTTON_VISIBLE;
|
|
|
|
|
m->buttons[6].state &= ~BUTTON_VISIBLE;
|
|
|
|
|
m->buttons[7].state &= ~BUTTON_VISIBLE;
|
|
|
|
|
m->buttons[8].state &= ~BUTTON_VISIBLE;
|
|
|
|
|
m->selected = slot;
|
|
|
|
|
update = -1;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-01 19:13:17 +01:00
|
|
|
|
default:
|
2010-05-06 14:59:43 +02:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (update < 0)
|
2008-12-10 19:16:30 +01:00
|
|
|
|
{
|
2010-05-06 14:59:43 +02:00
|
|
|
|
/* close right window */
|
|
|
|
|
if (m->bg_images[7].state & IMAGE_VISIBLE)
|
|
|
|
|
{
|
|
|
|
|
/* slide out window */
|
|
|
|
|
GUI_DrawMenuFX(m, 20, 1);
|
2008-12-10 19:16:30 +01:00
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
/* clear current selection */
|
|
|
|
|
m->buttons[slot].state &= ~BUTTON_SELECTED;
|
|
|
|
|
|
|
|
|
|
/* enable left buttons */
|
|
|
|
|
if (sram.on)
|
|
|
|
|
m->buttons[0].state |= BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[1].state |= BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[2].state |= BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[3].state |= BUTTON_ACTIVE;
|
|
|
|
|
m->buttons[4].state |= BUTTON_ACTIVE;
|
|
|
|
|
|
|
|
|
|
/* disable right window */
|
|
|
|
|
m->bg_images[7].state &= ~IMAGE_VISIBLE;
|
|
|
|
|
m->buttons[5].state &= ~BUTTON_VISIBLE;
|
|
|
|
|
m->buttons[6].state &= ~BUTTON_VISIBLE;
|
|
|
|
|
m->buttons[7].state &= ~BUTTON_VISIBLE;
|
|
|
|
|
m->buttons[8].state &= ~BUTTON_VISIBLE;
|
|
|
|
|
|
|
|
|
|
/* stay in menu */
|
|
|
|
|
m->selected = slot;
|
|
|
|
|
update = 0;
|
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
/* leave menu */
|
|
|
|
|
m->bg_images[3].state |= IMAGE_SLIDE_TOP;
|
|
|
|
|
m->bg_images[4].state |= IMAGE_SLIDE_BOTTOM;
|
|
|
|
|
m->bg_images[5].state |= IMAGE_SLIDE_TOP;
|
|
|
|
|
GUI_DrawMenuFX(m,30,1);
|
|
|
|
|
GUI_DeleteMenu(m);
|
|
|
|
|
return ret;
|
2008-08-07 14:26:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
2010-05-06 14:59:43 +02:00
|
|
|
|
* Load Game menu
|
2008-08-07 14:26:07 +02:00
|
|
|
|
*
|
|
|
|
|
****************************************************************************/
|
2010-05-06 14:59:43 +02:00
|
|
|
|
static int loadgamemenu ()
|
2008-08-07 14:26:07 +02:00
|
|
|
|
{
|
2010-03-22 15:07:25 +01:00
|
|
|
|
int ret;
|
2009-03-30 09:05:34 +02:00
|
|
|
|
gui_menu *m = &menu_load;
|
2009-05-19 18:14:43 +02:00
|
|
|
|
GUI_InitMenu(m);
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_DrawMenuFX(m,30,0);
|
2009-03-30 09:05:34 +02:00
|
|
|
|
|
2009-04-20 00:31:08 +02:00
|
|
|
|
while (1)
|
2008-12-10 19:16:30 +01:00
|
|
|
|
{
|
2009-04-20 00:31:08 +02:00
|
|
|
|
ret = GUI_RunMenu(m);
|
2009-03-30 09:05:34 +02:00
|
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
|
switch (ret)
|
|
|
|
|
{
|
|
|
|
|
/*** Button B ***/
|
2008-12-08 18:26:50 +01:00
|
|
|
|
case -1:
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_DrawMenuFX(m,30,1);
|
2009-05-19 18:14:43 +02:00
|
|
|
|
GUI_DeleteMenu(m);
|
2009-04-20 00:31:08 +02:00
|
|
|
|
return 0;
|
2008-12-08 18:26:50 +01:00
|
|
|
|
|
2010-11-01 19:13:17 +01:00
|
|
|
|
/*** Load from selected device */
|
|
|
|
|
default:
|
|
|
|
|
{
|
|
|
|
|
if (ret > 0)
|
2008-11-13 08:24:30 +01:00
|
|
|
|
{
|
2010-11-01 19:13:17 +01:00
|
|
|
|
ret = OpenDirectory(ret - 1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ret = OpenDirectory(TYPE_RECENT);
|
2008-11-13 08:24:30 +01:00
|
|
|
|
}
|
|
|
|
|
|
2010-11-01 19:13:17 +01:00
|
|
|
|
if (ret)
|
2008-12-11 18:38:29 +01:00
|
|
|
|
{
|
2009-05-19 18:14:43 +02:00
|
|
|
|
GUI_DeleteMenu(m);
|
2010-11-01 19:13:17 +01:00
|
|
|
|
if (FileSelector())
|
|
|
|
|
{
|
|
|
|
|
/* directly jump to game */
|
2010-03-22 15:07:25 +01:00
|
|
|
|
return 1;
|
2010-11-01 19:13:17 +01:00
|
|
|
|
}
|
2009-05-19 18:14:43 +02:00
|
|
|
|
GUI_InitMenu(m);
|
2008-12-11 18:38:29 +01:00
|
|
|
|
}
|
2008-12-04 20:32:22 +01:00
|
|
|
|
break;
|
2010-11-01 19:13:17 +01:00
|
|
|
|
}
|
2008-08-20 22:25:17 +02:00
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
|
}
|
2009-05-19 18:14:43 +02:00
|
|
|
|
|
|
|
|
|
return 0;
|
2008-08-07 14:26:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
|
* Show rom info screen
|
|
|
|
|
***************************************************************************/
|
2010-05-09 02:53:19 +02:00
|
|
|
|
static void showrominfo (void)
|
2008-08-07 14:26:07 +02:00
|
|
|
|
{
|
2010-05-09 02:53:19 +02:00
|
|
|
|
char items[15][64];
|
|
|
|
|
|
|
|
|
|
/* fill ROM infos */
|
|
|
|
|
sprintf (items[0], "Console Type: %s", rominfo.consoletype);
|
|
|
|
|
sprintf (items[1], "Copyright: %s", rominfo.copyright);
|
2010-05-28 14:08:00 +02:00
|
|
|
|
sprintf (items[2], "Company Name: %s", get_company());
|
2010-05-09 02:53:19 +02:00
|
|
|
|
sprintf (items[3], "Domestic Name:");
|
|
|
|
|
sprintf (items[4], "%s",rominfo.domestic);
|
|
|
|
|
sprintf (items[5], "International Name:");
|
|
|
|
|
sprintf (items[6], "%s",rominfo.international);
|
|
|
|
|
sprintf (items[7], "Type: %s (%s)",rominfo.ROMType, strcmp(rominfo.ROMType, "AI") ? "Game" : "Educational");
|
|
|
|
|
sprintf (items[8], "Product ID: %s", rominfo.product);
|
2010-05-28 14:08:00 +02:00
|
|
|
|
sprintf (items[9], "Checksum: %04x (%04x) (%s)", rominfo.checksum, rominfo.realchecksum,
|
|
|
|
|
(rominfo.checksum == rominfo.realchecksum) ? "GOOD" : "BAD");
|
2010-05-09 02:53:19 +02:00
|
|
|
|
|
|
|
|
|
sprintf (items[10], "Supports: ");
|
2010-05-28 14:08:00 +02:00
|
|
|
|
if (rominfo.peripherals & (1 << 1))
|
2008-08-07 14:26:07 +02:00
|
|
|
|
{
|
2010-05-28 14:08:00 +02:00
|
|
|
|
strcat(items[10],get_peripheral(1));
|
2010-05-09 02:53:19 +02:00
|
|
|
|
strcat(items[10],", ");
|
2008-08-07 14:26:07 +02:00
|
|
|
|
}
|
2010-05-28 14:08:00 +02:00
|
|
|
|
else if (rominfo.peripherals & (1 << 0))
|
2008-08-07 14:26:07 +02:00
|
|
|
|
{
|
2010-05-28 14:08:00 +02:00
|
|
|
|
strcat(items[10],get_peripheral(0));
|
2010-05-09 02:53:19 +02:00
|
|
|
|
strcat(items[10],", ");
|
|
|
|
|
}
|
2010-05-28 14:08:00 +02:00
|
|
|
|
if (rominfo.peripherals & (1 << 7))
|
2010-05-09 02:53:19 +02:00
|
|
|
|
{
|
2010-05-28 14:08:00 +02:00
|
|
|
|
strcat(items[10],get_peripheral(7));
|
2010-05-09 02:53:19 +02:00
|
|
|
|
strcat(items[10],", ");
|
|
|
|
|
}
|
2010-05-28 14:08:00 +02:00
|
|
|
|
if (rominfo.peripherals & (1 << 8))
|
2010-05-09 02:53:19 +02:00
|
|
|
|
{
|
2010-05-28 14:08:00 +02:00
|
|
|
|
strcat(items[10],get_peripheral(8));
|
2010-05-09 02:53:19 +02:00
|
|
|
|
strcat(items[10],", ");
|
|
|
|
|
}
|
2010-05-28 14:08:00 +02:00
|
|
|
|
if (rominfo.peripherals & (1 << 11))
|
2010-05-09 02:53:19 +02:00
|
|
|
|
{
|
2010-05-28 14:08:00 +02:00
|
|
|
|
strcat(items[10],get_peripheral(11));
|
2010-05-09 02:53:19 +02:00
|
|
|
|
strcat(items[10],", ");
|
|
|
|
|
}
|
2010-05-28 14:08:00 +02:00
|
|
|
|
if (rominfo.peripherals & (1 << 13))
|
2010-05-09 02:53:19 +02:00
|
|
|
|
{
|
2010-11-01 19:13:17 +01:00
|
|
|
|
strcat(items[10],get_peripheral(13));
|
2010-05-09 02:53:19 +02:00
|
|
|
|
strcat(items[10],", ");
|
|
|
|
|
}
|
|
|
|
|
if (strlen(items[10]) > 10)
|
|
|
|
|
items[10][strlen(items[10]) - 2] = 0;
|
2008-12-10 19:16:30 +01:00
|
|
|
|
|
2010-05-09 02:53:19 +02:00
|
|
|
|
sprintf (items[11], "ROM end: $%06X", rominfo.romend);
|
2008-12-10 19:16:30 +01:00
|
|
|
|
|
2010-05-09 02:53:19 +02:00
|
|
|
|
if (sram.custom)
|
2010-05-17 12:55:37 +02:00
|
|
|
|
sprintf (items[12], "EEPROM(%dK): $%06X", ((eeprom.type.size_mask+1)* 8) /1024, eeprom.type.sda_in_adr);
|
2010-05-09 02:53:19 +02:00
|
|
|
|
else if (sram.detected)
|
|
|
|
|
sprintf (items[12], "SRAM Start: $%06X", sram.start);
|
|
|
|
|
else
|
|
|
|
|
sprintf (items[12], "No Backup Memory specified");
|
|
|
|
|
|
|
|
|
|
if (sram.custom)
|
2010-05-17 12:55:37 +02:00
|
|
|
|
sprintf (items[13], "EEPROM(%dK): $%06X", ((eeprom.type.size_mask+1)* 8) /1024, eeprom.type.sda_out_adr);
|
2010-05-09 02:53:19 +02:00
|
|
|
|
else if (sram.detected)
|
|
|
|
|
sprintf (items[13], "SRAM End: $%06X", sram.end);
|
|
|
|
|
else if (sram.on)
|
|
|
|
|
sprintf (items[13], "SRAM enabled by default");
|
|
|
|
|
else
|
|
|
|
|
sprintf (items[13], "SRAM disabled by default");
|
|
|
|
|
|
|
|
|
|
if (region_code == REGION_USA)
|
2010-05-17 12:55:37 +02:00
|
|
|
|
sprintf (items[14], "Region Code: %s (USA)", rominfo.country);
|
2010-05-09 02:53:19 +02:00
|
|
|
|
else if (region_code == REGION_EUROPE)
|
2010-05-17 12:55:37 +02:00
|
|
|
|
sprintf (items[14], "Region Code: %s (EUR)", rominfo.country);
|
2010-05-09 02:53:19 +02:00
|
|
|
|
else if (region_code == REGION_JAPAN_NTSC)
|
2010-05-17 12:55:37 +02:00
|
|
|
|
sprintf (items[14], "Region Code: %s (JPN)", rominfo.country);
|
2010-05-09 02:53:19 +02:00
|
|
|
|
else if (region_code == REGION_JAPAN_PAL)
|
2010-05-17 12:55:37 +02:00
|
|
|
|
sprintf (items[14], "Region Code: %s (JPN-PAL)", rominfo.country);
|
2010-05-09 02:53:19 +02:00
|
|
|
|
|
2010-05-17 12:55:37 +02:00
|
|
|
|
GUI_TextWindow(&menu_main, "ROM Header Info", items, 15, 15);
|
2010-05-09 02:53:19 +02:00
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
|
|
2010-05-09 02:53:19 +02:00
|
|
|
|
/***************************************************************************
|
|
|
|
|
* Show credits
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
static void showcredits(void)
|
|
|
|
|
{
|
|
|
|
|
int offset = 0;
|
|
|
|
|
|
|
|
|
|
gx_texture *texture = gxTextureOpenPNG(Bg_credits_png,0);
|
|
|
|
|
s16 p = 0;
|
|
|
|
|
|
|
|
|
|
while (!p)
|
|
|
|
|
{
|
|
|
|
|
gxClearScreen ((GXColor)BLACK);
|
2010-05-28 14:08:00 +02:00
|
|
|
|
if (texture)
|
|
|
|
|
gxDrawTexture(texture, (640-texture->width)/2, (480-texture->height)/2, texture->width, texture->height,255);
|
2010-05-09 02:53:19 +02:00
|
|
|
|
|
|
|
|
|
FONT_writeCenter("Genesis Plus Core", 24, 0, 640, 480 - offset, (GXColor)LIGHT_BLUE);
|
2010-11-01 19:13:17 +01:00
|
|
|
|
FONT_writeCenter("improved emulation code, fixes & extra features by Eke-Eke", 18, 0, 640, 516 - offset, (GXColor)WHITE);
|
|
|
|
|
FONT_writeCenter("original 1.2a version by Charles MacDonald", 18, 0, 640, 534 - offset, (GXColor)WHITE);
|
2010-05-09 02:53:19 +02:00
|
|
|
|
FONT_writeCenter("original Z80 core by Juergen Buchmueller", 18, 0, 640, 552 - offset, (GXColor)WHITE);
|
2010-11-01 19:13:17 +01:00
|
|
|
|
FONT_writeCenter("original 68k Musashi core by Karl Stenerud", 18, 0, 640, 570 - offset, (GXColor)WHITE);
|
2010-05-09 02:53:19 +02:00
|
|
|
|
FONT_writeCenter("original YM2612 core by Jarek Burczynski & Tatsuyuki Satoh", 18, 0, 640, 588 - offset, (GXColor)WHITE);
|
|
|
|
|
FONT_writeCenter("SN76489 core by Maxim", 18, 0, 640, 606 - offset, (GXColor)WHITE);
|
|
|
|
|
FONT_writeCenter("SVP core by Gravydas Ignotas (Notaz)", 18, 0, 640, 624 - offset, (GXColor)WHITE);
|
|
|
|
|
FONT_writeCenter("FIR Resampler & NTSC Video Filter by Shay Green (Blargg)", 18, 0, 640, 642 - offset, (GXColor)WHITE);
|
|
|
|
|
FONT_writeCenter("3-Band EQ implementation by Neil C", 18, 0, 640, 660 - offset, (GXColor)WHITE);
|
|
|
|
|
|
2010-11-01 19:13:17 +01:00
|
|
|
|
FONT_writeCenter("Special thanks to ...", 20, 0, 640, 700 - offset, (GXColor)LIGHT_GREEN);
|
2010-05-09 02:53:19 +02:00
|
|
|
|
FONT_writeCenter("Nemesis, Tasco Deluxe, Bart Trzynadlowski, Jorge Cwik, Haze,", 18, 0, 640, 736 - offset, (GXColor)WHITE);
|
2010-11-01 19:13:17 +01:00
|
|
|
|
FONT_writeCenter("Stef Dallongeville, Notaz, AamirM, Steve Snake, Charles MacDonald", 18, 0, 640, 754 - offset, (GXColor)WHITE);
|
|
|
|
|
FONT_writeCenter("Spritesmind & SMS Power forums members for their technical help", 18, 0, 640, 772 - offset, (GXColor)WHITE);
|
2010-05-09 02:53:19 +02:00
|
|
|
|
|
|
|
|
|
FONT_writeCenter("Gamecube & Wii port", 24, 0, 640, 830 - offset, (GXColor)LIGHT_BLUE);
|
2010-11-01 19:13:17 +01:00
|
|
|
|
FONT_writeCenter("porting code, GUI engine & design by Eke-Eke", 18, 0, 640, 866 - offset, (GXColor)WHITE);
|
|
|
|
|
FONT_writeCenter("original Gamecube port by Softdev, Honkeykong & Markcube", 18, 0, 640, 884 - offset, (GXColor)WHITE);
|
2010-05-09 02:53:19 +02:00
|
|
|
|
FONT_writeCenter("original icons, logo & button design by Low Lines", 18, 0, 640, 906 - offset, (GXColor)WHITE);
|
2010-11-01 19:13:17 +01:00
|
|
|
|
FONT_writeCenter("credit illustration by Orioto (from Deviant Art)", 18, 0, 640, 924 - offset, (GXColor)WHITE);
|
|
|
|
|
FONT_writeCenter("memory card icon design by Brakken", 18, 0, 640, 942 - offset, (GXColor)WHITE);
|
|
|
|
|
FONT_writeCenter("libogc by Shagkur & other contibutors", 18, 0, 640, 960 - offset, (GXColor)WHITE);
|
|
|
|
|
FONT_writeCenter("libfat by Chism", 18, 0, 640, 978 - offset, (GXColor)WHITE);
|
|
|
|
|
FONT_writeCenter("wiiuse by Michael Laforest (Para)", 18, 0, 640, 996 - offset, (GXColor)WHITE);
|
|
|
|
|
FONT_writeCenter("asndlib & OGG player by Francisco Mu<4D>oz (Hermes)", 18, 0, 640, 1014 - offset, (GXColor)WHITE);
|
2010-05-09 02:53:19 +02:00
|
|
|
|
FONT_writeCenter("zlib, libpng & libtremor by their respective authors", 18, 0, 640, 1032 - offset, (GXColor)WHITE);
|
|
|
|
|
FONT_writeCenter("devkitPPC by Wintermute", 18, 0, 640, 1050 - offset, (GXColor)WHITE);
|
|
|
|
|
|
2010-11-01 19:13:17 +01:00
|
|
|
|
FONT_writeCenter("Special thanks to ...", 20, 0, 640, 1090 - offset, (GXColor)LIGHT_GREEN);
|
2010-05-09 02:53:19 +02:00
|
|
|
|
FONT_writeCenter("Softdev, Tmbinc, Costis, Emukiddid, Team Twiizer", 18, 0, 640, 1126 - offset, (GXColor)WHITE);
|
|
|
|
|
FONT_writeCenter("Brakken & Tehskeen members for their support", 18, 0, 640, 1144 - offset, (GXColor)WHITE);
|
2010-11-01 19:13:17 +01:00
|
|
|
|
FONT_writeCenter("Anca, my wife, for her patience & various ideas", 18, 0, 640, 1162 - offset, (GXColor)WHITE);
|
2008-12-10 19:16:30 +01:00
|
|
|
|
|
2009-05-19 18:14:43 +02:00
|
|
|
|
gxSetScreen();
|
2010-05-09 02:53:19 +02:00
|
|
|
|
p = m_input.keys;
|
|
|
|
|
VIDEO_WaitVSync();
|
|
|
|
|
p |= m_input.keys;
|
|
|
|
|
offset ++;
|
|
|
|
|
if (offset > 1144)
|
|
|
|
|
offset = 0;
|
2008-12-10 19:16:30 +01:00
|
|
|
|
}
|
|
|
|
|
|
2010-05-09 02:53:19 +02:00
|
|
|
|
gxTextureClose(&texture);
|
2008-08-07 14:26:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2010-05-28 17:47:45 +02:00
|
|
|
|
static void exitmenu(void)
|
2008-08-07 14:26:07 +02:00
|
|
|
|
{
|
2009-04-20 19:41:54 +02:00
|
|
|
|
char *items[3] =
|
|
|
|
|
{
|
|
|
|
|
"View Credits",
|
|
|
|
|
#ifdef HW_RVL
|
2010-05-28 17:47:45 +02:00
|
|
|
|
"Exit to System Menu",
|
2009-04-20 19:41:54 +02:00
|
|
|
|
#else
|
2010-05-28 17:47:45 +02:00
|
|
|
|
"Reset System",
|
2009-04-20 19:41:54 +02:00
|
|
|
|
#endif
|
2010-05-28 17:47:45 +02:00
|
|
|
|
"Return to Loader",
|
2009-04-20 19:41:54 +02:00
|
|
|
|
};
|
|
|
|
|
|
2010-05-28 17:47:45 +02:00
|
|
|
|
/* autodetect loader stub */
|
|
|
|
|
bool stub = FALSE;
|
|
|
|
|
u32 *sig = (u32*)0x80001800;
|
|
|
|
|
void (*reload)() = (void(*)())0x80001800;
|
|
|
|
|
|
|
|
|
|
#ifdef HW_RVL
|
2010-11-01 19:13:17 +01:00
|
|
|
|
if ((sig[1] == 0x53545542) && (sig[2] == 0x48415858)) // HBC
|
2010-05-28 17:47:45 +02:00
|
|
|
|
#else
|
2010-11-01 19:13:17 +01:00
|
|
|
|
if (sig[0] == 0x7c6000a6) // SDLOAD
|
2010-05-28 17:47:45 +02:00
|
|
|
|
#endif
|
2010-11-01 19:13:17 +01:00
|
|
|
|
stub = TRUE;
|
2010-05-28 17:47:45 +02:00
|
|
|
|
|
|
|
|
|
/* display option window */
|
|
|
|
|
switch (GUI_OptionWindow(&menu_main, VERSION, items, stub ? 3:2))
|
|
|
|
|
{
|
|
|
|
|
case 0: /* credits */
|
|
|
|
|
GUI_DeleteMenu(&menu_main);
|
|
|
|
|
showcredits();
|
|
|
|
|
GUI_InitMenu(&menu_main);
|
|
|
|
|
break;
|
|
|
|
|
|
2010-11-01 19:13:17 +01:00
|
|
|
|
case 1: /* reset */
|
2010-05-28 17:47:45 +02:00
|
|
|
|
#ifdef HW_RVL
|
|
|
|
|
gxTextureClose(&w_pointer);
|
|
|
|
|
#endif
|
|
|
|
|
GUI_DeleteMenu(&menu_main);
|
|
|
|
|
GUI_FadeOut();
|
|
|
|
|
shutdown();
|
2010-11-01 19:13:17 +01:00
|
|
|
|
#ifdef HW_RVL
|
|
|
|
|
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
|
|
|
|
#else
|
|
|
|
|
SYS_ResetSystem(SYS_HOTRESET,0,0);
|
|
|
|
|
#endif
|
2010-05-28 17:47:45 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2010-11-01 19:13:17 +01:00
|
|
|
|
case 2: /* exit to loader */
|
2010-05-28 17:47:45 +02:00
|
|
|
|
#ifdef HW_RVL
|
|
|
|
|
gxTextureClose(&w_pointer);
|
|
|
|
|
#endif
|
|
|
|
|
GUI_DeleteMenu(&menu_main);
|
|
|
|
|
GUI_FadeOut();
|
|
|
|
|
shutdown();
|
2010-11-01 19:13:17 +01:00
|
|
|
|
SYS_ResetSystem(SYS_SHUTDOWN,0,0);
|
|
|
|
|
__lwp_thread_stopmultitasking(*reload);
|
2010-05-28 17:47:45 +02:00
|
|
|
|
break;
|
2010-11-01 19:13:17 +01:00
|
|
|
|
|
2010-05-28 17:47:45 +02:00
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
|
* Main Menu
|
|
|
|
|
*
|
|
|
|
|
****************************************************************************/
|
2010-11-01 19:13:17 +01:00
|
|
|
|
|
|
|
|
|
static void mainmenu_cb(void)
|
|
|
|
|
{
|
|
|
|
|
char temp[4];
|
|
|
|
|
gui_menu *m = &menu_main;
|
|
|
|
|
int status = areplay_get_status();
|
|
|
|
|
|
|
|
|
|
/* Action Replay Switch current status */
|
|
|
|
|
if (status == AR_SWITCH_TRAINER) strcpy(temp,"TM");
|
|
|
|
|
else if (status == AR_SWITCH_ON) strcpy(temp,"ON");
|
|
|
|
|
else strcpy(temp,"OFF");
|
|
|
|
|
|
|
|
|
|
/* Display informations */
|
|
|
|
|
if (m->selected == 6)
|
|
|
|
|
{
|
|
|
|
|
FONT_writeCenter("Action\nReplay", 14, m->items[6].x, m->items[6].x + 54, m->items[6].y + (m->items[6].h - 28)/2 + 14, (GXColor)DARK_GREY);
|
|
|
|
|
FONT_writeCenter(temp, 11, m->items[6].x + 56 + 3, m->items[6].x + 78 + 2, m->items[6].y + (m->items[6].h - 11)/2 + 11, (GXColor)DARK_GREY);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
FONT_writeCenter("Action\nReplay", 12, m->items[6].x + 4, m->items[6].x + 54, m->items[6].y + (m->items[6].h - 24)/2 + 12, (GXColor)DARK_GREY);
|
|
|
|
|
FONT_writeCenter(temp, 10, m->items[6].x + 56, m->items[6].x + 78, m->items[6].y + (m->items[6].h - 10)/2 + 10, (GXColor)DARK_GREY);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-06 16:03:50 +02:00
|
|
|
|
void menu_execute(void)
|
2010-05-28 17:47:45 +02:00
|
|
|
|
{
|
|
|
|
|
char filename[MAXPATHLEN];
|
2010-11-01 19:13:17 +01:00
|
|
|
|
int status, quit = 0;
|
2010-05-28 17:47:45 +02:00
|
|
|
|
|
|
|
|
|
/* Autosave SRAM */
|
2010-05-06 14:59:43 +02:00
|
|
|
|
if (config.s_auto & 1)
|
|
|
|
|
slot_autosave(0,config.s_device);
|
2008-12-10 19:16:30 +01:00
|
|
|
|
|
2009-04-15 17:33:51 +02:00
|
|
|
|
#ifdef HW_RVL
|
2010-03-22 15:07:25 +01:00
|
|
|
|
/* Wiimote shutdown */
|
2009-05-20 17:11:06 +02:00
|
|
|
|
if (Shutdown)
|
|
|
|
|
{
|
|
|
|
|
GUI_FadeOut();
|
|
|
|
|
shutdown();
|
|
|
|
|
SYS_ResetSystem(SYS_POWEROFF, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
|
2010-05-28 17:47:45 +02:00
|
|
|
|
/* Wiimote pointer */
|
2009-05-01 14:56:48 +02:00
|
|
|
|
w_pointer = gxTextureOpenPNG(generic_point_png,0);
|
2009-04-20 00:31:08 +02:00
|
|
|
|
#endif
|
2008-11-13 08:24:30 +01:00
|
|
|
|
|
2009-03-30 09:05:34 +02:00
|
|
|
|
gui_menu *m = &menu_main;
|
|
|
|
|
|
2010-05-28 17:47:45 +02:00
|
|
|
|
/* Update main menu */
|
|
|
|
|
if (!m->screenshot && cart.romsize)
|
2009-04-20 00:31:08 +02:00
|
|
|
|
{
|
2010-05-28 17:47:45 +02:00
|
|
|
|
m->screenshot = 128;
|
|
|
|
|
m->bg_images[0].state &= ~IMAGE_VISIBLE;
|
|
|
|
|
m->items[0].y -= 90;
|
|
|
|
|
m->items[1].y -= 90;
|
|
|
|
|
m->items[2].y -= 90;
|
|
|
|
|
m->buttons[0].y -= 90;
|
|
|
|
|
m->buttons[1].y -= 90;
|
|
|
|
|
m->buttons[2].y -= 90;
|
2010-05-30 20:42:03 +02:00
|
|
|
|
m->buttons[0].shift[1] = 3;
|
|
|
|
|
m->buttons[1].shift[1] = 3;
|
|
|
|
|
m->buttons[2].shift[1] = 3;
|
2010-05-28 17:47:45 +02:00
|
|
|
|
m->buttons[3].state |= (BUTTON_VISIBLE | BUTTON_ACTIVE);
|
|
|
|
|
m->buttons[4].state |= (BUTTON_VISIBLE | BUTTON_ACTIVE);
|
|
|
|
|
m->buttons[5].state |= (BUTTON_VISIBLE | BUTTON_ACTIVE);
|
|
|
|
|
m->buttons[7].state |= (BUTTON_VISIBLE | BUTTON_ACTIVE);
|
|
|
|
|
m->buttons[8].state |= (BUTTON_VISIBLE | BUTTON_ACTIVE);
|
2010-11-01 19:13:17 +01:00
|
|
|
|
m->buttons[9].state |= (BUTTON_VISIBLE | BUTTON_ACTIVE);
|
|
|
|
|
if (areplay_get_status() >= 0)
|
|
|
|
|
{
|
|
|
|
|
menu_main.buttons[6].state |= (BUTTON_VISIBLE | BUTTON_ACTIVE);
|
|
|
|
|
menu_main.items[6].data = Button_sm_grey_png;
|
|
|
|
|
menu_main.cb = mainmenu_cb;
|
|
|
|
|
menu_main.buttons[3].shift[1] = 3;
|
|
|
|
|
menu_main.buttons[7].shift[0] = 1;
|
|
|
|
|
menu_main.buttons[8].shift[2] = 2;
|
|
|
|
|
}
|
2009-04-20 00:31:08 +02:00
|
|
|
|
}
|
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
|
GUI_InitMenu(m);
|
2009-04-20 00:31:08 +02:00
|
|
|
|
GUI_DrawMenuFX(m,10,0);
|
2009-04-01 09:37:54 +02:00
|
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
|
while (quit == 0)
|
|
|
|
|
{
|
2010-05-28 17:47:45 +02:00
|
|
|
|
switch (GUI_RunMenu(m))
|
2008-12-10 19:16:30 +01:00
|
|
|
|
{
|
2009-12-14 10:05:41 +01:00
|
|
|
|
/*** Load Game Menu ***/
|
|
|
|
|
case 0:
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_DrawMenuFX(m,30,1);
|
2009-05-04 23:43:16 +02:00
|
|
|
|
GUI_DeleteMenu(m);
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
|
|
|
|
if (loadgamemenu())
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* check current controller configuration */
|
|
|
|
|
if (!gx_input_FindDevices())
|
|
|
|
|
{
|
|
|
|
|
GUI_InitMenu(m);
|
|
|
|
|
GUI_DrawMenuFX(m,30,0);
|
|
|
|
|
GUI_WaitPrompt("Error","Invalid Controllers Settings");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* exit to game */
|
2010-11-01 19:13:17 +01:00
|
|
|
|
gxClearScreen((GXColor)BLACK);
|
|
|
|
|
gxSetScreen();
|
2010-12-04 18:15:36 +01:00
|
|
|
|
quit = 1;
|
2010-11-01 19:13:17 +01:00
|
|
|
|
break;
|
|
|
|
|
}
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
2009-12-14 10:05:41 +01:00
|
|
|
|
GUI_InitMenu(m);
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_DrawMenuFX(m,30,0);
|
2008-12-10 19:16:30 +01:00
|
|
|
|
break;
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
2009-12-14 10:05:41 +01:00
|
|
|
|
/*** Options Menu */
|
|
|
|
|
case 1:
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_DrawMenuFX(m,30,1);
|
2009-12-14 10:05:41 +01:00
|
|
|
|
GUI_DeleteMenu(m);
|
|
|
|
|
optionmenu();
|
|
|
|
|
GUI_InitMenu(m);
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_DrawMenuFX(m,30,0);
|
2009-12-14 10:05:41 +01:00
|
|
|
|
break;
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
2009-12-14 10:05:41 +01:00
|
|
|
|
/*** Exit Menu ***/
|
|
|
|
|
case 2:
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
2010-05-28 17:47:45 +02:00
|
|
|
|
exitmenu();
|
2009-04-21 03:05:56 +02:00
|
|
|
|
break;
|
2009-04-20 19:41:54 +02:00
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
2010-05-06 14:59:43 +02:00
|
|
|
|
/*** Save Manager ***/
|
2009-12-14 10:05:41 +01:00
|
|
|
|
case 3:
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_DrawMenuFX(m,30,1);
|
2009-05-12 14:27:19 +02:00
|
|
|
|
GUI_DeleteMenu(m);
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
|
|
|
|
if (savemenu())
|
|
|
|
|
{
|
|
|
|
|
/* check current controller configuration */
|
|
|
|
|
if (!gx_input_FindDevices())
|
|
|
|
|
{
|
|
|
|
|
GUI_InitMenu(m);
|
|
|
|
|
GUI_DrawMenuFX(m,30,0);
|
|
|
|
|
GUI_WaitPrompt("Error","Invalid Controllers Settings");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* exit to game */
|
|
|
|
|
quit = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2009-05-12 14:27:19 +02:00
|
|
|
|
GUI_InitMenu(m);
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_DrawMenuFX(m,30,0);
|
2009-03-15 20:11:01 +01:00
|
|
|
|
break;
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
2009-12-14 10:05:41 +01:00
|
|
|
|
/*** Virtual system hard reset ***/
|
|
|
|
|
case 4:
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
|
|
|
|
/* check current controller configuration */
|
|
|
|
|
if (!gx_input_FindDevices())
|
|
|
|
|
{
|
|
|
|
|
GUI_WaitPrompt("Error","Invalid Controllers Settings");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* reinitialize emulation */
|
2009-05-12 14:27:19 +02:00
|
|
|
|
GUI_DrawMenuFX(m,10,1);
|
|
|
|
|
GUI_DeleteMenu(m);
|
2009-08-14 15:54:15 +02:00
|
|
|
|
gxClearScreen((GXColor)BLACK);
|
2009-05-19 18:14:43 +02:00
|
|
|
|
gxSetScreen();
|
2009-10-16 13:32:55 +02:00
|
|
|
|
system_init();
|
|
|
|
|
system_reset();
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
|
|
|
|
/* restore SRAM */
|
2010-05-06 14:59:43 +02:00
|
|
|
|
if (config.s_auto & 1)
|
2010-11-01 19:13:17 +01:00
|
|
|
|
{
|
2010-05-06 14:59:43 +02:00
|
|
|
|
slot_autoload(0,config.s_device);
|
2010-11-01 19:13:17 +01:00
|
|
|
|
}
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
|
|
|
|
/* exit to game */
|
2009-04-20 19:41:54 +02:00
|
|
|
|
quit = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
2010-11-01 19:13:17 +01:00
|
|
|
|
/*** Cheats menu ***/
|
2009-12-14 10:05:41 +01:00
|
|
|
|
case 5:
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_DrawMenuFX(m,30,1);
|
2009-05-12 14:27:19 +02:00
|
|
|
|
GUI_DeleteMenu(m);
|
2010-11-01 19:13:17 +01:00
|
|
|
|
CheatMenu();
|
2009-05-12 14:27:19 +02:00
|
|
|
|
GUI_InitMenu(m);
|
2010-03-22 15:07:25 +01:00
|
|
|
|
GUI_DrawMenuFX(m,30,0);
|
2009-04-20 19:41:54 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
2010-11-01 19:13:17 +01:00
|
|
|
|
/*** Action Replay switch ***/
|
2009-12-14 10:05:41 +01:00
|
|
|
|
case 6:
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
2010-11-01 19:13:17 +01:00
|
|
|
|
status = (areplay_get_status() + 1) % (AR_SWITCH_TRAINER + 1);
|
|
|
|
|
areplay_set_status(status);
|
|
|
|
|
status = areplay_get_status();
|
2009-12-14 10:05:41 +01:00
|
|
|
|
GUI_DeleteMenu(m);
|
2010-11-01 19:13:17 +01:00
|
|
|
|
if (status == AR_SWITCH_TRAINER) m->items[6].data = Button_sm_blue_png;
|
|
|
|
|
else if (status == AR_SWITCH_ON) m->items[6].data = Button_sm_yellow_png;
|
|
|
|
|
else m->items[6].data = Button_sm_grey_png;
|
|
|
|
|
GUI_InitMenu(m);
|
2009-12-14 10:05:41 +01:00
|
|
|
|
break;
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
2010-11-01 19:13:17 +01:00
|
|
|
|
/*** Return to Game ***/
|
2009-12-14 10:05:41 +01:00
|
|
|
|
case 7:
|
2010-11-01 19:13:17 +01:00
|
|
|
|
case -1:
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
2010-11-01 19:13:17 +01:00
|
|
|
|
if (cart.romsize)
|
|
|
|
|
{
|
2010-12-04 18:15:36 +01:00
|
|
|
|
/* check current controller configuration */
|
|
|
|
|
if (!gx_input_FindDevices())
|
|
|
|
|
{
|
|
|
|
|
GUI_WaitPrompt("Error","Invalid Controllers Settings");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* exit to game */
|
2010-11-01 19:13:17 +01:00
|
|
|
|
GUI_DrawMenuFX(m,10,1);
|
|
|
|
|
GUI_DeleteMenu(m);
|
|
|
|
|
quit = 1;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
2010-11-01 19:13:17 +01:00
|
|
|
|
/*** Game Capture ***/
|
|
|
|
|
case 8:
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
2009-09-27 20:08:33 +02:00
|
|
|
|
sprintf(filename,"%s/snaps/%s.png", DEFAULT_PATH, rom_filename);
|
|
|
|
|
gxSaveScreenshot(filename);
|
2009-05-01 14:56:48 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
2010-05-09 02:53:19 +02:00
|
|
|
|
/*** ROM information screen ***/
|
2010-11-01 19:13:17 +01:00
|
|
|
|
case 9:
|
2010-12-04 18:15:36 +01:00
|
|
|
|
|
2009-08-14 15:54:15 +02:00
|
|
|
|
showrominfo();
|
2008-12-10 19:16:30 +01:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
|
/*** Remove any still held buttons ***/
|
2010-12-04 18:15:36 +01:00
|
|
|
|
while (PAD_ButtonsHeld(0)) PAD_ScanPads();
|
2008-08-07 14:26:07 +02:00
|
|
|
|
#ifdef HW_RVL
|
2010-12-04 18:15:36 +01:00
|
|
|
|
while (WPAD_ButtonsHeld(0)) WPAD_ScanPads();
|
2009-04-20 00:31:08 +02:00
|
|
|
|
gxTextureClose(&w_pointer);
|
2009-04-21 03:05:56 +02:00
|
|
|
|
#endif
|
2008-08-07 14:26:07 +02:00
|
|
|
|
}
|
2010-07-06 16:03:50 +02:00
|
|
|
|
|
|
|
|
|
void menu_configure(void)
|
|
|
|
|
{
|
|
|
|
|
/* background type */
|
|
|
|
|
if (config.bg_type > 0)
|
|
|
|
|
{
|
|
|
|
|
GUI_SetBgColor((u8)(config.bg_type - 1));
|
2010-11-01 19:13:17 +01:00
|
|
|
|
bg_main[0].state &= ~IMAGE_REPEAT;
|
|
|
|
|
bg_misc[0].state &= ~IMAGE_REPEAT;
|
|
|
|
|
bg_ctrls[0].state &= ~IMAGE_REPEAT;
|
|
|
|
|
bg_list[0].state &= ~IMAGE_REPEAT;
|
|
|
|
|
bg_saves[1].state &= ~IMAGE_REPEAT;
|
|
|
|
|
if (config.bg_type > 1)
|
|
|
|
|
{
|
|
|
|
|
bg_main[0].data = bg_misc[0].data = bg_ctrls[0].data = bg_list[0].data = bg_saves[1].data = Bg_main_png;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
bg_main[0].data = bg_misc[0].data = bg_ctrls[0].data = bg_list[0].data = bg_saves[1].data = Bg_main_2_png;
|
|
|
|
|
}
|
2010-07-06 16:03:50 +02:00
|
|
|
|
bg_main[0].x = bg_misc[0].x = bg_ctrls[0].x = bg_list[0].x = bg_saves[1].x = 374;
|
|
|
|
|
bg_main[0].y = bg_misc[0].y = bg_ctrls[0].y = bg_list[0].y = bg_saves[1].y = 140;
|
|
|
|
|
bg_main[0].w = bg_misc[0].w = bg_ctrls[0].w = bg_list[0].w = bg_saves[1].w = 284;
|
|
|
|
|
bg_main[0].h = bg_misc[0].h = bg_ctrls[0].h = bg_list[0].h = bg_saves[1].h = 288;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
GUI_SetBgColor(0);
|
2010-11-01 19:13:17 +01:00
|
|
|
|
bg_main[0].state |= IMAGE_REPEAT;
|
|
|
|
|
bg_misc[0].state |= IMAGE_REPEAT;
|
|
|
|
|
bg_ctrls[0].state |= IMAGE_REPEAT;
|
|
|
|
|
bg_list[0].state |= IMAGE_REPEAT;
|
|
|
|
|
bg_saves[1].state |= IMAGE_REPEAT;
|
2010-07-06 16:03:50 +02:00
|
|
|
|
bg_main[0].data = bg_misc[0].data = bg_ctrls[0].data = bg_list[0].data = bg_saves[1].data = Bg_layer_png;
|
|
|
|
|
bg_main[0].x = bg_misc[0].x = bg_ctrls[0].x = bg_list[0].x = bg_saves[1].x = 0;
|
|
|
|
|
bg_main[0].y = bg_misc[0].y = bg_ctrls[0].y = bg_list[0].y = bg_saves[1].y = 0;
|
|
|
|
|
bg_main[0].w = bg_misc[0].w = bg_ctrls[0].w = bg_list[0].w = bg_saves[1].w = 640;
|
|
|
|
|
bg_main[0].h = bg_misc[0].h = bg_ctrls[0].h = bg_list[0].h = bg_saves[1].h = 480;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* background overlay */
|
|
|
|
|
if (config.bg_overlay)
|
|
|
|
|
{
|
2010-11-01 19:13:17 +01:00
|
|
|
|
bg_main[1].state |= IMAGE_VISIBLE;
|
|
|
|
|
bg_misc[1].state |= IMAGE_VISIBLE;
|
2010-07-06 16:03:50 +02:00
|
|
|
|
bg_ctrls[1].state |= IMAGE_VISIBLE;
|
2010-11-01 19:13:17 +01:00
|
|
|
|
bg_list[1].state |= IMAGE_VISIBLE;
|
2010-07-06 16:03:50 +02:00
|
|
|
|
bg_saves[2].state |= IMAGE_VISIBLE;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-11-01 19:13:17 +01:00
|
|
|
|
bg_main[1].state &= ~IMAGE_VISIBLE;
|
|
|
|
|
bg_misc[1].state &= ~IMAGE_VISIBLE;
|
2010-07-06 16:03:50 +02:00
|
|
|
|
bg_ctrls[1].state &= ~IMAGE_VISIBLE;
|
2010-11-01 19:13:17 +01:00
|
|
|
|
bg_list[1].state &= ~IMAGE_VISIBLE;
|
2010-07-06 16:03:50 +02:00
|
|
|
|
bg_saves[2].state &= ~IMAGE_VISIBLE;
|
|
|
|
|
}
|
|
|
|
|
}
|