prep for easier translations

This commit is contained in:
dsbomb 2008-04-30 03:30:21 +00:00
parent ed39cf2655
commit acbb091033
7 changed files with 348 additions and 309 deletions

View File

@ -1017,7 +1017,7 @@ int OpenSD () {
havedir = 0; havedir = 0;
/* Reset SDCARD root directory */ /* Reset SDCARD root directory */
sprintf(rootSDdir,"dev%d:\\%s\\%s", FCEUDIR, SAVEDIR, ChosenSlot); sprintf(rootSDdir,"dev%d:\\%s\\%s", ChosenSlot, FCEUDIR, ROMSDIR);
sdslot = ChosenSlot; sdslot = ChosenSlot;
/* Parse initial root directory and get entries list */ /* Parse initial root directory and get entries list */

View File

@ -75,7 +75,7 @@ void WaitPrompt( char *msg )
ClearScreen(); ClearScreen();
WriteCentre( 220, msg); WriteCentre( 220, msg);
WriteCentre( 220 + font_height, "Press A to Continue"); WriteCentre( 220 + font_height, MENU_PRESS_A);
if ( PAD_ButtonsDown(0) & PAD_BUTTON_A ) if ( PAD_ButtonsDown(0) & PAD_BUTTON_A )
quit = 1; quit = 1;

View File

@ -8,7 +8,8 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "../../iplfont/iplfont.h" #include "iplfont/iplfont.h"
#include "intl.h"
#define MARGIN 0 #define MARGIN 0
@ -65,13 +66,10 @@ void Reboot() {
#define SCROLLY 395 #define SCROLLY 395
/* color palettes */ /* color palettes */
struct struct {
{
char *name, *desc; char *name, *desc;
unsigned int data[64]; unsigned int data[64];
} } palettes[] = {
palettes[] =
{
/* The default NES palette must be the first entry in the array */ /* The default NES palette must be the first entry in the array */
{ "loopy", "Loopy's NES palette", { "loopy", "Loopy's NES palette",
{ 0x757575, 0x271b8f, 0x0000ab, 0x47009f, { 0x757575, 0x271b8f, 0x0000ab, 0x47009f,
@ -298,24 +296,17 @@ extern GXRModeObj *vmode;
extern int font_size[256]; extern int font_size[256];
extern int font_height; extern int font_height;
extern int screenscaler; extern int screenscaler;
/*extern long blit_lookup[4];
extern long blit_lookup_inv[4];*/
/**************************************************************************** /****************************************************************************
* SetScreen * SetScreen
****************************************************************************/ ****************************************************************************/
void SetScreen() {
void SetScreen()
{
VIDEO_SetNextFramebuffer( xfb[whichfb] ); VIDEO_SetNextFramebuffer( xfb[whichfb] );
VIDEO_Flush(); VIDEO_Flush();
VIDEO_WaitVSync(); VIDEO_WaitVSync();
} }
void ClearScreen() void ClearScreen() {
{
whichfb ^= 1; whichfb ^= 1;
/*VIDEO_ClearFrameBuffer(vmode, xfb[whichfb], 0x258e2573);*/ /*VIDEO_ClearFrameBuffer(vmode, xfb[whichfb], 0x258e2573);*/
memcpy (xfb[whichfb], &backdrop, 1280 * 480); memcpy (xfb[whichfb], &backdrop, 1280 * 480);
@ -345,29 +336,23 @@ void ClearScreen()
* 4. Load ROM * 4. Load ROM
* 4.1 Load ROM from DVD-R * 4.1 Load ROM from DVD-R
***************************************************************************/ ***************************************************************************/
void DrawMenu(char *title, char items[][MENU_STRING_LENGTH], int maxitems, int select) {
void DrawMenu(char items[][30], int maxitems, int select)
{
int i,w,p,h; int i,w,p,h;
ClearScreen(); ClearScreen();
/*** Draw Title Centred ***/ /*** Draw Title Centred ***/
//h = (480 - ((maxitems + 3) * font_height)) / 2;
write_font(CentreTextPosition(title), 22, title);
p = (480 - (maxitems * font_height)) / 2 + 10; p = (480 - (maxitems * font_height)) / 2 + 10;
//p = h + (font_height << 1);
for( i = 0; i < maxitems; i++ ) for( i = 0; i < maxitems; i++ ) {
{
w = CentreTextPosition(items[i]); w = CentreTextPosition(items[i]);
h = GetTextWidth(items[i]); h = GetTextWidth(items[i]);
/* if ( i == select )
writex( w, p, h, font_height, items[i], blit_lookup_inv );
else
writex( w, p, h, font_height, items[i], blit_lookup );*/
writex( w, p, h, font_height, items[i], i == select ); writex( w, p, h, font_height, items[i], i == select );
p += font_height; p += font_height;
} }
@ -379,13 +364,11 @@ void DrawMenu(char items[][30], int maxitems, int select)
* *
* Remap a pad to the correct key * Remap a pad to the correct key
****************************************************************************/ ****************************************************************************/
extern unsigned short gcpadmap[12]; extern unsigned short gcpadmap[10];
char PADMap( int padvalue, int padnum ) char PADMap( int padvalue, int padnum ) {
{
char padkey; char padkey;
switch( padvalue ) switch( padvalue ) {
{
default: default:
case 0: gcpadmap[padnum] = PAD_BUTTON_A; padkey = 'A'; break; case 0: gcpadmap[padnum] = PAD_BUTTON_A; padkey = 'A'; break;
case 1: gcpadmap[padnum] = PAD_BUTTON_B; padkey = 'B'; break; case 1: gcpadmap[padnum] = PAD_BUTTON_B; padkey = 'B'; break;
@ -394,7 +377,6 @@ char PADMap( int padvalue, int padnum )
case 4: gcpadmap[padnum] = PAD_BUTTON_START; padkey = 'S'; break; case 4: gcpadmap[padnum] = PAD_BUTTON_START; padkey = 'S'; break;
case 5: gcpadmap[padnum] = PAD_TRIGGER_Z; padkey = 'Z'; break; case 5: gcpadmap[padnum] = PAD_TRIGGER_Z; padkey = 'Z'; break;
} }
return padkey; return padkey;
} }
@ -403,51 +385,48 @@ char PADMap( int padvalue, int padnum )
* *
* This screen simply let's the user swap A/B/X/Y around. * This screen simply let's the user swap A/B/X/Y around.
****************************************************************************/ ****************************************************************************/
char mpads[6] = { 0, 1, 2, 3, 4, 5 };
int configpadcount = 10;
char padmenu[10][30] = {
{ "NES BUTTON A - A" }, { " BUTTON B - B" }, { " START - S" },
{ " SELECT - Z" }, { " TURBO A - X" }, { " TURBO B - Y" },
{ " FOUR SCORE - OFF" }, { " ANALOG CLIP - 40"}, { " TURBO SPEED - 30.00 pps" },
{ "Return to previous" }
};
unsigned char text[][512] = {
//PAD Configuration
{ "Configure Your Gamepad" },
{ "Up, up, down, down, left, right, left, right, B, A, start" }
};
char mpads[2];
int PADCON = 0; int PADCON = 0;
void ConfigPAD() void ConfigPAD() {
{ int PadMenuCount = 10;
char PadMenu[10][MENU_STRING_LENGTH] = {
{ MENU_CONFIG_A }, { MENU_CONFIG_B }, { MENU_CONFIG_TURBO_A },
{ MENU_CONFIG_TURBO_B }, { MENU_CONFIG_START }, { MENU_CONFIG_SELECT },
{ MENU_CONFIG_FOUR_SCORE }, { MENU_CONFIG_CLIP }, { MENU_CONFIG_SPEED },
{ MENU_EXIT }
};
enum PAD_MENU {
PAD_A, PAD_B, PAD_TURBO_A, PAD_TURBO_B,
PAD_START, PAD_SELECT, PAD_FOUR_SCORE,
PAD_CLIP, PAD_SPEED, PAD_EXIT
};
unsigned char PadMenuText[][512] = {
{ MENU_CONFIG_TEXT1 }, { MENU_CONFIG_TEXT2 }
};
int menu = 0; int menu = 0;
int quit = 0; int quit = 0;
short j; short j;
int redraw = 1; int redraw = 1;
int i; int i = 0;
for ( i = 0; i < 6; i++ )
{
mpads[i] = padmenu[i][15] == 'A' ? 0 :
padmenu[i][15] == 'B' ? 1 :
padmenu[i][15] == 'X' ? 2 :
padmenu[i][15] == 'Y' ? 3 :
padmenu[i][15] == 'S' ? 4 :
padmenu[i][15] == 'Z' ? 5 : 0;
}
line = 0; line = 0;
scrollerx = 320 - MARGIN; scrollerx = 320 - MARGIN;
while ( quit == 0 ) while ( quit == 0 ) {
{ if ( redraw ) {
if ( redraw ) DrawMenu(&padmenu[0], configpadcount, menu); sprintf(PadMenu[PAD_A], MENU_CONFIG_A " - %c", PADMap(mpads[0], 0));
sprintf(PadMenu[PAD_B], MENU_CONFIG_B " - %c", PADMap(mpads[1], 1));
sprintf(PadMenu[PAD_TURBO_A], MENU_CONFIG_TURBO_A " - %c", PADMap(mpads[4], 4));
sprintf(PadMenu[PAD_TURBO_B], MENU_CONFIG_TURBO_B " - %c", PADMap(mpads[5], 5));
sprintf(PadMenu[PAD_START], MENU_CONFIG_START " - %c", PADMap(mpads[2], 2));
sprintf(PadMenu[PAD_SELECT], MENU_CONFIG_SELECT " - %c", PADMap(mpads[3], 3));
sprintf(PadMenu[PAD_FOUR_SCORE], MENU_CONFIG_FOUR_SCORE " - %s", FSDisable ? "OFF" : "ON");
sprintf(PadMenu[PAD_CLIP], MENU_CONFIG_CLIP " - %d", PADCAL);
sprintf(PadMenu[PAD_SPEED], MENU_CONFIG_SPEED " - %.2f pps", (float)60/PADTUR);
DrawMenu(MENU_CONFIG_TITLE, PadMenu, PadMenuCount, menu);
}
redraw = 0; redraw = 0;
j = PAD_ButtonsDown(0); j = PAD_ButtonsDown(0);
@ -465,67 +444,50 @@ void ConfigPAD()
if ( j & PAD_BUTTON_A ) { if ( j & PAD_BUTTON_A ) {
redraw = 1; redraw = 1;
switch( menu ) { switch( menu ) {
case PAD_A: i = 0; break;
case 0: i = 0; break; case PAD_B: i = 1; break;
case PAD_TURBO_A: i = 4; break;
case 1: i = 1; break; case PAD_TURBO_B: i = 5; break;
case PAD_START: i = 2; break;
case 2: i = 2; break; case PAD_SELECT: i = 3; break;
case PAD_FOUR_SCORE: i = -1;
case 3: i = 3; break;
case 4: i = 4; break;
case 5: i = 5; break;
case 6: i = -1;
FSDisable ^= 1; FSDisable ^= 1;
if ( FSDisable )
strcpy(padmenu[6], " FOUR SCORE - OFF");
else
strcpy(padmenu[6], " FOUR SCORE - ON ");
FCEUI_DisableFourScore(FSDisable); FCEUI_DisableFourScore(FSDisable);
break; break;
case 7: i = -1; case PAD_CLIP: i = -1;
PADCAL += 5; PADCAL += 5;
if ( PADCAL > 90 ) if ( PADCAL > 70 )
PADCAL = 40; PADCAL = 30;
sprintf(padmenu[7]," ANALOG CLIP - %d", PADCAL);
break; break;
case 8: i = -1; case PAD_SPEED:i = -1;
PADTUR += 1; PADTUR += 1;
if ( PADTUR > 10 ) PADTUR += 4; if ( PADTUR > 10 ) PADTUR += 4;
if ( PADTUR > 30 ) if ( PADTUR > 30 )
PADTUR = 2; PADTUR = 2;
sprintf(padmenu[8]," TURBO SPEED - %.2f pps", (float)60/PADTUR);
break; break;
case 9: quit=1; return; break; case PAD_EXIT:
quit = 1;
break;
default: break; default: break;
} }
if ( i >= 0 ) { if ( (quit == 0) && (i >= 0) ) {
mpads[i]++; mpads[i]++;
if ( mpads[i] == 6 ) mpads[i] = 0; if ( mpads[i] == 6 ) mpads[i] = 0;
padmenu[i][15] = PADMap( mpads[i], i );
} }
} }
if ( j & PAD_BUTTON_B ) { if ( j & PAD_BUTTON_B ) {
quit=1; return; quit = 1;
} }
if ( menu < 0 ) menu = configpadcount - 1; if ( menu < 0 ) menu = PadMenuCount - 1;
if ( menu == PadMenuCount ) menu = 0;
if ( menu == configpadcount ) menu = 0; scroller(SCROLLY, PadMenuText, 2);
scroller(SCROLLY, &text[0], 2);
VIDEO_WaitVSync(); VIDEO_WaitVSync();
} }
@ -535,12 +497,6 @@ void ConfigPAD()
/**************************************************************************** /****************************************************************************
* Save Game Manager * Save Game Manager
****************************************************************************/ ****************************************************************************/
unsigned char sgmtext[][512] = {
//Save game
{ "From where do you wish to load/save your game?" },
{ "Hard time making up your mind?" }
};
int SdSlotCount = 3; int SdSlotCount = 3;
char SdSlots[3][10] = { char SdSlots[3][10] = {
{ "Slot A" }, { "Slot B" }, { "Wii SD"} { "Slot A" }, { "Slot B" }, { "Wii SD"}
@ -551,21 +507,25 @@ enum SLOTS {
int ChosenSlot = 0; int ChosenSlot = 0;
int ChosenDevice = 1; int ChosenDevice = 1;
int mccount = 5;
char mcmenu[5][30] = {
{ "Save State" }, { "Load State" },
{ "Device" }, { "Slot" },
//{ "Use: SLOT A" }, { "Device: MCARD" },
//{ "Save Game State" }, { "Load Game State" },
{ "Return to Main Menu" }
};
int StateManager() { int StateManager() {
int SaveMenuCount = 5;
char SaveMenu[5][MENU_STRING_LENGTH] = {
{ MENU_SAVE_SAVE }, { MENU_SAVE_LOAD },
{ MENU_SAVE_DEVICE }, { "Slot" },
{ MENU_EXIT }
};
enum SAVE_MENU { enum SAVE_MENU {
SAVE_SAVE, SAVE_LOAD, SAVE_SAVE, SAVE_LOAD,
SAVE_DEVICE, SAVE_SLOT, SAVE_DEVICE, SAVE_SLOT,
SAVE_EXIT SAVE_EXIT
}; };
unsigned char SaveMenuText[][512] = {
//Save game
{ MENU_SAVE_TEXT1 },
{ MENU_SAVE_TEXT2 }
};
int ChosenMenu = 0; int ChosenMenu = 0;
int quit = 0; int quit = 0;
short j; short j;
@ -576,10 +536,10 @@ int StateManager() {
while ( quit == 0 ) { while ( quit == 0 ) {
if ( redraw ) { if ( redraw ) {
sprintf(mcmenu[SAVE_SLOT], "%s: %s", ChosenDevice ? "SDCard" : "MemCard", sprintf(SaveMenu[SAVE_SLOT], "%s: %s", ChosenDevice ? "SDCard" : "MemCard",
SdSlots[ChosenSlot]); SdSlots[ChosenSlot]);
sprintf(mcmenu[SAVE_DEVICE], "Device: %s", ChosenDevice ? "SDCard" : "MemCard"); sprintf(SaveMenu[SAVE_DEVICE], MENU_SAVE_DEVICE ": %s", ChosenDevice ? "SDCard" : "MemCard");
DrawMenu(mcmenu, mccount, ChosenMenu); DrawMenu(MENU_SAVE_TITLE, SaveMenu, SaveMenuCount, ChosenMenu);
redraw = 0; redraw = 0;
} }
@ -612,7 +572,7 @@ int StateManager() {
ChosenSlot = 0; ChosenSlot = 0;
break; break;
case SAVE_EXIT: case SAVE_EXIT:
quit = 1;//return 0 ; quit = 1;
break; break;
default: default:
break; break;
@ -646,12 +606,12 @@ int StateManager() {
if ( j & PAD_BUTTON_B ) quit = 1; if ( j & PAD_BUTTON_B ) quit = 1;
if ( ChosenMenu < 0 ) if ( ChosenMenu < 0 )
ChosenMenu = mccount - 1; ChosenMenu = SaveMenuCount - 1;
if ( ChosenMenu == mccount ) if ( ChosenMenu == SaveMenuCount )
ChosenMenu = 0; ChosenMenu = 0;
scroller(SCROLLY, &sgmtext[0], 2); scroller(SCROLLY, SaveMenuText, 2);
VIDEO_WaitVSync(); VIDEO_WaitVSync();
} }
@ -662,22 +622,24 @@ int StateManager() {
/**************************************************************************** /****************************************************************************
* Video Enhancement Screen * Video Enhancement Screen
****************************************************************************/ ****************************************************************************/
int VideoEnhancements() {
int VideoMenuCount = 5;
char VideoMenu[5][MENU_STRING_LENGTH] = {
{ MENU_VIDEO_SCALER }, { MENU_VIDEO_PALETTE },
{ MENU_VIDEO_SPRITE }, { MENU_VIDEO_TIMING },
{ MENU_EXIT }
};
enum VIDEO_MENU {
VIDEO_SCALER, VIDEO_PALETTE,
VIDEO_SPRITE, VIDEO_TIMING,
VIDEO_EXIT
};
unsigned char VideoMenuText[][512] = {
//Screen Configurator
{ MENU_VIDEO_TEXT1 },
{ MENU_VIDEO_TEXT2 }
};
int vecount = 5;
char vemenu[5][30] = {
{ "Screen Scaler - GX" }, { "Palette - Default" },
{ "8 Sprite Limit - ON " },{ "Timing - NTSC" },
{ "Return to Main Menu" }
};
unsigned char vestext[][512] = {
//Screen Configurator
{ "Wow, these colors and shapes sure are beautiful, brings back the memories." },
{ "Be sure not to mess these settings up, You don't want to ruin the experience! :D" }
};
int VideoEnhancements()
{
int menu = 0; int menu = 0;
int quit = 0; int quit = 0;
short j; short j;
@ -690,13 +652,18 @@ int VideoEnhancements()
while ( quit == 0) while ( quit == 0)
{ {
if ( redraw ) if ( redraw ) {
DrawMenu(&vemenu[0], vecount, menu ); sprintf(VideoMenu[VIDEO_SCALER], MENU_VIDEO_SCALER " - %s",
(screenscaler == 0) ? "2x" : (screenscaler == 1) ? "Cheesy" : "GX");
sprintf(VideoMenu[VIDEO_PALETTE], MENU_VIDEO_PALETTE " - %s",
currpal ? palettes[currpal-1].name : MENU_VIDEO_DEFAULT);
sprintf(VideoMenu[VIDEO_SPRITE], MENU_VIDEO_SPRITE " - %s", slimit ? MENU_ON : MENU_OFF);
sprintf(VideoMenu[VIDEO_TIMING], MENU_VIDEO_TIMING " - %s", timing ? "PAL " : "NTSC");
DrawMenu(MENU_VIDEO_TITLE, VideoMenu, VideoMenuCount, menu );
}
redraw = 0; redraw = 0;
j = PAD_ButtonsDown(0); j = PAD_ButtonsDown(0);
if ( j & PAD_BUTTON_DOWN ) { if ( j & PAD_BUTTON_DOWN ) {
menu++; menu++;
redraw = 1; redraw = 1;
@ -710,33 +677,20 @@ int VideoEnhancements()
if ( j & PAD_BUTTON_A ) { if ( j & PAD_BUTTON_A ) {
redraw = 1; redraw = 1;
switch ( menu ) { switch ( menu ) {
case 0: /*** Scaler ***/ case VIDEO_SCALER:
screenscaler++; if (++screenscaler > 2)
screenscaler = ( screenscaler > 2 ) ? 0 : screenscaler; screenscaler = 0;
switch ( screenscaler )
{
case 2: strcpy(vemenu[0], "Screen Scaler - GX"); break;
case 1: strcpy(vemenu[0], "Screen Scaler - Cheesy"); break;
case 0: strcpy(vemenu[0], "Screen Scaler - 2x"); break;
}
break; break;
case 1: /*** Palette ***/ case VIDEO_PALETTE:
currpal++; if ( ++currpal > MAXPAL )
if ( currpal > MAXPAL )
currpal = 0; currpal = 0;
if ( currpal == 0 ) { if ( currpal == 0 ) {
strcpy(vemenu[1],"Palette - Default");
/*** Do palette reset ***/ /*** Do palette reset ***/
FCEU_ResetPalette(); FCEU_ResetPalette();
} else { } else {
strcpy(vemenu[1],"Palette - ");
strcat(vemenu[1], palettes[currpal-1].name);
/*** Now setup this palette ***/ /*** Now setup this palette ***/
for ( i = 0; i < 64; i++ ) for ( i = 0; i < 64; i++ ) {
{
r = palettes[currpal-1].data[i] >> 16; r = palettes[currpal-1].data[i] >> 16;
g = ( palettes[currpal-1].data[i] & 0xff00 ) >> 8; g = ( palettes[currpal-1].data[i] & 0xff00 ) >> 8;
b = ( palettes[currpal-1].data[i] & 0xff ); b = ( palettes[currpal-1].data[i] & 0xff );
@ -747,28 +701,21 @@ int VideoEnhancements()
} }
} }
break; break;
case 2: slimit ^=1; case VIDEO_SPRITE:
if ( slimit ) slimit ^=1;
strcpy(vemenu[2], "8 Sprite Limit - ON ");
else
strcpy(vemenu[2], "8 Sprite Limit - OFF");
FCEUI_DisableSpriteLimitation( slimit ); FCEUI_DisableSpriteLimitation( slimit );
break; break;
case 3: timing ^= 1; case VIDEO_TIMING:
if ( timing ) timing ^= 1;
strcpy(vemenu[3], "Timing - PAL ");
else
strcpy(vemenu[3], "Timing - NTSC");
FCEUI_SetVidSystem( timing ); FCEUI_SetVidSystem( timing );
break; break;
case 4: quit = 1; break; case VIDEO_EXIT:
quit = 1;
break;
default: break; default: break;
@ -777,24 +724,21 @@ int VideoEnhancements()
if ( j & PAD_BUTTON_B ) quit = 1; if ( j & PAD_BUTTON_B ) quit = 1;
if ( menu < 0 ) if ( menu < 0 )
menu = vecount - 1; menu = VideoMenuCount - 1;
if ( menu == vecount ) if ( menu == VideoMenuCount )
menu = 0; menu = 0;
scroller(SCROLLY, &vestext[0], 2); scroller(SCROLLY, VideoMenuText, 2);
VIDEO_WaitVSync(); VIDEO_WaitVSync();
} }
return 0; return 0;
} }
/**************************************************************************** /****************************************************************************
* ROM Information * ROM Information
****************************************************************************/ ****************************************************************************/
typedef struct { typedef struct {
char ID[4]; /*NES^Z*/ char ID[4]; /*NES^Z*/
u8 ROM_size; u8 ROM_size;
@ -811,11 +755,9 @@ extern u32 VROM_size;
extern u32 iNESGameCRC32; extern u32 iNESGameCRC32;
extern u8 iNESMirroring; extern u8 iNESMirroring;
void ShowROMInfo() void ShowROMInfo() {
{
int i,p; int i,p;
char *title = "ROM Information"; char *title = MENU_INFO_TITLE;
char info[128]; char info[128];
ClearScreen(); ClearScreen();
@ -825,14 +767,13 @@ void ShowROMInfo()
write_font( CentreTextPosition( title ), p, title ); write_font( CentreTextPosition( title ), p, title );
p += ( font_height << 1 ); p += ( font_height << 1 );
for ( i = 0; i < 5; i++ ) for ( i = 0; i < 5; i++ ) {
{
switch (i) { switch (i) {
case 0: sprintf(info, "ROM Size : %d", head.ROM_size ); break; case 0: sprintf(info, MENU_INFO_ROM " : %d", head.ROM_size ); break;
case 1: sprintf(info, "VROM Size : %d", head.VROM_size ); break; case 1: sprintf(info, MENU_INFO_VROM " : %d", head.VROM_size ); break;
case 2: sprintf(info, "iNES CRC : %08x", iNESGameCRC32 ); break; case 2: sprintf(info, MENU_INFO_CRC " : %08x", iNESGameCRC32 ); break;
case 3: sprintf(info, "Mapper : %d", MapperNo ); break; case 3: sprintf(info, MENU_INFO_MAPPER " : %d", MapperNo ); break;
case 4: sprintf(info, "Mirroring : %d", iNESMirroring );break; case 4: sprintf(info, MENU_INFO_MIRROR " : %d", iNESMirroring );break;
} }
write_font( CentreTextPosition( info ), p, info ); write_font( CentreTextPosition( info ), p, info );
@ -842,30 +783,28 @@ void ShowROMInfo()
SetScreen(); SetScreen();
while ( !(PAD_ButtonsDown(0) & (PAD_BUTTON_A | PAD_BUTTON_B)) ) while ( !(PAD_Bu/ttonsDown(0) & (PAD_BUTTON_A | PAD_BUTTON_B)) )
{ VIDEO_WaitVSync(); } { VIDEO_WaitVSync(); }
} }
/**************************************************************************** /****************************************************************************
* Media Select Screen * Media Select Screen
****************************************************************************/ ****************************************************************************/
int MediaMenuCount = 5;
char MediaMenu[5][30] = {
{ "Load from SDCARD"}, { "SDCard: Slot A" },
{ "Load from DVD" }, { "Stop DVD Motor" },
{ "Return to previous" }
};
unsigned char msstext[][512] = {
//Screen Configurator
{ "What are You waiting for? Load some games!" },
{ "Still here?" },
{ "How can You wait this long?! The games are waiting for You!!" }
};
int MediaSelect() { int MediaSelect() {
int MediaMenuCount = 5;
char MediaMenu[5][MENU_STRING_LENGTH] = {
{ MENU_MEDIA_SDCARD }, { "SDCard: Slot A" },
{ MENU_MEDIA_DVD }, { MENU_MEDIA_STOPDVD },
{ MENU_EXIT }
};
unsigned char MediaMenuText[][512] = {
//Screen Configurator
{ MENU_MEDIA_TEXT1 },
{ MENU_MEDIA_TEXT2 },
{ MENU_MEDIA_TEXT3 }
};
enum MEDIA_MENU { enum MEDIA_MENU {
MEDIA_SDCARD, MEDIA_SLOT, MEDIA_SDCARD, MEDIA_SLOT,
MEDIA_DVD, MEDIA_STOPDVD, MEDIA_DVD, MEDIA_STOPDVD,
@ -891,12 +830,11 @@ int MediaSelect() {
while ( quit == 0 ) { while ( quit == 0 ) {
if ( redraw ) { if ( redraw ) {
sprintf(MediaMenu[MEDIA_SLOT], "SDCard: %s", SdSlots[ChosenSlot]); sprintf(MediaMenu[MEDIA_SLOT], "SDCard: %s", SdSlots[ChosenSlot]);
DrawMenu(MediaMenu, MediaMenuCount, ChosenMenu ); DrawMenu(MENU_MEDIA_TITLE, MediaMenu, MediaMenuCount, ChosenMenu );
redraw = 0; redraw = 0;
} }
j = PAD_ButtonsDown(0); j = PAD_ButtonsDown(0);
if ( j & PAD_BUTTON_DOWN ) { if ( j & PAD_BUTTON_DOWN ) {
ChosenMenu++; ChosenMenu++;
redraw = 1; redraw = 1;
@ -937,11 +875,11 @@ int MediaSelect() {
break; break;
#ifndef HW_RVL #ifndef HW_RVL
case MEDIA_STOPDVD: case MEDIA_STOPDVD:
ShowAction((char*)"Stopping DVD Motor ... Wait"); ShowAction((char*)MENU_MEDIA_STOPPING);
dvd_motor_off(); dvd_motor_off();
WaitPrompt((char*)"Stopped DVD Motor"); WaitPrompt((char*)MENU_MEDIA_STOPPED);
case MEDIA_EXIT: case MEDIA_EXIT:
quit = 1; //Previous quit = 1;
break; break;
#endif #endif
@ -972,7 +910,7 @@ int MediaSelect() {
if ( ChosenMenu < 0 ) if ( ChosenMenu < 0 )
ChosenMenu = MediaMenuCount - 1; ChosenMenu = MediaMenuCount - 1;
scroller(SCROLLY, &msstext[0], 3); scroller(SCROLLY, &MediaMenuText[0], 3);
VIDEO_WaitVSync(); VIDEO_WaitVSync();
} }
@ -982,40 +920,38 @@ int MediaSelect() {
/**************************************************************************** /****************************************************************************
* Credits screen * Credits screen
*****************************************************************************/ *****************************************************************************/
char credits[12][512] = {
//{ "Technical" },
{ "Gamecube port by softdev" },
{ "Original FCE by BERO" },
{ "FCE Ultra by Xodnizel" },
{ "DevkitPPC/libogc by wntrmute and shagkur" },
{ "IPLFont by Qoob" },
{ "DVD Codes Courtesy of Ninjamod" },
{ "Zlib by Jean-loup Gailly" },
{ "Misc. addons by KruLLo" },
{ "Extras features Askot" },
{ "Thank you to" },
{ "brakken, mithos, luciddream, HonkeyKong," },
{ "dsbomb for bringing it to the Wii" },
};
void ShowCredits(){ void ShowCredits(){
char CreditsText[12][512] = {
//{ "Technical" },
{ MENU_CREDITS_GCPORT " " MENU_CREDITS_BY " softdev" },
{ MENU_CREDITS_ORIG " " MENU_CREDITS_BY " BERO" },
{ MENU_CREDITS_FCEU " " MENU_CREDITS_BY " Xodnizel" },
{ "DevkitPPC/libogc " MENU_CREDITS_BY " wntrmute, shagkur" },
{ "IPLFont " MENU_CREDITS_BY " Qoob" },
{ MENU_CREDITS_DVD " Ninjamod" },
{ "Zlib " MENU_CREDITS_BY " Jean-loup Gailly" },
{ MENU_CREDITS_MISC " " MENU_CREDITS_BY " KruLLo" },
{ MENU_CREDITS_EXTRAS " " MENU_CREDITS_BY " Askot" },
{ MENU_CREDITS_THANK },
{ "brakken, mithos, luciddream, HonkeyKong," },
{ "dsbomb " MENU_CREDITS_WII },
};
int i,p; int i,p;
char *title = "Credits"; char *title = MENU_CREDITS_TITLE;
char info[128]; char info[128];
ClearScreen(); ClearScreen();
//p = (480 - (7 * font_height)) / 2 + 5; //150 //p = (480 - (7 * font_height)) / 2 + 5; //150
p = 105; //p = 105;
write_font( CentreTextPosition( title ), p, title ); write_font( CentreTextPosition( title ), 22, title );
//p += ( font_height << 1 ); //p += ( font_height << 1 );
p = 133; p = 109;
for ( i = 0; i < 12; i++ ) for ( i = 0; i < 12; i++ ) {
{ sprintf(info, CreditsText[i]);
sprintf(info, credits[i]);
write_font( CentreTextPosition( info ), p, info ); write_font( CentreTextPosition( info ), p, info );
p+=24; p+=24;
//p+=font_height; //p+=font_height;
@ -1025,42 +961,42 @@ void ShowCredits(){
while ( !(PAD_ButtonsDown(0) & (PAD_BUTTON_A | PAD_BUTTON_B)) ) while ( !(PAD_ButtonsDown(0) & (PAD_BUTTON_A | PAD_BUTTON_B)) )
{ VIDEO_WaitVSync(); } { VIDEO_WaitVSync(); }
} }
/**************************************************************************** /****************************************************************************
* Configuration Screen * Main Menu
****************************************************************************/ ****************************************************************************/
int configmenucount = 11; int MainMenu() {
char configmenu[11][30] = { int MainMenuCount = 10;
{ "Play Game" }, char MainMenu[10][MENU_STRING_LENGTH] = {
{ "Reset NES" }, { MENU_MAIN_PLAY },
{ "Load New Game" }, { MENU_MAIN_RESET },
{ "State Manager" }, { MENU_MAIN_LOAD },
{ "ROM Information" }, { MENU_MAIN_SAVE },
{ "Configure Joypads" }, { MENU_MAIN_INFO },
{ "Video Options" }, { MENU_MAIN_JOYPADS },
#ifdef HW_RVL { MENU_MAIN_OPTIONS },
{ "TP Reload" }, { MENU_MAIN_RELOAD },
{ "Reboot Wii" }, { MENU_MAIN_REBOOT },
#else { MENU_MAIN_CREDITS }
{ "PSO/SD Reload" } , };
{ "Reboot Gamecube" }, enum MAIN_MENU {
#endif MAIN_PLAY, MAIN_RESET, MAIN_LOAD,
{ "Credits" } MAIN_SAVE, MAIN_INFO, MAIN_JOYPADS,
}; MAIN_VIDEO, MAIN_RELOAD, MAIN_REBOOT,
MAIN_CREDITS
};
unsigned char MainMenuText[][512] = {
//Main Menu
{ MENU_MAIN_TEXT1 },
{ MENU_MAIN_TEXT2 },
{ MENU_MAIN_TEXT3 },
{ "* * *" },
{ MENU_MAIN_TEXT4 },
{ MENU_MAIN_TEXT5 },
{ MENU_MAIN_TEXT6 }
};
unsigned char cstext[][512] = {
//ConfigScreen
{ "FCE Ultra GameCube Edition - Version 1.0.9 \"SUPER-DELUXE\" ;)" },
{ "Press L + R anytime to return to this menu!" },
{ "Press START + B + X anytime for PSO/SD-reload" },
{ "* * *" },
{ "FCE Ultra GC is a modified port of the FCE Ultra 0.98.12 Nintendo Entertainment system for x86 (Windows/Linux) PC's. In English you can play NES games on your GameCube using either a softmod and/or modchip from a DVD or via a networked connection to your PC." },
{ "Disclaimer - Use at your own RISK!" },
{ "Official Homepage: http://www.tehskeen.net" }
};
int ConfigScreen() {
int menu = 0; int menu = 0;
int quit = 0; int quit = 0;
short j; short j;
@ -1078,31 +1014,16 @@ int ConfigScreen() {
line = 0; line = 0;
scrollerx = 320 - MARGIN; scrollerx = 320 - MARGIN;
while ( quit == 0 ) while ( quit == 0 ) {
{
if ( redraw ) if ( redraw )
/*DrawMenu("FCEU GC Configuration", &configmenu[0], configmenucount, menu );*/ DrawMenu(MENU_CREDITS_TITLE, MainMenu, MainMenuCount, menu );
DrawMenu(&configmenu[0], configmenucount, menu );
redraw = 0; redraw = 0;
//while (menu == 9 && !(PAD_ButtonsDown(0) & PAD_BUTTON_UP) && !(PAD_ButtonsDown(0) & PAD_BUTTON_DOWN))
// { scroller(SCROLLY, &credits[0], 12);VIDEO_WaitVSync(); }
/*if (menu == 9) {
scrollerx = 320 - MARGIN;
line = 0;
}*/
j = PAD_ButtonsDown(0); j = PAD_ButtonsDown(0);
if (j & PAD_BUTTON_DOWN) { if (j & PAD_BUTTON_DOWN) {
menu++; menu++;
redraw = 1; redraw = 1;
/*if (menu == 9) {
scrollerx = 320 - MARGIN;
line = 0;
}*/
} }
if (j & PAD_BUTTON_UP) { if (j & PAD_BUTTON_UP) {
@ -1117,51 +1038,51 @@ int ConfigScreen() {
if (j & PAD_BUTTON_A ) { if (j & PAD_BUTTON_A ) {
redraw = 1; redraw = 1;
switch ( menu ) { switch ( menu ) {
case 0: // Play Game case MAIN_PLAY:
quit = 1; quit = 1;
break; break;
case 1: // Reset NES case MAIN_RESET:
ResetNES(); ResetNES();
return 1; quit = 1;
break; break;
case 2: // Load new Game case MAIN_LOAD:
if (MediaSelect()) { if (MediaSelect()) {
if (GCMemROM() >= 0) if (GCMemROM() >= 0)
return 1;/* Fix by Garglub. Thanks! */ return 1; /* Fix by Garglub. Thanks! */
} }
scrollerx = 320 - MARGIN; scrollerx = 320 - MARGIN;
break; break;
case 3: // State Manager case MAIN_SAVE:
if (StateManager()) return 2; if (StateManager()) return 2;
scrollerx = 320 - MARGIN; scrollerx = 320 - MARGIN;
break; break;
case 4: // Game Information case MAIN_INFO:
ShowROMInfo(); ShowROMInfo();
break; break;
case 5: // COnfigure Joypads case MAIN_JOYPADS:
ConfigPAD(); ConfigPAD();
scrollerx = 320 - MARGIN; scrollerx = 320 - MARGIN;
break; break;
case 6: // Video Options case MAIN_VIDEO:
if (VideoEnhancements()) return 2; if (VideoEnhancements()) return 2;
scrollerx = 320 - MARGIN; scrollerx = 320 - MARGIN;
break; break;
case 7: // PSO/SD Reload case MAIN_RELOAD:
PSOReload(); PSOReload();
break; break;
case 8: // Reboot case MAIN_REBOOT:
Reboot(); Reboot();
break; break;
case 9: // Credits case MAIN_CREDITS:
ShowCredits(); ShowCredits();
break; break;
@ -1172,13 +1093,13 @@ int ConfigScreen() {
if (j & PAD_BUTTON_B ) { if (j & PAD_BUTTON_B ) {
quit = 1; quit = 1;
} }
if ( menu == configmenucount ) if ( menu == MainMenuCount )
menu = 0; menu = 0;
if ( menu < 0 ) if ( menu < 0 )
menu = configmenucount - 1; menu = MainMenuCount - 1;
scroller(SCROLLY, &cstext[0], 7); scroller(SCROLLY, MainMenuText, 7);
VIDEO_WaitVSync(); VIDEO_WaitVSync();
} }

View File

@ -0,0 +1,16 @@
/*
* This file holds collections of strings to make localization easier.
* Keep the max string length to 30 characters or bad things will happen
*/
#define MENU_STRING_LENGTH 30
#ifdef INTL_SPANISH
//#include "intl/spanish.h"
#elif defined INTL_GERMAN
//#include "intl/german.h"
#elif defined INTL_DUTCH
//#include "intl/dutch.h"
#else
#include "intl/english.h"
#endif

View File

@ -0,0 +1,102 @@
/*
* ---------------------------------------------------------------------------
* English by dsbomb
* ---------------------------------------------------------------------------
*/
// Some general menu strings
#define MENU_ON "ON"
#define MENU_OFF "OFF"
#define MENU_EXIT "Return to Previous"
#define MENU_PRESS_A "Press A to Continue"
// Main menu
#define MENU_MAIN_PLAY "Play Game"
#define MENU_MAIN_RESET "Reset NES"
#define MENU_MAIN_LOAD "Load New Game"
#define MENU_MAIN_SAVE "Save Manager"
#define MENU_MAIN_INFO "ROM Information"
#define MENU_MAIN_JOYPADS "Configure Joypads"
#define MENU_MAIN_OPTIONS "Video Options"
#ifdef HW_RVL
#define MENU_MAIN_RELOAD "TP Reload"
#define MENU_MAIN_REBOOT "Reboot Wii"
#else
#define MENU_MAIN_RELOAD "PSO Reload"
#define MENU_MAIN_REBOOT "Reboot Gamecube"
#endif
#define MENU_MAIN_CREDITS "View Credits"
#define MENU_MAIN_TEXT1 MENU_CREDITS_TITLE
#define MENU_MAIN_TEXT2 "Press L + R anytime to return to this menu!"
#define MENU_MAIN_TEXT3 "Press START + B + X anytime for PSO/SD-reload"
#define MENU_MAIN_TEXT4 "FCE Ultra GC is a modified port of the FCE Ultra 0.98.12 Nintendo Entertainment system for x86 (Windows/Linux) PC's. In English you can play NES games on your GameCube using either a softmod and/or modchip from a DVD or via a networked connection to your PC."
#define MENU_MAIN_TEXT5 "Disclaimer - Use at your own RISK!"
#define MENU_MAIN_TEXT6 "Official Homepage: http://www.tehskeen.net"
// Media menu
#define MENU_MEDIA_TITLE "Load a Game"
#define MENU_MEDIA_SDCARD "Load from SDCard"
#define MENU_MEDIA_DVD "Load from DVD"
#define MENU_MEDIA_STOPDVD "Stop DVD Motor"
#define MENU_MEDIA_STOPPING "Stopping DVD ... Wait"
#define MENU_MEDIA_STOPPED "DVD Motor Stopped"
#define MENU_MEDIA_TEXT1 "What are You waiting for? Load some games!"
#define MENU_MEDIA_TEXT2 "Still here?"
#define MENU_MEDIA_TEXT3 "How can You wait this long?! The games are waiting for You!!"
// Save menu
#define MENU_SAVE_TITLE "Save State Manager"
#define MENU_SAVE_SAVE "Save State"
#define MENU_SAVE_LOAD "Load State"
#define MENU_SAVE_DEVICE "Device"
#define MENU_SAVE_TEXT1 "From where do you wish to load/save your game?"
#define MENU_SAVE_TEXT2 "Hard time making up your mind?"
// Rom Information
#define MENU_INFO_TITLE "ROM Information"
#define MENU_INFO_ROM "ROM Size"
#define MENU_INFO_VROM "VROM Size"
#define MENU_INFO_CRC "iNES CRC"
#define MENU_INFO_MAPPER "Mapper"
#define MENU_INFO_MIRROR "Mirroring"
// Config Joypad menu
#define MENU_CONFIG_TITLE "Controller Configuration"
#define MENU_CONFIG_A "NES Button A"
#define MENU_CONFIG_B "NES Button B"
#define MENU_CONFIG_START "NES Button START"
#define MENU_CONFIG_SELECT "NES Button SELECT"
#define MENU_CONFIG_TURBO_A "NES Button TURBO A"
#define MENU_CONFIG_TURBO_B "NES Button TURBO B"
#define MENU_CONFIG_FOUR_SCORE "Four Score"
#define MENU_CONFIG_CLIP "Analog Clip"
#define MENU_CONFIG_SPEED "Turbo Speed"
#define MENU_CONFIG_TEXT1 "Configure Your Gamepad"
#define MENU_CONFIG_TEXT2 "Up, up, down, down, left, right, left, right, B, A, start"
// Emulator Options menu
#define MENU_VIDEO_TITLE "Video Options"
#define MENU_VIDEO_SCALER "Screen Scaler"
#define MENU_VIDEO_PALETTE "Palette"
#define MENU_VIDEO_SPRITE "8 Sprite Limit"
#define MENU_VIDEO_TIMING "Timing"
#define MENU_VIDEO_DEFAULT "Default"
#define MENU_VIDEO_TEXT1 "Wow, these colors and shapes sure are beautiful, brings back the memories."
#define MENU_VIDEO_TEXT2 "Be sure not to mess these settings up, You don't want to ruin the experience! :D"
// Credits menu
#ifdef HW_RVL
#define MENU_CREDITS_TITLE "FCE Ultra Wii Edition v1.0.10beta1"
#else
#define MENU_CREDITS_TITLE "FCE Ultra GC Edition v1.0.10beta1"
#endif
#define MENU_CREDITS_BY "by"
#define MENU_CREDITS_GCPORT "Gamecube Port"
#define MENU_CREDITS_ORIG "Original FCE"
#define MENU_CREDITS_FCEU "FCE Ultra"
#define MENU_CREDITS_DVD "DVD Codes courtesy of"
#define MENU_CREDITS_MISC "Misc addons"
#define MENU_CREDITS_EXTRAS "Extra features"
#define MENU_CREDITS_THANK "Thank you to"
#define MENU_CREDITS_WII "for bringing it to the Wii"

View File

@ -33,7 +33,7 @@ int eoptions=EO_BGRUN | EO_FORCEISCALE;
extern int RenderFrame( char *XBuf , int style); extern int RenderFrame( char *XBuf , int style);
extern int ConfigScreen(); extern int MainMenu();
extern void InitialiseSound(); extern void InitialiseSound();
extern void initDisplay(); extern void initDisplay();
@ -93,7 +93,7 @@ int main(int argc, char *argv[]) {
cleanSFMDATA(); cleanSFMDATA();
GCMemROM(); GCMemROM();
ConfigScreen(); MainMenu();
while (1) { while (1) {
uint8 *gfx; uint8 *gfx;

View File

@ -15,7 +15,7 @@ unsigned short skipb[4] = {0, 0, 0, 0};
unsigned short op[4] = {0, 0, 0, 0}; unsigned short op[4] = {0, 0, 0, 0};
extern int ConfigScreen(); extern int MainMenu();
/**************************************************************************** /****************************************************************************
* Initialise Pads * Initialise Pads
@ -139,7 +139,7 @@ int GetJoy()
signed char px; signed char px;
px = PAD_SubStickX (0); px = PAD_SubStickX (0);
if (((px < -PADCAL)) || (PAD_ButtonsHeld(0) == ( PAD_TRIGGER_L | PAD_TRIGGER_R ))) { if (((px < -PADCAL)) || (PAD_ButtonsHeld(0) == ( PAD_TRIGGER_L | PAD_TRIGGER_R ))) {
t = ConfigScreen(); t = MainMenu();
if (t == 1) { if (t == 1) {
return 1; return 1;
} }