aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/ds
diff options
context:
space:
mode:
authorBertrand Augereau2006-10-05 22:44:11 +0000
committerBertrand Augereau2006-10-05 22:44:11 +0000
commit3dc7c88e067b4fcf8828523b465ab9d377368784 (patch)
tree10c0d96a7b8edac7b9402768d2ca014670dec23c /backends/platform/ds
parentb01275d8c5eec2b4a868d681f2b89649f50d2325 (diff)
downloadscummvm-rg350-3dc7c88e067b4fcf8828523b465ab9d377368784.tar.gz
scummvm-rg350-3dc7c88e067b4fcf8828523b465ab9d377368784.tar.bz2
scummvm-rg350-3dc7c88e067b4fcf8828523b465ab9d377368784.zip
DS CPU scaling prototype, in 16 bit mode (for menu), not plugged(switch cpuScaler to test)
svn-id: r24129
Diffstat (limited to 'backends/platform/ds')
-rw-r--r--backends/platform/ds/arm9/source/dsmain.cpp44
-rw-r--r--backends/platform/ds/arm9/source/dsmain.h2
2 files changed, 37 insertions, 9 deletions
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();