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
|
|
|
*
|
2009-05-02 17:00:13 +02:00
|
|
|
* Genesis Plus GX menus
|
2008-12-11 18:38:29 +01:00
|
|
|
*
|
2009-05-13 16:26:55 +02:00
|
|
|
* Eke-Eke (2009)
|
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"
|
|
|
|
#include "font.h"
|
2009-05-13 16:26:55 +02:00
|
|
|
#include "gui.h"
|
|
|
|
#include "dvd.h"
|
2008-12-11 18:38:29 +01:00
|
|
|
#include "file_dvd.h"
|
|
|
|
#include "file_fat.h"
|
2008-12-14 13:38:52 +01:00
|
|
|
#include "filesel.h"
|
2008-08-07 14:26:07 +02:00
|
|
|
|
2009-05-01 14:56:48 +02:00
|
|
|
#define BG_COLOR_MAX 15
|
2009-04-23 03:01:07 +02:00
|
|
|
|
|
|
|
/* various background colors */
|
|
|
|
static GXColor bg_colors[BG_COLOR_MAX]=
|
|
|
|
{
|
|
|
|
{0xd4,0xd0,0xc8,0xff}, /* cream */
|
2009-05-05 13:09:40 +02:00
|
|
|
{0xcc,0xcc,0xcc,0xff}, /* light grey */
|
|
|
|
{0x66,0x66,0x66,0xff}, /* faded grey */
|
2009-05-01 14:56:48 +02:00
|
|
|
{0x50,0x51,0x5b,0xff}, /* grey blue */
|
2009-04-23 03:01:07 +02:00
|
|
|
{0xb8,0xc7,0xda,0xff}, /* light blue */
|
|
|
|
{0xc0,0xcf,0xe7,0xff}, /* sky blue */
|
|
|
|
{0x98,0xb1,0xd8,0xff}, /* sea blue */
|
|
|
|
{0x7b,0x8c,0xa6,0xff}, /* violet */
|
|
|
|
{0xa9,0xc7,0xc6,0xff}, /* green blue */
|
|
|
|
{0x7d,0xa4,0x9f,0xff}, /* darker green blue */
|
|
|
|
{0x22,0x52,0x74,0xff}, /* dark blue */
|
|
|
|
{0x33,0x33,0x33,0xff}, /* dark grey */
|
2009-05-13 16:26:55 +02:00
|
|
|
{0x00,0x00,0x00,0xff}, /* black */
|
2009-05-05 13:09:40 +02:00
|
|
|
{0xd6,0xcb,0xba,0xff}, /* light gold */
|
2009-05-13 16:26:55 +02:00
|
|
|
{0xbb,0xb0,0x99,0xff} /* gold */
|
2009-04-23 03:01:07 +02:00
|
|
|
};
|
2009-03-15 20:11:01 +01:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
2009-04-20 00:31:08 +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},
|
|
|
|
{Ctrl_player_png,Ctrl_player_over_png}
|
|
|
|
};
|
|
|
|
|
|
|
|
static butn_data button_player_none_data =
|
|
|
|
{
|
|
|
|
{NULL,NULL},
|
|
|
|
{Ctrl_player_none_png,NULL}
|
|
|
|
};
|
|
|
|
|
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
|
|
|
/*****************************************************************************/
|
2009-04-20 00:31:08 +02:00
|
|
|
/* Generic GUI backgrounds */
|
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
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
{NULL,Bg_main_png,IMAGE_VISIBLE|IMAGE_FADE,146,80,348,288,255},
|
|
|
|
{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
|
|
|
{
|
2009-05-12 14:27:19 +02:00
|
|
|
{NULL,Bg_main_png,IMAGE_VISIBLE|IMAGE_FADE,146,80,348,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
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
{NULL,Bg_main_png,IMAGE_VISIBLE,356,144,348,288,255},
|
|
|
|
{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},
|
|
|
|
{NULL,Frame_s4_png,IMAGE_VISIBLE,38,72,316,168,128},
|
2009-05-12 14:27:19 +02:00
|
|
|
{NULL,Frame_s4_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
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
{NULL,Bg_main_png,IMAGE_VISIBLE,356,144,348,288,255},
|
|
|
|
{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},
|
|
|
|
{NULL,Frame_s1_png,IMAGE_VISIBLE,8,70,372,336,128}
|
2009-04-16 14:19:12 +02:00
|
|
|
};
|
|
|
|
|
2009-03-29 20:56:36 +02:00
|
|
|
/*****************************************************************************/
|
|
|
|
/* Menu Items description */
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
2009-05-01 14:56:48 +02:00
|
|
|
static gui_item items_main[9] =
|
2009-04-20 19:41:54 +02:00
|
|
|
{
|
2009-04-21 03:05:56 +02:00
|
|
|
{NULL,Main_quit_png ,"","",128, 84,52,80},
|
|
|
|
{NULL,Main_load_png ,"","",280, 72,80,92},
|
|
|
|
{NULL,Main_options_png ,"","",456, 76,60,88},
|
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},
|
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
|
|
|
};
|
|
|
|
|
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},
|
|
|
|
{NULL,NULL,"","",304, 0, 24, 0},
|
|
|
|
{NULL,NULL,"","",304, 0, 24, 0},
|
|
|
|
{NULL,NULL,"","",304, 0, 24, 0},
|
|
|
|
{NULL,NULL,"","",304, 0, 24, 0},
|
|
|
|
{NULL,NULL,"","",304, 0, 24, 0},
|
|
|
|
{NULL,NULL,"","",304, 0, 24, 0},
|
|
|
|
{NULL,NULL,"","",304, 0, 24, 0},
|
|
|
|
{NULL,NULL,"","",304, 0, 24, 0},
|
|
|
|
{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
|
|
|
};
|
|
|
|
|
2009-04-20 19:41:54 +02:00
|
|
|
#ifdef HW_RVL
|
|
|
|
static gui_item items_load[4] =
|
|
|
|
{
|
2009-05-06 16:47:22 +02:00
|
|
|
{NULL,Load_recent_png,"","Load recent ROM files (USB/SD)" ,276,120,88,96},
|
|
|
|
{NULL,Load_sd_png ,"","Load ROM files from SDCARD" ,110,266,88,96},
|
|
|
|
{NULL,Load_usb_png ,"","Load ROM files from USB device" ,276,266,88,96},
|
|
|
|
{NULL,Load_dvd_png ,"","Load ROM files from DVD" ,442,266,88,96}
|
2009-04-20 19:41:54 +02:00
|
|
|
};
|
|
|
|
#else
|
|
|
|
static gui_item items_load[3] =
|
|
|
|
{
|
2009-05-06 16:47:22 +02:00
|
|
|
{NULL,Load_recent_png,"","Load recent ROM files (SD)" ,110,198,88,96},
|
|
|
|
{NULL,Load_sd_png ,"","Load ROM files from SDCARD" ,276,198,88,96},
|
|
|
|
{NULL,Load_dvd_png ,"","Load ROM files from DVD" ,442,198,88,96}
|
2009-04-20 19:41:54 +02:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static gui_item items_options[5] =
|
|
|
|
{
|
2009-04-24 01:24:40 +02: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 ,"","Input settings", 192,286,88,92},
|
|
|
|
{NULL,Option_menu_png ,"","Menu settings", 370,286,60,92}
|
2009-04-20 19:41:54 +02:00
|
|
|
};
|
|
|
|
|
2009-03-29 20:56:36 +02:00
|
|
|
/* Audio options menu */
|
2009-07-30 09:15:54 +02:00
|
|
|
static gui_item items_audio[10] =
|
2009-03-15 20:11:01 +01:00
|
|
|
{
|
2009-05-26 18:40:35 +02:00
|
|
|
{NULL,NULL,"High-Quality FM: LINEAR", "Setup YM2612 resampling", 52,132,276,48},
|
2009-05-27 16:07:14 +02:00
|
|
|
{NULL,NULL,"PSG Noise Boost: OFF", "Boost PSG Noise Channel", 52,132,276,48},
|
2009-05-26 18:40:35 +02:00
|
|
|
{NULL,NULL,"PSG Volume: 2.50", "Adjust SN76489 output level", 52,132,276,48},
|
|
|
|
{NULL,NULL,"FM Volume: 1.00", "Adjust YM2612 output level", 52,132,276,48},
|
2009-06-17 09:58:56 +02:00
|
|
|
{NULL,NULL,"Filtering: 3-BAND EQ", "Setup Audio filtering", 52,132,276,48},
|
2009-07-30 09:15:54 +02:00
|
|
|
{NULL,NULL,"Low Gain: 1.00", "Adjust EQ Low Band Gain", 52,132,276,48},
|
2009-08-11 10:18:46 +02:00
|
|
|
{NULL,NULL,"Mid Gain: 1.00", "Adjust EQ Middle Band Gain", 52,132,276,48},
|
2009-07-30 09:15:54 +02:00
|
|
|
{NULL,NULL,"High Gain: 1.00", "Adjust EQ High BandGain", 52,132,276,48},
|
2009-08-11 10:18:46 +02:00
|
|
|
{NULL,NULL,"Low Freq: 200 Hz", "Adjust EQ Low Band Frequency", 52,132,276,48},
|
|
|
|
{NULL,NULL,"High Freq: 20000 Hz", "Adjust EQ High Band Frequency",52,132,276,48}
|
2009-03-15 20:11:01 +01:00
|
|
|
};
|
|
|
|
|
2009-03-29 20:56:36 +02:00
|
|
|
/* System options menu */
|
2009-07-29 17:34:25 +02:00
|
|
|
static gui_item items_system[6] =
|
2009-03-15 20:11:01 +01:00
|
|
|
{
|
2009-06-17 09:58:56 +02:00
|
|
|
{NULL,NULL,"Console Region: AUTO", "Select system region", 52,132,276,48},
|
|
|
|
{NULL,NULL,"System Lockups: OFF", "Enable/disable original system lock-ups", 52,132,276,48},
|
|
|
|
{NULL,NULL,"68k Address Error: ON", "Enable/disable 68k Address Error", 52,132,276,48},
|
|
|
|
{NULL,NULL,"System BIOS: OFF", "Enable/disable TMSS BIOS support", 52,132,276,48},
|
2009-07-29 17:34:25 +02:00
|
|
|
{NULL,NULL,"Lock-on: OFF", "Select Lock-On cartridge type", 52,132,276,48},
|
2009-06-17 09:58:56 +02:00
|
|
|
{NULL,NULL,"SVP Cycles: 1500", "Adjust SVP chip emulation speed", 52,132,276,48}
|
2009-03-15 20:11:01 +01:00
|
|
|
};
|
|
|
|
|
2009-03-29 20:56:36 +02:00
|
|
|
/* Video options menu */
|
2009-03-15 20:11:01 +01:00
|
|
|
static gui_item items_video[8] =
|
|
|
|
{
|
2009-05-02 17:00:13 +02:00
|
|
|
{NULL,NULL,"Display: PROGRESSIVE", "Select video mode type", 52,132,276,48},
|
|
|
|
{NULL,NULL,"TV mode: 50/60Hz", "Select video refresh rate", 52,132,276,48},
|
|
|
|
{NULL,NULL,"Bilinear Filter: OFF", "Enable/disable hardware filtering", 52,132,276,48},
|
|
|
|
{NULL,NULL,"NTSC Filter: COMPOSITE","Enable/disable NTSC software filtering", 52,132,276,48},
|
|
|
|
{NULL,NULL,"Borders: OFF", "Enable/disable original overscan emulation",52,132,276,48},
|
2009-05-14 14:32:20 +02:00
|
|
|
{NULL,NULL,"Aspect: ORIGINAL (4:3)","Select display aspect ratio", 52,132,276,48},
|
2009-05-02 17:00:13 +02:00
|
|
|
{NULL,NULL,"DISPLAY POSITION", "Adjust display position", 52,132,276,48},
|
|
|
|
{NULL,NULL,"DISPLAY SIZE", "Adjust display size", 52,132,276,48}
|
2009-03-15 20:11:01 +01:00
|
|
|
};
|
|
|
|
|
2009-04-23 03:01:07 +02:00
|
|
|
/* Preferences menu */
|
2009-05-26 15:14:33 +02:00
|
|
|
static gui_item items_prefs[7] =
|
2009-04-23 03:01:07 +02:00
|
|
|
{
|
2009-05-26 15:14:33 +02:00
|
|
|
{NULL,NULL,"Auto SRAM: OFF", "Enable/disable automatic SRAM", 52,132,276,48},
|
|
|
|
{NULL,NULL,"Auto STATE: OFF", "Enable/disable automatic Savestate", 52,132,276,48},
|
|
|
|
{NULL,NULL,"SFX Volume: 100", "Adjust sound effects volume", 52,132,276,48},
|
|
|
|
{NULL,NULL,"BGM Volume: 100", "Adjust background music volume", 52,132,276,48},
|
|
|
|
{NULL,NULL,"BG Color: DEFAULT", "Change background color", 52,132,276,48},
|
|
|
|
{NULL,NULL,"Screen Width: 658", "Adjust Screen Width", 52,132,276,48},
|
|
|
|
{NULL,NULL,"Confirmation Box: OFF", "Enable/disable user confirmation", 52,132,276,48}
|
2009-04-23 03:01:07 +02:00
|
|
|
};
|
|
|
|
|
2009-03-15 20:11:01 +01:00
|
|
|
/*****************************************************************************/
|
|
|
|
/* Menu Buttons description */
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
2009-04-20 00:31:08 +02:00
|
|
|
/* Generic Buttons for list menu */
|
2009-05-02 17:00:13 +02:00
|
|
|
static gui_butn arrow_up = {&arrow_up_data,BUTTON_OVER_SFX,{0,0,0,0},14,76,360,32};
|
|
|
|
static gui_butn arrow_down = {&arrow_down_data,BUTTON_VISIBLE|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
|
|
|
{
|
2009-05-25 09:46:19 +02:00
|
|
|
{&button_text_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{1,1,0,0},52,132,276,48},
|
|
|
|
{&button_text_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{1,1,0,0},52,188,276,48},
|
|
|
|
{&button_text_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{1,1,0,0},52,244,276,48},
|
|
|
|
{&button_text_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{1,1,0,0},52,300,276,48}
|
2009-04-20 00:31:08 +02:00
|
|
|
};
|
2009-03-15 20:11:01 +01:00
|
|
|
|
2009-03-29 20:56:36 +02:00
|
|
|
/* Main menu */
|
2009-05-01 14:56:48 +02:00
|
|
|
static gui_butn buttons_main[9] =
|
2009-03-15 20:11:01 +01:00
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,3,0,1}, 80, 50,148,132},
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,3,1,1},246, 50,148,132},
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,3,1,1},412, 50,148,132},
|
2009-05-12 14:27:19 +02:00
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX ,{3,0,1,1}, 80,194,148,132},
|
2009-05-04 23:43:16 +02:00
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX ,{3,0,1,1},246,194,148,132},
|
2009-05-12 14:27:19 +02:00
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX ,{3,0,1,0},412,194,148,132},
|
2009-05-23 19:29:53 +02:00
|
|
|
{NULL , BUTTON_FADE|BUTTON_OVER_SFX ,{3,0,1,1}, 10,372, 84, 32},
|
|
|
|
{NULL , BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{2,1,1,1},546,334, 84, 32},
|
|
|
|
{NULL , BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,0,1,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
|
|
|
#ifdef HW_RVL
|
|
|
|
static gui_butn buttons_load[4] =
|
|
|
|
{
|
2009-05-12 14:27:19 +02:00
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,2,0,1},246,102,148,132},
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,0,1,1}, 80,248,148,132},
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{2,0,1,1},246,248,148,132},
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{3,0,1,0},412,248,148,132}
|
2009-03-30 09:05:34 +02:00
|
|
|
};
|
2009-03-15 20:11:01 +01:00
|
|
|
#else
|
|
|
|
static gui_butn buttons_load[3] =
|
|
|
|
{
|
2009-05-12 14:27:19 +02:00
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,0,0,1}, 80,180,148,132},
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,0,1,1},246,180,148,132},
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,0,1,0},412,180,148,132}
|
2009-03-15 20:11:01 +01:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2009-03-29 20:56:36 +02:00
|
|
|
/* Options menu */
|
2009-03-15 20:11:01 +01:00
|
|
|
static gui_butn buttons_options[5] =
|
|
|
|
{
|
2009-05-12 14:27:19 +02:00
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,3,0,1}, 80,120,148,132},
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,3,1,1},246,120,148,132},
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,2,1,1},412,120,148,132},
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{3,0,1,1},162,264,148,132},
|
|
|
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{2,0,1,0},330,264,148,132}
|
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,
|
2009-05-01 14:56:48 +02:00
|
|
|
9,9,4,
|
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},
|
2009-04-20 00:31:08 +02:00
|
|
|
{NULL,NULL},
|
|
|
|
FALSE
|
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-05-04 23:43:16 +02:00
|
|
|
13,13,8,
|
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},
|
2009-05-02 17:00:13 +02:00
|
|
|
{NULL,NULL},
|
|
|
|
FALSE
|
|
|
|
};
|
|
|
|
|
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-04-20 00:31:08 +02:00
|
|
|
4,4,5,
|
2009-03-15 20:11:01 +01:00
|
|
|
#else
|
2009-04-20 00:31:08 +02:00
|
|
|
3,3,5,
|
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},
|
2009-04-20 00:31:08 +02:00
|
|
|
{NULL,NULL},
|
|
|
|
FALSE
|
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,
|
|
|
|
5,5,5,
|
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},
|
2009-04-20 00:31:08 +02:00
|
|
|
{NULL,NULL},
|
|
|
|
FALSE
|
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-07-29 17:34:25 +02:00
|
|
|
6,4,6,
|
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},
|
2009-06-17 09:58:56 +02:00
|
|
|
{&arrow_up,&arrow_down},
|
2009-04-20 00:31:08 +02:00
|
|
|
FALSE
|
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,
|
|
|
|
8,4,6,
|
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},
|
2009-04-20 00:31:08 +02:00
|
|
|
{&arrow_up,&arrow_down},
|
|
|
|
FALSE
|
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,
|
2009-07-30 09:15:54 +02:00
|
|
|
10,4,6,
|
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},
|
2009-04-20 00:31:08 +02:00
|
|
|
{&arrow_up,&arrow_down},
|
|
|
|
FALSE
|
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,
|
2009-05-26 15:14:33 +02:00
|
|
|
7,4,6,
|
2009-04-23 03:01:07 +02:00
|
|
|
items_prefs,
|
|
|
|
buttons_list,
|
|
|
|
bg_list,
|
|
|
|
{&action_cancel, &action_select},
|
|
|
|
{&arrow_up,&arrow_down},
|
|
|
|
FALSE
|
|
|
|
};
|
|
|
|
|
2009-04-24 01:24:40 +02:00
|
|
|
|
2009-03-15 20:11:01 +01:00
|
|
|
/***************************************************************************
|
2009-04-15 17:33:51 +02:00
|
|
|
* drawmenu (deprecated)
|
2009-03-15 20:11:01 +01:00
|
|
|
*
|
|
|
|
* As it says, simply draws the menu with a highlight on the currently
|
|
|
|
* selected item :)
|
|
|
|
***************************************************************************/
|
|
|
|
char menutitle[60] = { "" };
|
2009-03-30 09:05:34 +02:00
|
|
|
static int menu = 0;
|
2009-03-15 20:11:01 +01:00
|
|
|
|
2009-03-30 09:05:34 +02:00
|
|
|
static void drawmenu (char items[][25], int maxitems, int selected)
|
2008-08-07 14:26:07 +02:00
|
|
|
{
|
2009-03-15 20:11:01 +01:00
|
|
|
|
2008-08-07 14:26:07 +02:00
|
|
|
int i;
|
|
|
|
int ypos;
|
|
|
|
|
2009-02-22 20:57:41 +01:00
|
|
|
ypos = (226 - (fheight * maxitems)) >> 1;
|
2008-08-07 14:26:07 +02:00
|
|
|
ypos += 130;
|
|
|
|
|
2009-02-26 18:24:53 +01:00
|
|
|
/* reset texture data */
|
2009-04-15 17:33:51 +02:00
|
|
|
gx_texture *texture;
|
|
|
|
memset(&texture,0,sizeof(gx_texture));
|
2009-02-22 20:57:41 +01:00
|
|
|
|
2009-02-26 18:24:53 +01:00
|
|
|
/* draw background items */
|
2009-04-23 03:01:07 +02:00
|
|
|
gxClearScreen (bg_colors[config.bg_color]);
|
2009-05-01 14:56:48 +02:00
|
|
|
texture= gxTextureOpenPNG(Bg_main_png,0);
|
2009-03-30 15:08:01 +02:00
|
|
|
if (texture)
|
|
|
|
{
|
2009-04-15 17:33:51 +02:00
|
|
|
gxDrawTexture(texture, (640-texture->width)/2, (480-texture->height)/2, texture->width, texture->height,255);
|
2009-03-30 15:08:01 +02:00
|
|
|
if (texture->data) free(texture->data);
|
|
|
|
free(texture);
|
|
|
|
}
|
2009-05-01 14:56:48 +02:00
|
|
|
texture= gxTextureOpenPNG(Banner_bottom_png,0);
|
2009-03-30 15:08:01 +02:00
|
|
|
if (texture)
|
|
|
|
{
|
2009-04-15 17:33:51 +02:00
|
|
|
gxDrawTexture(texture, 0, 480-texture->height, texture->width, texture->height, 255);
|
2009-03-30 15:08:01 +02:00
|
|
|
if (texture->data) free(texture->data);
|
|
|
|
free(texture);
|
|
|
|
}
|
2009-05-01 14:56:48 +02:00
|
|
|
texture= gxTextureOpenPNG(Banner_top_png,0);
|
2009-03-30 15:08:01 +02:00
|
|
|
if (texture)
|
|
|
|
{
|
2009-04-15 17:33:51 +02:00
|
|
|
gxDrawTexture(texture, 0, 0, texture->width, texture->height, 255);
|
2009-03-30 15:08:01 +02:00
|
|
|
if (texture->data) free(texture->data);
|
|
|
|
free(texture);
|
|
|
|
}
|
2009-05-01 14:56:48 +02:00
|
|
|
texture= gxTextureOpenPNG(Main_logo_png,0);
|
2009-03-30 15:08:01 +02:00
|
|
|
if (texture)
|
|
|
|
{
|
2009-04-15 17:33:51 +02:00
|
|
|
gxDrawTexture(texture, 444, 28, 176, 48, 255);
|
2009-03-30 15:08:01 +02:00
|
|
|
if (texture->data) free(texture->data);
|
|
|
|
free(texture);
|
|
|
|
}
|
2009-02-26 18:24:53 +01:00
|
|
|
|
2008-08-07 14:26:07 +02:00
|
|
|
for (i = 0; i < maxitems; i++)
|
|
|
|
{
|
2009-03-30 09:05:34 +02:00
|
|
|
if (i == selected) WriteCentre_HL (i * fheight + ypos, (char *) items[i]);
|
|
|
|
else WriteCentre (i * fheight + ypos, (char *) items[i]);
|
2009-02-26 18:24:53 +01:00
|
|
|
}
|
2008-08-07 14:26:07 +02:00
|
|
|
|
2009-05-19 18:14:43 +02:00
|
|
|
gxSetScreen();
|
2008-08-07 14:26:07 +02:00
|
|
|
}
|
|
|
|
|
2009-03-30 09:05:34 +02:00
|
|
|
static int domenu (char items[][25], int maxitems, u8 fastmove)
|
2008-08-07 14:26:07 +02:00
|
|
|
{
|
|
|
|
int redraw = 1;
|
|
|
|
int quit = 0;
|
|
|
|
short p;
|
|
|
|
int ret = 0;
|
|
|
|
|
2009-03-15 20:11:01 +01:00
|
|
|
|
2008-08-07 14:26:07 +02:00
|
|
|
while (quit == 0)
|
|
|
|
{
|
|
|
|
if (redraw)
|
|
|
|
{
|
|
|
|
drawmenu (&items[0], maxitems, menu);
|
|
|
|
redraw = 0;
|
|
|
|
}
|
|
|
|
|
2009-04-15 17:33:51 +02:00
|
|
|
p = m_input.keys;
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
|
|
if (p & PAD_BUTTON_UP)
|
|
|
|
{
|
|
|
|
redraw = 1;
|
|
|
|
menu--;
|
|
|
|
if (menu < 0) menu = maxitems - 1;
|
|
|
|
}
|
|
|
|
else if (p & PAD_BUTTON_DOWN)
|
|
|
|
{
|
|
|
|
redraw = 1;
|
|
|
|
menu++;
|
|
|
|
if (menu == maxitems) menu = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (p & PAD_BUTTON_A)
|
|
|
|
{
|
|
|
|
quit = 1;
|
|
|
|
ret = menu;
|
|
|
|
}
|
|
|
|
else if (p & PAD_BUTTON_B)
|
|
|
|
{
|
|
|
|
quit = 1;
|
|
|
|
ret = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fastmove)
|
|
|
|
{
|
|
|
|
if (p & PAD_BUTTON_RIGHT)
|
|
|
|
{
|
|
|
|
quit = 1;
|
|
|
|
ret = menu;
|
|
|
|
}
|
|
|
|
else if (p & PAD_BUTTON_LEFT)
|
|
|
|
{
|
|
|
|
quit = 1;
|
|
|
|
ret = 0 - 2 - menu;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
|
2009-05-01 14:56:48 +02:00
|
|
|
if (config.sram_auto == 0) sprintf (items[0].text, "SRAM Auto: FAT");
|
|
|
|
else if (config.sram_auto == 1) sprintf (items[0].text, "SRAM Auto: MCARD A");
|
|
|
|
else if (config.sram_auto == 2) sprintf (items[0].text, "SRAM Auto: MCARD B");
|
|
|
|
else sprintf (items[0].text, "SRAM Auto: OFF");
|
|
|
|
if (config.state_auto == 0) sprintf (items[1].text, "Savestate Auto: FAT");
|
|
|
|
else if (config.state_auto == 1) sprintf (items[1].text, "Savestate Auto: MCARD A");
|
|
|
|
else if (config.state_auto == 2) sprintf (items[1].text, "Savestate Auto: MCARD B");
|
|
|
|
else sprintf (items[1].text, "Savestate Auto: OFF");
|
|
|
|
sprintf (items[2].text, "SFX Volume: %1.1f", config.sfx_volume);
|
|
|
|
sprintf (items[3].text, "BGM Volume: %1.1f", config.bgm_volume);
|
|
|
|
if (config.bg_color) sprintf (items[4].text, "BG Color: Type %d", config.bg_color);
|
|
|
|
else sprintf (items[4].text, "BG Color: DEFAULT");
|
2009-05-14 18:13:19 +02:00
|
|
|
sprintf (items[5].text, "Screen Width: %d", config.screen_w);
|
2009-05-26 15:14:33 +02:00
|
|
|
sprintf (items[6].text, "Confirmation Box: %s",config.ask_confirm ? "ON":"OFF");
|
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)
|
|
|
|
{
|
|
|
|
case 0: /*** SRAM auto load/save ***/
|
|
|
|
config.sram_auto ++;
|
|
|
|
if (config.sram_auto > 2) config.sram_auto = -1;
|
2009-05-01 14:56:48 +02:00
|
|
|
if (config.sram_auto == 0) sprintf (items[0].text, "SRAM Auto: FAT");
|
|
|
|
else if (config.sram_auto == 1) sprintf (items[0].text, "SRAM Auto: MCARD A");
|
|
|
|
else if (config.sram_auto == 2) sprintf (items[0].text, "SRAM Auto: MCARD B");
|
|
|
|
else sprintf (items[0].text, "SRAM Auto: OFF");
|
2009-04-23 03:01:07 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 1: /*** Savestate auto load/save ***/
|
|
|
|
config.state_auto ++;
|
|
|
|
if (config.state_auto > 2) config.state_auto = -1;
|
2009-05-01 14:56:48 +02:00
|
|
|
if (config.state_auto == 0) sprintf (items[1].text, "Savestate Auto: FAT");
|
|
|
|
else if (config.state_auto == 1) sprintf (items[1].text, "Savestate Auto: MCARD A");
|
|
|
|
else if (config.state_auto == 2) sprintf (items[1].text, "Savestate Auto: MCARD B");
|
|
|
|
else sprintf (items[1].text, "Savestate Auto: OFF");
|
2009-04-23 03:01:07 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 2: /*** 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);
|
2009-05-01 14:56:48 +02:00
|
|
|
sprintf (items[2].text, "SFX Volume: %1.1f", config.sfx_volume);
|
2009-04-23 03:01:07 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 3: /*** 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);
|
2009-05-01 14:56:48 +02:00
|
|
|
sprintf (items[3].text, "BGM Volume: %1.1f", config.bgm_volume);
|
2009-04-23 03:01:07 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 4: /*** Background color ***/
|
|
|
|
if (ret < 0) config.bg_color --;
|
|
|
|
else config.bg_color ++;
|
|
|
|
if (config.bg_color < 0) config.bg_color = BG_COLOR_MAX - 1;
|
2009-05-14 18:13:19 +02:00
|
|
|
else if (config.bg_color >= BG_COLOR_MAX) config.bg_color = 0;
|
2009-05-01 14:56:48 +02:00
|
|
|
if (config.bg_color) sprintf (items[4].text, "BG Color: Type %d", config.bg_color);
|
|
|
|
else sprintf (items[4].text, "BG Color: DEFAULT");
|
2009-05-13 16:26:55 +02:00
|
|
|
GUI_SetBgColor(bg_colors[config.bg_color]);
|
2009-04-23 03:01:07 +02:00
|
|
|
break;
|
|
|
|
|
2009-05-14 18:13:19 +02:00
|
|
|
case 5:
|
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);
|
2009-05-19 18:14:43 +02:00
|
|
|
sprintf (items[5].text, "Screen Width: %d", config.screen_w);
|
2009-05-14 18:13:19 +02:00
|
|
|
break;
|
|
|
|
|
2009-05-26 15:14:33 +02:00
|
|
|
case 6:
|
|
|
|
config.ask_confirm ^= 1;
|
|
|
|
sprintf (items[6].text, "Confirmation Box: %s",config.ask_confirm ? "ON":"OFF");
|
|
|
|
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
|
|
|
*
|
|
|
|
****************************************************************************/
|
2009-03-30 09:05:34 +02:00
|
|
|
static void soundmenu ()
|
2008-08-07 14:26:07 +02:00
|
|
|
{
|
2009-03-30 09:05:34 +02:00
|
|
|
int ret, quit = 0;
|
|
|
|
gui_menu *m = &menu_audio;
|
|
|
|
gui_item *items = m->items;
|
2009-08-11 10:18:46 +02:00
|
|
|
float psg_volume = (float)config.psg_preamp/100.0;
|
|
|
|
float fm_volume = (float)config.fm_preamp/100.0;
|
2009-03-30 09:05:34 +02:00
|
|
|
|
2009-07-22 19:25:41 +02:00
|
|
|
sprintf (items[0].text, "High-Quality FM: %s", config.hq_fm ? "ON":"OFF");
|
2009-05-27 16:07:14 +02:00
|
|
|
sprintf (items[1].text, "PSG Noise Boost: %s", config.psgBoostNoise ? "ON":"OFF");
|
|
|
|
sprintf (items[2].text, "PSG Volume: %1.2f", psg_volume);
|
|
|
|
sprintf (items[3].text, "FM Volume: %1.2f", (double)config.fm_preamp/100.0);
|
|
|
|
if (config.filter == 2) sprintf (items[4].text, "Filtering: 3-BAND EQ");
|
|
|
|
else if (config.filter == 1) sprintf (items[4].text, "Filtering: LOW PASS");
|
|
|
|
else sprintf (items[4].text, "Filtering: OFF");
|
2009-08-11 10:18:46 +02:00
|
|
|
if (config.filter == 2)
|
|
|
|
{
|
|
|
|
sprintf (items[5].text, "Low Gain: %1.2f", config.lg);
|
|
|
|
strcpy (items[5].comment, "Adjust EQ Low Band Gain");
|
|
|
|
sprintf (items[6].text, "Middle Gain: %1.2f", config.mg);
|
|
|
|
sprintf (items[7].text, "High Gain: %1.2f", config.hg);
|
|
|
|
sprintf (items[8].text, "Low Freq: %d", config.low_freq);
|
|
|
|
sprintf (items[9].text, "High Freq: %d", config.high_freq);
|
|
|
|
}
|
|
|
|
else if (config.filter == 1)
|
|
|
|
{
|
|
|
|
sprintf (items[5].text, "Low-Pass Rate: %d %%", config.lp_range);
|
|
|
|
strcpy (items[5].comment, "Adjust Low Pass filter");
|
|
|
|
}
|
2009-05-01 14:56:48 +02:00
|
|
|
|
2009-04-20 00:31:08 +02:00
|
|
|
GUI_InitMenu(m);
|
2009-05-26 18:40:35 +02:00
|
|
|
|
2009-08-11 10:18:46 +02:00
|
|
|
if (config.filter == 1)
|
|
|
|
m->max_items = 6;
|
|
|
|
else if (config.filter == 2)
|
2009-07-30 09:15:54 +02:00
|
|
|
m->max_items = 10;
|
2009-08-11 10:18:46 +02:00
|
|
|
else
|
|
|
|
m->max_items = 5;
|
2009-05-26 18:40:35 +02:00
|
|
|
|
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);
|
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
switch (ret)
|
|
|
|
{
|
|
|
|
case 0:
|
2009-07-22 19:25:41 +02:00
|
|
|
config.hq_fm ^= 1;
|
|
|
|
sprintf (items[0].text, "High-Quality FM: %s", config.hq_fm ? "ON":"OFF");
|
2009-08-06 20:31:05 +02:00
|
|
|
if (cart.romsize)
|
2008-12-10 19:16:30 +01:00
|
|
|
{
|
2009-05-01 14:56:48 +02:00
|
|
|
unsigned char *temp = memalign(32,YM2612GetContextSize());
|
2009-04-15 17:33:51 +02:00
|
|
|
if (temp) memcpy(temp, YM2612GetContextPtr(), YM2612GetContextSize());
|
2008-12-10 19:16:30 +01:00
|
|
|
audio_init(48000);
|
2009-04-15 17:33:51 +02:00
|
|
|
if (temp)
|
|
|
|
{
|
|
|
|
YM2612Restore(temp);
|
|
|
|
free(temp);
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-05-26 18:40:35 +02:00
|
|
|
case 1:
|
2009-05-27 16:07:14 +02:00
|
|
|
config.psgBoostNoise ^= 1;
|
|
|
|
sprintf (items[1].text, "PSG Noise Boost: %s", config.psgBoostNoise ? "ON":"OFF");
|
|
|
|
SN76489_BoostNoise(config.psgBoostNoise);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
2009-05-26 18:40:35 +02:00
|
|
|
GUI_OptionBox(m,0,"PSG Volume",(void *)&psg_volume,0.01,0.0,5.0,0);
|
2009-05-27 16:07:14 +02:00
|
|
|
sprintf (items[2].text, "PSG Volume: %1.2f", psg_volume);
|
2009-05-26 18:40:35 +02:00
|
|
|
config.psg_preamp = (int)(psg_volume * 100.0);
|
|
|
|
break;
|
|
|
|
|
2009-05-27 16:07:14 +02:00
|
|
|
case 3:
|
2009-05-26 18:40:35 +02:00
|
|
|
GUI_OptionBox(m,0,"FM Volume",(void *)&fm_volume,0.01,0.0,5.0,0);
|
2009-08-11 10:18:46 +02:00
|
|
|
sprintf (items[3].text, "FM Volume: %1.2f", fm_volume);
|
2009-05-26 18:40:35 +02:00
|
|
|
config.fm_preamp = (int)(fm_volume * 100.0);
|
|
|
|
break;
|
|
|
|
|
2009-05-27 16:07:14 +02:00
|
|
|
case 4:
|
2009-05-26 18:40:35 +02:00
|
|
|
config.filter ++;
|
|
|
|
if (config.filter > 2) config.filter = 0;
|
|
|
|
if (config.filter == 2)
|
2009-08-11 10:18:46 +02:00
|
|
|
{
|
|
|
|
m->max_items = 10;
|
2009-05-27 16:07:14 +02:00
|
|
|
sprintf (items[4].text, "Filtering: 3-BAND EQ");
|
2009-08-11 10:18:46 +02:00
|
|
|
sprintf (items[5].text, "Low Gain: %1.2f", config.lg);
|
|
|
|
strcpy (items[5].comment, "Adjust EQ Low Band Gain");
|
|
|
|
sprintf (items[6].text, "Middle Gain: %1.2f", config.mg);
|
|
|
|
sprintf (items[7].text, "High Gain: %1.2f", config.hg);
|
|
|
|
sprintf (items[8].text, "Low Freq: %d", config.low_freq);
|
|
|
|
sprintf (items[9].text, "High Freq: %d", config.high_freq);
|
|
|
|
}
|
2009-05-26 18:40:35 +02:00
|
|
|
else if (config.filter == 1)
|
2009-08-11 10:18:46 +02:00
|
|
|
{
|
|
|
|
m->max_items = 6;
|
2009-05-27 16:07:14 +02:00
|
|
|
sprintf (items[4].text, "Filtering: LOW PASS");
|
2009-08-11 10:18:46 +02:00
|
|
|
sprintf (items[5].text, "Low-Pass Rate: %d %%", config.lp_range);
|
|
|
|
strcpy (items[5].comment, "Adjust Low Pass filter");
|
|
|
|
}
|
2009-05-26 18:40:35 +02:00
|
|
|
else
|
2009-08-11 10:18:46 +02:00
|
|
|
{
|
2009-05-27 16:07:14 +02:00
|
|
|
sprintf (items[4].text, "Filtering: OFF");
|
2009-08-11 10:18:46 +02:00
|
|
|
m->max_items = 5;
|
|
|
|
m->offset = 1;
|
|
|
|
m->selected = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* reintialize EQ */
|
|
|
|
audio_set_equalizer();
|
2009-05-26 18:40:35 +02:00
|
|
|
|
2009-08-11 10:18:46 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 5:
|
|
|
|
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);
|
|
|
|
sprintf (items[5].text, "Low-Pass Rate: %d %%", config.lp_range);
|
2009-05-26 18:40:35 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-08-11 10:18:46 +02:00
|
|
|
GUI_OptionBox(m,0,"Low Gain",(void *)&config.lg,0.01,0.0,2.0,0);
|
|
|
|
sprintf (items[5].text, "Low Gain: %1.2f", config.lg);
|
2009-07-30 09:15:54 +02:00
|
|
|
audio_set_equalizer();
|
2009-05-26 18:40:35 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-05-27 16:07:14 +02:00
|
|
|
case 6:
|
2009-08-11 10:18:46 +02:00
|
|
|
GUI_OptionBox(m,0,"Middle Gain",(void *)&config.mg,0.01,0.0,2.0,0);
|
|
|
|
sprintf (items[6].text, "Middle Gain: %1.2f", config.mg);
|
2009-05-26 18:40:35 +02:00
|
|
|
audio_set_equalizer();
|
|
|
|
break;
|
|
|
|
|
2009-05-27 16:07:14 +02:00
|
|
|
case 7:
|
2009-08-11 10:18:46 +02:00
|
|
|
GUI_OptionBox(m,0,"High Gain",(void *)&config.hg,0.01,0.0,2.0,0);
|
|
|
|
sprintf (items[7].text, "High Gain: %1.2f", config.hg);
|
2009-07-30 09:15:54 +02:00
|
|
|
audio_set_equalizer();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 8:
|
2009-08-11 10:18:46 +02:00
|
|
|
GUI_OptionBox(m,0,"Low Frequency",(void *)&config.low_freq,10,0,config.high_freq,1);
|
|
|
|
sprintf (items[8].text, "Low Freq: %d", config.low_freq);
|
2009-07-30 09:15:54 +02:00
|
|
|
audio_set_equalizer();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 9:
|
2009-08-11 10:18:46 +02:00
|
|
|
GUI_OptionBox(m,0,"High Frequency",(void *)&config.high_freq,100,config.low_freq,30000,1);
|
|
|
|
sprintf (items[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
|
|
|
|
2009-05-27 16:07:14 +02:00
|
|
|
m->max_items = 8;
|
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
|
|
|
{
|
2009-04-20 00:31:08 +02:00
|
|
|
int ret = 255;
|
|
|
|
int quit = 0;
|
2009-03-30 09:05:34 +02:00
|
|
|
gui_menu *m = &menu_system;
|
|
|
|
gui_item *items = m->items;
|
|
|
|
|
2009-05-01 14:56:48 +02:00
|
|
|
if (config.region_detect == 0) sprintf (items[0].text, "Console Region: AUTO");
|
|
|
|
else if (config.region_detect == 1) sprintf (items[0].text, "Console Region: USA");
|
|
|
|
else if (config.region_detect == 2) sprintf (items[0].text, "Console Region: EUR");
|
|
|
|
else if (config.region_detect == 3) sprintf (items[0].text, "Console Region: JAP");
|
|
|
|
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");
|
|
|
|
sprintf (items[3].text, "System BIOS: %s", (config.bios_enabled & 1) ? "ON":"OFF");
|
2009-08-06 20:31:05 +02: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) sprintf (items[4].text, "Lock-On: SONIC & KNUCKLES");
|
2009-07-29 17:34:25 +02:00
|
|
|
else sprintf (items[4].text, "Lock-On: OFF");
|
2009-06-17 09:58:56 +02:00
|
|
|
|
|
|
|
if (svp)
|
|
|
|
{
|
2009-07-29 17:34:25 +02:00
|
|
|
sprintf (items[5].text, "SVP Cycles: %d", SVP_cycles);
|
|
|
|
m->max_items = 6;
|
2009-06-17 09:58:56 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-07-29 17:34:25 +02:00
|
|
|
m->max_items = 5;
|
|
|
|
if (m->offset > 1) m->offset =1;
|
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)
|
|
|
|
{
|
|
|
|
case 0: /*** Region Force ***/
|
|
|
|
config.region_detect = (config.region_detect + 1) % 4;
|
2009-05-01 14:56:48 +02:00
|
|
|
if (config.region_detect == 0) sprintf (items[0].text, "Console Region: AUTO");
|
|
|
|
else if (config.region_detect == 1) sprintf (items[0].text, "Console Region: USA");
|
|
|
|
else if (config.region_detect == 2) sprintf (items[0].text, "Console Region: EUR");
|
|
|
|
else if (config.region_detect == 3) sprintf (items[0].text, "Console Region: JAP");
|
2009-08-06 20:31:05 +02:00
|
|
|
if (cart.romsize)
|
2008-12-10 19:16:30 +01:00
|
|
|
{
|
|
|
|
/* force region & cpu mode */
|
|
|
|
set_region();
|
2009-07-30 09:15:54 +02:00
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
/* reinitialize timings */
|
|
|
|
system_init ();
|
2009-10-04 20:24:29 +02:00
|
|
|
memfile_autoload(config.sram_auto,-1);
|
2009-05-01 14:56:48 +02:00
|
|
|
unsigned char *temp = memalign(32,YM2612GetContextSize());
|
2009-02-28 18:49:31 +01:00
|
|
|
if (temp) memcpy(temp, YM2612GetContextPtr(), YM2612GetContextSize());
|
2008-12-10 19:16:30 +01:00
|
|
|
audio_init(48000);
|
2009-05-01 14:56:48 +02:00
|
|
|
if (temp)
|
|
|
|
{
|
|
|
|
YM2612Restore(temp);
|
|
|
|
free(temp);
|
|
|
|
}
|
2009-02-28 18:49:31 +01:00
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
/* reinitialize HVC tables */
|
|
|
|
vctab = (vdp_pal) ? ((reg[1] & 8) ? vc_pal_240 : vc_pal_224) : vc_ntsc_224;
|
|
|
|
hctab = (reg[12] & 1) ? cycle2hc40 : cycle2hc32;
|
|
|
|
|
|
|
|
/* reinitialize overscan area */
|
2009-05-19 18:14:43 +02:00
|
|
|
bitmap.viewport.x = config.overscan ? 14 : 0;
|
2008-12-10 19:16:30 +01:00
|
|
|
bitmap.viewport.y = config.overscan ? (((reg[1] & 8) ? 0 : 8) + (vdp_pal ? 24 : 0)) : 0;
|
|
|
|
}
|
|
|
|
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 ***/
|
2008-08-07 14:26:07 +02:00
|
|
|
config.bios_enabled ^= 1;
|
2009-06-17 09:58:56 +02:00
|
|
|
sprintf (items[3].text, "System BIOS: %s", (config.bios_enabled & 1) ? "ON":"OFF");
|
2009-08-06 20:31:05 +02:00
|
|
|
if (cart.romsize)
|
2008-11-13 08:24:30 +01:00
|
|
|
{
|
2009-01-09 18:11:42 +01:00
|
|
|
system_init ();
|
2008-11-13 08:24:30 +01:00
|
|
|
system_reset ();
|
2009-10-04 20:24:29 +02:00
|
|
|
memfile_autoload(config.sram_auto,-1);
|
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-08-06 20:31:05 +02: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) sprintf (items[4].text, "Lock-On: SONIC & KNUCKLES");
|
2009-08-02 22:41:46 +02:00
|
|
|
else sprintf (items[4].text, "Lock-On: OFF");
|
2009-08-06 20:31:05 +02:00
|
|
|
if (cart.romsize)
|
2009-07-30 09:15:54 +02:00
|
|
|
{
|
2009-08-02 22:41:46 +02:00
|
|
|
system_reset (); /* clear any patches first */
|
2009-07-30 09:15:54 +02:00
|
|
|
system_init ();
|
|
|
|
system_reset ();
|
2009-10-04 20:24:29 +02:00
|
|
|
memfile_autoload(config.sram_auto,-1);
|
2009-07-30 09:15:54 +02:00
|
|
|
}
|
|
|
|
break;
|
2009-07-29 17:34:25 +02:00
|
|
|
|
|
|
|
case 5: /*** SVP emulation ***/
|
2009-05-25 12:41:16 +02:00
|
|
|
GUI_OptionBox(m,0,"SVP Cycles",(void *)&SVP_cycles,1,1,1500,1);
|
2009-07-30 09:15:54 +02:00
|
|
|
sprintf (items[5].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
|
|
|
*
|
|
|
|
****************************************************************************/
|
2009-03-30 09:05:34 +02:00
|
|
|
static void videomenu ()
|
2008-08-07 14:26:07 +02:00
|
|
|
{
|
2009-03-30 09:05:34 +02:00
|
|
|
int ret, quit = 0;
|
|
|
|
gui_menu *m = &menu_video;
|
|
|
|
gui_item *items = m->items;
|
|
|
|
|
2009-05-14 14:32:20 +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");
|
|
|
|
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");
|
|
|
|
sprintf (items[2].text, "Bilinear Filter: %s", config.bilinear ? " ON" : "OFF");
|
|
|
|
if (config.ntsc == 1) sprintf (items[3].text, "NTSC Filter: COMPOSITE");
|
|
|
|
else if (config.ntsc == 2) sprintf (items[3].text, "NTSC Filter: S-VIDEO");
|
|
|
|
else if (config.ntsc == 3) sprintf (items[3].text, "NTSC Filter: RGB");
|
|
|
|
else sprintf (items[3].text, "NTSC Filter: OFF");
|
|
|
|
sprintf (items[4].text, "Borders: %s", config.overscan ? " ON" : "OFF");
|
|
|
|
if (config.aspect == 1) sprintf (items[5].text,"Aspect: ORIGINAL (4:3)");
|
|
|
|
else if (config.aspect == 2) sprintf (items[5].text, "Aspect: ORIGINAL (16:9)");
|
|
|
|
else sprintf (items[5].text, "Aspect: FIT SCREEN");
|
2009-05-01 14:56:48 +02:00
|
|
|
|
2009-04-20 00:31:08 +02:00
|
|
|
GUI_InitMenu(m);
|
2009-05-26 18:40:35 +02:00
|
|
|
|
|
|
|
if (config.aspect)
|
|
|
|
m->max_items = 7;
|
|
|
|
else
|
|
|
|
m->max_items = 8;
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* do nothing if component cable is not detected */
|
|
|
|
config.render = 0;
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
}
|
2009-05-14 14:32:20 +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");
|
|
|
|
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");
|
2008-12-10 19:16:30 +01:00
|
|
|
break;
|
|
|
|
|
2009-05-14 14:32:20 +02:00
|
|
|
case 1: /*** tv mode ***/
|
2009-03-30 09:05:34 +02:00
|
|
|
if (config.render != 2) config.tv_mode = (config.tv_mode + 1) % 3;
|
2009-05-14 14:32:20 +02: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");
|
2008-12-10 19:16:30 +01:00
|
|
|
break;
|
|
|
|
|
2009-05-14 14:32:20 +02:00
|
|
|
case 2: /*** bilinear filtering ***/
|
2008-12-10 19:16:30 +01:00
|
|
|
config.bilinear ^= 1;
|
2009-05-14 14:32:20 +02:00
|
|
|
sprintf (items[2].text, "Bilinear Filter: %s", config.bilinear ? " ON" : "OFF");
|
2008-12-10 19:16:30 +01:00
|
|
|
break;
|
2008-10-20 17:50:13 +02:00
|
|
|
|
2009-05-14 14:32:20 +02:00
|
|
|
case 3: /*** NTSC filter ***/
|
2008-12-10 19:16:30 +01:00
|
|
|
config.ntsc ++;
|
2008-10-02 22:22:53 +02:00
|
|
|
if (config.ntsc > 3) config.ntsc = 0;
|
2009-05-14 14:32:20 +02:00
|
|
|
if (config.ntsc == 1) sprintf (items[3].text, "NTSC Filter: COMPOSITE");
|
|
|
|
else if (config.ntsc == 2) sprintf (items[3].text, "NTSC Filter: S-VIDEO");
|
|
|
|
else if (config.ntsc == 3) sprintf (items[3].text, "NTSC Filter: RGB");
|
|
|
|
else sprintf (items[3].text, "NTSC Filter: OFF");
|
2008-12-10 19:16:30 +01:00
|
|
|
break;
|
2008-10-03 16:14:20 +02:00
|
|
|
|
2009-05-14 14:32:20 +02:00
|
|
|
case 4: /*** overscan emulation ***/
|
2008-12-10 19:16:30 +01:00
|
|
|
config.overscan ^= 1;
|
2009-05-14 14:32:20 +02:00
|
|
|
sprintf (items[4].text, "Borders: %s", config.overscan ? " ON" : "OFF");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 5: /*** config.aspect ratio ***/
|
|
|
|
config.aspect ++;
|
|
|
|
if (config.aspect > 2) config.aspect = 0;
|
|
|
|
if (config.aspect == 1) sprintf (items[5].text,"Aspect: ORIGINAL (4:3)");
|
|
|
|
else if (config.aspect == 2) sprintf (items[5].text, "Aspect: ORIGINAL (16:9)");
|
|
|
|
else sprintf (items[5].text, "Aspect: FIT SCREEN");
|
2008-12-10 19:16:30 +01:00
|
|
|
|
2009-05-26 18:40:35 +02:00
|
|
|
if (config.aspect)
|
|
|
|
{
|
|
|
|
/* disable items */
|
|
|
|
m->max_items = 7;
|
|
|
|
|
|
|
|
/* reset menu selection */
|
|
|
|
if (m->offset > 3)
|
|
|
|
{
|
|
|
|
m->offset = 3;
|
|
|
|
m->selected = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* enable items */
|
|
|
|
m->max_items = 8;
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
|
|
|
|
break;
|
2009-05-25 12:41:16 +02:00
|
|
|
|
2009-05-26 18:40:35 +02:00
|
|
|
case 6:
|
2008-12-10 19:16:30 +01:00
|
|
|
break;
|
|
|
|
|
2009-05-26 18:40:35 +02:00
|
|
|
case 7:
|
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
|
|
|
|
2009-05-26 18:40:35 +02:00
|
|
|
m->max_items = 8;
|
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
|
|
|
****************************************************************************/
|
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;
|
|
|
|
strcpy(m->items[i+2].text,"");
|
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;
|
|
|
|
sprintf(m->items[i+2].text,"%d",max + 1);
|
2009-08-06 20:31:05 +02:00
|
|
|
if (cart.hw.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-05-05 14:58:25 +02: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;
|
2009-05-04 23:43:16 +02:00
|
|
|
else m->buttons[0].shift[3] = 0;
|
2009-05-05 14:58:25 +02:00
|
|
|
if (input.dev[4] != NO_DEVICE) m->buttons[1].shift[3] = 5;
|
|
|
|
else if (input.dev[0] != NO_DEVICE) m->buttons[1].shift[3] = 1;
|
2009-05-04 23:43:16 +02:00
|
|
|
else m->buttons[1].shift[3] = 0;
|
2009-05-05 14:58:25 +02: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;
|
2009-05-04 23:43:16 +02:00
|
|
|
else m->buttons[2].shift[1] = 0;
|
2009-05-05 14:58:25 +02: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;
|
2009-05-04 23:43:16 +02:00
|
|
|
else m->buttons[6].shift[0] = 0;
|
2009-05-05 14:58:25 +02:00
|
|
|
if (input.dev[4] != NO_DEVICE) m->buttons[5].shift[1] = 1;
|
2009-05-04 23:43:16 +02:00
|
|
|
else m->buttons[5].shift[1] = 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-05-07 15:00:57 +02:00
|
|
|
if (input.dev[6] != NO_DEVICE)
|
|
|
|
{
|
|
|
|
m->buttons[7].shift[1] = 1;
|
|
|
|
if (input.dev[7] != NO_DEVICE) m->buttons[8].shift[1] = 1;
|
|
|
|
else m->buttons[8].shift[1] = 0;
|
|
|
|
}
|
2009-05-04 23:43:16 +02:00
|
|
|
else m->buttons[7].shift[1] = 0;
|
2009-05-03 20:40:51 +02:00
|
|
|
}
|
2009-05-04 23:43:16 +02:00
|
|
|
else m->buttons[6].shift[1] = 0;
|
2009-05-02 17:00:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void ctrlmenu(void)
|
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
int player = 0;
|
|
|
|
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;
|
|
|
|
char msg[16];
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
|
|
#ifdef HW_RVL
|
|
|
|
u32 exp;
|
|
|
|
#endif
|
|
|
|
|
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 */
|
|
|
|
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
|
|
|
/* draw device port number */
|
|
|
|
if (m->bg_images[7].state & IMAGE_VISIBLE)
|
2008-12-10 19:16:30 +01:00
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
if (config.input[player].device != -1)
|
|
|
|
{
|
|
|
|
sprintf(msg,"%d",config.input[player].port + 1);
|
2009-05-05 14:58:25 +02:00
|
|
|
if (m->selected == 11)
|
|
|
|
FONT_write(msg,16,m->items[11].x+m->items[11].w+4,m->items[11].y+m->items[11].h+4,640,(GXColor)DARK_GREY);
|
|
|
|
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);
|
2009-05-04 23:43:16 +02:00
|
|
|
}
|
|
|
|
}
|
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 */
|
2009-08-06 20:31:05 +02:00
|
|
|
if (cart.hw.jcart) break;
|
2009-05-06 12:03:33 +02:00
|
|
|
if (input.system[0] == SYSTEM_MOUSE) input.system[0] +=3; /* lightguns are never used on Port 1 */
|
|
|
|
else input.system[0] ++;
|
|
|
|
if ((input.system[0] == SYSTEM_MOUSE) && (input.system[1] == SYSTEM_MOUSE)) input.system[0] +=3;
|
2009-05-04 23:43:16 +02:00
|
|
|
if (input.system[0] == SYSTEM_WAYPLAY) input.system[1] = SYSTEM_WAYPLAY;
|
|
|
|
if (input.system[0] > SYSTEM_WAYPLAY)
|
|
|
|
{
|
|
|
|
input.system[0] = NO_SYSTEM;
|
|
|
|
input.system[1] = SYSTEM_GAMEPAD;
|
|
|
|
}
|
2009-08-09 11:33:48 +02:00
|
|
|
old_system[0] = -1;
|
|
|
|
old_system[1] = -1;
|
|
|
|
io_init();
|
2009-05-04 23:43:16 +02:00
|
|
|
io_reset();
|
|
|
|
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 */
|
|
|
|
strcpy(m->title,"Controller Settings");
|
2008-08-07 14:26:07 +02:00
|
|
|
}
|
2009-05-04 23:43:16 +02:00
|
|
|
break;
|
2008-08-07 14:26:07 +02:00
|
|
|
|
2009-05-06 12:03:33 +02:00
|
|
|
case 1: /* update port 2 system */
|
2009-08-06 20:31:05 +02:00
|
|
|
if (cart.hw.jcart) break;
|
2009-05-04 23:43:16 +02:00
|
|
|
input.system[1] ++;
|
|
|
|
if ((input.system[0] == SYSTEM_MOUSE) && (input.system[1] == SYSTEM_MOUSE)) input.system[1] ++;
|
|
|
|
if (input.system[1] == SYSTEM_WAYPLAY) input.system[0] = SYSTEM_WAYPLAY;
|
|
|
|
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
|
|
|
}
|
2009-08-09 11:33:48 +02:00
|
|
|
old_system[0] = -1;
|
|
|
|
old_system[1] = -1;
|
|
|
|
io_init();
|
2009-05-04 23:43:16 +02:00
|
|
|
io_reset();
|
|
|
|
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 */
|
|
|
|
strcpy(m->title,"Controller Settings");
|
2008-08-11 20:02:04 +02:00
|
|
|
}
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
break;
|
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:
|
|
|
|
/* remove duplicate assigned inputs */
|
|
|
|
for (i=0; i<MAX_INPUTS; i++)
|
2008-08-11 20:02:04 +02:00
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
if ((i!=player) && (config.input[i].device == config.input[player].device) && (config.input[i].port == config.input[player].port))
|
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++)
|
|
|
|
if (input.dev[i] != NO_DEVICE) player ++;
|
|
|
|
|
|
|
|
if (m->bg_images[7].state & IMAGE_VISIBLE)
|
|
|
|
{
|
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 */
|
2009-08-06 20:31:05 +02:00
|
|
|
if (cart.hw.jcart && (player > 1))
|
2009-05-06 16:47:22 +02:00
|
|
|
sprintf(m->title,"Controller Settings (Player %d) (J-CART)",player+1);
|
|
|
|
else
|
|
|
|
sprintf(m->title,"Controller Settings (Player %d)",player+1);
|
2009-05-04 23:43:16 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 10: /* specific option */
|
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;
|
|
|
|
|
|
|
|
case 11: /* input controller selection */
|
2009-05-07 15:00:57 +02:00
|
|
|
#ifdef HW_RVL
|
2009-05-06 16:47:22 +02:00
|
|
|
/* no input device */
|
2009-05-07 15:00:57 +02:00
|
|
|
if (config.input[player].device > 0)
|
2008-08-11 20:02:04 +02:00
|
|
|
{
|
2009-05-06 16:47:22 +02:00
|
|
|
/* use next port */
|
|
|
|
config.input[player].port ++;
|
|
|
|
}
|
2009-05-07 15:00:57 +02:00
|
|
|
else
|
2009-05-06 16:47:22 +02:00
|
|
|
{
|
2009-05-07 15:00:57 +02:00
|
|
|
/* use gamecube pad */
|
|
|
|
config.input[player].device ++;
|
|
|
|
config.input[player].port = config.input[player].device ? 0 : (player%4);
|
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 wiimotes (without nunchuk) */
|
|
|
|
if (config.input[player].device == 1)
|
2008-08-11 20:02:04 +02:00
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
exp = 4;
|
|
|
|
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);
|
|
|
|
if (exp == WPAD_EXP_NUNCHUK) exp = 4;
|
2008-08-11 20:02:04 +02:00
|
|
|
}
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
while ((config.input[player].port<4) && (exp == 4))
|
2009-05-02 17:00:13 +02:00
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
/* try next port */
|
|
|
|
config.input[player].port ++;
|
|
|
|
if (config.input[player].port<4)
|
|
|
|
{
|
|
|
|
exp = 4;
|
|
|
|
WPAD_Probe(config.input[player].port,&exp);
|
2009-05-06 16:47:22 +02:00
|
|
|
if (exp == WPAD_EXP_NUNCHUK) exp = 4;
|
|
|
|
}
|
2009-05-04 23:43:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (config.input[player].port >= 4)
|
|
|
|
{
|
|
|
|
/* no wiimote (without nunchuk) found, try wiimote+nunchuks */
|
|
|
|
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
|
|
|
|
|
|
|
/* autodetect connected wiimote+nunchuks */
|
|
|
|
if (config.input[player].device == 2)
|
2008-08-11 20:02:04 +02:00
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
exp = 4;
|
|
|
|
if (config.input[player].port<4)
|
|
|
|
{
|
|
|
|
WPAD_Probe(config.input[player].port,&exp);
|
|
|
|
}
|
|
|
|
|
|
|
|
while ((config.input[player].port<4) && (exp != WPAD_EXP_NUNCHUK))
|
|
|
|
{
|
|
|
|
/* try next port */
|
|
|
|
config.input[player].port ++;
|
|
|
|
if (config.input[player].port<4)
|
|
|
|
{
|
|
|
|
exp = 4;
|
|
|
|
WPAD_Probe(config.input[player].port,&exp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (config.input[player].port >= 4)
|
|
|
|
{
|
|
|
|
/* no wiimote+nunchuk found, try classic controllers */
|
|
|
|
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
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
exp = 4;
|
|
|
|
if (config.input[player].port<4)
|
|
|
|
{
|
|
|
|
WPAD_Probe(config.input[player].port,&exp);
|
|
|
|
}
|
2009-05-02 17:00:13 +02:00
|
|
|
|
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 ++;
|
|
|
|
if (config.input[player].port<4)
|
|
|
|
{
|
|
|
|
exp = 4;
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
/* no classic controller found, use default gamecube pad */
|
|
|
|
config.input[player].device = 0;
|
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));
|
|
|
|
}
|
2009-05-07 15:00:57 +02:00
|
|
|
|
|
|
|
#else
|
|
|
|
/* use gamecube pad */
|
|
|
|
config.input[player].device = 0;
|
|
|
|
config.input[player].port = player%4;
|
2009-05-06 12:03:33 +02:00
|
|
|
#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));
|
|
|
|
break;
|
2009-05-02 17:00:13 +02:00
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
case 12: /* Controller Keys Configuration */
|
2009-05-06 16:47:22 +02:00
|
|
|
if (config.input[player].device < 0) break;
|
2009-05-23 19:29:53 +02:00
|
|
|
GUI_MsgBoxOpen("Keys Configuration", "",0);
|
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);
|
|
|
|
}
|
2009-05-19 18:14:43 +02:00
|
|
|
GUI_MsgBoxClose();
|
2009-05-04 23:43:16 +02:00
|
|
|
break;
|
|
|
|
}
|
2008-12-10 19:16:30 +01:00
|
|
|
}
|
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];
|
|
|
|
|
|
|
|
/* stay in menu */
|
|
|
|
update = 0;
|
|
|
|
}
|
|
|
|
}
|
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 */
|
2009-05-04 23:43:16 +02:00
|
|
|
for (i=0; i<8; i++)
|
|
|
|
{
|
|
|
|
if ((i!=player) && (config.input[i].device == config.input[player].device) && (config.input[i].port == config.input[player].port))
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
|
2009-05-06 12:03:33 +02:00
|
|
|
/* clear menu title */
|
2009-05-05 14:58:25 +02:00
|
|
|
strcpy(m->title,"Controller Settings");
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
/* 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 */
|
2009-05-04 23:43:16 +02: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;
|
|
|
|
|
|
|
|
/* 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
|
|
|
|
|
|
|
while (quit == 0)
|
2008-08-07 14:26:07 +02:00
|
|
|
{
|
2009-04-20 00:31:08 +02:00
|
|
|
GUI_InitMenu(m);
|
|
|
|
ret = GUI_RunMenu(m);
|
|
|
|
GUI_DeleteMenu(m);
|
2009-05-12 14:27:19 +02:00
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
switch (ret)
|
|
|
|
{
|
|
|
|
case 0:
|
2009-03-30 09:05:34 +02:00
|
|
|
systemmenu();
|
2008-12-10 19:16:30 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
2009-03-30 09:05:34 +02:00
|
|
|
videomenu();
|
2008-12-10 19:16:30 +01:00
|
|
|
break;
|
|
|
|
case 2:
|
2009-03-15 20:11:01 +01:00
|
|
|
soundmenu();
|
2008-12-10 19:16:30 +01:00
|
|
|
break;
|
|
|
|
case 3:
|
2009-05-02 17:00:13 +02:00
|
|
|
ctrlmenu();
|
2008-12-10 19:16:30 +01:00
|
|
|
break;
|
|
|
|
case 4:
|
2009-04-23 03:01:07 +02:00
|
|
|
prefmenu();
|
2008-12-10 19:16:30 +01:00
|
|
|
break;
|
|
|
|
case -1:
|
|
|
|
quit = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
|
|
config_save();
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Generic Load/Save menu
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
static u8 device = 0;
|
|
|
|
|
2009-03-30 09:05:34 +02:00
|
|
|
static int loadsavemenu (int which)
|
2008-08-07 14:26:07 +02:00
|
|
|
{
|
2008-12-10 19:16:30 +01:00
|
|
|
int prevmenu = menu;
|
|
|
|
int quit = 0;
|
|
|
|
int ret;
|
|
|
|
int count = 3;
|
|
|
|
char items[3][25];
|
2008-08-07 14:26:07 +02:00
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
menu = 2;
|
2008-08-07 14:26:07 +02:00
|
|
|
|
|
|
|
if (which == 1)
|
|
|
|
{
|
|
|
|
sprintf(items[1], "Save State");
|
|
|
|
sprintf(items[2], "Load State");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprintf(items[1], "Save SRAM");
|
|
|
|
sprintf(items[2], "Load SRAM");
|
|
|
|
}
|
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
while (quit == 0)
|
|
|
|
{
|
2008-12-12 16:38:04 +01:00
|
|
|
if (device == 0) sprintf(items[0], "Device: FAT");
|
2008-08-07 14:26:07 +02:00
|
|
|
else if (device == 1) sprintf(items[0], "Device: MCARD A");
|
|
|
|
else if (device == 2) sprintf(items[0], "Device: MCARD B");
|
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
ret = domenu (&items[0], count, 0);
|
|
|
|
switch (ret)
|
|
|
|
{
|
|
|
|
case -1:
|
|
|
|
quit = 1;
|
|
|
|
break;
|
2008-08-07 14:26:07 +02:00
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
case 0:
|
2008-08-07 14:26:07 +02:00
|
|
|
device = (device + 1)%3;
|
2008-10-23 22:38:06 +02:00
|
|
|
break;
|
2008-08-07 14:26:07 +02:00
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
case 1:
|
|
|
|
case 2:
|
2009-05-19 18:14:43 +02:00
|
|
|
SILENT = 1;
|
2008-12-10 19:16:30 +01:00
|
|
|
if (which == 1) quit = ManageState(ret-1,device);
|
|
|
|
else if (which == 0) quit = ManageSRAM(ret-1,device);
|
2009-05-19 18:14:43 +02:00
|
|
|
SILENT = 0;
|
2008-12-10 19:16:30 +01:00
|
|
|
if (quit) return 1;
|
2008-08-07 14:26:07 +02:00
|
|
|
break;
|
2008-12-10 19:16:30 +01:00
|
|
|
}
|
|
|
|
}
|
2008-08-07 14:26:07 +02:00
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
menu = prevmenu;
|
|
|
|
return 0;
|
2008-08-07 14:26:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* File Manager menu
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
2009-03-30 09:05:34 +02:00
|
|
|
static int filemenu ()
|
2008-08-07 14:26:07 +02:00
|
|
|
{
|
2008-12-10 19:16:30 +01:00
|
|
|
int prevmenu = menu;
|
|
|
|
int ret;
|
|
|
|
int quit = 0;
|
|
|
|
int count = 2;
|
|
|
|
char items[2][25] = {
|
|
|
|
{"SRAM Manager"},
|
|
|
|
{"STATE Manager"}
|
|
|
|
};
|
|
|
|
|
|
|
|
menu = 0;
|
|
|
|
|
|
|
|
while (quit == 0)
|
|
|
|
{
|
|
|
|
strcpy (menutitle, "Press B to return");
|
|
|
|
ret = domenu (&items[0], count, 0);
|
|
|
|
switch (ret)
|
|
|
|
{
|
|
|
|
case -1: /*** Button B ***/
|
|
|
|
ret = 0;
|
|
|
|
quit = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0: /*** SRAM Manager ***/
|
|
|
|
case 1: /*** SaveState Manager ***/
|
|
|
|
if (loadsavemenu(ret)) return 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
menu = prevmenu;
|
|
|
|
return 0;
|
2008-08-07 14:26:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Load Rom menu
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
2009-03-30 09:05:34 +02:00
|
|
|
static int loadmenu ()
|
2008-08-07 14:26:07 +02:00
|
|
|
{
|
2009-04-20 00:31:08 +02:00
|
|
|
int ret,size;
|
2009-03-30 09:05:34 +02:00
|
|
|
gui_menu *m = &menu_load;
|
2009-05-19 18:14:43 +02:00
|
|
|
GUI_InitMenu(m);
|
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:
|
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
|
|
|
|
|
|
|
/*** Load from DVD ***/
|
2009-05-19 18:14:43 +02:00
|
|
|
#ifdef HW_RVL
|
2008-12-08 18:26:50 +01:00
|
|
|
case 3:
|
2009-05-19 18:14:43 +02:00
|
|
|
#else
|
2008-10-23 22:38:06 +02:00
|
|
|
case 2:
|
2009-05-19 18:14:43 +02:00
|
|
|
#endif
|
|
|
|
if (DVD_Open())
|
2008-11-13 08:24:30 +01:00
|
|
|
{
|
2009-05-19 18:14:43 +02:00
|
|
|
GUI_DeleteMenu(m);
|
2009-08-06 20:31:05 +02:00
|
|
|
size = FileSelector(cart.rom,0);
|
2009-05-20 17:11:06 +02:00
|
|
|
if (size) return 1;
|
2009-05-19 18:14:43 +02:00
|
|
|
GUI_InitMenu(m);
|
2008-11-13 08:24:30 +01:00
|
|
|
}
|
2008-08-07 14:26:07 +02:00
|
|
|
break;
|
2008-11-13 08:24:30 +01:00
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
/*** Load from FAT device ***/
|
|
|
|
default:
|
2009-05-19 18:14:43 +02:00
|
|
|
if (FAT_Open(ret))
|
2008-12-11 18:38:29 +01:00
|
|
|
{
|
2009-05-19 18:14:43 +02:00
|
|
|
GUI_DeleteMenu(m);
|
2009-08-06 20:31:05 +02:00
|
|
|
size = FileSelector(cart.rom,1);
|
2009-05-20 17:11:06 +02:00
|
|
|
if (size) return 1;
|
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;
|
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
|
|
|
|
***************************************************************************/
|
2009-03-30 09:05:34 +02:00
|
|
|
static void showrominfo ()
|
2008-08-07 14:26:07 +02:00
|
|
|
{
|
|
|
|
int ypos;
|
|
|
|
u8 i,j,quit,redraw,max;
|
|
|
|
char msg[128];
|
|
|
|
short p;
|
|
|
|
char pName[14][21];
|
|
|
|
|
|
|
|
quit = 0;
|
|
|
|
j = 0;
|
|
|
|
redraw = 1;
|
|
|
|
|
|
|
|
/*** Remove any still held buttons ***/
|
|
|
|
while (PAD_ButtonsHeld(0)) PAD_ScanPads();
|
|
|
|
#ifdef HW_RVL
|
|
|
|
while (WPAD_ButtonsHeld(0)) WPAD_ScanPads();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
max = 14;
|
|
|
|
for (i = 0; i < 14; i++)
|
|
|
|
{
|
2008-12-10 19:16:30 +01:00
|
|
|
if (peripherals & (1 << i))
|
|
|
|
{
|
|
|
|
sprintf(pName[max-14],"%s", peripheralinfo[i].pName);
|
|
|
|
max ++;
|
|
|
|
}
|
2008-08-07 14:26:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
while (quit == 0)
|
|
|
|
{
|
2009-02-22 20:57:41 +01:00
|
|
|
if (redraw)
|
|
|
|
{
|
2009-04-15 17:33:51 +02:00
|
|
|
gxClearScreen ((GXColor)BLACK);
|
2008-12-10 19:16:30 +01:00
|
|
|
|
|
|
|
ypos = 134;
|
|
|
|
WriteCentre(ypos, "ROM Header Information");
|
|
|
|
ypos += 2*fheight;
|
|
|
|
|
|
|
|
for (i=0; i<8; i++)
|
|
|
|
{
|
|
|
|
switch (i+j)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sprintf (msg, "Console type: %s", rominfo.consoletype);
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
sprintf (msg, "Copyright: %s", rominfo.copyright);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
sprintf (msg, "Company: %s", companyinfo[getcompany ()].company);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
sprintf (msg, "Game Domestic Name:");
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
sprintf(msg, " %s",rominfo.domestic);
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
sprintf (msg, "Game International Name:");
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
sprintf(msg, " %s",rominfo.international);
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
sprintf (msg, "Type - %s : %s", rominfo.ROMType, strcmp (rominfo.ROMType, "AI") ? "Game" : "Educational");
|
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
sprintf (msg, "Product - %s", rominfo.product);
|
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
sprintf (msg, "Checksum - %04x (%04x) (%s)", rominfo.checksum, realchecksum, (rominfo.checksum == realchecksum) ? "Good" : "Bad");
|
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
sprintf (msg, "ROM end: $%06X", rominfo.romend);
|
|
|
|
break;
|
|
|
|
case 11:
|
|
|
|
if (svp) sprintf (msg, "SVP Chip detected");
|
|
|
|
else if (sram.custom) sprintf (msg, "EEPROM(%dK) - $%06X", ((eeprom.type.size_mask+1)* 8) /1024, (unsigned int)sram.start);
|
|
|
|
else if (sram.detected) sprintf (msg, "SRAM Start - $%06X", sram.start);
|
|
|
|
else sprintf (msg, "External RAM undetected");
|
|
|
|
|
|
|
|
break;
|
|
|
|
case 12:
|
|
|
|
if (sram.custom) sprintf (msg, "EEPROM(%dK) - $%06X", ((eeprom.type.size_mask+1)* 8) /1024, (unsigned int)sram.end);
|
|
|
|
else if (sram.detected) sprintf (msg, "SRAM End - $%06X", sram.end);
|
|
|
|
else if (sram.on) sprintf (msg, "Default SRAM activated ");
|
|
|
|
else sprintf (msg, "SRAM is disactivated ");
|
|
|
|
break;
|
|
|
|
case 13:
|
|
|
|
if (region_code == REGION_USA) sprintf (msg, "Region - %s (USA)", rominfo.country);
|
|
|
|
else if (region_code == REGION_EUROPE) sprintf (msg, "Region - %s (EUR)", rominfo.country);
|
|
|
|
else if (region_code == REGION_JAPAN_NTSC) sprintf (msg, "Region - %s (JAP)", rominfo.country);
|
|
|
|
else if (region_code == REGION_JAPAN_PAL) sprintf (msg, "Region - %s (JPAL)", rominfo.country);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
sprintf (msg, "Supports - %s", pName[i+j-14]);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
write_font (100, ypos, msg);
|
|
|
|
ypos += fheight;
|
|
|
|
}
|
|
|
|
|
|
|
|
ypos += fheight;
|
|
|
|
WriteCentre (ypos, "Press A to Continue");
|
2009-05-19 18:14:43 +02:00
|
|
|
gxSetScreen();
|
2008-12-10 19:16:30 +01:00
|
|
|
}
|
|
|
|
|
2009-04-15 17:33:51 +02:00
|
|
|
p = m_input.keys;
|
2008-12-10 19:16:30 +01:00
|
|
|
redraw = 0;
|
|
|
|
|
|
|
|
if ((j<(max-8)) && (p & PAD_BUTTON_DOWN)) {redraw = 1; j++;}
|
|
|
|
if ((j>0) && (p & PAD_BUTTON_UP)) {redraw = 1; j--;}
|
|
|
|
if (p & PAD_BUTTON_A) quit = 1;
|
|
|
|
if (p & PAD_BUTTON_B) quit = 1;
|
2008-08-07 14:26:07 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Main Menu
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
2009-05-02 17:00:13 +02:00
|
|
|
static int rom_loaded = 0;
|
2009-04-20 00:31:08 +02:00
|
|
|
void MainMenu (void)
|
2008-08-07 14:26:07 +02:00
|
|
|
{
|
2009-03-30 09:05:34 +02:00
|
|
|
int ret, quit = 0;
|
2009-04-20 00:31:08 +02:00
|
|
|
|
2009-04-20 19:41:54 +02:00
|
|
|
char *items[3] =
|
|
|
|
{
|
|
|
|
"View Credits",
|
|
|
|
"Exit to Loader",
|
|
|
|
#ifdef HW_RVL
|
|
|
|
"Exit to System Menu"
|
|
|
|
#else
|
|
|
|
"Reset System"
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2009-04-20 00:31:08 +02:00
|
|
|
/* autosave SRAM */
|
|
|
|
memfile_autosave(config.sram_auto,-1);
|
2008-12-10 19:16:30 +01:00
|
|
|
|
2009-04-15 17:33:51 +02:00
|
|
|
#ifdef HW_RVL
|
2009-05-20 17:11:06 +02:00
|
|
|
/* sutdown Wii */
|
|
|
|
if (Shutdown)
|
|
|
|
{
|
|
|
|
GUI_FadeOut();
|
|
|
|
shutdown();
|
|
|
|
SYS_ResetSystem(SYS_POWEROFF, 0, 0);
|
|
|
|
}
|
|
|
|
|
2009-04-20 00:31:08 +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;
|
|
|
|
|
2009-05-02 17:00:13 +02:00
|
|
|
if (!rom_loaded)
|
2009-04-20 00:31:08 +02:00
|
|
|
{
|
2009-05-02 17:00:13 +02:00
|
|
|
/* check if a game is running */
|
2009-08-06 20:31:05 +02:00
|
|
|
if (cart.romsize)
|
2009-05-02 17:00:13 +02:00
|
|
|
{
|
|
|
|
m->screenshot = 1;
|
2009-05-04 23:43:16 +02:00
|
|
|
m->bg_images[0].state &= ~IMAGE_VISIBLE;
|
2009-05-02 17:00:13 +02:00
|
|
|
m->buttons[3].state |= BUTTON_SELECT_SFX;
|
|
|
|
m->buttons[5].state |= BUTTON_SELECT_SFX;
|
|
|
|
m->buttons[6].state |= (BUTTON_VISIBLE | BUTTON_ACTIVE);
|
|
|
|
m->buttons[7].state |= (BUTTON_VISIBLE | BUTTON_ACTIVE);
|
|
|
|
m->buttons[8].state |= (BUTTON_VISIBLE | BUTTON_ACTIVE);
|
|
|
|
m->buttons[3].shift[1] = 3;
|
|
|
|
m->buttons[4].shift[1] = 3;
|
|
|
|
m->buttons[5].shift[1] = 2;
|
2009-05-03 12:14:56 +02:00
|
|
|
m->buttons[5].shift[3] = 1;
|
2009-05-02 17:00:13 +02:00
|
|
|
rom_loaded = 1;
|
|
|
|
}
|
2009-04-20 00:31:08 +02:00
|
|
|
}
|
|
|
|
|
2009-05-04 23:43:16 +02:00
|
|
|
GUI_InitMenu(m);
|
2009-05-13 16:26:55 +02:00
|
|
|
GUI_SetBgColor(bg_colors[config.bg_color]);
|
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)
|
|
|
|
{
|
2009-04-20 00:31:08 +02:00
|
|
|
ret = GUI_RunMenu(m);
|
2008-08-07 14:26:07 +02:00
|
|
|
|
2008-12-10 19:16:30 +01:00
|
|
|
switch (ret)
|
|
|
|
{
|
2009-05-04 23:43:16 +02:00
|
|
|
case -1: /*** Return to Game ***/
|
2009-04-21 03:05:56 +02:00
|
|
|
case 6:
|
2009-08-06 20:31:05 +02:00
|
|
|
if (!cart.romsize) break;
|
2009-05-04 23:43:16 +02:00
|
|
|
GUI_DrawMenuFX(m,10,1);
|
|
|
|
GUI_DeleteMenu(m);
|
|
|
|
quit = 1;
|
2008-12-10 19:16:30 +01:00
|
|
|
break;
|
|
|
|
|
2009-09-27 20:08:33 +02:00
|
|
|
case 0: /*** Exit Menu ***/
|
2009-04-20 19:41:54 +02:00
|
|
|
{
|
2009-09-27 20:08:33 +02:00
|
|
|
switch (GUI_OptionWindow(m, VERSION, items,3))
|
2009-04-20 19:41:54 +02:00
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
#ifdef HW_RVL
|
|
|
|
gxTextureClose(&w_pointer);
|
|
|
|
#endif
|
|
|
|
GUI_DeleteMenu(m);
|
2009-05-04 23:43:16 +02:00
|
|
|
GUI_FadeOut();
|
2009-04-20 19:41:54 +02:00
|
|
|
shutdown();
|
|
|
|
exit(0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
2009-04-21 03:05:56 +02:00
|
|
|
#ifdef HW_RVL
|
|
|
|
gxTextureClose(&w_pointer);
|
|
|
|
#endif
|
2009-04-20 19:41:54 +02:00
|
|
|
GUI_DeleteMenu(m);
|
2009-05-04 23:43:16 +02:00
|
|
|
GUI_FadeOut();
|
2009-04-20 19:41:54 +02:00
|
|
|
shutdown();
|
|
|
|
#ifdef HW_RVL
|
|
|
|
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
|
|
|
|
#else
|
|
|
|
SYS_ResetSystem(SYS_HOTRESET,0,0);
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
|
|
|
|
default: /* TODO */
|
|
|
|
break;
|
|
|
|
}
|
2009-04-21 03:05:56 +02:00
|
|
|
break;
|
2009-04-20 19:41:54 +02:00
|
|
|
}
|
|
|
|
|
2009-04-21 03:05:56 +02:00
|
|
|
case 1: /*** Load Game ***/
|
2009-05-12 14:27:19 +02:00
|
|
|
GUI_DeleteMenu(m);
|
2009-04-21 03:05:56 +02:00
|
|
|
quit = loadmenu();
|
2009-05-12 14:27:19 +02:00
|
|
|
if (quit) break;
|
|
|
|
GUI_InitMenu(m);
|
2009-04-21 03:05:56 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 2: /*** Options */
|
2009-05-12 14:27:19 +02:00
|
|
|
GUI_DeleteMenu(m);
|
2009-08-14 15:54:15 +02:00
|
|
|
optionmenu();
|
2009-05-12 14:27:19 +02:00
|
|
|
GUI_InitMenu(m);
|
2009-04-21 03:05:56 +02:00
|
|
|
break;
|
|
|
|
|
2009-09-27 20:08:33 +02:00
|
|
|
case 3: /*** Memory Manager (TODO !!!) ***/
|
2009-08-06 20:31:05 +02:00
|
|
|
if (!cart.romsize) break;
|
2009-05-12 14:27:19 +02:00
|
|
|
GUI_DeleteMenu(m);
|
2009-08-14 15:54:15 +02:00
|
|
|
quit = filemenu();
|
2009-05-12 14:27:19 +02:00
|
|
|
if (quit) break;
|
|
|
|
GUI_InitMenu(m);
|
2009-03-15 20:11:01 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 4: /*** Emulator Reset ***/
|
2009-08-06 20:31:05 +02:00
|
|
|
if (!cart.romsize) break;
|
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-08-14 15:54:15 +02:00
|
|
|
system_reset();
|
2009-04-20 19:41:54 +02:00
|
|
|
quit = 1;
|
|
|
|
break;
|
|
|
|
|
2009-09-27 20:08:33 +02:00
|
|
|
case 5: /*** Game Genie (TODO !!!) ***/
|
2009-08-06 20:31:05 +02:00
|
|
|
if (!cart.romsize) break;
|
2009-05-12 14:27:19 +02:00
|
|
|
GUI_DeleteMenu(m);
|
2009-04-20 19:41:54 +02:00
|
|
|
GetGGEntries();
|
2009-05-12 14:27:19 +02:00
|
|
|
GUI_InitMenu(m);
|
2009-04-20 19:41:54 +02:00
|
|
|
break;
|
|
|
|
|
2009-09-27 20:08:33 +02:00
|
|
|
case 7: /*** Game Screenshot ***/
|
2009-08-06 20:31:05 +02:00
|
|
|
if (!cart.romsize) break;
|
2009-09-27 20:08:33 +02:00
|
|
|
char filename[MAXPATHLEN];
|
|
|
|
sprintf(filename,"%s/snaps/%s.png", DEFAULT_PATH, rom_filename);
|
|
|
|
gxSaveScreenshot(filename);
|
2009-05-01 14:56:48 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 8: /*** ROM Information ***/
|
2009-08-06 20:31:05 +02:00
|
|
|
if (!cart.romsize) break;
|
2009-05-12 14:27:19 +02:00
|
|
|
GUI_DeleteMenu(m);
|
2009-08-14 15:54:15 +02:00
|
|
|
showrominfo();
|
2009-05-12 14:27:19 +02:00
|
|
|
GUI_InitMenu(m);
|
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 ***/
|
2009-05-04 23:43:16 +02:00
|
|
|
while (PAD_ButtonsHeld(0))
|
|
|
|
PAD_ScanPads();
|
2008-08-07 14:26:07 +02:00
|
|
|
#ifdef HW_RVL
|
2009-05-04 23:43:16 +02:00
|
|
|
while (WPAD_ButtonsHeld(0))
|
|
|
|
WPAD_ScanPads();
|
2008-08-07 14:26:07 +02:00
|
|
|
|
2009-04-20 00:31:08 +02:00
|
|
|
/* free wiimote pointer data */
|
|
|
|
gxTextureClose(&w_pointer);
|
2009-04-21 03:05:56 +02:00
|
|
|
#endif
|
2009-04-20 00:31:08 +02:00
|
|
|
|
2009-04-21 03:05:56 +02:00
|
|
|
#ifndef HW_RVL
|
2008-12-10 19:16:30 +01:00
|
|
|
/*** Stop the DVD from causing clicks while playing ***/
|
|
|
|
uselessinquiry ();
|
2008-08-07 14:26:07 +02:00
|
|
|
#endif
|
|
|
|
}
|