Changeset 630 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Device


Ignore:
Timestamp:
Dec 31, 2024, 3:38:24 PM (9 days ago)
Author:
Krister Nordvall
Message:

Changes:

  • Changed the g_szPCFlashSuccessful string in XTIDECFG to reflect the reality - it turns out ANY key was limited to just ENTER or ESC.
  • Removed the NEC V-specific optimization I added in r602 because NEC's documentation completely fails to mention that the ROL4 instruction also changes the high nibble of AL. Huge thanks to vcfed-member dreNorteR for discovering this and also for suggesting an optimization to the physical address conversion code in IdeTransfer.asm.
  • Made some changes to the OUTPUT_AL_TO_IDE_REGISTER and OUTPUT_AL_TO_IDE_CONTROL_BLOCK_REGISTER macros as an optimization. This saves 15+12 bytes in builds without MODULE_8BIT_IDE (e.g. the PS/2 builds).
  • Other minor optimizations and cleanups.
Location:
trunk/XTIDE_Universal_BIOS/Src/Device/IDE
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm

    r625 r630  
    44;
    55; XTIDE Universal BIOS and Associated Tools
    6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2023 by XTIDE Universal BIOS Team.
     6; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2024 by XTIDE Universal BIOS Team.
    77;
    88; This program is free software; you can redistribute it and/or modify
     
    3939    mov     al, FLG_DEVCONTROL_SRST | FLG_DEVCONTROL_nIEN
    4040; ---
     41%define IO_SEQUENCE     ; Do not modify DX while this is in effect!
    4142    OUTPUT_AL_TO_IDE_CONTROL_BLOCK_REGISTER     DEVICE_CONTROL_REGISTER_out
    4243    mov     ax, HSR0_RESET_WAIT_US
     
    5253; ---
    5354    OUTPUT_AL_TO_IDE_CONTROL_BLOCK_REGISTER     DEVICE_CONTROL_REGISTER_out
     55%undef IO_SEQUENCE      ; DX can be freely modified again.
    5456    mov     ax, HSR1_RESET_WAIT_US
    5557    call    Timer_DelayMicrosecondsFromAX
     
    277279ALIGN JUMP_ALIGN
    278280OutputSectorCountAndAddress:
     281%define IO_SEQUENCE     ; Do not modify DX while this is in effect!
    279282    OUTPUT_AL_TO_IDE_REGISTER   SECTOR_COUNT_REGISTER
    280283
     
    287290    mov     al, ch
    288291    OUTPUT_AL_TO_IDE_REGISTER   LBA_HIGH_REGISTER
     292%undef IO_SEQUENCE      ; DX can be freely modified again.
    289293    ret
    290294
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm

    r625 r630  
    44;
    55; XTIDE Universal BIOS and Associated Tools
    6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2023 by XTIDE Universal BIOS Team.
     6; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2024 by XTIDE Universal BIOS Team.
    77;
    88; This program is free software; you can redistribute it and/or modify
     
    264264
    265265    ; Convert ES:SI to physical address
    266 %ifdef USE_386
    267     mov     dx, es
    268     xor     ax, ax
    269     shld    ax, dx, 4
    270     shl     dx, 4
    271     add     si, dx
    272     adc     al, ah
    273     mov     es, ax
    274 
    275 %elifdef USE_186
    276 %ifdef USE_NEC_V
    277     mov     dx, es
    278     xor     ax, ax
    279     eROL4   dl
    280     eROL4   dh
    281     add     si, dx
    282     adc     al, ah
    283     mov     es, ax
    284 
    285 %else
    286     mov     ax, es
    287     rol     ax, 4
    288     mov     dx, ax
    289     and     ax, 0Fh
    290     xor     dx, ax
    291     add     si, dx
    292     adc     al, ah
    293     mov     es, ax
    294 
    295 %endif
     266%ifdef USE_386      ; 17 bytes
     267    mov     dx, es              ; 2
     268    xor     ax, ax              ; 2
     269    shld    ax, dx, 4           ; 3
     270    shl     dx, 4               ; 3
     271    add     si, dx              ; 2
     272    adc     al, ah              ; 2
     273    mov     es, ax              ; 2
     274                            ;------
     275                            ;    16 cycles on 386
     276%elifdef USE_186    ; 17 bytes
     277    mov     ax, es              ; 2
     278    rol     ax, 4               ; 3
     279    mov     dx, ax              ; 2
     280    and     al, 0F0h            ; 2
     281    xor     dx, ax              ; 2
     282    add     si, ax              ; 2
     283    adc     dl, dh              ; 2
     284    mov     es, dx              ; 2
     285                            ;------
     286                            ;    17 cycles on 386
    296287%else ; 808x
    297288    mov     al, 4
     
    301292    mov     cx, dx
    302293    xchg    cx, ax
    303     and     ax, 0Fh
     294    and     al, 0F0h
    304295    xor     dx, ax
    305     add     si, dx
    306     adc     al, ah
    307     mov     es, ax
     296    add     si, ax
     297    adc     dl, dh
     298    mov     es, dx
    308299
    309300%endif
Note: See TracChangeset for help on using the changeset viewer.