source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Main.asm@ 489

Last change on this file since 489 was 483, checked in by aitotat@…, 12 years ago

Changes to Configurator v2:

  • XT-CF Sector Window address can now be selected.
  • Default port settings will now be restored when selecting device.
File size: 3.9 KB
Line 
1; Project name : XTIDE Univeral BIOS Configurator v2
2; Description : Program start and exit.
3
4;
5; XTIDE Universal BIOS and Associated Tools
6; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
7;
8; This program is free software; you can redistribute it and/or modify
9; it under the terms of the GNU General Public License as published by
10; the Free Software Foundation; either version 2 of the License, or
11; (at your option) any later version.
12;
13; This program is distributed in the hope that it will be useful,
14; but WITHOUT ANY WARRANTY; without even the implied warranty of
15; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16; GNU General Public License for more details.
17; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
18;
19
20; Include .inc files
21
22%define INCLUDE_MENU_DIALOGS
23%define INCLUDE_SERIAL_LIBRARY
24
25%include "AssemblyLibrary.inc" ; Assembly Library. Must be included first!
26%include "Romvars.inc" ; XTIDE Universal BIOS variables
27%include "JRIDE_ISA.inc" ; For JR-IDE/ISA default segment
28%include "XTCF.inc" ; For XT-CF modes
29
30%include "Version.inc"
31%include "MenuCfg.inc"
32%include "MenuStructs.inc"
33%include "Variables.inc"
34
35
36; Section containing code
37SECTION .text
38
39
40; Program first instruction.
41ORG 100h ; Code starts at offset 100h (DOS .COM)
42Start:
43 jmp Main_Start
44
45; Include library sources
46%include "AssemblyLibrary.asm"
47
48; Include sources for this program
49%include "BiosFile.asm"
50%include "Buffers.asm"
51%include "Dialogs.asm"
52%include "EEPROM.asm"
53%include "Flash.asm"
54%include "MenuEvents.asm"
55%include "Menuitem.asm"
56%include "MenuitemPrint.asm"
57%include "Menupage.asm"
58%include "Strings.asm"
59
60%include "BootMenuSettingsMenu.asm"
61%include "ConfigurationMenu.asm"
62%include "FlashMenu.asm"
63%include "IdeControllerMenu.asm"
64%include "MainMenu.asm"
65%include "MasterSlaveMenu.asm"
66
67
68
69;--------------------------------------------------------------------
70; Program start
71;--------------------------------------------------------------------
72ALIGN JUMP_ALIGN
73Main_Start:
74 mov ax, SCREEN_BACKGROUND_CHARACTER_AND_ATTRIBUTE
75 call InitializeScreenWithBackgroudCharAndAttrInAX
76
77 call Main_InitializeCfgVars
78 call MenuEvents_DisplayMenu
79 mov ax, DOS_BACKGROUND_CHARACTER_AND_ATTRIBUTE
80 call InitializeScreenWithBackgroudCharAndAttrInAX
81
82 ; Exit to DOS
83 mov ax, 4C00h ; Exit to DOS
84 int 21h
85
86
87;--------------------------------------------------------------------
88; InitializeScreenWithBackgroudCharAndAttrInAX
89; Parameters:
90; AL: Background character
91; AH: Background attribute
92; Returns:
93; Nothing
94; Corrupts registers:
95; AX, DX, DI
96;--------------------------------------------------------------------
97ALIGN JUMP_ALIGN
98InitializeScreenWithBackgroudCharAndAttrInAX:
99 xchg dx, ax
100 CALL_DISPLAY_LIBRARY InitializeDisplayContext ; Reset cursor etc
101 xchg ax, dx
102 CALL_DISPLAY_LIBRARY ClearScreenWithCharInALandAttrInAH
103 ret
104
105
106;--------------------------------------------------------------------
107; Main_InitializeCfgVars
108; Parameters:
109; DS: Segment to CFGVARS
110; Returns:
111; Nothing
112; Corrupts registers:
113; AX, BX, CX, DI
114;--------------------------------------------------------------------
115ALIGN JUMP_ALIGN
116Main_InitializeCfgVars:
117 push es
118
119 call Buffers_Clear
120 call EEPROM_FindXtideUniversalBiosROMtoESDI
121 jnc SHORT .InitializationCompleted
122 mov [CFGVARS.wEepromSegment], es
123.InitializationCompleted:
124 pop es
125 ret
126
127
128; Section containing initialized data
129SECTION .data
130
131ALIGN WORD_ALIGN
132g_cfgVars:
133istruc CFGVARS
134 at CFGVARS.pMenupage, dw g_MenupageForMainMenu
135 at CFGVARS.wFlags, dw DEFAULT_CFGVARS_FLAGS
136 at CFGVARS.wEepromSegment, dw 0
137 at CFGVARS.bEepromType, db DEFAULT_EEPROM_TYPE
138 at CFGVARS.bEepromPage, db DEFAULT_PAGE_SIZE
139 at CFGVARS.bSdpCommand, db DEFAULT_SDP_COMMAND
140iend
141
142
143; Section containing uninitialized data
144SECTION .bss
Note: See TracBrowser for help on using the repository browser.