Ticket #8840: dsscalepatch.diff

File dsscalepatch.diff, 6.5 KB (added by SF/xanathar, 16 years ago)

Patch for files under backends/platform/ds/arm9/source/

  • backends/platform/ds/arm9/source/dsmain.cpp

     
    213213int gameHeight = 200;
    214214
    215215// Scale
    216 bool twoHundredPercentFixedScale = false;
     216scaleSize fixedScaleSize = SCALESIZE_DYNAMIC;
    217217bool cpuScalerEnable = false;
    218218#define NUM_SUPPORTED_GAMES 20
    219219
     
    481481        touchYOffset = y;
    482482}
    483483
    484 void set200PercentFixedScale(bool on) {
    485         twoHundredPercentFixedScale = on;
     484void setScaleSize(scaleSize size) {
     485        fixedScaleSize = size;
    486486}
    487487
    488488void setUnscaledMode(bool enable) {
     
    18541854        int yCenter = subScTargetY + ((subScreenHeight >> 1) << 8);
    18551855
    18561856       
    1857         if (twoHundredPercentFixedScale) {
     1857        if (fixedScaleSize == SCALESIZE_FIXED100) {
     1858                subScreenWidth = 256;
     1859                subScreenHeight = 192;
     1860        } else if (fixedScaleSize == SCALESIZE_FIXED200) {
    18581861                subScreenWidth = 256 >> 1;
    18591862                subScreenHeight = 192 >> 1;
    18601863        } else {
  • backends/platform/ds/arm9/source/dsmain.h

     
    3030
    3131namespace DS {
    3232
     33enum scaleSize {
     34        SCALESIZE_DYNAMIC = 0, SCALESIZE_FIXED100, SCALESIZE_FIXED200, SCALESIZE_NUM_MODES
     35};
    3336
    3437enum controlType {
    3538        CONT_SCUMM_ORIGINAL,
     
    8083
    8184void    setTalkPos(int x, int y);
    8285void    setTopScreenTarget(int x, int y);
    83 void    set200PercentFixedScale(bool on);
     86void    setScaleSize(scaleSize size);
    8487
    8588// Timers
    8689void    setTimerCallback(OSystem_DS::TimerProc proc, int interval);             // Setup a callback function at a regular interval
  • backends/platform/ds/arm9/source/dsoptions.cpp

     
    5454
    5555        new GUI::StaticTextWidget(this, 90, 10, 130, 15, "ScummVM DS Options", GUI::kTextAlignCenter);
    5656
    57         _leftHandedCheckbox = new GUI::CheckboxWidget(this, 5, 70, 130, 20, "Left handed mode", 0, 'L');
     57        _leftHandedCheckbox = new GUI::CheckboxWidget(this, 5, 85, 130, 20, "Left handed mode", 0, 'L');
    5858        _indyFightCheckbox = new GUI::CheckboxWidget(this, 5, 40, 200, 20, "Indy fighting controls", 0, 'I');
    59         _twoHundredPercentCheckbox = new GUI::CheckboxWidget(this, 5, 55, 230, 20, "Zoomed screen at fixed 200% zoom", 0, 'T');
     59
     60        _dynamicZoomCheckbox = new GUI::CheckboxWidget(this, 5, 55, 100, 20, "Dynamic Zoom", 0x20000003, 'T');
     61        _oneHundredPercentCheckbox = new GUI::CheckboxWidget(this, 105, 55, 90, 20, "Zoom 100%", 0x20000001, 'T');
     62        _twoHundredPercentCheckbox = new GUI::CheckboxWidget(this, 195, 55, 90, 20, "Zoom 200%", 0x20000002, 'T');
     63
    6064        _highQualityAudioCheckbox = new GUI::CheckboxWidget(this, 5, 25, 250, 20, "High quality audio (slower) (reboot)", 0, 'T');
    61         _disablePowerOff = new GUI::CheckboxWidget(this, 5, 85, 130, 20, "Disable power off", 0, 'T');
    62         _showCursorCheckbox = new GUI::CheckboxWidget(this, 5, 100, 130, 20, "Show mouse cursor", 0, 'T');
     65        _disablePowerOff = new GUI::CheckboxWidget(this, 5, 100, 130, 20, "Disable power off", 0, 'T');
     66        _showCursorCheckbox = new GUI::CheckboxWidget(this, 5, 130, 130, 20, "Show mouse cursor", 0, 'T');
    6367
    6468//#ifdef ALLOW_CPU_SCALER
    6569//      _cpuScaler = new GUI::CheckboxWidget(this, 160, 115, 90, 20, "CPU scaler", 0, 'T');
     
    125129                _unscaledCheckbox->setState(false);
    126130        }
    127131
    128         if (ConfMan.hasKey("twohundredpercent", "ds")) {
    129                 _twoHundredPercentCheckbox->setState(ConfMan.getBool("twohundredpercent", "ds"));
     132        if (ConfMan.hasKey("scalesize", "ds")) {
     133                int scalesize = ConfMan.getInt("scalesize", "ds");
     134                _twoHundredPercentCheckbox->setState(scalesize == (int)SCALESIZE_FIXED200);
     135                _oneHundredPercentCheckbox->setState(scalesize == (int)SCALESIZE_FIXED100);
     136                _dynamicZoomCheckbox->setState((scalesize != (int)SCALESIZE_FIXED100)&&(scalesize != (int)SCALESIZE_FIXED200));
    130137        } else {
    131138                _twoHundredPercentCheckbox->setState(false);
     139                _oneHundredPercentCheckbox->setState(false);
     140                _dynamicZoomCheckbox->setState(true);
    132141        }
    133142
    134143        if (ConfMan.hasKey("22khzaudio", "ds")) {
     
    180189void DSOptionsDialog::updateConfigManager() {
    181190        ConfMan.setBool("lefthanded", _leftHandedCheckbox->getState(), "ds");
    182191        ConfMan.setBool("unscaled", _unscaledCheckbox->getState(), "ds");
    183         ConfMan.setBool("twohundredpercent", _twoHundredPercentCheckbox->getState(), "ds");
     192
     193        if (_twoHundredPercentCheckbox->getState()) {
     194                ConfMan.setInt("scalesize", (int)SCALESIZE_FIXED200, "ds");
     195        } else if (_oneHundredPercentCheckbox->getState()) {
     196                ConfMan.setInt("scalesize", (int)SCALESIZE_FIXED100, "ds");
     197        } else {
     198                ConfMan.setInt("scalesize", (int)SCALESIZE_DYNAMIC, "ds");
     199        }
     200
    184201        ConfMan.setBool("22khzaudio", _highQualityAudioCheckbox->getState(), "ds");
    185202        ConfMan.setBool("disablepoweroff", _disablePowerOff->getState(), "ds");
    186203#ifdef ALLOW_CPU_SCALER
     
    222239                                _unscaledCheckbox->setState(true);
    223240                        }
    224241                }
     242                else if ((cmd & 0xFF000000) == 0x20000000)
     243                {
     244                        _dynamicZoomCheckbox->setState((sender == _dynamicZoomCheckbox) && (cmd == 0x20000003));
     245                        _oneHundredPercentCheckbox->setState((sender == _oneHundredPercentCheckbox) && (cmd == 0x20000001));
     246                        _twoHundredPercentCheckbox->setState((sender == _twoHundredPercentCheckbox) && (cmd == 0x20000002));
     247                }
    225248
    226249                guard = false;
    227250
     
    327350                DS::setUnscaledMode(false);
    328351        }
    329352
    330         if (ConfMan.hasKey("twohundredpercent", "ds")) {
    331                 DS::set200PercentFixedScale(ConfMan.getBool("twohundredpercent", "ds"));
     353        if (ConfMan.hasKey("scalesize", "ds")) {
     354                DS::setScaleSize((scaleSize)ConfMan.getInt("scalesize", "ds"));
    332355        } else {
    333                 DS::set200PercentFixedScale(false);
     356                DS::setScaleSize(SCALESIZE_DYNAMIC);
    334357        }
    335358
    336359        if (ConfMan.hasKey("xoffset", "ds")) {
  • backends/platform/ds/arm9/source/dsoptions.h

     
    5050        GUI::CheckboxWidget* _leftHandedCheckbox;
    5151        GUI::CheckboxWidget* _unscaledCheckbox;
    5252        GUI::CheckboxWidget* _twoHundredPercentCheckbox;
     53        GUI::CheckboxWidget* _oneHundredPercentCheckbox;
     54        GUI::CheckboxWidget* _dynamicZoomCheckbox;
    5355        GUI::CheckboxWidget* _indyFightCheckbox;
    5456        GUI::CheckboxWidget* _highQualityAudioCheckbox;
    5557        GUI::CheckboxWidget* _disablePowerOff;