Annotation of hatari/src/gui-sdl/dlgSystem.c, revision 1.1.1.15

1.1       root        1: /*
                      2:   Hatari - dlgSystem.c
                      3: 
1.1.1.12  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: 
1.1.1.15! root        7:   Dialog for setting various system options
1.1       root        8: */
1.1.1.7   root        9: const char DlgSystem_fileid[] = "Hatari dlgSystem.c : " __DATE__ " " __TIME__;
1.1       root       10: 
                     11: #include "main.h"
                     12: #include "configuration.h"
                     13: #include "dialog.h"
                     14: #include "sdlgui.h"
                     15: 
                     16: 
1.1.1.13  root       17: #define DLGSYS_ST          4
1.1.1.15! root       18: #define DLGSYS_MEGA_ST     5
        !            19: #define DLGSYS_STE         6
        !            20: #define DLGSYS_MEGA_STE    7
        !            21: #define DLGSYS_TT          8
        !            22: #define DLGSYS_FALCON      9
        !            23: #define DLGSYS_WSRND      12
        !            24: #define DLGSYS_WS1        13
        !            25: #define DLGSYS_WS2        14
        !            26: #define DLGSYS_WS3        15
        !            27: #define DLGSYS_WS4        16
        !            28: #define DLGSYS_DSPOFF     19
        !            29: #define DLGSYS_DSPDUMMY   20
        !            30: #define DLGSYS_DSPON      21
        !            31: #define DLGSYS_BLITTER    22
        !            32: #define DLGSYS_TIMERD     23
        !            33: #define DLGSYS_FASTBOOT   24
1.1.1.9   root       34: 
                     35: 
                     36: static SGOBJ systemdlg[] =
                     37: {
1.1.1.15! root       38:        { SGBOX, 0, 0, 0,0, 50,18, NULL },
        !            39:        { SGTEXT, 0, 0, 18,1, 14,1, "System options" },
1.1.1.9   root       40: 
1.1.1.15! root       41:        { SGBOX, 0, 0, 2,3, 15,8, NULL },
        !            42:        { SGTEXT, 0, 0, 3,3, 13,1, "Machine type:" },
1.1.1.14  root       43:        { SGRADIOBUT, 0, 0, 3,5, 4,1, "_ST" },
1.1.1.15! root       44:        { SGRADIOBUT, 0, 0, 3,6, 9,1, "Meg_a ST" },
        !            45:        { SGRADIOBUT, 0, 0, 3,7, 5,1, "ST_E" },
        !            46:        { SGRADIOBUT, 0, 0, 3,8, 10,1, "Me_ga STE" },
        !            47:        { SGRADIOBUT, 0, 0, 3,9, 4,1, "_TT" },
        !            48:        { SGRADIOBUT, 0, 0, 3,10, 8,1, "_Falcon" },
        !            49: 
        !            50:        { SGBOX, 0, 0, 18,3, 15,8, NULL },
        !            51:        { SGTEXT, 0, 0, 19,3, 13,1, "Video timing:" },
        !            52:        { SGRADIOBUT, 0, 0, 19,5, 8,1, "_Random" },
        !            53:        { SGRADIOBUT, 0, 0, 19,6, 12,1, "Wakestate_1" },
        !            54:        { SGRADIOBUT, 0, 0, 19,7, 12,1, "Wakestate_2" },
        !            55:        { SGRADIOBUT, 0, 0, 19,8, 12,1, "Wakestate_3" },
        !            56:        { SGRADIOBUT, 0, 0, 19,9, 12,1, "Wakestate_4" },
        !            57: 
        !            58:        { SGBOX, 0, 0, 34,3, 14,8, NULL },
        !            59:        { SGTEXT, 0, 0, 35,3, 12,1, "Falcon DSP:" },
        !            60:        { SGRADIOBUT, 0, 0, 35,5, 6,1, "_None" },
        !            61:        { SGRADIOBUT, 0, 0, 35,6, 7,1, "Dumm_y" },
        !            62:        { SGRADIOBUT, 0, 0, 35,7, 6,1, "Ful_l" },
        !            63: 
        !            64:        { SGCHECKBOX, 0, 0, 3,12, 20,1, "_Blitter in ST mode" },
        !            65:        { SGCHECKBOX, 0, 0, 3,13, 15,1, "Patch Timer-_D" },
        !            66:        { SGCHECKBOX, 0, 0, 3,14, 39,1, "Boot faster by _patching TOS & sysvars" },
        !            67: 
        !            68:        { SGBUTTON, SG_DEFAULT, 0, 16,16, 20,1, "Back to main menu" },
        !            69:        { SGSTOP, 0, 0, 0,0, 0,0, NULL }
1.1.1.9   root       70: };
                     71: 
                     72: 
                     73: /*-----------------------------------------------------------------------*/
                     74: /**
1.1.1.13  root       75:  * Show and process the "System" dialog
1.1.1.9   root       76:  */
1.1.1.15! root       77: void DlgSystem_Main(void)
1.1.1.9   root       78: {
                     79:        int i;
                     80:        MACHINETYPE     mti;
                     81: 
                     82:        SDLGui_CenterDlg(systemdlg);
                     83: 
1.1.1.15! root       84:        /* Set up machine type */
1.1.1.9   root       85:        for (i = DLGSYS_ST; i <= DLGSYS_FALCON; i++)
                     86:        {
                     87:                systemdlg[i].state &= ~SG_SELECTED;
                     88:        }
                     89:        systemdlg[DLGSYS_ST + ConfigureParams.System.nMachineType].state |= SG_SELECTED;
                     90: 
                     91: 
                     92:        /* DSP mode: */
                     93:        for (i = DLGSYS_DSPOFF; i <= DLGSYS_DSPON; i++)
                     94:        {
                     95:                systemdlg[i].state &= ~SG_SELECTED;
                     96:        }
                     97:        if (ConfigureParams.System.nDSPType == DSP_TYPE_NONE)
                     98:                systemdlg[DLGSYS_DSPOFF].state |= SG_SELECTED;
                     99:        else if (ConfigureParams.System.nDSPType == DSP_TYPE_DUMMY)
                    100:                systemdlg[DLGSYS_DSPDUMMY].state |= SG_SELECTED;
                    101:        else
                    102:                systemdlg[DLGSYS_DSPON].state |= SG_SELECTED;
                    103: 
1.1.1.15! root      104:        /* Video timing */
        !           105:        for (i = DLGSYS_WSRND; i <= DLGSYS_WS4; i++)
        !           106:        {
        !           107:                systemdlg[i].state &= ~SG_SELECTED;
        !           108:        }
        !           109:        systemdlg[DLGSYS_WSRND + ConfigureParams.System.VideoTimingMode].state |= SG_SELECTED;
1.1.1.9   root      110: 
                    111:        /* Emulate Blitter */
                    112:        if (ConfigureParams.System.bBlitter)
                    113:                systemdlg[DLGSYS_BLITTER].state |= SG_SELECTED;
                    114:        else
                    115:                systemdlg[DLGSYS_BLITTER].state &= ~SG_SELECTED;
                    116: 
                    117:        /* Patch timer D */
                    118:        if (ConfigureParams.System.bPatchTimerD)
                    119:                systemdlg[DLGSYS_TIMERD].state |= SG_SELECTED;
                    120:        else
                    121:                systemdlg[DLGSYS_TIMERD].state &= ~SG_SELECTED;
                    122: 
1.1.1.13  root      123:        /* Boot faster by patching system variables */
                    124:        if (ConfigureParams.System.bFastBoot)
                    125:                systemdlg[DLGSYS_FASTBOOT].state |= SG_SELECTED;
                    126:        else
                    127:                systemdlg[DLGSYS_FASTBOOT].state &= ~SG_SELECTED;
                    128: 
1.1.1.9   root      129:        /* Show the dialog: */
1.1.1.14  root      130:        SDLGui_DoDialog(systemdlg, NULL, false);
1.1.1.9   root      131: 
                    132:        /* Read values from dialog: */
                    133: 
                    134:        for (mti = MACHINE_ST; mti <= MACHINE_FALCON; mti++)
                    135:        {
                    136:                if (systemdlg[mti + DLGSYS_ST].state&SG_SELECTED)
                    137:                {
                    138:                        ConfigureParams.System.nMachineType = mti;
                    139:                        break;
                    140:                }
                    141:        }
                    142: 
                    143:        if (systemdlg[DLGSYS_DSPOFF].state & SG_SELECTED)
                    144:                ConfigureParams.System.nDSPType = DSP_TYPE_NONE;
                    145:        else if (systemdlg[DLGSYS_DSPDUMMY].state & SG_SELECTED)
                    146:                ConfigureParams.System.nDSPType = DSP_TYPE_DUMMY;
                    147:        else
                    148:                ConfigureParams.System.nDSPType = DSP_TYPE_EMU;
                    149: 
1.1.1.15! root      150:        for (i = DLGSYS_WSRND; i <= DLGSYS_WS4; i++)
        !           151:        {
        !           152:                if (systemdlg[i].state & SG_SELECTED)
        !           153:                {
        !           154:                        ConfigureParams.System.VideoTimingMode = i - DLGSYS_WSRND;
        !           155:                        break;
        !           156:                }
        !           157:        }
        !           158: 
1.1.1.9   root      159:        ConfigureParams.System.bBlitter = (systemdlg[DLGSYS_BLITTER].state & SG_SELECTED);
                    160:        ConfigureParams.System.bPatchTimerD = (systemdlg[DLGSYS_TIMERD].state & SG_SELECTED);
1.1.1.13  root      161:        ConfigureParams.System.bFastBoot = (systemdlg[DLGSYS_FASTBOOT].state & SG_SELECTED);
                    162: }

unix.superglobalmegacorp.com

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