aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/ds/arm9/source
diff options
context:
space:
mode:
authorBertrand Augereau2007-02-13 21:04:31 +0000
committerBertrand Augereau2007-02-13 21:04:31 +0000
commitf01d2a1199d775f8ceea4e674a961c80b00e222a (patch)
treee35b876c448f499dbe02ea52f3a14e5591135d0b /backends/platform/ds/arm9/source
parent7fa8e652a02558d0e9b27471520ce50b6d65afa7 (diff)
downloadscummvm-rg350-f01d2a1199d775f8ceea4e674a961c80b00e222a.tar.gz
scummvm-rg350-f01d2a1199d775f8ceea4e674a961c80b00e222a.tar.bz2
scummvm-rg350-f01d2a1199d775f8ceea4e674a961c80b00e222a.zip
NDS : Added the cpu scaler option in dsoptions (even seem to work dynamically, at least in Maniac Mansion)
svn-id: r25561
Diffstat (limited to 'backends/platform/ds/arm9/source')
-rw-r--r--backends/platform/ds/arm9/source/dsmain.cpp14
-rw-r--r--backends/platform/ds/arm9/source/dsoptions.cpp8
-rw-r--r--backends/platform/ds/arm9/source/dsoptions.h2
3 files changed, 17 insertions, 7 deletions
diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp
index e0332f91b5..da78f10ea7 100644
--- a/backends/platform/ds/arm9/source/dsmain.cpp
+++ b/backends/platform/ds/arm9/source/dsmain.cpp
@@ -148,7 +148,6 @@ u8 gameID;
bool consoleEnable = true;
bool gameScreenSwap = false;
-bool cpuScaler = false;
bool isCpuScalerEnabled();
//#define HEAVY_LOGGING
@@ -249,8 +248,9 @@ void updateStatus();
TransferSound soundControl;
-bool isCpuScalerEnabled() {
- return cpuScaler;
+bool isCpuScalerEnabled()
+{
+ return (ConfMan.hasKey("cpu_scaler", "ds") && ConfMan.getBool("cpu_scaler", "ds"));
}
//plays an 8 bit mono sample at 11025Hz
@@ -651,7 +651,7 @@ void displayMode16Bit() {
BG3_CR = BG_BMP16_512x256;
highBuffer = false;
- BG3_XDX = cpuScaler ? 256 : (int) (1.25f * 256);
+ BG3_XDX = isCpuScalerEnabled() ? 256 : (int) (1.25f * 256);
BG3_XDY = 0;
BG3_YDX = 0;
BG3_YDY = (int) ((200.0f / 192.0f) * 256);
@@ -701,7 +701,7 @@ void displayMode16BitFlipBuffer() {
// highBuffer = !highBuffer;
// BG3_CR = BG_BMP16_512x256 | BG_BMP_RAM(highBuffer? 1: 0);
- if (cpuScaler)
+ if (isCpuScalerEnabled())
{
Rescale_320x256x1555_To_256x256x1555(BG_GFX, back, 512, 512);
}
@@ -750,7 +750,7 @@ u16* get16BitBackBuffer() {
}
u16* get8BitBackBuffer() {
- if (cpuScaler)
+ if (isCpuScalerEnabled())
return BG_GFX;
else
return BG_GFX + 0x10000; // 16bit qty!
@@ -1349,7 +1349,7 @@ void setMainScreenScale(int x, int y) {
SUB_BG3_YDX = 0;
SUB_BG3_YDY = y;
} else {
- if (cpuScaler && (x==320))
+ if (isCpuScalerEnabled() && (x==320))
{
BG3_XDX = 256;
BG3_XDY = 0;
diff --git a/backends/platform/ds/arm9/source/dsoptions.cpp b/backends/platform/ds/arm9/source/dsoptions.cpp
index 90722507e2..272685a462 100644
--- a/backends/platform/ds/arm9/source/dsoptions.cpp
+++ b/backends/platform/ds/arm9/source/dsoptions.cpp
@@ -53,6 +53,7 @@ DSOptionsDialog::DSOptionsDialog() : GUI::Dialog(20, 0, 320 - 40, 200 - 20) {
_twoHundredPercentCheckbox = new GUI::CheckboxWidget(this, 20, 70, 230, 20, "Zoomed screen at fixed 200% zoom", 0, 'T');
_highQualityAudioCheckbox = new GUI::CheckboxWidget(this, 20, 85, 250, 20, "High quality audio (slower) (reboot)", 0, 'T');
_disablePowerOff = new GUI::CheckboxWidget(this, 20, 100, 250, 20, "Disable power off on quit", 0, 'T');
+ _cpuScaler = new GUI::CheckboxWidget(this, 20, 115, 250, 20, "CPU scaler", 0, 'T');
new GUI::StaticTextWidget(this, 20, 130, 110, 15, "Touch X Offset", GUI::kTextAlignLeft);
_touchX = new GUI::SliderWidget(this, 130, 130, 130, 12, 1);
@@ -106,6 +107,12 @@ DSOptionsDialog::DSOptionsDialog() : GUI::Dialog(20, 0, 320 - 40, 200 - 20) {
_disablePowerOff->setState(false);
}
+ if (ConfMan.hasKey("cpu_scaler", "ds")) {
+ _cpuScaler->setState(ConfMan.getBool("cpu_scaler", "ds"));
+ } else {
+ _cpuScaler->setState(false);
+ }
+
_indyFightCheckbox->setState(DS::getIndyFightState());
if (ConfMan.hasKey("xoffset", "ds")) {
@@ -128,6 +135,7 @@ DSOptionsDialog::~DSOptionsDialog() {
ConfMan.setBool("twohundredpercent", _twoHundredPercentCheckbox->getState(), "ds");
ConfMan.setBool("22khzaudio", _highQualityAudioCheckbox->getState(), "ds");
ConfMan.setBool("disablepoweroff", _disablePowerOff->getState(), "ds");
+ ConfMan.setBool("cpu_scaler", _cpuScaler->getState(), "ds");
ConfMan.setInt("xoffset", _touchX->getValue(), "ds");
ConfMan.setInt("yoffset", _touchY->getValue(), "ds");
DS::setOptions();
diff --git a/backends/platform/ds/arm9/source/dsoptions.h b/backends/platform/ds/arm9/source/dsoptions.h
index 3ab20666c6..9acb0d1da0 100644
--- a/backends/platform/ds/arm9/source/dsoptions.h
+++ b/backends/platform/ds/arm9/source/dsoptions.h
@@ -51,6 +51,8 @@ protected:
GUI::CheckboxWidget* _indyFightCheckbox;
GUI::CheckboxWidget* _highQualityAudioCheckbox;
GUI::CheckboxWidget* _disablePowerOff;
+ GUI::CheckboxWidget* _cpuScaler;
+
#ifdef DS_SCUMM_BUILD
Scumm::SaveLoadChooser* _delDialog;
#endif