source: xtideuniversalbios/trunk/Configurator/Src/FormatTitle.asm@ 629

Last change on this file since 629 was 2, checked in by Tomi Tilli, 15 years ago
File size: 3.6 KB
RevLine 
[2]1; File name : FormatTitle.asm
2; Project name : XTIDE Univeral BIOS Configurator
3; Created date : 19.4.2010
4; Last update : 20.4.2010
5; Author : Tomi Tilli
6; Description : Functions for printing menu title strings.
7
8; Section containing code
9SECTION .text
10
11;--------------------------------------------------------------------
12; Redraws menu title strings.
13;
14; FormatTitle_RedrawMenuTitle
15; Parameters:
16; SS:BP: Ptr to MENUVARS
17; Returns:
18; Nothing
19; Corrupts registers:
20; AX, BX, CX, DX
21;--------------------------------------------------------------------
22ALIGN JUMP_ALIGN
23FormatTitle_RedrawMenuTitle:
24 mov dl, MFL_UPD_TITLE ; Invalidate Title strings
25 jmp Menu_Invalidate
26
27
28;--------------------------------------------------------------------
29; Prints title strings for menu system.
30;
31; FormatTitle_String
32; Parameters:
33; SS:BP: Ptr to MENUVARS
34; Returns:
35; Nothing
36; Corrupts registers:
37; AX, BX, CX, DX, ES
38;--------------------------------------------------------------------
39ALIGN JUMP_ALIGN
40FormatTitle_String:
41 mov ax, cs
42 mov ds, ax
43 mov es, ax
44 call FormatTitle_PrintProgramName
45 call FormatTitle_PrintImageSource
46 jmp SHORT FormatTitle_PrintUnsavedChanges
47
48
49;--------------------------------------------------------------------
50; Prints program name.
51;
52; FormatTitle_PrintProgramName
53; Parameters:
54; SS:BP: Ptr to MENUVARS
55; DS=ES: String segment
56; Returns:
57; Nothing
58; Corrupts registers:
59; AX, BX, CX, DX
60;--------------------------------------------------------------------
61ALIGN JUMP_ALIGN
62FormatTitle_PrintProgramName:
63 mov di, g_szTitleProgramName
64 mov cx, CNT_TITLE_LINES
65 call MenuDraw_MultilineStr
66 call MenuDraw_NewlineStr
67 jmp MenuDraw_NewlineStr
68
69
70;--------------------------------------------------------------------
71; Prints where BIOS image is loaded from.
72;
73; FormatTitle_PrintImageSource
74; Parameters:
75; SS:BP: Ptr to MENUVARS
76; DS=ES: String segment
77; Returns:
78; Nothing
79; Corrupts registers:
80; AX, DX
81;--------------------------------------------------------------------
82ALIGN JUMP_ALIGN
83FormatTitle_PrintImageSource:
84 test WORD [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED
85 jz SHORT FormatTitle_NothingLoaded
86 mov dx, g_szImageSource
87 PRINT_STR
88 test WORD [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED
89 jnz SHORT FormatTitle_FileLoaded
90 ; Fall to FormatTitle_RomLoaded
91
92;--------------------------------------------------------------------
93; FormatTitle_RomLoaded
94; FormatTitle_FileLoaded
95; FormatTitle_NothingLoaded
96; Parameters:
97; SS:BP: Ptr to MENUVARS
98; DS=ES: String segment
99; Returns:
100; Nothing
101; Corrupts registers:
102; AX, DX
103;--------------------------------------------------------------------
104;ALIGN JUMP_ALIGN
105FormatTitle_RomLoaded:
106 mov dx, g_szRomLoaded
107 PRINT_STR
108 ret
109
110ALIGN JUMP_ALIGN
111FormatTitle_FileLoaded:
112 mov dx, 80h + DTA.szFile ; DTA starts at DOS PSP:80h
113 PRINT_STR
114 ret
115
116ALIGN JUMP_ALIGN
117FormatTitle_NothingLoaded:
118 mov dx, g_szNoBiosLoaded
119 PRINT_STR
120 ret
121
122
123;--------------------------------------------------------------------
124; Prints unsaved changes.
125;
126; FormatTitle_PrintUnsavedChanges
127; Parameters:
128; SS:BP: Ptr to MENUVARS
129; DS=ES: String segment
130; Returns:
131; Nothing
132; Corrupts registers:
133; AX, DX
134;--------------------------------------------------------------------
135ALIGN JUMP_ALIGN
136FormatTitle_PrintUnsavedChanges:
137 test WORD [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_UNSAVED
138 jz SHORT .Return
139 mov dl, '*'
140 PRINT_CHAR
141ALIGN JUMP_ALIGN
142.Return:
143 ret
Note: See TracBrowser for help on using the repository browser.