ScummVM/PS2 bugs fixed by this commit:
- general file write corruption (eg. ScummVM.ini, etc.) - COMI specific save crash / corruption (added option in engines/scumm/saveload.cpp to disable thumbnails on PS2, as emergency fallback in case the fix should prove to be insufficient) - implemented _screenChange logic (fixes grabOverlay & COMI popup menu) - fixed higher pitch (chipmunk fx) - made NET IRXs optional to allow it to work on fat PS2 without net+hd - fixed cursor restore on RTL - added "." as R2 to skip single lines of dialog - added write cache svn-id: r42404
This commit is contained in:
parent
17b1c6d0ae
commit
55cda3aa25
12 changed files with 268 additions and 73 deletions
|
@ -337,6 +337,7 @@ void Gs2dScreen::newScreenSize(uint16 width, uint16 height) {
|
||||||
memset(_screenBuf, 0, _width * height);
|
memset(_screenBuf, 0, _width * height);
|
||||||
memset(_overlayBuf, 0, _width * height * 2);
|
memset(_overlayBuf, 0, _width * height * 2);
|
||||||
memset(_clut, 0, 256 * sizeof(uint32));
|
memset(_clut, 0, 256 * sizeof(uint32));
|
||||||
|
_clut[1] = GS_RGBA(0xC0, 0xC0, 0xC0, 0);
|
||||||
|
|
||||||
// clear video ram
|
// clear video ram
|
||||||
_dmaPipe->uploadTex(_clutPtrs[MOUSE], 64, 0, 0, GS_PSMCT32, _clut, 16, 16);
|
_dmaPipe->uploadTex(_clutPtrs[MOUSE], 64, 0, 0, GS_PSMCT32, _clut, 16, 16);
|
||||||
|
@ -345,7 +346,8 @@ void Gs2dScreen::newScreenSize(uint16 width, uint16 height) {
|
||||||
_dmaPipe->flush();
|
_dmaPipe->flush();
|
||||||
_dmaPipe->waitForDma();
|
_dmaPipe->waitForDma();
|
||||||
|
|
||||||
_clutChanged = _screenChanged = _overlayChanged = false;
|
/*_clutChanged = */ _screenChanged = _overlayChanged = false;
|
||||||
|
_clutChanged = true; // reload palette on scr change
|
||||||
|
|
||||||
_texCoords[1].u = SCALE(_width);
|
_texCoords[1].u = SCALE(_width);
|
||||||
_texCoords[1].v = SCALE(_height);
|
_texCoords[1].v = SCALE(_height);
|
||||||
|
@ -396,6 +398,13 @@ void Gs2dScreen::clearScreen(void) {
|
||||||
SignalSema(g_DmacSema);
|
SignalSema(g_DmacSema);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Gs2dScreen::fillScreen(uint32 col) {
|
||||||
|
WaitSema(g_DmacSema);
|
||||||
|
memset(_screenBuf, col, _width * _height);
|
||||||
|
_screenChanged = true;
|
||||||
|
SignalSema(g_DmacSema);
|
||||||
|
}
|
||||||
|
|
||||||
Graphics::Surface *Gs2dScreen::lockScreen() {
|
Graphics::Surface *Gs2dScreen::lockScreen() {
|
||||||
WaitSema(g_DmacSema);
|
WaitSema(g_DmacSema);
|
||||||
|
|
||||||
|
@ -541,11 +550,11 @@ Graphics::PixelFormat Gs2dScreen::getOverlayFormat(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int16 Gs2dScreen::getOverlayWidth(void) {
|
int16 Gs2dScreen::getOverlayWidth(void) {
|
||||||
return _videoMode.overlayWidth;
|
return _width; // _videoMode.overlayWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16 Gs2dScreen::getOverlayHeight(void) {
|
int16 Gs2dScreen::getOverlayHeight(void) {
|
||||||
return _videoMode.overlayHeight;
|
return _height; // _videoMode.overlayHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gs2dScreen::setShakePos(int shake) {
|
void Gs2dScreen::setShakePos(int shake) {
|
||||||
|
|
|
@ -61,6 +61,7 @@ public:
|
||||||
void copyPrintfOverlay(const uint8* buf);
|
void copyPrintfOverlay(const uint8* buf);
|
||||||
void clearPrintfOverlay(void);
|
void clearPrintfOverlay(void);
|
||||||
void clearScreen(void);
|
void clearScreen(void);
|
||||||
|
void fillScreen(uint32 col);
|
||||||
|
|
||||||
Graphics::Surface *lockScreen();
|
Graphics::Surface *lockScreen();
|
||||||
void unlockScreen();
|
void unlockScreen();
|
||||||
|
|
94
backends/platform/ps2/Makefile.gdb
Normal file
94
backends/platform/ps2/Makefile.gdb
Normal file
|
@ -0,0 +1,94 @@
|
||||||
|
# $Header: Exp $
|
||||||
|
include $(PS2SDK)/Defs.make
|
||||||
|
|
||||||
|
PS2_EXTRA = /media/disk/nw8240/extras/scummvm/ports
|
||||||
|
PS2_EXTRA_INCS = /zlib/include /libmad/ee/include /SjPcm/ee/src /tremor
|
||||||
|
PS2_EXTRA_LIBS = /zlib/lib /libmad/ee/lib /SjPcm/ee/lib /tremor/tremor
|
||||||
|
|
||||||
|
ENABLED=STATIC_PLUGIN
|
||||||
|
|
||||||
|
#control build
|
||||||
|
DISABLE_SCALERS = true
|
||||||
|
DISABLE_HQ_SCALERS = true
|
||||||
|
|
||||||
|
ENABLE_SCUMM = $(ENABLED)
|
||||||
|
ENABLE_SCUMM_7_8 = $(ENABLED)
|
||||||
|
#ENABLE_HE = $(ENABLED)
|
||||||
|
#ENABLE_AGI = $(ENABLED)
|
||||||
|
#ENABLE_AGOS = $(ENABLED)
|
||||||
|
#ENABLE_CINE = $(ENABLED)
|
||||||
|
#ENABLE_CRUISE = $(ENABLED)
|
||||||
|
#ENABLE_DRASCULA = $(ENABLED)
|
||||||
|
#ENABLE_GOB = $(ENABLED)
|
||||||
|
#ENABLE_IGOR = $(ENABLED)
|
||||||
|
#ENABLE_KYRA = $(ENABLED)
|
||||||
|
#ENABLE_LURE = $(ENABLED)
|
||||||
|
# ENABLE_M4 = $(ENABLED)
|
||||||
|
#ENABLE_MADE = $(ENABLED)
|
||||||
|
#ENABLE_PARALLACTION = $(ENABLED)
|
||||||
|
#ENABLE_QUEEN = $(ENABLED)
|
||||||
|
#ENABLE_SAGA = $(ENABLED)
|
||||||
|
#ENABLE_SAGA2 = $(ENABLED)
|
||||||
|
#ENABLE_IHNM = $(ENABLED)
|
||||||
|
#ENABLE_SKY = $(ENABLED)
|
||||||
|
#ENABLE_SWORD1 = $(ENABLED)
|
||||||
|
#ENABLE_SWORD2 = $(ENABLED)
|
||||||
|
# ENABLE_TINSEL = $(ENABLED)
|
||||||
|
#ENABLE_TOUCHE = $(ENABLED)
|
||||||
|
|
||||||
|
HAVE_GCC3 = true
|
||||||
|
|
||||||
|
CC = ee-gcc
|
||||||
|
CXX = ee-g++
|
||||||
|
AS = ee-gcc
|
||||||
|
LD = ee-gcc
|
||||||
|
AR = ee-ar cru
|
||||||
|
RANLIB = ee-ranlib
|
||||||
|
STRIP = ee-strip
|
||||||
|
MKDIR = mkdir -p
|
||||||
|
RM = rm -f
|
||||||
|
|
||||||
|
srcdir = ../../..
|
||||||
|
VPATH = $(srcdir)
|
||||||
|
INCDIR = ../../../
|
||||||
|
# DEPDIR = .deps
|
||||||
|
|
||||||
|
DEFINES = -DUSE_VORBIS -DUSE_TREMOR -DUSE_MAD -DUSE_ZLIB -DFORCE_RTL -D_EE -D__PLAYSTATION2__ -D__PS2_DEBUG__ -g -Wall -Wno-multichar
|
||||||
|
|
||||||
|
|
||||||
|
INCLUDES = $(addprefix -I$(PS2_EXTRA),$(PS2_EXTRA_INCS))
|
||||||
|
INCLUDES += -I $(PS2GDB)/ee -I $(PS2SDK)/ee/include -I $(PS2SDK)/common/include -I ./common -I . -I $(srcdir) -I $(srcdir)/engines
|
||||||
|
|
||||||
|
TARGET = elf/scummvm.elf
|
||||||
|
|
||||||
|
OBJS := backends/platform/ps2/DmaPipe.o \
|
||||||
|
backends/platform/ps2/Gs2dScreen.o \
|
||||||
|
backends/platform/ps2/irxboot.o \
|
||||||
|
backends/platform/ps2/ps2input.o \
|
||||||
|
backends/platform/ps2/ps2pad.o \
|
||||||
|
backends/platform/ps2/savefilemgr.o \
|
||||||
|
backends/platform/ps2/fileio.o \
|
||||||
|
backends/platform/ps2/asyncfio.o \
|
||||||
|
backends/platform/ps2/icon.o \
|
||||||
|
backends/platform/ps2/cd.o \
|
||||||
|
backends/platform/ps2/eecodyvdfs.o \
|
||||||
|
backends/platform/ps2/rpckbd.o \
|
||||||
|
backends/platform/ps2/systemps2.o \
|
||||||
|
backends/platform/ps2/ps2mutex.o \
|
||||||
|
backends/platform/ps2/ps2time.o \
|
||||||
|
backends/platform/ps2/ps2debug.o
|
||||||
|
|
||||||
|
MODULE_DIRS += .
|
||||||
|
|
||||||
|
include $(srcdir)/Makefile.common
|
||||||
|
|
||||||
|
LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -T $(PS2SDK)/ee/startup/linkfile
|
||||||
|
LDFLAGS += -L $(PS2GDB)/lib -L $(PS2SDK)/ee/lib -L .
|
||||||
|
LDFLAGS += $(addprefix -L$(PS2_EXTRA),$(PS2_EXTRA_LIBS))
|
||||||
|
LDFLAGS += -lmc -lpad -lmouse -lhdd -lpoweroff -lsjpcm -lmad -ltremor -lz -lm -lc -lfileXio -lps2gdbStub -lps2ip -ldebug -lkernel -lstdc++
|
||||||
|
|
||||||
|
all: $(TARGET)
|
||||||
|
|
||||||
|
$(TARGET): $(OBJS)
|
||||||
|
$(LD) $^ $(LDFLAGS) -o $@
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# $Header: Exp $
|
# $Header: Exp $
|
||||||
include $(PS2SDK)/Defs.make
|
include $(PS2SDK)/Defs.make
|
||||||
|
|
||||||
PS2_EXTRA = /media/disk-1/nw8240/extras/scummvm/ports
|
PS2_EXTRA = /media/disk/nw8240/extras/scummvm/ports
|
||||||
PS2_EXTRA_INCS = /zlib/include /libmad/ee/include /SjPcm/ee/src /tremor
|
PS2_EXTRA_INCS = /zlib/include /libmad/ee/include /SjPcm/ee/src /tremor
|
||||||
PS2_EXTRA_LIBS = /zlib/lib /libmad/ee/lib /SjPcm/ee/lib /tremor/tremor
|
PS2_EXTRA_LIBS = /zlib/lib /libmad/ee/lib /SjPcm/ee/lib /tremor/tremor
|
||||||
|
|
||||||
|
@ -45,15 +45,15 @@ LD = ee-gcc
|
||||||
AR = ee-ar cru
|
AR = ee-ar cru
|
||||||
RANLIB = ee-ranlib
|
RANLIB = ee-ranlib
|
||||||
STRIP = ee-strip
|
STRIP = ee-strip
|
||||||
MKDIR = mkdir -p
|
MKDIR = mkdir -p
|
||||||
RM = rm -f
|
RM = rm -f
|
||||||
|
|
||||||
srcdir = ../../..
|
srcdir = ../../..
|
||||||
VPATH = $(srcdir)
|
VPATH = $(srcdir)
|
||||||
INCDIR = ../../../
|
INCDIR = ../../../
|
||||||
# DEPDIR = .deps
|
# DEPDIR = .deps
|
||||||
|
|
||||||
DEFINES = -DUSE_VORBIS -DUSE_TREMOR -DUSE_MAD -DUSE_ZLIB -D_EE -D__PLAYSTATION2__ -O2 -Wall -Wno-multichar
|
DEFINES = -DUSE_VORBIS -DUSE_TREMOR -DUSE_MAD -DUSE_ZLIB -DFORCE_RTL -D_EE -D__PLAYSTATION2__ -O2 -Wall -Wno-multichar
|
||||||
|
|
||||||
|
|
||||||
INCLUDES = $(addprefix -I$(PS2_EXTRA),$(PS2_EXTRA_INCS))
|
INCLUDES = $(addprefix -I$(PS2_EXTRA),$(PS2_EXTRA_INCS))
|
||||||
|
@ -86,7 +86,7 @@ LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -T $(PS2SDK)/ee/startup/linkfil
|
||||||
LDFLAGS += -L $(PS2SDK)/ee/lib -L .
|
LDFLAGS += -L $(PS2SDK)/ee/lib -L .
|
||||||
LDFLAGS += $(addprefix -L$(PS2_EXTRA),$(PS2_EXTRA_LIBS))
|
LDFLAGS += $(addprefix -L$(PS2_EXTRA),$(PS2_EXTRA_LIBS))
|
||||||
LDFLAGS += -lmc -lpad -lmouse -lhdd -lpoweroff -lsjpcm -lmad -ltremor -lz -lm -lc -lfileXio -lkernel -lstdc++
|
LDFLAGS += -lmc -lpad -lmouse -lhdd -lpoweroff -lsjpcm -lmad -ltremor -lz -lm -lc -lfileXio -lkernel -lstdc++
|
||||||
# LDFLAGS += -s
|
LDFLAGS += -s
|
||||||
|
|
||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ Ps2File::Ps2File(void) {
|
||||||
|
|
||||||
// _cache = (uint8 *)malloc(PS2_CACHE_MAX);
|
// _cache = (uint8 *)malloc(PS2_CACHE_MAX);
|
||||||
|
|
||||||
_cacheBuf = (uint8*)memalign(64, CACHE_SIZE);
|
_cacheBuf = (uint8*)memalign(64, CACHE_SIZE * 2);
|
||||||
|
|
||||||
_cacheOpRunning = 0;
|
_cacheOpRunning = 0;
|
||||||
_filePos = _physFilePos = _cachePos = 0;
|
_filePos = _physFilePos = _cachePos = 0;
|
||||||
|
@ -80,7 +80,16 @@ Ps2File::Ps2File(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Ps2File::~Ps2File(void) {
|
Ps2File::~Ps2File(void) {
|
||||||
|
uint32 w;
|
||||||
if (_fd >= 0) {
|
if (_fd >= 0) {
|
||||||
|
|
||||||
|
if (_mode != O_RDONLY) {
|
||||||
|
fio.seek(_fd, 0, SEEK_SET);
|
||||||
|
fio.write(_fd, _cacheBuf, _filePos);
|
||||||
|
w = fio.sync(_fd);
|
||||||
|
printf("flushed wbuf: %x of %x\n", w, _filePos);
|
||||||
|
}
|
||||||
|
|
||||||
fio.close(_fd);
|
fio.close(_fd);
|
||||||
uint32 r = fio.sync(_fd);
|
uint32 r = fio.sync(_fd);
|
||||||
printf("close [%d] - sync'd = %d\n", _fd, r);
|
printf("close [%d] - sync'd = %d\n", _fd, r);
|
||||||
|
@ -95,24 +104,87 @@ Ps2File::~Ps2File(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Ps2File::open(const char *name, int mode) {
|
bool Ps2File::open(const char *name, int mode) {
|
||||||
assert(_fd < 0);
|
#if 1
|
||||||
|
_fd = fio.open(name, mode);
|
||||||
|
|
||||||
|
printf("open %s [%d]\n", name, _fd);
|
||||||
|
|
||||||
|
if (_fd >= 0) {
|
||||||
|
_mode = mode;
|
||||||
|
_filePos = 0;
|
||||||
|
|
||||||
|
if (_mode == O_RDONLY) {
|
||||||
|
_fileSize = fio.seek(_fd, 0, SEEK_END);
|
||||||
|
fio.seek(_fd, 0, SEEK_SET);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_fileSize = 0;
|
||||||
|
|
||||||
|
printf(" _mode = %x\n", _mode);
|
||||||
|
printf(" _fileSize = %d\n", _fileSize);
|
||||||
|
// printf(" _filePos = %d\n", _filePos);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
|
uint32 r;
|
||||||
|
|
||||||
|
// hack: FIO does not reports size for RW (?)
|
||||||
|
_fd = fio.open(name, O_RDONLY);
|
||||||
|
if (_fd >= 0) {
|
||||||
|
_fileSize = fio.seek(_fd, 0, SEEK_END);
|
||||||
|
fio.seek(_fd, 0, SEEK_SET); /* rewind ! */
|
||||||
|
|
||||||
|
if (_fileSize && mode != O_RDONLY) {
|
||||||
|
fio.read(_fd, _cacheBuf, _fileSize);
|
||||||
|
r = fio.sync(_fd);
|
||||||
|
printf(" sz=%d, read=%d\n", _fileSize, r);
|
||||||
|
assert(r == _fileSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
fio.close(_fd);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_fileSize = 0; /* new file */
|
||||||
|
|
||||||
_fd = fio.open(name, mode);
|
_fd = fio.open(name, mode);
|
||||||
|
|
||||||
printf("open %s [%d]\n", name, _fd);
|
printf("open %s [%d]\n", name, _fd);
|
||||||
|
|
||||||
if (_fd >= 0) {
|
if (_fd >= 0) {
|
||||||
_fileSize = fio.seek(_fd, 0, SEEK_END);
|
_mode = mode;
|
||||||
if (mode == O_RDONLY)
|
_filePos = 0;
|
||||||
// if (!(mode & O_APPEND))
|
|
||||||
fio.seek(_fd, 0, SEEK_SET);
|
|
||||||
|
|
||||||
|
if (_fileSize) { /* existing data */
|
||||||
|
if (mode == O_RDONLY) {
|
||||||
|
/* DANGER: for w* modes it will truncate your fine files */
|
||||||
|
fio.seek(_fd, 0, SEEK_SET);
|
||||||
|
}
|
||||||
|
else if (_mode & O_APPEND) {
|
||||||
|
fio.seek(_fd, 0, _fileSize);
|
||||||
|
_filePos = _fileSize;
|
||||||
|
}
|
||||||
|
#if 0 /* file already trunc'd when opened as w* -> moved up */
|
||||||
|
if (mode != O_RDONLY) {
|
||||||
|
fio.read(_fd, _cacheBuf, _fileSize);
|
||||||
|
r = fio.sync(_fd);
|
||||||
|
printf(" sz=%d, read=%d\n", _fileSize, r);
|
||||||
|
assert(r == _fileSize);
|
||||||
|
// _fileSize = fio.seek(_fd, 0, SEEK_END);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
printf(" _mode = %x\n", _mode);
|
||||||
printf(" _fileSize = %d\n", _fileSize);
|
printf(" _fileSize = %d\n", _fileSize);
|
||||||
printf(" _filePos = %d\n", _filePos);
|
printf(" _filePos = %d\n", _filePos);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else
|
} else
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 Ps2File::tell(void) {
|
int32 Ps2File::tell(void) {
|
||||||
|
@ -225,7 +297,7 @@ void Ps2File::cacheReadAhead(void) {
|
||||||
_cachePos = cachePosEnd = _filePos & ~READ_ALIGN_MASK;
|
_cachePos = cachePosEnd = _filePos & ~READ_ALIGN_MASK;
|
||||||
assert(_filePos == _physFilePos);
|
assert(_filePos == _physFilePos);
|
||||||
} else {
|
} else {
|
||||||
uint32 cacheDiff = _filePos - _cachePos;
|
uint32 cacheDiff = _filePos - _cachePos;
|
||||||
assert(_bytesInCache >= cacheDiff);
|
assert(_bytesInCache >= cacheDiff);
|
||||||
cacheDiff &= ~READ_ALIGN_MASK;
|
cacheDiff &= ~READ_ALIGN_MASK;
|
||||||
_bytesInCache -= cacheDiff;
|
_bytesInCache -= cacheDiff;
|
||||||
|
@ -344,32 +416,18 @@ uint32 Ps2File::read(void *dest, uint32 len) {
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Ps2File::write(const void *src, uint32 len) {
|
uint32 Ps2File::write(const void *src, uint32 len) {
|
||||||
uint32 w;
|
|
||||||
#ifdef __PS2_FILE_SEMA__
|
#ifdef __PS2_FILE_SEMA__
|
||||||
WaitSema(_sema);
|
WaitSema(_sema);
|
||||||
#endif
|
#endif
|
||||||
_cacheSize = 0;
|
|
||||||
|
|
||||||
w = fio.sync(_fd);
|
memcpy(&_cacheBuf[_filePos], src, len);
|
||||||
assert(w==0);
|
_filePos += len;
|
||||||
|
|
||||||
fio.seek(_fd, _filePos, SEEK_SET);
|
|
||||||
fio.write(_fd, src, len);
|
|
||||||
|
|
||||||
w = fio.sync(_fd);
|
|
||||||
|
|
||||||
#ifdef __PS2_FILE_SEMA__
|
#ifdef __PS2_FILE_SEMA__
|
||||||
SignalSema(_sema);
|
SignalSema(_sema);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (w) {
|
return len;
|
||||||
_filePos += w;
|
|
||||||
if (w < len)
|
|
||||||
_eof = true;
|
|
||||||
return w;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE *ps2_fopen(const char *fname, const char *mode) {
|
FILE *ps2_fopen(const char *fname, const char *mode) {
|
||||||
|
@ -471,7 +529,8 @@ int ps2_ferror(FILE *stream) {
|
||||||
if (err)
|
if (err)
|
||||||
printf("ferror -> %d\n", err);
|
printf("ferror -> %d\n", err);
|
||||||
|
|
||||||
return err;
|
return 0; // kyra temp
|
||||||
|
// return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ps2_clearerr(FILE *stream) {
|
void ps2_clearerr(FILE *stream) {
|
||||||
|
|
|
@ -62,12 +62,12 @@ private:
|
||||||
void cacheReadSync(void);
|
void cacheReadSync(void);
|
||||||
|
|
||||||
int _fd;
|
int _fd;
|
||||||
|
uint32 _mode;
|
||||||
uint32 _fileSize;
|
uint32 _fileSize;
|
||||||
uint32 _filePos;
|
uint32 _filePos;
|
||||||
uint32 _cacheSize;
|
uint32 _cacheSize;
|
||||||
uint32 _cachePos;
|
uint32 _cachePos;
|
||||||
|
|
||||||
// uint8 cache[2048];
|
|
||||||
uint8 *_cache;
|
uint8 *_cache;
|
||||||
|
|
||||||
int _eof;
|
int _eof;
|
||||||
|
|
|
@ -55,15 +55,16 @@ IrxFile irxFiles[] = {
|
||||||
{ "USB_MASS.IRX", USB | OPTIONAL, MASS_DRIVER, NULL, 0 },
|
{ "USB_MASS.IRX", USB | OPTIONAL, MASS_DRIVER, NULL, 0 },
|
||||||
{ "PS2MOUSE.IRX", USB | OPTIONAL, MOUSE_DRIVER, NULL, 0 },
|
{ "PS2MOUSE.IRX", USB | OPTIONAL, MOUSE_DRIVER, NULL, 0 },
|
||||||
{ "RPCKBD.IRX", USB | OPTIONAL, KBD_DRIVER, NULL, 0 },
|
{ "RPCKBD.IRX", USB | OPTIONAL, KBD_DRIVER, NULL, 0 },
|
||||||
|
#ifndef NO_ADAPTOR
|
||||||
{ "POWEROFF.IRX", HDD | OPTIONAL | NOT_HOST | DEPENDANCY, HDD_DRIVER, NULL, 0 },
|
{ "POWEROFF.IRX", HDD | OPTIONAL | NOT_HOST | DEPENDANCY, HDD_DRIVER, NULL, 0 },
|
||||||
{ "PS2DEV9.IRX", HDD | OPTIONAL | NOT_HOST | DEPENDANCY, HDD_DRIVER, NULL, 0 },
|
{ "PS2DEV9.IRX", HDD | OPTIONAL | NOT_HOST | DEPENDANCY, HDD_DRIVER, NULL, 0 },
|
||||||
{ "PS2ATAD.IRX", HDD | OPTIONAL | DEPENDANCY, HDD_DRIVER, NULL, 0 },
|
{ "PS2ATAD.IRX", HDD | OPTIONAL | DEPENDANCY, HDD_DRIVER, NULL, 0 },
|
||||||
{ "PS2HDD.IRX", HDD | OPTIONAL | DEPENDANCY, HDD_DRIVER, hddArg, sizeof(hddArg) },
|
{ "PS2HDD.IRX", HDD | OPTIONAL | DEPENDANCY, HDD_DRIVER, hddArg, sizeof(hddArg) },
|
||||||
{ "PS2FS.IRX", HDD | OPTIONAL | DEPENDANCY, HDD_DRIVER, pfsArg, sizeof(pfsArg) },
|
{ "PS2FS.IRX", HDD | OPTIONAL | DEPENDANCY, HDD_DRIVER, pfsArg, sizeof(pfsArg) },
|
||||||
{ "PS2IP.IRX", NET | NOT_HOST, NET_DRIVER, NULL, 0 },
|
{ "PS2IP.IRX", NET | OPTIONAL | NOT_HOST | DEPENDANCY, NET_DRIVER, NULL, 0 },
|
||||||
{ "PS2SMAP.IRX", NET | NOT_HOST, NET_DRIVER, netArg, sizeof(netArg) },
|
{ "PS2SMAP.IRX", NET | OPTIONAL | NOT_HOST | DEPENDANCY, NET_DRIVER, netArg, sizeof(netArg) },
|
||||||
{ "PS2HOST.IRX", NET | NOT_HOST, NET_DRIVER, NULL, 0 }
|
{ "PS2HOST.IRX", NET | OPTIONAL | NOT_HOST | DEPENDANCY, NET_DRIVER, NULL, 0 }
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int numIrxFiles = sizeof(irxFiles) / sizeof(irxFiles[0]);
|
static const int numIrxFiles = sizeof(irxFiles) / sizeof(irxFiles[0]);
|
||||||
|
|
|
@ -510,22 +510,22 @@ const Common::KeyCode Ps2Input::_usbToSdlk[0x100] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const Common::KeyCode Ps2Input::_padCodes[16] = {
|
const Common::KeyCode Ps2Input::_padCodes[16] = {
|
||||||
Common::KEYCODE_1, // Select
|
Common::KEYCODE_1, // Select
|
||||||
Common::KEYCODE_INVALID, // L3
|
Common::KEYCODE_INVALID, // L3
|
||||||
Common::KEYCODE_INVALID, // R3
|
Common::KEYCODE_INVALID, // R3
|
||||||
Common::KEYCODE_F5, // Start
|
Common::KEYCODE_F5, // Start
|
||||||
Common::KEYCODE_INVALID, // Up
|
Common::KEYCODE_INVALID, // Up
|
||||||
Common::KEYCODE_INVALID, // Right
|
Common::KEYCODE_INVALID, // Right
|
||||||
Common::KEYCODE_INVALID, // Down
|
Common::KEYCODE_INVALID, // Down
|
||||||
Common::KEYCODE_INVALID, // Left
|
Common::KEYCODE_INVALID, // Left
|
||||||
Common::KEYCODE_KP0, // L2
|
Common::KEYCODE_KP0, // L2
|
||||||
Common::KEYCODE_INVALID, // R2
|
Common::KEYCODE_PERIOD, // R2
|
||||||
Common::KEYCODE_n, // L1
|
Common::KEYCODE_n, // L1
|
||||||
Common::KEYCODE_y, // R1
|
Common::KEYCODE_y, // R1
|
||||||
Common::KEYCODE_ESCAPE, // Triangle
|
Common::KEYCODE_ESCAPE, // Triangle
|
||||||
Common::KEYCODE_INVALID, // Circle => Right mouse button
|
Common::KEYCODE_INVALID, // Circle => Right mouse button
|
||||||
Common::KEYCODE_INVALID, // Cross => Left mouse button
|
Common::KEYCODE_INVALID, // Cross => Left mouse button
|
||||||
Common::KEYCODE_RETURN // Square
|
Common::KEYCODE_RETURN // Square
|
||||||
};
|
};
|
||||||
|
|
||||||
const Common::KeyCode Ps2Input::_padFlags[16] = {
|
const Common::KeyCode Ps2Input::_padFlags[16] = {
|
||||||
|
@ -544,7 +544,7 @@ const Common::KeyCode Ps2Input::_padFlags[16] = {
|
||||||
Common::KEYCODE_INVALID, // Triangle
|
Common::KEYCODE_INVALID, // Triangle
|
||||||
Common::KEYCODE_INVALID, // Circle
|
Common::KEYCODE_INVALID, // Circle
|
||||||
Common::KEYCODE_INVALID, // Cross
|
Common::KEYCODE_INVALID, // Cross
|
||||||
Common::KEYCODE_INVALID // Square
|
Common::KEYCODE_INVALID // Square
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -239,10 +239,10 @@ Common::StringList Ps2SaveFileManager::listSavefiles(const Common::String &patte
|
||||||
if (!savePath.exists() || !savePath.isDirectory())
|
if (!savePath.exists() || !savePath.isDirectory())
|
||||||
return Common::StringList();
|
return Common::StringList();
|
||||||
|
|
||||||
printf("listSavefiles = %s\n", pattern);
|
printf("listSavefiles = %s\n", pattern.c_str());
|
||||||
|
|
||||||
if (_mc) {
|
if (_mc) {
|
||||||
strcpy(temp, pattern);
|
strcpy(temp, pattern.c_str());
|
||||||
|
|
||||||
// mcSplit(temp, game, ext);
|
// mcSplit(temp, game, ext);
|
||||||
game = strdup(strtok(temp, "."));
|
game = strdup(strtok(temp, "."));
|
||||||
|
@ -255,7 +255,7 @@ Common::StringList Ps2SaveFileManager::listSavefiles(const Common::String &patte
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_dir = Common::String(savePath.getPath());
|
_dir = Common::String(savePath.getPath());
|
||||||
search = Common::String(pattern);
|
search = pattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::FSDirectory dir(_dir);
|
Common::FSDirectory dir(_dir);
|
||||||
|
|
|
@ -66,6 +66,10 @@
|
||||||
#include "icon.h"
|
#include "icon.h"
|
||||||
#include "ps2temp.h"
|
#include "ps2temp.h"
|
||||||
|
|
||||||
|
#ifdef __PS2_DEBUG__
|
||||||
|
#include <debug.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
// asm("mfc0 %0, $9\n" : "=r"(tickStart));
|
// asm("mfc0 %0, $9\n" : "=r"(tickStart));
|
||||||
|
|
||||||
extern void *_gp;
|
extern void *_gp;
|
||||||
|
@ -95,6 +99,11 @@ PS2Device detectBootPath(const char *elfPath, char *bootPath);
|
||||||
|
|
||||||
extern AsyncFio fio;
|
extern AsyncFio fio;
|
||||||
|
|
||||||
|
#ifdef __PS2_DEBUG__
|
||||||
|
extern "C" int gdb_stub_main(int argc, char *argv[]);
|
||||||
|
extern "C" void breakpoint(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
extern "C" int scummvm_main(int argc, char *argv[]);
|
extern "C" int scummvm_main(int argc, char *argv[]);
|
||||||
|
|
||||||
extern "C" int main(int argc, char *argv[]) {
|
extern "C" int main(int argc, char *argv[]) {
|
||||||
|
@ -117,6 +126,10 @@ extern "C" int main(int argc, char *argv[]) {
|
||||||
sioprintf("Result = %d\n", res);
|
sioprintf("Result = %d\n", res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __PS2_DEBUG__
|
||||||
|
gdb_stub_main(argc, argv);
|
||||||
|
#endif
|
||||||
|
|
||||||
sioprintf("Creating system\n");
|
sioprintf("Creating system\n");
|
||||||
g_system = g_systemPs2 = new OSystem_PS2(argv[0]);
|
g_system = g_systemPs2 = new OSystem_PS2(argv[0]);
|
||||||
|
|
||||||
|
@ -241,6 +254,8 @@ OSystem_PS2::OSystem_PS2(const char *elfPath) {
|
||||||
_printY = 0;
|
_printY = 0;
|
||||||
_msgClearTime = 0;
|
_msgClearTime = 0;
|
||||||
_systemQuit = false;
|
_systemQuit = false;
|
||||||
|
_modeChanged = false;
|
||||||
|
_screenChangeCount = 0;
|
||||||
|
|
||||||
_screen = new Gs2dScreen(320, 200, TV_DONT_CARE);
|
_screen = new Gs2dScreen(320, 200, TV_DONT_CARE);
|
||||||
|
|
||||||
|
@ -327,9 +342,8 @@ OSystem_PS2::OSystem_PS2(const char *elfPath) {
|
||||||
void OSystem_PS2::init(void) {
|
void OSystem_PS2::init(void) {
|
||||||
sioprintf("Timer...\n");
|
sioprintf("Timer...\n");
|
||||||
_scummTimerManager = new DefaultTimerManager();
|
_scummTimerManager = new DefaultTimerManager();
|
||||||
_scummEventManager = new DefaultEventManager();
|
|
||||||
_scummMixer = new Audio::MixerImpl(this);
|
_scummMixer = new Audio::MixerImpl(this);
|
||||||
_scummMixer->setOutputRate(44100);
|
_scummMixer->setOutputRate(48000);
|
||||||
_scummMixer->setReady(true);
|
_scummMixer->setReady(true);
|
||||||
initTimer();
|
initTimer();
|
||||||
|
|
||||||
|
@ -520,6 +534,9 @@ void OSystem_PS2::initSize(uint width, uint height) {
|
||||||
|
|
||||||
_oldMouseX = width / 2;
|
_oldMouseX = width / 2;
|
||||||
_oldMouseY = height / 2;
|
_oldMouseY = height / 2;
|
||||||
|
|
||||||
|
_modeChanged = true;
|
||||||
|
_screenChangeCount++;
|
||||||
printf("done\n");
|
printf("done\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -574,11 +591,11 @@ void OSystem_PS2::delayMillis(uint msecs) {
|
||||||
Common::TimerManager *OSystem_PS2::getTimerManager() {
|
Common::TimerManager *OSystem_PS2::getTimerManager() {
|
||||||
return _scummTimerManager;
|
return _scummTimerManager;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
Common::EventManager *OSystem_PS2::getEventManager() {
|
Common::EventManager *OSystem_PS2::getEventManager() {
|
||||||
return _scummEventManager;
|
return getEventManager();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
Audio::Mixer *OSystem_PS2::getMixer() {
|
Audio::Mixer *OSystem_PS2::getMixer() {
|
||||||
return _scummMixer;
|
return _scummMixer;
|
||||||
}
|
}
|
||||||
|
@ -661,7 +678,7 @@ int16 OSystem_PS2::getOverlayHeight(void) {
|
||||||
return _screen->getOverlayHeight();
|
return _screen->getOverlayHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
Graphics::Surface *OSystem_PS2::lockScreen() {
|
Graphics::Surface *OSystem_PS2::lockScreen(void) {
|
||||||
return _screen->lockScreen();
|
return _screen->lockScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -669,6 +686,10 @@ void OSystem_PS2::unlockScreen(void) {
|
||||||
_screen->unlockScreen();
|
_screen->unlockScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OSystem_PS2::fillScreen(uint32 col) {
|
||||||
|
_screen->fillScreen(col);
|
||||||
|
}
|
||||||
|
|
||||||
const OSystem::GraphicsMode OSystem_PS2::_graphicsMode = { NULL, NULL, 0 };
|
const OSystem::GraphicsMode OSystem_PS2::_graphicsMode = { NULL, NULL, 0 };
|
||||||
|
|
||||||
const OSystem::GraphicsMode *OSystem_PS2::getSupportedGraphicsModes(void) const {
|
const OSystem::GraphicsMode *OSystem_PS2::getSupportedGraphicsModes(void) const {
|
||||||
|
@ -688,7 +709,16 @@ int OSystem_PS2::getDefaultGraphicsMode(void) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OSystem_PS2::pollEvent(Common::Event &event) {
|
bool OSystem_PS2::pollEvent(Common::Event &event) {
|
||||||
bool res = _input->pollEvent(&event);
|
bool res;
|
||||||
|
|
||||||
|
if (_modeChanged) {
|
||||||
|
_modeChanged = false;
|
||||||
|
event.type = Common::EVENT_SCREEN_CHANGED;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
res = _input->pollEvent(&event);
|
||||||
|
|
||||||
if (res && (event.type == Common::EVENT_MOUSEMOVE))
|
if (res && (event.type == Common::EVENT_MOUSEMOVE))
|
||||||
_screen->setMouseXy(event.mouse.x, event.mouse.y);
|
_screen->setMouseXy(event.mouse.x, event.mouse.y);
|
||||||
return res;
|
return res;
|
||||||
|
|
|
@ -27,9 +27,9 @@
|
||||||
#define SYSTEMPS2_H
|
#define SYSTEMPS2_H
|
||||||
|
|
||||||
#include "common/system.h"
|
#include "common/system.h"
|
||||||
|
#include "backends/base-backend.h"
|
||||||
|
|
||||||
class DefaultTimerManager;
|
class DefaultTimerManager;
|
||||||
class DefaultEventManager;
|
|
||||||
class DefaultSaveFileManager;
|
class DefaultSaveFileManager;
|
||||||
|
|
||||||
class Gs2dScreen;
|
class Gs2dScreen;
|
||||||
|
@ -54,7 +54,7 @@ namespace Audio {
|
||||||
class MixerImpl;
|
class MixerImpl;
|
||||||
};
|
};
|
||||||
|
|
||||||
class OSystem_PS2 : public OSystem {
|
class OSystem_PS2 : public BaseBackend {
|
||||||
public:
|
public:
|
||||||
OSystem_PS2(const char *elfPath);
|
OSystem_PS2(const char *elfPath);
|
||||||
virtual ~OSystem_PS2(void);
|
virtual ~OSystem_PS2(void);
|
||||||
|
@ -72,6 +72,7 @@ public:
|
||||||
virtual Graphics::Surface *lockScreen();
|
virtual Graphics::Surface *lockScreen();
|
||||||
virtual void unlockScreen();
|
virtual void unlockScreen();
|
||||||
virtual void updateScreen();
|
virtual void updateScreen();
|
||||||
|
virtual void fillScreen(uint32);
|
||||||
/* TODO : check */
|
/* TODO : check */
|
||||||
virtual void displayMessageOnOSD(const char *msg) { printf("displayMessageOnOSD: %s\n", msg); };
|
virtual void displayMessageOnOSD(const char *msg) { printf("displayMessageOnOSD: %s\n", msg); };
|
||||||
/* */
|
/* */
|
||||||
|
@ -92,7 +93,7 @@ public:
|
||||||
virtual uint32 getMillis();
|
virtual uint32 getMillis();
|
||||||
virtual void delayMillis(uint msecs);
|
virtual void delayMillis(uint msecs);
|
||||||
virtual Common::TimerManager *getTimerManager();
|
virtual Common::TimerManager *getTimerManager();
|
||||||
virtual Common::EventManager *getEventManager();
|
// virtual Common::EventManager *getEventManager();
|
||||||
virtual bool pollEvent(Common::Event &event);
|
virtual bool pollEvent(Common::Event &event);
|
||||||
|
|
||||||
virtual Audio::Mixer *getMixer();
|
virtual Audio::Mixer *getMixer();
|
||||||
|
@ -112,14 +113,14 @@ public:
|
||||||
virtual int getDefaultGraphicsMode() const;
|
virtual int getDefaultGraphicsMode() const;
|
||||||
virtual bool setGraphicsMode(int mode);
|
virtual bool setGraphicsMode(int mode);
|
||||||
virtual int getGraphicsMode() const;
|
virtual int getGraphicsMode() const;
|
||||||
|
virtual int getScreenChangeID() const { return _screenChangeCount; }
|
||||||
|
|
||||||
virtual void quit();
|
virtual void quit();
|
||||||
|
|
||||||
virtual Common::SeekableReadStream *createConfigReadStream();
|
virtual Common::SeekableReadStream *createConfigReadStream();
|
||||||
virtual Common::WriteStream *createConfigWriteStream();
|
virtual Common::WriteStream *createConfigWriteStream();
|
||||||
|
|
||||||
virtual Graphics::PixelFormat getOverlayFormat() const;
|
virtual Graphics::PixelFormat getOverlayFormat() const;
|
||||||
|
|
||||||
virtual Common::SaveFileManager *getSavefileManager();
|
virtual Common::SaveFileManager *getSavefileManager();
|
||||||
virtual FilesystemFactory *getFilesystemFactory();
|
virtual FilesystemFactory *getFilesystemFactory();
|
||||||
|
|
||||||
|
@ -149,7 +150,6 @@ private:
|
||||||
void readRtcTime(void);
|
void readRtcTime(void);
|
||||||
|
|
||||||
DefaultTimerManager *_scummTimerManager;
|
DefaultTimerManager *_scummTimerManager;
|
||||||
DefaultEventManager *_scummEventManager;
|
|
||||||
Audio::MixerImpl *_scummMixer;
|
Audio::MixerImpl *_scummMixer;
|
||||||
|
|
||||||
bool _mouseVisible;
|
bool _mouseVisible;
|
||||||
|
@ -163,6 +163,8 @@ private:
|
||||||
uint16 _oldMouseX, _oldMouseY;
|
uint16 _oldMouseX, _oldMouseY;
|
||||||
uint32 _msgClearTime;
|
uint32 _msgClearTime;
|
||||||
uint16 _printY;
|
uint16 _printY;
|
||||||
|
bool _modeChanged;
|
||||||
|
int _screenChangeCount;
|
||||||
|
|
||||||
int _mutexSema;
|
int _mutexSema;
|
||||||
Ps2Mutex _mutex[MAX_MUTEXES];
|
Ps2Mutex _mutex[MAX_MUTEXES];
|
||||||
|
@ -179,4 +181,3 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SYSTEMPS2_H
|
#endif // SYSTEMPS2_H
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ bool ScummEngine::saveState(Common::OutSaveFile *out, bool writeHeader) {
|
||||||
memcpy(hdr.name, _saveLoadName, sizeof(hdr.name));
|
memcpy(hdr.name, _saveLoadName, sizeof(hdr.name));
|
||||||
saveSaveGameHeader(out, hdr);
|
saveSaveGameHeader(out, hdr);
|
||||||
}
|
}
|
||||||
#if !defined(__DS__)
|
#if !defined(__DS__) /* && !defined(__PLAYSTATION2__) */
|
||||||
Graphics::saveThumbnail(*out);
|
Graphics::saveThumbnail(*out);
|
||||||
#endif
|
#endif
|
||||||
saveInfos(out);
|
saveInfos(out);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue