Skip to content

Commit

Permalink
fix for Super Mario RPG, minor bug fixes, auto update feature
Browse files Browse the repository at this point in the history
  • Loading branch information
dborth committed Dec 24, 2008
1 parent 2794ede commit b6791d1
Show file tree
Hide file tree
Showing 31 changed files with 3,528 additions and 301 deletions.
5 changes: 2 additions & 3 deletions Makefile.gc
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ include $(DEVKITPPC)/gamecube_rules
TARGET := snes9xgx-gc
TARGETDIR := executables
BUILD := build_gc
SOURCES := source/snes9x source/ngc source/sz
DATA := data
INCLUDES := source/snes9x source/ngc
SOURCES := source/snes9x source/ngc source/sz source/unzip
INCLUDES := source/snes9x source/ngc source/unzip

#---------------------------------------------------------------------------------
# options for code generation
Expand Down
5 changes: 2 additions & 3 deletions Makefile.wii
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ include $(DEVKITPPC)/wii_rules
TARGET := snes9xgx-wii
TARGETDIR := executables
BUILD := build_wii
SOURCES := source/snes9x source/ngc source/sz
DATA := data
INCLUDES := source/snes9x source/ngc
SOURCES := source/snes9x source/ngc source/sz source/unzip
INCLUDES := source/snes9x source/ngc source/unzip

#---------------------------------------------------------------------------------
# options for code generation
Expand Down
2 changes: 1 addition & 1 deletion source/ngc/dvd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ extern "C" {
#endif

#include "menudraw.h"
#include "unzip.h"
#include "gcunzip.h"
#include "filesel.h"
#include "snes9xGX.h"

Expand Down
19 changes: 9 additions & 10 deletions source/ngc/fileop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* fileop.cpp
*
* FAT File operations
* File operations
***************************************************************************/

#include <gccore.h>
Expand All @@ -25,10 +25,10 @@

#include "snes9xGX.h"
#include "fileop.h"
#include "smbop.h"
#include "networkop.h"
#include "dvd.h"
#include "memcardop.h"
#include "unzip.h"
#include "gcunzip.h"
#include "video.h"
#include "menudraw.h"
#include "filesel.h"
Expand Down Expand Up @@ -83,6 +83,7 @@ devicecallback (void *arg)
}

InitializeNetwork(SILENT);
UpdateCheck();
#else
if(isMounted[METHOD_SD_SLOTA])
{
Expand All @@ -103,7 +104,6 @@ devicecallback (void *arg)
#endif
usleep(500000); // suspend thread for 1/2 sec
}

return NULL;
}

Expand All @@ -126,11 +126,11 @@ InitDeviceThread()
void UnmountAllFAT()
{
#ifdef HW_RVL
fatUnmount("sd");
fatUnmount("usb");
fatUnmount("sd:/");
fatUnmount("usb:/");
#else
fatUnmount("carda");
fatUnmount("cardb");
fatUnmount("carda:/");
fatUnmount("cardb:/");
#endif
}

Expand Down Expand Up @@ -179,7 +179,7 @@ bool MountFAT(int method)
if(unmountRequired[method])
{
unmountRequired[method] = false;
fatUnmount(name);
fatUnmount(rootdir);
disc->shutdown();
}
if(!isMounted[method])
Expand Down Expand Up @@ -505,4 +505,3 @@ u32 SaveFile(char filepath[], u32 datasize, int method, bool silent)
{
return SaveFile((char *)savebuffer, filepath, datasize, method, silent);
}

1 change: 1 addition & 0 deletions source/ngc/fileop.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ u32 SaveFile(char filepath[], u32 datasize, int method, bool silent);
extern char currFATdir[MAXPATHLEN];
extern FILE * file;
extern bool unmountRequired[];
extern bool isMounted[];
extern lwp_t devicethread;

#endif
10 changes: 6 additions & 4 deletions source/ngc/filesel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ extern "C" {
#include "menudraw.h"
#include "video.h"
#include "aram.h"
#include "smbop.h"
#include "networkop.h"
#include "fileop.h"
#include "memcardop.h"
#include "input.h"
#include "unzip.h"
#include "gcunzip.h"

int offset;
int selection;
Expand Down Expand Up @@ -108,7 +108,8 @@ int autoLoadMethod()
else
WaitPrompt("Unable to auto-determine load method!");

GCSettings.LoadMethod = method; // save method found for later use
if(GCSettings.LoadMethod == METHOD_AUTO)
GCSettings.LoadMethod = method; // save method found for later use
return method;
}

Expand Down Expand Up @@ -137,7 +138,8 @@ int autoSaveMethod(bool silent)
else if(!silent)
WaitPrompt("Unable to auto-determine save method!");

GCSettings.SaveMethod = method; // save method found for later use
if(GCSettings.SaveMethod == METHOD_AUTO)
GCSettings.SaveMethod = method; // save method found for later use
return method;
}

Expand Down
1 change: 1 addition & 0 deletions source/ngc/filesel.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define _NGCFILESEL_

#include <unistd.h>
#include <gccore.h>

#define SAVEBUFFERSIZE (512 * 1024)
#define MAXJOLIET 255
Expand Down
2 changes: 1 addition & 1 deletion source/ngc/freeze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ NGCFreezeGame (int method, bool silent)
// And the freezecomment
memset(freezecomment, 0, 64);

sprintf (freezecomment[0], "%s Freeze", VERSIONSTR);
sprintf (freezecomment[0], "%s Freeze", APPVERSION);
sprintf (freezecomment[1], Memory.ROMName);
memcpy (savebuffer + woffset, freezecomment, 64);
woffset += 64;
Expand Down
4 changes: 2 additions & 2 deletions source/ngc/unzip.cpp → source/ngc/gcunzip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ extern "C" {

#include "snes9xGX.h"
#include "dvd.h"
#include "smbop.h"
#include "networkop.h"
#include "fileop.h"
#include "video.h"
#include "menudraw.h"
#include "unzip.h"
#include "gcunzip.h"

/*
* PKWare Zip Header - adopted into zip standard
Expand Down
8 changes: 3 additions & 5 deletions source/ngc/unzip.h → source/ngc/gcunzip.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
* Michniewski 2008
* Tantric September 2008
*
* unzip.h
* gcunzip.h
*
* File unzip routines
****************************************************************************/
#ifndef _UNZIP_
#define _UNZIP_

#include <smb.h>
#ifndef _GCUNZIP_H_
#define _GCUNZIP_H_

extern int IsZipFile (char *buffer);
char * GetFirstZipFilename(int method);
Expand Down
Loading

0 comments on commit b6791d1

Please sign in to comment.