Changeset 294 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm
- Timestamp:
- Mar 4, 2012, 1:35:10 AM (13 years ago)
- google:author:
- krille_n_@hotmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm
r274 r294 127 127 ;-------------------------------------------------------------------- 128 128 ALIGN JUMP_ALIGN 129 FloppyDrive_GetCountToAX: 129 FloppyDrive_GetCountToAX: 130 130 %ifdef MODULE_SERIAL_FLOPPY 131 131 call RamVars_UnpackFlopCntAndFirstToAL 132 132 js .UseBIOSorBDA ; We didn't add in any drives, counts here are not valid 133 134 adc al,1 ; adds in the drive count bit, and adds 1 for count vs. 0-index, 133 134 adc al,1 ; adds in the drive count bit, and adds 1 for count vs. 0-index, 135 135 jmp .FinishCalc ; need to clear AH on the way out, and add in minimum drive numbers 136 136 137 .UseBIOSorBDA: 137 .UseBIOSorBDA: 138 138 %endif 139 139 call FloppyDrive_GetCountFromBIOS_or_BDA 140 140 141 .FinishCalc: 141 .FinishCalc: 142 142 mov ah, [cs:ROMVARS.bMinFddCnt] 143 143 MAX_U al, ah 144 144 cbw 145 146 ret 147 148 ALIGN JUMP_ALIGN 145 146 ret 147 148 ALIGN JUMP_ALIGN 149 149 FloppyDrive_GetCountFromBIOS_or_BDA: 150 150 push es … … 152 152 ;-------------------------------------------------------------------- 153 153 ; Reads Floppy Drive Count from BIOS. 154 ; Does not work on most XT systems. Call FloppyDrive_GetCountFromBDA154 ; Does not work on most XT systems. Call .GetCountFromBDA 155 155 ; if this function fails. 156 156 ; 157 ; GetCountFromBIOS157 ; .GetCountFromBIOS 158 158 ; Parameters: 159 159 ; Nothing 160 160 ; Returns: 161 161 ; AL: Number of Floppy Drives 162 ; CF: Cleared if successful l162 ; CF: Cleared if successful 163 163 ; Set if BIOS function not supported 164 164 ; Corrupts registers: … … 169 169 .GetCountFromBIOS: 170 170 push di 171 push es172 171 push bx 173 172 push cx … … 182 181 pop cx 183 182 pop bx 184 pop es185 183 pop di 186 184 %endif … … 188 186 ;-------------------------------------------------------------------- 189 187 ; Reads Floppy Drive Count (0...4) from BIOS Data Area. 190 ; This function should be used only if FloppyDrive_GetCountFromBIOS fails.191 ; 192 ; GetCountFromBDA193 ; Parameters: 194 ; Nothing 195 ; Returns: 196 ; CL: Number of Floppy Drives197 ; Corrupts registers: 198 ; CH, ES188 ; This function should be used only if .GetCountFromBIOS fails. 189 ; 190 ; .GetCountFromBDA 191 ; Parameters: 192 ; Nothing 193 ; Returns: 194 ; AL: Number of Floppy Drives 195 ; Corrupts registers: 196 ; AH, ES 199 197 ;-------------------------------------------------------------------- 200 198 %ifndef USE_AT … … 203 201 LOAD_BDA_SEGMENT_TO es, ax 204 202 mov al, [es:BDA.wEquipment] ; Load Equipment WORD low byte 205 mov ah, al ; Copy it to CH203 mov ah, al ; Copy it to AH 206 204 and ax, 0C001h ; Leave bits 15..14 and 0 207 205 eROL_IM ah, 2 ; EW low byte bits 7..6 to 1..0 208 add al, ah ; CL = Floppy Drive count206 add al, ah ; AL = Floppy Drive count 209 207 %endif 210 208 211 209 pop es 212 210 ret 213
Note:
See TracChangeset
for help on using the changeset viewer.