source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Dialogs.asm@ 64

Last change on this file since 64 was 59, checked in by Tomi Tilli, 14 years ago

Changes to Configuration Program v2:

  • Menu structure should now be complete.
File size: 4.8 KB
Line 
1; File name : Dialogs.asm
2; Project name : XTIDE Univeral BIOS Configurator v2
3; Created date : 10.10.2010
4; Last update : 19.11.2010
5; Author : Tomi Tilli
6; Description : Functions for displaying dialogs.
7
8; Section containing code
9SECTION .text
10
11;--------------------------------------------------------------------
12; Dialogs_DisplayHelpFromCSDXwithTitleInCSDI
13; Parameters:
14; CS:DX: Ptr to help string to display
15; CS:DI: Ptr to title string for help dialog
16; SS:BP: Menu handle
17; Returns:
18; Nothing
19; Corrupts registers:
20; AX
21;--------------------------------------------------------------------
22ALIGN JUMP_ALIGN
23Dialogs_DisplayHelpFromCSDXwithTitleInCSDI:
24 push ds
25 push si
26 push di
27 push cx
28
29 mov cx, DIALOG_INPUT_size
30 call Memory_ReserveCXbytesFromStackToDSSI
31 call InitializeDialogInputFromDSSI
32 mov [si+DIALOG_INPUT.fszTitle], di
33 jmp SHORT DisplayMessageDialogWithMessageInCSDXandDialogInputInDSSI
34
35;--------------------------------------------------------------------
36; Dialogs_DisplayNotificationFromCSDX
37; Dialogs_DisplayErrorFromCSDX
38; Parameters:
39; CS:DX: Ptr to notification string to display
40; SS:BP: Menu handle
41; Returns:
42; Nothing
43; Corrupts registers:
44; AX
45;--------------------------------------------------------------------
46ALIGN JUMP_ALIGN
47Dialogs_DisplayNotificationFromCSDX:
48 push ds
49 push si
50 push di
51 push cx
52
53 mov cx, DIALOG_INPUT_size
54 call Memory_ReserveCXbytesFromStackToDSSI
55 call InitializeDialogInputFromDSSI
56 mov WORD [si+DIALOG_INPUT.fszTitle], g_szNotificationDialog
57 jmp SHORT DisplayMessageDialogWithMessageInCSDXandDialogInputInDSSI
58
59ALIGN JUMP_ALIGN
60Dialogs_DisplayErrorFromCSDX:
61 push ds
62 push si
63 push di
64 push cx
65
66 mov cx, DIALOG_INPUT_size
67 call Memory_ReserveCXbytesFromStackToDSSI
68 mov WORD [si+DIALOG_INPUT.fszTitle], g_szErrorDialog
69ALIGN JUMP_ALIGN
70DisplayMessageDialogWithMessageInCSDXandDialogInputInDSSI:
71 call InitializeDialogInputFromDSSI
72 mov [si+DIALOG_INPUT.fszItems], dx
73 CALL_MENU_LIBRARY DisplayMessageWithInputInDSSI
74
75 add sp, BYTE DIALOG_INPUT_size
76 pop cx
77 pop di
78 pop si
79 pop ds
80 ret
81
82
83;--------------------------------------------------------------------
84; Dialogs_DisplayFileDialogWithDialogIoInDSSI
85; Parameters:
86; DS:SI: Ptr to FILE_DIALOG_IO
87; Returns:
88; Nothing
89; Corrupts registers:
90; AX, DI
91;--------------------------------------------------------------------
92ALIGN JUMP_ALIGN
93Dialogs_DisplayFileDialogWithDialogIoInDSSI:
94 push es
95
96 call Buffers_GetFileDialogItemBufferToESDI
97 mov WORD [si+FILE_DIALOG_IO.fszTitle], g_szDlgFileTitle
98 mov [si+FILE_DIALOG_IO.fszTitle+2], cs
99 mov [si+FILE_DIALOG_IO.fszItemBuffer], di
100 mov [si+FILE_DIALOG_IO.fszItemBuffer+2], es
101 mov BYTE [si+FILE_DIALOG_IO.bDialogFlags], FLG_FILEDIALOG_DRIVES
102 mov BYTE [si+FILE_DIALOG_IO.bFileAttributes], FLG_FILEATTR_DIRECTORY | FLG_FILEATTR_ARCHIVE
103 mov WORD [si+FILE_DIALOG_IO.fpFileFilterString], g_szDlgFileFilter
104 mov [si+FILE_DIALOG_IO.fpFileFilterString+2], cs
105 CALL_MENU_LIBRARY GetFileNameWithIoInDSSI
106
107 pop es
108 ret
109
110
111;--------------------------------------------------------------------
112; Dialogs_DisplayQuitDialog
113; Dialogs_DisplaySaveChangesDialog
114; Parameters:
115; Nothing
116; Returns:
117; ZF: Set if user wants to do the action
118; Cleared if user wants to cancel
119; Corrupts registers:
120; AX, CX
121;--------------------------------------------------------------------
122ALIGN JUMP_ALIGN
123Dialogs_DisplayQuitDialog:
124 push ds
125
126 mov cx, DIALOG_INPUT_size
127 call Memory_ReserveCXbytesFromStackToDSSI
128 call InitializeDialogInputFromDSSI
129 mov WORD [si+DIALOG_INPUT.fszTitle], g_szDlgExitToDos
130 mov WORD [si+DIALOG_INPUT.fszItems], g_szMultichoiseBooleanFlag
131 CALL_MENU_LIBRARY GetSelectionToAXwithInputInDSSI
132 add sp, BYTE DIALOG_INPUT_size
133 cmp ax, BYTE 1 ; 1 = YES
134
135 pop ds
136 ret
137
138
139ALIGN JUMP_ALIGN
140Dialogs_DisplaySaveChangesDialog:
141 push ds
142
143 mov cx, DIALOG_INPUT_size
144 call Memory_ReserveCXbytesFromStackToDSSI
145 call InitializeDialogInputFromDSSI
146 mov WORD [si+DIALOG_INPUT.fszTitle], g_szDlgSaveChanges
147 mov WORD [si+DIALOG_INPUT.fszItems], g_szMultichoiseBooleanFlag
148 CALL_MENU_LIBRARY GetSelectionToAXwithInputInDSSI
149 add sp, BYTE DIALOG_INPUT_size
150 cmp ax, BYTE 1 ; 1 = YES
151
152 pop ds
153 ret
154
155
156;--------------------------------------------------------------------
157; InitializeDialogInputFromDSSI
158; Parameters:
159; DS:SI: Ptr to DIALOG_INPUT
160; Returns:
161; Nothing
162; Corrupts registers:
163; Nothing
164;--------------------------------------------------------------------
165ALIGN JUMP_ALIGN
166InitializeDialogInputFromDSSI:
167 mov [si+DIALOG_INPUT.fszTitle+2], cs
168 mov [si+DIALOG_INPUT.fszItems+2], cs
169 mov WORD [si+DIALOG_INPUT.fszInfo], g_szGenericDialogInfo
170 mov [si+DIALOG_INPUT.fszInfo+2], cs
171 ret
Note: See TracBrowser for help on using the repository browser.