[Scummvm-cvs-logs] SF.net SVN: scummvm: [25129] scummvm/trunk/backends
agent-q at users.sourceforge.net
agent-q at users.sourceforge.net
Sat Jan 20 18:29:21 CET 2007
Revision: 25129
http://scummvm.svn.sourceforge.net/scummvm/?rev=25129&view=rev
Author: agent-q
Date: 2007-01-20 09:29:20 -0800 (Sat, 20 Jan 2007)
Log Message:
-----------
Ported changes from branch-0-9-0 to fix grabRawScreen(), and palette corruption.
Modified Paths:
--------------
scummvm/trunk/backends/fs/ds/ds-fs.h
scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp
scummvm/trunk/backends/platform/ds/arm9/source/osystem_ds.cpp
Modified: scummvm/trunk/backends/fs/ds/ds-fs.h
===================================================================
--- scummvm/trunk/backends/fs/ds/ds-fs.h 2007-01-20 17:14:04 UTC (rev 25128)
+++ scummvm/trunk/backends/fs/ds/ds-fs.h 2007-01-20 17:29:20 UTC (rev 25129)
@@ -123,7 +123,8 @@
//
// A #define is the only way, as redefinig the functions would cause linker errors.
-// These functions need to be #undef'ed, as their definition is done with #includes
+// These functions need to be #undef'ed, as their original definition
+// in devkitarm is done with #includes (ugh!)
#undef feof
#undef stderr
#undef stdout
@@ -175,7 +176,12 @@
#define getcwd(dir, dunno) DS::std_getcwd(dir, dunno)
#define ferror(handle) DS::std_ferror(handle)
+#ifdef assert
+#undef assert
+#endif
+#define assert(s) if (!(s)) consolePrintf("Assertion failed: '##s##' at file %s, line %d\n", __FILE__, __LINE__)
+
}
#endif
Modified: scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp 2007-01-20 17:14:04 UTC (rev 25128)
+++ scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp 2007-01-20 17:29:20 UTC (rev 25129)
@@ -517,7 +517,7 @@
BG0_Y0 = 0;
// Restore palette entry used by text in the front-end
- PALETTE_SUB[255] = savedPalEntry255;
+// PALETTE_SUB[255] = savedPalEntry255;
consoleInitDefault((u16*)SCREEN_BASE_BLOCK(0), (u16*)CHAR_BASE_BLOCK(1), 16);
consolePrintSet(0, 23);
Modified: scummvm/trunk/backends/platform/ds/arm9/source/osystem_ds.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/osystem_ds.cpp 2007-01-20 17:14:04 UTC (rev 25128)
+++ scummvm/trunk/backends/platform/ds/arm9/source/osystem_ds.cpp 2007-01-20 17:29:20 UTC (rev 25129)
@@ -471,7 +471,19 @@
bool OSystem_DS::grabRawScreen(Graphics::Surface* surf) {
surf->create(DS::getGameWidth(), DS::getGameHeight(), 1);
- memcpy(surf->pixels, DS::get8BitBackBuffer(), DS::getGameWidth() * DS::getGameHeight());
+
+ // Ensure we copy using 16 bit quantities due to limitation of VRAM addressing
+ // TODO: Change this to work with the software scalar (hint: video ram format is different)
+ u16* image = (u16 *) DS::get8BitBackBuffer();
+ for (int y = 0; y < DS::getGameHeight(); y++)
+ {
+ DC_FlushRange((image + (y * 512)), DS::getGameWidth());
+ for (int x = 0; x < DS::getGameWidth() >> 1; x++)
+ {
+ *(((u16 *) (surf->pixels)) + y * (DS::getGameWidth() >> 1) + x) = *(image + y * 256 + x);
+ }
+ }
+
return true;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list