reorg menu, fix intermittent crashes/freezes problem, bg now stored in MEM2, change savebuffer alloc, other misc changes

This commit is contained in:
dborth 2008-09-30 05:31:46 +00:00
parent dba88e0437
commit 5730ab7f94
8 changed files with 393 additions and 362 deletions

View File

@ -59,7 +59,7 @@ unsigned char *savebuffer = NULL;
/**************************************************************************** /****************************************************************************
* AllocSaveBuffer () * AllocSaveBuffer ()
* Clear and allocate the savebuffer * Allocate and clear the savebuffer
***************************************************************************/ ***************************************************************************/
void void
AllocSaveBuffer () AllocSaveBuffer ()
@ -67,7 +67,7 @@ AllocSaveBuffer ()
if (savebuffer != NULL) if (savebuffer != NULL)
free(savebuffer); free(savebuffer);
savebuffer = (unsigned char *) memalign(32, SAVEBUFFERSIZE); savebuffer = (unsigned char *) malloc(SAVEBUFFERSIZE);
memset (savebuffer, 0, SAVEBUFFERSIZE); memset (savebuffer, 0, SAVEBUFFERSIZE);
} }

View File

@ -161,17 +161,17 @@ NGCFreezeGame (int method, bool8 silent)
{ {
sprintf (filename, "%s.snz", Memory.ROMName); sprintf (filename, "%s.snz", Memory.ROMName);
/*** Copy in save icon ***/ // Copy in save icon
int woffset = sizeof (saveicon); int woffset = sizeof (saveicon);
memcpy (savebuffer, saveicon, woffset); memcpy (savebuffer, saveicon, woffset);
/*** And the freezecomment ***/ // And the freezecomment
sprintf (freezecomment[0], "%s Freeze", VERSIONSTR); sprintf (freezecomment[0], "%s Freeze", VERSIONSTR);
sprintf (freezecomment[1], Memory.ROMName); sprintf (freezecomment[1], Memory.ROMName);
memcpy (savebuffer + woffset, freezecomment, 64); memcpy (savebuffer + woffset, freezecomment, 64);
woffset += 64; woffset += 64;
/*** Zip and copy in the freeze ***/ // Zip and copy in the freeze
uLongf DestBuffSize = (uLongf) SAVEBUFFERSIZE; uLongf DestBuffSize = (uLongf) SAVEBUFFERSIZE;
int err= compress2((Bytef*)(savebuffer+woffset+8), (uLongf*)&DestBuffSize, (const Bytef*)savebuffer, (uLongf)bufoffset, Z_BEST_COMPRESSION); int err= compress2((Bytef*)(savebuffer+woffset+8), (uLongf*)&DestBuffSize, (const Bytef*)savebuffer, (uLongf)bufoffset, Z_BEST_COMPRESSION);
@ -290,7 +290,8 @@ NGCUnfreezeGame (int method, bool8 silent)
if (ret) if (ret)
{ {
char zipbuffer[SAVEBUFFERSIZE]; char * zipbuffer = (char *)malloc(SAVEBUFFERSIZE);
memset (zipbuffer, 0, SAVEBUFFERSIZE);
// skip the saveicon and comment // skip the saveicon and comment
offset = (sizeof(saveicon) + 64); offset = (sizeof(saveicon) + 64);
@ -310,18 +311,21 @@ NGCUnfreezeGame (int method, bool8 silent)
{ {
sprintf (msg, "Unzip error %s ",zError(err)); sprintf (msg, "Unzip error %s ",zError(err));
WaitPrompt (msg); WaitPrompt (msg);
return 0;
} }
else if ( DestBuffSize != decompressedsize ) else if ( DestBuffSize != decompressedsize )
{ {
WaitPrompt((char*) "Unzipped size doesn't match expected size!"); WaitPrompt((char*) "Unzipped size doesn't match expected size!");
return 0;
} }
else else
{ {
offset = SAVEBUFFERSIZE; offset = SAVEBUFFERSIZE;
memcpy (savebuffer, zipbuffer, SAVEBUFFERSIZE); memcpy (savebuffer, zipbuffer, SAVEBUFFERSIZE);
} }
free(zipbuffer);
zipbuffer = NULL;
if(offset == 0)
return 0;
} }
} }

View File

@ -114,301 +114,6 @@ LoadManager ()
return loadROM; return loadROM;
} }
/****************************************************************************
* Preferences Menu
***************************************************************************/
static int prefmenuCount = 11;
static char prefmenu[][50] = {
"Load Method",
"Load Folder",
"Save Method",
"Save Folder",
"Auto Load",
"Auto Save",
"Verify MC Saves",
"Reverse Stereo",
"Interpolated Sound",
"Save Preferences",
"Back to Main Menu"
};
void
PreferencesMenu ()
{
int ret = 0;
int quit = 0;
int oldmenu = menu;
menu = 0;
while (quit == 0)
{
// some load/save methods are not implemented - here's where we skip them
// they need to be skipped in the order they were enumerated in snes9xGX.h
// no USB ports on GameCube
#ifndef HW_RVL
if(GCSettings.LoadMethod == METHOD_USB)
GCSettings.LoadMethod++;
if(GCSettings.SaveMethod == METHOD_USB)
GCSettings.SaveMethod++;
#endif
// saving to DVD is impossible
if(GCSettings.SaveMethod == METHOD_DVD)
GCSettings.SaveMethod++;
// disable SMB in GC mode (stalls out)
#ifndef HW_RVL
if(GCSettings.LoadMethod == METHOD_SMB)
GCSettings.LoadMethod++;
if(GCSettings.SaveMethod == METHOD_SMB)
GCSettings.SaveMethod++;
#endif
// disable MC saving in Wii mode - does not work for some reason!
#ifdef HW_RVL
if(GCSettings.SaveMethod == METHOD_MC_SLOTA)
GCSettings.SaveMethod++;
if(GCSettings.SaveMethod == METHOD_MC_SLOTB)
GCSettings.SaveMethod++;
#endif
// correct load/save methods out of bounds
if(GCSettings.LoadMethod > 4)
GCSettings.LoadMethod = 0;
if(GCSettings.SaveMethod > 6)
GCSettings.SaveMethod = 0;
if (GCSettings.LoadMethod == METHOD_AUTO) sprintf (prefmenu[0],"Load Method AUTO");
else if (GCSettings.LoadMethod == METHOD_SD) sprintf (prefmenu[0],"Load Method SD");
else if (GCSettings.LoadMethod == METHOD_USB) sprintf (prefmenu[0],"Load Method USB");
else if (GCSettings.LoadMethod == METHOD_DVD) sprintf (prefmenu[0],"Load Method DVD");
else if (GCSettings.LoadMethod == METHOD_SMB) sprintf (prefmenu[0],"Load Method Network");
sprintf (prefmenu[1], "Load Folder %s", GCSettings.LoadFolder);
if (GCSettings.SaveMethod == METHOD_AUTO) sprintf (prefmenu[2],"Save Method AUTO");
else if (GCSettings.SaveMethod == METHOD_SD) sprintf (prefmenu[2],"Save Method SD");
else if (GCSettings.SaveMethod == METHOD_USB) sprintf (prefmenu[2],"Save Method USB");
else if (GCSettings.SaveMethod == METHOD_SMB) sprintf (prefmenu[2],"Save Method Network");
else if (GCSettings.SaveMethod == METHOD_MC_SLOTA) sprintf (prefmenu[2],"Save Method MC Slot A");
else if (GCSettings.SaveMethod == METHOD_MC_SLOTB) sprintf (prefmenu[2],"Save Method MC Slot B");
sprintf (prefmenu[3], "Save Folder %s", GCSettings.SaveFolder);
// disable changing load/save directories for now
prefmenu[1][0] = '\0';
prefmenu[3][0] = '\0';
if (GCSettings.AutoLoad == 0) sprintf (prefmenu[4],"Auto Load OFF");
else if (GCSettings.AutoLoad == 1) sprintf (prefmenu[4],"Auto Load SRAM");
else if (GCSettings.AutoLoad == 2) sprintf (prefmenu[4],"Auto Load SNAPSHOT");
if (GCSettings.AutoSave == 0) sprintf (prefmenu[5],"Auto Save OFF");
else if (GCSettings.AutoSave == 1) sprintf (prefmenu[5],"Auto Save SRAM");
else if (GCSettings.AutoSave == 2) sprintf (prefmenu[5],"Auto Save SNAPSHOT");
else if (GCSettings.AutoSave == 3) sprintf (prefmenu[5],"Auto Save BOTH");
sprintf (prefmenu[6], "Verify MC Saves %s",
GCSettings.VerifySaves == true ? " ON" : "OFF");
sprintf (prefmenu[7], "Reverse Stereo %s",
Settings.ReverseStereo == true ? " ON" : "OFF");
sprintf (prefmenu[8], "Interpolated Sound %s",
Settings.InterpolatedSound == true ? " ON" : "OFF");
ret = RunMenu (prefmenu, prefmenuCount, (char*)"Preferences", 16);
switch (ret)
{
case 0:
GCSettings.LoadMethod ++;
break;
case 1:
break;
case 2:
GCSettings.SaveMethod ++;
break;
case 3:
break;
case 4:
GCSettings.AutoLoad ++;
if (GCSettings.AutoLoad > 2)
GCSettings.AutoLoad = 0;
break;
case 5:
GCSettings.AutoSave ++;
if (GCSettings.AutoSave > 3)
GCSettings.AutoSave = 0;
break;
case 6:
GCSettings.VerifySaves ^= 1;
break;
case 7:
Settings.ReverseStereo ^= 1;
break;
case 8:
Settings.InterpolatedSound ^= 1;
break;
case 9:
SavePrefs(GCSettings.SaveMethod, NOTSILENT);
break;
case -1: /*** Button B ***/
case 10:
quit = 1;
break;
}
}
menu = oldmenu;
}
/****************************************************************************
* Video Options
***************************************************************************/
static int videomenuCount = 14;
static char videomenu[][50] = {
"Transparency",
"Display Frame Rate",
"Enable Zooming",
"Video Filtering",
"Widescreen",
"X-shift ++",
" --",
"Y-shift ++",
" --",
"X-shift: ",
"Y-shift: ",
"Reset Video Shifts",
"Save Preferences",
"Back to Main Menu"
};
void
VideoOptions ()
{
int ret = 0;
int quit = 0;
int oldmenu = menu;
menu = 0;
while (quit == 0)
{
sprintf (prefmenu[0], "Transparency %s",
Settings.Transparency == true ? " ON" : "OFF");
sprintf (prefmenu[1], "Display Frame Rate %s",
Settings.DisplayFrameRate == true ? " ON" : "OFF");
sprintf (prefmenu[2], "Enable Zooming %s",
GCSettings.NGCZoom == true ? " ON" : "OFF");
// don't allow original render mode if progressive video mode detected
if (GCSettings.render==0 && progressive)
GCSettings.render++;
if ( GCSettings.render == 0 )
sprintf (prefmenu[3], "Video Rendering Original");
if ( GCSettings.render == 1 )
sprintf (prefmenu[3], "Video Rendering Filtered");
if ( GCSettings.render == 2 )
sprintf (prefmenu[3], "Video Rendering Unfiltered");
sprintf (prefmenu[4], "Video Scaling %s",
GCSettings.widescreen == true ? "16:9 Correction" : "Default");
sprintf (prefmenu[9], "X-shift: %d", GCSettings.xshift);
sprintf (prefmenu[10], "Y-shift: %d", GCSettings.yshift);
ret = RunMenu (videomenu, videomenuCount, (char*)"Video Options", 16);
switch (ret)
{
case 0:
Settings.Transparency ^= 1;
break;
case 1:
Settings.DisplayFrameRate ^= 1;
break;
case 2:
GCSettings.NGCZoom ^= 1;
break;
case 3:
GCSettings.render++;
if (GCSettings.render > 2 )
GCSettings.render = 0;
// reset zoom
zoom_reset ();
break;
case 4:
GCSettings.widescreen ^= 1;
break;
case 5:
// xscale UP
GCSettings.xshift++;
break;
case 6:
// xscale DOWN
GCSettings.xshift--;
break;
case 7:
// yscale UP
GCSettings.yshift++;
break;
case 8:
// yscale DOWN
GCSettings.yshift--;
break;
case 9:
case 10:
break;
case 11:
// reset video shifts
GCSettings.xshift = GCSettings.yshift = 0;
break;
case 12:
SavePrefs(GCSettings.SaveMethod, NOTSILENT);
break;
case -1: /*** Button B ***/
case 13:
quit = 1;
break;
}
}
menu = oldmenu;
}
/**************************************************************************** /****************************************************************************
* Cheat Menu * Cheat Menu
***************************************************************************/ ***************************************************************************/
@ -693,6 +398,286 @@ GameMenu ()
return retval; return retval;
} }
/****************************************************************************
* File Options Menu
***************************************************************************/
static int filemenuCount = 8;
static char filemenu[][50] = {
"Load Method",
"Load Folder",
"Save Method",
"Save Folder",
"Auto Load",
"Auto Save",
"Verify MC Saves",
"Back to Preferences Menu"
};
void
FileOptions ()
{
int ret = 0;
int quit = 0;
int oldmenu = menu;
menu = 0;
while (quit == 0)
{
// some load/save methods are not implemented - here's where we skip them
// they need to be skipped in the order they were enumerated in snes9xGX.h
// no USB ports on GameCube
#ifndef HW_RVL
if(GCSettings.LoadMethod == METHOD_USB)
GCSettings.LoadMethod++;
if(GCSettings.SaveMethod == METHOD_USB)
GCSettings.SaveMethod++;
#endif
// saving to DVD is impossible
if(GCSettings.SaveMethod == METHOD_DVD)
GCSettings.SaveMethod++;
// disable SMB in GC mode (stalls out)
#ifndef HW_RVL
if(GCSettings.LoadMethod == METHOD_SMB)
GCSettings.LoadMethod++;
if(GCSettings.SaveMethod == METHOD_SMB)
GCSettings.SaveMethod++;
#endif
// disable MC saving in Wii mode - does not work for some reason!
#ifdef HW_RVL
if(GCSettings.SaveMethod == METHOD_MC_SLOTA)
GCSettings.SaveMethod++;
if(GCSettings.SaveMethod == METHOD_MC_SLOTB)
GCSettings.SaveMethod++;
#endif
// correct load/save methods out of bounds
if(GCSettings.LoadMethod > 4)
GCSettings.LoadMethod = 0;
if(GCSettings.SaveMethod > 6)
GCSettings.SaveMethod = 0;
if (GCSettings.LoadMethod == METHOD_AUTO) sprintf (filemenu[0],"Load Method AUTO");
else if (GCSettings.LoadMethod == METHOD_SD) sprintf (filemenu[0],"Load Method SD");
else if (GCSettings.LoadMethod == METHOD_USB) sprintf (filemenu[0],"Load Method USB");
else if (GCSettings.LoadMethod == METHOD_DVD) sprintf (filemenu[0],"Load Method DVD");
else if (GCSettings.LoadMethod == METHOD_SMB) sprintf (filemenu[0],"Load Method Network");
sprintf (filemenu[1], "Load Folder %s", GCSettings.LoadFolder);
if (GCSettings.SaveMethod == METHOD_AUTO) sprintf (filemenu[2],"Save Method AUTO");
else if (GCSettings.SaveMethod == METHOD_SD) sprintf (filemenu[2],"Save Method SD");
else if (GCSettings.SaveMethod == METHOD_USB) sprintf (filemenu[2],"Save Method USB");
else if (GCSettings.SaveMethod == METHOD_SMB) sprintf (filemenu[2],"Save Method Network");
else if (GCSettings.SaveMethod == METHOD_MC_SLOTA) sprintf (filemenu[2],"Save Method MC Slot A");
else if (GCSettings.SaveMethod == METHOD_MC_SLOTB) sprintf (filemenu[2],"Save Method MC Slot B");
sprintf (filemenu[3], "Save Folder %s", GCSettings.SaveFolder);
// disable changing load/save directories for now
filemenu[1][0] = '\0';
filemenu[3][0] = '\0';
if (GCSettings.AutoLoad == 0) sprintf (filemenu[4],"Auto Load OFF");
else if (GCSettings.AutoLoad == 1) sprintf (filemenu[4],"Auto Load SRAM");
else if (GCSettings.AutoLoad == 2) sprintf (filemenu[4],"Auto Load SNAPSHOT");
if (GCSettings.AutoSave == 0) sprintf (filemenu[5],"Auto Save OFF");
else if (GCSettings.AutoSave == 1) sprintf (filemenu[5],"Auto Save SRAM");
else if (GCSettings.AutoSave == 2) sprintf (filemenu[5],"Auto Save SNAPSHOT");
else if (GCSettings.AutoSave == 3) sprintf (filemenu[5],"Auto Save BOTH");
sprintf (filemenu[6], "Verify MC Saves %s",
GCSettings.VerifySaves == true ? " ON" : "OFF");
ret = RunMenu (filemenu, filemenuCount, (char*)"Save/Load Options", 16);
switch (ret)
{
case 0:
GCSettings.LoadMethod ++;
break;
case 1:
break;
case 2:
GCSettings.SaveMethod ++;
break;
case 3:
break;
case 4:
GCSettings.AutoLoad ++;
if (GCSettings.AutoLoad > 2)
GCSettings.AutoLoad = 0;
break;
case 5:
GCSettings.AutoSave ++;
if (GCSettings.AutoSave > 3)
GCSettings.AutoSave = 0;
break;
case 6:
GCSettings.VerifySaves ^= 1;
break;
case -1: /*** Button B ***/
case 7:
SavePrefs(GCSettings.SaveMethod, SILENT);
quit = 1;
break;
}
}
menu = oldmenu;
}
/****************************************************************************
* Video Options
***************************************************************************/
static int videomenuCount = 14;
static char videomenu[][50] = {
"Transparency",
"Display Frame Rate",
"Enable Zooming",
"Video Filtering",
"Widescreen",
"X-shift ++",
" --",
"Y-shift ++",
" --",
"Shift: ",
"Reset Video Shift",
"Reverse Stereo",
"Interpolated Sound",
"Back to Preferences Menu"
};
void
VideoOptions ()
{
int ret = 0;
int quit = 0;
int oldmenu = menu;
menu = 0;
while (quit == 0)
{
sprintf (videomenu[0], "Transparency %s",
Settings.Transparency == true ? " ON" : "OFF");
sprintf (videomenu[1], "Display Frame Rate %s",
Settings.DisplayFrameRate == true ? " ON" : "OFF");
sprintf (videomenu[2], "Enable Zooming %s",
GCSettings.NGCZoom == true ? " ON" : "OFF");
// don't allow original render mode if progressive video mode detected
if (GCSettings.render==0 && progressive)
GCSettings.render++;
if ( GCSettings.render == 0 )
sprintf (videomenu[3], "Video Rendering Original");
if ( GCSettings.render == 1 )
sprintf (videomenu[3], "Video Rendering Filtered");
if ( GCSettings.render == 2 )
sprintf (videomenu[3], "Video Rendering Unfiltered");
sprintf (videomenu[4], "Video Scaling %s",
GCSettings.widescreen == true ? "16:9 Correction" : "Default");
sprintf (videomenu[9], "Video Shift: %d, %d", GCSettings.xshift, GCSettings.yshift);
sprintf (videomenu[11], "Reverse Stereo %s",
Settings.ReverseStereo == true ? " ON" : "OFF");
sprintf (videomenu[12], "Interpolated Sound %s",
Settings.InterpolatedSound == true ? " ON" : "OFF");
ret = RunMenu (videomenu, videomenuCount, (char*)"Video Options", 16);
switch (ret)
{
case 0:
Settings.Transparency ^= 1;
break;
case 1:
Settings.DisplayFrameRate ^= 1;
break;
case 2:
GCSettings.NGCZoom ^= 1;
break;
case 3:
GCSettings.render++;
if (GCSettings.render > 2 )
GCSettings.render = 0;
// reset zoom
zoom_reset ();
break;
case 4:
GCSettings.widescreen ^= 1;
break;
case 5:
// xscale UP
GCSettings.xshift++;
break;
case 6:
// xscale DOWN
GCSettings.xshift--;
break;
case 7:
// yscale UP
GCSettings.yshift++;
break;
case 8:
// yscale DOWN
GCSettings.yshift--;
break;
case 9:
break;
case 10:
// reset video shifts
GCSettings.xshift = GCSettings.yshift = 0;
WaitPrompt((char *)"Video Shift Reset");
break;
case 11:
Settings.ReverseStereo ^= 1;
break;
case 12:
Settings.InterpolatedSound ^= 1;
break;
case -1: // Button B
case 13:
SavePrefs(GCSettings.SaveMethod, SILENT);
quit = 1;
break;
}
}
menu = oldmenu;
}
/**************************************************************************** /****************************************************************************
* Controller Configuration * Controller Configuration
* *
@ -916,7 +901,7 @@ ConfigureButtons (u16 ctrlr_type)
menu = oldmenu; menu = oldmenu;
} // end configurebuttons() } // end configurebuttons()
int ctlrmenucount = 10; int ctlrmenucount = 9;
char ctlrmenu[][50] = { char ctlrmenu[][50] = {
// toggle: // toggle:
"MultiTap", "MultiTap",
@ -928,8 +913,7 @@ char ctlrmenu[][50] = {
"Classic Controller", "Classic Controller",
"Wiimote", "Wiimote",
"Gamecube Pad", "Gamecube Pad",
"Save Preferences", "Back to Preferences Menu"
"Go Back"
}; };
void void
@ -1004,13 +988,9 @@ ConfigureControllers ()
ConfigureButtons (CTRLR_GCPAD); ConfigureButtons (CTRLR_GCPAD);
break; break;
case 8:
/*** Save Preferences Now ***/
SavePrefs(GCSettings.SaveMethod, NOTSILENT);
break;
case -1: /*** Button B ***/ case -1: /*** Button B ***/
case 9: case 8:
SavePrefs(GCSettings.SaveMethod, SILENT);
/*** Return ***/ /*** Return ***/
quit = 1; quit = 1;
break; break;
@ -1020,37 +1000,87 @@ ConfigureControllers ()
menu = oldmenu; menu = oldmenu;
} }
/****************************************************************************
* Preferences Menu
***************************************************************************/
static int prefmenuCount = 5;
static char prefmenu[][50] = {
"Controllers",
"Video / Sound",
"Saving / Loading",
"Reset Preferences",
"Back to Main Menu"
};
void
PreferencesMenu ()
{
int ret = 0;
int quit = 0;
int oldmenu = menu;
menu = 0;
while (quit == 0)
{
ret = RunMenu (prefmenu, prefmenuCount, (char*)"Preferences");
switch (ret)
{
case 0:
ConfigureControllers ();
break;
case 1:
VideoOptions ();
break;
case 2:
FileOptions ();
break;
case 3:
DefaultSettings ();
WaitPrompt((char *)"Preferences Reset");
break;
case -1: /*** Button B ***/
case 4:
quit = 1;
break;
}
}
menu = oldmenu;
}
/**************************************************************************** /****************************************************************************
* Main Menu * Main Menu
***************************************************************************/ ***************************************************************************/
int menucount = 9; int menucount = 7;
char menuitems[][50] = { char menuitems[][50] = {
"Choose Game", "Choose Game",
"Controller Configuration",
"Preferences", "Preferences",
"Game Menu", "Game Menu",
"Video Options", "Credits",
"Credits",
"DVD Motor Off", "DVD Motor Off",
"Reset System", "Reset System",
"Return to Loader" "Return to Loader"
}; };
void void
mainmenu (int selectedMenu) MainMenu (int selectedMenu)
{ {
int quit = 0; int quit = 0;
int ret; int ret;
// disable game-specific menu items if a ROM isn't loaded // disable game-specific menu items if a ROM isn't loaded
if ( ARAM_ROMSIZE == 0 ) if ( ARAM_ROMSIZE == 0 )
menuitems[3][0] = '\0'; menuitems[2][0] = '\0';
else else
sprintf (menuitems[3], "Game Menu"); sprintf (menuitems[2], "Game Menu");
#ifndef HW_DOL #ifndef HW_DOL
// don't show dvd motor off on the wii // don't show dvd motor off on the wii
menuitems[6][0] = '\0'; menuitems[4][0] = '\0';
#endif #endif
VIDEO_WaitVSync (); VIDEO_WaitVSync ();
@ -1075,44 +1105,34 @@ mainmenu (int selectedMenu)
break; break;
case 1: case 1:
// Configure Controllers
ConfigureControllers ();
break;
case 2:
// Preferences // Preferences
PreferencesMenu (); PreferencesMenu ();
break; break;
case 3: case 2:
// Game Options // Game Options
quit = GameMenu (); quit = GameMenu ();
break; break;
case 4:
// Video Options
VideoOptions ();
break;
case 5: case 3:
// Credits // Credits
Credits (); Credits ();
WaitButtonA (); WaitButtonA ();
break; break;
case 6: case 4:
// turn the dvd motor off (GC only) // turn the dvd motor off (GC only)
#ifdef HW_DOL #ifdef HW_DOL
dvd_motor_off (); dvd_motor_off ();
#endif #endif
break; break;
case 7: case 5:
// Reset the Gamecube/Wii // Reset the Gamecube/Wii
Reboot(); Reboot();
break; break;
case 8: case 6:
// Exit to Loader // Exit to Loader
#ifdef HW_RVL #ifdef HW_RVL
#ifdef WII_DVD #ifdef WII_DVD

View File

@ -15,6 +15,6 @@
#define _NGCMENU_ #define _NGCMENU_
void mainmenu (int selectedMenu); void MainMenu (int selectedMenu);
#endif #endif

View File

@ -55,9 +55,7 @@ extern int whichfb;
/*** Permanent backdrop ***/ /*** Permanent backdrop ***/
#ifdef HW_RVL #ifdef HW_RVL
u32 *backdrop; u32 *backdrop = NULL;
#else
static u32 *backdrop;
#endif #endif
unsigned int getcolour (u8 r1, u8 g1, u8 b1); unsigned int getcolour (u8 r1, u8 g1, u8 b1);
void DrawLineFast( int startx, int endx, int y, u8 r, u8 g, u8 b ); void DrawLineFast( int startx, int endx, int y, u8 r, u8 g, u8 b );
@ -318,14 +316,14 @@ unpackbackdrop ()
unsigned int colour; unsigned int colour;
int offset; int offset;
int i; int i;
int bgSize = (screenheight * 640 * 2);
// backdrop = (unsigned int *) malloc (screenheight * 1280); u32 * bgtemp = (u32 *) malloc (bgSize);
backdrop = (u32 *) malloc (screenheight * 1280);
colour = getcolour (0x00, 0x00, 0x00); colour = getcolour (0x00, 0x00, 0x00);
/*** Fill with black for now ***/ /*** Fill with black for now ***/
for (i = 0; i < (320 * screenheight); i++) for (i = 0; i < (320 * screenheight); i++)
backdrop[i] = colour; bgtemp[i] = colour;
/*** If it's PAL50, need to move down a few lines ***/ /*** If it's PAL50, need to move down a few lines ***/
offset = ((screenheight - 480) >> 1) * 320; offset = ((screenheight - 480) >> 1) * 320;
@ -333,15 +331,22 @@ unpackbackdrop ()
outbytes = BG_RAW; outbytes = BG_RAW;
res = res =
uncompress ((Bytef *) backdrop + offset, &outbytes, (Bytef *) bg, uncompress ((Bytef *) bgtemp + offset, &outbytes, (Bytef *) bg,
inbytes); inbytes);
#ifndef HW_RVL #ifdef HW_RVL
/*** Now store the backdrop in ARAM ***/ // On Wii - store backdrop in MEM2
ARAMPut ((char *) backdrop, (char *) AR_BACKDROP, 640 * screenheight * 2); unsigned int MEM2Storage = 0x91000000;
free (backdrop); backdrop = (u32 *)MEM2Storage;
memcpy(backdrop, bgtemp, bgSize);
#else
// On GameCube - store the backdrop in ARAM
ARAMPut ((char *) bgtemp, (char *) AR_BACKDROP, bgSize);
#endif #endif
// otherwise (on wii) backdrop is stored in memory
free (bgtemp);
bgtemp = NULL;
clearscreen (); clearscreen ();
showscreen (); showscreen ();
} }

View File

@ -31,7 +31,7 @@ DefaultSettings ()
sprintf (GCSettings.CheatFolder,"snes9x/cheats"); // Path to cheat files sprintf (GCSettings.CheatFolder,"snes9x/cheats"); // Path to cheat files
GCSettings.AutoLoad = 1; GCSettings.AutoLoad = 1;
GCSettings.AutoSave = 1; GCSettings.AutoSave = 1;
GCSettings.VerifySaves = 0; GCSettings.VerifySaves = 0;
// custom SMB settings // custom SMB settings
@ -54,12 +54,12 @@ DefaultSettings ()
GCSettings.Superscope = 0; GCSettings.Superscope = 0;
GCSettings.Mouse = 0; GCSettings.Mouse = 0;
GCSettings.Justifier = 0; GCSettings.Justifier = 0;
GCSettings.NGCZoom = 0; // zooming default off GCSettings.NGCZoom = 0; // zooming default off
GCSettings.render = 2; // Unfiltered GCSettings.render = 2; // Unfiltered
GCSettings.widescreen = 0; // no aspect ratio correction GCSettings.widescreen = 0; // no aspect ratio correction
GCSettings.xshift = 0; // video shift GCSettings.xshift = 0; // video shift
GCSettings.yshift = 0; GCSettings.yshift = 0;
@ -99,7 +99,7 @@ DefaultSettings ()
Settings.SkipFrames = 10; Settings.SkipFrames = 10;
Settings.TurboSkipFrames = 19; Settings.TurboSkipFrames = 19;
Settings.DisplayFrameRate = false; Settings.DisplayFrameRate = false;
Settings.AutoDisplayMessages = 1; // SNES9x 1.51 Settings.AutoDisplayMessages = 0; // SNES9x 1.51
Settings.InitialInfoStringTimeout = 200; // # frames to display messages for Settings.InitialInfoStringTimeout = 200; // # frames to display messages for
// Frame timings in 50hz and 60hz cpu mode // Frame timings in 50hz and 60hz cpu mode

View File

@ -156,7 +156,7 @@ emulate ()
//gui_savescreen (); //gui_savescreen ();
*/ */
mainmenu (3); // go to game menu MainMenu (2); // go to game menu
FrameTimer = 0; FrameTimer = 0;
setFrameTimerMethod (); // set frametimer method every time a ROM is loaded setFrameTimerMethod (); // set frametimer method every time a ROM is loaded
@ -297,7 +297,7 @@ main ()
if(!LoadPrefs()) if(!LoadPrefs())
{ {
WaitPrompt((char*) "Preferences reset - check settings!"); WaitPrompt((char*) "Preferences reset - check settings!");
selectedMenu = 2; // change to preferences menu selectedMenu = 1; // change to preferences menu
} }
// No appended ROM, so get the user to load one // No appended ROM, so get the user to load one
@ -305,7 +305,7 @@ main ()
{ {
while (ARAM_ROMSIZE == 0) while (ARAM_ROMSIZE == 0)
{ {
mainmenu (selectedMenu); MainMenu (selectedMenu);
} }
} }
else else

View File

@ -156,9 +156,11 @@ LoadSRAM (int method, bool silent)
if(method == METHOD_SD || method == METHOD_USB) if(method == METHOD_SD || method == METHOD_USB)
{ {
ChangeFATInterface(method, NOTSILENT); if(ChangeFATInterface(method, NOTSILENT))
sprintf (filepath, "%s/%s/%s.srm", ROOTFATDIR, GCSettings.SaveFolder, Memory.ROMFilename); {
offset = LoadBufferFromFAT (filepath, silent); sprintf (filepath, "%s/%s/%s.srm", ROOTFATDIR, GCSettings.SaveFolder, Memory.ROMFilename);
offset = LoadBufferFromFAT (filepath, silent);
}
} }
else if(method == METHOD_SMB) else if(method == METHOD_SMB)
{ {