From 3dc7c88e067b4fcf8828523b465ab9d377368784 Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Thu, 5 Oct 2006 22:44:11 +0000 Subject: DS CPU scaling prototype, in 16 bit mode (for menu), not plugged(switch cpuScaler to test) svn-id: r24129 --- backends/platform/ds/arm9/source/dsmain.cpp | 44 +++++++++++++++++++++++------ backends/platform/ds/arm9/source/dsmain.h | 2 ++ 2 files changed, 37 insertions(+), 9 deletions(-) (limited to 'backends/platform') diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp index 40fe7a142e..31ef245982 100644 --- a/backends/platform/ds/arm9/source/dsmain.cpp +++ b/backends/platform/ds/arm9/source/dsmain.cpp @@ -40,6 +40,7 @@ #include "registers_alt.h" //#include "compact_flash.h" #include "dsoptions.h" +#include "blitters.h" namespace DS { @@ -114,6 +115,12 @@ u8 gameID; bool consoleEnable = true; bool gameScreenSwap = false; +bool cpuScaler = false; +bool isCpuScalerEnabled() +{ + return cpuScaler; +} + MouseMode mouseMode; @@ -522,7 +529,7 @@ void displayMode16Bit() { BG3_CR = BG_BMP16_512x256; highBuffer = false; - BG3_XDX = (int) (1.25f * 256); + BG3_XDX = cpuScaler ? 256 : (int) (1.25f * 256); BG3_XDY = 0; BG3_YDX = 0; BG3_YDY = (int) ((200.0f / 192.0f) * 256); @@ -567,8 +574,18 @@ void displayMode16BitFlipBuffer() { // highBuffer = !highBuffer; // BG3_CR = BG_BMP16_512x256 | BG_BMP_RAM(highBuffer? 1: 0); - for (int r = 0; r < 512 * 256; r++) { - *(BG_GFX + r) = *(back + r); + if (cpuScaler) + { + for(int i=0; i<200; ++i) + { + DS::Rescale_320x1555Scanline_To_256x1555Scanline(BG_GFX+i*512, back+i*512); + } + } + else + { + for (int r = 0; r < 512 * 256; r++) { + *(BG_GFX + r) = *(back + r); + } } } } @@ -1169,11 +1186,21 @@ void setMainScreenScale(int x, int y) { SUB_BG3_YDX = 0; SUB_BG3_YDY = y; } else { - BG3_XDX = x; - BG3_XDY = 0; - BG3_YDX = 0; - BG3_YDY = y; - + if (cpuScaler && (!displayModeIs8Bit) && (x==320)) + { + BG3_XDX = 256; + BG3_XDY = 0; + BG3_YDX = 0; + BG3_YDY = y; + } + else + { + BG3_XDX = x; + BG3_XDY = 0; + BG3_YDX = 0; + BG3_YDY = y; + } + touchScX = x; touchScY = y; } @@ -1941,4 +1968,3 @@ int main(void) int main() { DS::main(); } - diff --git a/backends/platform/ds/arm9/source/dsmain.h b/backends/platform/ds/arm9/source/dsmain.h index 06bf23d2d2..c6c4148cb7 100644 --- a/backends/platform/ds/arm9/source/dsmain.h +++ b/backends/platform/ds/arm9/source/dsmain.h @@ -106,6 +106,8 @@ void setTouchYOffset(int y); void setUnscaledMode(bool enable); void setIndyFightState(bool st); bool getIndyFightState(); +bool isCpuScalerEnabled(); + // Display bool getIsDisplayMode8Bit(); -- cgit v1.2.3