gpgx: clean up some rom load code... maybe???

This commit is contained in:
goyuken 2013-12-19 22:51:04 +00:00
parent 163ee0e6fd
commit 96db47cb24
5 changed files with 11 additions and 13 deletions

View File

@ -135,7 +135,7 @@ int (*load_archive_cb)(const char *filename, unsigned char *buffer, int maxsize)
// return 0 on failure, else actual loaded size
// extension, if not null, should be populated with the extension of the file loaded
// (up to 3 chars and null terminator, no more)
int load_archive(char *filename, unsigned char *buffer, int maxsize, char *extension)
int load_archive(const char *filename, unsigned char *buffer, int maxsize, char *extension)
{
if (extension)
memcpy(extension, romextension, 4);
@ -404,13 +404,8 @@ GPGX_EX int gpgx_init(const char *feromextension, int (*feload_archive_cb)(const
config.input[i].padtype = sixbutton ? DEVICE_PAD6B : DEVICE_PAD3B;
}
{
//copy our desired fname into a r/w string buffer, since load_rom may edit it (!)
char fname[64];
strcpy(fname,"PRIMARY_ROM");
if (!load_rom(fname))
return 0;
}
if (!load_rom("PRIMARY_ROM"))
return 0;
audio_init(44100, 0);
system_init();

View File

@ -525,7 +525,7 @@ int load_bios(void)
* Return 0 on error, 1 on success
*
***************************************************************************/
int load_rom(char *filename)
int load_rom(const char *filename)
{
int i, size;
@ -729,8 +729,11 @@ int load_rom(char *filename)
scd.cartridge.boot = 0x40;
/* automatically load associated .iso image */
strncpy(&filename[strlen(filename) - 4], ".iso", 4);
cdd_load((char *)cdc.ram); // should this be checked for failure?
// this will only possibly work if a CD and a ROM are provided at the same time, which the frontend
// has no provision for at the moment
if (cdd_load((char *)cdc.ram) <= 0)
// no load, so disable CD hardware
system_hw = SYSTEM_MD;
}
else
{

View File

@ -65,7 +65,7 @@ extern uint8 romtype;
/* Function prototypes */
extern int load_bios(void);
extern int load_rom(char *filename);
extern int load_rom(const char *filename);
extern void get_region(char *romheader);
extern char *get_company(void);
extern char *get_peripheral(int index);

View File

@ -79,6 +79,6 @@ extern char MS_BIOS_EU[256];
extern char MS_BIOS_JP[256];
void osd_input_update(void);
int load_archive(char *filename, unsigned char *buffer, int maxsize, char *extension);
int load_archive(const char *filename, unsigned char *buffer, int maxsize, char *extension);
#endif /* _OSD_H */

Binary file not shown.