Annotation of previous/src/gui-sdl/dlgSystem.c, revision 1.1.1.3

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.
1.1.1.2   root        6: 
                      7:  This file contains 2 system panels :
                      8:     - 1 for the old uae CPU
                      9:     - 1 for the new WinUae cpu
                     10: 
                     11:  The selection is made during compilation with the ENABLE_WINUAE_CPU define
                     12: 
1.1       root       13: */
                     14: const char DlgSystem_fileid[] = "Hatari dlgSystem.c : " __DATE__ " " __TIME__;
                     15: 
                     16: #include "main.h"
                     17: #include "configuration.h"
                     18: #include "dialog.h"
                     19: #include "sdlgui.h"
                     20: 
                     21: 
1.1.1.3 ! root       22: #define DLGSYS_CUBE030    4
        !            23: #define DLGSYS_SLAB       5
        !            24: #define DLGSYS_COLOR      6
        !            25: #define DLGSYS_TURBO      7
        !            26: 
        !            27: #define DLGSYS_CUSTOMIZE  8
        !            28: #define DLGSYS_RESET      9
        !            29: 
        !            30: #define DLGSYS_EXIT       25
        !            31: 
        !            32: /* Variable strings */
        !            33: char cpu_type[16] = "68030";
        !            34: char cpu_clock[16] = "25 MHz";
        !            35: char fpu_type[16] = "68882";
        !            36: char memory_size[16] = "8 MB";
        !            37: char scsi_controller[16] = "NCR53C90";
        !            38: char rtc_chip[16] = "MC68HC68T1";
        !            39: char emulate_adb[16] = " ";
        !            40: 
        !            41: /* Additional functions */
        !            42: void print_system_overview(void);
        !            43: void get_default_values(void);
1.1       root       44: 
                     45: 
                     46: 
                     47: 
1.1.1.3 ! root       48: static SGOBJ systemdlg[] =
1.1       root       49: {
1.1.1.3 ! root       50:        { SGBOX, 0, 0, 0,0, 60,24, NULL },
        !            51:        { SGTEXT, 0, 0, 23,1, 14,1, "System options" },
        !            52:   
        !            53:        { SGBOX, 0, 0, 2,3, 26,14, NULL },
        !            54:        { SGTEXT, 0, 0, 3,4, 14,1, "Machine type" },
        !            55:        { SGRADIOBUT, 0, 0, 5,6, 15,1, "NeXT Computer" },
        !            56:        { SGRADIOBUT, 0, 0, 5,8, 13,1, "NeXTstation" },
        !            57:     { SGCHECKBOX, 0, 0, 7,9, 7,1, "Color" },
        !            58:     { SGCHECKBOX, 0, 0, 7,10, 7,1, "Turbo" },
        !            59:     
        !            60:     { SGBUTTON, SG_DEFAULT, 0, 5,13, 20,1, "Customize" },
        !            61:     { SGBUTTON, SG_DEFAULT, 0, 5,15, 20,1, "System defaults" },
        !            62:         
        !            63:        { SGTEXT, 0, 0, 30,4, 13,1, "System overview:" },
        !            64:     { SGTEXT, 0, 0, 30,6, 13,1, "CPU type:" },
        !            65:     { SGTEXT, 0, 0, 44,6, 13,1, cpu_type },
        !            66:     { SGTEXT, 0, 0, 30,7, 13,1, "CPU clock:" },
        !            67:     { SGTEXT, 0, 0, 44,7, 13,1, cpu_clock },
        !            68:     { SGTEXT, 0, 0, 30,8, 13,1, "FPU type:" },
        !            69:     { SGTEXT, 0, 0, 44,8, 13,1, fpu_type },
        !            70:     { SGTEXT, 0, 0, 30,9, 13,1, "Memory size:" },
        !            71:     { SGTEXT, 0, 0, 44,9, 13,1, memory_size },
        !            72:     { SGTEXT, 0, 0, 30,10, 13,1, "SCSI chip:" },
        !            73:     { SGTEXT, 0, 0, 44,10, 13,1, scsi_controller },
        !            74:     { SGTEXT, 0, 0, 30,11, 13,1, "RTC chip:" },
        !            75:     { SGTEXT, 0, 0, 44,11, 13,1, rtc_chip },
        !            76:     { SGTEXT, 0, 0, 30,13, 13,1, emulate_adb },
        !            77:     
        !            78:     { SGTEXT, 0, 0, 4,18, 13,1, "Changing machine type resets all advanced options." },
        !            79:     
        !            80:        { SGBUTTON, SG_DEFAULT, 0, 21,21, 20,1, "Back to main menu" },
        !            81:        { -1, 0, 0, 0,0, 0,0, NULL }
        !            82:  };
1.1       root       83: 
                     84: 
1.1.1.3 ! root       85: /* Function to print system overview */
1.1       root       86: 
1.1.1.3 ! root       87: void print_system_overview(void) {
        !            88:     switch (ConfigureParams.System.nCpuLevel) {
        !            89:         case 0:
        !            90:             sprintf(cpu_type, "68000"); break;
        !            91:         case 1:
        !            92:             sprintf(cpu_type, "68010"); break;
        !            93:         case 2:
        !            94:             sprintf(cpu_type, "68020"); break;
        !            95:         case 3:
        !            96:             sprintf(cpu_type, "68030"); break;
        !            97:         case 4:
        !            98:             sprintf(cpu_type, "68040"); break;
        !            99:         case 5:
        !           100:             sprintf(cpu_type, "68060"); break;
        !           101:         default: break;
        !           102:     }
        !           103:     
        !           104:     sprintf(cpu_clock, "%i MHz", ConfigureParams.System.nCpuFreq);
        !           105:     
        !           106:     sprintf(memory_size, "%i MB", Configuration_CheckMemory(ConfigureParams.Memory.nMemoryBankSize));
        !           107:     
        !           108:     switch (ConfigureParams.System.n_FPUType) {
        !           109:         case FPU_NONE:
        !           110:             sprintf(fpu_type, "none"); break;
        !           111:         case FPU_68881:
        !           112:             sprintf(fpu_type, "68881"); break;
        !           113:         case FPU_68882:
        !           114:             sprintf(fpu_type, "68882"); break;
        !           115:         case FPU_CPU:
        !           116:             sprintf(fpu_type, "68040 internal"); break;
        !           117:         default: break;
        !           118:     }
        !           119:     
        !           120:     switch (ConfigureParams.System.nSCSI) {
        !           121:         case NCR53C90:
        !           122:             sprintf(scsi_controller, "NCR53C90"); break;
        !           123:         case NCR53C90A:
        !           124:             sprintf(scsi_controller, "NCR53C90A"); break;
        !           125:         default: break;
        !           126:     }
        !           127:     
        !           128:     switch (ConfigureParams.System.nRTC) {
        !           129:         case MC68HC68T1:
        !           130:             sprintf(rtc_chip, "MC68HC68T1"); break;
        !           131:         case MCS1850:
        !           132:             sprintf(rtc_chip, "MCS1850"); break;
        !           133:         default: break;
        !           134:     }
        !           135:     
        !           136:     if (ConfigureParams.System.bADB)
        !           137:         sprintf(emulate_adb, "ADB emulated");
        !           138:     else
        !           139:         sprintf(emulate_adb, " ");
1.1       root      140: }
1.1.1.2   root      141: 
                    142: 
1.1.1.3 ! root      143: /* Function to get default values for each system */
        !           144: void get_default_values(void) {
        !           145:     switch (ConfigureParams.System.nMachineType) {
        !           146:         case NEXT_CUBE030:
        !           147:             ConfigureParams.System.nCpuLevel = 3;
        !           148:             ConfigureParams.System.nCpuFreq = 25;
        !           149:             ConfigureParams.System.n_FPUType = FPU_68882;
        !           150:             ConfigureParams.System.nSCSI = NCR53C90;
        !           151:             ConfigureParams.System.nRTC = MC68HC68T1;
        !           152:             ConfigureParams.System.bADB = false;
        !           153:             break;
        !           154:             
        !           155:         case NEXT_STATION:
        !           156:             ConfigureParams.System.nMachineType = NEXT_STATION;
        !           157:             ConfigureParams.System.nCpuLevel = 4;
        !           158:             if (ConfigureParams.System.bTurbo)
        !           159:                 ConfigureParams.System.nCpuFreq = 33;
        !           160:             else
        !           161:                 ConfigureParams.System.nCpuFreq = 25;
        !           162:             ConfigureParams.System.n_FPUType = FPU_CPU;
        !           163:             ConfigureParams.System.nSCSI = NCR53C90A;
        !           164:             ConfigureParams.System.nRTC = MCS1850;
        !           165:             ConfigureParams.System.bADB = false;
        !           166:             break;
        !           167:         default:
        !           168:             break;
        !           169:     }
        !           170: }
1.1.1.2   root      171: 
                    172: 
                    173: /*-----------------------------------------------------------------------*/
                    174: /**
                    175:   * Show and process the "System" dialog (specific to winUAE cpu).
                    176:   */
                    177: void Dialog_SystemDlg(void)
                    178: {
                    179:        int i;
1.1.1.3 ! root      180:     int but;
1.1.1.2   root      181:  
                    182:        SDLGui_CenterDlg(systemdlg);
                    183:  
                    184:        /* Set up dialog from actual values: */
1.1.1.3 ! root      185:     
        !           186:     /* System type: */
        !           187:        for (i = DLGSYS_CUBE030; i <= DLGSYS_SLAB; i++)
1.1.1.2   root      188:        {
                    189:                systemdlg[i].state &= ~SG_SELECTED;
                    190:        }
1.1.1.3 ! root      191:     if (ConfigureParams.System.nMachineType == NEXT_CUBE030)
        !           192:         systemdlg[DLGSYS_CUBE030].state |= SG_SELECTED;
        !           193:     else if (ConfigureParams.System.nMachineType == NEXT_STATION)
        !           194:         systemdlg[DLGSYS_SLAB].state |= SG_SELECTED;
        !           195:  
        !           196:          
        !           197:     /* System overview */
        !           198:     print_system_overview();
        !           199:      
1.1.1.2   root      200:                
1.1.1.3 ! root      201:        /* Draw and process the dialog: */
        !           202: 
        !           203:     do
        !           204:        {
        !           205:         but = SDLGui_DoDialog(systemdlg, NULL);
        !           206:         switch (but) {
        !           207:             case DLGSYS_CUBE030:
        !           208:                 ConfigureParams.System.nMachineType = NEXT_CUBE030;
        !           209:                 systemdlg[DLGSYS_COLOR].state &= ~SG_SELECTED;
        !           210:                 ConfigureParams.System.bColor = false;
        !           211:                 systemdlg[DLGSYS_TURBO].state &= ~SG_SELECTED;
        !           212:                 ConfigureParams.System.bTurbo = false;
        !           213:                 get_default_values();
        !           214:                 print_system_overview();
        !           215:                 break;
        !           216:                 
        !           217:             case DLGSYS_SLAB:
        !           218:                 ConfigureParams.System.nMachineType = NEXT_STATION;
        !           219:                 get_default_values();
        !           220:                 print_system_overview();
        !           221:                 break;
        !           222:                 
        !           223:             case DLGSYS_COLOR:
        !           224:                 ConfigureParams.System.nMachineType = NEXT_STATION;
        !           225:                 if (systemdlg[DLGSYS_COLOR].state & SG_SELECTED) {
        !           226:                     systemdlg[DLGSYS_CUBE030].state &= ~SG_SELECTED;
        !           227:                     systemdlg[DLGSYS_SLAB].state |= SG_SELECTED;
        !           228:                     ConfigureParams.System.bColor = true;
        !           229:                 } else {
        !           230:                     ConfigureParams.System.bColor = false;
        !           231:                 }
        !           232:                 get_default_values();
        !           233:                 print_system_overview();
        !           234:                 break;
        !           235:                 
        !           236:             case DLGSYS_TURBO:
        !           237:                 ConfigureParams.System.nMachineType = NEXT_STATION;
        !           238:                 if (systemdlg[DLGSYS_TURBO].state & SG_SELECTED) {
        !           239:                     systemdlg[DLGSYS_CUBE030].state &= ~SG_SELECTED;
        !           240:                     systemdlg[DLGSYS_SLAB].state |= SG_SELECTED;
        !           241:                     ConfigureParams.System.bTurbo = true;
        !           242:                 } else {
        !           243:                     ConfigureParams.System.bTurbo = false;
        !           244:                 }
        !           245:                 get_default_values();
        !           246:                 print_system_overview();
        !           247:                 break;
        !           248:                                 
        !           249:             case DLGSYS_CUSTOMIZE:
        !           250:                 Dialog_AdvancedDlg();
        !           251:                 print_system_overview();
        !           252:                 break;
        !           253:                 
        !           254:             case DLGSYS_RESET:
        !           255:                 get_default_values();
        !           256:                 print_system_overview();
        !           257:                 break;
        !           258: 
        !           259:             default:
        !           260:                 break;
        !           261:         }
        !           262:     }
        !           263:     while (but != DLGSYS_EXIT && but != SDLGUI_QUIT
        !           264:            && but != SDLGUI_ERROR && !bQuitProgram);
        !           265:     
1.1.1.2   root      266:  
                    267:        /* Read values from dialog: */
                    268:  
1.1.1.3 ! root      269: //    if (systemdlg[DLGSYS_CUBE030].state&SG_SELECTED)
        !           270: //        ConfigureParams.System.nMachineType = NEXT_CUBE030;
        !           271: //    else if (systemdlg[DLGSYS_SLAB].state&SG_SELECTED)
        !           272: //        ConfigureParams.System.nMachineType = NEXT_STATION;
        !           273:      
        !           274:     /* Obsolete */
        !           275:        ConfigureParams.System.bCompatibleCpu = 1;
        !           276:        ConfigureParams.System.bBlitter = 0;
        !           277:        ConfigureParams.System.bRealTimeClock = 0;
        !           278:        ConfigureParams.System.bPatchTimerD = 0;
        !           279:        ConfigureParams.System.bAddressSpace24 = 0;
        !           280:        ConfigureParams.System.bCycleExactCpu = 0;
        !           281:        ConfigureParams.System.bCompatibleFPU = 1;
        !           282:        ConfigureParams.System.bMMU = 1;
1.1.1.2   root      283: }
1.1.1.3 ! root      284: 

unix.superglobalmegacorp.com

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