- Do not treat mass: as a read-only device. On the contrary, it's better to keep all the savefiles and the configuration file there when it's available.
- Calling driveStop() on a slim PS2 with no disc in drive results in that - http://sourceforge.net/tracker/index.ph ... tid=418820.
- PAL_NTSC_FLAG doesn't work with a slim PS2.
- SD TVs have a significant overscan (dispPosY = 88, _tvHeight = 480 for me, and that's PAL) - so that should be configurable or it should default to some safe values.
- Checking for EISDIR won't work with mass:.
- Quit should call mc0:/BOOT/BOOT.ELF.
- TocManager is buggy and the whole caching system needs a rewrite.
Some fixes:
Ps2UsbSaveFileManager, to be used instead of Ps2SaveFileManager when launched from mass: (needs an intermediate abstract class). http://rapidshare.com/files/129739353/s ... b.zip.html
Code: Select all
backends\fs\ps2\ps2-fs.cpp:
in class Ps2FilesystemNode : public AbstractFilesystemNode
virtual bool isWritable() const {
if (_path[0] == 'm') // mass and mc
return true;
else
return false;
}
in bool Ps2FilesystemNode::getDirectoryFlag(const char *path)
else if (strncmp(path, "mass:", 5) == 0) {
fd = fio.dopen(path);
if (fd >= 0) {
dbg_printf("Node is a dir\n");
fio.dclose(fd);
return true;
} else
dbg_printf("Node is not a dir (%d)\n", fd);
base\commandLine.cpp:
In void registerDefaults()
#ifdef __PLAYSTATION2__
#include "backends/platform/ps2/systemps2.h"
char savePath[MAXPATHLEN];
((OSystem_PS2*)g_system)->makeSavePath(savePath);
ConfMan.registerDefault("savepath", savePath);
#endif //#ifdef __PLAYSTATION2__
gui\options.cpp:
remove __PLAYSTATION2__ from #if !( defined(__DC__) || defined(__GP32__) || defined(__PLAYSTATION2__) )
backends\platform\ps2\irxboot.h:
add MASS to enum BootDevice
backends\platform\ps2\irxboot.cpp:
to detectBootPath():
if (strncasecmp(elfPath, "mass", 4) == 0)
device = MASS;
backends\platform\ps2\systemps2.h:
to class OSystem_PS2 : public OSystem
void loadBootElf();
void makeSavePath(char *dest);
char szElfPath[0x100];
backends\platform\ps2\systemps2.cpp
at the end of OSystem_PS2::startIrxModules():
if(_usbMassLoaded) {
int access = 0;
while(access <= 0) access = fioDopen("mass:");
fioDclose(access);
}
in OSystem_PS2::OSystem_PS2():
int numModules = loadIrxModules(_bootDevice, szElfPath, &modules);
at the end of OSystem_PS2::OSystem_PS2():
assert(mcInit(MC_TYPE_MC) >= 0);
at the end of OSystem_PS2::quit()
loadBootElf();
void OSystem_PS2::makeConfigPath(char *dest) {
switch (_bootDevice) {
case CDROM:
strcpy(dest, "cdfs:/ScummVM.ini");
break;
case HOST:
case MASS:
sprintf(dest, "%sscummvm.ini", szElfPath);
break;
case OTHER:
case UNKNOWN:
default:
strcpy(dest, "mc0:ScummVM/scummvm.ini");
}
}
void OSystem_PS2::makeSavePath(char *dest) {
switch (_bootDevice) {
case HOST:
case MASS:
strcpy(dest, szElfPath);
break;
case CDROM:
case OTHER:
case UNKNOWN:
default:
strcpy(dest, "mc0:ScummVM");
}
}
typedef struct { // struct definition for ELF object header
u8 ident[16];
u16 type;
u16 machine;
u32 version;
u32 entry;
u32 phoff;
u32 shoff;
u32 flags;
u16 ehsize;
u16 phentsize;
u16 phnum;
u16 shentsize;
u16 shnum;
u16 shstrndx;
} elf_header_t;
typedef struct { // struct definition for ELF program section header
u32 type;
u32 offset;
void* vaddr;
u32 paddr;
u32 filesz;
u32 memsz;
u32 flags;
u32 align;
} elf_pheader_t;
void OSystem_PS2::loadBootElf(void) {
char* filename = "mc0:/BOOT/BOOT.ELF";
u8* boot_elf;
elf_header_t* eh;
elf_pheader_t* eph;
int hFile = 0;
int nSize, i;
int argc;
char* argv[1];
boot_elf = (u8*) 0x1800000;
eh = (elf_header_t*) boot_elf;
hFile = fioOpen(filename, O_RDONLY);
if(hFile < 0)
LoadExecPS2("rom0:OSDSYS", 0, NULL);
fioRead(hFile, boot_elf, 52);
if((_lw((u32) &eh->ident) != 0x464c457f) || eh->type != 2)
LoadExecPS2("rom0:OSDSYS", 0, NULL);
fioLseek(hFile, eh->phoff, SEEK_SET);
eph = (elf_pheader_t*) (boot_elf + eh->phoff);
nSize = eh->phnum * eh->phentsize;
fioRead(hFile, (void*) eph, nSize);
for(i = 0; i < eh->phnum; i++) {
if(eph[i].type != 1)
continue;
fioLseek(hFile, eph[i].offset, SEEK_SET);
fioRead(hFile, eph[i].vaddr, eph[i].filesz);
if(eph[i].memsz > eph[i].filesz)
memset((unsigned char*)eph[i].vaddr + eph[i].filesz, 0, eph[i].memsz - eph[i].filesz);
}
fioClose(hFile);
fioExit();
padEnd();
cdvdInit(CDVD_EXIT);
SifIopReset(NULL, 0);
SifExitRpc();
while (!SifIopSync());
SifInitRpc(0);
cdvdExit();
SifExitRpc();
FlushCache(0);
SifLoadFileExit();
argc = 1;
argv[0] = filename;
ExecPS2((void*) eh->entry, 0, argc, argv);
}
And here is an updated version based on the 0.11.1. But it's PAL only, mass: only and scumm, saga and sky engines only. http://rapidshare.com/files/129737311/scummvm.zip.html