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

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

Initial commit (Work in progress).

File size: 3.5 KB
Line 
1; File name : Dialogs.asm
2; Project name : XTIDE Univeral BIOS Configurator v2
3; Created date : 10.10.2010
4; Last update : 10.10.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; InitializeDialogInputFromDSSI
84; Parameters:
85; DS:SI: Ptr to DIALOG_INPUT
86; Returns:
87; Nothing
88; Corrupts registers:
89; Nothing
90;--------------------------------------------------------------------
91ALIGN JUMP_ALIGN
92InitializeDialogInputFromDSSI:
93 mov [si+DIALOG_INPUT.fszTitle+2], cs
94 mov [si+DIALOG_INPUT.fszItems+2], cs
95 mov WORD [si+DIALOG_INPUT.fszInfo], g_szGenericDialogInfo
96 mov [si+DIALOG_INPUT.fszInfo+2], cs
97 ret
98
99
100;--------------------------------------------------------------------
101; Dialogs_DisplayFileDialogWithDialogIoInDSSI
102; Parameters:
103; DS:SI: Ptr to FILE_DIALOG_IO
104; Returns:
105; Nothing
106; Corrupts registers:
107; AX, DI
108;--------------------------------------------------------------------
109ALIGN JUMP_ALIGN
110Dialogs_DisplayFileDialogWithDialogIoInDSSI:
111 push es
112
113 call Buffers_GetFileDialogItemBufferToESDI
114 mov WORD [si+FILE_DIALOG_IO.fszTitle], g_szDlgFileTitle
115 mov [si+FILE_DIALOG_IO.fszTitle+2], cs
116 mov [si+FILE_DIALOG_IO.fszItemBuffer], di
117 mov [si+FILE_DIALOG_IO.fszItemBuffer+2], es
118 mov BYTE [si+FILE_DIALOG_IO.bDialogFlags], FLG_FILEDIALOG_DRIVES
119 mov BYTE [si+FILE_DIALOG_IO.bFileAttributes], FLG_FILEATTR_DIRECTORY | FLG_FILEATTR_ARCHIVE
120 mov WORD [si+FILE_DIALOG_IO.fpFileFilterString], g_szDlgFileFilter
121 mov [si+FILE_DIALOG_IO.fpFileFilterString+2], cs
122 CALL_MENU_LIBRARY GetFileNameWithIoInDSSI
123
124 pop es
125 ret
Note: See TracBrowser for help on using the repository browser.