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