[Scummvm-cvs-logs] SF.net SVN: scummvm: [27374] scummvm
Tramboi at users.sourceforge.net
Tramboi at users.sourceforge.net
Tue Jun 12 09:14:06 CEST 2007
Revision: 27374
http://scummvm.svn.sourceforge.net/scummvm/?rev=27374&view=rev
Author: Tramboi
Date: 2007-06-12 00:14:04 -0700 (Tue, 12 Jun 2007)
Log Message:
-----------
NDS : Attempt to not buffer overrun VRAM when doing saveGameBackBuffer/restoreGameBackBuffer ported to branch 0.10.0
Modified Paths:
--------------
scummvm/branches/branch-0-10-0/backends/platform/ds/arm9/source/dsmain.cpp
scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp
Modified: scummvm/branches/branch-0-10-0/backends/platform/ds/arm9/source/dsmain.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/backends/platform/ds/arm9/source/dsmain.cpp 2007-06-12 06:50:31 UTC (rev 27373)
+++ scummvm/branches/branch-0-10-0/backends/platform/ds/arm9/source/dsmain.cpp 2007-06-12 07:14:04 UTC (rev 27374)
@@ -333,27 +333,49 @@
void saveGameBackBuffer() {
#ifdef DISABLE_SCUMM
if (savedBuffer == NULL) savedBuffer = new u8[gameWidth * gameHeight];
- for (int r = 0; r < 200; r++) {
- memcpy(savedBuffer + (r * gameWidth), ((u8 *) (get8BitBackBuffer())) + (r * 512), gameWidth);
+ if(isCpuScalerEnabled())
+ {
+ memcpy(savedBuffer, get8BitBackBuffer(), gameWidth * gameHeight);
}
+ else
+ {
+ for (int r = 0; r < gameHeight; r++) {
+ memcpy(savedBuffer + (r * gameWidth), ((u8 *) (get8BitBackBuffer())) + (r * 512), gameWidth);
+ }
+ }
#endif
}
void restoreGameBackBuffer() {
#ifdef DISABLE_SCUMM
if (savedBuffer) {
- for (int r = 0; r < 200; r++) {
- memcpy(((u8 *) (BG_GFX_SUB)) + (r * 512), savedBuffer + (r * gameWidth), gameWidth);
- memcpy(((u8 *) (get8BitBackBuffer())) + (r * 512), savedBuffer + (r * gameWidth), gameWidth);
- }
+ if(isCpuScalerEnabled())
+ {
+ memcpy(get8BitBackBuffer(), savedBuffer, gameWidth * gameHeight);
+ // TODO Synchronize with framebuffer if necessary
+ }
+ else
+ {
+ for (int r = 0; r < gameHeight; r++) {
+ memcpy(((u8 *) (BG_GFX_SUB)) + (r * 512), savedBuffer + (r * gameWidth), gameWidth);
+ memcpy(((u8 *) (get8BitBackBuffer())) + (r * 512), savedBuffer + (r * gameWidth), gameWidth);
+ }
+ }
+
delete savedBuffer;
savedBuffer = NULL;
}
-#endif
-
-#ifndef DISABLE_SCUMM
- memset(get8BitBackBuffer(), 0, 512 * 256);
- memset(BG_GFX_SUB, 0, 512 * 256);
+#else
+ if(isCpuScalerEnabled())
+ {
+ memset(get8BitBackBuffer(), 0, 320 * 200);
+ // TODO Synchronize with framebuffer if necessary
+ }
+ else
+ {
+ memset(get8BitBackBuffer(), 0, 512 * 256);
+ memset(BG_GFX_SUB, 0, 512 * 256);
+ }
if (Scumm::g_scumm) {
Scumm::g_scumm->markRectAsDirty(Scumm::kMainVirtScreen, 0, gameWidth - 1, 0, gameHeight - 1, 1);
Scumm::g_scumm->markRectAsDirty(Scumm::kTextVirtScreen, 0, gameWidth - 1, 0, gameHeight - 1, 1);
@@ -2483,4 +2505,3 @@
int main() {
DS::main();
}
-
Modified: scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp 2007-06-12 06:50:31 UTC (rev 27373)
+++ scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp 2007-06-12 07:14:04 UTC (rev 27374)
@@ -750,7 +750,7 @@
}
else if (isCpuScalerEnabled())
{
- #define SCALER_PROFILE
+ //#define SCALER_PROFILE
#ifdef SCALER_PROFILE
TIMER1_CR = TIMER_ENABLE | TIMER_DIV_1024;
@@ -2505,4 +2505,3 @@
int main() {
DS::main();
}
-
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