git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@27235 e17a0e51-4ae3-4d35-97c3-1a29b211df97
This commit is contained in:
parent
54e6ea3610
commit
c9b34c524d
|
@ -1,10 +1,14 @@
|
|||
August 22, 2009 dario86
|
||||
|
||||
* libpcsxcore/cdrom.c: Demute the CD-DA by default.
|
||||
* libpcsxcore/cdrom.c: Demute the CD-DA by default, which fixes the music
|
||||
problem with Tekken 1.
|
||||
|
||||
August 22, 2009 Wei Mingzhi <weimingzhi@gmail.com>
|
||||
|
||||
* libpcsxcore/misc.c: Also check for PSX.EXE in CheckCdrom().
|
||||
* libpcsxcore/misc.c: Also check for PSX.EXE in CheckCdrom(). Added support
|
||||
for CPE binaries. Returns -1 in Load() if EXE is not found. Print the
|
||||
EXE loading error messages in console instead of a message box.
|
||||
* gui/Gtk2Gui.c: Show files with .cpe extension in the Load EXE dialog box.
|
||||
* debian/rules: Removed dh_desktop.
|
||||
|
||||
August 17, 2009 Wei Mingzhi <weimingzhi@gmail.com>
|
||||
|
|
|
@ -479,11 +479,12 @@ void OnFile_RunExe() {
|
|||
GtkFileFilter *exefilter = gtk_file_filter_new ();
|
||||
gtk_file_filter_add_pattern (exefilter, "*.exe");
|
||||
gtk_file_filter_add_pattern (exefilter, "*.psx");
|
||||
gtk_file_filter_add_pattern (exefilter, "*.cpe");
|
||||
gtk_file_filter_set_name (exefilter, _("PlayStation Executable Files"));
|
||||
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (file_chooser), exefilter);
|
||||
GtkFileFilter *allfilter = gtk_file_filter_new ();
|
||||
gtk_file_filter_add_pattern (allfilter, "*");
|
||||
gtk_file_filter_set_name (allfilter, "All Files");
|
||||
gtk_file_filter_set_name (allfilter, _("All Files"));
|
||||
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (file_chooser), allfilter);
|
||||
|
||||
/* Set this to the config object and retain it - maybe LastUsedDir */
|
||||
|
@ -503,19 +504,16 @@ void OnFile_RunExe() {
|
|||
LoadPlugins();
|
||||
NetOpened = 0;
|
||||
|
||||
/* TODO If a CDR plugin image has not been selected, then OpenPlugins() will prompt us to
|
||||
configure the plugin, even though we don't need it for EXE files. Need to pass a parameter
|
||||
or something */
|
||||
if (OpenPlugins() == -1) {
|
||||
/* TODO Error message */
|
||||
SysRunGui();
|
||||
g_free(file);
|
||||
SysRunGui();
|
||||
} else {
|
||||
SysReset();
|
||||
|
||||
if (Load(file) == 0) {
|
||||
g_free(file);
|
||||
if (Config.Dbg) hdb_start();
|
||||
psxCpu->Execute();
|
||||
g_free(file);
|
||||
} else {
|
||||
g_free(file);
|
||||
ClosePlugins();
|
||||
|
|
|
@ -369,14 +369,16 @@ int Load(char *ExePath) {
|
|||
EXE_HEADER tmpHead;
|
||||
int type;
|
||||
int retval = 0;
|
||||
u8 opcode;
|
||||
u32 section_address, section_size;
|
||||
|
||||
strncpy(CdromId, "SLUS99999", 9);
|
||||
strncpy(CdromLabel, "SLUS_999.99", 11);
|
||||
|
||||
tmpFile = fopen(ExePath,"rb");
|
||||
tmpFile = fopen(ExePath, "rb");
|
||||
if (tmpFile == NULL) {
|
||||
SysMessage(_("Error opening file: %s"), ExePath);
|
||||
retval = 0;
|
||||
SysPrintf(_("Error opening file: %s.\n"), ExePath);
|
||||
retval = -1;
|
||||
} else {
|
||||
type = PSXGetFileType(tmpFile);
|
||||
switch (type) {
|
||||
|
@ -393,19 +395,50 @@ int Load(char *ExePath) {
|
|||
retval = 0;
|
||||
break;
|
||||
case CPE_EXE:
|
||||
SysMessage(_("CPE files not supported."));
|
||||
retval = -1;
|
||||
fseek(tmpFile, 6, SEEK_SET); /* Something tells me we should go to 4 and read the "08 00" here... */
|
||||
do {
|
||||
fread(&opcode, 1, 1, tmpFile);
|
||||
switch (opcode) {
|
||||
case 1: /* Section loading */
|
||||
fread(§ion_address, 4, 1, tmpFile);
|
||||
fread(§ion_size, 4, 1, tmpFile);
|
||||
section_address = SWAPu32(section_address);
|
||||
section_size = SWAPu32(section_size);
|
||||
#ifdef EMU_LOG
|
||||
EMU_LOG("Loading %08X bytes from %08X to %08X\n", section_size, ftell(tmpFile), section_address);
|
||||
#endif
|
||||
fread(PSXM(section_address), section_size, 1, tmpFile);
|
||||
break;
|
||||
case 3: /* register loading (PC only?) */
|
||||
fseek(tmpFile, 2, SEEK_CUR); /* unknown field */
|
||||
fread(&psxRegs.pc, 4, 1, tmpFile);
|
||||
psxRegs.pc = SWAPu32(psxRegs.pc);
|
||||
break;
|
||||
case 0: /* End of file */
|
||||
break;
|
||||
default:
|
||||
SysPrintf(_("Unknown CPE opcode %02x at position %08x.\n"), opcode, ftell(tmpFile) - 1);
|
||||
retval = -1;
|
||||
break;
|
||||
}
|
||||
} while (opcode != 0 && retval == 0);
|
||||
break;
|
||||
case COFF_EXE:
|
||||
SysMessage(_("COFF files not supported."));
|
||||
SysPrintf(_("COFF files not supported.\n"));
|
||||
retval = -1;
|
||||
break;
|
||||
case INVALID_EXE:
|
||||
SysMessage(_("This file does not appear to be a valid PSX file."));
|
||||
SysPrintf(_("This file does not appear to be a valid PSX file.\n"));
|
||||
retval = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (retval != 0) {
|
||||
CdromId[0] = '\0';
|
||||
CdromLabel[0] = '\0';
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue