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

1.1       root        1: /*
                      2:   Hatari - dlgSystem.c
                      3: 
                      4:   This file is distributed under the GNU Public License, version 2 or at
                      5:   your option any later version. Read the file gpl.txt for details.
                      6: */
1.1.1.4 ! root        7: const char DlgSystem_rcsid[] = "Hatari $Id: dlgSystem.c,v 1.10 2007/01/18 23:21:54 thothy Exp $";
1.1       root        8: 
                      9: #include "main.h"
                     10: #include "configuration.h"
                     11: #include "dialog.h"
                     12: #include "sdlgui.h"
                     13: 
                     14: 
1.1.1.2   root       15: #define DLGSYS_68000    4
                     16: #define DLGSYS_68010    5
                     17: #define DLGSYS_68020    6
                     18: #define DLGSYS_68030    7
                     19: #define DLGSYS_68040    8
                     20: #define DLGSYS_ST       11
                     21: #define DLGSYS_STE      12
1.1.1.4 ! root       22: #define DLGSYS_TT       13
        !            23: #define DLGSYS_FALCON   14
        !            24: #define DLGSYS_8MHZ     17
        !            25: #define DLGSYS_16MHZ    18
        !            26: #define DLGSYS_32MHZ    19
        !            27: #define DLGSYS_PREFETCH 20
        !            28: #define DLGSYS_BLITTER  21
        !            29: #define DLGSYS_RTC      22
        !            30: #define DLGSYS_TIMERD   23
        !            31: #define DLGSYS_SLOWFDC  24
1.1       root       32: 
                     33: 
                     34: /* The "System" dialog: */
                     35: static SGOBJ systemdlg[] =
                     36: {
1.1.1.2   root       37:        { SGBOX, 0, 0, 0,0, 36,23, NULL },
                     38:        { SGTEXT, 0, 0, 11,1, 14,1, "System options" },
                     39: 
                     40:        { SGBOX, 0, 0, 2,3, 16,9, NULL },
                     41:        { SGTEXT, 0, 0, 3,4, 8,1, "CPU type:" },
                     42:        { SGRADIOBUT, 0, 0, 6,6, 7,1, "68000" },
                     43:        { SGRADIOBUT, 0, 0, 6,7, 7,1, "68010" },
                     44:        { SGRADIOBUT, 0, 0, 6,8, 7,1, "68020" },
                     45:        { SGRADIOBUT, 0, 0, 6,9, 11,1, "68020+FPU" },
                     46:        { SGRADIOBUT, 0, 0, 6,10, 7,1, "68040" },
                     47: 
                     48:        { SGBOX, 0, 0, 19,3, 15,9, NULL },
                     49:        { SGTEXT, 0, 0, 20,4, 13,1, "Machine type:" },
1.1.1.4 ! root       50:        { SGRADIOBUT, 0, 0, 23,6, 8,1, "ST" },
        !            51:        { SGRADIOBUT, 0, 0, 23,7, 8,1, "STE" },
        !            52:        { SGRADIOBUT, 0, 0, 23,8, 8,1, "TT *" },
        !            53:        { SGRADIOBUT, 0, 0, 23,9, 8,1, "Falcon *" },
        !            54:        { SGTEXT, 0, 0, 21,11, 12,1, "* incomplete" },
1.1.1.2   root       55: 
                     56:        { SGTEXT, 0, 0, 2,13, 15,1, "CPU clock (MHz):" },
                     57:        { SGRADIOBUT, 0, 0, 19,13, 3,1, "8" },
                     58:        { SGRADIOBUT, 0, 0, 24,13, 4,1, "16" },
                     59:        { SGRADIOBUT, 0, 0, 30,13, 4,1, "32" },
                     60: 
                     61:        { SGCHECKBOX, 0, 0, 2,15, 32,1, "Slower but more compatible CPU" },
                     62:        { SGCHECKBOX, 0, 0, 2,16, 20,1, "Blitter emulation" },
                     63:        { SGCHECKBOX, 0, 0, 2,17, 27,1, "Real time clock emulation" },
                     64:        { SGCHECKBOX, 0, 0, 2,18, 15,1, "Patch Timer-D" },
                     65:        { SGCHECKBOX, 0, 0, 2,19, 25,1, "Slow down FDC emulation" },
                     66: 
1.1.1.4 ! root       67:        { SGBUTTON, SG_DEFAULT, 0, 8,21, 20,1, "Back to main menu" },
1.1.1.2   root       68:        { -1, 0, 0, 0,0, 0,0, NULL }
1.1       root       69: };
                     70: 
                     71: 
                     72: /*-----------------------------------------------------------------------*/
                     73: /*
                     74:   Show and process the "System" dialog.
                     75: */
                     76: void Dialog_SystemDlg(void)
                     77: {
1.1.1.2   root       78:        int i;
1.1       root       79: 
1.1.1.2   root       80:        SDLGui_CenterDlg(systemdlg);
1.1       root       81: 
1.1.1.2   root       82:        /* Set up dialog from actual values: */
1.1       root       83: 
1.1.1.2   root       84:        for (i = DLGSYS_68000; i <= DLGSYS_68040; i++)
                     85:        {
                     86:                systemdlg[i].state &= ~SG_SELECTED;
                     87:        }
                     88:        systemdlg[DLGSYS_68000+DialogParams.System.nCpuLevel].state |= SG_SELECTED;
                     89: 
1.1.1.4 ! root       90:        for (i = DLGSYS_ST; i <= DLGSYS_FALCON; i++)
1.1.1.2   root       91:        {
                     92:                systemdlg[i].state &= ~SG_SELECTED;
                     93:        }
                     94:        systemdlg[DLGSYS_ST + DialogParams.System.nMachineType].state |= SG_SELECTED;
                     95: 
                     96:        for (i = DLGSYS_8MHZ; i <= DLGSYS_16MHZ; i++)
                     97:        {
                     98:                systemdlg[i].state &= ~SG_SELECTED;
                     99:        }
                    100:        if (DialogParams.System.nCpuFreq == 32)
                    101:          systemdlg[DLGSYS_32MHZ].state |= SG_SELECTED;
                    102:        else if (DialogParams.System.nCpuFreq == 16)
                    103:          systemdlg[DLGSYS_16MHZ].state |= SG_SELECTED;
                    104:        else
                    105:          systemdlg[DLGSYS_8MHZ].state |= SG_SELECTED;
                    106: 
                    107:        if (DialogParams.System.bCompatibleCpu)
                    108:                systemdlg[DLGSYS_PREFETCH].state |= SG_SELECTED;
                    109:        else
                    110:                systemdlg[DLGSYS_PREFETCH].state &= ~SG_SELECTED;
                    111: 
                    112:        if (DialogParams.System.bBlitter)
                    113:                systemdlg[DLGSYS_BLITTER].state |= SG_SELECTED;
                    114:        else
                    115:                systemdlg[DLGSYS_BLITTER].state &= ~SG_SELECTED;
                    116: 
                    117:        if (DialogParams.System.bRealTimeClock)
                    118:                systemdlg[DLGSYS_RTC].state |= SG_SELECTED;
                    119:        else
                    120:                systemdlg[DLGSYS_RTC].state &= ~SG_SELECTED;
                    121: 
                    122:        if (DialogParams.System.bPatchTimerD)
                    123:                systemdlg[DLGSYS_TIMERD].state |= SG_SELECTED;
                    124:        else
                    125:                systemdlg[DLGSYS_TIMERD].state &= ~SG_SELECTED;
                    126: 
                    127:        if (DialogParams.System.bSlowFDC)
                    128:                systemdlg[DLGSYS_SLOWFDC].state |= SG_SELECTED;
                    129:        else
                    130:                systemdlg[DLGSYS_SLOWFDC].state &= ~SG_SELECTED;
                    131: 
                    132:        /* Show the dialog: */
                    133:        SDLGui_DoDialog(systemdlg, NULL);
                    134: 
                    135:        /* Read values from dialog: */
                    136: 
                    137:        for (i = DLGSYS_68000; i <= DLGSYS_68040; i++)
                    138:        {
                    139:                if (systemdlg[i].state&SG_SELECTED)
                    140:                {
                    141:                        DialogParams.System.nCpuLevel = i-DLGSYS_68000;
                    142:                        break;
                    143:                }
                    144:        }
                    145: 
1.1.1.4 ! root      146:        for (i = DLGSYS_ST; i <= DLGSYS_FALCON; i++)
1.1.1.2   root      147:        {
                    148:                if (systemdlg[i].state&SG_SELECTED)
                    149:                {
                    150:                        DialogParams.System.nMachineType = i-DLGSYS_ST;
                    151:                        break;
                    152:                }
                    153:        }
                    154: 
                    155:        if (systemdlg[DLGSYS_32MHZ].state & SG_SELECTED)
                    156:                DialogParams.System.nCpuFreq = 32;
                    157:        else if (systemdlg[DLGSYS_16MHZ].state & SG_SELECTED)
                    158:                DialogParams.System.nCpuFreq = 16;
                    159:        else
                    160:                DialogParams.System.nCpuFreq = 8;
                    161: 
                    162:        DialogParams.System.bCompatibleCpu = (systemdlg[DLGSYS_PREFETCH].state & SG_SELECTED);
                    163:        DialogParams.System.bBlitter = (systemdlg[DLGSYS_BLITTER].state & SG_SELECTED);
                    164:        DialogParams.System.bRealTimeClock = (systemdlg[DLGSYS_RTC].state & SG_SELECTED);
                    165:        DialogParams.System.bPatchTimerD = (systemdlg[DLGSYS_TIMERD].state & SG_SELECTED);
                    166:        DialogParams.System.bSlowFDC = (systemdlg[DLGSYS_SLOWFDC].state & SG_SELECTED);
1.1       root      167: }

unix.superglobalmegacorp.com

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