Renaming files

This commit is contained in:
dborth 2008-08-07 05:19:17 +00:00
parent 56ac399948
commit 023b0e4f3b
15 changed files with 132 additions and 134 deletions

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* Snes9x 1.50 * Snes9x 1.50
* *
* Nintendo Gamecube Audio * Nintendo Gamecube Audio
* *
@ -26,7 +26,7 @@
#include "controls.h" #include "controls.h"
#include "video.h" #include "video.h"
#include "ftfont.h" #include "menudraw.h"
/*** Double buffered audio ***/ /*** Double buffered audio ***/
#define AUDIOBUFFER 2048 #define AUDIOBUFFER 2048
@ -65,8 +65,8 @@ AudioThread (void *arg)
} }
/** /**
* MixSamples * MixSamples
* This continually calls S9xMixSamples On each DMA Completion * This continually calls S9xMixSamples On each DMA Completion
*/ */
static void static void
GCMixSamples () GCMixSamples ()

View File

@ -11,9 +11,9 @@
#include "snes9xGx.h" #include "snes9xGx.h"
#include "memmap.h" #include "memmap.h"
#include "sdload.h" #include "fileop.h"
#include "cheats.h" #include "cheats.h"
extern SCheatData Cheat; extern SCheatData Cheat;
/**************************************************************************** /****************************************************************************
@ -34,10 +34,10 @@ SetupCheats()
sprintf (cheatFile, "%s/snes9x/cheats/%s.cht", ROOTSDDIR, Memory.ROMFilename); sprintf (cheatFile, "%s/snes9x/cheats/%s.cht", ROOTSDDIR, Memory.ROMFilename);
else if(GCSettings.SaveMethod == METHOD_USB) else if(GCSettings.SaveMethod == METHOD_USB)
sprintf (cheatFile, "%s/snes9x/cheats/%s.cht", ROOTUSBDIR, Memory.ROMFilename); sprintf (cheatFile, "%s/snes9x/cheats/%s.cht", ROOTUSBDIR, Memory.ROMFilename);
// load cheat file if present // load cheat file if present
if(strlen(cheatFile) > 0) if(strlen(cheatFile) > 0)
{ {
if(S9xLoadCheatFile (cheatFile)) if(S9xLoadCheatFile (cheatFile))
{ {
// disable all cheats loaded from the file // disable all cheats loaded from the file

View File

@ -5,19 +5,19 @@
* softdev July 2006 * softdev July 2006
* crunchy2 May 2007 * crunchy2 May 2007
* *
* sdload.cpp * fileop.cpp
* *
* Load ROMS from FAT * File operations
****************************************************************************/ ****************************************************************************/
#include <gccore.h> #include <gccore.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <ogcsys.h> #include <ogcsys.h>
#include "sdload.h" #include "fileop.h"
#include "unzip.h" #include "unzip.h"
#include "memmap.h" #include "memmap.h"
#include "video.h" #include "video.h"
#include "ftfont.h" #include "menudraw.h"
#include "dvd.h" #include "dvd.h"
#include "filesel.h" #include "filesel.h"
#include "sram.h" #include "sram.h"
@ -54,7 +54,7 @@ bool fat_is_mounted(PARTITION_INTERFACE partition) {
/**************************************************************************** /****************************************************************************
* fat_enable_readahead_all * fat_enable_readahead_all
****************************************************************************/ ****************************************************************************/
void fat_enable_readahead_all() { void fat_enable_readahead_all() {
int i; int i;
for (i=1; i <= 4; ++i) { for (i=1; i <= 4; ++i) {
@ -181,7 +181,7 @@ int updateFATdirname(int method)
/*************************************************************************** /***************************************************************************
* Browse FAT subdirectories * Browse FAT subdirectories
***************************************************************************/ ***************************************************************************/
int parseFATdirectory(int method) int parseFATdirectory(int method)
{ {
int nbfiles = 0; int nbfiles = 0;
DIR_ITER *fatdir; DIR_ITER *fatdir;
@ -198,16 +198,16 @@ int parseFATdirectory(int method)
{ {
sprintf(msg, "Error opening %s", currFATdir); sprintf(msg, "Error opening %s", currFATdir);
WaitPrompt(msg); WaitPrompt(msg);
// if we can't open the previous dir, open root dir // if we can't open the previous dir, open root dir
if(method == METHOD_SD) if(method == METHOD_SD)
sprintf(currFATdir,"%s",ROOTSDDIR); sprintf(currFATdir,"%s",ROOTSDDIR);
else else
sprintf(currFATdir,"%s",ROOTUSBDIR); sprintf(currFATdir,"%s",ROOTUSBDIR);
fatdir = diropen(currFATdir); fatdir = diropen(currFATdir);
if (fatdir == NULL) if (fatdir == NULL)
{ {
sprintf(msg, "Error opening %s", currFATdir); sprintf(msg, "Error opening %s", currFATdir);
WaitPrompt(msg); WaitPrompt(msg);

View File

@ -5,13 +5,13 @@
* softdev July 2006 * softdev July 2006
* crunchy2 May 2007 * crunchy2 May 2007
* *
* sdload.cpp * fileop.h
* *
* Load ROMS from SD Card * File operations
****************************************************************************/ ****************************************************************************/
#ifndef _LOADFROMSDC_ #ifndef _FATFILESC_
#define _LOADFROMSDC_ #define _FATFILESC_
#include <gccore.h> #include <gccore.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

View File

@ -30,13 +30,13 @@
#include "snes9xGx.h" #include "snes9xGx.h"
#include "dvd.h" #include "dvd.h"
#include "ftfont.h" #include "menudraw.h"
#include "video.h" #include "video.h"
#include "aram.h" #include "aram.h"
#include "unzip.h" #include "unzip.h"
#include "filesel.h" #include "filesel.h"
#include "smbload.h" #include "smbload.h"
#include "sdload.h" #include "fileload.h"
#include "mcsave.h" #include "mcsave.h"
#define PAGESIZE 17 #define PAGESIZE 17
@ -67,38 +67,38 @@ int autoSaveMethod()
{ {
return METHOD_SD; return METHOD_SD;
int method = -1; int method = -1;
while(method < 0) while(method < 0)
{ {
WaitPrompt((char*) "Checking SD"); WaitPrompt((char*) "Checking SD");
if(diropen(ROOTSDDIR)) if(diropen(ROOTSDDIR))
{ {
WaitPrompt((char*) "Found SD!"); WaitPrompt((char*) "Found SD!");
method = METHOD_SD; method = METHOD_SD;
break; break;
} }
WaitPrompt((char*) "Checking USB"); WaitPrompt((char*) "Checking USB");
if(diropen(ROOTUSBDIR)) if(diropen(ROOTUSBDIR))
{ {
WaitPrompt((char*) "Found USB!"); WaitPrompt((char*) "Found USB!");
method = METHOD_USB; method = METHOD_USB;
break; break;
} }
WaitPrompt((char*) "Checking Slot A"); WaitPrompt((char*) "Checking Slot A");
// check Memory Card Slot A // check Memory Card Slot A
if(MountCard(CARD_SLOTA, SILENT) == 0) if(MountCard(CARD_SLOTA, SILENT) == 0)
{ {
WaitPrompt((char*) "Found Memory Card A!"); WaitPrompt((char*) "Found Memory Card A!");
method = METHOD_MC_SLOTA; method = METHOD_MC_SLOTA;
break; break;
} }
WaitPrompt((char*) "Checking Slot B"); WaitPrompt((char*) "Checking Slot B");
// check Memory Card Slot B // check Memory Card Slot B
if(MountCard(CARD_SLOTB, SILENT) == 0) if(MountCard(CARD_SLOTB, SILENT) == 0)
{ {
@ -106,7 +106,7 @@ int autoSaveMethod()
method = METHOD_MC_SLOTB; method = METHOD_MC_SLOTB;
break; break;
} }
// no method found // no method found
WaitPrompt((char*) "Error: Could not determine save method."); WaitPrompt((char*) "Error: Could not determine save method.");
method = 0; method = 0;
@ -123,7 +123,7 @@ int autoSaveMethod()
void StripExt(char* returnstring, char * inputstring) void StripExt(char* returnstring, char * inputstring)
{ {
char* loc_dot; char* loc_dot;
strcpy (returnstring, inputstring); strcpy (returnstring, inputstring);
loc_dot = strrchr(returnstring,'.'); loc_dot = strrchr(returnstring,'.');
if (loc_dot != NULL) if (loc_dot != NULL)
@ -147,10 +147,10 @@ ShowFiles (int offset, int selection)
int w; int w;
clearscreen (); clearscreen ();
setfontsize (28); setfontsize (28);
DrawText (-1, 60, (char*)"Choose Game"); DrawText (-1, 60, (char*)"Choose Game");
setfontsize(18); setfontsize(18);
ypos = (screenheight - ((PAGESIZE - 1) * 20)) >> 1; ypos = (screenheight - ((PAGESIZE - 1) * 20)) >> 1;
@ -307,8 +307,8 @@ FileSelector (int method)
{ {
rootdir = filelist[selection].offset; rootdir = filelist[selection].offset;
rootdirlength = filelist[selection].length; rootdirlength = filelist[selection].length;
// store the filename (used for sram/freeze naming) // store the filename (used for sram/freeze naming)
StripExt(Memory.ROMFilename, filelist[selection].filename); // store stripped filename in Memory.ROMFilename StripExt(Memory.ROMFilename, filelist[selection].filename); // store stripped filename in Memory.ROMFilename
switch (method) switch (method)
@ -321,12 +321,12 @@ FileSelector (int method)
ARAM_ROMSIZE = LoadFATFile (filelist[selection].filename, ARAM_ROMSIZE = LoadFATFile (filelist[selection].filename,
filelist[selection].length); filelist[selection].length);
break; break;
case METHOD_DVD: case METHOD_DVD:
/*** Now load the DVD file to it's offset ***/ /*** Now load the DVD file to it's offset ***/
ARAM_ROMSIZE = LoadDVDFile (Memory.ROM); ARAM_ROMSIZE = LoadDVDFile (Memory.ROM);
break; break;
case METHOD_SMB: case METHOD_SMB:
/*** Load from SMB ***/ /*** Load from SMB ***/
ARAM_ROMSIZE = ARAM_ROMSIZE =
@ -527,7 +527,7 @@ int
OpenFAT (int method) OpenFAT (int method)
{ {
char msg[80]; char msg[80];
//if (haveFATdir == 0) //if (haveFATdir == 0)
//{ //{
/* don't mess with DVD entries */ /* don't mess with DVD entries */
@ -569,7 +569,7 @@ int
OpenROM (int method) OpenROM (int method)
{ {
int loadROM = 0; int loadROM = 0;
if(method == METHOD_AUTO) if(method == METHOD_AUTO)
method = autoLoadMethod(); method = autoLoadMethod();
@ -588,7 +588,7 @@ OpenROM (int method)
loadROM = OpenSMB (method); loadROM = OpenSMB (method);
break; break;
} }
return loadROM; return loadROM;
} }

View File

@ -30,7 +30,7 @@
#include "snes9xGX.h" #include "snes9xGX.h"
#include "video.h" #include "video.h"
#include "ftfont.h" #include "menudraw.h"
#include "s9xconfig.h" #include "s9xconfig.h"
#include "audio.h" #include "audio.h"
#include "menu.h" #include "menu.h"
@ -115,7 +115,7 @@ int MountCard(int cslot, bool8 silent)
while ( tries < 5 && ret == CARD_ERROR_NOCARD ) while ( tries < 5 && ret == CARD_ERROR_NOCARD )
{ {
EXI_ProbeReset (); EXI_ProbeReset ();
if(!silent) if(!silent)
ShowAction ((char*) "Mounting card..."); ShowAction ((char*) "Mounting card...");
CARD_Unmount (cslot); CARD_Unmount (cslot);
@ -130,7 +130,7 @@ int MountCard(int cslot, bool8 silent)
while ( tries < 5 && ret == CARD_ERROR_UNLOCKED ) while ( tries < 5 && ret == CARD_ERROR_UNLOCKED )
{ {
EXI_ProbeReset (); EXI_ProbeReset ();
if(!silent) if(!silent)
ShowAction ((char*) "Waiting for unlock..."); ShowAction ((char*) "Waiting for unlock...");
usleep(500000); // wait half second usleep(500000); // wait half second

View File

@ -28,9 +28,9 @@
#include "Snes9xGx.h" #include "Snes9xGx.h"
#include "filesel.h" #include "filesel.h"
#include "ftfont.h" #include "menudraw.h"
#include "smbload.h" #include "smbload.h"
#include "sdload.h" #include "fileop.h"
#include "mcsave.h" #include "mcsave.h"
extern "C" extern "C"

View File

@ -26,14 +26,13 @@
#include "spc7110.h" #include "spc7110.h"
#include "controls.h" #include "controls.h"
#include "aram.h" #include "aram.h"
#include "ftfont.h"
#include "video.h" #include "video.h"
#include "mcsave.h" #include "mcsave.h"
#include "filesel.h" #include "filesel.h"
#include "unzip.h" #include "unzip.h"
#include "smbload.h" #include "smbload.h"
#include "mcsave.h" #include "mcsave.h"
#include "sdload.h" #include "fileop.h"
#include "memfile.h" #include "memfile.h"
#include "dvd.h" #include "dvd.h"
#include "s9xconfig.h" #include "s9xconfig.h"
@ -41,8 +40,7 @@
#include "preferences.h" #include "preferences.h"
#include "button_mapping.h" #include "button_mapping.h"
#include "ftfont.h" #include "menudraw.h"
#include "cheats.h" #include "cheats.h"
#include "cheatmgr.h" #include "cheatmgr.h"
@ -88,7 +86,7 @@ LoadManager ()
quickLoadSRAM ( SILENT ); quickLoadSRAM ( SILENT );
else if ( GCSettings.AutoLoad == 2 ) else if ( GCSettings.AutoLoad == 2 )
quickLoadFreeze ( SILENT ); quickLoadFreeze ( SILENT );
// setup cheats // setup cheats
SetupCheats(); SetupCheats();
} }
@ -132,7 +130,7 @@ PreferencesMenu ()
while (quit == 0) while (quit == 0)
{ {
// some load/save methods are not implemented - here's where we skip them // some load/save methods are not implemented - here's where we skip them
#ifndef HW_RVL // GameCube mode #ifndef HW_RVL // GameCube mode
if(GCSettings.LoadMethod == METHOD_USB) if(GCSettings.LoadMethod == METHOD_USB)
GCSettings.LoadMethod++; GCSettings.LoadMethod++;
@ -142,22 +140,22 @@ PreferencesMenu ()
if(GCSettings.LoadMethod == METHOD_DVD) if(GCSettings.LoadMethod == METHOD_DVD)
GCSettings.LoadMethod++; GCSettings.LoadMethod++;
#endif #endif
if(GCSettings.SaveMethod == METHOD_DVD) // saving to DVD is impossible if(GCSettings.SaveMethod == METHOD_DVD) // saving to DVD is impossible
GCSettings.SaveMethod++; GCSettings.SaveMethod++;
if(GCSettings.SaveMethod == METHOD_SMB) // disable SMB - network saving needs some work if(GCSettings.SaveMethod == METHOD_SMB) // disable SMB - network saving needs some work
GCSettings.SaveMethod++; GCSettings.SaveMethod++;
if(GCSettings.LoadMethod == METHOD_SMB) // disable SMB - network loading needs some work if(GCSettings.LoadMethod == METHOD_SMB) // disable SMB - network loading needs some work
GCSettings.LoadMethod++; GCSettings.LoadMethod++;
// correct load/save methods out of bounds // correct load/save methods out of bounds
if(GCSettings.LoadMethod > 4) if(GCSettings.LoadMethod > 4)
GCSettings.LoadMethod = 0; GCSettings.LoadMethod = 0;
if(GCSettings.SaveMethod > 6) if(GCSettings.SaveMethod > 6)
GCSettings.SaveMethod = 0; GCSettings.SaveMethod = 0;
if (GCSettings.LoadMethod == METHOD_AUTO) sprintf (prefmenu[0],"Load Method AUTO"); 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_SD) sprintf (prefmenu[0],"Load Method SD");
else if (GCSettings.LoadMethod == METHOD_USB) sprintf (prefmenu[0],"Load Method USB"); else if (GCSettings.LoadMethod == METHOD_USB) sprintf (prefmenu[0],"Load Method USB");
@ -172,9 +170,9 @@ PreferencesMenu ()
else if (GCSettings.SaveMethod == METHOD_SMB) sprintf (prefmenu[2],"Save Method Network"); 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_SLOTA) sprintf (prefmenu[2],"Save Method MC Slot A");
else if (GCSettings.SaveMethod == METHOD_MC_SLOTB) sprintf (prefmenu[2],"Save Method MC Slot B"); else if (GCSettings.SaveMethod == METHOD_MC_SLOTB) sprintf (prefmenu[2],"Save Method MC Slot B");
sprintf (prefmenu[3], "Save Folder %s", GCSettings.SaveFolder); sprintf (prefmenu[3], "Save Folder %s", GCSettings.SaveFolder);
// disable changing load/save directories for now // disable changing load/save directories for now
prefmenu[1][0] = '\0'; prefmenu[1][0] = '\0';
prefmenu[3][0] = '\0'; prefmenu[3][0] = '\0';
@ -205,10 +203,10 @@ PreferencesMenu ()
sprintf (prefmenu[11], "C-Stick Zoom %s", sprintf (prefmenu[11], "C-Stick Zoom %s",
GCSettings.NGCZoom == true ? " ON" : "OFF"); GCSettings.NGCZoom == true ? " ON" : "OFF");
sprintf (prefmenu[12], "Video Filtering %s", sprintf (prefmenu[12], "Video Filtering %s",
GCSettings.render == true ? " ON" : "OFF"); GCSettings.render == true ? " ON" : "OFF");
ret = RunMenu (prefmenu, prefmenuCount, (char*)"Preferences", 16); ret = RunMenu (prefmenu, prefmenuCount, (char*)"Preferences", 16);
switch (ret) switch (ret)
@ -216,23 +214,23 @@ PreferencesMenu ()
case 0: case 0:
GCSettings.LoadMethod ++; GCSettings.LoadMethod ++;
break; break;
case 1: case 1:
break; break;
case 2: case 2:
GCSettings.SaveMethod ++; GCSettings.SaveMethod ++;
break; break;
case 3: case 3:
break; break;
case 4: case 4:
GCSettings.AutoLoad ++; GCSettings.AutoLoad ++;
if (GCSettings.AutoLoad > 2) if (GCSettings.AutoLoad > 2)
GCSettings.AutoLoad = 0; GCSettings.AutoLoad = 0;
break; break;
case 5: case 5:
GCSettings.AutoSave ++; GCSettings.AutoSave ++;
if (GCSettings.AutoSave > 3) if (GCSettings.AutoSave > 3)
@ -262,7 +260,7 @@ PreferencesMenu ()
case 11: case 11:
GCSettings.NGCZoom ^= 1; GCSettings.NGCZoom ^= 1;
break; break;
case 12: case 12:
GCSettings.render ^= 1; GCSettings.render ^= 1;
break; break;
@ -286,19 +284,19 @@ PreferencesMenu ()
****************************************************************************/ ****************************************************************************/
static int cheatmenuCount = 0; static int cheatmenuCount = 0;
static char cheatmenu[MAX_CHEATS][50]; static char cheatmenu[MAX_CHEATS][50];
void CheatMenu() void CheatMenu()
{ {
int ret = -1; int ret = -1;
int oldmenu = menu; int oldmenu = menu;
menu = 0; menu = 0;
if(Cheat.num_cheats > 0) if(Cheat.num_cheats > 0)
{ {
cheatmenuCount = Cheat.num_cheats + 1; cheatmenuCount = Cheat.num_cheats + 1;
sprintf (cheatmenu[cheatmenuCount-1], "Back to Game Menu"); sprintf (cheatmenu[cheatmenuCount-1], "Back to Game Menu");
while(ret != cheatmenuCount-1) while(ret != cheatmenuCount-1)
{ {
if(ret >= 0) if(ret >= 0)
@ -308,10 +306,10 @@ void CheatMenu()
else else
S9xEnableCheat(ret); S9xEnableCheat(ret);
} }
for(uint16 i=0; i < Cheat.num_cheats; i++) for(uint16 i=0; i < Cheat.num_cheats; i++)
sprintf (cheatmenu[i], "%s %s", Cheat.c[i].name, Cheat.c[i].enabled == true ? " ON" : "OFF"); sprintf (cheatmenu[i], "%s %s", Cheat.c[i].name, Cheat.c[i].enabled == true ? " ON" : "OFF");
ret = RunMenu (cheatmenu, cheatmenuCount, (char*)"Cheats", 16); ret = RunMenu (cheatmenu, cheatmenuCount, (char*)"Cheats", 16);
} }
} }
@ -343,7 +341,7 @@ GameMenu ()
int quit = 0; int quit = 0;
int oldmenu = menu; int oldmenu = menu;
menu = 0; menu = 0;
while (quit == 0) while (quit == 0)
{ {
ret = RunMenu (gamemenu, gamemenuCount, (char*)"Game Options"); ret = RunMenu (gamemenu, gamemenuCount, (char*)"Game Options");
@ -393,7 +391,7 @@ GameMenu ()
} }
menu = oldmenu; menu = oldmenu;
return retval; return retval;
} }
@ -649,10 +647,10 @@ ConfigureControllers ()
while (quit == 0) while (quit == 0)
{ {
sprintf (ctlrmenu[0], "MultiTap %s", Settings.MultiPlayer5Master == true ? " ON" : "OFF"); sprintf (ctlrmenu[0], "MultiTap %s", Settings.MultiPlayer5Master == true ? " ON" : "OFF");
if (GCSettings.Superscope > 0) if (GCSettings.Superscope > 0)
sprintf (ctlrmenu[1], "Superscope: Pad %d", GCSettings.Superscope); sprintf (ctlrmenu[1], "Superscope: Pad %d", GCSettings.Superscope);
else else
sprintf (ctlrmenu[1], "Superscope OFF"); sprintf (ctlrmenu[1], "Superscope OFF");
/*** Controller Config Menu ***/ /*** Controller Config Menu ***/
@ -806,7 +804,7 @@ mainmenu (int selectedMenu)
#endif #endif
ReInitGCVideo(); // update video after reading settings ReInitGCVideo(); // update video after reading settings
Settings.SuperScopeMaster = (GCSettings.Superscope > 0 ? true : false); // update superscope settings Settings.SuperScopeMaster = (GCSettings.Superscope > 0 ? true : false); // update superscope settings
// update mouse/justifier info? // update mouse/justifier info?
SetControllers(); SetControllers();

View File

@ -27,7 +27,7 @@
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#include "video.h" #include "video.h"
#include "ftfont.h" #include "menudraw.h"
#include "dkpro.h" #include "dkpro.h"
#include "snes9xGX.h" #include "snes9xGX.h"
@ -281,12 +281,12 @@ void
Credits () Credits ()
{ {
clearscreen (); clearscreen ();
setfontcolour (0x00, 0x00, 0x00); setfontcolour (0x00, 0x00, 0x00);
setfontsize (28); setfontsize (28);
DrawText (-1, 60, (char*)"Credits"); DrawText (-1, 60, (char*)"Credits");
int ypos = 25; int ypos = 25;
if (screenheight == 480) if (screenheight == 480)
@ -296,7 +296,7 @@ Credits ()
setfontsize (18); setfontsize (18);
DrawText (-1, ypos += 30, (char*)"Technical"); DrawText (-1, ypos += 30, (char*)"Technical");
setfontsize (14); setfontsize (14);
DrawText (-1, ypos += 22, (char*)"Snes9x v1.5.1 - Snes9x Team"); DrawText (-1, ypos += 22, (char*)"Snes9x v1.5.1 - Snes9x Team");
DrawText (-1, ypos += 18, (char*)"GameCube Port 2.0 WIP6 and earlier - SoftDev"); DrawText (-1, ypos += 18, (char*)"GameCube Port 2.0 WIP6 and earlier - SoftDev");
@ -308,16 +308,16 @@ Credits ()
setfontsize (18); setfontsize (18);
DrawText (-1, ypos += 30, (char*)"Testing"); DrawText (-1, ypos += 30, (char*)"Testing");
setfontsize (14); setfontsize (14);
DrawText (-1, ypos += 22, (char*)"crunchy2 / tehskeen users / others"); DrawText (-1, ypos += 22, (char*)"crunchy2 / tehskeen users / others");
setfontsize (18); setfontsize (18);
DrawText (-1, ypos += 30, (char*)"Documentation"); DrawText (-1, ypos += 30, (char*)"Documentation");
setfontsize (14); setfontsize (14);
DrawText (-1, ypos += 22, (char*)"brakken, crunchy2, michniewski"); DrawText (-1, ypos += 22, (char*)"brakken, crunchy2, michniewski");
setfontsize (12); setfontsize (12);
DrawText (-1, ypos += 50, (char*)"Snes9x - Copyright (c) Snes9x Team 1996 - 2006"); DrawText (-1, ypos += 50, (char*)"Snes9x - Copyright (c) Snes9x Team 1996 - 2006");
DrawText (-1, ypos += 15, (char*)"This software is open source and may be copied, distributed, or modified"); DrawText (-1, ypos += 15, (char*)"This software is open source and may be copied, distributed, or modified");

View File

@ -17,9 +17,9 @@
#include "snes9xGx.h" #include "snes9xGx.h"
#include "memmap.h" #include "memmap.h"
#include "srtc.h" #include "srtc.h"
#include "ftfont.h" #include "menudraw.h"
#include "mcsave.h" #include "mcsave.h"
#include "sdload.h" #include "fileop.h"
#include "smbload.h" #include "smbload.h"
#include "filesel.h" #include "filesel.h"

View File

@ -21,7 +21,7 @@ extern "C"
#include "unzip.h" #include "unzip.h"
#include "memmap.h" #include "memmap.h"
#include "video.h" #include "video.h"
#include "ftfont.h" #include "menudraw.h"
#include "dvd.h" #include "dvd.h"
#include "filesel.h" #include "filesel.h"
#include "sram.h" #include "sram.h"

View File

@ -181,7 +181,7 @@
#include "snes9xGX.h" #include "snes9xGX.h"
#include "dvd.h" #include "dvd.h"
#include "video.h" #include "video.h"
#include "ftfont.h" #include "menudraw.h"
#include "s9xconfig.h" #include "s9xconfig.h"
#include "audio.h" #include "audio.h"
#include "menu.h" #include "menu.h"
@ -190,7 +190,7 @@
#include "preferences.h" #include "preferences.h"
#include "gctime.h" #include "gctime.h"
#include "button_mapping.h" #include "button_mapping.h"
#include "sdload.h" #include "fileop.h"
unsigned long ARAM_ROMSIZE = 0; unsigned long ARAM_ROMSIZE = 0;
int ConfigRequested = 0; int ConfigRequested = 0;
@ -260,9 +260,9 @@ unsigned int wmscopemap[] = { WPAD_BUTTON_MINUS, WPAD_BUTTON_B,
}; };
void UpdateCursorPosition (int pad, int &pos_x, int &pos_y) void UpdateCursorPosition (int pad, int &pos_x, int &pos_y)
{ {
// gc left joystick // gc left joystick
signed char pad_x = PAD_StickX (pad); signed char pad_x = PAD_StickX (pad);
signed char pad_y = PAD_StickY (pad); signed char pad_y = PAD_StickY (pad);
int SCOPEPADCAL = 30; int SCOPEPADCAL = 30;
#ifdef HW_RVL #ifdef HW_RVL
@ -278,16 +278,16 @@ void UpdateCursorPosition (int pad, int &pos_x, int &pos_y)
pos_x -=4; pos_x -=4;
if (pos_x < 0) pos_x = 0; if (pos_x < 0) pos_x = 0;
} }
if (pad_y < -SCOPEPADCAL){ if (pad_y < -SCOPEPADCAL){
pos_y +=4; pos_y +=4;
if (pos_y > 224) pos_y = 224; if (pos_y > 224) pos_y = 224;
} }
if (pad_y > SCOPEPADCAL){ if (pad_y > SCOPEPADCAL){
pos_y -=4; pos_y -=4;
if (pos_y < 0) pos_y = 0; if (pos_y < 0) pos_y = 0;
} }
#ifdef HW_RVL #ifdef HW_RVL
// read wiimote IR // read wiimote IR
WPAD_IR(pad, &ir); WPAD_IR(pad, &ir);
@ -392,10 +392,10 @@ decodepad (int pad)
if ( mag>JOY_THRESHOLD && (ang>220 && ang<320) ) if ( mag>JOY_THRESHOLD && (ang>220 && ang<320) )
wp |= WPAD_CLASSIC_BUTTON_LEFT; wp |= WPAD_CLASSIC_BUTTON_LEFT;
if ( mag>JOY_THRESHOLD && (ang>40 && ang<140) ) if ( mag>JOY_THRESHOLD && (ang>40 && ang<140) )
wp |= WPAD_CLASSIC_BUTTON_RIGHT; wp |= WPAD_CLASSIC_BUTTON_RIGHT;
} }
#endif #endif
/*** Fix offset to pad ***/ /*** Fix offset to pad ***/
offset = ((pad + 1) << 4); offset = ((pad + 1) << 4);
@ -413,7 +413,7 @@ decodepad (int pad)
else else
S9xReportButton (offset + i, false); S9xReportButton (offset + i, false);
} }
/*** Superscope ***/ /*** Superscope ***/
if (pad == GCSettings.Superscope-1) // report only once if (pad == GCSettings.Superscope-1) // report only once
{ {
@ -421,7 +421,7 @@ decodepad (int pad)
offset = 0x50; offset = 0x50;
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
{ {
if ( jp & gcscopemap[i] if ( jp & gcscopemap[i]
#ifdef HW_RVL #ifdef HW_RVL
|| wp & wmscopemap[i] || wp & wmscopemap[i]
#endif #endif
@ -438,7 +438,7 @@ decodepad (int pad)
} }
/**************************************************************************** /****************************************************************************
* setFrameTimerMethod() * setFrameTimerMethod()
* change frametimer method depending on whether ROM is NTSC or PAL * change frametimer method depending on whether ROM is NTSC or PAL
****************************************************************************/ ****************************************************************************/
extern u8 vmode_60hz; extern u8 vmode_60hz;
int timerstyle; int timerstyle;
@ -446,8 +446,8 @@ int timerstyle;
void setFrameTimerMethod() void setFrameTimerMethod()
{ {
/* /*
Set frametimer method Set frametimer method
(timerstyle: 0=NTSC vblank, 1=PAL int timer) (timerstyle: 0=NTSC vblank, 1=PAL int timer)
*/ */
if ( Settings.PAL ) { if ( Settings.PAL ) {
if(vmode_60hz == 1) if(vmode_60hz == 1)
@ -466,7 +466,7 @@ void setFrameTimerMethod()
} }
/**************************************************************************** /****************************************************************************
* NGCReportButtons * NGCReportButtons
* Called on each rendered frame * Called on each rendered frame
****************************************************************************/ ****************************************************************************/
void void
NGCReportButtons () NGCReportButtons ()
@ -482,7 +482,7 @@ NGCReportButtons ()
u32 wm_pb = WPAD_ButtonsHeld (0); // wiimote / expansion button info u32 wm_pb = WPAD_ButtonsHeld (0); // wiimote / expansion button info
wpad_get_analogues(0, &mag1, &ang1, &mag2, &ang2); // get joystick info from wii expansions wpad_get_analogues(0, &mag1, &ang1, &mag2, &ang2); // get joystick info from wii expansions
#endif #endif
/*** Check for video zoom ***/ /*** Check for video zoom ***/
if (GCSettings.NGCZoom) if (GCSettings.NGCZoom)
{ {
@ -496,15 +496,15 @@ NGCReportButtons ()
#endif #endif
} }
Settings.TurboMode = ( (gc_px > 70) Settings.TurboMode = ( (gc_px > 70)
#ifdef HW_RVL #ifdef HW_RVL
|| (mag2>JOY_THRESHOLD && ang2>75 && ang2<115) || (mag2>JOY_THRESHOLD && ang2>75 && ang2<115)
#endif #endif
); // RIGHT on c-stick and on classic ctrlr right joystick ); // RIGHT on c-stick and on classic ctrlr right joystick
/*** Check for menu: /*** Check for menu:
CStick left CStick left
OR "L+R+X+Y" (eg. Hombrew/Adapted SNES controllers) OR "L+R+X+Y" (eg. Hombrew/Adapted SNES controllers)
OR "Home" on the wiimote or classic controller ***/ OR "Home" on the wiimote or classic controller ***/
if ((gc_px < -70) || if ((gc_px < -70) ||
@ -519,9 +519,9 @@ NGCReportButtons ()
) )
{ {
ConfigRequested = 1; ConfigRequested = 1;
VIDEO_WaitVSync (); VIDEO_WaitVSync ();
if ( GCSettings.AutoSave == 1 ) if ( GCSettings.AutoSave == 1 )
{ {
quickSaveSRAM ( SILENT ); quickSaveSRAM ( SILENT );
@ -539,16 +539,16 @@ NGCReportButtons ()
quickSaveFreeze ( SILENT ); quickSaveFreeze ( SILENT );
} }
} }
mainmenu (3); // go to game menu mainmenu (3); // go to game menu
FrameTimer = 0; FrameTimer = 0;
ConfigRequested = 0; ConfigRequested = 0;
setFrameTimerMethod(); // set frametimer method every time a ROM is loaded setFrameTimerMethod(); // set frametimer method every time a ROM is loaded
S9xReportControllers(); // FIX S9xReportControllers(); // FIX
} }
else else
{ {
@ -562,7 +562,7 @@ NGCReportButtons ()
* wpad_get_analogues() * wpad_get_analogues()
* *
* gets the analogue stick magnitude and angle values ( * gets the analogue stick magnitude and angle values (
* from classic or nunchuk expansions) * from classic or nunchuk expansions)
****************************************************************************/ ****************************************************************************/
u32 wpad_get_analogues(int pad, float* mag1, u16* ang1, float* mag2, u16* ang2) u32 wpad_get_analogues(int pad, float* mag1, u16* ang1, float* mag2, u16* ang2)
{ {
@ -571,7 +571,7 @@ u32 wpad_get_analogues(int pad, float* mag1, u16* ang1, float* mag2, u16* ang2)
#ifdef HW_RVL #ifdef HW_RVL
struct expansion_t exp; struct expansion_t exp;
memset( &exp, 0, sizeof(exp) ); memset( &exp, 0, sizeof(exp) );
if ( WPAD_Probe( pad, &exp_type) == 0) // check wiimote and expansion status (first if wiimote is connected & no errors) if ( WPAD_Probe( pad, &exp_type) == 0) // check wiimote and expansion status (first if wiimote is connected & no errors)
{ {
WPAD_Expansion(pad, &exp); // expansion connected. get info WPAD_Expansion(pad, &exp); // expansion connected. get info
@ -596,14 +596,14 @@ void SetControllers ()
{ {
if (Settings.MultiPlayer5Master == true) if (Settings.MultiPlayer5Master == true)
{ {
S9xSetController (0, CTL_JOYPAD, 0, 0, 0, 0); S9xSetController (0, CTL_JOYPAD, 0, 0, 0, 0);
S9xSetController (1, CTL_MP5, 1, 2, 3, -1); S9xSetController (1, CTL_MP5, 1, 2, 3, -1);
} }
else if (Settings.SuperScopeMaster == true) else if (Settings.SuperScopeMaster == true)
{ {
S9xSetController (0, CTL_JOYPAD, 0, 0, 0, 0); S9xSetController (0, CTL_JOYPAD, 0, 0, 0, 0);
S9xSetController (1, CTL_SUPERSCOPE, 1, 0, 0, 0); S9xSetController (1, CTL_SUPERSCOPE, 1, 0, 0, 0);
} }
else else
{ {
@ -681,7 +681,7 @@ SetDefaultButtonMap ()
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 Down"); ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 Down");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 Left"); ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 Left");
ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 Right"); ASSIGN_BUTTON_FALSE (maxcode++, "Joypad4 Right");
maxcode = 0x50; maxcode = 0x50;
/*** Superscope ***/ /*** Superscope ***/
ASSIGN_BUTTON_FALSE (maxcode++, "Superscope AimOffscreen"); ASSIGN_BUTTON_FALSE (maxcode++, "Superscope AimOffscreen");
@ -689,11 +689,11 @@ SetDefaultButtonMap ()
ASSIGN_BUTTON_FALSE (maxcode++, "Superscope Cursor"); ASSIGN_BUTTON_FALSE (maxcode++, "Superscope Cursor");
ASSIGN_BUTTON_FALSE (maxcode++, "Superscope ToggleTurbo"); ASSIGN_BUTTON_FALSE (maxcode++, "Superscope ToggleTurbo");
ASSIGN_BUTTON_FALSE (maxcode++, "Superscope Pause"); ASSIGN_BUTTON_FALSE (maxcode++, "Superscope Pause");
maxcode = 0x60; maxcode = 0x60;
S9xMapPointer( maxcode++, S9xGetCommandT("Pointer Superscope"), false); S9xMapPointer( maxcode++, S9xGetCommandT("Pointer Superscope"), false);
// add mouses here // add mouses here
SetControllers (); SetControllers ();
} }
@ -757,7 +757,7 @@ main ()
fatInitDefault(); fatInitDefault();
//fatInit(8192, false); //fatInit(8192, false);
//fat_enable_readahead_all(); //fat_enable_readahead_all();
/*** Initialize DVD subsystem ***/ /*** Initialize DVD subsystem ***/
DVD_Init (); DVD_Init ();

View File

@ -17,9 +17,9 @@
#include "snes9xGx.h" #include "snes9xGx.h"
#include "memmap.h" #include "memmap.h"
#include "srtc.h" #include "srtc.h"
#include "ftfont.h" #include "menudraw.h"
#include "mcsave.h" #include "mcsave.h"
#include "sdload.h" #include "fileop.h"
#include "smbload.h" #include "smbload.h"
#include "filesel.h" #include "filesel.h"
@ -254,7 +254,7 @@ LoadSRAM (int method, bool silent)
sprintf (filepath, "%s/%s/%s.srm", ROOTSDDIR, GCSettings.SaveFolder, Memory.ROMFilename); sprintf (filepath, "%s/%s/%s.srm", ROOTSDDIR, GCSettings.SaveFolder, Memory.ROMFilename);
else else
sprintf (filepath, "%s/%s/%s.srm", ROOTUSBDIR, GCSettings.SaveFolder, Memory.ROMFilename); sprintf (filepath, "%s/%s/%s.srm", ROOTUSBDIR, GCSettings.SaveFolder, Memory.ROMFilename);
offset = LoadBufferFromFAT (filepath, silent); offset = LoadBufferFromFAT (filepath, silent);
} }
else if(method == METHOD_SMB) else if(method == METHOD_SMB)

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* Snes9x 1.50 * Snes9x 1.50
* *
* Nintendo Gamecube Unzip - borrowed from the GPP * Nintendo Gamecube Unzip - borrowed from the GPP
* *
@ -12,7 +12,7 @@
#include <zlib.h> #include <zlib.h>
#include "dvd.h" #include "dvd.h"
#include "video.h" #include "video.h"
#include "ftfont.h" #include "menudraw.h"
#include "unzip.h" #include "unzip.h"
/* /*
@ -100,7 +100,7 @@ UnZipBuffer (unsigned char *outbuffer, u64 discoffset, short where, FILE* fileha
memcpy (&pkzip, readbuffer, sizeof (PKZIPHEADER)); memcpy (&pkzip, readbuffer, sizeof (PKZIPHEADER));
pkzip.uncompressedSize = FLIP32 (pkzip.uncompressedSize); pkzip.uncompressedSize = FLIP32 (pkzip.uncompressedSize);
sprintf (msg, "Unzipping %d bytes ... Wait", sprintf (msg, "Unzipping %d bytes ... Wait",
pkzip.uncompressedSize); pkzip.uncompressedSize);
ShowAction (msg); ShowAction (msg);
@ -157,7 +157,7 @@ UnZipBuffer (unsigned char *outbuffer, u64 discoffset, short where, FILE* fileha
/*** Readup the next 2k block ***/ /*** Readup the next 2k block ***/
zipoffset = 0; zipoffset = 0;
zipchunk = ZIPCHUNK; zipchunk = ZIPCHUNK;
switch (where) { switch (where) {
case 0: // SD Card case 0: // SD Card
fread (readbuffer, 1, 2048, filehandle); break; fread (readbuffer, 1, 2048, filehandle); break;
@ -165,7 +165,7 @@ UnZipBuffer (unsigned char *outbuffer, u64 discoffset, short where, FILE* fileha
discoffset += 2048; discoffset += 2048;
dvd_read (readbuffer, 2048, discoffset); break; dvd_read (readbuffer, 2048, discoffset); break;
} }
} }
while (res != Z_STREAM_END); while (res != Z_STREAM_END);