diff options
author | Bertrand Augereau | 2007-06-17 19:37:07 +0000 |
---|---|---|
committer | Bertrand Augereau | 2007-06-17 19:37:07 +0000 |
commit | e5107cb9807b884e8b84ff25733d60575902039d (patch) | |
tree | 00557c2f624ce86b958d8c1109515ba770353f5c /backends/platform/ds/arm9/source | |
parent | e477ca37b314bf40cd360840985cef2bf605f735 (diff) | |
download | scummvm-rg350-e5107cb9807b884e8b84ff25733d60575902039d.tar.gz scummvm-rg350-e5107cb9807b884e8b84ff25733d60575902039d.tar.bz2 scummvm-rg350-e5107cb9807b884e8b84ff25733d60575902039d.zip |
NDS: setKeyboardEnable shouldn't overrun VRAM anymore when CPU scaler is on
svn-id: r27515
Diffstat (limited to 'backends/platform/ds/arm9/source')
-rw-r--r-- | backends/platform/ds/arm9/source/dsmain.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp index 644b66671a..45f0a16deb 100644 --- a/backends/platform/ds/arm9/source/dsmain.cpp +++ b/backends/platform/ds/arm9/source/dsmain.cpp @@ -1018,11 +1018,19 @@ void setKeyboardEnable(bool en) { // Copy the sub screen VRAM from the top screen - they should always be // the same. u16* buffer = get8BitBackBuffer(); - - for (int r = 0; r < (512 * 256) >> 1; r++) { - BG_GFX_SUB[r] = buffer[r]; - } - + + if(isCpuScalerEnabled()) + { + for (int y = 0; y < gameHeight; ++y) + for (int x = 0; x < gameWidth / 2; ++x) + BG_GFX_SUB[y*256 + x] = buffer[y*gameWidth/2 + x]; + } + else + { + for (int r = 0; r < (512 * 256) >> 1; r++) { + BG_GFX_SUB[r] = buffer[r]; + } + } SUB_DISPLAY_CR &= ~DISPLAY_BG1_ACTIVE; // Turn off keyboard layer SUB_DISPLAY_CR |= DISPLAY_BG3_ACTIVE; // Turn on game layer } else { |