mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 05:38:56 +00:00
NDS: setKeyboardEnable shouldn't overrun VRAM anymore when CPU scaler is on
svn-id: r27515
This commit is contained in:
parent
e477ca37b3
commit
e5107cb980
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user