added an option to disable background "overlay"
changed background image when background is 'pure black'
improved some menu transitions
minor menu arrangement & code cleanup
This commit is contained in:
ekeeke31 2010-03-22 14:07:25 +00:00
parent a590414754
commit 68ceeb3b8c
8 changed files with 247 additions and 108 deletions

View File

@ -122,12 +122,13 @@ void config_default(void)
#endif #endif
config.state_auto = -1; config.state_auto = -1;
config.bg_color = 0; config.bg_color = 0;
config.bg_overlay = 0;
config.screen_w = 658; config.screen_w = 658;
config.ask_confirm = 0; config.ask_confirm = 0;
config.bgm_volume = 100.0; config.bgm_volume = 100.0;
config.sfx_volume = 100.0; config.sfx_volume = 100.0;
/* restore saved configuration */ /* restore from config file */
config_load(); config_load();
io_init(); io_init();
} }

View File

@ -73,6 +73,7 @@ typedef struct
int8 sram_auto; int8 sram_auto;
int8 state_auto; int8 state_auto;
int8 bg_color; int8 bg_color;
int8 bg_overlay;
int16 screen_w; int16 screen_w;
uint8 ask_confirm; uint8 ask_confirm;
float bgm_volume; float bgm_volume;

View File

@ -84,12 +84,12 @@ static gui_item action_select =
/*****************************************************************************/ /*****************************************************************************/
static gui_image bg_filesel[10] = static gui_image bg_filesel[10] =
{ {
{NULL,Bg_main_png,IMAGE_VISIBLE,356,144,348,288,255}, {NULL,Bg_main_png,IMAGE_VISIBLE,374,140,284,288,255},
{NULL,Bg_overlay_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,255}, {NULL,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_top_png,IMAGE_VISIBLE,0,0,640,108,255},
{NULL,Banner_bottom_png,IMAGE_VISIBLE,0,380,640,100,255}, {NULL,Banner_bottom_png,IMAGE_VISIBLE,0,380,640,100,255},
{NULL,Main_logo_png,IMAGE_VISIBLE,466,40,152,44,255}, {NULL,Main_logo_png,IMAGE_VISIBLE,466,40,152,44,255},
{NULL,Frame_s1_png,IMAGE_VISIBLE,8,70,372,336,230}, {NULL,Frame_s1_png,IMAGE_VISIBLE,8,70,372,336,200},
{NULL,Frame_s2_png,0,384,264,248,140,200}, {NULL,Frame_s2_png,0,384,264,248,140,200},
{NULL,Snap_empty_png,IMAGE_VISIBLE,422,114,164,116,255}, {NULL,Snap_empty_png,IMAGE_VISIBLE,422,114,164,116,255},
{NULL,NULL,0,424,116,160,112,255}, {NULL,NULL,0,424,116,160,112,255},
@ -163,6 +163,16 @@ int FileSelector(unsigned char *buffer, bool useFAT)
gui_butn *button; gui_butn *button;
#endif #endif
/* Background Settings */
if (config.bg_color == (BG_COLOR_MAX - 1))
bg_filesel[0].data = Bg_main_2_png;
else
bg_filesel[0].data = Bg_main_png;
if (config.bg_overlay)
bg_filesel[1].state |= IMAGE_VISIBLE;
else
bg_filesel[1].state &= ~IMAGE_VISIBLE;
/* Initialize Menu */ /* Initialize Menu */
gui_menu *m = &menu_browser; gui_menu *m = &menu_browser;
GUI_InitMenu(m); GUI_InitMenu(m);

View File

@ -38,6 +38,27 @@ static lwp_t msgboxthread;
/* background color */ /* background color */
static GXColor bg_color; static GXColor bg_color;
/* various background colors */
static GXColor bg_colors[BG_COLOR_MAX]=
{
{0xd4,0xd0,0xc8,0xff}, /* cream */
{0xbb,0xb0,0x99,0xff}, /* gold */
{0xd6,0xcb,0xba,0xff}, /* light gold */
{0xcc,0xcc,0xcc,0xff}, /* light grey */
{0x66,0x66,0x66,0xff}, /* faded grey */
{0x50,0x51,0x5b,0xff}, /* grey blue */
{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 */
{0x00,0x00,0x00,0xff} /* black */
};
/*****************************************************************************/ /*****************************************************************************/
/* Generic GUI routines */ /* Generic GUI routines */
/*****************************************************************************/ /*****************************************************************************/
@ -179,11 +200,14 @@ void GUI_DrawMenu(gui_menu *menu)
for (i=0; i<menu->max_images; i++) for (i=0; i<menu->max_images; i++)
{ {
image = &menu->bg_images[i]; image = &menu->bg_images[i];
if (image->state & IMAGE_VISIBLE)
{
if (image->state & IMAGE_REPEAT) if (image->state & IMAGE_REPEAT)
gxDrawTextureRepeat(image->texture,image->x,image->y,image->w,image->h,image->alpha); gxDrawTextureRepeat(image->texture,image->x,image->y,image->w,image->h,image->alpha);
else if (image->state & IMAGE_VISIBLE) else
gxDrawTexture(image->texture,image->x,image->y,image->w,image->h,image->alpha); gxDrawTexture(image->texture,image->x,image->y,image->w,image->h,image->alpha);
} }
}
/* menu title */ /* menu title */
FONT_write(menu->title, 22,10,56,640,(GXColor)WHITE); FONT_write(menu->title, 22,10,56,640,(GXColor)WHITE);
@ -365,29 +389,31 @@ void GUI_DrawMenuFX(gui_menu *menu, u8 speed, u8 out)
if ((image->state & IMAGE_FADE) && ((out && (image->alpha > alpha)) || (!out && (image->alpha < alpha)))) if ((image->state & IMAGE_FADE) && ((out && (image->alpha > alpha)) || (!out && (image->alpha < alpha))))
{ {
/* FADE In-Out */ /* FADE In-Out */
if (image->state & IMAGE_VISIBLE)
{
if (image->state & IMAGE_REPEAT) if (image->state & IMAGE_REPEAT)
gxDrawTextureRepeat(image->texture,image->x+xoffset,image->y+yoffset,image->w,image->h,alpha); gxDrawTextureRepeat(image->texture,image->x+xoffset,image->y+yoffset,image->w,image->h,alpha);
else if (image->state & IMAGE_VISIBLE) else
gxDrawTexture(image->texture,image->x+xoffset,image->y+yoffset,image->w,image->h,alpha); gxDrawTexture(image->texture,image->x+xoffset,image->y+yoffset,image->w,image->h,alpha);
} }
}
else else
{
if (image->state & IMAGE_VISIBLE)
{ {
if (image->state & IMAGE_REPEAT) if (image->state & IMAGE_REPEAT)
gxDrawTextureRepeat(image->texture,image->x+xoffset,image->y+yoffset,image->w,image->h,image->alpha); gxDrawTextureRepeat(image->texture,image->x+xoffset,image->y+yoffset,image->w,image->h,image->alpha);
else if (image->state & IMAGE_VISIBLE) else
gxDrawTexture(image->texture,image->x+xoffset,image->y+yoffset,image->w,image->h,image->alpha); gxDrawTexture(image->texture,image->x+xoffset,image->y+yoffset,image->w,image->h,image->alpha);
} }
} }
}
/* menu title */ /* menu title */
if (menu->bg_images[2].state & IMAGE_SLIDE_TOP) if (menu->bg_images[2].state & IMAGE_SLIDE_TOP)
{
FONT_write(menu->title, 22,10,out ? (56 + temp - max_offset) : (56 -temp),640,(GXColor)WHITE); FONT_write(menu->title, 22,10,out ? (56 + temp - max_offset) : (56 -temp),640,(GXColor)WHITE);
}
else else
{
FONT_write(menu->title, 22,10,56,640,(GXColor)WHITE); FONT_write(menu->title, 22,10,56,640,(GXColor)WHITE);
}
/* draw buttons + items */ /* draw buttons + items */
for (i=0; i<menu->max_buttons; i++) for (i=0; i<menu->max_buttons; i++)
@ -1234,7 +1260,7 @@ void GUI_OptionBox(gui_menu *parent, optioncallback cb, char *title, void *optio
GUI_DrawMenu(parent); GUI_DrawMenu(parent);
/* draw window */ /* draw window */
gxDrawTexture(window,xwindow,ywindow-yoffset,window->width,window->height,230); gxDrawTexture(window,xwindow,ywindow-yoffset,window->width,window->height,225);
gxDrawTexture(top,xwindow,ywindow-yoffset,top->width,top->height,255); gxDrawTexture(top,xwindow,ywindow-yoffset,top->width,top->height,255);
/* display title */ /* display title */
@ -1262,7 +1288,7 @@ void GUI_OptionBox(gui_menu *parent, optioncallback cb, char *title, void *optio
GUI_DrawMenu(parent); GUI_DrawMenu(parent);
/* draw window */ /* draw window */
gxDrawTexture(window,xwindow,ywindow,window->width,window->height,230); gxDrawTexture(window,xwindow,ywindow,window->width,window->height,225);
gxDrawTexture(top,xwindow,ywindow,top->width,top->height,255); gxDrawTexture(top,xwindow,ywindow,top->width,top->height,255);
/* display title */ /* display title */
@ -1414,7 +1440,7 @@ void GUI_OptionBox(gui_menu *parent, optioncallback cb, char *title, void *optio
GUI_DrawMenu(parent); GUI_DrawMenu(parent);
/* draw window */ /* draw window */
gxDrawTexture(window,xwindow,ywindow-yoffset,window->width,window->height,230); gxDrawTexture(window,xwindow,ywindow-yoffset,window->width,window->height,225);
gxDrawTexture(top,xwindow,ywindow-yoffset,top->width,top->height,255); gxDrawTexture(top,xwindow,ywindow-yoffset,top->width,top->height,255);
/* display title */ /* display title */
@ -1476,7 +1502,7 @@ void GUI_OptionBox2(gui_menu *parent, char *text_1, char *text_2, s16 *option_1,
GUI_DrawMenu(parent); GUI_DrawMenu(parent);
/* draw window */ /* draw window */
gxDrawTexture(window,xwindow,ywindow-yoffset,window->width,window->height,230); gxDrawTexture(window,xwindow,ywindow-yoffset,window->width,window->height,225);
/* update display */ /* update display */
gxSetScreen(); gxSetScreen();
@ -1500,7 +1526,7 @@ void GUI_OptionBox2(gui_menu *parent, char *text_1, char *text_2, s16 *option_1,
GUI_DrawMenu(parent); GUI_DrawMenu(parent);
/* draw window */ /* draw window */
gxDrawTexture(window,xwindow,ywindow,window->width,window->height,230); gxDrawTexture(window,xwindow,ywindow,window->width,window->height,225);
/* draw options text */ /* draw options text */
if (*option_1 < 0) sprintf(msg,"%s: -%02d",text_1,abs(*option_1)); if (*option_1 < 0) sprintf(msg,"%s: -%02d",text_1,abs(*option_1));
@ -1651,7 +1677,7 @@ void GUI_OptionBox2(gui_menu *parent, char *text_1, char *text_2, s16 *option_1,
GUI_DrawMenu(parent); GUI_DrawMenu(parent);
/* draw window */ /* draw window */
gxDrawTexture(window,xwindow,ywindow-yoffset,window->width,window->height,230); gxDrawTexture(window,xwindow,ywindow-yoffset,window->width,window->height,225);
/* update display */ /* update display */
gxSetScreen(); gxSetScreen();
@ -1921,13 +1947,22 @@ void GUI_FadeOut()
} }
} }
/* Select default background color */ /* Return background color */
void GUI_SetBgColor(GXColor color) GXColor *GUI_GetBgColor(void)
{ {
bg_color.r = color.r; return &bg_color;
bg_color.g = color.g; }
bg_color.b = color.b;
bg_color.a = color.a; /* Select background color */
void GUI_SetBgColor(u8 color)
{
if (color < BG_COLOR_MAX)
{
bg_color.r = bg_colors[color].r;
bg_color.g = bg_colors[color].g;
bg_color.b = bg_colors[color].b;
bg_color.a = bg_colors[color].a;
}
} }
/* Initialize GUI engine */ /* Initialize GUI engine */

View File

@ -52,6 +52,8 @@
#define IMAGE_SLIDE_TOP 0x20 #define IMAGE_SLIDE_TOP 0x20
#define IMAGE_SLIDE_BOTTOM 0x40 #define IMAGE_SLIDE_BOTTOM 0x40
#define BG_COLOR_MAX 15
/*****************************************************************************/ /*****************************************************************************/
/* Generic GUI structures */ /* Generic GUI structures */
/*****************************************************************************/ /*****************************************************************************/
@ -153,9 +155,11 @@ extern const u8 Bg_intro_c2_png[];
extern const u8 Bg_intro_c3_png[]; extern const u8 Bg_intro_c3_png[];
extern const u8 Bg_intro_c4_png[]; extern const u8 Bg_intro_c4_png[];
extern const u8 Bg_intro_c5_png[]; extern const u8 Bg_intro_c5_png[];
extern const u8 Bg_credits_png[];
/* Generic backgrounds */ /* Generic backgrounds */
extern const u8 Bg_main_png[]; extern const u8 Bg_main_png[];
extern const u8 Bg_main_2_png[];
extern const u8 Bg_overlay_png[]; extern const u8 Bg_overlay_png[];
extern const u8 Banner_main_png[]; extern const u8 Banner_main_png[];
extern const u8 Banner_bottom_png[]; extern const u8 Banner_bottom_png[];
@ -291,7 +295,8 @@ extern void GUI_MsgBoxClose(void);
extern void GUI_WaitPrompt(char *title, char *msg); extern void GUI_WaitPrompt(char *title, char *msg);
extern int GUI_ConfirmPrompt(char *msg); extern int GUI_ConfirmPrompt(char *msg);
extern void GUI_FadeOut(); extern void GUI_FadeOut();
extern void GUI_SetBgColor(GXColor color); extern GXColor *GUI_GetBgColor(void);
extern void GUI_SetBgColor(u8 color);
extern void GUI_Initialize(void); extern void GUI_Initialize(void);
#endif #endif

View File

@ -29,28 +29,6 @@
#include "file_fat.h" #include "file_fat.h"
#include "filesel.h" #include "filesel.h"
#define BG_COLOR_MAX 15
/* various background colors */
static GXColor bg_colors[BG_COLOR_MAX]=
{
{0xd4,0xd0,0xc8,0xff}, /* cream */
{0xcc,0xcc,0xcc,0xff}, /* light grey */
{0x66,0x66,0x66,0xff}, /* faded grey */
{0x50,0x51,0x5b,0xff}, /* grey blue */
{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 */
{0x00,0x00,0x00,0xff}, /* black */
{0xd6,0xcb,0xba,0xff}, /* light gold */
{0xbb,0xb0,0x99,0xff} /* gold */
};
/*****************************************************************************/ /*****************************************************************************/
/* Generic Buttons data */ /* Generic Buttons data */
/*****************************************************************************/ /*****************************************************************************/
@ -115,7 +93,7 @@ static gui_item action_select =
/*****************************************************************************/ /*****************************************************************************/
static gui_image bg_main[4] = static gui_image bg_main[4] =
{ {
{NULL,Bg_main_png,IMAGE_VISIBLE|IMAGE_FADE,146,80,348,288,255}, {NULL,Bg_main_png,IMAGE_VISIBLE|IMAGE_FADE,178,28,284,288,255},
{NULL,Bg_overlay_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,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,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} {NULL,Main_logo_png,IMAGE_VISIBLE|IMAGE_SLIDE_BOTTOM,202,362,232,56,255}
@ -123,7 +101,7 @@ static gui_image bg_main[4] =
static gui_image bg_misc[5] = static gui_image bg_misc[5] =
{ {
{NULL,Bg_main_png,IMAGE_VISIBLE|IMAGE_FADE,146,80,348,288,255}, {NULL,Bg_main_png,IMAGE_VISIBLE|IMAGE_FADE,178,96,284,288,255},
{NULL,Bg_overlay_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,255}, {NULL,Bg_overlay_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,255},
{NULL,Banner_top_png,IMAGE_VISIBLE|IMAGE_SLIDE_TOP,0,0,640,108,255}, {NULL,Banner_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,Banner_bottom_png,IMAGE_VISIBLE|IMAGE_SLIDE_BOTTOM,0,380,640,100,255},
@ -132,7 +110,7 @@ static gui_image bg_misc[5] =
static gui_image bg_ctrls[8] = static gui_image bg_ctrls[8] =
{ {
{NULL,Bg_main_png,IMAGE_VISIBLE,356,144,348,288,255}, {NULL,Bg_main_png,IMAGE_VISIBLE,374,140,284,288,255},
{NULL,Bg_overlay_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,255}, {NULL,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_top_png,IMAGE_VISIBLE,0,0,640,108,255},
{NULL,Banner_bottom_png,IMAGE_VISIBLE,0,380,640,100,255}, {NULL,Banner_bottom_png,IMAGE_VISIBLE,0,380,640,100,255},
@ -144,7 +122,7 @@ static gui_image bg_ctrls[8] =
static gui_image bg_list[6] = static gui_image bg_list[6] =
{ {
{NULL,Bg_main_png,IMAGE_VISIBLE,356,144,348,288,255}, {NULL,Bg_main_png,IMAGE_VISIBLE,374,140,284,288,255},
{NULL,Bg_overlay_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,255}, {NULL,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_top_png,IMAGE_VISIBLE,0,0,640,108,255},
{NULL,Banner_bottom_png,IMAGE_VISIBLE,0,380,640,100,255}, {NULL,Banner_bottom_png,IMAGE_VISIBLE,0,380,640,100,255},
@ -190,22 +168,15 @@ static gui_item items_ctrls[13] =
{NULL,Ctrl_config_png,"Keys\nConfig","Configure Controller Keys",530,306,32,32} {NULL,Ctrl_config_png,"Keys\nConfig","Configure Controller Keys",530,306,32,32}
}; };
#ifdef HW_RVL
static gui_item items_load[4] = static gui_item items_load[4] =
{ {
{NULL,Load_recent_png,"","Load recent ROM files (USB/SD)" ,276,120,88,96}, {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_sd_png ,"","Load ROM files from SDCARD" ,110,266,88,96},
#ifdef HW_RVL
{NULL,Load_usb_png ,"","Load ROM files from USB device" ,276,266,88,96}, {NULL,Load_usb_png ,"","Load ROM files from USB device" ,276,266,88,96},
#endif
{NULL,Load_dvd_png ,"","Load ROM files from DVD" ,442,266,88,96} {NULL,Load_dvd_png ,"","Load ROM files from DVD" ,442,266,88,96}
}; };
#else
static gui_item items_load[3] =
{
{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}
};
#endif
static gui_item items_options[5] = static gui_item items_options[5] =
{ {
@ -267,13 +238,14 @@ static gui_item items_video[8] =
}; };
/* Menu options */ /* Menu options */
static gui_item items_prefs[7] = static gui_item items_prefs[8] =
{ {
{NULL,NULL,"Auto SRAM: OFF", "Enable/disable automatic SRAM", 52,132,276,48}, {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,"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,"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,"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,"BG Color: DEFAULT", "Change background color", 52,132,276,48},
{NULL,NULL,"BG Overlay: ON", "Enable/disable background overlay", 52,132,276,48},
{NULL,NULL,"Screen Width: 658", "Adjust Screen Width", 52,132,276,48}, {NULL,NULL,"Screen Width: 658", "Adjust Screen Width", 52,132,276,48},
{NULL,NULL,"Confirm Box: OFF", "Enable/disable user confirmation", 52,132,276,48} {NULL,NULL,"Confirm Box: OFF", "Enable/disable user confirmation", 52,132,276,48}
}; };
@ -328,22 +300,17 @@ static gui_butn buttons_ctrls[13] =
}; };
/* Load Game menu */ /* Load Game menu */
#ifdef HW_RVL
static gui_butn buttons_load[4] = static gui_butn buttons_load[4] =
{ {
{&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,{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,{1,0,1,1}, 80,248,148,132},
#ifdef HW_RVL
{&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,{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} {&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{3,0,1,0},412,248,148,132}
};
#else #else
static gui_butn buttons_load[3] = {&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{2,0,1,0},412,248,148,132}
{
{&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}
};
#endif #endif
};
/* Options menu */ /* Options menu */
static gui_butn buttons_options[5] = static gui_butn buttons_options[5] =
@ -459,7 +426,7 @@ static gui_menu menu_prefs =
{ {
"Menu Settings", "Menu Settings",
0,0, 0,0,
7,4,6,0, 8,4,6,0,
items_prefs, items_prefs,
buttons_list, buttons_list,
bg_list, bg_list,
@ -491,7 +458,7 @@ static void drawmenu (char items[][25], int maxitems, int selected)
memset(&texture,0,sizeof(gx_texture)); memset(&texture,0,sizeof(gx_texture));
/* draw background items */ /* draw background items */
gxClearScreen (bg_colors[config.bg_color]); gxClearScreen (*GUI_GetBgColor());
texture= gxTextureOpenPNG(Bg_main_png,0); texture= gxTextureOpenPNG(Bg_main_png,0);
if (texture) if (texture)
{ {
@ -625,8 +592,9 @@ static void prefmenu ()
sprintf (items[3].text, "BGM Volume: %1.1f", config.bgm_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); if (config.bg_color) sprintf (items[4].text, "BG Color: Type %d", config.bg_color);
else sprintf (items[4].text, "BG Color: DEFAULT"); else sprintf (items[4].text, "BG Color: DEFAULT");
sprintf (items[5].text, "Screen Width: %d", config.screen_w); sprintf (items[5].text, "BG Overlay: %s", config.bg_overlay ? "ON":"OFF");
sprintf (items[6].text, "Confirmation Box: %s",config.ask_confirm ? "ON":"OFF"); sprintf (items[6].text, "Screen Width: %d", config.screen_w);
sprintf (items[7].text, "Confirmation Box: %s",config.ask_confirm ? "ON":"OFF");
GUI_InitMenu(m); GUI_InitMenu(m);
GUI_SlideMenuTitle(m,strlen("Menu ")); GUI_SlideMenuTitle(m,strlen("Menu "));
@ -672,15 +640,50 @@ static void prefmenu ()
else if (config.bg_color >= BG_COLOR_MAX) config.bg_color = 0; else if (config.bg_color >= BG_COLOR_MAX) config.bg_color = 0;
if (config.bg_color) sprintf (items[4].text, "BG Color: Type %d", config.bg_color); if (config.bg_color) sprintf (items[4].text, "BG Color: Type %d", config.bg_color);
else sprintf (items[4].text, "BG Color: DEFAULT"); else sprintf (items[4].text, "BG Color: DEFAULT");
GUI_SetBgColor(bg_colors[config.bg_color]); GUI_SetBgColor((u8)config.bg_color);
GUI_DeleteMenu(m);
if (config.bg_color == (BG_COLOR_MAX - 1))
{
bg_main[0].data = Bg_main_2_png;
bg_misc[0].data = Bg_main_2_png;
bg_ctrls[0].data = Bg_main_2_png;
bg_list[0].data = Bg_main_2_png;
}
else
{
bg_main[0].data = Bg_main_png;
bg_misc[0].data = Bg_main_png;
bg_ctrls[0].data = Bg_main_png;
bg_list[0].data = Bg_main_png;
}
GUI_InitMenu(m);
break; break;
case 5: case 5: /*** Background items ***/
config.bg_overlay ^= 1;
sprintf (items[5].text, "BG Overlay: %s", config.bg_overlay ? "ON":"OFF");
if (config.bg_overlay)
{
bg_main[1].state |= IMAGE_VISIBLE;
bg_misc[1].state |= IMAGE_VISIBLE;
bg_ctrls[1].state |= IMAGE_VISIBLE;
bg_list[1].state |= IMAGE_VISIBLE;
}
else
{
bg_main[1].state &= ~IMAGE_VISIBLE;
bg_misc[1].state &= ~IMAGE_VISIBLE;
bg_ctrls[1].state &= ~IMAGE_VISIBLE;
bg_list[1].state &= ~IMAGE_VISIBLE;
}
break;
case 6: /*** Screen Width ***/
GUI_OptionBox(m,update_screen_w,"Screen Width",(void *)&config.screen_w,2,640,VI_MAX_WIDTH_NTSC,1); GUI_OptionBox(m,update_screen_w,"Screen Width",(void *)&config.screen_w,2,640,VI_MAX_WIDTH_NTSC,1);
sprintf (items[5].text, "Screen Width: %d", config.screen_w); sprintf (items[5].text, "Screen Width: %d", config.screen_w);
break; break;
case 6: case 7: /*** User COnfirmation ***/
config.ask_confirm ^= 1; config.ask_confirm ^= 1;
sprintf (items[6].text, "Confirmation Box: %s",config.ask_confirm ? "ON":"OFF"); sprintf (items[6].text, "Confirmation Box: %s",config.ask_confirm ? "ON":"OFF");
break; break;
@ -2189,28 +2192,39 @@ static void optionmenu(void)
int ret, quit = 0; int ret, quit = 0;
gui_menu *m = &menu_options; gui_menu *m = &menu_options;
GUI_InitMenu(m);
GUI_DrawMenuFX(m,30,0);
while (quit == 0) while (quit == 0)
{ {
GUI_InitMenu(m);
ret = GUI_RunMenu(m); ret = GUI_RunMenu(m);
GUI_DeleteMenu(m);
switch (ret) switch (ret)
{ {
case 0: case 0:
GUI_DeleteMenu(m);
systemmenu(); systemmenu();
GUI_InitMenu(m);
break; break;
case 1: case 1:
GUI_DeleteMenu(m);
videomenu(); videomenu();
GUI_InitMenu(m);
break; break;
case 2: case 2:
GUI_DeleteMenu(m);
soundmenu(); soundmenu();
GUI_InitMenu(m);
break; break;
case 3: case 3:
GUI_DeleteMenu(m);
ctrlmenu(); ctrlmenu();
GUI_InitMenu(m);
break; break;
case 4: case 4:
GUI_DeleteMenu(m);
prefmenu(); prefmenu();
GUI_InitMenu(m);
break; break;
case -1: case -1:
quit = 1; quit = 1;
@ -2218,6 +2232,8 @@ static void optionmenu(void)
} }
} }
GUI_DrawMenuFX(m,30,1);
GUI_DeleteMenu(m);
config_save(); config_save();
} }
@ -2250,9 +2266,12 @@ static int loadsavemenu (int which)
while (quit == 0) while (quit == 0)
{ {
if (device == 0) sprintf(items[0], "Device: FAT"); if (device == 0)
else if (device == 1) sprintf(items[0], "Device: MCARD A"); sprintf(items[0], "Device: FAT");
else if (device == 2) sprintf(items[0], "Device: MCARD B"); else if (device == 1)
sprintf(items[0], "Device: MCARD A");
else if (device == 2)
sprintf(items[0], "Device: MCARD B");
ret = domenu (&items[0], count, 0); ret = domenu (&items[0], count, 0);
switch (ret) switch (ret)
@ -2268,10 +2287,13 @@ static int loadsavemenu (int which)
case 1: case 1:
case 2: case 2:
SILENT = 1; SILENT = 1;
if (which == 1) quit = ManageState(ret-1,device); if (which == 1)
else if (which == 0) quit = ManageSRAM(ret-1,device); quit = ManageState(ret-1,device);
else if (which == 0)
quit = ManageSRAM(ret-1,device);
SILENT = 0; SILENT = 0;
if (quit) return 1; if (quit)
return 1;
break; break;
} }
} }
@ -2311,7 +2333,8 @@ static int filemenu ()
case 0: /*** SRAM Manager ***/ case 0: /*** SRAM Manager ***/
case 1: /*** SaveState Manager ***/ case 1: /*** SaveState Manager ***/
if (loadsavemenu(ret)) return 1; if (loadsavemenu(ret))
return 1;
break; break;
} }
} }
@ -2327,9 +2350,10 @@ static int filemenu ()
****************************************************************************/ ****************************************************************************/
static int loadmenu () static int loadmenu ()
{ {
int ret,size; int ret;
gui_menu *m = &menu_load; gui_menu *m = &menu_load;
GUI_InitMenu(m); GUI_InitMenu(m);
GUI_DrawMenuFX(m,30,0);
while (1) while (1)
{ {
@ -2339,6 +2363,7 @@ static int loadmenu ()
{ {
/*** Button B ***/ /*** Button B ***/
case -1: case -1:
GUI_DrawMenuFX(m,30,1);
GUI_DeleteMenu(m); GUI_DeleteMenu(m);
return 0; return 0;
@ -2351,8 +2376,8 @@ static int loadmenu ()
if (DVD_Open()) if (DVD_Open())
{ {
GUI_DeleteMenu(m); GUI_DeleteMenu(m);
size = FileSelector(cart.rom,0); if (FileSelector(cart.rom,0))
if (size) return 1; return 1;
GUI_InitMenu(m); GUI_InitMenu(m);
} }
break; break;
@ -2362,8 +2387,8 @@ static int loadmenu ()
if (FAT_Open(ret)) if (FAT_Open(ret))
{ {
GUI_DeleteMenu(m); GUI_DeleteMenu(m);
size = FileSelector(cart.rom,1); if (FileSelector(cart.rom,1))
if (size) return 1; return 1;
GUI_InitMenu(m); GUI_InitMenu(m);
} }
break; break;
@ -2453,13 +2478,13 @@ static void showrominfo ()
break; break;
case 11: case 11:
if (svp) sprintf (msg, "SVP Chip detected"); 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.custom) sprintf (msg, "EEPROM(%dK) - $%06X", ((eeprom.type.size_mask+1)* 8) /1024, (unsigned int)eeprom.type.sda_out_bit);
else if (sram.detected) sprintf (msg, "SRAM Start - $%06X", sram.start); else if (sram.detected) sprintf (msg, "SRAM Start - $%06X", sram.start);
else sprintf (msg, "External RAM undetected"); else sprintf (msg, "External RAM undetected");
break; break;
case 12: case 12:
if (sram.custom) sprintf (msg, "EEPROM(%dK) - $%06X", ((eeprom.type.size_mask+1)* 8) /1024, (unsigned int)sram.end); if (sram.custom) sprintf (msg, "EEPROM(%dK) - $%06X", ((eeprom.type.size_mask+1)* 8) /1024, (unsigned int)eeprom.type.scl_bit);
else if (sram.detected) sprintf (msg, "SRAM End - $%06X", sram.end); else if (sram.detected) sprintf (msg, "SRAM End - $%06X", sram.end);
else if (sram.on) sprintf (msg, "Default SRAM activated "); else if (sram.on) sprintf (msg, "Default SRAM activated ");
else sprintf (msg, "SRAM is disactivated "); else sprintf (msg, "SRAM is disactivated ");
@ -2518,7 +2543,7 @@ void MainMenu (void)
memfile_autosave(config.sram_auto,-1); memfile_autosave(config.sram_auto,-1);
#ifdef HW_RVL #ifdef HW_RVL
/* sutdown Wii */ /* Wiimote shutdown */
if (Shutdown) if (Shutdown)
{ {
GUI_FadeOut(); GUI_FadeOut();
@ -2552,8 +2577,38 @@ void MainMenu (void)
} }
} }
/* Background Settings */
GUI_SetBgColor((u8)config.bg_color);
if (config.bg_color == (BG_COLOR_MAX - 1))
{
bg_main[0].data = Bg_main_2_png;
bg_misc[0].data = Bg_main_2_png;
bg_ctrls[0].data = Bg_main_2_png;
bg_list[0].data = Bg_main_2_png;
}
else
{
bg_main[0].data = Bg_main_png;
bg_misc[0].data = Bg_main_png;
bg_ctrls[0].data = Bg_main_png;
bg_list[0].data = Bg_main_png;
}
if (config.bg_overlay)
{
bg_main[1].state |= IMAGE_VISIBLE;
bg_misc[1].state |= IMAGE_VISIBLE;
bg_ctrls[1].state |= IMAGE_VISIBLE;
bg_list[1].state |= IMAGE_VISIBLE;
}
else
{
bg_main[1].state &= ~IMAGE_VISIBLE;
bg_misc[1].state &= ~IMAGE_VISIBLE;
bg_ctrls[1].state &= ~IMAGE_VISIBLE;
bg_list[1].state &= ~IMAGE_VISIBLE;
}
GUI_InitMenu(m); GUI_InitMenu(m);
GUI_SetBgColor(bg_colors[config.bg_color]);
GUI_DrawMenuFX(m,10,0); GUI_DrawMenuFX(m,10,0);
while (quit == 0) while (quit == 0)
@ -2564,17 +2619,22 @@ void MainMenu (void)
{ {
/*** Load Game Menu ***/ /*** Load Game Menu ***/
case 0: case 0:
GUI_DrawMenuFX(m,30,1);
GUI_DeleteMenu(m); GUI_DeleteMenu(m);
quit = loadmenu(); quit = loadmenu();
if (quit) break; if (quit)
break;
GUI_InitMenu(m); GUI_InitMenu(m);
GUI_DrawMenuFX(m,30,0);
break; break;
/*** Options Menu */ /*** Options Menu */
case 1: case 1:
GUI_DrawMenuFX(m,30,1);
GUI_DeleteMenu(m); GUI_DeleteMenu(m);
optionmenu(); optionmenu();
GUI_InitMenu(m); GUI_InitMenu(m);
GUI_DrawMenuFX(m,30,0);
break; break;
/*** Exit Menu ***/ /*** Exit Menu ***/
@ -2607,23 +2667,43 @@ void MainMenu (void)
break; break;
default: /* credits (TODO !!!) */ default: /* credits (TODO !!!) */
{
#if 0
gxClearScreen ((GXColor){0,0,0,0});
gx_texture *texture = gxTextureOpenPNG(Bg_credits_png,0);
if (texture)
{
gxDrawTexture(texture, (640-texture->width)/2, (480-texture->height)/2, texture->width, texture->height,255);
if (texture->data)
free(texture->data);
free(texture);
}
gxSetScreen();
while (!(m_input.keys & PAD_BUTTON_A) && !(m_input.keys & PAD_BUTTON_B))
VIDEO_WaitVSync ();
#endif
break; break;
} }
}
break; break;
} }
/*** File Manager (TODO !!!) ***/ /*** File Manager (TODO !!!) ***/
case 3: case 3:
if (!cart.romsize) break; if (!cart.romsize)
break;
GUI_DrawMenuFX(m,30,1);
GUI_DeleteMenu(m); GUI_DeleteMenu(m);
quit = filemenu(); quit = filemenu();
if (quit) break; if (quit) break;
GUI_InitMenu(m); GUI_InitMenu(m);
GUI_DrawMenuFX(m,30,0);
break; break;
/*** Virtual system hard reset ***/ /*** Virtual system hard reset ***/
case 4: case 4:
if (!cart.romsize) break; if (!cart.romsize)
break;
GUI_DrawMenuFX(m,10,1); GUI_DrawMenuFX(m,10,1);
GUI_DeleteMenu(m); GUI_DeleteMenu(m);
gxClearScreen((GXColor)BLACK); gxClearScreen((GXColor)BLACK);
@ -2637,16 +2717,20 @@ void MainMenu (void)
/*** Game Genie menu (TODO !!!) ***/ /*** Game Genie menu (TODO !!!) ***/
case 5: case 5:
if (!cart.romsize) break; if (!cart.romsize)
break;
GUI_DrawMenuFX(m,30,1);
GUI_DeleteMenu(m); GUI_DeleteMenu(m);
GetGGEntries(); GetGGEntries();
GUI_InitMenu(m); GUI_InitMenu(m);
GUI_DrawMenuFX(m,30,0);
break; break;
/*** Return to Game ***/ /*** Return to Game ***/
case 6: case 6:
case -1: case -1:
if (!cart.romsize) break; if (!cart.romsize)
break;
GUI_DrawMenuFX(m,10,1); GUI_DrawMenuFX(m,10,1);
GUI_DeleteMenu(m); GUI_DeleteMenu(m);
quit = 1; quit = 1;
@ -2654,7 +2738,8 @@ void MainMenu (void)
/*** Game Capture ***/ /*** Game Capture ***/
case 7: case 7:
if (!cart.romsize) break; if (!cart.romsize)
break;
char filename[MAXPATHLEN]; char filename[MAXPATHLEN];
sprintf(filename,"%s/snaps/%s.png", DEFAULT_PATH, rom_filename); sprintf(filename,"%s/snaps/%s.png", DEFAULT_PATH, rom_filename);
gxSaveScreenshot(filename); gxSaveScreenshot(filename);
@ -2663,9 +2748,11 @@ void MainMenu (void)
/*** ROM information screen (TODO !!!) ***/ /*** ROM information screen (TODO !!!) ***/
case 8: case 8:
if (!cart.romsize) break; if (!cart.romsize) break;
GUI_DrawMenuFX(m,30,1);
GUI_DeleteMenu(m); GUI_DeleteMenu(m);
showrominfo(); showrominfo();
GUI_InitMenu(m); GUI_InitMenu(m);
GUI_DrawMenuFX(m,30,0);
break; break;
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@ -34,9 +34,9 @@
#define SK_UPMEM "/genplus/sk2chip.bin" #define SK_UPMEM "/genplus/sk2chip.bin"
#ifdef HW_RVL #ifdef HW_RVL
#define VERSION "version 1.4.0W" #define VERSION "version 1.4.xW"
#else #else
#define VERSION "version 1.4.0G" #define VERSION "version 1.4.xG"
#endif #endif
#define osd_input_Update() gx_input_UpdateEmu() #define osd_input_Update() gx_input_UpdateEmu()