Annotation of hatari/src/gui-sdl/dlgScreen.c, revision 1.1.1.14

1.1       root        1: /*
                      2:   Hatari - dlgScreen.c
                      3: 
1.1.1.13  root        4:   This file is distributed under the GNU General Public License, version 2
                      5:   or at your option any later version. Read the file gpl.txt for details.
1.1.1.9   root        6: 
                      7:  Atari monitor and Hatari window settings.
1.1       root        8: */
1.1.1.8   root        9: const char DlgScreen_fileid[] = "Hatari dlgScreen.c : " __DATE__ " " __TIME__;
1.1       root       10: 
                     11: #include "main.h"
                     12: #include "configuration.h"
                     13: #include "dialog.h"
                     14: #include "sdlgui.h"
                     15: #include "screen.h"
                     16: #include "screenSnapShot.h"
1.1.1.10  root       17: #include "resolution.h"
1.1.1.2   root       18: #include "vdi.h"
1.1.1.6   root       19: #include "video.h"
1.1.1.9   root       20: #include "avi_record.h"
                     21: #include "statusbar.h"
1.1.1.10  root       22: #include "clocks_timings.h"
1.1.1.5   root       23: 
                     24: #define ITEMS_IN_ARRAY(a) (sizeof(a)/sizeof(a[0]))
                     25: 
1.1.1.9   root       26: 
                     27: /* The Monitor dialog: */
                     28: #define DLGSCRN_MONO         3
                     29: #define DLGSCRN_RGB          4
                     30: #define DLGSCRN_VGA          5
                     31: #define DLGSCRN_TV           6
                     32: #define DLGSCRN_OVERSCAN     7
                     33: #define DLGSCRN_USEVDIRES    9
                     34: #define DLGSCRN_VDI_WLESS    11
                     35: #define DLGSCRN_VDI_WTEXT    12
                     36: #define DLGSCRN_VDI_WMORE    13
                     37: #define DLGSCRN_VDI_HLESS    15
                     38: #define DLGSCRN_VDI_HTEXT    16
                     39: #define DLGSCRN_VDI_HMORE    17
                     40: #define DLGSCRN_BPP1         18
                     41: #define DLGSCRN_BPP2         19
                     42: #define DLGSCRN_BPP4         20
                     43: #define DLGSCRN_EXIT_MONITOR 21
1.1.1.5   root       44: 
                     45: /* Strings for VDI resolution width and height */
                     46: static char sVdiWidth[5];
                     47: static char sVdiHeight[5];
1.1       root       48: 
1.1.1.9   root       49: static SGOBJ monitordlg[] =
1.1       root       50: {
1.1.1.10  root       51:        { SGBOX, 0, 0, 0,0, 34,18, NULL },
1.1.1.9   root       52: 
1.1.1.10  root       53:        { SGBOX,      0, 0,  1,1, 32,6, NULL },
                     54:        { SGTEXT,     0, 0, 10,1, 14,1, "Atari monitor" },
                     55:        { SGRADIOBUT, 0, 0,  4,3,  6,1, "Mono" },
                     56:        { SGRADIOBUT, 0, 0, 12,3,  6,1, "RGB" },
                     57:        { SGRADIOBUT, 0, 0, 19,3,  6,1, "VGA" },
                     58:        { SGRADIOBUT, 0, 0, 26,3,  6,1, "TV" },
1.1.1.12  root       59:        { SGCHECKBOX, 0, 0, 12,5, 22,1, "Show borders" },
1.1.1.10  root       60: 
                     61:        { SGBOX,      0, 0,  1,8, 32,7, NULL },
                     62:        { SGCHECKBOX, 0, 0,  4,9, 33,1, "Use extended VDI screen" },
                     63:        { SGTEXT,     0, 0,  4,11, 5,1, "Size:" },
                     64:        { SGBUTTON,   0, 0,  6,12, 1,1, "\x04" },     /* Arrow left */
                     65:        { SGTEXT,     0, 0,  8,12, 4,1, sVdiWidth },
                     66:        { SGBUTTON,   0, 0, 13,12, 1,1, "\x03" },     /* Arrow right */
                     67:        { SGTEXT,     0, 0,  4,13, 1,1, "x" },
                     68:        { SGBUTTON,   0, 0,  6,13, 1,1, "\x04" },     /* Arrow left */
                     69:        { SGTEXT,     0, 0,  8,13, 4,1, sVdiHeight },
                     70:        { SGBUTTON,   0, 0, 13,13, 1,1, "\x03" },     /* Arrow right */
1.1.1.9   root       71: 
                     72:        { SGRADIOBUT, SG_EXIT, 0, 18,11, 11,1, " 2 colors" },
                     73:        { SGRADIOBUT, SG_EXIT, 0, 18,12, 11,1, " 4 colors" },
                     74:        { SGRADIOBUT, SG_EXIT, 0, 18,13, 11,1, "16 colors" },
                     75: 
1.1.1.10  root       76:        { SGBUTTON, SG_DEFAULT, 0, 7,16, 20,1, "Back to main menu" },
1.1.1.9   root       77:        { -1, 0, 0, 0,0, 0,0, NULL }
                     78: };
                     79: 
                     80: 
                     81: /* The window dialog: */
                     82: #define DLGSCRN_FULLSCRN    3
1.1.1.10  root       83: #define DLGSCRN_STATUSBAR   5
                     84: #define DLGSCRN_DRIVELED     6
                     85: #define DLGSCRN_NONE        7
                     86: #define DLGSCRN_SKIP0       9
                     87: #define DLGSCRN_SKIP1       10
                     88: #define DLGSCRN_SKIP2       11
                     89: #define DLGSCRN_SKIP3       12
                     90: #define DLGSCRN_SKIP4       13
1.1.1.14! root       91: #define DLGSCRN_KEEP_RES_ST 16
        !            92: #define DLGSCRN_KEEP_RES    17
        !            93: #define DLGSCRN_MAX_WLESS   19
        !            94: #define DLGSCRN_MAX_WTEXT   20
        !            95: #define DLGSCRN_MAX_WMORE   21
        !            96: #define DLGSCRN_MAX_HLESS   23
        !            97: #define DLGSCRN_MAX_HTEXT   24
        !            98: #define DLGSCRN_MAX_HMORE   25
        !            99: #define DLGSCRN_CROP        28
        !           100: #define DLGSCRN_CAPTURE     29
        !           101: #define DLGSCRN_RECANIM     30
        !           102: #define DLGSCRN_EXIT_WINDOW 31
1.1.1.9   root      103: 
                    104: /* needs to match Frame skip values in windowdlg[]! */
                    105: static const int skip_frames[] = { 0, 1, 2, 4, AUTO_FRAMESKIP_LIMIT };
                    106: 
                    107: /* Strings for doubled resolution max width and height */
                    108: static char sMaxWidth[5];
                    109: static char sMaxHeight[5];
                    110: 
                    111: #define MAX_SIZE_STEP 8
1.1.1.2   root      112: 
1.1.1.9   root      113: /* The window dialog: */
                    114: static SGOBJ windowdlg[] =
                    115: {
1.1.1.10  root      116:        { SGBOX, 0, 0, 0,0, 52,20, NULL },
1.1.1.9   root      117: 
1.1.1.10  root      118:        { SGBOX,      0, 0,  1,1, 50,10, NULL },
                    119:        { SGTEXT,     0, 0,  4,2, 20,1, "Hatari screen options" },
                    120:        { SGCHECKBOX, 0, 0,  4,4, 12,1, "Fullscreen" },
                    121:        { SGTEXT,     0, 0,  4,6, 12,1, "Indicators:" },
                    122:        { SGRADIOBUT, 0, 0,  6,7, 11,1, "Statusbar" },
                    123:        { SGRADIOBUT, 0, 0,  6,8, 11,1, "Drive led" },
                    124:        { SGRADIOBUT, 0, 0,  6,9, 11,1, "None" },
                    125:        { SGTEXT,     0, 0, 19,4, 12,1, "Frame skip:" },
                    126:        { SGRADIOBUT, 0, 0, 21,5,  7,1, "Off" },
                    127:        { SGRADIOBUT, 0, 0, 21,6,  7,1, "1" },
                    128:        { SGRADIOBUT, 0, 0, 21,7,  7,1, "2" },
                    129:        { SGRADIOBUT, 0, 0, 21,8,  7,1, "4" },
                    130:        { SGRADIOBUT, 0, 0, 21,9,  7,1, "Auto" },
1.1.1.14! root      131:        { SGTEXT,     0, 0, 33,2, 14,1, "Keep desktop" },
        !           132:        { SGTEXT,     0, 0, 33,3, 14,1, "resolution:" },
        !           133:        { SGCHECKBOX, 0, 0, 35,4, 12,2, "ST/STe" },
        !           134:        { SGCHECKBOX, 0, 0, 35,5, 12,1, "TT/Falcon" },
1.1.1.10  root      135:        { SGTEXT,     0, 0, 33,7, 15,1, "Max zoomed win:" },
                    136:        { SGBUTTON,   0, 0, 35,8,  1,1, "\x04" },     /* Arrow left */
                    137:        { SGTEXT,     0, 0, 37,8,  4,1, sMaxWidth },
                    138:        { SGBUTTON,   0, 0, 43,8,  1,1, "\x03" },     /* Arrow right */
                    139:        { SGTEXT,     0, 0, 33,9,  1,1, "x" },
                    140:        { SGBUTTON,   0, 0, 35,9,  1,1, "\x04" },     /* Arrow left */
                    141:        { SGTEXT,     0, 0, 37,9,  4,1, sMaxHeight },
                    142:        { SGBUTTON,   0, 0, 43,9,  1,1, "\x03" },     /* Arrow right */
                    143: 
                    144:        { SGBOX,      0, 0,  1,12, 50,5, NULL },
                    145:        { SGTEXT,     0, 0,  7,13, 16,1, "Screen capture" },
                    146:        { SGCHECKBOX, 0, 0,  8,15, 16,1, "Crop statusbar" },
                    147:        { SGBUTTON,   0, 0, 29,13, 14,1, " Screenshot " },
                    148:        { SGBUTTON,   0, 0, 29,15, 14,1, " Record AVI " },
1.1.1.2   root      149: 
1.1.1.10  root      150:        { SGBUTTON, SG_DEFAULT, 0, 17,18, 20,1, "Back to main menu" },
1.1.1.5   root      151:        { -1, 0, 0, 0,0, 0,0, NULL }
1.1       root      152: };
                    153: 
                    154: 
1.1.1.9   root      155: /* ---------------------------------------------------------------- */
1.1.1.5   root      156: 
1.1.1.9   root      157: static int nVdiStepX, nVdiStepY;   /* VDI resolution changing steps */
1.1.1.5   root      158: 
                    159: /**
                    160:  * Set width and height stepping for VDI resolution changing.
                    161:  * Depending on the color depth we can only change the VDI resolution
                    162:  * in certain steps:
                    163:  * - The screen width must be dividable by 16 bytes (i.e. 128 pixels in
                    164:  *   monochrome, 32 pixels in 16 color mode), or the text mode scrolling
                    165:  *   function of TOS will fail.
                    166:  * - The screen height must be a multiple of the character cell height
                    167:  *   (i.e. 16 pixels in monochrome, 8 pixels in color mode).
                    168:  */
1.1.1.9   root      169: static void DlgMonitor_SetVdiStepping(void)
1.1.1.5   root      170: {
1.1.1.9   root      171:        if (monitordlg[DLGSCRN_BPP1].state & SG_SELECTED)
1.1.1.5   root      172:        {
                    173:                nVdiStepX = 128;
                    174:                nVdiStepY = 16;
                    175:        }
1.1.1.9   root      176:        else if (monitordlg[DLGSCRN_BPP2].state & SG_SELECTED)
1.1.1.5   root      177:        {
                    178:                nVdiStepX = 64;
                    179:                nVdiStepY = 8;
                    180:        }
                    181:        else
                    182:        {
                    183:                nVdiStepX = 32;
                    184:                nVdiStepY = 8;
                    185:        }
                    186: }
                    187: 
                    188: 
1.1       root      189: /*-----------------------------------------------------------------------*/
1.1.1.5   root      190: /**
1.1.1.9   root      191:  * Show and process the monitor dialog.
1.1.1.5   root      192:  */
1.1.1.9   root      193: void Dialog_MonitorDlg(void)
1.1       root      194: {
1.1.1.9   root      195:        int but;
1.1.1.5   root      196:        unsigned int i;
1.1.1.8   root      197:        MONITORTYPE     mti;
1.1       root      198: 
1.1.1.9   root      199:        SDLGui_CenterDlg(monitordlg);
1.1       root      200: 
1.1.1.9   root      201:        /* Set up general monitor options in the dialog from actual values: */
1.1.1.5   root      202: 
1.1.1.6   root      203:        if (ConfigureParams.Screen.bAllowOverscan)
1.1.1.9   root      204:                monitordlg[DLGSCRN_OVERSCAN].state |= SG_SELECTED;
1.1.1.5   root      205:        else
1.1.1.9   root      206:                monitordlg[DLGSCRN_OVERSCAN].state &= ~SG_SELECTED;
1.1.1.5   root      207: 
                    208:        for (i = DLGSCRN_MONO; i <= DLGSCRN_TV; i++)
1.1.1.9   root      209:                monitordlg[i].state &= ~SG_SELECTED;
                    210:        monitordlg[DLGSCRN_MONO+ConfigureParams.Screen.nMonitorType].state |= SG_SELECTED;
1.1.1.5   root      211: 
                    212:        /* Initialize VDI resolution options: */
                    213: 
1.1.1.6   root      214:        if (ConfigureParams.Screen.bUseExtVdiResolutions)
1.1.1.9   root      215:                monitordlg[DLGSCRN_USEVDIRES].state |= SG_SELECTED;
1.1.1.5   root      216:        else
1.1.1.9   root      217:                monitordlg[DLGSCRN_USEVDIRES].state &= ~SG_SELECTED;
1.1.1.5   root      218:        for (i=0; i<3; i++)
1.1.1.9   root      219:                monitordlg[DLGSCRN_BPP1 + i].state &= ~SG_SELECTED;
                    220:        monitordlg[DLGSCRN_BPP1 + ConfigureParams.Screen.nVdiColors - GEMCOLOR_2].state |= SG_SELECTED;
1.1.1.6   root      221:        sprintf(sVdiWidth, "%4i", ConfigureParams.Screen.nVdiWidth);
                    222:        sprintf(sVdiHeight, "%4i", ConfigureParams.Screen.nVdiHeight);
1.1.1.9   root      223:        DlgMonitor_SetVdiStepping();
1.1.1.5   root      224: 
1.1.1.9   root      225:        /* The monitor dialog main loop */
1.1.1.5   root      226:        do
                    227:        {
1.1.1.9   root      228:                but = SDLGui_DoDialog(monitordlg, NULL);
1.1.1.5   root      229:                switch (but)
                    230:                {
1.1.1.9   root      231:                 case DLGSCRN_VDI_WLESS:
1.1.1.6   root      232:                        ConfigureParams.Screen.nVdiWidth = VDI_Limit(ConfigureParams.Screen.nVdiWidth - nVdiStepX,
1.1.1.5   root      233:                                                        nVdiStepX, MIN_VDI_WIDTH, MAX_VDI_WIDTH);
1.1.1.6   root      234:                        sprintf(sVdiWidth, "%4i", ConfigureParams.Screen.nVdiWidth);
1.1.1.5   root      235:                        break;
1.1.1.9   root      236:                 case DLGSCRN_VDI_WMORE:
1.1.1.6   root      237:                        ConfigureParams.Screen.nVdiWidth = VDI_Limit(ConfigureParams.Screen.nVdiWidth + nVdiStepX,
1.1.1.5   root      238:                                                        nVdiStepX, MIN_VDI_WIDTH, MAX_VDI_WIDTH);
1.1.1.6   root      239:                        sprintf(sVdiWidth, "%4i", ConfigureParams.Screen.nVdiWidth);
1.1.1.5   root      240:                        break;
                    241: 
1.1.1.9   root      242:                 case DLGSCRN_VDI_HLESS:
1.1.1.6   root      243:                        ConfigureParams.Screen.nVdiHeight = VDI_Limit(ConfigureParams.Screen.nVdiHeight - nVdiStepY,
1.1.1.5   root      244:                                                         nVdiStepY, MIN_VDI_HEIGHT, MAX_VDI_HEIGHT);
1.1.1.6   root      245:                        sprintf(sVdiHeight, "%4i", ConfigureParams.Screen.nVdiHeight);
1.1.1.5   root      246:                        break;
1.1.1.9   root      247:                 case DLGSCRN_VDI_HMORE:
1.1.1.6   root      248:                        ConfigureParams.Screen.nVdiHeight = VDI_Limit(ConfigureParams.Screen.nVdiHeight + nVdiStepY,
1.1.1.5   root      249:                                                         nVdiStepY, MIN_VDI_HEIGHT, MAX_VDI_HEIGHT);
1.1.1.6   root      250:                        sprintf(sVdiHeight, "%4i", ConfigureParams.Screen.nVdiHeight);
1.1.1.5   root      251:                        break;
                    252: 
                    253:                 case DLGSCRN_BPP1:
                    254:                 case DLGSCRN_BPP2:
                    255:                 case DLGSCRN_BPP4:
1.1.1.9   root      256:                        DlgMonitor_SetVdiStepping();
1.1.1.5   root      257:                        /* Align resolution to actual conditions: */
1.1.1.6   root      258:                        ConfigureParams.Screen.nVdiWidth = VDI_Limit(ConfigureParams.Screen.nVdiWidth, nVdiStepX,
1.1.1.5   root      259:                                                        MIN_VDI_WIDTH, MAX_VDI_WIDTH);
1.1.1.6   root      260:                        ConfigureParams.Screen.nVdiHeight = VDI_Limit(ConfigureParams.Screen.nVdiHeight, nVdiStepY,
1.1.1.5   root      261:                                                         MIN_VDI_HEIGHT, MAX_VDI_HEIGHT);
1.1.1.6   root      262:                        sprintf(sVdiWidth, "%4i", ConfigureParams.Screen.nVdiWidth);
                    263:                        sprintf(sVdiHeight, "%4i", ConfigureParams.Screen.nVdiHeight);
1.1.1.5   root      264:                        break;
1.1.1.9   root      265:                }
                    266:        }
                    267:        while (but != DLGSCRN_EXIT_MONITOR && but != SDLGUI_QUIT
                    268:                && but != SDLGUI_ERROR && !bQuitProgram);
                    269: 
                    270:        /* Read new values from dialog: */
                    271: 
                    272:        ConfigureParams.Screen.bAllowOverscan = (monitordlg[DLGSCRN_OVERSCAN].state & SG_SELECTED);
                    273: 
                    274:        for (mti = MONITOR_TYPE_MONO; mti <= MONITOR_TYPE_TV; mti++)
                    275:        {
                    276:                if (monitordlg[mti + DLGSCRN_MONO].state & SG_SELECTED)
                    277:                {
                    278:                        ConfigureParams.Screen.nMonitorType = mti;
                    279:                        break;
                    280:                }
                    281:        }
                    282: 
                    283:        ConfigureParams.Screen.bUseExtVdiResolutions = (monitordlg[DLGSCRN_USEVDIRES].state & SG_SELECTED);
                    284:        for (i=0; i<3; i++)
                    285:        {
                    286:                if (monitordlg[DLGSCRN_BPP1 + i].state & SG_SELECTED)
                    287:                        ConfigureParams.Screen.nVdiColors = GEMCOLOR_2 + i;
                    288:        }
                    289: }
                    290: 
                    291: 
                    292: /*-----------------------------------------------------------------------*/
                    293: /**
                    294:  * Show and process the window dialog.
                    295:  */
                    296: void Dialog_WindowDlg(void)
                    297: {
1.1.1.10  root      298:        int deskw, deskh, but, skip = 0;
1.1.1.9   root      299:        unsigned int i;
                    300: 
                    301:        SDLGui_CenterDlg(windowdlg);
                    302: 
                    303:        /* Set up general window options in the dialog from actual values: */
                    304: 
                    305:        if (ConfigureParams.Screen.bFullScreen)
                    306:                windowdlg[DLGSCRN_FULLSCRN].state |= SG_SELECTED;
                    307:        else
                    308:                windowdlg[DLGSCRN_FULLSCRN].state &= ~SG_SELECTED;
                    309: 
1.1.1.10  root      310:        if (ConfigureParams.Screen.bKeepResolution)
                    311:                windowdlg[DLGSCRN_KEEP_RES].state |= SG_SELECTED;
                    312:        else
                    313:                windowdlg[DLGSCRN_KEEP_RES].state &= ~SG_SELECTED;
1.1.1.14! root      314:        if (ConfigureParams.Screen.bKeepResolutionST)
        !           315:                windowdlg[DLGSCRN_KEEP_RES_ST].state |= SG_SELECTED;
        !           316:        else
        !           317:                windowdlg[DLGSCRN_KEEP_RES_ST].state &= ~SG_SELECTED;
1.1.1.10  root      318: 
                    319:        windowdlg[DLGSCRN_STATUSBAR].state &= ~SG_SELECTED;
                    320:        windowdlg[DLGSCRN_DRIVELED].state &= ~SG_SELECTED;
                    321:        windowdlg[DLGSCRN_NONE].state &= ~SG_SELECTED;
1.1.1.9   root      322:        if (ConfigureParams.Screen.bShowStatusbar)
                    323:                windowdlg[DLGSCRN_STATUSBAR].state |= SG_SELECTED;
1.1.1.10  root      324:        else if (ConfigureParams.Screen.bShowDriveLed)
                    325:                windowdlg[DLGSCRN_DRIVELED].state |= SG_SELECTED;
1.1.1.11  root      326:        else
                    327:                windowdlg[DLGSCRN_NONE].state |= SG_SELECTED;
1.1.1.9   root      328: 
                    329:        for (i = 0; i < ITEMS_IN_ARRAY(skip_frames); i++)
                    330:        {
                    331:                if (ConfigureParams.Screen.nFrameSkips >= skip_frames[i])
                    332:                        skip = i;
                    333:                windowdlg[i+DLGSCRN_SKIP0].state &= ~SG_SELECTED;
                    334:        }
                    335:        windowdlg[DLGSCRN_SKIP0+skip].state |= SG_SELECTED;
                    336: 
1.1.1.10  root      337:        Resolution_GetDesktopSize(&deskw, &deskh);
1.1.1.9   root      338:        sprintf(sMaxWidth, "%4i", ConfigureParams.Screen.nMaxWidth);
                    339:        sprintf(sMaxHeight, "%4i", ConfigureParams.Screen.nMaxHeight);
                    340: 
                    341:        /* Initialize window capture options: */
                    342: 
1.1.1.10  root      343:        if (ConfigureParams.Screen.bCrop)
                    344:                windowdlg[DLGSCRN_CROP].state |= SG_SELECTED;
1.1.1.9   root      345:        else
1.1.1.10  root      346:                windowdlg[DLGSCRN_CROP].state &= ~SG_SELECTED;
1.1.1.9   root      347: 
                    348:        if (Avi_AreWeRecording())
                    349:                windowdlg[DLGSCRN_RECANIM].txt = "Stop record";
                    350:        else
                    351:                windowdlg[DLGSCRN_RECANIM].txt = "Record AVI";
                    352: 
                    353:        /* The window dialog main loop */
                    354:        do
                    355:        {
                    356:                but = SDLGui_DoDialog(windowdlg, NULL);
                    357:                switch (but)
                    358:                {
                    359:                 case DLGSCRN_MAX_WLESS:
                    360:                        ConfigureParams.Screen.nMaxWidth = VDI_Limit(ConfigureParams.Screen.nMaxWidth - MAX_SIZE_STEP,
1.1.1.10  root      361:                                                        MAX_SIZE_STEP, MIN_VDI_WIDTH, deskw);
1.1.1.9   root      362:                        sprintf(sMaxWidth, "%4i", ConfigureParams.Screen.nMaxWidth);
                    363:                        break;
                    364:                 case DLGSCRN_MAX_WMORE:
                    365:                        ConfigureParams.Screen.nMaxWidth = VDI_Limit(ConfigureParams.Screen.nMaxWidth + MAX_SIZE_STEP,
1.1.1.10  root      366:                                                        MAX_SIZE_STEP, MIN_VDI_WIDTH, deskw);
1.1.1.9   root      367:                        sprintf(sMaxWidth, "%4i", ConfigureParams.Screen.nMaxWidth);
                    368:                        break;
                    369: 
                    370:                 case DLGSCRN_MAX_HLESS:
                    371:                        ConfigureParams.Screen.nMaxHeight = VDI_Limit(ConfigureParams.Screen.nMaxHeight - MAX_SIZE_STEP,
1.1.1.10  root      372:                                                         MAX_SIZE_STEP, MIN_VDI_HEIGHT, deskh);
1.1.1.9   root      373:                        sprintf(sMaxHeight, "%4i", ConfigureParams.Screen.nMaxHeight);
                    374:                        break;
                    375:                 case DLGSCRN_MAX_HMORE:
                    376:                        ConfigureParams.Screen.nMaxHeight = VDI_Limit(ConfigureParams.Screen.nMaxHeight + MAX_SIZE_STEP,
1.1.1.10  root      377:                                                         MAX_SIZE_STEP, MIN_VDI_HEIGHT, deskh);
1.1.1.9   root      378:                        sprintf(sMaxHeight, "%4i", ConfigureParams.Screen.nMaxHeight);
                    379:                        break;
1.1.1.5   root      380: 
                    381:                 case DLGSCRN_CAPTURE:
                    382:                        SDL_UpdateRect(sdlscrn, 0,0,0,0);
1.1.1.10  root      383:                        ConfigureParams.Screen.bCrop = (windowdlg[DLGSCRN_CROP].state & SG_SELECTED);
1.1.1.5   root      384:                        ScreenSnapShot_SaveScreen();
                    385:                        break;
1.1.1.9   root      386: 
                    387:                case DLGSCRN_RECANIM:
                    388:                        if (Avi_AreWeRecording())
1.1.1.5   root      389:                        {
1.1.1.9   root      390:                                /* AVI indexing can take a while for larger files */
                    391:                                Statusbar_AddMessage("Finishing AVI file...", 100);
1.1.1.14! root      392:                                Statusbar_Update(sdlscrn, true);
1.1.1.9   root      393:                                Avi_StopRecording();
                    394:                                windowdlg[DLGSCRN_RECANIM].txt = "Record AVI";
                    395:                                Statusbar_AddMessage("Emulation paused", 100);
1.1.1.14! root      396:                                Statusbar_Update(sdlscrn, true);
1.1.1.5   root      397:                        }
                    398:                        else
                    399:                        {
1.1.1.10  root      400:                                ConfigureParams.Screen.bCrop = (windowdlg[DLGSCRN_CROP].state & SG_SELECTED);
                    401:                                Avi_StartRecording ( ConfigureParams.Video.AviRecordFile , ConfigureParams.Screen.bCrop ,
                    402:                                        ConfigureParams.Video.AviRecordFps == 0 ?
                    403:                                                ClocksTimings_GetVBLPerSec ( ConfigureParams.System.nMachineType , nScreenRefreshRate ) :
                    404:                                                (Uint32)ConfigureParams.Video.AviRecordFps << CLOCKS_TIMINGS_SHIFT_VBL ,
                    405:                                        1 << CLOCKS_TIMINGS_SHIFT_VBL ,
                    406:                                        ConfigureParams.Video.AviRecordVcodec );
1.1.1.9   root      407:                                windowdlg[DLGSCRN_RECANIM].txt = "Stop record";
1.1.1.5   root      408:                        }
                    409:                        break;
                    410:                }
                    411:        }
1.1.1.9   root      412:        while (but != DLGSCRN_EXIT_WINDOW && but != SDLGUI_QUIT
1.1.1.5   root      413:                && but != SDLGUI_ERROR && !bQuitProgram);
                    414: 
                    415:        /* Read new values from dialog: */
                    416: 
1.1.1.9   root      417:        ConfigureParams.Screen.bFullScreen = (windowdlg[DLGSCRN_FULLSCRN].state & SG_SELECTED);
1.1.1.10  root      418:        ConfigureParams.Screen.bKeepResolution = (windowdlg[DLGSCRN_KEEP_RES].state & SG_SELECTED);
1.1.1.14! root      419:        ConfigureParams.Screen.bKeepResolutionST = (windowdlg[DLGSCRN_KEEP_RES_ST].state & SG_SELECTED);
1.1.1.5   root      420: 
1.1.1.10  root      421:        ConfigureParams.Screen.bShowStatusbar = false;
                    422:        ConfigureParams.Screen.bShowDriveLed = false;
1.1.1.9   root      423:        if (windowdlg[DLGSCRN_STATUSBAR].state & SG_SELECTED)
1.1.1.8   root      424:                ConfigureParams.Screen.bShowStatusbar = true;
1.1.1.10  root      425:        else if (windowdlg[DLGSCRN_DRIVELED].state & SG_SELECTED)
                    426:                ConfigureParams.Screen.bShowDriveLed = true;
1.1.1.5   root      427: 
                    428:        for (i = DLGSCRN_SKIP0; i <= DLGSCRN_SKIP4; i++)
                    429:        {
1.1.1.9   root      430:                if (windowdlg[i].state & SG_SELECTED)
1.1.1.5   root      431:                {
1.1.1.6   root      432:                        ConfigureParams.Screen.nFrameSkips = skip_frames[i-DLGSCRN_SKIP0];
1.1.1.5   root      433:                        break;
                    434:                }
                    435:        }
1.1.1.2   root      436: 
1.1.1.10  root      437:        ConfigureParams.Screen.bCrop = (windowdlg[DLGSCRN_CROP].state & SG_SELECTED);
1.1       root      438: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.