Whoa! Removing trailing spaces.
svn-id: r35648
This commit is contained in:
parent
05d3633eb3
commit
696897b058
385 changed files with 2639 additions and 2639 deletions
|
@ -356,7 +356,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
|
|||
if (!artificialEventQueue.empty()) {
|
||||
event = artificialEventQueue.pop();
|
||||
result = true;
|
||||
} else
|
||||
} else
|
||||
result = _boss->pollEvent(event);
|
||||
|
||||
if (_recordMode != kPassthrough) {
|
||||
|
@ -397,7 +397,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
|
|||
if (g_engine && !g_engine->isPaused()) {
|
||||
Common::Event menuEvent;
|
||||
menuEvent.type = Common::EVENT_MAINMENU;
|
||||
|
||||
|
||||
// FIXME: GSoC RTL branch passes the F6 key event to the
|
||||
// engine, and also enqueues a EVENT_MAINMENU. For now,
|
||||
// we just drop the key event and return an EVENT_MAINMENU
|
||||
|
@ -406,7 +406,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
|
|||
//
|
||||
// However, this has other consequences, possibly negative ones.
|
||||
// Like, what happens with key repeat for the trigger key?
|
||||
|
||||
|
||||
//pushEvent(menuEvent);
|
||||
event = menuEvent;
|
||||
|
||||
|
@ -519,8 +519,8 @@ void DefaultEventManager::pushEvent(Common::Event event) {
|
|||
if (event.type == Common::EVENT_QUIT) {
|
||||
if (!_shouldQuit)
|
||||
artificialEventQueue.push(event);
|
||||
} else
|
||||
artificialEventQueue.push(event);
|
||||
} else
|
||||
artificialEventQueue.push(event);
|
||||
}
|
||||
|
||||
#endif // !defined(DISABLE_DEFAULT_EVENTMANAGER)
|
||||
|
|
|
@ -249,7 +249,7 @@ GBAMPFileSystemNode::GBAMPFileSystemNode(const Common::String& path) {
|
|||
_isValid = false; // Old code returned false here, but I'm not sure why
|
||||
} else if ((strlen(pathStr) > 4) && (!strncmp(pathStr, "mp:/", 4))) {
|
||||
// Files which start with mp:/
|
||||
|
||||
|
||||
// Clear the filename to 128 bytes, because a libfat bug occationally tries to read in this area.
|
||||
memset(check, 0, 128);
|
||||
strcpy(check, pathStr + 3);
|
||||
|
@ -279,7 +279,7 @@ GBAMPFileSystemNode::GBAMPFileSystemNode(const Common::String& path) {
|
|||
_isValid = fileOrDir == FT_FILE;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// consolePrintf("Path: %s \n", check);
|
||||
|
||||
|
@ -567,7 +567,7 @@ size_t std_fread(const void* ptr, size_t size, size_t numItems, FILE* handle) {
|
|||
return numItems;
|
||||
} else {
|
||||
// consolePrintf("Read past end of file: %d read out of %d\n", bytes / size, numItems);
|
||||
if ((size_t)bytes != size * numItems) readPastEndOfFile = true;
|
||||
if ((size_t)bytes != size * numItems) readPastEndOfFile = true;
|
||||
return bytes / size;
|
||||
}
|
||||
return numItems;
|
||||
|
@ -694,7 +694,7 @@ int std_fseek(FILE* handle, long int offset, int whence) {
|
|||
int std_ferror(FILE* handle) {
|
||||
//FIXME: not implemented?
|
||||
// consolePrintf("ferror ");
|
||||
|
||||
|
||||
return readPastEndOfFile;
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ POSIXFilesystemNode::POSIXFilesystemNode(const Common::String &p) {
|
|||
} else {
|
||||
_path = p;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __OS2__
|
||||
// On OS/2, 'X:/' is a root of drive X, so we should not remove that last
|
||||
// slash.
|
||||
|
@ -95,7 +95,7 @@ POSIXFilesystemNode::POSIXFilesystemNode(const Common::String &p) {
|
|||
AbstractFSNode *POSIXFilesystemNode::getChild(const Common::String &n) const {
|
||||
assert(!_path.empty());
|
||||
assert(_isDirectory);
|
||||
|
||||
|
||||
// Make sure the string contains no slashes
|
||||
assert(!n.contains('/'));
|
||||
|
||||
|
@ -117,14 +117,14 @@ bool POSIXFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, boo
|
|||
// Special case for the root dir: List all DOS drives
|
||||
ULONG ulDrvNum;
|
||||
ULONG ulDrvMap;
|
||||
|
||||
|
||||
DosQueryCurrentDisk(&ulDrvNum, &ulDrvMap);
|
||||
|
||||
|
||||
for (int i = 0; i < 26; i++) {
|
||||
if (ulDrvMap & 1) {
|
||||
char drive_root[] = "A:/";
|
||||
drive_root[0] += i;
|
||||
|
||||
|
||||
POSIXFilesystemNode *entry = new POSIXFilesystemNode();
|
||||
entry->_isDirectory = true;
|
||||
entry->_isValid = true;
|
||||
|
@ -132,10 +132,10 @@ bool POSIXFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, boo
|
|||
entry->_displayName = "[" + Common::String(drive_root, 2) + "]";
|
||||
myList.push_back(entry);
|
||||
}
|
||||
|
||||
|
||||
ulDrvMap >>= 1;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
@ -220,7 +220,7 @@ AbstractFSNode *POSIXFilesystemNode::getParent() const {
|
|||
|
||||
const char *start = _path.c_str();
|
||||
const char *end = start + _path.size();
|
||||
|
||||
|
||||
// Strip of the last component. We make use of the fact that at this
|
||||
// point, _path is guaranteed to be normalized
|
||||
while (end > start && *(end-1) != '/')
|
||||
|
|
|
@ -43,11 +43,11 @@ protected:
|
|||
Common::String _path;
|
||||
bool _isDirectory;
|
||||
bool _isValid;
|
||||
|
||||
|
||||
virtual AbstractFSNode *makeNode(const Common::String &path) const {
|
||||
return new POSIXFilesystemNode(path);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Plain constructor, for internal use only (hence protected).
|
||||
*/
|
||||
|
|
|
@ -30,18 +30,18 @@
|
|||
|
||||
/**
|
||||
* Creates PS2FilesystemNode objects.
|
||||
*
|
||||
*
|
||||
* Parts of this class are documented in the base interface class, AbstractFilesystemFactory.
|
||||
*/
|
||||
class Ps2FilesystemFactory : public FilesystemFactory, public Common::Singleton<Ps2FilesystemFactory> {
|
||||
class Ps2FilesystemFactory : public FilesystemFactory, public Common::Singleton<Ps2FilesystemFactory> {
|
||||
public:
|
||||
virtual AbstractFSNode *makeRootFileNode() const;
|
||||
virtual AbstractFSNode *makeCurrentDirectoryFileNode() const;
|
||||
virtual AbstractFSNode *makeFileNodePath(const Common::String &path) const;
|
||||
|
||||
|
||||
protected:
|
||||
Ps2FilesystemFactory() {};
|
||||
|
||||
|
||||
private:
|
||||
friend class Common::Singleton<SingletonBaseType>;
|
||||
};
|
||||
|
|
|
@ -40,7 +40,7 @@ extern OSystem_PS2 *g_systemPs2;
|
|||
|
||||
/**
|
||||
* Implementation of the ScummVM file system API based on the Ps2SDK.
|
||||
*
|
||||
*
|
||||
* Parts of this class are documented in the base interface class, AbstractFSNode.
|
||||
*/
|
||||
class Ps2FilesystemNode : public AbstractFSNode {
|
||||
|
@ -62,15 +62,15 @@ public:
|
|||
* Creates a PS2FilesystemNode with the root node as path.
|
||||
*/
|
||||
Ps2FilesystemNode();
|
||||
|
||||
|
||||
/**
|
||||
* Creates a PS2FilesystemNode for a given path.
|
||||
*
|
||||
*
|
||||
* @param path Common::String with the path the new node should point to.
|
||||
*/
|
||||
Ps2FilesystemNode(const Common::String &path);
|
||||
Ps2FilesystemNode(const Common::String &path, bool verify);
|
||||
|
||||
|
||||
/**
|
||||
* Copy constructor.
|
||||
*/
|
||||
|
@ -165,7 +165,7 @@ Ps2FilesystemNode::Ps2FilesystemNode(const Ps2FilesystemNode *node) {
|
|||
}
|
||||
|
||||
bool Ps2FilesystemNode::exists(void) const {
|
||||
|
||||
|
||||
dbg_printf("Ps2FilesystemNode::exists: path \"%s\": ", _path.c_str());
|
||||
|
||||
if (_path[4] != ':') { // don't bother for relative path... they always fail on PS2!
|
||||
|
@ -217,10 +217,10 @@ AbstractFSNode *Ps2FilesystemNode::getChild(const Common::String &n) const {
|
|||
char listDir[256];
|
||||
sprintf(listDir, "%s/", _path.c_str());
|
||||
int fd = fio.dopen(listDir);
|
||||
|
||||
|
||||
if (fd >= 0) {
|
||||
iox_dirent_t dirent;
|
||||
|
||||
|
||||
while (fio.dread(fd, &dirent) > 0) {
|
||||
if (strcmp(n.c_str(), dirent.name) == 0) {
|
||||
Ps2FilesystemNode *dirEntry = new Ps2FilesystemNode();
|
||||
|
@ -240,13 +240,13 @@ AbstractFSNode *Ps2FilesystemNode::getChild(const Common::String &n) const {
|
|||
}
|
||||
fio.dclose(fd);
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool Ps2FilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hidden) const {
|
||||
//TODO: honor the hidden flag
|
||||
|
||||
|
||||
if (!_isDirectory)
|
||||
return false;
|
||||
|
||||
|
@ -273,14 +273,14 @@ bool Ps2FilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hi
|
|||
} else {
|
||||
char listDir[256];
|
||||
int fd;
|
||||
|
||||
|
||||
if (_path.lastChar() == '/' /* || _path.lastChar() == ':'*/)
|
||||
fd = fio.dopen(_path.c_str());
|
||||
else {
|
||||
sprintf(listDir, "%s/", _path.c_str());
|
||||
fd = fio.dopen(listDir);
|
||||
}
|
||||
|
||||
|
||||
if (fd >= 0) {
|
||||
iox_dirent_t dirent;
|
||||
Ps2FilesystemNode dirEntry;
|
||||
|
@ -338,7 +338,7 @@ char *Ps2FilesystemNode::getDeviceDescription(const char *path) const {
|
|||
else if (strncmp(path, "mass", 4) == 0)
|
||||
return "USB Mass Storage";
|
||||
else
|
||||
return "Harddisk";
|
||||
return "Harddisk";
|
||||
}
|
||||
|
||||
Common::SeekableReadStream *Ps2FilesystemNode::openForReading() {
|
||||
|
|
|
@ -140,7 +140,7 @@ AbstractFSNode *SymbianFilesystemNode::getChild(const Common::String &n) const {
|
|||
if (_path.lastChar() != '\\')
|
||||
newPath += '\\';
|
||||
|
||||
newPath += n;
|
||||
newPath += n;
|
||||
|
||||
return new SymbianFilesystemNode(newPath);
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ bool SymbianFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b
|
|||
|
||||
if (_path.lastChar() != '\\')
|
||||
fname.Append('\\');
|
||||
|
||||
|
||||
if (static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession().GetDir(fname, KEntryAttNormal|KEntryAttDir, 0, dirPtr) == KErrNone) {
|
||||
CleanupStack::PushL(dirPtr);
|
||||
TInt cnt=dirPtr->Count();
|
||||
|
@ -219,7 +219,7 @@ bool SymbianFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b
|
|||
if ((mode == Common::FSNode::kListFilesOnly && entry._isDirectory) ||
|
||||
(mode == Common::FSNode::kListDirectoriesOnly && !entry._isDirectory))
|
||||
continue;
|
||||
|
||||
|
||||
myList.push_back(new SymbianFilesystemNode(entry));
|
||||
}
|
||||
CleanupStack::PopAndDestroy(dirPtr);
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
@ -21,7 +21,7 @@
|
|||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
#include "common/scummsys.h"
|
||||
#include "backends/fs/symbian/symbianstream.h"
|
||||
|
@ -48,7 +48,7 @@ TSymbianFileEntry* CreateSymbianFileEntry(const char* name, const char* mode) {
|
|||
fileEntry->_inputPos = KErrNotFound;
|
||||
fileEntry->_lastError = 0;
|
||||
fileEntry->_eofReached = EFalse;
|
||||
|
||||
|
||||
if (fileEntry != NULL) {
|
||||
TInt modeLen = strlen(mode);
|
||||
|
||||
|
@ -102,9 +102,9 @@ size_t ReadData(const void* ptr, size_t size, size_t numItems, TSymbianFileEntry
|
|||
TSymbianFileEntry* entry = ((TSymbianFileEntry*)(handle));
|
||||
TUint32 totsize = size*numItems;
|
||||
TPtr8 pointer ( (unsigned char*) ptr, totsize);
|
||||
|
||||
|
||||
// Nothing cached and we want to load at least KInputBufferLength bytes
|
||||
if (totsize >= KInputBufferLength) {
|
||||
if (totsize >= KInputBufferLength) {
|
||||
TUint32 totLength = 0;
|
||||
if (entry->_inputPos != KErrNotFound) {
|
||||
TPtr8 cacheBuffer( (unsigned char*) entry->_inputBuffer+entry->_inputPos, entry->_inputBufferLen - entry->_inputPos, KInputBufferLength);
|
||||
|
@ -113,19 +113,19 @@ size_t ReadData(const void* ptr, size_t size, size_t numItems, TSymbianFileEntry
|
|||
totLength+=pointer.Length();
|
||||
pointer.Set(totLength+(unsigned char*) ptr, 0, totsize-totLength);
|
||||
}
|
||||
|
||||
|
||||
entry->_lastError = entry->_fileHandle.Read(pointer);
|
||||
|
||||
|
||||
totLength+=pointer.Length();
|
||||
|
||||
|
||||
pointer.Set((unsigned char*) ptr, totLength, totsize);
|
||||
|
||||
|
||||
} else {
|
||||
// Nothing in buffer
|
||||
// Nothing in buffer
|
||||
if (entry->_inputPos == KErrNotFound) {
|
||||
TPtr8 cacheBuffer( (unsigned char*) entry->_inputBuffer, KInputBufferLength);
|
||||
entry->_lastError = entry->_fileHandle.Read(cacheBuffer);
|
||||
|
||||
entry->_lastError = entry->_fileHandle.Read(cacheBuffer);
|
||||
|
||||
if (cacheBuffer.Length() >= totsize) {
|
||||
pointer.Copy(cacheBuffer.Left(totsize));
|
||||
entry->_inputPos = totsize;
|
||||
|
@ -134,19 +134,19 @@ size_t ReadData(const void* ptr, size_t size, size_t numItems, TSymbianFileEntry
|
|||
pointer.Copy(cacheBuffer);
|
||||
entry->_inputPos = KErrNotFound;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
TPtr8 cacheBuffer( (unsigned char*) entry->_inputBuffer, entry->_inputBufferLen, KInputBufferLength);
|
||||
|
||||
|
||||
if (entry->_inputPos+totsize < entry->_inputBufferLen) {
|
||||
pointer.Copy(cacheBuffer.Mid(entry->_inputPos, totsize));
|
||||
entry->_inputPos+=totsize;
|
||||
} else {
|
||||
|
||||
|
||||
pointer.Copy(cacheBuffer.Mid(entry->_inputPos, entry->_inputBufferLen-entry->_inputPos));
|
||||
cacheBuffer.SetLength(0);
|
||||
entry->_lastError = entry->_fileHandle.Read(cacheBuffer);
|
||||
|
||||
|
||||
if (cacheBuffer.Length() >= totsize-pointer.Length()) {
|
||||
TUint32 restSize = totsize-pointer.Length();
|
||||
pointer.Append(cacheBuffer.Left(restSize));
|
||||
|
@ -158,8 +158,8 @@ size_t ReadData(const void* ptr, size_t size, size_t numItems, TSymbianFileEntry
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if((numItems * size) != pointer.Length() && entry->_lastError == KErrNone) {
|
||||
entry->_eofReached = ETrue;
|
||||
}
|
||||
|
@ -234,11 +234,11 @@ bool SymbianStdioStream::seek(int32 offs, int whence) {
|
|||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
entry->_inputPos = KErrNotFound;
|
||||
entry->_eofReached = EFalse;
|
||||
entry->_fileHandle.Seek(seekMode, pos);
|
||||
|
||||
|
||||
return true; // FIXME: Probably should return a value based on what _fileHandle.Seek returns
|
||||
}
|
||||
|
||||
|
@ -256,7 +256,7 @@ uint32 SymbianStdioStream::write(const void *ptr, uint32 len) {
|
|||
if (((TSymbianFileEntry*)(_handle))->_lastError == KErrNone) {
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ bool WiiFilesystemNode::getDevopChildren(AbstractFSList &list, ListMode mode, bo
|
|||
|
||||
if (!dt || !dt->name || !dt->open_r || !dt->diropen_r)
|
||||
continue;
|
||||
|
||||
|
||||
list.push_back(new WiiFilesystemNode(Common::String(dt->name) + ":/", true));
|
||||
}
|
||||
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Raw MIDI output for the Atari ST line of computers.
|
||||
* Based on the ScummVM SEQ & CoreMIDI drivers.
|
||||
* Based on the ScummVM SEQ & CoreMIDI drivers.
|
||||
* Atari code by Keith Scroggins
|
||||
* We, unfortunately, could not use the SEQ driver because the /dev/midi under
|
||||
* FreeMiNT (and hence in libc) is considered to be a serial port for machine
|
||||
|
|
|
@ -26,4 +26,4 @@ void MathlibRelease() {
|
|||
if (!useCount)
|
||||
SysLibRemove(MathLibRef);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,4 +37,4 @@ void SonyHRRelease(UInt16 HRrefNum);
|
|||
|
||||
UInt8 SonyScreenSize(UInt16 HRrefNum, Coord *stdw, Coord *stdh, Coord *fullw, Coord *fullh);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -137,4 +137,4 @@ void RumbleRelease() {
|
|||
HwrVibrateAttributes(1, kHwrVibrateActive, &active);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,4 +31,4 @@ void RumbleRun (Boolean active);
|
|||
Boolean RumbleInit ();
|
||||
void RumbleRelease ();
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -90,7 +90,7 @@ AbstractFSNode *RoninCDFileNode::makeFileNodePath(const Common::String &path) {
|
|||
return new RoninCDFileNode(path);
|
||||
} else if ((fd = open(path.c_str(), O_DIR|O_RDONLY)) >= 0) {
|
||||
close(fd);
|
||||
return new RoninCDDirectoryNode(path);
|
||||
return new RoninCDDirectoryNode(path);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -27,25 +27,25 @@
|
|||
|
||||
namespace DS {
|
||||
|
||||
void asmDrawStripToScreen(int height, int width, byte const* text, byte const* src, byte* dst,
|
||||
void asmDrawStripToScreen(int height, int width, byte const* text, byte const* src, byte* dst,
|
||||
int vsPitch, int vmScreenWidth, int textSurfacePitch) {
|
||||
|
||||
|
||||
if (height <= 0) height = 1;
|
||||
if (width < 4) return;
|
||||
|
||||
|
||||
|
||||
|
||||
width &= ~4;
|
||||
// src = (const byte *) (((int) (src)) & (~4));
|
||||
// dst = (byte *) (((int) (dst)) & (~4));
|
||||
// text = (const byte *) (((int) (text)) & (~4));
|
||||
|
||||
|
||||
asm ( "mov r5, %0\n" // Height
|
||||
"yLoop:\n"
|
||||
"yLoop:\n"
|
||||
"mov r3, #0\n" // X pos
|
||||
|
||||
|
||||
"xLoop:\n"
|
||||
|
||||
|
||||
"ldr r4, [%2, r3]\n" // Load text layer word
|
||||
"cmp r4, %5\n"
|
||||
"bne singleByteCompare\n"
|
||||
|
@ -54,7 +54,7 @@ void asmDrawStripToScreen(int height, int width, byte const* text, byte const* s
|
|||
"add r3, r3, #4\n"
|
||||
"cmp r3, %1\n" // x == width?
|
||||
"blt xLoop\n"
|
||||
|
||||
|
||||
"add %2, %2, %8\n" // src += vs->pitch
|
||||
"add %3, %3, %6\n" // dst += _vm->_screenWidth
|
||||
"add %4, %4, %7\n" // text += _textSurface.pitch
|
||||
|
@ -62,8 +62,8 @@ void asmDrawStripToScreen(int height, int width, byte const* text, byte const* s
|
|||
"cmp r5, #0\n" // y == 0?
|
||||
"bne yLoop\n"
|
||||
"b end\n"
|
||||
|
||||
|
||||
|
||||
|
||||
"singleByteCompare:\n"
|
||||
"ldrb r4, [%2, r3]\n" // Load text byte
|
||||
"cmps r4, %5, lsr #24\n" // Compare with mask
|
||||
|
@ -78,7 +78,7 @@ void asmDrawStripToScreen(int height, int width, byte const* text, byte const* s
|
|||
"ldreqb r4, [%3, r3]\n" // Otherwise Load src byte
|
||||
"streqb r4, [%4, r3]\n" // Store it
|
||||
"add r3, r3, #1\n"
|
||||
|
||||
|
||||
"ldrb r4, [%2, r3]\n" // Load text byte
|
||||
"cmps r4, %5, lsr #24\n" // Compare with mask
|
||||
"strneb r4, [%4, r3]\n" // Store if not equal
|
||||
|
@ -91,7 +91,7 @@ void asmDrawStripToScreen(int height, int width, byte const* text, byte const* s
|
|||
"strneb r4, [%4, r3]\n" // Store if not equal
|
||||
"ldreqb r4, [%3, r3]\n" // Otherwise Load src byte
|
||||
"streqb r4, [%4, r3]\n" // Store it
|
||||
"add r3, r3, #1\n"
|
||||
"add r3, r3, #1\n"
|
||||
|
||||
"cmps r3, %1\n" // x == width?
|
||||
"blt xLoop\n" // Repeat
|
||||
|
@ -101,10 +101,10 @@ void asmDrawStripToScreen(int height, int width, byte const* text, byte const* s
|
|||
"sub r5, r5, #1\n" // y -= 1
|
||||
"cmp r5, #0\n" // y == 0?
|
||||
"bne yLoop\n"
|
||||
|
||||
|
||||
"end:\n"
|
||||
: /* no output registers */
|
||||
: "r" (height), "r" (width), "r" (text), "r" (src), "r" (dst), "r" (CHARSET_MASK_TRANSPARENCY | (CHARSET_MASK_TRANSPARENCY << 8) | (CHARSET_MASK_TRANSPARENCY << 16) | (CHARSET_MASK_TRANSPARENCY << 24)),
|
||||
: "r" (height), "r" (width), "r" (text), "r" (src), "r" (dst), "r" (CHARSET_MASK_TRANSPARENCY | (CHARSET_MASK_TRANSPARENCY << 8) | (CHARSET_MASK_TRANSPARENCY << 16) | (CHARSET_MASK_TRANSPARENCY << 24)),
|
||||
"r" (vsPitch), "r" (vmScreenWidth), "r" (textSurfacePitch)
|
||||
: "r5", "r3", "r4", "%2", "%3", "%4", "memory");
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ void asmCopy8Col(byte* dst, int dstPitch, const byte* src, int height) {
|
|||
asm("ands r0, %3, #1\n"
|
||||
"addne %3, %3, #1\n"
|
||||
"bne roll2\n"
|
||||
|
||||
|
||||
"yLoop2:\n"
|
||||
"ldr r0, [%2, #0]\n"
|
||||
"str r0, [%0, #0]\n"
|
||||
|
@ -131,7 +131,7 @@ void asmCopy8Col(byte* dst, int dstPitch, const byte* src, int height) {
|
|||
"add %0, %0, %1\n"
|
||||
"add %2, %2, %1\n"
|
||||
"subs %3, %3, #2\n"
|
||||
"bne yLoop2\n"
|
||||
"bne yLoop2\n"
|
||||
|
||||
: /* no output registers */
|
||||
: "r" (dst), "r" (dstPitch), "r" (src), "r" (height)
|
||||
|
@ -150,7 +150,7 @@ void ComputeDivBy5TableIFN()
|
|||
for (int i=0; i<160; ++i)
|
||||
{
|
||||
DIV_BY_5[i] = (2*i+5)/10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PERFECT_5_TO_4_RESCALING
|
||||
|
@ -163,13 +163,13 @@ static inline void RescaleBlock_5x1555_To_4x1555( u16 s0, u16 s1, u16 s2, u16 s3
|
|||
u32 bs3 = s3 & 0x1F;
|
||||
u32 bs4 = s4 & 0x1F;
|
||||
|
||||
#if 0
|
||||
#if 0
|
||||
u32 gs0 = (s0 >> 5) & 0x1F;
|
||||
u32 gs1 = (s1 >> 5) & 0x1F;
|
||||
u32 gs2 = (s2 >> 5) & 0x1F;
|
||||
u32 gs3 = (s3 >> 5) & 0x1F;
|
||||
u32 gs4 = (s4 >> 5) & 0x1F;
|
||||
|
||||
|
||||
u32 rs0 = (s0 >> 10) & 0x1F;
|
||||
u32 rs1 = (s1 >> 10) & 0x1F;
|
||||
u32 rs2 = (s2 >> 10) & 0x1F;
|
||||
|
@ -191,22 +191,22 @@ static inline void RescaleBlock_5x1555_To_4x1555( u16 s0, u16 s1, u16 s2, u16 s3
|
|||
asm("and %0, %2, %1, lsr #10" : "=r"(rs3) : "r"(s3), "r"(mask) : );
|
||||
asm("and %0, %2, %1, lsr #10" : "=r"(rs4) : "r"(s4), "r"(mask) : );
|
||||
#endif
|
||||
|
||||
|
||||
u32 rd0 = 4*rs0 + rs1;
|
||||
u32 rd1 = 2*rs1 + rs1 + 2*rs2;
|
||||
u32 rd2 = 2*rs2 + 2*rs3 + rs3;
|
||||
u32 rd3 = rs3 + 4*rs4;
|
||||
|
||||
|
||||
u32 gd0 = 4*gs0 + gs1;
|
||||
u32 gd1 = 2*gs1 + gs1 + 2*gs2;
|
||||
u32 gd2 = 2*gs2 + 2*gs3 + gs3;
|
||||
u32 gd3 = gs3 + 4*gs4;
|
||||
|
||||
|
||||
u32 bd0 = 4*bs0 + bs1;
|
||||
u32 bd1 = 2*bs1 + bs1 + 2*bs2;
|
||||
u32 bd2 = 2*bs2 + 2*bs3 + bs3;
|
||||
u32 bd3 = bs3 + 4*bs4;
|
||||
|
||||
|
||||
#if 0
|
||||
// Offsetting for correct rounding
|
||||
rd0 = rd0*2+5; rd1 = rd1*2+5; rd2 = rd2*2+5; rd3 = rd3*2+5;
|
||||
|
@ -217,14 +217,14 @@ static inline void RescaleBlock_5x1555_To_4x1555( u16 s0, u16 s1, u16 s2, u16 s3
|
|||
gd0 = (gd0 * 51) >> 9; gd1 = (gd1 * 51) >> 9; gd2 = (gd2 * 51) >> 9; gd3 = (gd3 * 51) >> 9;
|
||||
bd0 = (bd0 * 51) >> 9; bd1 = (bd1 * 51) >> 9; bd2 = (bd2 * 51) >> 9; bd3 = (bd3 * 51) >> 9;
|
||||
#else
|
||||
rd0 = DIV_BY_5[rd0]; rd1 = DIV_BY_5[rd1]; rd2 = DIV_BY_5[rd2]; rd3 = DIV_BY_5[rd3];
|
||||
gd0 = DIV_BY_5[gd0]; gd1 = DIV_BY_5[gd1]; gd2 = DIV_BY_5[gd2]; gd3 = DIV_BY_5[gd3];
|
||||
bd0 = DIV_BY_5[bd0]; bd1 = DIV_BY_5[bd1]; bd2 = DIV_BY_5[bd2]; bd3 = DIV_BY_5[bd3];
|
||||
rd0 = DIV_BY_5[rd0]; rd1 = DIV_BY_5[rd1]; rd2 = DIV_BY_5[rd2]; rd3 = DIV_BY_5[rd3];
|
||||
gd0 = DIV_BY_5[gd0]; gd1 = DIV_BY_5[gd1]; gd2 = DIV_BY_5[gd2]; gd3 = DIV_BY_5[gd3];
|
||||
bd0 = DIV_BY_5[bd0]; bd1 = DIV_BY_5[bd1]; bd2 = DIV_BY_5[bd2]; bd3 = DIV_BY_5[bd3];
|
||||
#endif
|
||||
|
||||
|
||||
u32 d10 = 0x80008000 | (rd1 << 26) | (gd1 << 21) | (bd1 << 16) | (rd0 << 10) | (gd0 << 5) | bd0;
|
||||
u32 d32 = 0x80008000 | (rd3 << 26) | (gd3 << 21) | (bd3 << 16) | (rd2 << 10) | (gd2 << 5) | bd2;
|
||||
|
||||
|
||||
((u32*)dest)[0] = d10;
|
||||
((u32*)dest)[1] = d32;
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ static inline void RescaleBlock_5x1555_To_4x1555( u16 s0, u16 s1, u16 s2, u16 s3
|
|||
u16* dest)
|
||||
{
|
||||
static const u32 MASK = 0x03E07C1F;
|
||||
|
||||
|
||||
u32 argbargbs0 = u32(s0) | (u32(s0) << 16);
|
||||
u32 argbargbs1 = u32(s1) | (u32(s1) << 16);
|
||||
u32 argbargbs2 = u32(s2) | (u32(s2) << 16);
|
||||
|
@ -245,32 +245,32 @@ static inline void RescaleBlock_5x1555_To_4x1555( u16 s0, u16 s1, u16 s2, u16 s3
|
|||
u32 grbs2 = argbargbs2 & MASK;
|
||||
u32 grbs3 = argbargbs3 & MASK;
|
||||
u32 grbs4 = argbargbs4 & MASK;
|
||||
|
||||
|
||||
u32 grbd0 = (3*grbs0 + grbs1) >> 2;
|
||||
u32 grbd1 = ( grbs1 + grbs2) >> 1;
|
||||
u32 grbd2 = ( grbs2 + grbs3) >> 1;
|
||||
u32 grbd3 = ( grbs3 + 3*grbs4) >> 2;
|
||||
|
||||
|
||||
grbd0 &= MASK;
|
||||
grbd1 &= MASK;
|
||||
grbd2 &= MASK;
|
||||
grbd3 &= MASK;
|
||||
|
||||
|
||||
u32 d0 = grbd0 | (grbd0 >> 16);
|
||||
u32 d1 = grbd1 | (grbd1 >> 16);
|
||||
u32 d2 = grbd2 | (grbd2 >> 16);
|
||||
u32 d3 = grbd3 | (grbd3 >> 16);
|
||||
|
||||
d0 &= 0xFFFF;
|
||||
d1 &= 0xFFFF;
|
||||
d2 &= 0xFFFF;
|
||||
d3 &= 0xFFFF;
|
||||
|
||||
d0 |= 0x8000;
|
||||
d1 |= 0x8000;
|
||||
d2 |= 0x8000;
|
||||
d3 |= 0x8000;
|
||||
|
||||
|
||||
d0 &= 0xFFFF;
|
||||
d1 &= 0xFFFF;
|
||||
d2 &= 0xFFFF;
|
||||
d3 &= 0xFFFF;
|
||||
|
||||
d0 |= 0x8000;
|
||||
d1 |= 0x8000;
|
||||
d2 |= 0x8000;
|
||||
d3 |= 0x8000;
|
||||
|
||||
dest[0] = d0;
|
||||
dest[1] = d1;
|
||||
dest[2] = d2;
|
||||
|
@ -287,13 +287,13 @@ static inline void RescaleBlock_5x8888_To_4x1555( u32 s0, u32 s1, u32 s2, u32 s3
|
|||
u32 bd0 = (d0 << 24) >> 24;
|
||||
u32 bd1 = (d1 << 24) >> 24;
|
||||
u32 gd0 = (d0 << 16) >> 24;
|
||||
u32 gd1 = (d1 << 16) >> 24;
|
||||
u32 gd1 = (d1 << 16) >> 24;
|
||||
u32 rd0 = (d0 >> 16);
|
||||
u32 rd1 = (d1 >> 16);
|
||||
|
||||
|
||||
rd0 = DIV_BY_5[rd0]; rd1 = DIV_BY_5[rd1];
|
||||
gd0 = DIV_BY_5[gd0]; gd1 = DIV_BY_5[gd1];
|
||||
bd0 = DIV_BY_5[bd0]; bd1 = DIV_BY_5[bd1];
|
||||
bd0 = DIV_BY_5[bd0]; bd1 = DIV_BY_5[bd1];
|
||||
u32 d10 = 0x80008000 | (rd1 << 26) | (gd1 << 21) | (bd1 << 16) | (rd0 << 10) | (gd0 << 5) | bd0;
|
||||
((u32*)dest)[0] = d10;
|
||||
|
||||
|
@ -307,11 +307,11 @@ static inline void RescaleBlock_5x8888_To_4x1555( u32 s0, u32 s1, u32 s2, u32 s3
|
|||
u32 rd2 = (d2 >> 16);
|
||||
u32 rd3 = (d3 >> 16);
|
||||
|
||||
rd2 = DIV_BY_5[rd2]; rd3 = DIV_BY_5[rd3];
|
||||
gd2 = DIV_BY_5[gd2]; gd3 = DIV_BY_5[gd3];
|
||||
bd2 = DIV_BY_5[bd2]; bd3 = DIV_BY_5[bd3];
|
||||
rd2 = DIV_BY_5[rd2]; rd3 = DIV_BY_5[rd3];
|
||||
gd2 = DIV_BY_5[gd2]; gd3 = DIV_BY_5[gd3];
|
||||
bd2 = DIV_BY_5[bd2]; bd3 = DIV_BY_5[bd3];
|
||||
u32 d32 = 0x80008000 | (rd3 << 26) | (gd3 << 21) | (bd3 << 16) | (rd2 << 10) | (gd2 << 5) | bd2;
|
||||
|
||||
|
||||
((u32*)dest)[1] = d32;
|
||||
}
|
||||
|
||||
|
@ -320,7 +320,7 @@ static inline void RescaleBlock_5x8888_To_4x1555( u32 s0, u32 s1, u32 s2, u32 s3
|
|||
static inline void Rescale_320xPAL8Scanline_To_256x1555Scanline(u16* dest, const u8* src, const u32* palette)
|
||||
{
|
||||
ComputeDivBy5TableIFN();
|
||||
|
||||
|
||||
for (size_t i=0; i<64; ++i)
|
||||
{
|
||||
u32 s0 = palette[src[5*i+0]];
|
||||
|
@ -353,7 +353,7 @@ static inline void Rescale_320xPAL8Scanline_To_256x1555Scanline(u16* dest, const
|
|||
static inline void Rescale_320x1555Scanline_To_256x1555Scanline(u16* dest, const u16* src)
|
||||
{
|
||||
ComputeDivBy5TableIFN();
|
||||
|
||||
|
||||
for (size_t i=0; i<64; ++i)
|
||||
{
|
||||
u16 s0 = src[5*i+0];
|
||||
|
@ -384,7 +384,7 @@ void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, int destStri
|
|||
|
||||
for (size_t i=0; i<200; ++i)
|
||||
{
|
||||
Rescale_320xPAL8Scanline_To_256x1555Scanline(dest + i*destStride, src + i *srcStride, fastRam);
|
||||
Rescale_320xPAL8Scanline_To_256x1555Scanline(dest + i*destStride, src + i *srcStride, fastRam);
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
@ -396,7 +396,7 @@ void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, int destStri
|
|||
|
||||
for (size_t i=0; i<200; ++i)
|
||||
{
|
||||
Rescale_320xPAL8Scanline_To_256x1555Scanline(dest + i*destStride, src + i *srcStride, fastRam);
|
||||
Rescale_320xPAL8Scanline_To_256x1555Scanline(dest + i*destStride, src + i *srcStride, fastRam);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "cdaudio.h"
|
||||
#include "backends/fs/ds/ds-fs.h"
|
||||
#include "common/config-manager.h"
|
||||
|
@ -53,9 +53,9 @@ struct WaveHeader {
|
|||
u16 fmtExtraData; // Number of extra fmt bytes
|
||||
u16 fmtExtra; // Samples per block (only for IMA-ADPCM files)
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
struct chunkHeader {
|
||||
char name[4];
|
||||
char name[4];
|
||||
u32 size;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
@ -112,7 +112,7 @@ void decompressBlock();
|
|||
|
||||
|
||||
void allocBuffers() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
void setActive(bool active) {
|
||||
|
@ -125,17 +125,17 @@ bool getActive() {
|
|||
|
||||
void playTrack(int track, int numLoops, int startFrame, int duration) {
|
||||
Common::String path = ConfMan.get("path");
|
||||
|
||||
|
||||
if (isPlayingFlag) {
|
||||
stopTrack();
|
||||
}
|
||||
|
||||
|
||||
if (trackStartsAt2) {
|
||||
track++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
char str[100];
|
||||
|
||||
if (path[strlen(path.c_str()) - 1] == '/') {
|
||||
|
@ -145,50 +145,50 @@ void playTrack(int track, int numLoops, int startFrame, int duration) {
|
|||
sprintf(str, "/track%d.wav", track);
|
||||
path = path + str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//1820160
|
||||
|
||||
|
||||
file = DS::std_fopen(path.c_str(), "rb");
|
||||
|
||||
|
||||
if (!file) {
|
||||
consolePrintf("Failed to open %s!\n", path.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
DS::std_fread((const void *) &waveHeader, sizeof(waveHeader), 1, file);
|
||||
|
||||
|
||||
consolePrintf("Playing track %d\n", track);
|
||||
consolePrintf("Format: %d\n", waveHeader.fmtFormatTag);
|
||||
consolePrintf("Rate : %d\n", waveHeader.fmtSamPerSec);
|
||||
consolePrintf("Bits : %d\n", waveHeader.fmtBitsPerSam);
|
||||
consolePrintf("BlkSz : %d\n", waveHeader.fmtExtra);
|
||||
|
||||
|
||||
if ((waveHeader.fmtFormatTag != 17) && (waveHeader.fmtFormatTag != 20)) {
|
||||
consolePrintf("Wave file is in the wrong format! You must use IMA-ADPCM 4-bit mono.\n");
|
||||
DS::std_fclose(file);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
for (int r = 0; r < 8; r++) {
|
||||
IPC->adpcm.buffer[r] = (u8 * volatile) (decoderFormat *) malloc(waveHeader.fmtBlockAlign);
|
||||
IPC->adpcm.filled[r] = false;
|
||||
IPC->adpcm.arm7Dirty[r] = false;
|
||||
}
|
||||
|
||||
|
||||
// Skip chunks until we reach the data chunk
|
||||
chunkHeader chunk;
|
||||
DS::std_fread((const void *) &chunk, sizeof(chunkHeader), 1, file);
|
||||
|
||||
|
||||
while (!((chunk.name[0] == 'd') && (chunk.name[1] == 'a') && (chunk.name[2] == 't') && (chunk.name[3] == 'a'))) {
|
||||
DS::std_fseek(file, chunk.size, SEEK_CUR);
|
||||
DS::std_fread((const void *) &chunk, sizeof(chunkHeader), 1, file);
|
||||
}
|
||||
|
||||
|
||||
dataChunkStart = DS::std_ftell(file);
|
||||
|
||||
|
||||
|
||||
|
||||
static bool started = false;
|
||||
sampleNum = 0;
|
||||
blockCount = 0;
|
||||
|
@ -206,35 +206,35 @@ void playTrack(int track, int numLoops, int startFrame, int duration) {
|
|||
memset(audioBuffer, 0, BUFFER_SIZE * 2);
|
||||
memset(decompressionBuffer, 0, waveHeader.fmtExtra * 2);
|
||||
DS::playSound(audioBuffer, BUFFER_SIZE * 2, false, false, waveHeader.fmtSamPerSec);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
fillPos = (IPC->streamPlayingSection + 1) & 3;
|
||||
isPlayingFlag = true;
|
||||
|
||||
|
||||
|
||||
|
||||
// Startframe is a 75Hz timer. Dunno why, since nothing else
|
||||
// seems to run at that rate.
|
||||
int tenths = (startFrame * 10) / 75;
|
||||
|
||||
|
||||
// Seek to the nearest block start to the start time
|
||||
int samples = (tenths * waveHeader.fmtSamPerSec) / 10;
|
||||
int block = samples / waveHeader.fmtExtra;
|
||||
|
||||
|
||||
|
||||
|
||||
if (duration == 0) {
|
||||
blocksLeft = 0;
|
||||
} else {
|
||||
blocksLeft = ((((duration * 100) / 75) * (waveHeader.fmtSamPerSec)) / (waveHeader.fmtExtra) / 100) + 10;
|
||||
}
|
||||
// consolePrintf("Playing %d blocks (%d)\n\n", blocksLeft, duration);
|
||||
|
||||
|
||||
// No need to seek if we're starting from the beginning
|
||||
if (block != 0) {
|
||||
DS::std_fseek(file, dataChunkStart + block * waveHeader.fmtBlockAlign, SEEK_SET);
|
||||
// consolePrintf("Startframe: %d msec: %d (%d,%d)\n", startFrame, tenthssec, samples, block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//decompressBlock();
|
||||
playNextBlock();
|
||||
DS::CD::numLoops = numLoops;
|
||||
|
@ -252,21 +252,21 @@ extern "C" void ARM_adcpm(int *block, int len, int stepTableIndex,
|
|||
void decompressBlock() {
|
||||
int block[2048];
|
||||
bool loop = false;
|
||||
|
||||
|
||||
blockCount++;
|
||||
|
||||
|
||||
if (blockCount < 10) return;
|
||||
|
||||
|
||||
|
||||
|
||||
do {
|
||||
DS::std_fread((const void *) &blockHeader, sizeof(blockHeader), 1, file);
|
||||
|
||||
|
||||
DS::std_fread(&block[0], waveHeader.fmtBlockAlign - sizeof(blockHeader), 1, file);
|
||||
|
||||
if (DS::std_feof(file) ) {
|
||||
// Reached end of file, so loop
|
||||
|
||||
|
||||
|
||||
|
||||
if ((numLoops == -1) || (numLoops > 1)) {
|
||||
// Seek file to first packet
|
||||
if (numLoops != -1) {
|
||||
|
@ -283,14 +283,14 @@ void decompressBlock() {
|
|||
stopTrack();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
loop = false;
|
||||
}
|
||||
|
||||
|
||||
} while (loop);
|
||||
|
||||
|
||||
|
||||
|
||||
if (blocksLeft > 0) {
|
||||
blocksLeft--;
|
||||
// consolePrintf("%d ", blocksLeft);
|
||||
|
@ -305,37 +305,37 @@ void decompressBlock() {
|
|||
blockHeader.stepTableIndex,
|
||||
blockHeader.firstSample,
|
||||
decompressionBuffer);
|
||||
#else
|
||||
#else
|
||||
// First sample is in header
|
||||
decompressionBuffer[0] = blockHeader.firstSample;
|
||||
|
||||
|
||||
// Set up initial table indeces
|
||||
int stepTableIndex = blockHeader.stepTableIndex;
|
||||
int prevSample = blockHeader.firstSample;
|
||||
|
||||
|
||||
// consolePrintf("Decompressing block step=%d fs=%d\n", stepTableIndex, prevSample);
|
||||
|
||||
for (int r = 0; r < waveHeader.fmtExtra - 1; r++) {
|
||||
|
||||
|
||||
int word = block[r >> 3];
|
||||
int offset = 0;
|
||||
|
||||
|
||||
switch (7 - (r & 0x0007)) {
|
||||
case 0: {
|
||||
offset = (word & 0xF0000000) >> 28;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case 1: {
|
||||
offset = (word & 0x0F000000) >> 24;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case 2: {
|
||||
offset = (word & 0x00F00000) >> 20;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case 3: {
|
||||
offset = (word & 0x000F0000) >> 16;
|
||||
break;
|
||||
|
@ -361,41 +361,41 @@ void decompressBlock() {
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int diff = 0;
|
||||
|
||||
|
||||
if (offset & 4) {
|
||||
diff = diff + stepTab[stepTableIndex];
|
||||
}
|
||||
|
||||
|
||||
if (offset & 2) {
|
||||
diff = diff + (stepTab[stepTableIndex] >> 1);
|
||||
}
|
||||
|
||||
|
||||
if (offset & 1) {
|
||||
diff = diff + (stepTab[stepTableIndex] >> 2);
|
||||
}
|
||||
|
||||
|
||||
diff = diff + (stepTab[stepTableIndex] >> 3);
|
||||
|
||||
|
||||
if (offset & 8) {
|
||||
diff = -diff;
|
||||
diff = -diff;
|
||||
}
|
||||
|
||||
|
||||
int newSample = prevSample + diff;
|
||||
|
||||
|
||||
if (newSample > 32767) newSample = 32767;
|
||||
if (newSample < -32768) newSample = -32768;
|
||||
|
||||
|
||||
decompressionBuffer[r + 1] = newSample;
|
||||
|
||||
|
||||
prevSample = newSample;
|
||||
|
||||
|
||||
stepTableIndex += indexTab[offset];
|
||||
|
||||
|
||||
if (stepTableIndex > 88) stepTableIndex = 88;
|
||||
if (stepTableIndex < 0) stepTableIndex = 0;
|
||||
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -404,21 +404,21 @@ void decompressBlock() {
|
|||
void playNextBlock() {
|
||||
if (!isPlayingFlag) return;
|
||||
int lastBlockId = -1;
|
||||
|
||||
|
||||
while (IPC->adpcm.semaphore); // Wait for buffer to become free if needed
|
||||
IPC->adpcm.semaphore = true; // Lock the buffer structure to prevent clashing with the ARM7
|
||||
// DC_FlushAll();
|
||||
|
||||
|
||||
//-8644, 25088
|
||||
for (int block = fillPos + 1; block < fillPos + 4; block++) {
|
||||
|
||||
int blockId = block & 3;
|
||||
|
||||
|
||||
if (IPC->streamFillNeeded[blockId]) {
|
||||
|
||||
|
||||
IPC->streamFillNeeded[blockId] = false;
|
||||
// DC_FlushAll();
|
||||
|
||||
|
||||
/* if (!(REG_KEYINPUT & KEY_R)) {
|
||||
//consolePrintf("Align: %d First: %d Step:%d Res:%d\n", waveHeader.fmtBlockAlign, blockHeader.firstSample, blockHeader.stepTableIndex, blockHeader.reserved);
|
||||
consolePrintf("Filling buffer %d\n", blockId);
|
||||
|
@ -432,19 +432,19 @@ void playNextBlock() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
lastBlockId = blockId;
|
||||
IPC->streamFillNeeded[blockId] = false;
|
||||
// DC_FlushAll();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (lastBlockId != -1) {
|
||||
fillPos = lastBlockId;
|
||||
/* if (!(REG_KEYINPUT & KEY_R)) {
|
||||
|
@ -459,18 +459,18 @@ void stopTrack() {
|
|||
if (!isPlayingFlag) return;
|
||||
|
||||
DS::std_fclose(file);
|
||||
|
||||
|
||||
isPlayingFlag = false;
|
||||
|
||||
|
||||
for (int r = 0; r < BUFFER_SIZE; r++) {
|
||||
audioBuffer[r] = 0;
|
||||
}
|
||||
|
||||
|
||||
for (int r= 0; r < waveHeader.fmtExtra; r++) {
|
||||
decompressionBuffer[r] = 0;
|
||||
}
|
||||
// DS::stopSound(1);
|
||||
|
||||
|
||||
// free(audioBuffer);
|
||||
// free(decompressionBuffer);
|
||||
|
||||
|
@ -507,7 +507,7 @@ bool trackExists(int num) {
|
|||
bool checkCD() {
|
||||
// Need to check whethe CD audio files are present - do this by trying to open Track1.wav.
|
||||
consolePrintf("Attempted to open cd drive\n");
|
||||
|
||||
|
||||
if (trackExists(1)) {
|
||||
trackStartsAt2 = false;
|
||||
return true;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _CDAUDIO_H_
|
||||
#define _CDAUDIO_H_
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
//
|
||||
// Changelog:
|
||||
// 0.1: First version
|
||||
// 0.2: Fixed sprite mapping bug. 1D mapping should work now.
|
||||
// 0.2: Fixed sprite mapping bug. 1D mapping should work now.
|
||||
// Changed some register defines for consistency.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
@ -87,7 +87,7 @@ void consoleClear(void);
|
|||
//
|
||||
// Changelog:
|
||||
// 0.1: First version
|
||||
// 0.2: Fixed sprite mapping bug. 1D mapping should work now.
|
||||
// 0.2: Fixed sprite mapping bug. 1D mapping should work now.
|
||||
// Changed some register defines for consistency.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _DSMAIN_H
|
||||
#define _DSMAIN_H
|
||||
|
||||
|
@ -93,7 +93,7 @@ int getMillis(); // Return the current runtime in milliseconds
|
|||
void doTimerCallback(); // Call callback function if required
|
||||
|
||||
// Sound
|
||||
void doSoundCallback();
|
||||
void doSoundCallback();
|
||||
void startSound(int freq, int buffer); // Start sound hardware
|
||||
// Call function if sound buffers need more data
|
||||
void playSound(const void* data, u32 length, bool loop, bool adpcm = false, int rate = 22050); // Start a sound
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "dsoptions.h"
|
||||
#include "dsmain.h"
|
||||
#include "gui/dialog.h"
|
||||
|
@ -98,7 +98,7 @@ DSOptionsDialog::DSOptionsDialog() : GUI::Dialog(0, 0, 320 - 10, 230 - 40) {
|
|||
_tab->setActiveTab(0);
|
||||
|
||||
_radioButtonMode = false;
|
||||
|
||||
|
||||
#ifdef DS_SCUMM_BUILD
|
||||
if (!DS::isGBAMPAvailable()) {
|
||||
// addButton(this, 100, 140, "Delete Save", 'dels', 'D');
|
||||
|
@ -112,7 +112,7 @@ DSOptionsDialog::DSOptionsDialog() : GUI::Dialog(0, 0, 320 - 10, 230 - 40) {
|
|||
// _cpuScaler = new GUI::CheckboxWidget(this, 160, 115, 90, 20, "CPU scaler", 0, 'T');
|
||||
//#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -145,13 +145,13 @@ DSOptionsDialog::DSOptionsDialog() : GUI::Dialog(0, 0, 320 - 10, 230 - 40) {
|
|||
_unscaledCheckbox->setState(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (ConfMan.hasKey("topscreenzoom", "ds")) {
|
||||
|
||||
_100PercentCheckbox->setState(false);
|
||||
_150PercentCheckbox->setState(false);
|
||||
_200PercentCheckbox->setState(false);
|
||||
|
||||
_100PercentCheckbox->setState(false);
|
||||
_150PercentCheckbox->setState(false);
|
||||
_200PercentCheckbox->setState(false);
|
||||
|
||||
switch (ConfMan.getInt("topscreenzoom", "ds"))
|
||||
{
|
||||
case 100: {
|
||||
|
@ -237,7 +237,7 @@ DSOptionsDialog::DSOptionsDialog() : GUI::Dialog(0, 0, 320 - 10, 230 - 40) {
|
|||
if (!_cpuScaler->getState() && !_unscaledCheckbox->getState()) {
|
||||
_hardScaler->setState(true);
|
||||
}
|
||||
|
||||
|
||||
_radioButtonMode = true;
|
||||
}
|
||||
|
||||
|
@ -293,17 +293,17 @@ void DSOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint
|
|||
_cpuScaler->setState(false);
|
||||
_hardScaler->setState(false);
|
||||
_unscaledCheckbox->setState(false);
|
||||
|
||||
|
||||
if ((sender == _cpuScaler) && (cmd == 0x10000002))
|
||||
{
|
||||
_cpuScaler->setState(true);
|
||||
}
|
||||
|
||||
|
||||
if ((sender == _hardScaler) && (cmd == 0x10000001))
|
||||
{
|
||||
_hardScaler->setState(true);
|
||||
}
|
||||
|
||||
|
||||
if ((sender == _unscaledCheckbox) && (cmd == 0x10000003))
|
||||
{
|
||||
_unscaledCheckbox->setState(true);
|
||||
|
@ -392,11 +392,11 @@ void togglePause() {
|
|||
OSystem_DS* system = OSystem_DS::instance();
|
||||
|
||||
event.type = Common::EVENT_KEYDOWN;
|
||||
event.kbd.keycode = Common::KEYCODE_p;
|
||||
event.kbd.keycode = Common::KEYCODE_p;
|
||||
event.kbd.ascii = 'p';
|
||||
event.kbd.flags = 0;
|
||||
system->addEvent(event);
|
||||
|
||||
|
||||
event.type = Common::EVENT_KEYUP;
|
||||
system->addEvent(event);
|
||||
}
|
||||
|
@ -407,12 +407,12 @@ void showOptionsDialog() {
|
|||
togglePause();
|
||||
|
||||
DS::displayMode16Bit();
|
||||
|
||||
|
||||
|
||||
DSOptionsDialog* d = new DSOptionsDialog();
|
||||
d->runModal();
|
||||
delete d;
|
||||
|
||||
|
||||
DS::displayMode8Bit();
|
||||
|
||||
togglePause();
|
||||
|
@ -487,7 +487,7 @@ void setOptions() {
|
|||
} else {
|
||||
DS::setCpuScalerEnable(false);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (ConfMan.hasKey("screentaps", "ds")) {
|
||||
DS::setTapScreenClicksEnable(ConfMan.getBool("screentaps", "ds"));
|
||||
|
@ -497,7 +497,7 @@ void setOptions() {
|
|||
|
||||
if (ConfMan.hasKey("touchpad", "ds")) {
|
||||
bool enable = ConfMan.getBool("touchpad", "ds");
|
||||
|
||||
|
||||
DS::setTrackPadStyleEnable(enable);
|
||||
|
||||
if ((enable) and (firstLoad)) {
|
||||
|
@ -509,7 +509,7 @@ void setOptions() {
|
|||
if (enable) {
|
||||
DS::setTapScreenClicksEnable(true);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
DS::setTrackPadStyleEnable(false);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
// Use DMA to read the card, remove this line to use normal reads/writes
|
||||
// #define _CF_USE_DMA
|
||||
|
||||
// Allow buffers not aligned to 16 bits when reading files.
|
||||
// Allow buffers not aligned to 16 bits when reading files.
|
||||
// Note that this will slow down access speed, so only use if you have to.
|
||||
// It is also incompatible with DMA
|
||||
#define _CF_ALLOW_UNALIGNED
|
||||
|
@ -43,7 +43,7 @@
|
|||
|
||||
// This allows the code to build on an earlier version of libnds, before the register was renamed
|
||||
#ifndef REG_EXMEMCNT
|
||||
#define REG_EXMEMCNT REG_EXEMEMCNT
|
||||
#define REG_EXMEMCNT REG_EXEMEMCNT
|
||||
#endif
|
||||
|
||||
#ifndef REG_EXEMEMCNT
|
||||
|
@ -70,7 +70,7 @@
|
|||
#endif
|
||||
|
||||
// Disable NDS specific hardware and features if running on a GBA
|
||||
#ifndef NDS
|
||||
#ifndef NDS
|
||||
#undef SUPPORT_NMMC
|
||||
#undef DISC_CACHE
|
||||
#endif
|
||||
|
|
|
@ -147,7 +147,7 @@ bool FAT_GetAlias (char* alias);
|
|||
|
||||
/*-----------------------------------------------------------------
|
||||
FAT_GetLongFilename
|
||||
Get the long name of the last file or directory retrived with
|
||||
Get the long name of the last file or directory retrived with
|
||||
GetDirEntry. Also works for FindFirstFile and FindNextFile
|
||||
char* filename: OUT will be filled with the filename, should be at
|
||||
least 256 bytes long
|
||||
|
@ -210,7 +210,7 @@ FAT_FindNextFile
|
|||
Gets the name of the next directory entry
|
||||
(can be a file or subdirectory)
|
||||
char* filename: OUT filename, must be at least 13 chars long
|
||||
FILE_TYPE return: OUT returns FT_NONE if failed,
|
||||
FILE_TYPE return: OUT returns FT_NONE if failed,
|
||||
FT_FILE if it found a file and FT_DIR if it found a directory
|
||||
-----------------------------------------------------------------*/
|
||||
FILE_TYPE FAT_FindNextFile (char* filename);
|
||||
|
@ -220,7 +220,7 @@ FAT_FindFirstFile
|
|||
Gets the name of the first directory entry and resets the count
|
||||
(can be a file or subdirectory)
|
||||
char* filename: OUT filename, must be at least 13 chars long
|
||||
FILE_TYPE return: OUT returns FT_NONE if failed,
|
||||
FILE_TYPE return: OUT returns FT_NONE if failed,
|
||||
FT_FILE if it found a file and FT_DIR if it found a directory
|
||||
-----------------------------------------------------------------*/
|
||||
FILE_TYPE FAT_FindFirstFile (char* filename);
|
||||
|
@ -230,7 +230,7 @@ FAT_FindFirstFileLFN
|
|||
Gets the long file name of the first directory entry and resets
|
||||
the count (can be a file or subdirectory)
|
||||
char* lfn: OUT long file name, must be at least 256 chars long
|
||||
FILE_TYPE return: OUT returns FT_NONE if failed,
|
||||
FILE_TYPE return: OUT returns FT_NONE if failed,
|
||||
FT_FILE if it found a file and FT_DIR if it found a directory
|
||||
-----------------------------------------------------------------*/
|
||||
FILE_TYPE FAT_FindFirstFileLFN(char* lfn);
|
||||
|
@ -240,16 +240,16 @@ FAT_FindNextFileLFN
|
|||
Gets the long file name of the next directory entry
|
||||
(can be a file or subdirectory)
|
||||
char* lfn: OUT long file name, must be at least 256 chars long
|
||||
FILE_TYPE return: OUT returns FT_NONE if failed,
|
||||
FILE_TYPE return: OUT returns FT_NONE if failed,
|
||||
FT_FILE if it found a file and FT_DIR if it found a directory
|
||||
-----------------------------------------------------------------*/
|
||||
FILE_TYPE FAT_FindNextFileLFN(char* lfn);
|
||||
|
||||
/*-----------------------------------------------------------------
|
||||
FAT_FileExists
|
||||
Returns the type of file
|
||||
Returns the type of file
|
||||
char* filename: IN filename of the file to look for
|
||||
FILE_TYPE return: OUT returns FT_NONE if there is now file with
|
||||
FILE_TYPE return: OUT returns FT_NONE if there is now file with
|
||||
that name, FT_FILE if it is a file and FT_DIR if it is a directory
|
||||
-----------------------------------------------------------------*/
|
||||
FILE_TYPE FAT_FileExists (const char* filename);
|
||||
|
@ -269,7 +269,7 @@ u32 FAT_GetFileSystemTotalSize (void);
|
|||
/*-----------------------------------------------------------------
|
||||
FAT_chdir
|
||||
Changes the current working directory
|
||||
const char* path: IN null terminated string of directory separated by
|
||||
const char* path: IN null terminated string of directory separated by
|
||||
forward slashes, / is root
|
||||
bool return: OUT returns true if successful
|
||||
-----------------------------------------------------------------*/
|
||||
|
@ -282,12 +282,12 @@ bool FAT_chdir (const char* path);
|
|||
/*-----------------------------------------------------------------
|
||||
FAT_fopen(filename, mode)
|
||||
Opens a file
|
||||
const char* path: IN null terminated string of filename and path
|
||||
const char* path: IN null terminated string of filename and path
|
||||
separated by forward slashes, / is root
|
||||
const char* mode: IN mode to open file in
|
||||
Supported modes: "r", "r+", "w", "w+", "a", "a+", don't use
|
||||
"b" or "t" in any mode, as all files are openned in binary mode
|
||||
FAT_FILE* return: OUT handle to open file, returns -1 if the file
|
||||
FAT_FILE* return: OUT handle to open file, returns -1 if the file
|
||||
couldn't be openned
|
||||
-----------------------------------------------------------------*/
|
||||
FAT_FILE* FAT_fopen(const char* path, const char* mode);
|
||||
|
@ -338,7 +338,7 @@ u32 FAT_fread (void* buffer, u32 size, u32 count, FAT_FILE* file);
|
|||
FAT_fwrite(buffer, size, count, file)
|
||||
Writes size * count bytes into file from buffer, starting
|
||||
from current position. It then sets the current position to the
|
||||
byte after the last byte written. If the file was openned in
|
||||
byte after the last byte written. If the file was openned in
|
||||
append mode it always writes to the end of the file.
|
||||
const void* buffer IN: Pointer to buffer containing data. Should be
|
||||
at least as big as the number of bytes to be written.
|
||||
|
@ -371,7 +371,7 @@ int FAT_remove (const char* path);
|
|||
#ifdef CAN_WRITE_TO_DISC
|
||||
/*-----------------------------------------------------------------
|
||||
FAT_mkdir (path)
|
||||
Makes a new directory, so long as no other directory or file has
|
||||
Makes a new directory, so long as no other directory or file has
|
||||
the same name.
|
||||
const char* path IN: Path and filename of directory to make
|
||||
int return OUT: zero if successful, non-zero if not
|
||||
|
@ -403,9 +403,9 @@ FAT_fgets (char *tgtBuffer, int num, FAT_FILE* file)
|
|||
Gets a up to num bytes from file, stopping at the first
|
||||
newline.
|
||||
|
||||
CAUTION: does not do strictly streaming. I.e. it's
|
||||
CAUTION: does not do strictly streaming. I.e. it's
|
||||
reading more then needed bytes and seeking back.
|
||||
shouldn't matter for random access
|
||||
shouldn't matter for random access
|
||||
|
||||
char *tgtBuffer OUT: buffer to write to
|
||||
int num IN: size of target buffer
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
io_dldi.h
|
||||
io_dldi.h
|
||||
|
||||
Reserved space for new drivers
|
||||
|
||||
|
||||
This software is completely free. No warranty is provided.
|
||||
If you use it, please give me credit and email me about your
|
||||
project at chishm@hotmail.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
io_fcsr.h
|
||||
io_fcsr.h
|
||||
|
||||
Hardware Routines for using a GBA Flash Cart with SRAM
|
||||
|
||||
|
@ -23,7 +23,7 @@ extern LPIO_INTERFACE FCSR_GetInterface(void) ;
|
|||
|
||||
#endif // define IO_FCSR_H
|
||||
/*
|
||||
io_fcsr.h
|
||||
io_fcsr.h
|
||||
|
||||
Hardware Routines for using a GBA Flash Cart with SRAM
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
io_m3_common.h
|
||||
io_m3_common.h
|
||||
|
||||
Routines common to all version of the M3
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
|||
Some code written by SaTa may have been unknowingly used.
|
||||
|
||||
Copyright (c) 2006 Michael "Chishm" Chisholm
|
||||
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
|||
|
||||
// Values for changing mode
|
||||
#define M3_MODE_ROM 0x00400004
|
||||
#define M3_MODE_MEDIA 0x00400003
|
||||
#define M3_MODE_MEDIA 0x00400003
|
||||
|
||||
extern void _M3_changeMode (u32 mode);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
io_m3cf.h
|
||||
io_m3cf.h
|
||||
|
||||
Hardware Routines for reading a compact flash card
|
||||
using the M3 CF
|
||||
|
@ -24,7 +24,7 @@ extern LPIO_INTERFACE M3CF_GetInterface(void) ;
|
|||
|
||||
#endif // define IO_M3CF_H
|
||||
/*
|
||||
io_m3cf.h
|
||||
io_m3cf.h
|
||||
|
||||
Hardware Routines for reading a compact flash card
|
||||
using the M3 CF
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
io_mmcf.h
|
||||
io_mmcf.h
|
||||
|
||||
Hardware Routines for reading a compact flash card
|
||||
using the GBA Movie Player
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
io_mpcf.h
|
||||
io_mpcf.h
|
||||
|
||||
Hardware Routines for reading a compact flash card
|
||||
using the GBA Movie Player
|
||||
|
@ -24,7 +24,7 @@ extern LPIO_INTERFACE MPCF_GetInterface(void) ;
|
|||
|
||||
#endif // define IO_MPCF_H
|
||||
/*
|
||||
io_mpcf.h
|
||||
io_mpcf.h
|
||||
|
||||
Hardware Routines for reading a compact flash card
|
||||
using the GBA Movie Player
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/*
|
||||
io_njsd.h
|
||||
io_njsd.h
|
||||
|
||||
Hardware Routines for reading an SD card using
|
||||
a NinjaDS SD adapter.
|
||||
|
||||
Copyright (c) 2006 Michael "Chishm" Chisholm
|
||||
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
io_NMMC.h
|
||||
io_NMMC.h
|
||||
|
||||
Hardware Routines for reading an SD or MMC card using
|
||||
a Neoflash MK2 or MK3.
|
||||
|
@ -26,7 +26,7 @@ extern LPIO_INTERFACE NMMC_GetInterface(void) ;
|
|||
|
||||
#endif // define IO_NMMC_H
|
||||
/*
|
||||
io_NMMC.h
|
||||
io_NMMC.h
|
||||
|
||||
Hardware Routines for reading an SD or MMC card using
|
||||
a Neoflash MK2 or MK3.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
io_sccf.h
|
||||
io_sccf.h
|
||||
|
||||
Hardware Routines for reading a compact flash card
|
||||
using the Supercard CF
|
||||
|
@ -24,7 +24,7 @@ extern LPIO_INTERFACE SCCF_GetInterface(void) ;
|
|||
|
||||
#endif // define IO_SCCF_H
|
||||
/*
|
||||
io_sccf.h
|
||||
io_sccf.h
|
||||
|
||||
Hardware Routines for reading a compact flash card
|
||||
using the Supercard CF
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/*
|
||||
io_scsd.h by SaTa.
|
||||
based on io_sccf.h
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
io_sccf.h
|
||||
io_sccf.h
|
||||
|
||||
Hardware Routines for reading a compact flash card
|
||||
using the GBA Movie Player
|
||||
|
@ -26,4 +26,4 @@
|
|||
// export interface
|
||||
extern LPIO_INTERFACE SCSD_GetInterface(void) ;
|
||||
|
||||
#endif // define IO_SCSD_H
|
||||
#endif // define IO_SCSD_H
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
SD routines partially based on sd.s by Romman
|
||||
|
||||
Copyright (c) 2006 Michael "Chishm" Chisholm
|
||||
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
|||
|
||||
2006-07-11 - Chishm
|
||||
* Original release
|
||||
|
||||
|
||||
2006-07-28 - Chishm
|
||||
* Changed voltage range that the SD card can use
|
||||
*/
|
||||
|
@ -76,7 +76,7 @@
|
|||
#define SD_STATE_IDENT 2 // Identification state, after ALL_SEND_CID
|
||||
#define SD_STATE_STBY 3 // Standby state, when card is deselected
|
||||
#define SD_STATE_TRAN 4 // Transfer state, after card is selected and ready for data transfer
|
||||
#define SD_STATE_DATA 5 //
|
||||
#define SD_STATE_DATA 5 //
|
||||
#define SD_STATE_RCV 6 // Receive data state
|
||||
#define SD_STATE_PRG 7 // Programming state
|
||||
#define SD_STATE_DIS 8 // Disconnect state
|
||||
|
@ -85,7 +85,7 @@
|
|||
#define READY_FOR_DATA 1 // bit 8 in card status
|
||||
|
||||
/*
|
||||
Calculate the CRC7 of a command and return it preshifted with
|
||||
Calculate the CRC7 of a command and return it preshifted with
|
||||
an end bit added
|
||||
*/
|
||||
extern u8 _SD_CRC7(u8* data, int size);
|
||||
|
@ -106,7 +106,7 @@ cmd_17byte_response: a pointer to a function that sends the SD card a command an
|
|||
use4bitBus: initialise card to use a 4 bit data bus when communicating with the card
|
||||
RCA: a pointer to the location to store the card's Relative Card Address, preshifted up by 16 bits.
|
||||
*/
|
||||
extern bool _SD_InitCard (_SD_FN_CMD_6BYTE_RESPONSE cmd_6byte_response,
|
||||
extern bool _SD_InitCard (_SD_FN_CMD_6BYTE_RESPONSE cmd_6byte_response,
|
||||
_SD_FN_CMD_17BYTE_RESPONSE cmd_17byte_response,
|
||||
bool use4bitBus,
|
||||
u32 *RCA);
|
||||
|
|
|
@ -93,40 +93,40 @@ uint32 GBAMPSaveFile::write(const void *buf, uint32 size) {
|
|||
|
||||
memcpy(buffer + bufferPos, buf, size);
|
||||
bufferPos += size;
|
||||
|
||||
|
||||
saveSize += size;
|
||||
|
||||
|
||||
/* int pos = 0;
|
||||
|
||||
|
||||
int rest = SAVE_BUFFER_SIZE - bufferPos;
|
||||
memcpy(buffer + bufferPos, buf, rest);
|
||||
bufferPos = 512;
|
||||
pos += rest;
|
||||
flushSaveBuffer();
|
||||
flushSaveBuffer();
|
||||
size -= rest;
|
||||
// consolePrintf("First section: %d\n", rest);
|
||||
|
||||
|
||||
while (size >= 512) {
|
||||
DS::std_fwrite(((char *) (buf)) + pos, 1, 512, handle);
|
||||
size -= 512;
|
||||
pos += 512;
|
||||
// consolePrintf("Full chunk, %d left ", size);
|
||||
}
|
||||
|
||||
|
||||
bufferPos = 0;
|
||||
memcpy(buffer + bufferPos, ((char *) (buf)) + pos, size);
|
||||
bufferPos += size;
|
||||
// consolePrintf("%d left in buffer ", bufferPos);*/
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
memcpy(buffer + bufferPos, buf, size);
|
||||
bufferPos += size;
|
||||
|
||||
|
||||
saveSize += size;
|
||||
}
|
||||
|
||||
|
||||
// if ((size > 100) || (size <= 0)) consolePrintf("Write %d bytes\n", size);
|
||||
return size;
|
||||
}
|
||||
|
@ -146,24 +146,24 @@ GBAMPSaveFileManager::~GBAMPSaveFileManager() {
|
|||
|
||||
GBAMPSaveFile* GBAMPSaveFileManager::openSavefile(char const* name, bool saveOrLoad) {
|
||||
char fileSpec[128];
|
||||
|
||||
|
||||
strcpy(fileSpec, getSavePath());
|
||||
|
||||
|
||||
if (fileSpec[strlen(fileSpec) - 1] == '/') {
|
||||
sprintf(fileSpec, "%s%s", getSavePath(), name);
|
||||
} else {
|
||||
sprintf(fileSpec, "%s/%s", getSavePath(), name);
|
||||
}
|
||||
|
||||
|
||||
// consolePrintf("Opening the file: %s\n", fileSpec);
|
||||
GBAMPSaveFile* sf = new GBAMPSaveFile(fileSpec, saveOrLoad);
|
||||
if (sf->isOpen()) {
|
||||
// consolePrintf("Ok");
|
||||
return sf;
|
||||
return sf;
|
||||
} else {
|
||||
// consolePrintf("Fail");
|
||||
delete sf;
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -189,11 +189,11 @@ const char *GBAMPSaveFileManager::getSavePath() const {
|
|||
return dir;
|
||||
}
|
||||
|
||||
Common::StringList GBAMPSaveFileManager::listSavefiles(const char *pattern) {
|
||||
Common::StringList GBAMPSaveFileManager::listSavefiles(const char *pattern) {
|
||||
|
||||
enum { TYPE_NO_MORE = 0, TYPE_FILE = 1, TYPE_DIR = 2 };
|
||||
char name[256];
|
||||
|
||||
|
||||
{
|
||||
char dir[128];
|
||||
strcpy(dir, getSavePath());
|
||||
|
@ -218,13 +218,13 @@ Common::StringList GBAMPSaveFileManager::listSavefiles(const char *pattern) {
|
|||
|
||||
// consolePrintf("Save path: '%s', pattern: '%s'\n", getSavePath(), pattern);
|
||||
|
||||
|
||||
|
||||
int fileType = FAT_FindFirstFileLFN(name);
|
||||
|
||||
Common::StringList list;
|
||||
|
||||
do {
|
||||
|
||||
|
||||
if (fileType == TYPE_FILE) {
|
||||
|
||||
FAT_GetLongFilename(name);
|
||||
|
@ -232,18 +232,18 @@ Common::StringList GBAMPSaveFileManager::listSavefiles(const char *pattern) {
|
|||
for (int r = 0; name[r] != 0; r++) {
|
||||
name[r] = tolower(name[r]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (Common::matchString(name, pattern)) {
|
||||
list.push_back(name);
|
||||
}
|
||||
}
|
||||
|
||||
} while ((fileType = FAT_FindNextFileLFN(name)));
|
||||
|
||||
|
||||
FAT_chdir("/");
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _GBAMPSAVE_H_
|
||||
#define _GBAMPSAVE_H_
|
||||
|
||||
|
@ -38,19 +38,19 @@ class GBAMPSaveFile : public Common::InSaveFile, public Common::OutSaveFile {
|
|||
public:
|
||||
GBAMPSaveFile(char* name, bool saveOrLoad);
|
||||
virtual ~GBAMPSaveFile();
|
||||
|
||||
|
||||
virtual uint32 read(void *buf, uint32 size);
|
||||
virtual uint32 write(const void *buf, uint32 size);
|
||||
|
||||
|
||||
virtual bool eos() const;
|
||||
virtual bool skip(uint32 bytes);
|
||||
|
||||
virtual int32 pos() const;
|
||||
virtual int32 size() const;
|
||||
virtual bool seek(int32 pos, int whence);
|
||||
|
||||
|
||||
void flushSaveBuffer();
|
||||
|
||||
|
||||
virtual bool isOpen() const {
|
||||
return handle != 0;
|
||||
}
|
||||
|
@ -61,17 +61,17 @@ class GBAMPSaveFileManager : public Common::SaveFileManager {
|
|||
public:
|
||||
GBAMPSaveFileManager();
|
||||
~GBAMPSaveFileManager();
|
||||
|
||||
|
||||
// static GBAMPSaveFileManager* instance() { return instancePtr; }
|
||||
|
||||
GBAMPSaveFile *openSavefile(const char *filename, bool saveOrLoad);
|
||||
|
||||
|
||||
virtual Common::OutSaveFile* openForSaving(const char* filename) { return openSavefile(filename, true); }
|
||||
virtual Common::InSaveFile* openForLoading(const char* filename) { return openSavefile(filename, false); }
|
||||
|
||||
|
||||
virtual bool removeSavefile(const char *filename) { return false; } // TODO: Implement this
|
||||
virtual Common::StringList listSavefiles(const char *pattern);
|
||||
|
||||
|
||||
void deleteFile(char* name);
|
||||
void listFiles();
|
||||
|
||||
|
|
|
@ -27,26 +27,26 @@
|
|||
$Log: keys.c,v $
|
||||
Revision 1.13 2006/01/12 09:10:47 wntrmute
|
||||
Added key repeat as suggested by pepsiman
|
||||
|
||||
|
||||
Revision 1.12 2005/11/27 12:30:25 wntrmute
|
||||
reverted to correct hardware REGisters
|
||||
|
||||
|
||||
Revision 1.11 2005/11/27 07:48:45 joatski
|
||||
Renamed REG_KEYINPUT and REG_KEYCNT back to KEYS and KEYS_CR, as the alternatives are defined in registers_alt.h.
|
||||
Changed function returns to uint32
|
||||
|
||||
|
||||
Revision 1.10 2005/11/03 23:38:49 wntrmute
|
||||
don't use enum for key function returns
|
||||
|
||||
|
||||
Revision 1.9 2005/10/13 16:30:11 dovoto
|
||||
Changed KEYPAD_BITS to a typedef enum, this resolved some issues with multiple redefinition of KEYPAD_BITS (although this error did not allways occur).
|
||||
|
||||
|
||||
Revision 1.8 2005/10/03 21:21:59 wntrmute
|
||||
use enum types
|
||||
|
||||
|
||||
Revision 1.7 2005/09/07 18:06:27 wntrmute
|
||||
use new register names
|
||||
|
||||
|
||||
Revision 1.6 2005/08/23 17:06:10 wntrmute
|
||||
converted all endings to unix
|
||||
|
||||
|
@ -148,4 +148,4 @@ uint32 keysUp(void) {
|
|||
}
|
||||
|
||||
|
||||
} // namespace ds
|
||||
} // namespace ds
|
||||
|
|
|
@ -63,7 +63,7 @@ int OSystem_DS::timerHandler(int t) {
|
|||
tm->handler();
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
void OSystem_DS::initBackend() {
|
||||
ConfMan.setInt("autosave_period", 0);
|
||||
ConfMan.setBool("FM_medium_quality", true);
|
||||
|
@ -80,7 +80,7 @@ void OSystem_DS::initBackend() {
|
|||
|
||||
_mixer->setOutputRate(DS::getSoundFrequency());
|
||||
_mixer->setReady(true);
|
||||
|
||||
|
||||
OSystem::initBackend();
|
||||
}
|
||||
|
||||
|
@ -149,13 +149,13 @@ void OSystem_DS::setPalette(const byte *colors, uint start, uint num) {
|
|||
int red = *colors;
|
||||
int green = *(colors + 1);
|
||||
int blue = *(colors + 2);
|
||||
|
||||
|
||||
red >>= 3;
|
||||
green >>= 3;
|
||||
blue >>= 3;
|
||||
|
||||
|
||||
// if (r != 255)
|
||||
{
|
||||
{
|
||||
u16 paletteValue = red | (green << 5) | (blue << 10);
|
||||
|
||||
if (DS::getIsDisplayMode8Bit()) {
|
||||
|
@ -168,7 +168,7 @@ void OSystem_DS::setPalette(const byte *colors, uint start, uint num) {
|
|||
_palette[r] = paletteValue;
|
||||
}
|
||||
// if (num == 255) consolePrintf("pal:%d r:%d g:%d b:%d\n", r, red, green, blue);
|
||||
|
||||
|
||||
colors += 4;
|
||||
}
|
||||
}
|
||||
|
@ -180,14 +180,14 @@ void OSystem_DS::setCursorPalette(const byte *colors, uint start, uint num) {
|
|||
int red = *colors;
|
||||
int green = *(colors + 1);
|
||||
int blue = *(colors + 2);
|
||||
|
||||
|
||||
red >>= 3;
|
||||
green >>= 3;
|
||||
blue >>= 3;
|
||||
|
||||
|
||||
u16 paletteValue = red | (green << 5) | (blue << 10);
|
||||
_cursorPalette[r] = paletteValue;
|
||||
|
||||
|
||||
colors += 4;
|
||||
}
|
||||
|
||||
|
@ -198,7 +198,7 @@ bool OSystem_DS::grabRawScreen(Graphics::Surface* surf) {
|
|||
surf->create(DS::getGameWidth(), DS::getGameHeight(), 1);
|
||||
|
||||
// Ensure we copy using 16 bit quantities due to limitation of VRAM addressing
|
||||
|
||||
|
||||
|
||||
const u16* image = (const u16 *) DS::get8BitBackBuffer();
|
||||
for (int y = 0; y < DS::getGameHeight(); y++)
|
||||
|
@ -215,7 +215,7 @@ bool OSystem_DS::grabRawScreen(Graphics::Surface* surf) {
|
|||
|
||||
void OSystem_DS::grabPalette(unsigned char *colors, uint start, uint num) {
|
||||
// consolePrintf("Grabpalette");
|
||||
|
||||
|
||||
for (unsigned int r = start; r < start + num; r++) {
|
||||
*colors++ = (BG_PALETTE[r] & 0x001F) << 3;
|
||||
*colors++ = (BG_PALETTE[r] & 0x03E0) >> 5 << 3;
|
||||
|
@ -228,11 +228,11 @@ void OSystem_DS::grabPalette(unsigned char *colors, uint start, uint num) {
|
|||
|
||||
void OSystem_DS::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {
|
||||
//consolePrintf("Copy rect %d, %d %d, %d ", x, y, w, h);
|
||||
if (!_graphicsEnable) return;
|
||||
if (!_graphicsEnable) return;
|
||||
if (w <= 1) return;
|
||||
if (h < 0) return;
|
||||
if (!DS::getIsDisplayMode8Bit()) return;
|
||||
|
||||
|
||||
u16* bg;
|
||||
s32 stride;
|
||||
u16* bgSub = (u16 *) BG_GFX_SUB;
|
||||
|
@ -258,7 +258,7 @@ void OSystem_DS::copyRectToScreen(const byte *buf, int pitch, int x, int y, int
|
|||
u8* dest = ((u8 *) (bg)) + (dy * stride) + x;
|
||||
u8* destSub = ((u8 *) (bgSub)) + (dy * 512) + x;
|
||||
u8* src = (u8 *) buf + (pitch * by);
|
||||
|
||||
|
||||
u32 dx;
|
||||
|
||||
u32 pixelsLeft = w;
|
||||
|
@ -306,7 +306,7 @@ void OSystem_DS::copyRectToScreen(const byte *buf, int pitch, int x, int y, int
|
|||
}
|
||||
|
||||
by++;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// consolePrintf("Slow method used!\n");
|
||||
|
@ -315,40 +315,40 @@ void OSystem_DS::copyRectToScreen(const byte *buf, int pitch, int x, int y, int
|
|||
} else {
|
||||
|
||||
// Stuff is aligned to 16-bit boundaries, so it's safe to do DMA.
|
||||
|
||||
|
||||
u16* src = (u16 *) buf;
|
||||
|
||||
|
||||
if (DS::getKeyboardEnable()) {
|
||||
|
||||
|
||||
for (int dy = y; dy < y + h; dy++) {
|
||||
u16* dest = bg + (dy * (stride >> 1)) + (x >> 1);
|
||||
|
||||
|
||||
DC_FlushRange(src, w << 1);
|
||||
DC_FlushRange(dest, w << 1);
|
||||
dmaCopyHalfWords(3, src, dest, w);
|
||||
|
||||
|
||||
while (dmaBusy(3));
|
||||
|
||||
|
||||
src += pitch >> 1;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
for (int dy = y; dy < y + h; dy++) {
|
||||
u16* dest1 = bg + (dy * (stride >> 1)) + (x >> 1);
|
||||
u16* dest2 = bgSub + (dy << 8) + (x >> 1);
|
||||
|
||||
|
||||
DC_FlushRange(src, w << 1);
|
||||
DC_FlushRange(dest1, w << 1);
|
||||
DC_FlushRange(dest2, w << 1);
|
||||
|
||||
|
||||
dmaCopyHalfWords(3, src, dest1, w);
|
||||
|
||||
|
||||
if ((!_frameBufferExists) || (buf == _framebuffer.pixels)) {
|
||||
dmaCopyHalfWords(2, src, dest2, w);
|
||||
}
|
||||
|
||||
|
||||
while (dmaBusy(2) || dmaBusy(3));
|
||||
|
||||
|
||||
src += pitch >> 1;
|
||||
}
|
||||
}
|
||||
|
@ -402,36 +402,36 @@ void OSystem_DS::grabOverlay (OverlayColor *buf, int pitch) {
|
|||
void OSystem_DS::copyRectToOverlay (const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
|
||||
u16* bg = (u16 *) DS::get16BitBackBuffer();
|
||||
const u16* src = (const u16 *) buf;
|
||||
|
||||
|
||||
// if (x + w > 256) w = 256 - x;
|
||||
//if (x + h > 256) h = 256 - y;
|
||||
|
||||
// consolePrintf("Copy rect ovl %d, %d %d, %d %d\n", x, y, w, h, pitch);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
for (int dy = y; dy < y + h; dy++) {
|
||||
|
||||
|
||||
|
||||
|
||||
// Slow but save copy:
|
||||
for (int dx = x; dx < x + w; dx++) {
|
||||
|
||||
|
||||
*(bg + (dy * 512) + dx) = *src;
|
||||
//if ((*src) != 0) consolePrintf("%d,%d: %d ", dx, dy, *src);
|
||||
//consolePrintf("%d,", *src);
|
||||
src++;
|
||||
}
|
||||
src += (pitch - w);
|
||||
|
||||
|
||||
// Fast but broken copy: (why?)
|
||||
/*
|
||||
REG_IME = 0;
|
||||
dmaCopy(src, bg + (dy << 9) + x, w * 2);
|
||||
REG_IME = 1;
|
||||
|
||||
|
||||
src += pitch;*/
|
||||
}
|
||||
|
||||
|
||||
// consolePrintf("Copy rect ovl done");
|
||||
|
||||
}
|
||||
|
@ -446,7 +446,7 @@ int16 OSystem_DS::getOverlayWidth() {
|
|||
return getWidth();
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool OSystem_DS::showMouse(bool visible) {
|
||||
DS::setShowCursor(visible);
|
||||
return true;
|
||||
|
@ -498,7 +498,7 @@ bool OSystem_DS::pollEvent(Common::Event &event) {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
|
||||
/* if (lastPenFrame != DS::getMillis()) {
|
||||
|
@ -511,7 +511,7 @@ bool OSystem_DS::pollEvent(Common::Event &event) {
|
|||
if (eventNum == 1) {
|
||||
eventNum = 0;
|
||||
lastPenFrame = DS::getMillis();
|
||||
if (DS::getPenDown()) {
|
||||
if (DS::getPenDown()) {
|
||||
event.type = Common::EVENT_LBUTTONDOWN;
|
||||
event.mouse = Common::Point(DS::getPenX(), DS::getPenY());
|
||||
consolePrintf("Down %d, %d ", event.mouse.x, event.mouse.y);
|
||||
|
@ -538,12 +538,12 @@ void OSystem_DS::delayMillis(uint msecs) {
|
|||
int st = getMillis();
|
||||
DS::addEventsToQueue();
|
||||
DS::CD::update();
|
||||
|
||||
|
||||
DS::doSoundCallback();
|
||||
while (st + msecs >= getMillis()) {
|
||||
DS::doSoundCallback();
|
||||
}
|
||||
|
||||
|
||||
DS::doTimerCallback();
|
||||
DS::checkSleepMode();
|
||||
DS::addEventsToQueue();
|
||||
|
@ -599,7 +599,7 @@ void OSystem_DS::quit() {
|
|||
/* consolePrintf("Soft resetting...");
|
||||
IPC->reset = 1;
|
||||
REG_IE = 0;
|
||||
|
||||
|
||||
asm("swi 0x26\n");
|
||||
swiSoftReset();*/
|
||||
}
|
||||
|
@ -618,10 +618,10 @@ Common::SaveFileManager* OSystem_DS::getSavefileManager() {
|
|||
} else {
|
||||
forceSram = false;
|
||||
}
|
||||
if (forceSram) {
|
||||
if (forceSram) {
|
||||
consolePrintf("Using SRAM save method!\n");
|
||||
}
|
||||
|
||||
|
||||
if (DS::isGBAMPAvailable() && (!forceSram)) {
|
||||
return &mpSaveManager;
|
||||
} else {
|
||||
|
@ -653,21 +653,21 @@ Graphics::Surface* OSystem_DS::createTempFrameBuffer() {
|
|||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
s32 height = DS::getGameHeight();
|
||||
s32 width = DS::getGameWidth();
|
||||
s32 stride = DS::get8BitBackBufferStride();
|
||||
|
||||
|
||||
u16* src = DS::get8BitBackBuffer();
|
||||
u16* dest = DS::getScalerBuffer();
|
||||
|
||||
for (int y = 0; y < height; y++) {
|
||||
|
||||
|
||||
u16* destLine = dest + (y * (width / 2));
|
||||
u16* srcLine = src + (y * (stride / 2));
|
||||
|
||||
DC_FlushRange(srcLine, width);
|
||||
|
||||
|
||||
dmaCopyHalfWords(3, srcLine, destLine, width);
|
||||
}
|
||||
|
||||
|
@ -681,7 +681,7 @@ Graphics::Surface* OSystem_DS::createTempFrameBuffer() {
|
|||
|
||||
_frameBufferExists = true;
|
||||
|
||||
/*
|
||||
/*
|
||||
size_t imageStrideInBytes = DS::get8BitBackBufferStride();
|
||||
size_t imageStrideInWords = imageStrideInBytes / 2;
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef _OSYSTEM_DS_H_
|
||||
#define _OSYSTEM_DS_H_
|
||||
#include "common/system.h"
|
||||
|
@ -33,13 +33,13 @@
|
|||
#include "sound/mixer_intern.h"
|
||||
#include "graphics/surface.h"
|
||||
|
||||
class DSAudioMixer : public Audio::MixerImpl {
|
||||
class DSAudioMixer : public Audio::MixerImpl {
|
||||
|
||||
public:
|
||||
DSAudioMixer(OSystem* system) : Audio::MixerImpl(system) { }
|
||||
};
|
||||
|
||||
class DSTimerManager : public DefaultTimerManager {
|
||||
class DSTimerManager : public DefaultTimerManager {
|
||||
};
|
||||
|
||||
|
||||
|
@ -48,10 +48,10 @@ protected:
|
|||
|
||||
int eventNum;
|
||||
int lastPenFrame;
|
||||
|
||||
|
||||
Common::Event eventQueue[96];
|
||||
int queuePos;
|
||||
|
||||
|
||||
#ifdef GBA_SRAM_SAVE
|
||||
DSSaveFileManager saveManager;
|
||||
#endif
|
||||
|
@ -75,7 +75,7 @@ protected:
|
|||
byte _cursorKey;
|
||||
int _cursorScale;
|
||||
|
||||
|
||||
|
||||
Graphics::Surface* createTempFrameBuffer();
|
||||
bool _disableCursorPalette;
|
||||
|
||||
|
@ -114,7 +114,7 @@ public:
|
|||
virtual int16 getOverlayHeight();
|
||||
virtual int16 getOverlayWidth();
|
||||
virtual Graphics::PixelFormat getOverlayFormat() const { return Graphics::createPixelFormat<1555>(); }
|
||||
|
||||
|
||||
virtual bool showMouse(bool visible);
|
||||
|
||||
virtual void warpMouse(int x, int y);
|
||||
|
@ -146,21 +146,21 @@ public:
|
|||
virtual void displayMessageOnOSD(const char *msg);
|
||||
|
||||
virtual Common::SaveFileManager *getSavefileManager();
|
||||
|
||||
|
||||
void addEvent(Common::Event& e);
|
||||
bool isEventQueueEmpty() { return queuePos == 0; }
|
||||
|
||||
|
||||
virtual bool grabRawScreen(Graphics::Surface* surf);
|
||||
|
||||
|
||||
virtual void setFocusRectangle(const Common::Rect& rect);
|
||||
|
||||
|
||||
virtual void clearFocusRectangle();
|
||||
|
||||
|
||||
virtual void initBackend();
|
||||
|
||||
|
||||
virtual Graphics::Surface *lockScreen();
|
||||
virtual void unlockScreen();
|
||||
|
||||
|
||||
virtual Audio::Mixer* getMixer() { return _mixer; }
|
||||
Audio::MixerImpl* getMixerImpl() { return _mixer; }
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _PORTDEFS_H_
|
||||
#define _PORTDEFS_H_
|
||||
|
||||
|
@ -82,7 +82,7 @@ int consolePrintf(const char* s, ...);
|
|||
#define ITCM_DATA __attribute__((section(".itcm")))
|
||||
|
||||
// Since I can't change the engine at the moment (post lockdown) this define can go here.
|
||||
// This define changes the mouse-relative motion which doesn't make sense on a touch screen to
|
||||
// This define changes the mouse-relative motion which doesn't make sense on a touch screen to
|
||||
// a more conventional form of input where the menus can be clicked on.
|
||||
#define LURE_CLICKABLE_MENUS
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*
|
||||
*/
|
||||
#ifdef GBA_SRAM_SAVE
|
||||
|
||||
|
@ -53,18 +53,18 @@ DSSaveFile::DSSaveFile(SCUMMSave* s, bool compressed, u8* data) {
|
|||
ownsData = true;
|
||||
saveCompressed = false;
|
||||
// consolePrintf("Decompressed. name=%s size=%d (%d)", save.name, save.size, save.compressedSize);
|
||||
|
||||
|
||||
} else {
|
||||
ownsData = false;
|
||||
origHeader = s;
|
||||
}
|
||||
|
||||
|
||||
if (save.magic == (int) 0xBEEFCAFE) {
|
||||
save.isValid = true;
|
||||
} else {
|
||||
save.isValid = false;
|
||||
}
|
||||
|
||||
|
||||
isTempFile = false;
|
||||
eosReached = false;
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ DSSaveFile::~DSSaveFile() {
|
|||
}
|
||||
|
||||
bool DSSaveFile::loadFromSaveRAM(vu8* address) {
|
||||
|
||||
|
||||
SCUMMSave newSave;
|
||||
|
||||
for (int t = 0; t < (int) sizeof(newSave); t++) {
|
||||
|
@ -91,13 +91,13 @@ bool DSSaveFile::loadFromSaveRAM(vu8* address) {
|
|||
newSave.isValid = true;
|
||||
|
||||
*((u16 *) (0x4000204)) |= 0x3;
|
||||
|
||||
|
||||
saveData = new unsigned char[newSave.compressedSize];
|
||||
|
||||
|
||||
for (int t = 0; t < (int) newSave.compressedSize; t++) {
|
||||
((char *) (saveData))[t] = *(address + t + sizeof(newSave));
|
||||
}
|
||||
|
||||
|
||||
if (ownsData) delete this->saveData;
|
||||
save = newSave;
|
||||
saveCompressed = true;
|
||||
|
@ -107,7 +107,7 @@ bool DSSaveFile::loadFromSaveRAM(vu8* address) {
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -116,11 +116,11 @@ void DSSaveFile::compress() {
|
|||
unsigned char* compBuffer = new unsigned char[(save.size * 110) / 100];
|
||||
int compSize = LZ_Compress((u8 *) saveData, compBuffer, save.size);
|
||||
save.compressedSize = compSize;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
delete saveData;
|
||||
|
||||
|
||||
// Make the save smaller
|
||||
saveData = (u8 *) realloc(compBuffer, save.compressedSize);
|
||||
saveCompressed = true;
|
||||
|
@ -131,39 +131,39 @@ int DSSaveFile::saveToSaveRAM(vu8* address) {
|
|||
|
||||
unsigned char* compBuffer;
|
||||
bool failed;
|
||||
|
||||
|
||||
|
||||
int compSize;
|
||||
|
||||
|
||||
compress();
|
||||
|
||||
|
||||
compSize = save.compressedSize;
|
||||
compBuffer = saveData;
|
||||
|
||||
|
||||
if (DSSaveFileManager::instance()->getBytesFree() >= getRamUsage()) {
|
||||
|
||||
DSSaveFileManager::instance()->addBytesFree(-getRamUsage());
|
||||
|
||||
|
||||
// Write header
|
||||
for (int t = 0; t < sizeof(save); t++) {
|
||||
while (*(address + t) != ((char *) (&save))[t]) {
|
||||
*(address + t) = ((char *) (&save))[t];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Write compressed buffer
|
||||
for (int t = sizeof(save); t < (int) sizeof(save) + compSize; t++) {
|
||||
while (*(address + t) != compBuffer[t - sizeof(save)]) {
|
||||
*(address + t) = compBuffer[t - sizeof(save)];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
failed = false;
|
||||
} else {
|
||||
failed = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return failed? 0: compSize + sizeof(save);
|
||||
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ uint32 DSSaveFile::read(void *buf, uint32 size) {
|
|||
}
|
||||
memcpy(buf, saveData + ptr, size);
|
||||
// consolePrintf("byte: %d ", ((u8 *) (buf))[0]);
|
||||
|
||||
|
||||
ptr += size;
|
||||
return size;
|
||||
}
|
||||
|
@ -260,7 +260,7 @@ bool DSSaveFile::matches(const char *filename) {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DSSaveFile::setName(char *name) {
|
||||
save.isValid = true;
|
||||
save.magic = 0xBEEFCAFE;
|
||||
|
@ -269,7 +269,7 @@ void DSSaveFile::setName(char *name) {
|
|||
save.compressedSize = 0;
|
||||
saveData = new unsigned char[DS_MAX_SAVE_SIZE];
|
||||
strcpy(save.name, name);
|
||||
|
||||
|
||||
if ((strstr(name, ".s99")) || (strstr(name, ".c"))) {
|
||||
isTempFile = true;
|
||||
} else {
|
||||
|
@ -309,10 +309,10 @@ void DSSaveFile::deleteFile() {
|
|||
|
||||
DSSaveFileManager::DSSaveFileManager() {
|
||||
instancePtr = this;
|
||||
|
||||
|
||||
*((u16 *) (0x4000204)) |= 0x3;
|
||||
swiWaitForVBlank();
|
||||
|
||||
|
||||
loadAllFromSRAM();
|
||||
}
|
||||
|
||||
|
@ -322,7 +322,7 @@ DSSaveFileManager::~DSSaveFileManager() {
|
|||
|
||||
void DSSaveFileManager::loadAllFromSRAM() {
|
||||
int addr = 1;
|
||||
|
||||
|
||||
for (int r = 0; r < 8; r++) {
|
||||
gbaSave[r].deleteFile();
|
||||
}
|
||||
|
@ -343,7 +343,7 @@ void DSSaveFileManager::formatSram() {
|
|||
for (int r = 0; r < SRAM_SAVE_MAX; r++) {
|
||||
*(CART_RAM + r) = 0;
|
||||
}
|
||||
|
||||
|
||||
loadAllFromSRAM();
|
||||
}
|
||||
|
||||
|
@ -369,7 +369,7 @@ DSSaveFile *DSSaveFileManager::openSavefile(const char* filename, bool saveOrLoa
|
|||
return gbaSave[r].clone();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (saveOrLoad) {
|
||||
return makeSaveFile(filename, saveOrLoad);
|
||||
} else {
|
||||
|
@ -429,20 +429,20 @@ void DSSaveFileManager::listSavefiles(const char *prefix, bool *marks, int num)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
DSSaveFile *DSSaveFileManager::makeSaveFile(const char *filename, bool saveOrLoad) {
|
||||
|
||||
|
||||
// Find a free save slot
|
||||
int r = 0;
|
||||
|
||||
|
||||
while ((r < 8) && (gbaSave[r].isValid())) {
|
||||
r++;
|
||||
}
|
||||
|
||||
|
||||
if ((r == 8) && (gbaSave[r].isValid())) {
|
||||
// No more saves
|
||||
return NULL;
|
||||
|
@ -459,9 +459,9 @@ void DSSaveFileManager::flushToSaveRAM() {
|
|||
int cartAddr = 1;
|
||||
int s;
|
||||
int extraData = DSSaveFileManager::getExtraData();
|
||||
|
||||
|
||||
*((u16 *) (0x4000204)) |= 0x3;
|
||||
|
||||
|
||||
swiWaitForVBlank();
|
||||
|
||||
int size = 0;
|
||||
|
@ -471,20 +471,20 @@ void DSSaveFileManager::flushToSaveRAM() {
|
|||
if (!gbaSave[r].isTemp()) size += gbaSave[r].getRamUsage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (size <= SRAM_SAVE_MAX) {
|
||||
|
||||
for (int r = 0; r < SRAM_SAVE_MAX; r++) {
|
||||
*(CART_RAM + r) = 0;
|
||||
}
|
||||
|
||||
|
||||
sramBytesFree = SRAM_SAVE_MAX;
|
||||
|
||||
|
||||
for (int r = 0; (r < 8); r++) {
|
||||
if (gbaSave[r].isValid() && (!gbaSave[r].isTemp())) {
|
||||
|
||||
|
||||
cartAddr += s = gbaSave[r].saveToSaveRAM(CART_RAM + cartAddr);
|
||||
|
||||
|
||||
/* if (s == 0) {
|
||||
consolePrintf("WARNING: Save didn't fit in cart RAM and has been lost!! Delete files and save again.", gbaSave[r].getName());
|
||||
failed = true;
|
||||
|
@ -495,7 +495,7 @@ void DSSaveFileManager::flushToSaveRAM() {
|
|||
|
||||
consolePrintf("WARNING: Save didn't fit in cart RAM and has been lost!! Delete files and save again.");
|
||||
loadAllFromSRAM();
|
||||
|
||||
|
||||
}
|
||||
|
||||
DSSaveFileManager::setExtraData(extraData);
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _RAMSAVE_H_
|
||||
#define _RAMSAVE_H_
|
||||
|
||||
|
@ -46,58 +46,58 @@ class DSSaveFile : public Common::InSaveFile, public Common::OutSaveFile {
|
|||
u16 extraMagic; // 32
|
||||
u32 reserved; // 36
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
SCUMMSave save;
|
||||
u8* saveData;
|
||||
SCUMMSave* origHeader;
|
||||
bool isOpenFlag;
|
||||
bool isTempFile;
|
||||
bool eosReached;
|
||||
|
||||
|
||||
public:
|
||||
DSSaveFile();
|
||||
DSSaveFile(SCUMMSave* s, bool saveCompressed, u8* data);
|
||||
~DSSaveFile();
|
||||
|
||||
|
||||
void reset();
|
||||
|
||||
|
||||
bool isOpen() const { return isOpenFlag; }
|
||||
virtual bool eos() const;
|
||||
virtual void clearErr();
|
||||
virtual bool skip(uint32 size);
|
||||
|
||||
|
||||
virtual int32 pos() const;
|
||||
virtual int32 size() const;
|
||||
virtual bool seek(int32 pos, int whence);
|
||||
|
||||
uint32 read(void *buf, uint32 size);
|
||||
uint32 write(const void *buf, uint32 size);
|
||||
|
||||
|
||||
void setName(char *name);
|
||||
char* getName() { return save.name; }
|
||||
|
||||
|
||||
bool isValid() { return save.isValid; }
|
||||
bool isTemp() { return isTempFile; }
|
||||
bool matches(const char *prefix, int num);
|
||||
bool matches(const char *filename);
|
||||
|
||||
|
||||
void clearData();
|
||||
void compress();
|
||||
|
||||
|
||||
int getRamUsage() { return sizeof(save) + save.compressedSize; }
|
||||
char* getRamImage() { return (char *) &save; }
|
||||
|
||||
|
||||
int getSize() { return save.size; }
|
||||
|
||||
|
||||
DSSaveFile* clone();
|
||||
|
||||
|
||||
bool loadFromSaveRAM(vu8* address);
|
||||
int saveToSaveRAM(vu8* address);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void deleteFile();
|
||||
|
||||
|
||||
void operator delete(void *p) {
|
||||
// consolePrintf("Finished! size=%d\n", ((DSSaveFile *) (p))->save->size);
|
||||
}
|
||||
|
@ -109,25 +109,25 @@ public:
|
|||
|
||||
|
||||
class DSSaveFileManager : public Common::SaveFileManager {
|
||||
|
||||
|
||||
DSSaveFile gbaSave[8];
|
||||
static DSSaveFileManager* instancePtr;
|
||||
int sramBytesFree;
|
||||
|
||||
|
||||
public:
|
||||
DSSaveFileManager();
|
||||
~DSSaveFileManager();
|
||||
|
||||
|
||||
static DSSaveFileManager* instance() { return instancePtr; }
|
||||
|
||||
DSSaveFile *openSavefile(const char *filename, bool saveOrLoad);
|
||||
|
||||
|
||||
virtual Common::OutSaveFile* openForSaving(const char* filename) { return openSavefile(filename, true); }
|
||||
virtual Common::InSaveFile* openForLoading(const char* filename) { return openSavefile(filename, false); }
|
||||
|
||||
virtual bool removeSavefile(const char *filename);
|
||||
virtual Common::StringList listSavefiles(const char *pattern);
|
||||
|
||||
|
||||
void flushToSaveRAM();
|
||||
|
||||
void addBytesFree(int size) { sramBytesFree += size; }
|
||||
|
@ -136,7 +136,7 @@ public:
|
|||
void deleteFile(char* name);
|
||||
void listFiles();
|
||||
void formatSram();
|
||||
|
||||
|
||||
void loadAllFromSRAM();
|
||||
|
||||
static bool isExtraDataPresent();
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
//
|
||||
// Changelog:
|
||||
// 0.1: First version
|
||||
// 0.2: Fixed sprite mapping bug. 1D mapping should work now.
|
||||
// 0.2: Fixed sprite mapping bug. 1D mapping should work now.
|
||||
// Changed some register defines for consistency.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "scummhelp.h"
|
||||
|
||||
#define ADD_BIND(k,d) do { key[i] = k; dsc[i] = d; i++; } while (0)
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SCUMMHELP_H_
|
||||
#define _SCUMMHELP_H_
|
||||
|
||||
|
@ -30,7 +30,7 @@ namespace DS {
|
|||
|
||||
void updateStrings(byte gameId, byte version, Common::Platform platform,
|
||||
int page, Common::String &title, Common::String *&key, Common::String *&dsc);
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -45,7 +45,7 @@ struct key_data {
|
|||
|
||||
key_data keys[DS_NUM_KEYS] = {
|
||||
// Key number x y character
|
||||
|
||||
|
||||
// Numbers
|
||||
{28, 3, 0, '1'},
|
||||
{29, 5, 0, '2'},
|
||||
|
@ -116,7 +116,7 @@ key_data keys[DS_NUM_KEYS] = {
|
|||
{54, 29, 8, Common::KEYCODE_DOWN},
|
||||
{53, 31, 8, Common::KEYCODE_RIGHT},
|
||||
{51, 29, 6, Common::KEYCODE_UP},
|
||||
|
||||
|
||||
// Close button
|
||||
{56, 30, 0, Common::KEYCODE_INVALID},
|
||||
|
||||
|
@ -133,7 +133,7 @@ key_data keys[DS_NUM_KEYS] = {
|
|||
{66, 26, -2, Common::KEYCODE_F10},
|
||||
{67, 28, -2, Common::KEYCODE_F11},
|
||||
{68, 30, -2, Common::KEYCODE_F12},
|
||||
|
||||
|
||||
};
|
||||
|
||||
int keyboardX;
|
||||
|
@ -162,7 +162,7 @@ void restoreVRAM(int tileBase, int mapBase, u16* saveSpace) {
|
|||
/* for (int r = 0; r < 32 * 32; r++) {
|
||||
((u16 *) SCREEN_BASE_BLOCK_SUB(mapBase))[r] = *saveSpace++;
|
||||
}
|
||||
|
||||
|
||||
for (int r = 0; r < 4096; r++) {
|
||||
((u16 *) CHAR_BASE_BLOCK_SUB(tileBase))[r] = *saveSpace++;
|
||||
}*/
|
||||
|
@ -175,19 +175,19 @@ void drawKeyboard(int tileBase, int mapBase, u16* saveSpace) {
|
|||
// *saveSpace++ = ((u16 *) SCREEN_BASE_BLOCK_SUB(mapBase))[r];
|
||||
((u16 *) SCREEN_BASE_BLOCK_SUB(mapBase))[r] = 0;
|
||||
}
|
||||
|
||||
|
||||
for (int r = 0; r < KEYBOARD_DATA_SIZE / 2; r++) {
|
||||
// *saveSpace++ = ((u16 *) CHAR_BASE_BLOCK_SUB(tileBase))[r];
|
||||
((u16 *) CHAR_BASE_BLOCK_SUB(tileBase))[r] = ((u16 *) (::keyboard_raw))[r];
|
||||
}
|
||||
|
||||
|
||||
for (int r = 0; r < 16; r++) {
|
||||
BG_PALETTE_SUB[r] = ((u16 *) (keyboard_pal_raw))[r];
|
||||
}
|
||||
|
||||
// this is the font
|
||||
for (int tile = 0; tile < 94; tile++) {
|
||||
|
||||
|
||||
u16* tileAddr = (u16 *) (CHAR_BASE_BLOCK_SUB(tileBase) + ((KEYBOARD_DATA_SIZE) + (tile * 32)));
|
||||
u8* src = ((u8 *) (::_8x8font_tga_raw)) + 18 + tile * 8;
|
||||
|
||||
|
@ -197,55 +197,55 @@ void drawKeyboard(int tileBase, int mapBase, u16* saveSpace) {
|
|||
| ((*(src + (y * 752) + (x * 4) + 1) & 0x0F) << 4)
|
||||
| ((*(src + (y * 752) + (x * 4) + 2) & 0x0F) << 8)
|
||||
| ((*(src + (y * 752) + (x * 4) + 3) & 0x0F) << 12);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
for (int r = 0; r < 16; r++) {
|
||||
int col = ((u16 *) (keyboard_pal_raw))[r];
|
||||
|
||||
|
||||
int red = col & 0x001F;
|
||||
int green = (col & 0x03E0) >> 5;
|
||||
int blue = (col & 0x7C00) >> 10;
|
||||
|
||||
|
||||
red = (red * 8) / 16;
|
||||
green = (green * 24) / 16;
|
||||
blue = (blue * 8) / 16;
|
||||
|
||||
if (green > 31) green = 31;
|
||||
|
||||
|
||||
BG_PALETTE_SUB[16 + r] = red | (green << 5) | (blue << 10);
|
||||
}
|
||||
|
||||
|
||||
keyboardX = -2;
|
||||
keyboardY = 2;
|
||||
|
||||
|
||||
DS::mapBase = mapBase;
|
||||
DS::tileBase = tileBase;
|
||||
|
||||
|
||||
shiftState = false;
|
||||
capsLockState = false;
|
||||
|
||||
|
||||
int x = keyboardX;
|
||||
int y = keyboardY;
|
||||
|
||||
|
||||
u16* base = ((u16 *) SCREEN_BASE_BLOCK_SUB(mapBase));
|
||||
baseAddress = base;
|
||||
|
||||
|
||||
for (int r = 0; r < DS_NUM_KEYS; r++) {
|
||||
base[(y + keys[r].y) * 32 + x + keys[r].x] = 10 + keys[r].keyNum * 2;
|
||||
base[(y + keys[r].y) * 32 + x + keys[r].x + 1] = 10 + keys[r].keyNum * 2 + 1;
|
||||
|
||||
|
||||
base[(y + keys[r].y + 1) * 32 + x + keys[r].x] = 10 + 148 + keys[r].keyNum * 2;
|
||||
base[(y + keys[r].y + 1) * 32 + x + keys[r].x + 1] = 10 + 148 + keys[r].keyNum * 2 + 1;
|
||||
|
||||
|
||||
keys[r].pressed = false;
|
||||
}
|
||||
|
||||
|
||||
closed = false;
|
||||
clearAutoComplete();
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ void drawAutoComplete() {
|
|||
baseAddress[y * 32 + x] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
for (int r = 0; r < autoCompleteCount; r++) {
|
||||
int y = 12 + (r % 6) * 2;
|
||||
|
@ -265,15 +265,15 @@ void drawAutoComplete() {
|
|||
|
||||
for (int p = 0; autoCompleteWord[r][p] != 0; p++) {
|
||||
char c = autoCompleteWord[r][p];
|
||||
|
||||
|
||||
int tile = c - 33 + (KEYBOARD_DATA_SIZE / 32);
|
||||
|
||||
if (selectedCompletion == r) {
|
||||
tile |= 0x1000;
|
||||
}
|
||||
|
||||
baseAddress[y * 32 + x + p] = tile;
|
||||
|
||||
baseAddress[y * 32 + x + p] = tile;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -330,7 +330,7 @@ void typeCompletion(int current) {
|
|||
event.type = Common::EVENT_KEYDOWN;
|
||||
event.kbd.flags = 0;
|
||||
system->addEvent(event);
|
||||
|
||||
|
||||
event.type = Common::EVENT_KEYUP;
|
||||
system->addEvent(event);
|
||||
}
|
||||
|
@ -351,13 +351,13 @@ void updateTypeEvents()
|
|||
{
|
||||
Common::Event event;
|
||||
OSystem_DS* system = OSystem_DS::instance();
|
||||
|
||||
|
||||
event.kbd.keycode = (Common::KeyCode) autoCompleteBuffer[0];
|
||||
event.kbd.ascii = autoCompleteBuffer[0];
|
||||
event.type = Common::EVENT_KEYDOWN;
|
||||
event.kbd.flags = 0;
|
||||
system->addEvent(event);
|
||||
|
||||
|
||||
event.type = Common::EVENT_KEYUP;
|
||||
system->addEvent(event);
|
||||
|
||||
|
@ -380,16 +380,16 @@ void createKeyEvent(int keyNum, Common::Event& event)
|
|||
} else {
|
||||
event.kbd.keycode = (Common::KeyCode) (Common::KEYCODE_F1 - (keys[keyNum].character - '1'));
|
||||
event.kbd.ascii = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else if ((keys[keyNum].character >= 'A') && (keys[keyNum].character <= 'Z')) {
|
||||
|
||||
|
||||
if ((!DS::shiftState) && (!DS::capsLockState)) {
|
||||
event.kbd.ascii = keys[keyNum].character + 32; // Make key lowercase.
|
||||
} else {
|
||||
event.kbd.ascii = keys[keyNum].character;
|
||||
}
|
||||
|
||||
|
||||
event.kbd.keycode = (Common::KeyCode) event.kbd.ascii;
|
||||
} else {
|
||||
if ((keys[keyNum].character >= Common::KEYCODE_F1) && (keys[keyNum].character >= Common::KEYCODE_F12)) {
|
||||
|
@ -399,7 +399,7 @@ void createKeyEvent(int keyNum, Common::Event& event)
|
|||
event.kbd.ascii = keys[keyNum].character;
|
||||
event.kbd.keycode = (Common::KeyCode) keys[keyNum].character;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void releaseAllKeys() {
|
||||
|
@ -408,7 +408,7 @@ void releaseAllKeys() {
|
|||
DS::setKeyHighlight(r, false);
|
||||
|
||||
OSystem_DS* system = OSystem_DS::instance();
|
||||
|
||||
|
||||
Common::Event event;
|
||||
createKeyEvent(r, event);
|
||||
event.type = Common::EVENT_KEYUP;
|
||||
|
@ -416,7 +416,7 @@ void releaseAllKeys() {
|
|||
|
||||
keys[r].pressed = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void addKeyboardEvents() {
|
||||
|
@ -427,7 +427,7 @@ void addKeyboardEvents() {
|
|||
if (DS::getPenDown()) {
|
||||
int x = IPC->touchXpx;
|
||||
int y = IPC->touchYpx;
|
||||
|
||||
|
||||
int tx = (x >> 3);
|
||||
int ty = (y >> 3);
|
||||
|
||||
|
@ -451,63 +451,63 @@ void addKeyboardEvents() {
|
|||
|
||||
tx -= keyboardX;
|
||||
ty -= keyboardY;
|
||||
|
||||
|
||||
// consolePrintf("x=%d y=%d\n", tx, ty);
|
||||
|
||||
|
||||
for (int r = 0; r < DS_NUM_KEYS; r++) {
|
||||
if (( (tx >= keys[r].x) && (tx <= keys[r].x + 1)) &&
|
||||
if (( (tx >= keys[r].x) && (tx <= keys[r].x + 1)) &&
|
||||
(ty >= keys[r].y) && (ty <= keys[r].y + 1)) {
|
||||
OSystem_DS* system = OSystem_DS::instance();
|
||||
Common::Event event;
|
||||
|
||||
|
||||
// consolePrintf("Key: %d\n", r);
|
||||
if ((keys[r].character == Common::KEYCODE_INVALID)) {
|
||||
// Close button
|
||||
//DS::closed = true;
|
||||
} else {
|
||||
createKeyEvent(r, event);
|
||||
}
|
||||
|
||||
//event.kbd.keycode = keys[r].character;
|
||||
//event.kbd.ascii = keys[r].character;
|
||||
}
|
||||
|
||||
//event.kbd.keycode = keys[r].character;
|
||||
//event.kbd.ascii = keys[r].character;
|
||||
event.type = Common::EVENT_KEYDOWN;
|
||||
system->addEvent(event);
|
||||
|
||||
// event.type = Common::EVENT_KEYUP;
|
||||
// system->addEvent(event);
|
||||
|
||||
|
||||
switch (keys[r].character) {
|
||||
case DS_SHIFT: {
|
||||
DS::shiftState = !DS::shiftState;
|
||||
DS::setKeyHighlight(r, DS::shiftState);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case DS_CAPSLOCK: {
|
||||
DS::capsLockState = !DS::capsLockState;
|
||||
DS::setKeyHighlight(r, DS::capsLockState);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
default: {
|
||||
DS::setKeyHighlight(r, true);
|
||||
keys[r].pressed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (DS::getPenReleased()) {
|
||||
|
||||
|
||||
for (int r = 0; r < DS_NUM_KEYS; r++) {
|
||||
if (keys[r].pressed) {
|
||||
DS::setKeyHighlight(r, false);
|
||||
|
||||
OSystem_DS* system = OSystem_DS::instance();
|
||||
|
||||
|
||||
Common::Event event;
|
||||
if ((keys[r].character == Common::KEYCODE_INVALID)) {
|
||||
// Close button
|
||||
|
@ -524,7 +524,7 @@ void addKeyboardEvents() {
|
|||
resetShift = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _TOUCHKEYBOARD_H_
|
||||
#define _TOUCHKEYBOARD_H_
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ void addAutoCompleteLine(char* line) {
|
|||
{
|
||||
char word[32];
|
||||
int length;
|
||||
|
||||
|
||||
// Skip the T9-style numbers
|
||||
while (*line != ' ')
|
||||
{
|
||||
|
@ -37,7 +37,7 @@ void addAutoCompleteLine(char* line) {
|
|||
if (*line == ' ') line++;
|
||||
|
||||
|
||||
// Copy the new word
|
||||
// Copy the new word
|
||||
do {
|
||||
word[length++] = *line++;
|
||||
} while ((*line != '\0') && (*line != ' ') && (*line != '\n'));
|
||||
|
@ -47,7 +47,7 @@ void addAutoCompleteLine(char* line) {
|
|||
|
||||
// Store a pointer to the start of the word
|
||||
wordBufferPtr[wordBufferPtrPos++] = &wordBuffer[wordBufferPos];
|
||||
|
||||
|
||||
// copy the new word into the buffer
|
||||
strcpy(&wordBuffer[wordBufferPos], word);
|
||||
wordBufferPos += strlen(word) + 1;
|
||||
|
@ -103,11 +103,11 @@ bool findWordCompletions(char* input)
|
|||
// Get the word from the dictonary line
|
||||
word = wordBufferPtr[position];
|
||||
|
||||
|
||||
|
||||
|
||||
// Now check to see if the word is before or after the stub we're after
|
||||
int result = scumm_stricmp((const char *) partialWord, (const char *) word);
|
||||
|
||||
|
||||
if (result == 0) {
|
||||
// We've found the whole word. Aren't we good.
|
||||
break;
|
||||
|
@ -127,10 +127,10 @@ bool findWordCompletions(char* input)
|
|||
word = wordBufferPtr[position];
|
||||
//consolePrintf("Final word: %s\n", word);
|
||||
|
||||
|
||||
|
||||
|
||||
system->setCharactersEntered(strlen(partialWord));
|
||||
|
||||
|
||||
|
||||
bool match = true;
|
||||
|
||||
|
@ -160,7 +160,7 @@ bool findWordCompletions(char* input)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (match) {
|
||||
system->addAutoComplete(word);
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
@ -29,25 +29,25 @@
|
|||
|
||||
ZipFile::ZipFile() {
|
||||
// Locate a zip file in cartridge memory space
|
||||
|
||||
|
||||
// consolePrintf("ZIP file check...");
|
||||
|
||||
|
||||
char* p = (char *) ZF_SEARCH_START;
|
||||
bool found = false;
|
||||
|
||||
|
||||
_zipFile = NULL;
|
||||
|
||||
|
||||
while ((p != (char *) ZF_SEARCH_END) && (!found)) {
|
||||
// Zip file header is: 0x504B0304
|
||||
|
||||
|
||||
if ( (*p == 0x50) && (*(p + 1) == 0x4B) && (*(p + 2) == 0x03) && (*(p + 3) == 0x04) ) {
|
||||
// Found header!
|
||||
found = true;
|
||||
_zipFile = p;
|
||||
}
|
||||
|
||||
|
||||
if (!found) p += ZF_SEARCH_STRIDE;
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (_zipFile) {
|
||||
|
@ -56,14 +56,14 @@ ZipFile::ZipFile() {
|
|||
// consolePrintf("Not in use!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
changeToRoot();
|
||||
restartFile();
|
||||
|
||||
|
||||
if (_currentFile->compSize != (u32) getFileSize()) {
|
||||
consolePrintf("Error: ZIP file contains compression!\n");
|
||||
}
|
||||
|
||||
|
||||
_allFilesVisible = false;
|
||||
}
|
||||
|
||||
|
@ -83,19 +83,19 @@ bool ZipFile::restartFile() {
|
|||
getFileName(name);
|
||||
more = skipFile();
|
||||
}
|
||||
|
||||
|
||||
return more;
|
||||
}
|
||||
|
||||
bool ZipFile::currentFileInFolder() {
|
||||
char name[128];
|
||||
|
||||
|
||||
if (_allFilesVisible) return true;
|
||||
|
||||
|
||||
getFileName(name);
|
||||
|
||||
// consolePrintf("N:'%s'D:'%s'\n", name, _directory);
|
||||
|
||||
|
||||
if (_directory[0] == 0) { // Root directory
|
||||
name[strlen(name) - 1] = 0;
|
||||
return !strchr(name, '\\'); // Not in root if contains a / character before the last character
|
||||
|
@ -104,52 +104,52 @@ bool ZipFile::currentFileInFolder() {
|
|||
&& (no slashes after the directory || it's the last character)
|
||||
&& (slash follows directory)
|
||||
*/
|
||||
if ((strstr(name, _directory) == name) && (strlen(name) != strlen(_directory))
|
||||
if ((strstr(name, _directory) == name) && (strlen(name) != strlen(_directory))
|
||||
&& ((strchr(name + strlen(_directory) + 1, '\\') == NULL)
|
||||
|| (strchr(name + strlen(_directory) + 1, '\\') == name + strlen(name) - 1))
|
||||
&& (*(name + strlen(_directory)) == '\\')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ZipFile::getFileName(char* name) {
|
||||
strncpy(name, (char *) (_currentFile + 1), _currentFile->nameLength);
|
||||
|
||||
|
||||
for (int r = 0; r < (int) strlen(name); r++) {
|
||||
if (name[r] == '/') name[r] = '\\';
|
||||
}
|
||||
|
||||
name[_currentFile->nameLength] = 0;
|
||||
|
||||
|
||||
if (name[strlen(name) - 1] == '\\') {
|
||||
name[strlen(name) - 1] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool ZipFile::skipFile() {
|
||||
bool valid;
|
||||
|
||||
do {
|
||||
|
||||
|
||||
// Move on to the next file
|
||||
_currentFile = (FileHeader *) (
|
||||
((char *) (_currentFile)) + sizeof(*_currentFile) + _currentFile->nameLength + _currentFile->fileSize + _currentFile->extraLength
|
||||
);
|
||||
|
||||
|
||||
// Return true if there are more files. Check this by looking for the magic number
|
||||
valid = (_currentFile->magic[0] == 0x50) &&
|
||||
(_currentFile->magic[1] == 0x4B) &&
|
||||
(_currentFile->magic[2] == 0x03) &&
|
||||
(_currentFile->magic[3] == 0x04);
|
||||
|
||||
|
||||
|
||||
|
||||
} while (valid && !currentFileInFolder());
|
||||
|
||||
|
||||
return valid;
|
||||
|
||||
|
||||
// Currently doesn't handle data descriptors!
|
||||
}
|
||||
|
||||
|
@ -180,7 +180,7 @@ char* ZipFile::getFile() {
|
|||
bool ZipFile::findFile(char* search) {
|
||||
changeToRoot();
|
||||
restartFile();
|
||||
|
||||
|
||||
char searchName[128];
|
||||
strcpy(searchName, search);
|
||||
for (int r = 0; r < (int) strlen(searchName); r++) {
|
||||
|
@ -191,15 +191,15 @@ bool ZipFile::findFile(char* search) {
|
|||
*(searchName + strlen(searchName) - 1) = '\0'; // which we need to dispose of.
|
||||
}
|
||||
|
||||
|
||||
|
||||
do {
|
||||
char name[128];
|
||||
getFileName(name);
|
||||
if (*(name + strlen(name) - 1) == '\\') { // Directories have a terminating slash
|
||||
*(name + strlen(name) - 1) = '\0'; // which we need to dispose of.
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (!stricmp(name, searchName)) {
|
||||
// consolePrintf("'%s'=='%s'\n", name, searchName);
|
||||
return true; // Got it!
|
||||
|
@ -222,7 +222,7 @@ void ZipFile::changeDirectory(char* dir) {
|
|||
for (int r = 0; r < (int) strlen(_directory); r++) {
|
||||
if (_directory[r] == '/') _directory[r] = '\\';
|
||||
}
|
||||
|
||||
|
||||
if (_directory[strlen(_directory) - 1] == '\\') {
|
||||
_directory[strlen(_directory) - 1] = '\0';
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ZIPREADER_H_
|
||||
#define _ZIPREADER_H_
|
||||
#include "portdefs.h"
|
||||
|
@ -45,9 +45,9 @@ class ZipFile {
|
|||
|
||||
char* _zipFile;
|
||||
char _directory[128];
|
||||
|
||||
|
||||
bool _allFilesVisible;
|
||||
|
||||
|
||||
FileHeader* _currentFile;
|
||||
|
||||
public:
|
||||
|
@ -55,25 +55,25 @@ public:
|
|||
~ZipFile();
|
||||
|
||||
bool isReady();
|
||||
|
||||
|
||||
// These operations set the current file
|
||||
bool restartFile();
|
||||
bool skipFile();
|
||||
bool findFile(char* search);
|
||||
bool findFile(char* search);
|
||||
|
||||
// These return the file's data and information
|
||||
char* getFile();
|
||||
int getFileSize();
|
||||
void getFileName(char* name);
|
||||
bool isDirectory();
|
||||
|
||||
|
||||
// These set the current directory
|
||||
void changeDirectory(char* name);
|
||||
void changeToRoot();
|
||||
void setAllFilesVisible(bool state) { _allFilesVisible = state; }
|
||||
|
||||
|
||||
bool currentFileInFolder();
|
||||
|
||||
|
||||
u16 misaligned16(u16* v);
|
||||
u32 misaligned32(u32* v);
|
||||
|
||||
|
|
|
@ -65,11 +65,11 @@ OSystem_IPHONE::OSystem_IPHONE() :
|
|||
_needEventRestPeriod(false), _mouseClickAndDragEnabled(false), _touchpadModeEnabled(false),
|
||||
_gestureStartX(-1), _gestureStartY(-1), _fullScreenIsDirty(false),
|
||||
_mouseDirty(false), _timeSuspended(0), _lastDragPosX(-1), _lastDragPosY(-1)
|
||||
|
||||
|
||||
{
|
||||
_queuedInputEvent.type = (Common::EventType)0;
|
||||
_lastDrawnMouseRect = Common::Rect(0, 0, 0, 0);
|
||||
|
||||
|
||||
_fsFactory = new POSIXFilesystemFactory();
|
||||
}
|
||||
|
||||
|
@ -693,7 +693,7 @@ bool OSystem_IPHONE::pollEvent(Common::Event &event) {
|
|||
|
||||
case kInputMouseUp:
|
||||
if (!handleEvent_mouseUp(event, x, y))
|
||||
return false;
|
||||
return false;
|
||||
break;
|
||||
|
||||
case kInputMouseDragged:
|
||||
|
@ -714,7 +714,7 @@ bool OSystem_IPHONE::pollEvent(Common::Event &event) {
|
|||
break;
|
||||
|
||||
case kInputOrientationChanged:
|
||||
handleEvent_orientationChanged((int)xUnit);
|
||||
handleEvent_orientationChanged((int)xUnit);
|
||||
return false;
|
||||
break;
|
||||
|
||||
|
@ -762,12 +762,12 @@ bool OSystem_IPHONE::handleEvent_mouseDown(Common::Event &event, int x, int y) {
|
|||
} else {
|
||||
_lastMouseDown = getMillis();
|
||||
}
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool OSystem_IPHONE::handleEvent_mouseUp(Common::Event &event, int x, int y) {
|
||||
//printf("Mouse up at (%u, %u)\n", x, y);
|
||||
|
||||
|
||||
if (_secondaryTapped) {
|
||||
_secondaryTapped = false;
|
||||
if (!handleEvent_secondMouseUp(event, x, y))
|
||||
|
@ -791,7 +791,7 @@ bool OSystem_IPHONE::handleEvent_mouseUp(Common::Event &event, int x, int y) {
|
|||
} else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -850,14 +850,14 @@ bool OSystem_IPHONE::handleEvent_secondMouseUp(Common::Event &event, int x, int
|
|||
event.mouse.x = _mouseX;
|
||||
event.mouse.y = _mouseY;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OSystem_IPHONE::handleEvent_mouseDragged(Common::Event &event, int x, int y) {
|
||||
if (_lastDragPosX == x && _lastDragPosY == y)
|
||||
return false;
|
||||
|
||||
|
||||
_lastDragPosX = x;
|
||||
_lastDragPosY = y;
|
||||
|
||||
|
@ -927,13 +927,13 @@ bool OSystem_IPHONE::handleEvent_mouseDragged(Common::Event &event, int x, int y
|
|||
int mouseNewPosY;
|
||||
if (_touchpadModeEnabled ) {
|
||||
int deltaX = _lastPadX - x;
|
||||
int deltaY = _lastPadY - y;
|
||||
int deltaY = _lastPadY - y;
|
||||
_lastPadX = x;
|
||||
_lastPadY = y;
|
||||
|
||||
|
||||
mouseNewPosX = (int)(_mouseX - deltaX / 0.5f);
|
||||
mouseNewPosY = (int)(_mouseY - deltaY / 0.5f);
|
||||
|
||||
|
||||
if (mouseNewPosX < 0)
|
||||
mouseNewPosX = 0;
|
||||
else if (mouseNewPosX > _screenWidth)
|
||||
|
@ -943,18 +943,18 @@ bool OSystem_IPHONE::handleEvent_mouseDragged(Common::Event &event, int x, int y
|
|||
mouseNewPosY = 0;
|
||||
else if (mouseNewPosY > _screenHeight)
|
||||
mouseNewPosY = _screenHeight;
|
||||
|
||||
|
||||
} else {
|
||||
mouseNewPosX = x;
|
||||
mouseNewPosY = y;
|
||||
}
|
||||
|
||||
|
||||
event.type = Common::EVENT_MOUSEMOVE;
|
||||
event.mouse.x = mouseNewPosX;
|
||||
event.mouse.y = mouseNewPosY;
|
||||
warpMouse(mouseNewPosX, mouseNewPosY);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -986,7 +986,7 @@ void OSystem_IPHONE::handleEvent_orientationChanged(int orientation) {
|
|||
|
||||
dirtyFullScreen();
|
||||
updateScreen();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OSystem_IPHONE::handleEvent_keyPressed(Common::Event &event, int keyPressed) {
|
||||
|
@ -1047,9 +1047,9 @@ void OSystem_IPHONE::handleEvent_keyPressed(Common::Event &event, int keyPresse
|
|||
event.kbd.flags = _queuedInputEvent.kbd.flags = 0;
|
||||
event.kbd.keycode = _queuedInputEvent.kbd.keycode = (Common::KeyCode)keyPressed;
|
||||
event.kbd.ascii = _queuedInputEvent.kbd.ascii = ascii;
|
||||
_needEventRestPeriod = true;
|
||||
_needEventRestPeriod = true;
|
||||
}
|
||||
|
||||
|
||||
bool OSystem_IPHONE::handleEvent_swipe(Common::Event &event, int direction) {
|
||||
Common::KeyCode keycode = Common::KEYCODE_INVALID;
|
||||
switch (_screenOrientation) {
|
||||
|
@ -1115,7 +1115,7 @@ bool OSystem_IPHONE::handleEvent_swipe(Common::Event &event, int direction) {
|
|||
_queuedInputEvent.type = Common::EVENT_KEYUP;
|
||||
event.kbd.flags = _queuedInputEvent.kbd.flags = 0;
|
||||
_needEventRestPeriod = true;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1126,14 +1126,14 @@ void OSystem_IPHONE::suspendLoop() {
|
|||
uint32 startTime = getMillis();
|
||||
|
||||
stopSoundsystem();
|
||||
|
||||
|
||||
while (!done) {
|
||||
if (iPhone_fetchEvent(&eventType, &xUnit, &yUnit))
|
||||
if ((InputEvent)eventType == kInputApplicationResumed)
|
||||
done = true;
|
||||
usleep(100000);
|
||||
}
|
||||
|
||||
|
||||
startSoundsystem();
|
||||
|
||||
_timeSuspended += getMillis() - startTime;
|
||||
|
@ -1238,7 +1238,7 @@ void OSystem_IPHONE::startSoundsystem() {
|
|||
for (int i = 0; i < AUDIO_BUFFERS; i++) {
|
||||
if (AudioQueueAllocateBuffer(s_AudioQueue.queue, bufferBytes, &s_AudioQueue.buffers[i])) {
|
||||
printf("Error allocating AudioQueue buffer!\n");
|
||||
_mixer->setReady(false);
|
||||
_mixer->setReady(false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1248,10 +1248,10 @@ void OSystem_IPHONE::startSoundsystem() {
|
|||
AudioQueueSetParameter(s_AudioQueue.queue, kAudioQueueParam_Volume, 1.0);
|
||||
if (AudioQueueStart(s_AudioQueue.queue, NULL)) {
|
||||
printf("Error starting the AudioQueue!\n");
|
||||
_mixer->setReady(false);
|
||||
_mixer->setReady(false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
_mixer->setOutputRate(AUDIO_SAMPLE_RATE);
|
||||
_mixer->setReady(true);
|
||||
}
|
||||
|
|
|
@ -190,17 +190,17 @@ protected:
|
|||
void suspendLoop();
|
||||
static void AQBufferCallback(void *in, AudioQueueRef inQ, AudioQueueBufferRef outQB);
|
||||
static int timerHandler(int t);
|
||||
|
||||
|
||||
bool handleEvent_swipe(Common::Event &event, int direction);
|
||||
void handleEvent_keyPressed(Common::Event &event, int keyPressed);
|
||||
void handleEvent_orientationChanged(int orientation);
|
||||
|
||||
bool handleEvent_mouseDown(Common::Event &event, int x, int y);
|
||||
bool handleEvent_mouseUp(Common::Event &event, int x, int y);
|
||||
|
||||
|
||||
bool handleEvent_secondMouseDown(Common::Event &event, int x, int y);
|
||||
bool handleEvent_secondMouseUp(Common::Event &event, int x, int y);
|
||||
|
||||
|
||||
bool handleEvent_mouseDragged(Common::Event &event, int x, int y);
|
||||
};
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode tvMode) {
|
|||
_videoMode = tvMode;
|
||||
|
||||
printf("Setting up %s mode\n", (_videoMode == TV_PAL) ? "PAL" : "NTSC");
|
||||
|
||||
|
||||
// set screen size, 640x544 for pal, 640x448 for ntsc
|
||||
_tvWidth = 640;
|
||||
_tvHeight = ((_videoMode == TV_PAL) ? 544 : 448);
|
||||
|
@ -175,7 +175,7 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode tvMode) {
|
|||
_clutPtrs[TEXT] = _clutPtrs[SCREEN] + 0x2000;
|
||||
_texPtrs[SCREEN] = _clutPtrs[SCREEN] + 0x3000;
|
||||
_texPtrs[TEXT] = 0; // these buffers are stored in the alpha gaps of the frame buffers
|
||||
_texPtrs[MOUSE] = 128 * 256 * 4;
|
||||
_texPtrs[MOUSE] = 128 * 256 * 4;
|
||||
_texPtrs[PRINTF] = _texPtrs[MOUSE] + M_SIZE * M_SIZE * 4;
|
||||
|
||||
_showOverlay = false;
|
||||
|
@ -224,7 +224,7 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode tvMode) {
|
|||
updateScreen();
|
||||
|
||||
createAnimTextures();
|
||||
|
||||
|
||||
// create anim thread
|
||||
ee_thread_t animThread, thisThread;
|
||||
ReferThreadStatus(GetThreadId(), &thisThread);
|
||||
|
@ -636,7 +636,7 @@ void Gs2dScreen::animThread(void) {
|
|||
do {
|
||||
WaitSema(g_AnimSema);
|
||||
} while ((!_systemQuit) && (!g_RunAnim));
|
||||
|
||||
|
||||
if (_systemQuit)
|
||||
break;
|
||||
|
||||
|
@ -761,7 +761,7 @@ const uint32 Gs2dScreen::_binaryClut[16] __attribute__((aligned(64))) = {
|
|||
GS_RGBA( 0, 0, 0, 0x20), // scrPrintf: semitransparent
|
||||
GS_RGBA(0xC0, 0xC0, 0xC0, 0), // scrPrintf: red
|
||||
GS_RGBA(0x16, 0x16, 0xF0, 0), // scrPrintf: blue
|
||||
|
||||
|
||||
GS_RGBA(0xFF, 0xFF, 0xFF, 0x80), GS_RGBA(0xFF, 0xFF, 0xFF, 0x80), // unused
|
||||
GS_RGBA(0xFF, 0xFF, 0xFF, 0x80), GS_RGBA(0xFF, 0xFF, 0xFF, 0x80),
|
||||
GS_RGBA(0xFF, 0xFF, 0xFF, 0x80), GS_RGBA(0xFF, 0xFF, 0xFF, 0x80),
|
||||
|
|
|
@ -355,7 +355,7 @@ FILE *ps2_fopen(const char *fname, const char *mode) {
|
|||
file = new Ps2McWriteFile((Ps2SaveFileManager *)g_systemPs2->getSavefileManager());
|
||||
if (file->open(fname + 4)) // + 4 to skip "mc0:"
|
||||
return (FILE *)file;
|
||||
|
||||
|
||||
delete file;
|
||||
return NULL;
|
||||
} else {
|
||||
|
|
|
@ -52,7 +52,7 @@ typedef struct _kbd_rawkey {
|
|||
#define PS2KBD_READMODE_RAW 2
|
||||
|
||||
/* Notes on read mode */
|
||||
/* In normal readmode (default) read multiples of 1 character off the keyboard file. These are
|
||||
/* In normal readmode (default) read multiples of 1 character off the keyboard file. These are
|
||||
processed by the keymaps so that you get back ASCII data */
|
||||
/* In raw readmode must read multiples of 2. First byte indicates state (i.e. Up or Down)
|
||||
Second byte is the USB key code for that key. This table is presented in the USB HID Usage Tables manaual
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# ____| | ____| | | |____|
|
||||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org>
|
||||
# Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org>
|
||||
# Licenced under Academic Free License version 2.0
|
||||
# Review ps2sdk README & LICENSE files for further details.
|
||||
#
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
|
||||
/* Default US keymap */
|
||||
|
||||
u8 us_keymap[PS2KBD_KEYMAP_SIZE] =
|
||||
{
|
||||
u8 us_keymap[PS2KBD_KEYMAP_SIZE] =
|
||||
{
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
|
@ -83,7 +83,7 @@ u8 us_keymap[PS2KBD_KEYMAP_SIZE] =
|
|||
0, // F5
|
||||
0, // F6
|
||||
0, // F7
|
||||
0, // F8
|
||||
0, // F8
|
||||
0, // F9
|
||||
0, // F10
|
||||
0, // F11
|
||||
|
@ -92,7 +92,7 @@ u8 us_keymap[PS2KBD_KEYMAP_SIZE] =
|
|||
0, // Scroll Lock
|
||||
0, // Pause
|
||||
0, // Insert
|
||||
0, // Home
|
||||
0, // Home
|
||||
0, // Pg Up
|
||||
0, // Delete
|
||||
0, // End
|
||||
|
@ -102,7 +102,7 @@ u8 us_keymap[PS2KBD_KEYMAP_SIZE] =
|
|||
0, // Down
|
||||
0, // Up
|
||||
0, // Numlock
|
||||
'/', // Keypad
|
||||
'/', // Keypad
|
||||
'*',
|
||||
'-',
|
||||
'+',
|
||||
|
@ -276,7 +276,7 @@ u8 us_keymap[PS2KBD_KEYMAP_SIZE] =
|
|||
0
|
||||
};
|
||||
|
||||
u8 us_shiftkeymap[PS2KBD_KEYMAP_SIZE] =
|
||||
u8 us_shiftkeymap[PS2KBD_KEYMAP_SIZE] =
|
||||
{
|
||||
0,
|
||||
0,
|
||||
|
@ -343,7 +343,7 @@ u8 us_shiftkeymap[PS2KBD_KEYMAP_SIZE] =
|
|||
0, // F5
|
||||
0, // F6
|
||||
0, // F7
|
||||
0, // F8
|
||||
0, // F8
|
||||
0, // F9
|
||||
0, // F10
|
||||
0, // F11
|
||||
|
@ -352,7 +352,7 @@ u8 us_shiftkeymap[PS2KBD_KEYMAP_SIZE] =
|
|||
0, // Scroll Lock
|
||||
0, // Pause
|
||||
0, // Insert
|
||||
0, // Home
|
||||
0, // Home
|
||||
0, // Pg Up
|
||||
0, // Delete
|
||||
0, // End
|
||||
|
@ -362,7 +362,7 @@ u8 us_shiftkeymap[PS2KBD_KEYMAP_SIZE] =
|
|||
0, // Down
|
||||
0, // Up
|
||||
0, // Numlock
|
||||
'/', // Keypad
|
||||
'/', // Keypad
|
||||
'*',
|
||||
'-',
|
||||
'+',
|
||||
|
@ -536,7 +536,7 @@ u8 us_shiftkeymap[PS2KBD_KEYMAP_SIZE] =
|
|||
0
|
||||
};
|
||||
|
||||
u8 us_keycap[PS2KBD_KEYMAP_SIZE] =
|
||||
u8 us_keycap[PS2KBD_KEYMAP_SIZE] =
|
||||
{
|
||||
0,
|
||||
0,
|
||||
|
@ -603,7 +603,7 @@ u8 us_keycap[PS2KBD_KEYMAP_SIZE] =
|
|||
0, // F5
|
||||
0, // F6
|
||||
0, // F7
|
||||
0, // F8
|
||||
0, // F8
|
||||
0, // F9
|
||||
0, // F10
|
||||
0, // F11
|
||||
|
@ -612,7 +612,7 @@ u8 us_keycap[PS2KBD_KEYMAP_SIZE] =
|
|||
0, // Scroll Lock
|
||||
0, // Pause
|
||||
0, // Insert
|
||||
0, // Home
|
||||
0, // Home
|
||||
0, // Pg Up
|
||||
0, // Delete
|
||||
0, // End
|
||||
|
@ -622,7 +622,7 @@ u8 us_keycap[PS2KBD_KEYMAP_SIZE] =
|
|||
0, // Down
|
||||
0, // Up
|
||||
0, // Numlock
|
||||
0, // Keypad
|
||||
0, // Keypad
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
|
@ -796,7 +796,7 @@ u8 us_keycap[PS2KBD_KEYMAP_SIZE] =
|
|||
0
|
||||
};
|
||||
|
||||
u8 us_special_keys[PS2KBD_KEYMAP_SIZE] = {
|
||||
u8 us_special_keys[PS2KBD_KEYMAP_SIZE] = {
|
||||
|
||||
0,
|
||||
0,
|
||||
|
@ -863,7 +863,7 @@ u8 us_special_keys[PS2KBD_KEYMAP_SIZE] = {
|
|||
5, // F5
|
||||
6, // F6
|
||||
7, // F7
|
||||
8, // F8
|
||||
8, // F8
|
||||
9, // F9
|
||||
10, // F10
|
||||
11, // F11
|
||||
|
@ -872,7 +872,7 @@ u8 us_special_keys[PS2KBD_KEYMAP_SIZE] = {
|
|||
33, // Scroll Lock
|
||||
34, // Pause
|
||||
35, // Insert
|
||||
36, // Home
|
||||
36, // Home
|
||||
37, // Pg Up
|
||||
38, // Delete
|
||||
39, // End
|
||||
|
@ -882,7 +882,7 @@ u8 us_special_keys[PS2KBD_KEYMAP_SIZE] = {
|
|||
43, // Down
|
||||
44, // Up
|
||||
0, // Numlock
|
||||
0, // Keypad /
|
||||
0, // Keypad /
|
||||
0, // Keypad *
|
||||
0, // Keypad -
|
||||
0, // Keypad +
|
||||
|
@ -1056,7 +1056,7 @@ u8 us_special_keys[PS2KBD_KEYMAP_SIZE] = {
|
|||
0
|
||||
};
|
||||
|
||||
u8 us_control_map[PS2KBD_KEYMAP_SIZE] = {
|
||||
u8 us_control_map[PS2KBD_KEYMAP_SIZE] = {
|
||||
|
||||
0,
|
||||
0,
|
||||
|
@ -1123,7 +1123,7 @@ u8 us_control_map[PS2KBD_KEYMAP_SIZE] = {
|
|||
0, // F5
|
||||
0, // F6
|
||||
0, // F7
|
||||
0, // F8
|
||||
0, // F8
|
||||
0, // F9
|
||||
0, // F10
|
||||
0, // F11
|
||||
|
@ -1132,7 +1132,7 @@ u8 us_control_map[PS2KBD_KEYMAP_SIZE] = {
|
|||
0, // Scroll Lock
|
||||
0, // Pause
|
||||
0, // Insert
|
||||
0, // Home
|
||||
0, // Home
|
||||
0, // Pg Up
|
||||
0, // Delete
|
||||
0, // End
|
||||
|
@ -1142,7 +1142,7 @@ u8 us_control_map[PS2KBD_KEYMAP_SIZE] = {
|
|||
0, // Down
|
||||
0, // Up
|
||||
0, // Numlock
|
||||
0, // Keypad
|
||||
0, // Keypad
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
|
@ -1316,7 +1316,7 @@ u8 us_control_map[PS2KBD_KEYMAP_SIZE] = {
|
|||
0
|
||||
};
|
||||
|
||||
u8 us_alt_map[PS2KBD_KEYMAP_SIZE] = {
|
||||
u8 us_alt_map[PS2KBD_KEYMAP_SIZE] = {
|
||||
|
||||
0,
|
||||
0,
|
||||
|
@ -1383,7 +1383,7 @@ u8 us_alt_map[PS2KBD_KEYMAP_SIZE] = {
|
|||
0, // F5
|
||||
0, // F6
|
||||
0, // F7
|
||||
0, // F8
|
||||
0, // F8
|
||||
0, // F9
|
||||
0, // F10
|
||||
0, // F11
|
||||
|
@ -1392,7 +1392,7 @@ u8 us_alt_map[PS2KBD_KEYMAP_SIZE] = {
|
|||
0, // Scroll Lock
|
||||
0, // Pause
|
||||
0, // Insert
|
||||
0, // Home
|
||||
0, // Home
|
||||
0, // Pg Up
|
||||
0, // Delete
|
||||
0, // End
|
||||
|
@ -1402,7 +1402,7 @@ u8 us_alt_map[PS2KBD_KEYMAP_SIZE] = {
|
|||
0, // Down
|
||||
0, // Up
|
||||
0, // Numlock
|
||||
0, // Keypad
|
||||
0, // Keypad
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
|
|
|
@ -74,7 +74,7 @@ BootDevice detectBootPath(const char *elfPath, char *bootPath) {
|
|||
device = OTHER;
|
||||
|
||||
sioprintf("elf path: %s, device %d\n", elfPath, device);
|
||||
|
||||
|
||||
strcpy(bootPath, elfPath);
|
||||
|
||||
char *pathPos = bootPath;
|
||||
|
@ -116,7 +116,7 @@ BootDevice detectBootPath(const char *elfPath, char *bootPath) {
|
|||
return device;
|
||||
}
|
||||
|
||||
int loadIrxModules(int device, const char *irxPath, IrxReference **modules) {
|
||||
int loadIrxModules(int device, const char *irxPath, IrxReference **modules) {
|
||||
|
||||
IrxReference *resModules = (IrxReference *)malloc(numIrxFiles * sizeof(IrxReference));
|
||||
IrxReference *curModule = resModules;
|
||||
|
|
|
@ -193,7 +193,7 @@ Ps2SaveFileManager::Ps2SaveFileManager(OSystem_PS2 *system, Gs2dScreen *screen)
|
|||
|
||||
saveThread.initial_priority = thisThread.current_priority + 1;
|
||||
saveThread.stack_size = 8 * 1024;
|
||||
_autoSaveStack = malloc(saveThread.stack_size);
|
||||
_autoSaveStack = malloc(saveThread.stack_size);
|
||||
saveThread.stack = _autoSaveStack;
|
||||
saveThread.func = (void *)runSaveThread;
|
||||
saveThread.gp_reg = &_gp;
|
||||
|
@ -409,7 +409,7 @@ Common::StringList Ps2SaveFileManager::listSavefiles(const char *regex) {
|
|||
_mcNeedsUpdate = true;
|
||||
|
||||
mcTable *mcEntries = (mcTable*)memalign(64, sizeof(mcTable) * MAX_MC_ENTRIES);
|
||||
|
||||
|
||||
char temp[256], mcSearchStr[256], *dir, *ext;
|
||||
strcpy(temp, regex);
|
||||
dir = strdup(strtok(temp, "."));
|
||||
|
@ -451,7 +451,7 @@ bool Ps2SaveFileManager::removeSavefile(const char *filename) {
|
|||
|
||||
char dir[64], name[64], fullPath[128];
|
||||
|
||||
splitPath(filename, dir, name);
|
||||
splitPath(filename, dir, name);
|
||||
sprintf(fullPath, "/ScummVM-%s/%s", dir, name);
|
||||
|
||||
int res = _mc->remove(fullPath);
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
int read(int fd, void *buf, int size);
|
||||
int write(int fd, const void *buf, int size);
|
||||
int mkDir(const char *name);
|
||||
int getDir(const char *name, unsigned int mode, int max, void *dest);
|
||||
int getDir(const char *name, unsigned int mode, int max, void *dest);
|
||||
int getInfo(int *type, int *free, int *format);
|
||||
int remove(const char *name);
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ void OSystem_PS2::startIrxModules(int numModules, IrxReference *modules) {
|
|||
}
|
||||
} else
|
||||
sioprintf("Module \"%s\" wasn't found: %d\n", modules[i].path, modules[i].errorCode);
|
||||
|
||||
|
||||
if ((modules[i].errorCode < 0) || (res < 0) || (rv < 0)) {
|
||||
if (!(modules[i].fileRef->flags & OPTIONAL)) {
|
||||
if (modules[i].errorCode < 0)
|
||||
|
@ -208,7 +208,7 @@ void OSystem_PS2::startIrxModules(int numModules, IrxReference *modules) {
|
|||
quit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (modules[i].buffer)
|
||||
free(modules[i].buffer);
|
||||
} else {
|
||||
|
@ -283,7 +283,7 @@ OSystem_PS2::OSystem_PS2(const char *elfPath) {
|
|||
|
||||
hddPreparePoweroff();
|
||||
//poweroffInit();
|
||||
dbg_printf("romeo : hddPreparePoweroff done\n");
|
||||
dbg_printf("romeo : hddPreparePoweroff done\n");
|
||||
|
||||
hddSetUserPoweroffCallback(gluePowerOffCallback, this);
|
||||
//poweroffSetCallback(gluePowerOffCallback, this);
|
||||
|
@ -464,7 +464,7 @@ bool OSystem_PS2::hddPresent(void) {
|
|||
}
|
||||
|
||||
bool OSystem_PS2::usbMassPresent(void) {
|
||||
|
||||
|
||||
if (_usbMassLoaded) {
|
||||
int testFd = fio.dopen("mass:/");
|
||||
if (testFd >= 0)
|
||||
|
@ -670,7 +670,7 @@ void OSystem_PS2::msgPrintf(int millis, char *format, ...) {
|
|||
while ((*lnEnd) && (*lnEnd != '\n'))
|
||||
lnEnd++;
|
||||
*lnEnd = '\0';
|
||||
|
||||
|
||||
Common::String str(lnSta);
|
||||
int width = Graphics::g_sysfont.getStringWidth(str);
|
||||
if (width > maxWidth)
|
||||
|
|
|
@ -99,7 +99,7 @@ OSystem_PSP::~OSystem_PSP() {
|
|||
|
||||
void OSystem_PSP::initBackend() {
|
||||
_savefile = new PSPSaveFileManager;
|
||||
|
||||
|
||||
_timer = new DefaultTimerManager();
|
||||
setTimerCallback(&timer_handler, 10);
|
||||
|
||||
|
@ -614,7 +614,7 @@ void OSystem_PSP::setupMixer(void) {
|
|||
// least on some platforms SDL will lie and claim it did get the rate
|
||||
// even if it didn't. Probably only happens for "weird" rates, though.
|
||||
_samplesPerSec = obtained.freq;
|
||||
|
||||
|
||||
// Tell the mixer that we are ready and start the sound processing
|
||||
_mixer->setOutputRate(_samplesPerSec);
|
||||
_mixer->setReady(true);
|
||||
|
|
|
@ -96,7 +96,7 @@ OSystem_PSP_GU::OSystem_PSP_GU() {
|
|||
keyboard_letters = (unsigned char *)memalign(16, KBD_DATA_SIZE);
|
||||
if (Z_OK != uncompress((Bytef *)keyboard_letters, &kbdSize, (const Bytef *)keyboard_letters_compressed, size_keyboard_letters_compressed))
|
||||
error("OSystem_PSP_GU: uncompressing keyboard_letters failed");
|
||||
|
||||
|
||||
kbdSize = KBD_DATA_SIZE;
|
||||
keyboard_letters_shift = (unsigned char *)memalign(16, KBD_DATA_SIZE);
|
||||
if (Z_OK != uncompress((Bytef *)keyboard_letters_shift, &kbdSize, (const Bytef *)keyboard_letters_shift_compressed, size_keyboard_letters_shift_compressed))
|
||||
|
|
|
@ -301,7 +301,7 @@ void OSystem_SDL::setGraphicsModeIntern() {
|
|||
}
|
||||
|
||||
_scalerProc = newScalerProc;
|
||||
|
||||
|
||||
if (_videoMode.mode != GFX_NORMAL) {
|
||||
for (int i = 0; i < ARRAYSIZE(s_gfxModeSwitchTable); i++) {
|
||||
if (s_gfxModeSwitchTable[i][1] == _videoMode.mode || s_gfxModeSwitchTable[i][2] == _videoMode.mode) {
|
||||
|
@ -742,7 +742,7 @@ bool OSystem_SDL::saveScreenshot(const char *filename) {
|
|||
|
||||
void OSystem_SDL::setFullscreenMode(bool enable) {
|
||||
Common::StackLock lock(_graphicsMutex);
|
||||
|
||||
|
||||
if (_oldVideoMode.setup && _oldVideoMode.fullscreen == enable)
|
||||
return;
|
||||
|
||||
|
|
|
@ -378,7 +378,7 @@ protected:
|
|||
SDL_Thread *_soundThread;
|
||||
bool _soundThreadIsRunning;
|
||||
bool _soundThreadShouldQuit;
|
||||
|
||||
|
||||
byte _activeSoundBuf;
|
||||
uint _soundBufSize;
|
||||
byte *_soundBuffers[2];
|
||||
|
|
|
@ -178,7 +178,7 @@ void SymbianActions::initInstanceGame() {
|
|||
// Skip text
|
||||
if (!is_cine && !is_parallaction)
|
||||
_action_enabled[ACTION_SKIP_TEXT] = true;
|
||||
if (is_simon || is_sky || is_sword2 || is_queen || is_sword1 || is_gob ||
|
||||
if (is_simon || is_sky || is_sword2 || is_queen || is_sword1 || is_gob ||
|
||||
is_saga || is_kyra || is_touche || is_lure || is_feeble || is_drascula)
|
||||
_key_action[ACTION_SKIP_TEXT].setKey(Common::KEYCODE_ESCAPE, Common::KEYCODE_ESCAPE); // Escape key
|
||||
else {
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include <eikenv.h> // for CEikonEnv::Static() @ Symbian::FatalError()
|
||||
#include <sdlapp.h> // for CSDLApp::GetExecutablePathCStr() @ Symbian::GetExecutablePath()
|
||||
#include <bautils.h>
|
||||
|
||||
|
||||
#include "backends/fs/symbian/symbian-fs-factory.h"
|
||||
#include "backends/platform/symbian/src/SymbianOS.h"
|
||||
#include "backends/platform/symbian/src/SymbianActions.h"
|
||||
|
@ -156,7 +156,7 @@ void OSystem_SDL_Symbian::initBackend() {
|
|||
// If savepath has not already been set then set it
|
||||
if (!ConfMan.hasKey("savepath")) {
|
||||
ConfMan.set("savepath", savePath);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Ensure that the current set path (might have been altered by the user) exists
|
||||
|
@ -164,7 +164,7 @@ void OSystem_SDL_Symbian::initBackend() {
|
|||
TFileName fname;
|
||||
TPtrC8 ptr((const unsigned char*)currentPath.c_str(),currentPath.size());
|
||||
fname.Copy(ptr);
|
||||
BaflUtils::EnsurePathExistsL(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), fname);
|
||||
BaflUtils::EnsurePathExistsL(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), fname);
|
||||
|
||||
ConfMan.setBool("FM_high_quality", false);
|
||||
#if !defined(S60) || defined(S60V3) // S60 has low quality as default
|
||||
|
@ -268,12 +268,12 @@ void OSystem_SDL_Symbian::setupMixer() {
|
|||
// even if it didn't. Probably only happens for "weird" rates, though.
|
||||
_samplesPerSec = obtained.freq;
|
||||
_channels = obtained.channels;
|
||||
|
||||
|
||||
// Need to create mixbuffer for stereo mix to downmix
|
||||
if (_channels != 2) {
|
||||
_stereo_mix_buffer = new byte [obtained.size*2];//*2 for stereo values
|
||||
}
|
||||
|
||||
|
||||
// Tell the mixer that we are ready and start the sound processing
|
||||
_mixer->setOutputRate(_samplesPerSec);
|
||||
_mixer->setReady(true);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*
|
||||
* This is the vsnprintf for scummvm/symbian implementation from the original snprintf.c,
|
||||
* This is the vsnprintf for scummvm/symbian implementation from the original snprintf.c,
|
||||
* all support functions has been removed and vsnprintf renamed to symbian_vsnprintf
|
||||
* snprintf.c - a portable implementation of snprintf
|
||||
* According to the homepage this function could be licensed as either Frontier Aritistic or GPL.
|
||||
*
|
||||
*
|
||||
* AUTHOR
|
||||
* Mark Martinec <mark.martinec@ijs.si>, April 1999.
|
||||
*
|
||||
|
@ -230,14 +230,14 @@ static char credits[] = "\n\
|
|||
@(#)snprintf.c, v2.2: Copyright 1999, Mark Martinec. Frontier Artistic License applies.\n\
|
||||
@(#)snprintf.c, v2.2: http://www.ijs.si/software/snprintf/\n";
|
||||
int symbian_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) {
|
||||
|
||||
|
||||
size_t str_l = 0;
|
||||
const char *p = fmt;
|
||||
|
||||
|
||||
/* In contrast with POSIX, the ISO C99 now says
|
||||
* that str can be NULL and str_m can be 0.
|
||||
* This is more useful than the old: if (str_m < 1) return -1; */
|
||||
|
||||
|
||||
if (!p) p = "";
|
||||
while (*p) {
|
||||
if (*p != '%') {
|
||||
|
@ -260,7 +260,7 @@ int symbian_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) {
|
|||
the ' ' flag should be ignored. */
|
||||
char length_modifier = '\0'; /* allowed values: \0, h, l, L */
|
||||
char tmp[32];/* temporary buffer for simple numeric->string conversion */
|
||||
|
||||
|
||||
const char *str_arg; /* string address in case of string argument */
|
||||
size_t str_arg_l; /* natural field width of arg without padding
|
||||
and sign */
|
||||
|
@ -268,17 +268,17 @@ int symbian_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) {
|
|||
/* unsigned char argument value - only defined for c conversion.
|
||||
N.B. standard explicitly states the char argument for
|
||||
the c conversion is unsigned */
|
||||
|
||||
|
||||
size_t number_of_zeros_to_pad = 0;
|
||||
/* number of zeros to be inserted for numeric conversions
|
||||
as required by the precision or minimal field width */
|
||||
|
||||
|
||||
size_t zero_padding_insertion_ind = 0;
|
||||
/* index into tmp where zero padding is to be inserted */
|
||||
|
||||
|
||||
char fmt_spec = '\0';
|
||||
/* current conversion specifier character */
|
||||
|
||||
|
||||
str_arg = credits;/* just to make compiler happy (defined but not used)*/
|
||||
str_arg = NULL;
|
||||
starting_p = p; p++; /* skip '%' */
|
||||
|
@ -298,7 +298,7 @@ int symbian_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) {
|
|||
p++;
|
||||
}
|
||||
/* If the '0' and '-' flags both appear, the '0' flag should be ignored. */
|
||||
|
||||
|
||||
/* parse field width */
|
||||
if (*p == '*') {
|
||||
int j;
|
||||
|
@ -397,21 +397,21 @@ int symbian_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) {
|
|||
case 'd': case 'u': case 'o': case 'x': case 'X': case 'p': {
|
||||
/* NOTE: the u, o, x, X and p conversion specifiers imply
|
||||
the value is unsigned; d implies a signed value */
|
||||
|
||||
|
||||
int arg_sign = 0;
|
||||
/* 0 if numeric argument is zero (or if pointer is NULL for 'p'),
|
||||
+1 if greater than zero (or nonzero for unsigned arguments),
|
||||
-1 if negative (unsigned argument is never negative) */
|
||||
|
||||
|
||||
int int_arg = 0; unsigned int uint_arg = 0;
|
||||
/* only defined for length modifier h, or for no length modifiers */
|
||||
|
||||
|
||||
long int long_arg = 0; unsigned long int ulong_arg = 0;
|
||||
/* only defined for length modifier l */
|
||||
|
||||
|
||||
void *ptr_arg = NULL;
|
||||
/* pointer argument value -only defined for p conversion */
|
||||
|
||||
|
||||
#ifdef SNPRINTF_LONGLONG_SUPPORT
|
||||
long long int long_long_arg = 0;
|
||||
unsigned long long int ulong_long_arg = 0;
|
||||
|
@ -554,7 +554,7 @@ int symbian_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) {
|
|||
}
|
||||
}
|
||||
/* zero padding to specified precision? */
|
||||
if (num_of_digits < precision)
|
||||
if (num_of_digits < precision)
|
||||
number_of_zeros_to_pad = precision - num_of_digits;
|
||||
}
|
||||
/* zero padding to specified minimal field width? */
|
||||
|
@ -659,10 +659,10 @@ int symbian_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) {
|
|||
int symbian_snprintf(char *text, size_t maxlen, const char *fmt, ...) {
|
||||
va_list ap;
|
||||
int retval;
|
||||
|
||||
|
||||
va_start(ap, fmt);
|
||||
retval = symbian_vsnprintf(text, maxlen, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* Generic GX Scaler
|
||||
* Generic GX Scaler
|
||||
* softdev 2007
|
||||
* dhewg 2008
|
||||
*
|
||||
|
|
|
@ -93,7 +93,7 @@ OSystem_Wii::~OSystem_Wii() {
|
|||
|
||||
void OSystem_Wii::initBackend() {
|
||||
_startup_time = gettime();
|
||||
|
||||
|
||||
char buf[MAXPATHLEN];
|
||||
if (!getcwd(buf, MAXPATHLEN))
|
||||
strcpy(buf, "/");
|
||||
|
|
|
@ -291,7 +291,7 @@ void OSystem_Wii::updateScreen() {
|
|||
|
||||
if (_mouseVisible) {
|
||||
msx = _mouseX - _mouseHotspotX;
|
||||
msy = _mouseY - _mouseHotspotY;
|
||||
msy = _mouseY - _mouseHotspotY;
|
||||
mox = 0;
|
||||
moy = 0;
|
||||
mpx = _mouseWidth;
|
||||
|
|
|
@ -134,7 +134,7 @@ void CEActionsPocket::initInstanceGame() {
|
|||
GUI_Actions::initInstanceGame();
|
||||
|
||||
// See if a right click mapping could be needed
|
||||
if (is_sword1 || is_sword2 || is_sky || is_queen || is_comi || is_gob ||
|
||||
if (is_sword1 || is_sword2 || is_sky || is_queen || is_comi || is_gob ||
|
||||
is_samnmax || is_cine || is_touche || is_parallaction || is_drascula)
|
||||
_right_click_needed = true;
|
||||
|
||||
|
@ -173,7 +173,7 @@ void CEActionsPocket::initInstanceGame() {
|
|||
// Skip
|
||||
if (!is_cine && !is_parallaction)
|
||||
_action_enabled[POCKET_ACTION_SKIP] = true;
|
||||
if (is_simon || is_sky || is_sword2 || is_queen || is_sword1 || is_gob ||
|
||||
if (is_simon || is_sky || is_sword2 || is_queen || is_sword1 || is_gob ||
|
||||
is_saga || is_kyra || is_touche || is_lure || is_feeble || is_drascula)
|
||||
_key_action[POCKET_ACTION_SKIP].setKey(VK_ESCAPE);
|
||||
else
|
||||
|
|
|
@ -460,7 +460,7 @@ static Common::String getDefaultConfigFileName() {
|
|||
strcpy(configFile, getcwd(NULL, MAX_PATH));
|
||||
strcat(configFile, "\\");
|
||||
strcat(configFile, DEFAULT_CONFIG_FILE);
|
||||
return configFile;
|
||||
return configFile;
|
||||
}
|
||||
|
||||
Common::SeekableReadStream *OSystem_WINCE3::openConfigFileForReading() {
|
||||
|
@ -1377,7 +1377,7 @@ bool OSystem_WINCE3::loadGFXMode() {
|
|||
if (_hwscreen == NULL) {
|
||||
warning("SDL_SetVideoMode says we can't switch to that mode (%s)", SDL_GetError());
|
||||
quit();
|
||||
}
|
||||
}
|
||||
|
||||
// see what orientation sdl finally accepted
|
||||
if (_hwscreen->flags & SDL_PORTRTVIDEO)
|
||||
|
@ -1441,8 +1441,8 @@ bool OSystem_WINCE3::loadGFXMode() {
|
|||
_km.y_max = _videoMode.screenHeight * _scaleFactorXm / _scaleFactorXd - 1;
|
||||
_km.delay_time = 25;
|
||||
_km.last_time = 0;
|
||||
|
||||
return true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void OSystem_WINCE3::unloadGFXMode() {
|
||||
|
|
|
@ -203,7 +203,7 @@ private:
|
|||
bool _zoomUp; // zooming up mode
|
||||
bool _zoomDown; // zooming down mode
|
||||
|
||||
bool _noDoubleTapRMB; // disable double tap -> rmb click
|
||||
bool _noDoubleTapRMB; // disable double tap -> rmb click
|
||||
bool _rbutton; // double tap -> right button simulation
|
||||
bool _closeClick; // flag when taps are spatially close together
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ bool DefaultSaveFileManager::removeSavefile(const char *filename) {
|
|||
return false;
|
||||
|
||||
Common::FSNode file = savePath.getChild(filename);
|
||||
|
||||
|
||||
// FIXME: remove does not exist on all systems. If your port fails to
|
||||
// compile because of this, please let us know (scummvm-devel or Fingolfin).
|
||||
// There is a nicely portable workaround, too: Make this method overloadable.
|
||||
|
|
|
@ -53,7 +53,7 @@ POSIXSaveFileManager::POSIXSaveFileManager() {
|
|||
}
|
||||
}
|
||||
/*
|
||||
POSIXSaveFileManager::POSIXSaveFileManager(const Common::String &defaultSavepath)
|
||||
POSIXSaveFileManager::POSIXSaveFileManager(const Common::String &defaultSavepath)
|
||||
: DefaultSaveFileManager(defaultSavepath) {
|
||||
}
|
||||
*/
|
||||
|
|
|
@ -39,7 +39,7 @@ PSPSaveFileManager::PSPSaveFileManager() {
|
|||
ConfMan.registerDefault("savepath", PSP_DEFAULT_SAVE_PATH);
|
||||
}
|
||||
/*
|
||||
PSPSaveFileManager::PSPSaveFileManager(const Common::String &defaultSavepath)
|
||||
PSPSaveFileManager::PSPSaveFileManager(const Common::String &defaultSavepath)
|
||||
: DefaultSaveFileManager(defaultSavepath) {
|
||||
}
|
||||
*/
|
||||
|
|
|
@ -223,7 +223,7 @@ public:
|
|||
* @return pointer to the stream object, 0 in case of a failure
|
||||
*/
|
||||
virtual WriteStream *openForWriting() const;
|
||||
|
||||
|
||||
// Compatibility with ArchiveMember API.
|
||||
SeekableReadStream *open() {
|
||||
return openForReading();
|
||||
|
|
|
@ -1442,7 +1442,7 @@ Common::SeekableReadStream *ZipArchive::openFile(const Common::String &name) {
|
|||
unzReadCurrentFile(_zipFile, buffer, fileInfo.uncompressed_size);
|
||||
unzCloseCurrentFile(_zipFile);
|
||||
return new Common::MemoryReadStream(buffer, fileInfo.uncompressed_size+1, true);
|
||||
|
||||
|
||||
// FIXME: instead of reading all into a memory stream, we could
|
||||
// instead create a new ZipStream class. But then we have to be
|
||||
// careful to handle the case where the client code opens multiple
|
||||
|
|
|
@ -2186,7 +2186,7 @@ SaveStateList AgiMetaEngine::listSaves(const char *target) const {
|
|||
for (Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
|
||||
// Obtain the last 3 digits of the filename, since they correspond to the save slot
|
||||
int slotNum = atoi(file->c_str() + file->size() - 3);
|
||||
|
||||
|
||||
if (slotNum >= 0 && slotNum <= 999) {
|
||||
Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str());
|
||||
if (in) {
|
||||
|
@ -2250,7 +2250,7 @@ SaveStateDescriptor AgiMetaEngine::querySaveMetaInfos(const char *target, int sl
|
|||
int year = saveDate & 0xFFFF;
|
||||
|
||||
desc.setSaveDate(year, month, day);
|
||||
|
||||
|
||||
int hour = (saveTime >> 8) & 0xFF;
|
||||
int minutes = saveTime & 0xFF;
|
||||
|
||||
|
@ -2264,7 +2264,7 @@ SaveStateDescriptor AgiMetaEngine::querySaveMetaInfos(const char *target, int sl
|
|||
|
||||
return desc;
|
||||
}
|
||||
|
||||
|
||||
return SaveStateDescriptor();
|
||||
}
|
||||
|
||||
|
@ -2414,8 +2414,8 @@ const Common::ADGameDescription *AgiMetaEngine::fallbackDetect(const Common::FSL
|
|||
// Check if we found a match with any of the fallback methods
|
||||
if (matchedUsingWag || matchedUsingFilenames) {
|
||||
_extra = description + (!_extra.empty() ? " " : "") + _extra; // Let's combine the description and extra
|
||||
|
||||
// Override the gameid & extra values in g_fallbackDesc.desc. This only works
|
||||
|
||||
// Override the gameid & extra values in g_fallbackDesc.desc. This only works
|
||||
// until the fallback detector is called again, and while the MetaEngine instance
|
||||
// is alive (as else the string storage is modified/deleted).
|
||||
g_fallbackDesc.desc.gameid = _gameid.c_str();
|
||||
|
@ -2454,11 +2454,11 @@ Common::Error AgiBase::saveGameState(int slot, const char *desc) {
|
|||
return Common::kNoError; // TODO: return success/failure
|
||||
}
|
||||
|
||||
bool AgiBase::canLoadGameStateCurrently() {
|
||||
bool AgiBase::canLoadGameStateCurrently() {
|
||||
return (!(getGameType() == GType_PreAGI) && getflag(fMenusWork));
|
||||
}
|
||||
|
||||
bool AgiBase::canSaveGameStateCurrently() {
|
||||
bool AgiBase::canSaveGameStateCurrently() {
|
||||
return (!(getGameType() == GType_PreAGI) && getflag(fMenusWork));
|
||||
}
|
||||
|
||||
|
|
|
@ -230,7 +230,7 @@ uint8 *AgiLoader_v3::loadVolRes(AgiDir *agid) {
|
|||
debugC(3, kDebugLevelResources, "offset = %d", agid->offset);
|
||||
debugC(3, kDebugLevelResources, "x = %x %x", x[0], x[1]);
|
||||
error("ACK! BAD RESOURCE");
|
||||
|
||||
|
||||
_vm->quitGame();
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
* Version 1 (Sarien): view table has 256 entries (needed in KQ3)
|
||||
* Version 2 (ScummVM): first ScummVM version
|
||||
* Version 3 (ScummVM): added AGIPAL save/load support
|
||||
* Version 4 (ScummVM): added thumbnails and save creation date/time
|
||||
* Version 4 (ScummVM): added thumbnails and save creation date/time
|
||||
*/
|
||||
|
||||
namespace Agi {
|
||||
|
|
|
@ -555,7 +555,7 @@ Common::Error AGOSEngine::init() {
|
|||
// Setup midi driver
|
||||
int midiDriver = MidiDriver::detectMusicDriver(MDT_ADLIB | MDT_MIDI);
|
||||
_nativeMT32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32"));
|
||||
|
||||
|
||||
_driver = MidiDriver::createMidi(midiDriver);
|
||||
|
||||
if (_nativeMT32) {
|
||||
|
@ -890,7 +890,7 @@ AGOSEngine::~AGOSEngine() {
|
|||
free(_tablesHeapPtr - _tablesHeapCurPos);
|
||||
|
||||
free(_mouseData);
|
||||
|
||||
|
||||
free(_gameOffsetsPtr);
|
||||
free(_iconFilePtr);
|
||||
free(_itemArrayPtr);
|
||||
|
@ -1029,7 +1029,7 @@ Common::Error AGOSEngine::go() {
|
|||
|
||||
|
||||
/* I do not think that this will be used
|
||||
*
|
||||
*
|
||||
void AGOSEngine::shutdown() {
|
||||
// Sync with AGOSEngine::~AGOSEngine()
|
||||
// In Simon 2, this gets deleted along with _sound further down
|
||||
|
|
|
@ -102,7 +102,7 @@ static const Common::ADParams detectionParams = {
|
|||
class AgosMetaEngine : public Common::AdvancedMetaEngine {
|
||||
public:
|
||||
AgosMetaEngine() : Common::AdvancedMetaEngine(detectionParams) {}
|
||||
|
||||
|
||||
virtual const char *getName() const {
|
||||
return "AGOS";
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ public:
|
|||
virtual const char *getCopyright() const {
|
||||
return "AGOS (C) Adventure Soft";
|
||||
}
|
||||
|
||||
|
||||
virtual bool hasFeature(MetaEngineFeature f) const;
|
||||
virtual bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const;
|
||||
virtual SaveStateList listSaves(const char *target) const;
|
||||
|
|
|
@ -58,7 +58,7 @@ public:
|
|||
BaseSound(Audio::Mixer *mixer, File *file, uint32 *offsets, bool bigEndian = false);
|
||||
virtual ~BaseSound();
|
||||
void close();
|
||||
|
||||
|
||||
void playSound(uint sound, Audio::Mixer::SoundType type, Audio::SoundHandle *handle, byte flags, int vol = 0) {
|
||||
playSound(sound, sound, type, handle, flags, vol);
|
||||
}
|
||||
|
@ -563,7 +563,7 @@ void Sound::readSfxFile(const char *filename) {
|
|||
|
||||
void Sound::loadSfxTable(File *gameFile, uint32 base) {
|
||||
stopAll();
|
||||
|
||||
|
||||
if (_effects)
|
||||
_effects->close();
|
||||
|
||||
|
|
|
@ -541,7 +541,7 @@ int AGOSEngine::startSubroutine(Subroutine *sub) {
|
|||
error("Recursion error");
|
||||
|
||||
// WORKAROUND: If the game is saved, right after Simon is thrown in the dungeon of Sordid's Fortress of Doom,
|
||||
// the saved game fails to load correctly. When loading the saved game, the sequence of Simon waking is started,
|
||||
// the saved game fails to load correctly. When loading the saved game, the sequence of Simon waking is started,
|
||||
// before the scene is actually reloaded, due to a script bug. We manually add the extra script code from DOS CD
|
||||
// release, which fixed this particular script bug.
|
||||
if (getGameType() == GType_SIMON2 && !(getFeatures() & GF_TALKIE) && sub->id == 12101) {
|
||||
|
|
|
@ -138,7 +138,7 @@ void AGOSEngine::vc22_setPaletteNew() {
|
|||
palptr[3] = 0;
|
||||
|
||||
palptr += 4;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
_paletteFlag = 2;
|
||||
|
|
|
@ -585,7 +585,7 @@ int loadAni(const char *resourceName, int16 idx) {
|
|||
|
||||
transparentColor = getAnimTransparentColor(resourceName);
|
||||
|
||||
// TODO: Merge this special case hack into getAnimTransparentColor somehow.
|
||||
// TODO: Merge this special case hack into getAnimTransparentColor somehow.
|
||||
// HACK: Versions of TITRE.ANI with height 37 use color 0xF for transparency.
|
||||
// Versions of TITRE.ANI with height 57 use color 0x0 for transparency.
|
||||
// Fixes bug #2057619: FW: Glitches in title display of demo (regression).
|
||||
|
|
|
@ -98,7 +98,7 @@ void loadBgIncrustFromSave(Common::SeekableReadStream &fHandle) {
|
|||
tmp.y = fHandle.readUint16BE();
|
||||
tmp.frame = fHandle.readUint16BE();
|
||||
tmp.part = fHandle.readUint16BE();
|
||||
|
||||
|
||||
bgIncrustList.push_back(tmp);
|
||||
|
||||
if (tmp.param == 0) {
|
||||
|
|
|
@ -98,7 +98,7 @@ Common::Error CineEngine::go() {
|
|||
delete renderer;
|
||||
delete[] collisionPage;
|
||||
delete g_sound;
|
||||
|
||||
|
||||
return Common::kNoError;
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ void CineEngine::initialize() {
|
|||
Common::set_to(zoneData.begin(), zoneData.end(), 0);
|
||||
|
||||
// Resize zone query table to its correct size and reset all its elements
|
||||
zoneQuery.resize(NUM_MAX_ZONE);
|
||||
zoneQuery.resize(NUM_MAX_ZONE);
|
||||
Common::set_to(zoneQuery.begin(), zoneQuery.end(), 0);
|
||||
|
||||
_timerDelayMultiplier = 12; // Set default speed
|
||||
|
|
|
@ -589,7 +589,7 @@ SaveStateList CineMetaEngine::listSaves(const char *target) const {
|
|||
if (pos < (sizeof(saveDesc) - 1)) {
|
||||
if (ch < 32 || in->eos()) {
|
||||
saveDesc[pos++] = '\0';
|
||||
}
|
||||
}
|
||||
else if (ch >= 32) {
|
||||
saveDesc[pos++] = ch;
|
||||
}
|
||||
|
@ -697,11 +697,11 @@ Common::Error CineEngine::saveGameState(int slot, const char *desc) {
|
|||
return Common::kNoError;
|
||||
}
|
||||
|
||||
bool CineEngine::canLoadGameStateCurrently() {
|
||||
bool CineEngine::canLoadGameStateCurrently() {
|
||||
return (!disableSystemMenu && !inMenu);
|
||||
}
|
||||
|
||||
bool CineEngine::canSaveGameStateCurrently() {
|
||||
bool CineEngine::canSaveGameStateCurrently() {
|
||||
return (allowPlayerInput && !disableSystemMenu && !inMenu);
|
||||
}
|
||||
|
||||
|
|
|
@ -329,7 +329,7 @@ void FWRenderer::drawPlainBox(int x, int y, int width, int height, byte color) {
|
|||
Common::Rect screenRect(320, 200);
|
||||
boxRect.clip(screenRect);
|
||||
|
||||
// Draw the filled rectangle
|
||||
// Draw the filled rectangle
|
||||
byte *dest = _backBuffer + boxRect.top * 320 + boxRect.left;
|
||||
for (int i = 0; i < boxRect.height(); i++) {
|
||||
memset(dest + i * 320, color, boxRect.width());
|
||||
|
@ -1092,7 +1092,7 @@ void OSRenderer::renderOverlay(const Common::List<overlay>::iterator &it) {
|
|||
}
|
||||
|
||||
_messageLen += messageTable[it->objIdx].size();
|
||||
drawMessage(messageTable[it->objIdx].c_str(), it->x, it->y, it->width, it->color);
|
||||
drawMessage(messageTable[it->objIdx].c_str(), it->x, it->y, it->width, it->color);
|
||||
if (it->color >= 0) { // This test isn't in Future Wars's implementation
|
||||
waitForPlayerClick = 1;
|
||||
}
|
||||
|
|
|
@ -265,7 +265,7 @@ void CineEngine::mainLoop(int bootScriptIdx) {
|
|||
|
||||
errorVar = 0;
|
||||
|
||||
addScriptToGlobalScripts(bootScriptIdx);
|
||||
addScriptToGlobalScripts(bootScriptIdx);
|
||||
|
||||
menuVar = 0;
|
||||
|
||||
|
@ -337,7 +337,7 @@ void CineEngine::mainLoop(int bootScriptIdx) {
|
|||
|
||||
stopMusicAfterFadeOut();
|
||||
di = executePlayerInput();
|
||||
|
||||
|
||||
// Clear the zoneQuery table (Operation Stealth specific)
|
||||
if (g_cine->getGameType() == Cine::GType_OS) {
|
||||
Common::set_to(zoneQuery.begin(), zoneQuery.end(), 0);
|
||||
|
|
|
@ -57,7 +57,7 @@ void loadMsg(char *pMsgName) {
|
|||
// buffer (e.g. message indexes 58-254 in BATEAU.MSG in PROCS08 in Operation Stealth).
|
||||
if (messageDataPos < sourceSize) {
|
||||
messageTable.push_back((const char *)(dataPtr + messageDataPos));
|
||||
} else {
|
||||
} else {
|
||||
if (messageLen > 0) { // Only warn about overflowing non-empty strings
|
||||
warning("loadMsg(%s): message (%d. / %d) is overflowing the input buffer. Replacing it with an empty string", pMsgName, i + 1, count);
|
||||
} else {
|
||||
|
|
|
@ -44,7 +44,7 @@ void loadPal(const char *fileName) {
|
|||
if (!palFileHandle.open(buffer))
|
||||
error("loadPal(): Cannot open file %s", fileName);
|
||||
|
||||
uint16 palEntriesCount = palFileHandle.readUint16LE();
|
||||
uint16 palEntriesCount = palFileHandle.readUint16LE();
|
||||
palFileHandle.readUint16LE(); // entry size
|
||||
|
||||
palArray.resize(palEntriesCount);
|
||||
|
|
|
@ -80,7 +80,7 @@ static Common::String fixVolCnfFileName(const uint8 *src, uint len) {
|
|||
// so that's why we have to convert them first. There's no trailing zero in them
|
||||
// either and they're always of the full length 11 with padding spaces. Extension
|
||||
// can be always found at offset 8 onwards.
|
||||
//
|
||||
//
|
||||
// Examples of filename mappings:
|
||||
// "AEROPORTMSG" -> "AEROPORT.MSG"
|
||||
// "MITRAILLHP " -> "MITRAILL.HP" (Notice the trailing space after the extension)
|
||||
|
@ -160,7 +160,7 @@ void CineEngine::readVolCnf() {
|
|||
// US Amiga release. It uses a compressed 'vol.cnf' file but still uses
|
||||
// file names of length 13. So we try to deduce the file name length from
|
||||
// the data in the 'vol.cnf' file.
|
||||
int fileNameLength;
|
||||
int fileNameLength;
|
||||
if (fileNameLenMod11 != fileNameLenMod13) {
|
||||
// All file name blocks' sizes were divisible by either 11 or 13, but not with both.
|
||||
fileNameLength = (fileNameLenMod11 ? 11 : 13);
|
||||
|
|
|
@ -103,7 +103,7 @@ enum CineSaveGameFormat detectSaveGameFormat(Common::SeekableReadStream &fHandle
|
|||
overlayEntrySize,
|
||||
bgIncrustEntrySize
|
||||
};
|
||||
|
||||
|
||||
uint animEntrySize = animEntrySizeChoices[i];
|
||||
// Jump over the animDataTable entries and the screen parameters
|
||||
int32 newPos = animDataTableStart + animEntrySize * animEntriesCount + sizeofScreenParams;
|
||||
|
@ -128,7 +128,7 @@ enum CineSaveGameFormat detectSaveGameFormat(Common::SeekableReadStream &fHandle
|
|||
}
|
||||
fHandle.seek(newPos);
|
||||
}
|
||||
|
||||
|
||||
// If we could walk the chain successfully and
|
||||
// got exactly to the end of file then we've got a match.
|
||||
if (chainWalkSuccess && fHandle.pos() == fHandle.size()) {
|
||||
|
@ -145,7 +145,7 @@ enum CineSaveGameFormat detectSaveGameFormat(Common::SeekableReadStream &fHandle
|
|||
assert(animEntrySize == oldAnimEntrySize || animEntrySize == newAnimEntrySize);
|
||||
if (animEntrySize == oldAnimEntrySize) {
|
||||
result = ANIMSIZE_23;
|
||||
} else { // animEntrySize == newAnimEntrySize
|
||||
} else { // animEntrySize == newAnimEntrySize
|
||||
// Check data and mask pointers in all of the animDataTable entries
|
||||
// to see whether we've got the version with the broken data and mask pointers or not.
|
||||
// In the broken format all data and mask pointers were always zero.
|
||||
|
@ -484,7 +484,7 @@ bool CineEngine::loadTempSaveOS(Common::SeekableReadStream &in) {
|
|||
return false;
|
||||
} else if (hdr.version > CURRENT_OS_SAVE_VER) {
|
||||
warning("loadTempSaveOS: Detected newer format version. Not loading savegame");
|
||||
return false;
|
||||
return false;
|
||||
} else if ((int)hdr.version < (int)CURRENT_OS_SAVE_VER) {
|
||||
warning("loadTempSaveOS: Detected older format version. Trying to load nonetheless. Things may break");
|
||||
} else { // hdr.id == TEMP_OS_FORMAT_ID && hdr.version == CURRENT_OS_SAVE_VER
|
||||
|
@ -499,7 +499,7 @@ bool CineEngine::loadTempSaveOS(Common::SeekableReadStream &in) {
|
|||
|
||||
// Ok, so we've got a correct header for a temporary Operation Stealth savegame.
|
||||
// Let's start loading the plain savegame data then.
|
||||
currentDisk = in.readUint16BE();
|
||||
currentDisk = in.readUint16BE();
|
||||
in.read(currentPartName, 13);
|
||||
in.read(currentPrcName, 13);
|
||||
in.read(currentRelName, 13);
|
||||
|
@ -509,7 +509,7 @@ bool CineEngine::loadTempSaveOS(Common::SeekableReadStream &in) {
|
|||
for (uint i = 0; i < 8; i++) {
|
||||
in.read(bgNames[i], 13);
|
||||
}
|
||||
|
||||
|
||||
in.read(currentCtName, 13);
|
||||
|
||||
// Moved the loading of current procedure, relation,
|
||||
|
@ -571,7 +571,7 @@ bool CineEngine::loadTempSaveOS(Common::SeekableReadStream &in) {
|
|||
// TODO: Use the loaded value (Is music playing? (Uint16BE, Boolean)).
|
||||
in.readUint16BE();
|
||||
|
||||
renderer->_cmdY = in.readUint16BE();
|
||||
renderer->_cmdY = in.readUint16BE();
|
||||
in.readUint16BE(); // Some unknown variable that seems to always be zero
|
||||
allowPlayerInput = in.readUint16BE();
|
||||
playerCommand = in.readUint16BE();
|
||||
|
@ -583,7 +583,7 @@ bool CineEngine::loadTempSaveOS(Common::SeekableReadStream &in) {
|
|||
var2 = in.readUint16BE();
|
||||
commandVar2 = in.readUint16BE();
|
||||
renderer->_messageBg = in.readUint16BE();
|
||||
|
||||
|
||||
// TODO: Use the loaded value (adBgVar1 (Uint16BE)).
|
||||
in.readUint16BE();
|
||||
|
||||
|
@ -625,7 +625,7 @@ bool CineEngine::loadTempSaveOS(Common::SeekableReadStream &in) {
|
|||
// TODO: Palette handling?
|
||||
|
||||
if (in.pos() == in.size()) {
|
||||
debug(3, "loadTempSaveOS: Loaded the whole savefile.");
|
||||
debug(3, "loadTempSaveOS: Loaded the whole savefile.");
|
||||
} else {
|
||||
warning("loadTempSaveOS: Loaded the savefile but didn't exhaust it completely. Something was left over");
|
||||
}
|
||||
|
@ -784,7 +784,7 @@ bool CineEngine::makeLoad(char *saveName) {
|
|||
// 0x2315 + (255 * 30) + (2 * 6) + (206 + 206 + 20 + 20) * 512 = ~242kB
|
||||
//
|
||||
// I think it extremely unlikely that there would be over 512 global scripts, object scripts,
|
||||
// overlays and background incrusts so 256kB seems like quite a safe upper limit.
|
||||
// overlays and background incrusts so 256kB seems like quite a safe upper limit.
|
||||
// NOTE: If the savegame format is changed then this value might have to be re-evaluated!
|
||||
// Hopefully devices with more limited memory can also cope with this memory allocation.
|
||||
saveSize = 256 * 1024;
|
||||
|
@ -815,7 +815,7 @@ bool CineEngine::makeLoad(char *saveName) {
|
|||
if (load) {
|
||||
// Reset the engine's state
|
||||
resetEngine();
|
||||
|
||||
|
||||
if (saveGameFormat == TEMP_OS_FORMAT) {
|
||||
// Load the temporary Operation Stealth savegame format
|
||||
result = loadTempSaveOS(*in);
|
||||
|
@ -882,7 +882,7 @@ void CineEngine::makeSaveFW(Common::OutSaveFile &out) {
|
|||
void CineEngine::makeSaveOS(Common::OutSaveFile &out) {
|
||||
int i;
|
||||
|
||||
// Make a temporary Operation Stealth savegame format chunk header and save it.
|
||||
// Make a temporary Operation Stealth savegame format chunk header and save it.
|
||||
ChunkHeader header;
|
||||
header.id = TEMP_OS_FORMAT_ID;
|
||||
header.version = CURRENT_OS_SAVE_VER;
|
||||
|
@ -918,7 +918,7 @@ void CineEngine::makeSaveOS(Common::OutSaveFile &out) {
|
|||
// 0x2934: Is music playing? (Uint16BE, Boolean).
|
||||
out.writeUint16BE(0);
|
||||
|
||||
out.writeUint16BE(renderer->_cmdY);
|
||||
out.writeUint16BE(renderer->_cmdY);
|
||||
out.writeUint16BE(0); // Some unknown variable that seems to always be zero
|
||||
out.writeUint16BE(allowPlayerInput);
|
||||
out.writeUint16BE(playerCommand);
|
||||
|
@ -930,7 +930,7 @@ void CineEngine::makeSaveOS(Common::OutSaveFile &out) {
|
|||
out.writeUint16BE(var2);
|
||||
out.writeUint16BE(commandVar2);
|
||||
out.writeUint16BE(renderer->_messageBg);
|
||||
|
||||
|
||||
// FIXME: Save proper value for this variable, currently writing zero.
|
||||
// An unknown variable at 0x295E: adBgVar1 (Uint16BE).
|
||||
out.writeUint16BE(0);
|
||||
|
|
|
@ -459,7 +459,7 @@ int FWScript::o2_modifySeqListElement() {
|
|||
byte e = getNextByte();
|
||||
debugC(5, kCineDebugScript, "Line: %d: o2_modifySeqListElement(%d,%d,%d,%d,%d)", _line, a, b, c, d, e);
|
||||
|
||||
modifySeqListElement(a, 0, b, c, d, e);
|
||||
modifySeqListElement(a, 0, b, c, d, e);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ private:
|
|||
/**
|
||||
* Get bits from the source stream.
|
||||
* @note Changes the bit position in the source stream.
|
||||
* @param numBits Number of bits to read from the source stream.
|
||||
* @param numBits Number of bits to read from the source stream.
|
||||
* @return Integer value consisting of the bits read from the source stream (In range [0, (2 ** numBits) - 1]).
|
||||
* @return Later the bit was read from the source, the less significant it is in the return value.
|
||||
*/
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue