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

1.1       root        1: /*
                      2:   Hatari - dlgRom.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: const char DlgRom_fileid[] = "Hatari dlgRom.c : " __DATE__ " " __TIME__;
                      8: 
                      9: #include "main.h"
                     10: #include "configuration.h"
                     11: #include "dialog.h"
                     12: #include "sdlgui.h"
                     13: #include "file.h"
                     14: #include "paths.h"
                     15: 
                     16: 
                     17: #define DLGROM_ROM030_DEFAULT     4
                     18: #define DLGROM_ROM030_BROWSE      5
                     19: #define DLGROM_ROM030_NAME        6
                     20: 
                     21: #define DLGROM_ROM040_DEFAULT     9
                     22: #define DLGROM_ROM040_BROWSE     10
                     23: #define DLGROM_ROM040_NAME       11
                     24: 
                     25: #define DLGROM_ROMTURBO_DEFAULT  14
                     26: #define DLGROM_ROMTURBO_BROWSE   15
                     27: #define DLGROM_ROMTURBO_NAME     16
                     28: 
                     29: #define DLGROM_EXIT              18
                     30: 
                     31: 
                     32: 
                     33: /* The ROM dialog: */
                     34: static SGOBJ romdlg[] =
                     35: {
                     36:        { SGBOX, 0, 0, 0,0, 52,28, NULL },
                     37:     { SGTEXT, 0, 0, 22,1, 9,1, "ROM setup" },
                     38: 
                     39:        { SGBOX, 0, 0, 1,4, 50,5, NULL },
                     40:        { SGTEXT, 0, 0, 2,5, 30,1, "ROM for 68030 based systems:" },
                     41:     { SGBUTTON, 0, 0, 32,5, 9,1, "Default" },
                     42:        { SGBUTTON, 0, 0, 42,5, 8,1, "Browse" },
                     43:        { SGTEXT, 0, 0, 2,7, 46,1, NULL },
                     44:     
                     45:        { SGBOX, 0, 0, 1,10, 50,5, NULL },
                     46:        { SGTEXT, 0, 0, 2,11, 30,1, "ROM for 68040 based systems:" },
                     47:        { SGBUTTON, 0, 0, 32,11, 9,1, "Default" },
                     48:        { SGBUTTON, 0, 0, 42,11, 8,1, "Browse" },
                     49:        { SGTEXT, 0, 0, 2,13, 46,1, NULL },
                     50:     
                     51:     { SGBOX, 0, 0, 1,16, 50,5, NULL },
                     52:        { SGTEXT, 0, 0, 2,17, 30,1, "ROM for Turbo systems:" },
                     53:        { SGBUTTON, 0, 0, 32,17, 9,1, "Default" },
                     54:        { SGBUTTON, 0, 0, 42,17, 8,1, "Browse" },
                     55:        { SGTEXT, 0, 0, 2,19, 46,1, NULL },
                     56:     
                     57:        { SGTEXT, 0, 0, 2,23, 25,1, "A reset is needed after changing these options." },
                     58:        { SGBUTTON, SG_DEFAULT, 0, 15,25, 21,1, "Back to main menu" },
                     59:        { -1, 0, 0, 0,0, 0,0, NULL }
                     60: };
                     61: 
                     62: 
                     63: 
                     64: /*-----------------------------------------------------------------------*/
                     65: /**
                     66:  * Show and process the ROM dialog.
                     67:  */
                     68: void DlgRom_Main(void)
                     69: {
                     70:        char szDlgRom030Name[47];
                     71:        char szDlgRom040Name[47];
                     72:     char szDlgRomTurboName[47];
                     73:        int but;
                     74: 
                     75:        SDLGui_CenterDlg(romdlg);
                     76: 
                     77:        File_ShrinkName(szDlgRom030Name, ConfigureParams.Rom.szRom030FileName, sizeof(szDlgRom030Name)-1);
                     78:        romdlg[DLGROM_ROM030_NAME].txt = szDlgRom030Name;
                     79: 
                     80:        File_ShrinkName(szDlgRom040Name, ConfigureParams.Rom.szRom040FileName, sizeof(szDlgRom040Name)-1);
                     81:        romdlg[DLGROM_ROM040_NAME].txt = szDlgRom040Name;
                     82:     
                     83:     File_ShrinkName(szDlgRomTurboName, ConfigureParams.Rom.szRomTurboFileName, sizeof(szDlgRomTurboName)-1);
                     84:        romdlg[DLGROM_ROMTURBO_NAME].txt = szDlgRomTurboName;
                     85: 
                     86:        do
                     87:        {
                     88:                but = SDLGui_DoDialog(romdlg, NULL);
                     89:                switch (but)
                     90:                {
                     91:             case DLGROM_ROM030_DEFAULT:
                     92:                 sprintf(ConfigureParams.Rom.szRom030FileName, "%s%cRev_1.0_v41.BIN",
                     93:                         Paths_GetWorkingDir(), PATHSEP);
                     94:                 File_ShrinkName(szDlgRom030Name, ConfigureParams.Rom.szRom030FileName, sizeof(szDlgRom030Name)-1);
                     95:                 break;
                     96:                 
                     97:             case DLGROM_ROM030_BROWSE:
                     98:                 /* Show and process the file selection dlg */
                     99:                 SDLGui_FileConfSelect(szDlgRom030Name,
                    100:                                       ConfigureParams.Rom.szRom030FileName,
                    101:                                       sizeof(szDlgRom030Name)-1,
                    102:                                       false);
                    103:                 break;
                    104:                 
                    105:             case DLGROM_ROM040_DEFAULT:
                    106:                 sprintf(ConfigureParams.Rom.szRom040FileName, "%s%cRev_2.5_v66.BIN",
                    107:                         Paths_GetWorkingDir(), PATHSEP);
                    108:                 File_ShrinkName(szDlgRom040Name, ConfigureParams.Rom.szRom040FileName, sizeof(szDlgRom040Name)-1);
                    109:                 break;
                    110:                 
                    111:             case DLGROM_ROM040_BROWSE:
                    112:                 /* Show and process the file selection dlg */
                    113:                 SDLGui_FileConfSelect(szDlgRom040Name,
                    114:                                       ConfigureParams.Rom.szRom040FileName,
                    115:                                       sizeof(szDlgRom040Name)-1,
                    116:                                       false);
                    117:                 break;
                    118:                 
                    119:             case DLGROM_ROMTURBO_DEFAULT:
                    120:                 sprintf(ConfigureParams.Rom.szRomTurboFileName, "%s%cRev_3.3_v74.BIN",
                    121:                         Paths_GetWorkingDir(), PATHSEP);
                    122:                 File_ShrinkName(szDlgRomTurboName, ConfigureParams.Rom.szRomTurboFileName, sizeof(szDlgRomTurboName)-1);
                    123:                 break;
                    124:                 
                    125:             case DLGROM_ROMTURBO_BROWSE:
                    126:                 /* Show and process the file selection dlg */
                    127:                 SDLGui_FileConfSelect(szDlgRomTurboName,
                    128:                                       ConfigureParams.Rom.szRomTurboFileName,
                    129:                                       sizeof(szDlgRomTurboName)-1,
                    130:                                       false);
                    131:                 break;
                    132: 
                    133:                }
                    134:        }
                    135:        while (but != DLGROM_EXIT && but != SDLGUI_QUIT
                    136:               && but != SDLGUI_ERROR && !bQuitProgram);
                    137: }

unix.superglobalmegacorp.com

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