Changeset 181 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs


Ignore:
Timestamp:
Nov 13, 2011, 3:38:40 PM (13 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes to all parts of the project:

  • Size optimizations.
  • Added a define (EXCLUDE_FROM_XTIDECFG) to exclude unused library code from XTIDECFG.
  • Tried to minimize time spent with interrupts disabled.
  • Some minor attempts to improve speed (reordering instructions etc).
  • Tried to improve readability, did some cleanup and fixed some errors in comments.
Location:
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm

    r173 r181  
    7878    ; Only need to limit sectors for LBA assist
    7979    test    BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA
    80     jnz     SHORT .ReturnLbaAssistedLCHS
     80    jz      SHORT AccessDPT_ShiftPCHinBXDXtoLCH
    8181
    82     ; P-CHS to L-CHS translation when necessary
    83     jmp     SHORT AccessDPT_ShiftPCHinBXDXtoLCH
     82    cmp     WORD [di+DPT.dwCylinders+2], BYTE 0
     83    jnz     SHORT .Return_MAX_LCHS_CYLINDERS
    8484
    85 .ReturnLbaAssistedLCHS:
    86     cmp     WORD [di+DPT.dwCylinders+2], BYTE 0
    87     jz      SHORT .LimitCylindersTo1024
     85    ; Limit cylinders to 1024
     86    cmp     bx, MAX_LCHS_CYLINDERS
     87    jb      SHORT .Return
     88ALIGN JUMP_ALIGN
     89.Return_MAX_LCHS_CYLINDERS:
    8890    mov     bx, MAX_LCHS_CYLINDERS
    89 .LimitCylindersTo1024:
    90     MIN_U   bx, MAX_LCHS_CYLINDERS
     91ALIGN JUMP_ALIGN, ret
     92.Return:
    9193    ret
    9294
     
    114116    jmp     SHORT .ShiftLoop
    115117.LimitHeadsTo255:                       ; DOS does not support drives with 256 heads
    116     sub     dl, dh                      ; BH set only when 256 logical heads
     118    sub     dl, dh                      ; DH set only when 256 logical heads
    117119    xor     dh, dh
    118120    ret
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm

    r175 r181  
    6666%ifdef MODULE_SERIAL
    6767    cmp     byte [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT
    68     jnz     .around
     68    jnz     .StoreAddressing
    6969    or      byte [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE
    70 .around:               
    71 %endif     
    72 
     70%endif
    7371    ; Fall to .StoreAddressing
    7472
     
    117115
    118116    ; We need to get number of bits to shift for translation
    119     push    bx
    120117    push    ax
    121118    eMOVZX  dx, bl                      ; Heads now in DX
    122     xchg    bx, ax                      ; Sectors now in BX
    123     call    AccessDPT_ShiftPCHinBXDXtoLCH
     119    xchg    bx, ax                      ; Cylinders now in BX
     120    call    AccessDPT_ShiftPCHinBXDXtoLCH   ; Leaves AX untouched
     121    xchg    bx, ax                      ; Restore HeadsAndSectors to BX
    124122    or      cl, ADDRESSING_MODE_PCHS<<ADDRESSING_MODE_FIELD_POSITION
    125123    or      [di+DPT.bFlagsLow], cl      ; Store bits to shift
    126124    pop     ax
    127     pop     bx
    128125    ; Fall to .StoreChsFromAXBX
    129126
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm

    r161 r181  
    167167;       CF:         Set if wanted DPT found
    168168;                   Cleared if DPT not found
     169;                   Unchanged if no drives
    169170;   Corrupts registers:
    170171;       Nothing unless corrupted by callback function
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm

    r155 r181  
    9393    test    BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_FULLMODE
    9494    jnz     SHORT .GetStolenSegmentToDS
     95%ifndef USE_186
    9596    mov     di, LITE_MODE_RAMVARS_SEGMENT
    9697    mov     ds, di
     98%else
     99    push    LITE_MODE_RAMVARS_SEGMENT
     100    pop     ds
     101%endif
    97102    ret
    98103
     
    183188    LOAD_BDA_SEGMENT_TO es, cx, !       ; Zero CX
    184189    call    RamVars_GetCountOfKnownDrivesToDL
    185     MAX_U   dl, [es:BDA.bHDCount]
    186     mov     cl, dl
     190    mov     cl, [es:BDA.bHDCount]
     191    MAX_U   cl, dl
    187192
    188193    pop     dx
Note: See TracChangeset for help on using the changeset viewer.