Changeset 92 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm
- Timestamp:
- Jan 27, 2011, 5:44:27 PM (14 years ago)
- google:author:
- aitotat
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm
r88 r92 27 27 cmp cx, BYTE NO_ITEM_SELECTED 28 28 je SHORT BootMenu_DisplayAndReturnSelection 29 jmp BootMenu_ConvertMenuitemToDriveOrFunction29 jmp SHORT BootMenu_ConvertMenuitemFromCXtoDriveInDX 30 30 31 31 … … 66 66 call FloppyDrive_GetCount 67 67 add ax, cx 68 call BootMenu_GetMenuFunctionCount69 add cx, ax70 ret71 72 ;--------------------------------------------------------------------73 ; Returns number of functions displayed in Boot Menu.74 ;75 ; BootMenu_GetMenuFunctionCount76 ; Parameters:77 ; Nothing78 ; Returns:79 ; CX: Number of boot menu functions80 ; Corrupts registers:81 ; Nothing82 ;--------------------------------------------------------------------83 ALIGN JUMP_ALIGN84 BootMenu_GetMenuFunctionCount:85 xor cx, cx86 test BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_ROMBOOT87 jz SHORT .DontIncludeRomBoot88 inc cx89 ALIGN JUMP_ALIGN90 .DontIncludeRomBoot:91 68 ret 92 69 … … 110 87 111 88 ;-------------------------------------------------------------------- 112 ; Converts any hotkey to Boot Menu menuitem index. 113 ; 114 ; BootMenu_ConvertHotkeyToMenuitem 115 ; Parameters: 116 ; AX: ASCII hotkey starting from upper case 'A' 89 ; BootMenu_ConvertAsciiHotkeyFromALtoMenuitemInCX 90 ; Parameters: 91 ; AL: ASCII hotkey starting from upper case 'A' 117 92 ; Returns: 118 93 ; CX: Menuitem index … … 121 96 ;-------------------------------------------------------------------- 122 97 ALIGN JUMP_ALIGN 123 BootMenu_Convert HotkeyToMenuitem:124 call BootMenu_GetLetterForFirstHardDisk 98 BootMenu_ConvertAsciiHotkeyFromALtoMenuitemInCX: 99 call BootMenu_GetLetterForFirstHardDiskToCL 125 100 cmp al, cl ; Letter is for Hard Disk? 126 101 jae SHORT .StartFromHardDiskLetter … … 139 114 ; can be higher if more than two floppy drives are found. 140 115 ; 141 ; BootMenu_GetLetterForFirstHardDisk 116 ; BootMenu_GetLetterForFirstHardDiskToCL 142 117 ; Parameters: 143 118 ; Nothing … … 148 123 ;-------------------------------------------------------------------- 149 124 ALIGN JUMP_ALIGN 150 BootMenu_GetLetterForFirstHardDisk :125 BootMenu_GetLetterForFirstHardDiskToCL: 151 126 call FloppyDrive_GetCount 152 127 add cl, 'A' … … 156 131 157 132 ;-------------------------------------------------------------------- 158 ; Converts selected menuitem index to drive number or function ID. 159 ; 160 ; BootMenu_ConvertMenuitemToDriveOrFunction 133 ; BootMenu_ConvertMenuitemFromCXtoDriveInDX 161 134 ; Parameters: 162 135 ; CX: Index of menuitem selected from Boot Menu 163 136 ; DS: RAMVARS segment 164 137 ; Returns: 165 ; DX: Drive number to be used for booting (if CF cleared) 166 ; Function ID (if CF set) 167 ; CF: Cleared if drive selected 168 ; Set if function selected 169 ; Corrupts registers: 170 ; AX, CX 171 ;-------------------------------------------------------------------- 172 ALIGN JUMP_ALIGN 173 BootMenu_ConvertMenuitemToDriveOrFunction: 138 ; DX: Drive number to be used for booting 139 ; Corrupts registers: 140 ; CX 141 ;-------------------------------------------------------------------- 142 ALIGN JUMP_ALIGN 143 BootMenu_ConvertMenuitemFromCXtoDriveInDX: 174 144 mov dx, cx ; Copy menuitem index to DX 175 145 call FloppyDrive_GetCount … … 177 147 jb SHORT .ReturnFloppyDriveInDX 178 148 sub dx, cx ; Remove floppy drives from index 179 call RamVars_GetHardDiskCountFromBDAtoCX180 cmp dx, cx ; Hard disk?181 jb SHORT .ReturnHardDiskInDX182 sub dx, cx ; Remove hard disks from index183 jmp SHORT BootMenu_ConvertFunctionIndexToID184 ALIGN JUMP_ALIGN185 .ReturnHardDiskInDX:186 149 or dl, 80h 187 ALIGN JUMP_ALIGN188 150 .ReturnFloppyDriveInDX: 189 clc190 ret191 192 193 ;--------------------------------------------------------------------194 ; Converts selected menuitem index to drive number or function ID.195 ;196 ; BootMenu_ConvertFunctionIndexToID197 ; Parameters:198 ; CX: Menuitem index199 ; DX: Function index (Menuitem index - floppy count - HD count)200 ; Returns:201 ; DX: Function ID202 ; CF: Set to indicate function203 ; Corrupts registers:204 ; AX, CX205 ;--------------------------------------------------------------------206 ALIGN JUMP_ALIGN207 BootMenu_ConvertFunctionIndexToID:208 mov dx, ID_BOOTFUNC_ROMBOOT209 stc210 151 ret 211 152
Note:
See TracChangeset
for help on using the changeset viewer.