Skip to content

Commit

Permalink
In-game menu is more convenient
Browse files Browse the repository at this point in the history
  • Loading branch information
infval authored and AKuHAK committed Apr 27, 2018
1 parent 23395b7 commit f499c9c
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 125 deletions.
9 changes: 4 additions & 5 deletions src/drivers/ps2/browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ extern skin FCEUSkin;
/************************************/
extern GSGLOBAL *gsGlobal;
extern GSTEXTURE BG_TEX;
extern GSFONTM *gsFontM;

/************************************/
/* Pad Variables */
Expand All @@ -42,7 +41,7 @@ extern int FONT_HEIGHT;
extern int FONT_WIDTH;
char path[4096] = "path";
int needed_path[2] = { -1, -1 };
char mpartitions[4][256];
extern char mpartitions[4][256];
static u16 history[20]; // 20 levels should be enough
u8 h = 0;
static int first_file_index;
Expand All @@ -53,7 +52,7 @@ extern int Browser_Menu();

static inline char* strzncpy(char *d, const char *s, size_t l) { d[0] = 0; return strncat(d, s, l); }

int comp_entries_by_filename(const void *elem1, const void *elem2)
static int comp_entries_by_filename(const void *elem1, const void *elem2)
{
return strcmp(((entries*)elem1)->filename, ((entries*)elem2)->filename);
}
Expand Down Expand Up @@ -652,8 +651,8 @@ char* Browser(int files_too, int menu_id)
if (selection < 0) { selection = (n-1); }
if (selection != oldselect) {

gsKit_clear(gsGlobal, GS_SETREG_RGBAQ(0x00, 0x00, 0x00, 0x80, 0x00));
browser_primitive("FCEUltra PS2 B0.93 [x.3.2]", "Browser", &BG_TEX, menu_x1, menu_y1, menu_x2, menu_y2);
gsKit_clear(gsGlobal, GS_SETREG_RGBAQ(0x00, 0x00, 0x00, 0x00, 0x00));
browser_primitive("FCEUltra PS2 B0.93 [x.3.3]", "Browser", &BG_TEX, menu_x1, menu_y1, menu_x2, menu_y2);

if (selection > max_item) {
list_offset = text_line - (selection - max_item) * FONT_HEIGHT;
Expand Down
15 changes: 7 additions & 8 deletions src/drivers/ps2/cnfsettings.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ extern GSGLOBAL *gsGlobal;

vars Settings;
skin FCEUSkin;
char control_name[256];
extern int needed_path[2];
extern char mpartitions[4][256];

Expand Down Expand Up @@ -669,13 +668,13 @@ void Default_Global_CNF()

void Default_Skin_CNF()
{
FCEUSkin.frame = GS_SETREG_RGBAQ(0xFF, 0xFF, 0xFF, 0x80, 0x00);
FCEUSkin.textcolor = GS_SETREG_RGBAQ(0xFF, 0xFF, 0xFF, 0x80, 0x00);
FCEUSkin.highlight = GS_SETREG_RGBAQ(0x80, 0x80, 0x40, 0x80, 0x00);
FCEUSkin.bgColor1 = GS_SETREG_RGBAQ(0x80, 0x00, 0x00, 0x80, 0x00);
FCEUSkin.bgColor2 = GS_SETREG_RGBAQ(0x00, 0x00, 0x00, 0x80, 0x00);
FCEUSkin.bgColor3 = GS_SETREG_RGBAQ(0x00, 0x00, 0x00, 0x80, 0x00);
FCEUSkin.bgColor4 = GS_SETREG_RGBAQ(0x80, 0x00, 0x00, 0x80, 0x00);
FCEUSkin.frame = GS_SETREG_RGBAQ(0xFF, 0xFF, 0xFF, 0x00, 0x00);
FCEUSkin.textcolor = GS_SETREG_RGBAQ(0xFF, 0xFF, 0xFF, 0x00, 0x00);
FCEUSkin.highlight = GS_SETREG_RGBAQ(0x80, 0x80, 0x40, 0x00, 0x00);
FCEUSkin.bgColor1 = GS_SETREG_RGBAQ(0x80, 0x00, 0x00, 0x00, 0x00);
FCEUSkin.bgColor2 = GS_SETREG_RGBAQ(0x00, 0x00, 0x00, 0x00, 0x00);
FCEUSkin.bgColor3 = GS_SETREG_RGBAQ(0x00, 0x00, 0x00, 0x00, 0x00);
FCEUSkin.bgColor4 = GS_SETREG_RGBAQ(0x80, 0x00, 0x00, 0x00, 0x00);
strcpy(FCEUSkin.bgTexture, "mc0:/FCEUMM/backg.jpg");
strcpy(FCEUSkin.bgMenu, "mc0:/FCEUMM/strtg.jpg");
}
10 changes: 4 additions & 6 deletions src/drivers/ps2/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
#include "../../fceu-types.h"

#include "ps2fceu.h"
extern unsigned char path[4096];
extern char path[4096];
extern vars Settings;
extern skin FCEUSkin;
extern u8 partitions[2];
char mpartitions[4][256];
int FONT_HEIGHT = 16;
int FONT_WIDTH = 8;
Expand Down Expand Up @@ -539,7 +538,6 @@ struct st_palettes palettes[] = {
GSTEXTURE NES_TEX;
GSTEXTURE BG_TEX;
GSTEXTURE MENU_TEX;
GSFONTM *gsFontM;

u8 menutex = 0;
u8 bgtex = 0;
Expand Down Expand Up @@ -862,13 +860,13 @@ void SetupNESGS()
NES_TEX.Filter = GS_FILTER_NEAREST;
}

// gsKit_clear(gsGlobal, GS_SETREG_RGBA(0x00, 0x00, 0x00, 0x80));
// gsKit_clear(gsGlobal, GS_SETREG_RGBA(0x00, 0x00, 0x00, 0x00));
FCEUD_GetPalette(0, &r, &g, &b);
// r = (NesPalette[ 0 ] & 0xff0000)>>16;
// g = (NesPalette[ 0 ] & 0xff00 )>> 8;
// b = (NesPalette[ 0 ] & 0xff )<< 0;

gsKit_clear(gsGlobal, GS_SETREG_RGBA(r, g, b, 0x80));
gsKit_clear(gsGlobal, GS_SETREG_RGBA(r, g, b, 0x00));
y1 = 0;
v1 = 0;
y2 = NES_TEX.Height*2;
Expand Down Expand Up @@ -921,7 +919,7 @@ void SetupNESGS()
NES_TEX.Width, /* U2 */
v2, /* V2 */
2, /* Z */
GS_SETREG_RGBA(0x80, 0x80, 0x80, 0x80) /* RGBA */
GS_SETREG_RGBA(0x80, 0x80, 0x80, 0x00) /* RGBA */
);
}

Expand Down
Loading

0 comments on commit f499c9c

Please sign in to comment.