Changeset 124 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src
- Timestamp:
- Mar 2, 2011, 7:42:19 PM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/XTIDE_Universal_BIOS/Src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm
r95 r124 49 49 ; Returns number of menuitems in Boot Menu. 50 50 ; 51 ; BootMenu_GetMenuitemCountTo CX51 ; BootMenu_GetMenuitemCountToAX 52 52 ; Parameters: 53 53 ; DS: RAMVARS segment 54 54 ; Returns: 55 ; CX: Number of boot menu items55 ; AX: Number of boot menu items 56 56 ; Corrupts registers: 57 ; AX57 ; CX 58 58 ;-------------------------------------------------------------------- 59 59 ALIGN JUMP_ALIGN 60 BootMenu_GetMenuitemCountTo CX:60 BootMenu_GetMenuitemCountToAX: 61 61 call RamVars_GetHardDiskCountFromBDAtoCX 62 62 xchg ax, cx 63 call FloppyDrive_GetCount 63 call FloppyDrive_GetCountToCX 64 64 add ax, cx 65 65 ret … … 67 67 68 68 ;-------------------------------------------------------------------- 69 ; BootMenu_GetHeightToA LwithItemCountInCL69 ; BootMenu_GetHeightToAHwithItemCountInAL 70 70 ; Parameters: 71 ; CL: Number of menuitems71 ; AL: Number of menuitems 72 72 ; Returns: 73 73 ; AH: Boot menu height 74 74 ; Corrupts registers: 75 ; AL, C L, DI75 ; AL, CX, DI 76 76 ;-------------------------------------------------------------------- 77 77 ALIGN JUMP_ALIGN 78 BootMenu_GetHeightToAHwithItemCountInCL: 78 BootMenu_GetHeightToAHwithItemCountInAL: 79 xchg cx, ax 79 80 add cl, BOOT_MENU_HEIGHT_WITHOUT_ITEMS 80 81 CALL_DISPLAY_LIBRARY GetColumnsToALandRowsToAH 81 sub ah, MENU_SCREEN_BOTTOM_LINES*2 82 sub ah, MENU_SCREEN_BOTTOM_LINES*2 ; Leave space for bottom info 82 83 MIN_U ah, cl 83 84 ret … … 104 105 .StartFromHardDiskLetter: 105 106 sub al, cl ; Hard Disk index 106 call FloppyDrive_GetCount 107 call FloppyDrive_GetCountToCX 107 108 add cx, ax ; Menuitem index 108 109 ret … … 122 123 ALIGN JUMP_ALIGN 123 124 BootMenu_GetLetterForFirstHardDiskToCL: 124 call FloppyDrive_GetCount 125 call FloppyDrive_GetCountToCX 125 126 add cl, 'A' 126 127 MAX_U cl, 'C' … … 141 142 BootMenu_ConvertMenuitemFromCXtoDriveInDX: 142 143 mov dx, cx ; Copy menuitem index to DX 143 call FloppyDrive_GetCount 144 call FloppyDrive_GetCountToCX 144 145 cmp dx, cx ; Floppy drive? 145 146 jb SHORT .ReturnFloppyDriveInDX … … 151 152 152 153 ;-------------------------------------------------------------------- 153 ; Converts Floppy or Hard Disk Drive number to menuitem index. 154 ; This function does not check does the drive really exists. 155 ; 156 ; BootMenu_ConvertDriveToMenuitem 154 ; BootMenu_GetMenuitemToDXforDriveInDL 157 155 ; Parameters: 158 156 ; DL: Drive number 159 157 ; Returns: 160 ; CX: Menuitem index (assuming drive is available)158 ; DX: Menuitem index (assuming drive is available) 161 159 ; Corrupts registers: 162 ; AX160 ; Nothing 163 161 ;-------------------------------------------------------------------- 164 162 ALIGN JUMP_ALIGN 165 BootMenu_ConvertDriveToMenuitem: 166 test dl, 80h ; Floppy drive? 167 jz SHORT .ReturnFloppyMenuitem 168 call FloppyDrive_GetCount 169 mov ax, 7Fh ; Load mask to clear floppy bit 170 and ax, dx ; AX = Hard Disk index 171 add cx, ax ; Add hard disk index to floppy drive count 172 ret 173 ALIGN JUMP_ALIGN 174 .ReturnFloppyMenuitem: 175 eMOVZX cx, dl ; Drive number and item index are equal 163 BootMenu_GetMenuitemToDXforDriveInDL: 164 xor dh, dh ; Drive number now in DX 165 test dl, 80h 166 jz SHORT .ReturnItemIndexInDX ; Return if floppy drive (HD bit not set) 167 call FloppyDrive_GetCountToCX 168 add dx, cx 169 .ReturnItemIndexInDX: 176 170 ret 177 171 … … 198 192 jmp SHORT .CompareDriveNumberToDriveCount 199 193 .IsFloppyDriveIsInSystem: 200 call FloppyDrive_GetCount ; Floppy Drive count toCX194 call FloppyDrive_GetCountToCX 201 195 .CompareDriveNumberToDriveCount: 202 cmp dl, cl 196 cmp dl, cl ; Set CF when DL is smaller 203 197 ret -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuEvent.asm
r95 r124 8 8 .HardDisk resb 2 9 9 .FloppyDrive resb 2 10 .SpecialFunction resb 211 10 endstruc 12 11 … … 29 28 jmp [bx+.rgfnEventSpecificHandlers] 30 29 .EventNotHandled: 31 .IdleProcessing:32 30 clc 33 31 ret … … 35 33 ALIGN WORD_ALIGN 36 34 .rgfnEventSpecificHandlers: 37 dw .InitializeMenuinitFromDSSI 38 dw .EventCompleted 39 dw . IdleProcessing40 dw .ItemHighlightedFromCX 41 dw .ItemSelectedFromCX 42 dw .KeyStrokeInAX 43 dw BootMenuPrint_TitleStrings 44 dw .RefreshInformation 45 dw .RefreshItemFromCX 35 dw .InitializeMenuinitFromDSSI ; MENUEVENT.InitializeMenuinitFromDSSI 36 dw .EventCompleted ; MENUEVENT.ExitMenu 37 dw .EventNotHandled ; MENUEVENT.IdleProcessing 38 dw .ItemHighlightedFromCX ; MENUEVENT.ItemHighlightedFromCX 39 dw .ItemSelectedFromCX ; MENUEVENT.ItemSelectedFromCX 40 dw .KeyStrokeInAX ; MENUEVENT.KeyStrokeInAX 41 dw BootMenuPrint_TitleStrings ; MENUEVENT.RefreshTitle 42 dw .RefreshInformation ; MENUEVENT.RefreshInformation 43 dw .RefreshItemFromCX ; MENUEVENT.RefreshItemFromCX 46 44 47 45 … … 55 53 call RamVars_GetSegmentToDS 56 54 call .GetDefaultMenuitemToDX 57 call BootMenu_GetMenuitemCountTo CX55 call BootMenu_GetMenuitemCountToAX 58 56 pop ds 59 mov [si+MENUINIT.wItems], cx57 mov [si+MENUINIT.wItems], ax 60 58 mov [si+MENUINIT.wHighlightedItem], dx 61 59 mov WORD [si+MENUINIT.wTitleAndInfoLines], BOOT_MENU_TITLE_AND_INFO_LINES 62 60 mov BYTE [si+MENUINIT.bWidth], BOOT_MENU_WIDTH 63 call BootMenu_GetHeightToAHwithItemCountIn CL61 call BootMenu_GetHeightToAHwithItemCountInAL 64 62 mov [si+MENUINIT.bHeight], ah 65 63 stc … … 72 70 jnc SHORT .DoNotSetDefaultMenuitem 73 71 call DriveXlate_SetDriveToSwap 74 call BootMenu_ConvertDriveToMenuitem 75 mov dx, cx 76 ret 72 jmp BootMenu_GetMenuitemToDXforDriveInDL 77 73 ALIGN JUMP_ALIGN 78 74 .DoNotSetDefaultMenuitem: -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm
r122 r124 362 362 ALIGN JUMP_ALIGN 363 363 BootMenuPrint_TheBottomOfScreen: 364 call FloppyDrive_GetCount 364 call FloppyDrive_GetCountToCX 365 365 mov bl, cl ; Floppy Drive count to BL 366 366 call RamVars_GetHardDiskCountFromBDAtoCX -
trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm
r102 r124 120 120 ; Returns number of Floppy Drives in system. 121 121 ; 122 ; FloppyDrive_GetCount 122 ; FloppyDrive_GetCountToCX 123 123 ; Parameters: 124 124 ; Nothing … … 129 129 ;-------------------------------------------------------------------- 130 130 ALIGN JUMP_ALIGN 131 FloppyDrive_GetCount :131 FloppyDrive_GetCountToCX: 132 132 push es 133 133 %ifdef USE_AT 134 call FloppyDrive_GetCountFromBIOS134 call GetCountFromBIOS 135 135 %else 136 call FloppyDrive_GetCountFromBDA136 call GetCountFromBDA 137 137 %endif 138 138 MAX_U cl, [cs:ROMVARS.bMinFddCnt] … … 147 147 ; if this function fails. 148 148 ; 149 ; FloppyDrive_GetCountFromBIOS149 ; GetCountFromBIOS 150 150 ; Parameters: 151 151 ; Nothing … … 159 159 %ifdef USE_AT 160 160 ALIGN JUMP_ALIGN 161 FloppyDrive_GetCountFromBIOS:161 GetCountFromBIOS: 162 162 push di 163 163 push dx … … 182 182 ; This function should be used only if FloppyDrive_GetCountFromBIOS fails. 183 183 ; 184 ; FloppyDrive_GetCountFromBDA184 ; GetCountFromBDA 185 185 ; Parameters: 186 186 ; Nothing … … 192 192 %ifndef USE_AT 193 193 ALIGN JUMP_ALIGN 194 FloppyDrive_GetCountFromBDA:194 GetCountFromBDA: 195 195 LOAD_BDA_SEGMENT_TO es, cx 196 196 mov cl, [es:BDA.wEquipment] ; Load Equipment WORD low byte
Note:
See TracChangeset
for help on using the changeset viewer.