[57] | 1 | ; Project name : XTIDE Univeral BIOS Configurator v2 |
---|
[153] | 2 | ; Description : Program start and exit. |
---|
[57] | 3 | |
---|
[376] | 4 | ; |
---|
[505] | 5 | ; XTIDE Universal BIOS and Associated Tools |
---|
[376] | 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. |
---|
[505] | 12 | ; |
---|
[376] | 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 |
---|
[505] | 16 | ; GNU General Public License for more details. |
---|
[376] | 17 | ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
---|
[505] | 18 | ; |
---|
[376] | 19 | |
---|
[57] | 20 | ; Include .inc files |
---|
[505] | 21 | |
---|
[57] | 22 | %define INCLUDE_MENU_DIALOGS |
---|
[280] | 23 | %define INCLUDE_SERIAL_LIBRARY |
---|
[505] | 24 | |
---|
[57] | 25 | %include "AssemblyLibrary.inc" ; Assembly Library. Must be included first! |
---|
| 26 | %include "Romvars.inc" ; XTIDE Universal BIOS variables |
---|
[497] | 27 | %include "IdeRegisters.inc" ; Needed for port and device autodetection |
---|
[483] | 28 | %include "JRIDE_ISA.inc" ; For JR-IDE/ISA default segment |
---|
[481] | 29 | %include "XTCF.inc" ; For XT-CF modes |
---|
[57] | 30 | |
---|
[457] | 31 | %include "Version.inc" |
---|
[57] | 32 | %include "MenuCfg.inc" |
---|
| 33 | %include "MenuStructs.inc" |
---|
| 34 | %include "Variables.inc" |
---|
| 35 | |
---|
| 36 | |
---|
| 37 | ; Section containing code |
---|
| 38 | SECTION .text |
---|
| 39 | |
---|
| 40 | |
---|
| 41 | ; Program first instruction. |
---|
| 42 | ORG 100h ; Code starts at offset 100h (DOS .COM) |
---|
| 43 | Start: |
---|
| 44 | jmp Main_Start |
---|
| 45 | |
---|
| 46 | ; Include library sources |
---|
| 47 | %include "AssemblyLibrary.asm" |
---|
| 48 | |
---|
| 49 | ; Include sources for this program |
---|
[497] | 50 | %include "AutoConfigure.asm" |
---|
[57] | 51 | %include "BiosFile.asm" |
---|
| 52 | %include "Buffers.asm" |
---|
| 53 | %include "Dialogs.asm" |
---|
| 54 | %include "EEPROM.asm" |
---|
[65] | 55 | %include "Flash.asm" |
---|
[497] | 56 | %include "IdeAutodetect.asm" |
---|
[57] | 57 | %include "MenuEvents.asm" |
---|
| 58 | %include "Menuitem.asm" |
---|
| 59 | %include "MenuitemPrint.asm" |
---|
| 60 | %include "Menupage.asm" |
---|
| 61 | %include "Strings.asm" |
---|
| 62 | |
---|
[59] | 63 | %include "BootMenuSettingsMenu.asm" |
---|
[57] | 64 | %include "ConfigurationMenu.asm" |
---|
[59] | 65 | %include "FlashMenu.asm" |
---|
[57] | 66 | %include "IdeControllerMenu.asm" |
---|
| 67 | %include "MainMenu.asm" |
---|
| 68 | %include "MasterSlaveMenu.asm" |
---|
| 69 | |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | ;-------------------------------------------------------------------- |
---|
| 73 | ; Program start |
---|
| 74 | ;-------------------------------------------------------------------- |
---|
| 75 | ALIGN JUMP_ALIGN |
---|
| 76 | Main_Start: |
---|
[68] | 77 | mov ax, SCREEN_BACKGROUND_CHARACTER_AND_ATTRIBUTE |
---|
| 78 | call InitializeScreenWithBackgroudCharAndAttrInAX |
---|
[57] | 79 | |
---|
| 80 | call Main_InitializeCfgVars |
---|
| 81 | call MenuEvents_DisplayMenu |
---|
[68] | 82 | mov ax, DOS_BACKGROUND_CHARACTER_AND_ATTRIBUTE |
---|
| 83 | call InitializeScreenWithBackgroudCharAndAttrInAX |
---|
[57] | 84 | |
---|
| 85 | ; Exit to DOS |
---|
| 86 | mov ax, 4C00h ; Exit to DOS |
---|
| 87 | int 21h |
---|
| 88 | |
---|
| 89 | |
---|
| 90 | ;-------------------------------------------------------------------- |
---|
[68] | 91 | ; InitializeScreenWithBackgroudCharAndAttrInAX |
---|
| 92 | ; Parameters: |
---|
| 93 | ; AL: Background character |
---|
| 94 | ; AH: Background attribute |
---|
| 95 | ; Returns: |
---|
| 96 | ; Nothing |
---|
| 97 | ; Corrupts registers: |
---|
| 98 | ; AX, DX, DI |
---|
| 99 | ;-------------------------------------------------------------------- |
---|
| 100 | ALIGN JUMP_ALIGN |
---|
| 101 | InitializeScreenWithBackgroudCharAndAttrInAX: |
---|
| 102 | xchg dx, ax |
---|
| 103 | CALL_DISPLAY_LIBRARY InitializeDisplayContext ; Reset cursor etc |
---|
| 104 | xchg ax, dx |
---|
[505] | 105 | JMP_DISPLAY_LIBRARY ClearScreenWithCharInALandAttrInAH |
---|
[68] | 106 | |
---|
| 107 | |
---|
| 108 | ;-------------------------------------------------------------------- |
---|
[57] | 109 | ; Main_InitializeCfgVars |
---|
| 110 | ; Parameters: |
---|
| 111 | ; DS: Segment to CFGVARS |
---|
| 112 | ; Returns: |
---|
| 113 | ; Nothing |
---|
| 114 | ; Corrupts registers: |
---|
| 115 | ; AX, BX, CX, DI |
---|
| 116 | ;-------------------------------------------------------------------- |
---|
| 117 | ALIGN JUMP_ALIGN |
---|
| 118 | Main_InitializeCfgVars: |
---|
| 119 | push es |
---|
| 120 | |
---|
| 121 | call Buffers_Clear |
---|
| 122 | call EEPROM_FindXtideUniversalBiosROMtoESDI |
---|
| 123 | jnc SHORT .InitializationCompleted |
---|
| 124 | mov [CFGVARS.wEepromSegment], es |
---|
| 125 | .InitializationCompleted: |
---|
| 126 | pop es |
---|
| 127 | ret |
---|
| 128 | |
---|
| 129 | |
---|
| 130 | ; Section containing initialized data |
---|
| 131 | SECTION .data |
---|
| 132 | |
---|
| 133 | ALIGN WORD_ALIGN |
---|
| 134 | g_cfgVars: |
---|
| 135 | istruc CFGVARS |
---|
[59] | 136 | at CFGVARS.pMenupage, dw g_MenupageForMainMenu |
---|
| 137 | at CFGVARS.wFlags, dw DEFAULT_CFGVARS_FLAGS |
---|
[371] | 138 | at CFGVARS.wEepromSegment, dw 0 |
---|
[63] | 139 | at CFGVARS.bEepromType, db DEFAULT_EEPROM_TYPE |
---|
[65] | 140 | at CFGVARS.bEepromPage, db DEFAULT_PAGE_SIZE |
---|
[59] | 141 | at CFGVARS.bSdpCommand, db DEFAULT_SDP_COMMAND |
---|
[57] | 142 | iend |
---|
| 143 | |
---|
| 144 | |
---|
| 145 | ; Section containing uninitialized data |
---|
| 146 | SECTION .bss |
---|