|
|
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.
6: */
7: char DlgSystem_rcsid[] = "Hatari $Id: dlgSystem.c,v 1.2 2004/03/01 13:57:30 thothy Exp $";
8:
9: #include "main.h"
10: #include "configuration.h"
11: #include "dialog.h"
12: #include "sdlgui.h"
13:
14:
15: #define DLGSYS_68000 3
16: #define DLGSYS_68010 4
17: #define DLGSYS_68020 5
18: #define DLGSYS_68030 6
19: #define DLGSYS_68040 7
20: #define DLGSYS_PREFETCH 8
21: #define DLGSYS_BLITTER 9
22: #define DLGSYS_TIMERD 10
23:
24:
25: /* The "System" dialog: */
26: static SGOBJ systemdlg[] =
27: {
28: { SGBOX, 0, 0, 0,0, 30,18, NULL },
29: { SGTEXT, 0, 0, 8,1, 14,1, "System options" },
30: { SGTEXT, 0, 0, 3,4, 8,1, "CPU Type:" },
31: { SGRADIOBUT, 0, 0, 16,4, 7,1, "68000" },
32: { SGRADIOBUT, 0, 0, 16,5, 7,1, "68010" },
33: { SGRADIOBUT, 0, 0, 16,6, 7,1, "68020" },
34: { SGRADIOBUT, 0, 0, 16,7, 11,1, "68020+FPU" },
35: { SGRADIOBUT, 0, 0, 16,8, 7,1, "68040" },
36: { SGCHECKBOX, 0, 0, 3,10, 24,1, "Use CPU prefetch mode" },
37: { SGCHECKBOX, 0, 0, 3,12, 20,1, "Blitter emulation" },
38: { SGCHECKBOX, 0, 0, 3,14, 15,1, "Patch Timer-D" },
39: { SGBUTTON, 0, 0, 5,16, 20,1, "Back to main menu" },
40: { -1, 0, 0, 0,0, 0,0, NULL }
41: };
42:
43:
44: /*-----------------------------------------------------------------------*/
45: /*
46: Show and process the "System" dialog.
47: */
48: void Dialog_SystemDlg(void)
49: {
50: int i;
51:
52: SDLGui_CenterDlg(systemdlg);
53:
54: /* Set up dialog from actual values: */
55:
56: for(i=DLGSYS_68000; i<=DLGSYS_68040; i++)
57: {
58: systemdlg[i].state &= ~SG_SELECTED;
59: }
60:
61: systemdlg[DLGSYS_68000+DialogParams.System.nCpuLevel].state |= SG_SELECTED;
62:
63: if( DialogParams.System.bCompatibleCpu )
64: systemdlg[DLGSYS_PREFETCH].state |= SG_SELECTED;
65: else
66: systemdlg[DLGSYS_PREFETCH].state &= ~SG_SELECTED;
67:
68: if( DialogParams.System.bBlitter )
69: systemdlg[DLGSYS_BLITTER].state |= SG_SELECTED;
70: else
71: systemdlg[DLGSYS_BLITTER].state &= ~SG_SELECTED;
72:
73: if (DialogParams.System.bPatchTimerD)
74: systemdlg[DLGSYS_TIMERD].state |= SG_SELECTED;
75: else
76: systemdlg[DLGSYS_TIMERD].state &= ~SG_SELECTED;
77:
78: /* Show the dialog: */
79: SDLGui_DoDialog(systemdlg);
80:
81: /* Read values from dialog: */
82:
83: for(i=DLGSYS_68000; i<=DLGSYS_68040; i++)
84: {
85: if( systemdlg[i].state&SG_SELECTED )
86: {
87: DialogParams.System.nCpuLevel = i-DLGSYS_68000;
88: break;
89: }
90: }
91:
92: DialogParams.System.bCompatibleCpu = (systemdlg[DLGSYS_PREFETCH].state & SG_SELECTED);
93: DialogParams.System.bBlitter = ( systemdlg[DLGSYS_BLITTER].state & SG_SELECTED );
94: DialogParams.System.bPatchTimerD = ( systemdlg[DLGSYS_TIMERD].state & SG_SELECTED );
95: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.