Annotation of previous/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: 
                     15: 
                     16: #define DLGROM_TOSBROWSE  4
                     17: #define DLGROM_TOSNAME    5
                     18: #define DLGROM_CARTEJECT  9
                     19: #define DLGROM_CARTBROWSE 10
                     20: #define DLGROM_CARTNAME   11
                     21: #define DLGROM_EXIT       13
                     22: 
                     23: 
                     24: /* The ROM dialog: */
                     25: static SGOBJ romdlg[] =
                     26: {
                     27:        { SGBOX, 0, 0, 0,0, 52,23, NULL },
                     28:        { SGBOX, 0, 0, 1,1, 50,8, NULL },
                     29:        { SGTEXT, 0, 0, 22,2, 9,1, "TOS setup" },
                     30:        { SGTEXT, 0, 0, 2,5, 25,1, "TOS image:" },
                     31:        { SGBUTTON, 0, 0, 42,5, 8,1, "Browse" },
                     32:        { SGTEXT, 0, 0, 2,7, 46,1, NULL },
                     33:        { SGBOX, 0, 0, 1,10, 50,8, NULL },
                     34:        { SGTEXT, 0, 0, 18,11, 15,1, "Cartridge setup" },
                     35:        { SGTEXT, 0, 0, 2,14, 25,1, "Cartridge image:" },
                     36:        { SGBUTTON, 0, 0, 32,14, 8,1, "Eject" },
                     37:        { SGBUTTON, 0, 0, 42,14, 8,1, "Browse" },
                     38:        { SGTEXT, 0, 0, 2,16, 46,1, NULL },
                     39:        { SGTEXT, 0, 0, 2,19, 25,1, "A reset is needed after changing these options." },
                     40:        { SGBUTTON, SG_DEFAULT, 0, 16,21, 20,1, "Back to main menu" },
                     41:        { -1, 0, 0, 0,0, 0,0, NULL }
                     42: };
                     43: 
                     44: 
                     45: /*-----------------------------------------------------------------------*/
                     46: /**
                     47:  * Show and process the ROM dialog.
                     48:  */
                     49: void DlgRom_Main(void)
                     50: {
                     51:        char szDlgTosName[47];
                     52:        char szDlgCartName[47];
                     53:        int but;
                     54: 
                     55:        SDLGui_CenterDlg(romdlg);
                     56: 
                     57:        File_ShrinkName(szDlgTosName, ConfigureParams.Rom.szTosImageFileName, sizeof(szDlgTosName)-1);
                     58:        romdlg[DLGROM_TOSNAME].txt = szDlgTosName;
                     59: 
                     60:        File_ShrinkName(szDlgCartName, ConfigureParams.Rom.szCartridgeImageFileName, sizeof(szDlgCartName)-1);
                     61:        romdlg[DLGROM_CARTNAME].txt = szDlgCartName;
                     62: 
                     63:        do
                     64:        {
                     65:                but = SDLGui_DoDialog(romdlg, NULL);
                     66:                switch (but)
                     67:                {
                     68:                 case DLGROM_TOSBROWSE:
                     69:                        /* Show and process the file selection dlg */
                     70:                        SDLGui_FileConfSelect(szDlgTosName,
                     71:                                              ConfigureParams.Rom.szTosImageFileName,
                     72:                                              sizeof(szDlgTosName)-1,
                     73:                                              false);
                     74:                        break;
                     75: 
                     76:                 case DLGROM_CARTEJECT:
                     77:                        szDlgCartName[0] = 0;
                     78:                        ConfigureParams.Rom.szCartridgeImageFileName[0] = 0;
                     79:                        break;
                     80: 
                     81:                 case DLGROM_CARTBROWSE:
                     82:                        /* Show and process the file selection dlg */
                     83:                        SDLGui_FileConfSelect(szDlgCartName,
                     84:                                              ConfigureParams.Rom.szCartridgeImageFileName,
                     85:                                               sizeof(szDlgCartName)-1,
                     86:                                              false);
                     87:                        break;
                     88:                }
                     89:        }
                     90:        while (but != DLGROM_EXIT && but != SDLGUI_QUIT
                     91:               && but != SDLGUI_ERROR && !bQuitProgram);
                     92: }

unix.superglobalmegacorp.com

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