Changeset 258 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm
- Timestamp:
- Feb 22, 2012, 7:01:53 PM (12 years ago)
- google:author:
- gregli@hotmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm
r181 r258 120 120 ; Returns number of Floppy Drives in system. 121 121 ; 122 ; FloppyDrive_GetCountToCX 123 ; Parameters: 124 ; Nothing 125 ; Returns: 126 ; CX: Number of Floppy Drives 127 ; Corrupts registers: 128 ; Nothing 129 ;-------------------------------------------------------------------- 130 ALIGN JUMP_ALIGN 131 FloppyDrive_GetCountToCX: 122 ; FloppyDrive_GetCountToAX 123 ; Parameters: 124 ; DS: RAMVARS Segment 125 ; Returns: 126 ; AX: Number of Floppy Drives 127 ;-------------------------------------------------------------------- 128 ALIGN JUMP_ALIGN 129 FloppyDrive_GetCountToAX: 130 %ifdef MODULE_SERIAL_FLOPPY 131 call RamVars_UnpackFlopCntAndFirstToAL 132 adc al,1 ; adds in the drive count bit, and adds 1 for count vs. 0-index, 133 ; but still won't impact SF 134 jns .UseInternalNumber ; need to clear CH on the way out, and add in additional drive numbers 135 136 %endif 137 call FloppyDrive_GetCountFromBIOS_or_BDA 138 139 .UseInternalNumber: 140 mov ah, [cs:ROMVARS.bMinFddCnt] 141 MAX_U al, ah 142 cbw 143 144 ret 145 146 ALIGN JUMP_ALIGN 147 FloppyDrive_GetCountFromBIOS_or_BDA: 132 148 push es 133 %ifdef USE_AT134 call GetCountFromBIOS135 %else136 call GetCountFromBDA137 %endif138 mov ch, [cs:ROMVARS.bMinFddCnt]139 MAX_U cl, ch140 pop es141 xor ch, ch142 ret143 144 149 145 150 ;-------------------------------------------------------------------- … … 160 165 %ifdef USE_AT 161 166 ALIGN JUMP_ALIGN 162 GetCountFromBIOS:167 .GetCountFromBIOS: 163 168 push di 164 169 push dx 165 170 push bx 166 push ax167 171 168 172 mov ah, 08h ; Get Drive Parameters 169 173 cwd ; Floppy Drive 00h 170 174 int BIOS_DISKETTE_INTERRUPT_40h 171 mov cl, dl ; Number of Floppy Drives to CL 172 173 pop ax 175 mov al, dl ; Number of Floppy Drives to AL 176 174 177 pop bx 175 178 pop dx 176 179 pop di 177 ret 178 %endif 179 180 %endif 180 181 181 182 ;-------------------------------------------------------------------- … … 193 194 %ifndef USE_AT 194 195 ALIGN JUMP_ALIGN 195 GetCountFromBDA: 196 LOAD_BDA_SEGMENT_TO es, cx 197 mov cl, [es:BDA.wEquipment] ; Load Equipment WORD low byte 198 mov ch, cl ; Copy it to CH 199 and cx, 0C001h ; Leave bits 15..14 and 0 200 eROL_IM ch, 2 ; EW low byte bits 7..6 to 1..0 201 add cl, ch ; CL = Floppy Drive count 202 ret 203 %endif 196 .GetCountFromBDA: 197 LOAD_BDA_SEGMENT_TO es, ax 198 mov al, [es:BDA.wEquipment] ; Load Equipment WORD low byte 199 mov ah, al ; Copy it to CH 200 and ax, 0C001h ; Leave bits 15..14 and 0 201 eROL_IM ah, 2 ; EW low byte bits 7..6 to 1..0 202 add al, ah ; CL = Floppy Drive count 203 %endif 204 205 pop es 206 ret 207
Note: See TracChangeset
for help on using the changeset viewer.