diff options
author | Neil Millstone | 2007-01-20 17:29:20 +0000 |
---|---|---|
committer | Neil Millstone | 2007-01-20 17:29:20 +0000 |
commit | 0c82694f4782ad913b4d482f533f1e05f7219dc1 (patch) | |
tree | 489b13fdf8a2c681beff44edda768b83f843f48e /backends/platform/ds/arm9 | |
parent | b6b75af524e7446c961801b11abe170400335bdd (diff) | |
download | scummvm-rg350-0c82694f4782ad913b4d482f533f1e05f7219dc1.tar.gz scummvm-rg350-0c82694f4782ad913b4d482f533f1e05f7219dc1.tar.bz2 scummvm-rg350-0c82694f4782ad913b4d482f533f1e05f7219dc1.zip |
Ported changes from branch-0-9-0 to fix grabRawScreen(), and palette corruption.
svn-id: r25129
Diffstat (limited to 'backends/platform/ds/arm9')
-rw-r--r-- | backends/platform/ds/arm9/source/dsmain.cpp | 2 | ||||
-rw-r--r-- | backends/platform/ds/arm9/source/osystem_ds.cpp | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp index bb764bc75a..e0332f91b5 100644 --- a/backends/platform/ds/arm9/source/dsmain.cpp +++ b/backends/platform/ds/arm9/source/dsmain.cpp @@ -517,7 +517,7 @@ void displayMode8Bit() { 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); 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; } |