mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-24 02:01:48 +01:00
minor bug fixes, modified SRAM/SaveState filenames
This commit is contained in:
parent
00a61b4762
commit
7b8984f729
@ -1,7 +1,7 @@
|
||||
Genesis Plus for Gamecube
|
||||
------------------------------
|
||||
|
||||
11/12/2008:
|
||||
12/12/2008:
|
||||
-----------
|
||||
[Genesis]
|
||||
- YM2612 bugfixes (MAME core):
|
||||
@ -26,8 +26,8 @@ Genesis Plus for Gamecube
|
||||
- removed embedded font, (re)enabled IPL font support: now should works for Qoob users too (thanks to emukiddid)
|
||||
- fixed "Reset" button behavior, now acts more like Genesis Reset button ;-)
|
||||
- patched libfat for faster SDCARD accesses (thanks to svpe)
|
||||
- various bugfixes and menu tweaks
|
||||
|
||||
- SRAM and SaveState files are now based on the ROM filename
|
||||
- various bugfixes, menu tweaks and code cleanup
|
||||
|
||||
[NGC only]
|
||||
- added 480p support in menu
|
||||
|
@ -51,8 +51,8 @@
|
||||
|
||||
/* System IO ports */
|
||||
#define NO_SYSTEM (0) /* Unconnected Port*/
|
||||
#define SYSTEM_MOUSE (1) /* Sega Mouse */
|
||||
#define SYSTEM_GAMEPAD (2) /* Single Gamepad */
|
||||
#define SYSTEM_GAMEPAD (1) /* Single Gamepad */
|
||||
#define SYSTEM_MOUSE (2) /* Sega Mouse */
|
||||
#define SYSTEM_MENACER (3) /* Sega Menacer (port 2) */
|
||||
#define SYSTEM_JUSTIFIER (4) /* Konami Justifier (port 2) */
|
||||
#define SYSTEM_TEAMPLAYER (5) /* Sega TeamPlayer */
|
||||
|
@ -25,9 +25,9 @@
|
||||
#include <sys/dir.h>
|
||||
|
||||
#ifdef HW_RVL
|
||||
#define CONFIG_VERSION "GENPLUS 1.2.2W"
|
||||
#define CONFIG_VERSION "GENPLUS 1.2.3W"
|
||||
#else
|
||||
#define CONFIG_VERSION "GENPLUS 1.2.2G"
|
||||
#define CONFIG_VERSION "GENPLUS 1.2.3G"
|
||||
#endif
|
||||
|
||||
void config_save()
|
||||
|
@ -195,7 +195,7 @@ int FAT_LoadFile (u8 *buffer)
|
||||
if (length > 0)
|
||||
{
|
||||
/* Add/move the file to the top of the history. */
|
||||
history_add_file(fatdir, filelist[selection].filename);
|
||||
if(!useHistory) history_add_file(fatdir, filelist[selection].filename);
|
||||
|
||||
/* full filename */
|
||||
char fname[MAXPATHLEN];
|
||||
|
@ -39,6 +39,7 @@ int haveDVDdir = 0;
|
||||
int haveFATdir = 0;
|
||||
|
||||
FILEENTRIES filelist[MAXFILES];
|
||||
char rom_filename[MAXJOLIET];
|
||||
|
||||
/***************************************************************************
|
||||
* ShowFiles
|
||||
@ -80,7 +81,7 @@ int FileSelector(unsigned char *buffer)
|
||||
int go_up = 0;
|
||||
int ret;
|
||||
int i,size;
|
||||
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (redraw) ShowFiles (offset, selection);
|
||||
@ -108,7 +109,7 @@ int FileSelector(unsigned char *buffer)
|
||||
redraw = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* highlight next item */
|
||||
else if (p & PAD_BUTTON_DOWN)
|
||||
{
|
||||
@ -118,7 +119,7 @@ int FileSelector(unsigned char *buffer)
|
||||
if ((selection - offset) >= PAGESIZE) offset += PAGESIZE;
|
||||
redraw = 1;
|
||||
}
|
||||
|
||||
|
||||
/* highlight previous item */
|
||||
else if (p & PAD_BUTTON_UP)
|
||||
{
|
||||
@ -133,7 +134,7 @@ int FileSelector(unsigned char *buffer)
|
||||
if (offset < 0) offset = 0;
|
||||
redraw = 1;
|
||||
}
|
||||
|
||||
|
||||
/* go back one page */
|
||||
else if (p & PAD_TRIGGER_L)
|
||||
{
|
||||
@ -148,7 +149,7 @@ int FileSelector(unsigned char *buffer)
|
||||
if (offset < 0) offset = 0;
|
||||
redraw = 1;
|
||||
}
|
||||
|
||||
|
||||
/* go forward one page */
|
||||
else if (p & PAD_TRIGGER_R)
|
||||
{
|
||||
@ -158,14 +159,14 @@ int FileSelector(unsigned char *buffer)
|
||||
if ((selection - offset) >= PAGESIZE) offset += PAGESIZE;
|
||||
redraw = 1;
|
||||
}
|
||||
|
||||
|
||||
/* quit */
|
||||
if (p & PAD_TRIGGER_Z)
|
||||
{
|
||||
filelist[selection].filename_offset = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* open selected file or directory */
|
||||
if ((p & PAD_BUTTON_A) || (p & PAD_BUTTON_B))
|
||||
{
|
||||
@ -178,7 +179,7 @@ int FileSelector(unsigned char *buffer)
|
||||
go_up = 1;
|
||||
selection = useFAT ? 0 : 1;
|
||||
}
|
||||
|
||||
|
||||
/*** This is directory ***/
|
||||
if (filelist[selection].flags)
|
||||
{
|
||||
@ -198,9 +199,20 @@ int FileSelector(unsigned char *buffer)
|
||||
/*** This is a file ***/
|
||||
else
|
||||
{
|
||||
/* root directory ? */
|
||||
if (go_up) return 0;
|
||||
|
||||
/* Load file */
|
||||
if (useFAT) return FAT_LoadFile(buffer);
|
||||
else return DVD_LoadFile(buffer);
|
||||
if (useFAT) ret = FAT_LoadFile(buffer);
|
||||
else ret = DVD_LoadFile(buffer);
|
||||
|
||||
if (ret)
|
||||
{
|
||||
/* get filename and remove extension */
|
||||
sprintf(rom_filename,"%s", filelist[selection].filename);
|
||||
rom_filename[strlen(rom_filename) - 5] = 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
redraw = 1;
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ typedef struct
|
||||
|
||||
/* Global Variables */
|
||||
extern FILEENTRIES filelist[MAXFILES];
|
||||
extern char rom_filename[MAXJOLIET];
|
||||
extern int maxfiles;
|
||||
extern int offset;
|
||||
extern int selection;
|
||||
|
@ -129,7 +129,7 @@ int UnZipBuffer (unsigned char *outbuffer, u64 discoffset, char *filename)
|
||||
/*** Copy PKZip header to local, used as info ***/
|
||||
memcpy (&pkzip, &readbuffer, sizeof (PKZIPHEADER));
|
||||
|
||||
sprintf (msg, "Unzipping %d bytes ... Wait", FLIP32 (pkzip.uncompressedSize));
|
||||
sprintf (msg, "Unzipping %d bytes ...", FLIP32 (pkzip.uncompressedSize));
|
||||
ShowAction (msg);
|
||||
|
||||
/*** Prepare the zip stream ***/
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "shared.h"
|
||||
#include "font.h"
|
||||
#include "saveicon.h"
|
||||
#include "filesel.h"
|
||||
|
||||
#ifndef HW_RVL
|
||||
#include "dvd.h"
|
||||
@ -97,7 +98,7 @@ void memfile_autosave()
|
||||
* We use the same buffer as for Memory Card manager
|
||||
* Function returns TRUE on success.
|
||||
*****************************************************************************/
|
||||
static int SD_ManageFile(char *filename, int direction, int filetype)
|
||||
static int FAT_ManageFile(char *filename, int direction, int filetype)
|
||||
{
|
||||
char pathname[MAXPATHLEN];
|
||||
int done = 0;
|
||||
@ -241,7 +242,24 @@ int CardFileExists (char *filename, u8 slot)
|
||||
****************************************************************************/
|
||||
int ManageSRAM (u8 direction, u8 device)
|
||||
{
|
||||
char filename[128];
|
||||
if (!genromsize) return 0;
|
||||
|
||||
char filename[MAXJOLIET];
|
||||
|
||||
/* clean buffer */
|
||||
memset(savebuffer, 0, 0x24000);
|
||||
|
||||
if (direction) ShowAction ("Loading SRAM ...");
|
||||
else ShowAction ("Saving SRAM ...");
|
||||
|
||||
if (device == 0)
|
||||
{
|
||||
/* FAT support */
|
||||
sprintf (filename, "%s.srm", rom_filename);
|
||||
return FAT_ManageFile(filename,direction,1);
|
||||
}
|
||||
|
||||
/* Memory CARD support */
|
||||
char action[80];
|
||||
int CardError;
|
||||
unsigned int SectorSize;
|
||||
@ -251,26 +269,15 @@ int ManageSRAM (u8 direction, u8 device)
|
||||
int sbo;
|
||||
unsigned long inzipped,outzipped;
|
||||
|
||||
if (!genromsize) return 0;
|
||||
|
||||
/* clean buffer */
|
||||
memset(savebuffer, 0, 0x24000);
|
||||
|
||||
if (direction) ShowAction ("Loading SRAM ...");
|
||||
else ShowAction ("Saving SRAM ...");
|
||||
|
||||
/* First, build a filename */
|
||||
sprintf (filename, "MD-%04X.srm", realchecksum);
|
||||
strcpy (comment[1], filename);
|
||||
|
||||
/* device is SDCARD, let's go */
|
||||
if (device == 0) return SD_ManageFile(filename,direction,1);
|
||||
|
||||
/* set MCARD slot nr. */
|
||||
u8 CARDSLOT = device - 1;
|
||||
|
||||
/* device is MCARD, we continue */
|
||||
if (direction == 0) /*** Saving ***/
|
||||
/* Saving */
|
||||
if (direction == 0)
|
||||
{
|
||||
/*** Build the output buffer ***/
|
||||
memcpy (&savebuffer, &icon, 2048);
|
||||
@ -432,7 +439,24 @@ int ManageSRAM (u8 direction, u8 device)
|
||||
****************************************************************************/
|
||||
int ManageState (u8 direction, u8 device)
|
||||
{
|
||||
char filename[128];
|
||||
if (!genromsize) return 0;
|
||||
|
||||
char filename[MAXJOLIET];
|
||||
|
||||
/* clean buffer */
|
||||
memset(savebuffer, 0, 0x24000);
|
||||
|
||||
if (direction) ShowAction ("Loading State ...");
|
||||
else ShowAction ("Saving State ...");
|
||||
|
||||
if (device == 0)
|
||||
{
|
||||
/* FAT support */
|
||||
sprintf (filename, "%s.gpz", rom_filename);
|
||||
return FAT_ManageFile(filename,direction,0);
|
||||
}
|
||||
|
||||
/* Memory CARD support */
|
||||
char action[80];
|
||||
int CardError;
|
||||
unsigned int SectorSize;
|
||||
@ -442,26 +466,15 @@ int ManageState (u8 direction, u8 device)
|
||||
int sbo;
|
||||
int state_size = 0;
|
||||
|
||||
if (!genromsize) return 0;
|
||||
|
||||
/* clean buffer */
|
||||
memset(savebuffer, 0, 0x24000);
|
||||
|
||||
if (direction) ShowAction ("Loading State ...");
|
||||
else ShowAction ("Saving State ...");
|
||||
|
||||
/* First, build a filename */
|
||||
sprintf (filename, "MD-%04X.gpz", realchecksum);
|
||||
strcpy (comment[1], filename);
|
||||
|
||||
/* device is SDCARD, let's go */
|
||||
if (device == 0) return SD_ManageFile(filename,direction,0);
|
||||
|
||||
/* set MCARD slot nr. */
|
||||
u8 CARDSLOT = device - 1;
|
||||
|
||||
/* device is MCARD, we continue */
|
||||
if (direction == 0) /* Saving */
|
||||
/* Saving */
|
||||
if (direction == 0)
|
||||
{
|
||||
/* Build the output buffer */
|
||||
memcpy (&savebuffer, &icon, 2048);
|
||||
|
@ -712,8 +712,7 @@ void ConfigureJoypads ()
|
||||
break;
|
||||
|
||||
case 7:
|
||||
/* special case: wiimote controls lightgun */
|
||||
|
||||
if (config.input[player].device < 0) break;
|
||||
ogc_input__config(config.input[player].port, config.input[player].device, input.padtype[player]);
|
||||
break;
|
||||
|
||||
|
@ -167,6 +167,7 @@ int main (int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Default Config */
|
||||
legal();
|
||||
set_config_defaults();
|
||||
config_load();
|
||||
|
||||
@ -185,7 +186,6 @@ int main (int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Show Menu */
|
||||
legal();
|
||||
MainMenu();
|
||||
ConfigRequested = 0;
|
||||
|
||||
|
@ -52,14 +52,14 @@ static void AudioSwitchBuffers()
|
||||
AUDIO_StartDMA();
|
||||
|
||||
/* increment soundbuffers index */
|
||||
playbuffer++;
|
||||
playbuffer &= 0xf;
|
||||
|
||||
if (playbuffer == mixbuffer)
|
||||
{
|
||||
playbuffer--;
|
||||
if ( playbuffer < 0 ) playbuffer = 15;
|
||||
}
|
||||
playbuffer++;
|
||||
playbuffer &= 0xf;
|
||||
|
||||
IsPlaying = 1;
|
||||
}
|
||||
|
||||
|
@ -655,7 +655,7 @@ void ogc_input__set_defaults(void)
|
||||
int j;
|
||||
for (i=0; i<4; i++)
|
||||
{
|
||||
/* autodetect connected controller */
|
||||
/* try to autodetect connected controller */
|
||||
exp = 255;
|
||||
WPAD_Probe(i, &exp);
|
||||
if (exp <= WPAD_EXP_CLASSIC)
|
||||
|
Loading…
Reference in New Issue
Block a user