Changeset 492 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuEvent.asm
- Timestamp:
- Dec 21, 2012, 1:01:55 AM (12 years ago)
- google:author:
- gregli@hotmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuEvent.asm
r489 r492 21 21 SECTION .text 22 22 23 24 ;--------------------------------------------------------------------25 ; GetDefaultMenuitemToDL26 ; Parameters:27 ; DL: Drive number28 ; ES: Ptr to BDA (zero)29 ; Returns:30 ; DL: Menuitem index (assuming drive is available)31 ; Corrupts registers:32 ; AX, DH33 ;--------------------------------------------------------------------34 GetDefaultMenuitemToDX:35 mov dx, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wHddAndFddLetters]36 test BYTE [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bFlags], FLG_HOTKEY_HD_FIRST37 eCMOVZ dl, dh38 call IsDriveDLinSystem39 jnc SHORT BootMenuEvent_Handler.DoNotSetDefaultMenuitem40 call DriveXlate_SetDriveToSwap41 ; Fall to GetMenuitemToDXforDriveInDL42 43 44 23 ;-------------------------------------------------------------------- 45 24 ; GetMenuitemToDXforDriveInDL … … 63 42 64 43 ;-------------------------------------------------------------------- 65 ; IsDriveDLinSystem66 ; Parameters:67 ; DL: Drive number68 ; DS: RAMVARS segment69 ; Returns:70 ; CF: Set if drive number is valid71 ; Clear if drive is not present in system72 ; Corrupts registers:73 ; AX, CX74 ;--------------------------------------------------------------------75 IsDriveDLinSystem:76 test dl, dl ; Floppy drive?77 jns SHORT .IsFloppyDriveInSystem78 call RamVars_GetHardDiskCountFromBDAtoAX ; Hard Disk count to AX79 or al, 80h ; Set Hard Disk bit to AX80 jmp SHORT .CompareDriveNumberToDriveCount81 .IsFloppyDriveInSystem:82 call FloppyDrive_GetCountToAX83 .CompareDriveNumberToDriveCount:84 cmp dl, al ; Set CF when DL is smaller85 ret86 87 88 ;--------------------------------------------------------------------89 44 ; BootMenuEvent_Handler 90 45 ; Common parameters for all events: … … 115 70 MENUEVENT_ItemHighlightedFromCX equ (EventItemHighlightedFromCX - FirstEvent) 116 71 MENUEVENT_ItemSelectedFromCX equ (EventItemSelectedFromCX - FirstEvent) 117 MENUEVENT_KeyStrokeInAX equ (EventKeyStrokeInAX - FirstEvent)118 72 MENUEVENT_RefreshTitle equ (BootMenuPrint_TitleStrings - FirstEvent) 119 73 MENUEVENT_RefreshInformation equ (BootMenuPrint_RefreshInformation - FirstEvent) … … 164 118 EventInitializeMenuinitFromSSBP: 165 119 ; Store default Menuitem (=default drive to boot from) 166 call GetDefaultMenuitemToDX120 xor dx, dx 167 121 mov [bp+MENUINIT.wHighlightedItem], dx 168 122 … … 172 126 call FloppyDrive_GetCountToAX 173 127 add ax, cx 128 inc ax ; extra entry for ROM Boot item 174 129 mov [bp+MENUINIT.wItems], ax 175 130 176 131 ; Store menu size 177 132 mov WORD [bp+MENUINIT.wTitleAndInfoLines], BOOT_MENU_TITLE_AND_INFO_LINES … … 180 135 xchg cx, ax 181 136 CALL_DISPLAY_LIBRARY GetColumnsToALandRowsToAH 182 sub ah, MENU_SCREEN_BOTTOM_LINES*2 ; Leave space for Hotkey Bar183 137 MIN_U ah, cl 184 138 mov [bp+MENUINIT.bHeight], ah … … 207 161 EventItemHighlightedFromCX: 208 162 push cx 163 call DriveXlate_Reset 209 164 call BootMenu_GetDriveToDXforMenuitemInCX 210 call DriveXlate_Reset165 jnc .noDriveSwap 211 166 call DriveXlate_SetDriveToSwap 212 213 ; We need to generate keystroke so selection two drives is possible. 214 ; The secondary boot drive is selected by highlighting it using menu keys 215 ; and the primary boot drive is selected by pressing drive letter hotkey. 216 call BootVars_StoreHotkeyForDriveNumberInDL 217 call RedrawHotkeyBarFromInsideMenuEventHandler 218 167 .noDriveSwap: 168 219 169 ; Redraw changes in drive numbers 220 170 xor ax, ax ; Update first floppy drive (for translated drive number) … … 230 180 ret 231 181 232 233 ;-------------------------------------------------------------------- 234 ; EventKeyStrokeInAX 235 ; Parameters 236 ; AL: ASCII character for the key 237 ; AH: Keyboard library scan code for the key 238 ; DS: Ptr to RAMVARS 239 ; ES: Ptr to BDA (zero) 240 ; SS:BP: Menu library handle 241 ; Returns: 242 ; CF: Set if event processed 243 ; Cleared if event not processed 244 ; Corrupts registers: 245 ; Does not matter 246 ;-------------------------------------------------------------------- 247 EventKeyStrokeInAX: 248 cmp ah, BOOT_MENU_HOTKEY_SCANCODE 249 je SHORT BootMenuEvent_Completed ; Ignore Boot Menu hotkey 250 call HotkeyBar_StoreHotkeyToBootvarsIfValidKeystrokeInAX 251 jnc SHORT BootMenuEvent_Completed 252 253 ; Hotkey is now stored to BOOTVARS and menu can be closed 254 jmp SHORT CloseBootMenu 255 256 182 257 183 ;-------------------------------------------------------------------- 258 184 ; EventItemSelectedFromCX … … 269 195 ;-------------------------------------------------------------------- 270 196 EventItemSelectedFromCX: 271 call BootMenu_GetDriveToDXforMenuitemInCX272 jnc SHORT BootMenuEvent_Completed ; No menuitem selected273 274 ; Convert selected drive to hotkey keystroke275 call HotkeyBar_StoreHotkeyToBootvarsForDriveLetterInDL276 197 ; Fall to CloseBootMenu 277 198 … … 290 211 call DriveXlate_Reset 291 212 CALL_MENU_LIBRARY Close 292 ; Fall to RedrawHotkeyBarFromInsideMenuEventHandler293 294 295 ;--------------------------------------------------------------------296 ; RedrawHotkeyBarFromInsideMenuEventHandler297 ; Parameters298 ; DS: RAMVARS segment299 ; ES: BDA segment (zero)300 ; Returns:301 ; Nothing302 ; Corrupts registers:303 ; AX, BX, CX, DX, SI, DI304 ;--------------------------------------------------------------------305 RedrawHotkeyBarFromInsideMenuEventHandler:306 mov al, MONO_NORMAL307 CALL_DISPLAY_LIBRARY SetCharacterAttributeFromAL308 309 mov bl, ATTRIBUTES_ARE_USED310 mov ax, TELETYPE_OUTPUT_WITH_ATTRIBUTE311 CALL_DISPLAY_LIBRARY SetCharOutputFunctionFromAXwithAttribFlagInBL312 call HotkeyBar_DrawToTopOfScreen313 213 ; Fall to BootMenuEvent_Completed 314 214 315 215 316 216 ;-------------------------------------------------------------------- 317 217 ; BootMenuEvent_Completed
Note:
See TracChangeset
for help on using the changeset viewer.