network setting tweak, minor changes

This commit is contained in:
dborth 2008-09-07 23:50:57 +00:00
parent 2c1af15a5b
commit 15d25fbe9d
5 changed files with 41 additions and 40 deletions

View File

@ -34,11 +34,16 @@ DefaultSettings ()
GCSettings.AutoLoad = 1; GCSettings.AutoLoad = 1;
GCSettings.AutoSave = 1; GCSettings.AutoSave = 1;
// default SMB settings // custom SMB settings
strncpy (GCSettings.smbip, "192.168.0.1", 15); // IP Address of share server strncpy (GCSettings.smbip, "", 15); // IP Address of share server
strncpy (GCSettings.smbuser, "Wiiuser", 19); // Your share user strncpy (GCSettings.smbuser, "", 19); // Your share user
strncpy (GCSettings.smbpwd, "password", 19); // Your share user password strncpy (GCSettings.smbpwd, "", 19); // Your share user password
strncpy (GCSettings.smbshare, "SNES", 19); // Share name on server strncpy (GCSettings.smbshare, "", 19); // Share name on server
GCSettings.smbip[15] = 0;
GCSettings.smbuser[19] = 0;
GCSettings.smbpwd[19] = 0;
GCSettings.smbshare[19] = 0;
GCSettings.gcip[0] = 0; GCSettings.gcip[0] = 0;
GCSettings.gwip[0] = 0; GCSettings.gwip[0] = 0;
@ -48,10 +53,10 @@ DefaultSettings ()
GCSettings.NGCZoom = 0; GCSettings.NGCZoom = 0;
GCSettings.VerifySaves = 0; GCSettings.VerifySaves = 0;
GCSettings.render = 0; GCSettings.render = 0;
GCSettings.widescreen = 0; GCSettings.widescreen = 0;
GCSettings.Superscope = 0; GCSettings.Superscope = 0;
GCSettings.Mouse = 0; GCSettings.Mouse = 0;
GCSettings.Justifier = 0; GCSettings.Justifier = 0;

View File

@ -132,8 +132,8 @@
Snes9x homepage: http://www.snes9x.com Snes9x homepage: http://www.snes9x.com
Permission to use, copy, modify and/or distribute Snes9x in both binary Permission to use, copy, modify and/or distribute Snes9x in both binary
and source form, for non-commercial purposes, is hereby granted without and source form, for non-commercial purposes, is hereby granted without
fee, providing that this license information and copyright notice appear fee, providing that this license information and copyright notice appear
with all copies and any derived work. with all copies and any derived work.
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
@ -202,7 +202,7 @@ S9xExit ()
{ {
/*** Nintendo Gamecube will NEVER get here ... unless /*** Nintendo Gamecube will NEVER get here ... unless
something major went wrong !! something major went wrong !!
In which case, I'll settle for a reboot first -;) In which case, I'll settle for a reboot first -;)
***/ ***/
} }
@ -242,7 +242,7 @@ S9xGetFilenameInc (const char *e, enum s9x_getdirtype dirtype)
void void
S9xAutoSaveSRAM () S9xAutoSaveSRAM ()
{ {
//Memory.SaveSRAM (S9xGetFilename (".srm", SRAM_DIR));
} }
/*** Sound based functions ***/ /*** Sound based functions ***/
@ -284,7 +284,7 @@ S9xGenerateSound ()
/* eke-eke */ /* eke-eke */
void S9xInitSync() void S9xInitSync()
{ {
FrameTimer = 0; FrameTimer = 0;
prev = gettime(); prev = gettime();
} }
@ -295,7 +295,7 @@ extern int timerstyle;
void S9xSyncSpeed () void S9xSyncSpeed ()
{ {
uint32 skipFrms = Settings.SkipFrames; uint32 skipFrms = Settings.SkipFrames;
if ( Settings.TurboMode ) if ( Settings.TurboMode )
skipFrms = Settings.TurboSkipFrames; skipFrms = Settings.TurboSkipFrames;
@ -305,10 +305,10 @@ void S9xSyncSpeed ()
{ {
usleep (50); usleep (50);
} }
if (FrameTimer > skipFrms) if (FrameTimer > skipFrms)
FrameTimer = skipFrms; FrameTimer = skipFrms;
if ((FrameTimer > 1) && (IPPU.SkippedFrames < skipFrms)) if ((FrameTimer > 1) && (IPPU.SkippedFrames < skipFrms))
{ {
IPPU.SkippedFrames++; IPPU.SkippedFrames++;
@ -320,11 +320,11 @@ void S9xSyncSpeed ()
IPPU.RenderThisFrame = TRUE; IPPU.RenderThisFrame = TRUE;
} }
} }
else /* use internal timer for PAL roms */ else /* use internal timer for PAL roms */
{ {
unsigned int timediffallowed = Settings.TurboMode ? 0 : Settings.FrameTime; unsigned int timediffallowed = Settings.TurboMode ? 0 : Settings.FrameTime;
now = gettime(); now = gettime();
if (diff_usec(prev, now) > timediffallowed) if (diff_usec(prev, now) > timediffallowed)
{ {
/*while ( diff_usec((prev, now) < timediffallowed * 2) { /*while ( diff_usec((prev, now) < timediffallowed * 2) {
@ -353,7 +353,7 @@ void S9xSyncSpeed ()
prev = now; prev = now;
} }
if ( !Settings.TurboMode ) if ( !Settings.TurboMode )
FrameTimer--; FrameTimer--;
return; return;

View File

@ -89,6 +89,13 @@ ConnectShare (bool silent)
return false; return false;
#endif #endif
// check that all parameter have been set
if(strlen(GCSettings.smbuser) == 0 ||
strlen(GCSettings.smbpwd) == 0 ||
strlen(GCSettings.smbshare) == 0 ||
strlen(GCSettings.smbip) == 0)
return false;
if(!networkInit) if(!networkInit)
networkInit = InitializeNetwork(silent); networkInit = InitializeNetwork(silent);

View File

@ -347,10 +347,10 @@ main ()
WPAD_SetVRes(WPAD_CHAN_ALL,640,480); WPAD_SetVRes(WPAD_CHAN_ALL,640,480);
#endif #endif
/*** Initialise GC ***/ // Initialise video
InitGCVideo (); /*** Get the ball rolling ***/ InitGCVideo ();
/*** Initialise freetype ***/ // Initialise freetype font system
if (FT_Init ()) if (FT_Init ())
{ {
printf ("Cannot initialise font subsystem!\n"); printf ("Cannot initialise font subsystem!\n");
@ -359,38 +359,33 @@ main ()
unpackbackdrop (); unpackbackdrop ();
/*** Set defaults ***/ // Set defaults
DefaultSettings (); DefaultSettings ();
S9xUnmapAllControls (); S9xUnmapAllControls ();
SetDefaultButtonMap (); SetDefaultButtonMap ();
//printf ("Initialise Memory\n"); // Allocate SNES Memory
/*** Allocate SNES Memory ***/
if (!Memory.Init ()) if (!Memory.Init ())
while (1); while (1);
//printf ("Initialise APU\n"); // Allocate APU
/*** Allocate APU ***/
if (!S9xInitAPU ()) if (!S9xInitAPU ())
while (1); while (1);
/*** Set Pixel Renderer to match 565 ***/ // Set Pixel Renderer to match 565
S9xSetRenderPixelFormat (RGB565); S9xSetRenderPixelFormat (RGB565);
/*** Initialise Snes Sound System ***/ // Initialise Snes Sound System
S9xInitSound (5, TRUE, 1024); S9xInitSound (5, TRUE, 1024);
//printf ("Initialise GFX\n"); // Initialise Graphics
/*** Initialise Graphics ***/
setGFX (); setGFX ();
if (!S9xGraphicsInit ()) if (!S9xGraphicsInit ())
while (1); while (1);
// Initialize libFAT for SD and USB // Initialize libFAT for SD and USB
fatInitDefault(); fatInitDefault();
//fatInit(8192, false);
//fat_enable_readahead_all();
// Initialize DVD subsystem (GameCube only) // Initialize DVD subsystem (GameCube only)
#ifndef HW_RVL #ifndef HW_RVL
@ -414,13 +409,7 @@ main ()
selectedMenu = 2; // change to preferences menu selectedMenu = 2; // change to preferences menu
} }
// Correct any relevant saved settings that are invalid // No appended ROM, so get the user to load one
Settings.FrameTimeNTSC = 16667;
Settings.FrameTimePAL = 20000;
if ( Settings.TurboSkipFrames <= Settings.SkipFrames )
Settings.TurboSkipFrames = 20;
/*** No appended ROM, so get the user to load one ***/
if (ARAM_ROMSIZE == 0) if (ARAM_ROMSIZE == 0)
{ {
while (ARAM_ROMSIZE == 0) while (ARAM_ROMSIZE == 0)

View File

@ -84,7 +84,7 @@ preparesavedata (int method)
else else
{ {
offset = 0; offset = 0;
WaitPrompt("No SRAM data to save!"); WaitPrompt((char *)"No SRAM data to save!");
} }
return offset; return offset;