Annotation of previous_trunk/src/gui-sdl/dlgSystem.c, revision 1.1.1.1

1.1       root        1: /*
                      2:   Previous - 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: 
                      7: */
                      8: 
                      9: const char DlgSystem_fileid[] = "Previous dlgSystem.c : " __DATE__ " " __TIME__;
                     10: 
                     11: #include "main.h"
                     12: #include "configuration.h"
                     13: #include "dialog.h"
                     14: #include "sdlgui.h"
                     15: 
                     16: 
                     17: #define DLGSYS_CUBE030    4
                     18: #define DLGSYS_CUBE       5
                     19: #define DLGSYS_CUBETURBO  6
                     20: #define DLGSYS_SLAB       7
                     21: #define DLGSYS_SLABTURBO  8
                     22: #define DLGSYS_SLABCOLOR  9
                     23: 
                     24: #define DLGSYS_CUSTOMIZE  10
                     25: #define DLGSYS_RESET      11
                     26: 
                     27: #define DLGSYS_EXIT       32
                     28: 
                     29: /* Variable strings */
                     30: char cpu_type[16] = "68030";
                     31: char cpu_clock[16] = "25 MHz";
                     32: char fpu_type[16] = "68882";
                     33: char dsp_type[16] = "56001";
                     34: char dsp_memory[16] = "24 kB";
                     35: char main_memory[16] = "8 MB";
                     36: char scsi_controller[16] = "NCR53C90";
                     37: char rtc_chip[16] = "MC68HC68T1";
                     38: char nbic_present[16] = "none";
                     39: 
                     40: /* Additional functions */
                     41: void print_system_overview(void);
                     42: void update_system_selection(void);
                     43: void get_default_values(void);
                     44: 
                     45: 
                     46: static SGOBJ systemdlg[] =
                     47: {
                     48:     { SGBOX, 0, 0, 0,0, 58,27, NULL },
                     49:     { SGTEXT, 0, 0, 22,1, 14,1, "System options" },
                     50:     
                     51:     { SGBOX, 0, 0, 2,3, 25,17, NULL },
                     52:     { SGTEXT, 0, 0, 3,4, 14,1, "Machine type" },
                     53:     { SGRADIOBUT, 0, 0, 5,6, 15,1, "NeXT Computer" },
                     54:     { SGRADIOBUT, 0, 0, 5,8, 10,1, "NeXTcube" },
                     55:     { SGCHECKBOX, 0, 0, 7,9, 7,1, "Turbo" },
                     56:     { SGRADIOBUT, 0, 0, 5,11, 13,1, "NeXTstation" },
                     57:     { SGCHECKBOX, 0, 0, 7,12, 7,1, "Turbo" },
                     58:     { SGCHECKBOX, 0, 0, 7,13, 7,1, "Color" },
                     59:     
                     60:     { SGBUTTON, SG_DEFAULT, 0, 5,16, 19,1, "Customize" },
                     61:     { SGBUTTON, SG_DEFAULT, 0, 5,18, 19,1, "System defaults" },
                     62: 
                     63:     { SGTEXT, 0, 0, 30,4, 13,1, "System overview:" },
                     64:     { SGTEXT, 0, 0, 30,6, 13,1, "CPU clock:" },
                     65:     { SGTEXT, 0, 0, 44,6, 13,1, cpu_clock },
                     66:     { SGTEXT, 0, 0, 30,7, 13,1, "CPU type:" },
                     67:     { SGTEXT, 0, 0, 44,7, 13,1, cpu_type },
                     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, "DSP type:" },
                     71:     { SGTEXT, 0, 0, 44,9, 13,1, dsp_type },
                     72:     { SGTEXT, 0, 0, 30,10, 13,1, "DSP memory:" },
                     73:     { SGTEXT, 0, 0, 44,10, 13,1, dsp_memory },
                     74:     { SGTEXT, 0, 0, 30,11, 13,1, "Main memory:" },
                     75:     { SGTEXT, 0, 0, 44,11, 13,1, main_memory },
                     76:     { SGTEXT, 0, 0, 30,12, 13,1, "SCSI chip:" },
                     77:     { SGTEXT, 0, 0, 44,12, 13,1, scsi_controller },
                     78:     { SGTEXT, 0, 0, 30,13, 13,1, "RTC chip:" },
                     79:     { SGTEXT, 0, 0, 44,13, 13,1, rtc_chip },
                     80:     { SGTEXT, 0, 0, 30,14, 13,1, "NBIC:" },
                     81:     { SGTEXT, 0, 0, 44,14, 13,1, nbic_present },
                     82: 
                     83:     { SGTEXT, 0, 0, 4,21, 13,1, "Changing machine type resets all advanced options." },
                     84:     
                     85:     { SGBUTTON, SG_DEFAULT, 0, 18,24, 21,1, "Back to main menu" },
                     86: 
                     87:     { -1, 0, 0, 0,0, 0,0, NULL }
                     88: };
                     89: 
                     90: 
                     91: /* Function to print system overview */
                     92: 
                     93: void print_system_overview(void) {
                     94:     switch (ConfigureParams.System.nCpuLevel) {
                     95:         case 0:
                     96:             sprintf(cpu_type, "68000"); break;
                     97:         case 1:
                     98:             sprintf(cpu_type, "68010"); break;
                     99:         case 2:
                    100:             sprintf(cpu_type, "68020"); break;
                    101:         case 3:
                    102:             sprintf(cpu_type, "68030"); break;
                    103:         case 4:
                    104:             sprintf(cpu_type, "68040"); break;
                    105:         case 5:
                    106:             sprintf(cpu_type, "68060"); break;
                    107:         default: break;
                    108:     }
                    109:     
                    110:     if(ConfigureParams.System.bRealtime) sprintf(cpu_clock, "Variable");
                    111:     else                                 sprintf(cpu_clock, "%i MHz", ConfigureParams.System.nCpuFreq);
                    112:     
                    113:     sprintf(main_memory, "%i MB", Configuration_CheckMemory(ConfigureParams.Memory.nMemoryBankSize));
                    114:     
                    115:     sprintf(dsp_memory, "%i kB", ConfigureParams.System.bDSPMemoryExpansion?96:24);
                    116:     
                    117:     switch (ConfigureParams.System.n_FPUType) {
                    118:         case FPU_NONE:
                    119:             sprintf(fpu_type, "none"); break;
                    120:         case FPU_68881:
                    121:             sprintf(fpu_type, "68881"); break;
                    122:         case FPU_68882:
                    123:             sprintf(fpu_type, "68882"); break;
                    124:         case FPU_CPU:
                    125:             sprintf(fpu_type, "68040"); break;
                    126:         default: break;
                    127:     }
                    128:     
                    129:     switch (ConfigureParams.System.nDSPType) {
                    130:         case DSP_TYPE_NONE:
                    131:         case DSP_TYPE_DUMMY:
                    132:             sprintf(dsp_type, "none"); break;
                    133:         case DSP_TYPE_EMU:
                    134:             sprintf(dsp_type, "56001"); break;
                    135:             
                    136:         default: break;
                    137:     }
                    138:     
                    139:     switch (ConfigureParams.System.nSCSI) {
                    140:         case NCR53C90:
                    141:             sprintf(scsi_controller, "NCR53C90"); break;
                    142:         case NCR53C90A:
                    143:             sprintf(scsi_controller, "NCR53C90A"); break;
                    144:         default: break;
                    145:     }
                    146:     
                    147:     switch (ConfigureParams.System.nRTC) {
                    148:         case MC68HC68T1:
                    149:             sprintf(rtc_chip, "MC68HC68T1"); break;
                    150:         case MCCS1850:
                    151:             sprintf(rtc_chip, "MCCS1850"); break;
                    152:         default: break;
                    153:     }
                    154:     
                    155:     if (ConfigureParams.System.bNBIC) {
                    156:         sprintf(nbic_present, "present");
                    157:     } else {
                    158:         sprintf(nbic_present, "none");
                    159:     }
                    160:     
                    161:     update_system_selection();
                    162: }
                    163: 
                    164: 
                    165: /* Function to select and unselect system options */
                    166: void update_system_selection(void) {
                    167:     switch (ConfigureParams.System.nMachineType) {
                    168:         case NEXT_CUBE030:
                    169:             systemdlg[DLGSYS_CUBE030].state |= SG_SELECTED;
                    170:             systemdlg[DLGSYS_CUBE].state &= ~SG_SELECTED;
                    171:             systemdlg[DLGSYS_CUBETURBO].state &= ~SG_SELECTED;
                    172:             systemdlg[DLGSYS_SLAB].state &= ~SG_SELECTED;
                    173:             systemdlg[DLGSYS_SLABCOLOR].state &= ~SG_SELECTED;
                    174:             systemdlg[DLGSYS_SLABTURBO].state &= ~SG_SELECTED;
                    175:             break;
                    176:         case NEXT_CUBE040:
                    177:             systemdlg[DLGSYS_CUBE030].state &= ~SG_SELECTED;
                    178:             systemdlg[DLGSYS_CUBE].state |= SG_SELECTED;
                    179:             if (ConfigureParams.System.bTurbo) {
                    180:                 systemdlg[DLGSYS_CUBETURBO].state |= SG_SELECTED;
                    181:             } else {
                    182:                 systemdlg[DLGSYS_CUBETURBO].state &= ~SG_SELECTED;
                    183:             }
                    184:             systemdlg[DLGSYS_SLAB].state &= ~SG_SELECTED;
                    185:             systemdlg[DLGSYS_SLABCOLOR].state &= ~SG_SELECTED;
                    186:             systemdlg[DLGSYS_SLABTURBO].state &= ~SG_SELECTED;
                    187:             break;
                    188:         case NEXT_STATION:
                    189:             systemdlg[DLGSYS_CUBE030].state &= ~SG_SELECTED;
                    190:             systemdlg[DLGSYS_CUBE].state &= ~SG_SELECTED;
                    191:             systemdlg[DLGSYS_CUBETURBO].state &= ~SG_SELECTED;
                    192:             systemdlg[DLGSYS_SLAB].state |= SG_SELECTED;
                    193:             if (ConfigureParams.System.bTurbo) {
                    194:                 systemdlg[DLGSYS_SLABTURBO].state |= SG_SELECTED;
                    195:             } else {
                    196:                 systemdlg[DLGSYS_SLABTURBO].state &= ~SG_SELECTED;
                    197:             }
                    198:             if (ConfigureParams.System.bColor) {
                    199:                 systemdlg[DLGSYS_SLABCOLOR].state |= SG_SELECTED;
                    200:             } else {
                    201:                 systemdlg[DLGSYS_SLABCOLOR].state &= ~SG_SELECTED;
                    202:             }
                    203:             break;
                    204:             
                    205:         default:
                    206:             break;
                    207:     }
                    208: }
                    209: 
                    210: 
                    211: /* Function to get default values for each system */
                    212: void get_default_values(void) {
                    213:     Configuration_SetSystemDefaults();
                    214: }
                    215: 
                    216: 
                    217: /*-----------------------------------------------------------------------*/
                    218: /**
                    219:   * Show and process the "System" dialog (specific to winUAE cpu).
                    220:   */
                    221: void Dialog_SystemDlg(void)
                    222: {
                    223:        int i;
                    224:     int but;
                    225:  
                    226:        SDLGui_CenterDlg(systemdlg);
                    227:  
                    228:        /* Set up dialog from actual values: */
                    229:     
                    230:     /* System type: */
                    231:        for (i = DLGSYS_CUBE030; i <= DLGSYS_SLAB; i++)
                    232:        {
                    233:                systemdlg[i].state &= ~SG_SELECTED;
                    234:        }
                    235:     if (ConfigureParams.System.nMachineType == NEXT_CUBE030)
                    236:         systemdlg[DLGSYS_CUBE030].state |= SG_SELECTED;
                    237:     else if (ConfigureParams.System.nMachineType == NEXT_STATION)
                    238:         systemdlg[DLGSYS_SLAB].state |= SG_SELECTED;
                    239:  
                    240:          
                    241:     /* System overview */
                    242:     print_system_overview();
                    243:      
                    244:                
                    245:        /* Draw and process the dialog: */
                    246: 
                    247:     do
                    248:        {
                    249:         but = SDLGui_DoDialog(systemdlg, NULL);
                    250:         switch (but) {
                    251:             case DLGSYS_CUBE030:
                    252:                 ConfigureParams.System.nMachineType = NEXT_CUBE030;
                    253:                 get_default_values();
                    254:                 break;
                    255:                 
                    256:             case DLGSYS_CUBE:
                    257:                                if (ConfigureParams.System.nMachineType!=NEXT_CUBE040) {
                    258:                                        ConfigureParams.System.bTurbo = false;
                    259:                                }
                    260:                 ConfigureParams.System.nMachineType = NEXT_CUBE040;
                    261:                 get_default_values();
                    262:                 break;
                    263:                 
                    264:             case DLGSYS_CUBETURBO:
                    265:                 if (ConfigureParams.System.bTurbo &&
                    266:                                        ConfigureParams.System.nMachineType==NEXT_CUBE040) {
                    267:                     ConfigureParams.System.bTurbo = false;
                    268:                 } else {
                    269:                     ConfigureParams.System.bTurbo = true;
                    270:                 }
                    271:                                ConfigureParams.System.nMachineType = NEXT_CUBE040;
                    272:                 get_default_values();
                    273:                 break;
                    274:                 
                    275:             case DLGSYS_SLAB:
                    276:                                if (ConfigureParams.System.nMachineType!=NEXT_STATION) {
                    277:                                        ConfigureParams.System.bTurbo = false;
                    278:                                }
                    279:                 ConfigureParams.System.nMachineType = NEXT_STATION;
                    280:                 get_default_values();
                    281:                 break;
                    282:                 
                    283:             case DLGSYS_SLABCOLOR:
                    284:                                if (ConfigureParams.System.nMachineType!=NEXT_STATION) {
                    285:                                        ConfigureParams.System.bTurbo = false;
                    286:                                }
                    287:                 if (ConfigureParams.System.bColor) {
                    288:                     ConfigureParams.System.bColor = false;
                    289:                 } else {
                    290:                     ConfigureParams.System.bColor = true;
                    291:                 }
                    292:                                ConfigureParams.System.nMachineType = NEXT_STATION;
                    293:                 get_default_values();
                    294:                 break;
                    295:                 
                    296:             case DLGSYS_SLABTURBO:
                    297:                                if (ConfigureParams.System.bTurbo &&
                    298:                                        ConfigureParams.System.nMachineType==NEXT_STATION) {
                    299:                     ConfigureParams.System.bTurbo = false;
                    300:                 } else {
                    301:                     ConfigureParams.System.bTurbo = true;
                    302:                 }
                    303:                                ConfigureParams.System.nMachineType = NEXT_STATION;
                    304:                 get_default_values();
                    305:                 break;
                    306:                                 
                    307:             case DLGSYS_CUSTOMIZE:
                    308:                 Dialog_AdvancedDlg();
                    309:                 break;
                    310:                 
                    311:             case DLGSYS_RESET:
                    312:                                ConfigureParams.System.bRealtime = false;
                    313:                 get_default_values();
                    314:                 break;
                    315: 
                    316:             default:
                    317:                 break;
                    318:         }
                    319:                
                    320:                print_system_overview();
                    321:     }
                    322:     while (but != DLGSYS_EXIT && but != SDLGUI_QUIT
                    323:            && but != SDLGUI_ERROR && !bQuitProgram);
                    324:     
                    325:   
                    326:     /* Obsolete */
                    327:        ConfigureParams.System.bCompatibleCpu = 1;
                    328:        ConfigureParams.System.bRealTimeClock = 0;
                    329:        ConfigureParams.System.bCompatibleFPU = 1;
                    330:        ConfigureParams.System.bMMU = 1;
                    331: }
                    332: 

unix.superglobalmegacorp.com

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