aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/ds/arm9/source/osystem_ds.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/ds/arm9/source/osystem_ds.cpp')
-rw-r--r--backends/platform/ds/arm9/source/osystem_ds.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp
index 247b4e73de..70299ae5b2 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.cpp
+++ b/backends/platform/ds/arm9/source/osystem_ds.cpp
@@ -471,7 +471,19 @@ Common::SaveFileManager* OSystem_DS::getSavefileManager()
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;
}