|
|
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: */
1.1.1.6 ! root 7: const char DlgRom_rcsid[] = "Hatari $Id: dlgRom.c,v 1.10 2008-06-08 16:07:40 eerot Exp $";
1.1 root 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." },
1.1.1.4 root 40: { SGBUTTON, SG_DEFAULT, 0, 16,21, 20,1, "Back to main menu" },
1.1 root 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:
1.1.1.5 root 57: File_ShrinkName(szDlgTosName, ConfigureParams.Rom.szTosImageFileName, sizeof(szDlgTosName)-1);
1.1 root 58: romdlg[DLGROM_TOSNAME].txt = szDlgTosName;
59:
1.1.1.5 root 60: File_ShrinkName(szDlgCartName, ConfigureParams.Rom.szCartridgeImageFileName, sizeof(szDlgCartName)-1);
1.1 root 61: romdlg[DLGROM_CARTNAME].txt = szDlgCartName;
62:
63: do
64: {
1.1.1.2 root 65: but = SDLGui_DoDialog(romdlg, NULL);
1.1 root 66: switch (but)
67: {
68: case DLGROM_TOSBROWSE:
1.1.1.4 root 69: /* Show and process the file selection dlg */
70: SDLGui_FileConfSelect(szDlgTosName,
1.1.1.5 root 71: ConfigureParams.Rom.szTosImageFileName,
1.1.1.4 root 72: sizeof(szDlgTosName)-1,
73: FALSE);
1.1 root 74: break;
75:
76: case DLGROM_CARTEJECT:
77: szDlgCartName[0] = 0;
1.1.1.5 root 78: ConfigureParams.Rom.szCartridgeImageFileName[0] = 0;
1.1 root 79: break;
80:
81: case DLGROM_CARTBROWSE:
1.1.1.4 root 82: /* Show and process the file selection dlg */
83: SDLGui_FileConfSelect(szDlgCartName,
1.1.1.5 root 84: ConfigureParams.Rom.szCartridgeImageFileName,
1.1.1.4 root 85: sizeof(szDlgCartName)-1,
86: FALSE);
1.1 root 87: break;
88: }
89: }
1.1.1.4 root 90: while (but != DLGROM_EXIT && but != SDLGUI_QUIT
91: && but != SDLGUI_ERROR && !bQuitProgram);
1.1 root 92: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.