Changeset 630 in xtideuniversalbios


Ignore:
Timestamp:
Dec 31, 2024, 3:38:24 PM (6 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
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Inc/NEC_V.inc

    r593 r630  
    44;
    55; XTIDE Universal BIOS and Associated Tools
    6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 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
     
    782782;
    783783; Rotates the destination four bits to the left via the low nibble of AL.
     784; If the destination is AL then the high and low nibbles will be swapped.
    784785;
    785786; eROL4
     
    787788;       %1:     8-bit destination (register or memory location)
    788789;   Returns:
    789 ;       AL:     The high nibble of %1 in the low nibble of AL
     790;       AL:     The low nibble of AL in the high nibble of AL
     791;               The high nibble of %1 in the low nibble of AL
    790792;       %1:     The low nibble of %1 in the high nibble of %1
    791793;               The low nibble of AL in the low nibble of %1
     
    863865;
    864866; Rotates the destination four bits to the right via the low nibble of AL.
     867; If the destination is AL then nothing changes.
    865868;
    866869; eROR4
     
    868871;       %1:     8-bit destination (register or memory location)
    869872;   Returns:
    870 ;       AL:     The low nibble of %1 in the low nibble of AL
     873;       AL:     The high nibble of %1 in the high nibble of AL
     874;               The low nibble of %1 in the low nibble of AL
    871875;       %1:     The high nibble of %1 in the low nibble of %1
    872876;               The low nibble of AL in the high nibble of %1
  • trunk/BIOS_Drive_Information_Tool/Src/Strings.asm

    r624 r630  
    44;
    55; XTIDE Universal BIOS and Associated Tools
    6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 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
     
    2222
    2323g_szProgramName:    db  "BIOS Drive Information Tool v1.0.3",CR,LF
    24                     db  "(C) 2012-2022 by XTIDE Universal BIOS Team",CR,LF
     24                    db  "(C) 2012-2024 by XTIDE Universal BIOS Team",CR,LF
    2525                    db  "Released under GNU GPL v2",CR,LF
    2626                    db  "http://xtideuniversalbios.org/",CR,LF,NULL
  • trunk/XTIDE_Universal_BIOS/Inc/IdeIO.inc

    r623 r630  
    44;
    55; XTIDE Universal BIOS and Associated Tools
    6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 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
     
    3737%ifndef MODULE_8BIT_IDE ; Standard IDE controllers only
    3838
    39     %ifnidni %1, dx
    40         mov     dx, %1
    41     %endif
    42     add     dx, [di+DPT.wBasePort]
     39    %ifdef IO_SEQUENCE
     40        %ifndef previous_parameter
     41            %ifnidni %1, dx
     42                mov     dx, %1
     43            %endif
     44            add     dx, [di+DPT.wBasePort]
     45        %elif previous_parameter + 1 = %1
     46            inc     dx
     47        %elif previous_parameter - 1 = %1
     48            dec     dx
     49        %elif previous_parameter = %1
     50        %else
     51            %ifnidni %1, dx
     52                mov     dx, %1
     53            %endif
     54            add     dx, [di+DPT.wBasePort]
     55        %endif
     56        %define previous_parameter %1
     57
     58    %else ; ~IO_SEQUENCE
     59        %undef previous_parameter
     60        %ifnidni %1, dx
     61            mov     dx, %1
     62        %endif
     63        add     dx, [di+DPT.wBasePort]
     64    %endif
    4365    out     dx, al
    4466
     
    5779%ifndef MODULE_8BIT_IDE ; Standard IDE controllers only
    5880
    59     eMOVZX  bx, [di+DPT.bIdevarsOffset]
    60     %ifnidni %1, dx
    61         mov     dx, %1
    62     %endif
    63     add     dx, [cs:bx+IDEVARS.wControlBlockPort]
     81    %ifdef IO_SEQUENCE
     82        %ifndef previous_parameter
     83            eMOVZX  bx, [di+DPT.bIdevarsOffset]
     84            %ifnidni %1, dx
     85                mov     dx, %1
     86            %endif
     87            add     dx, [cs:bx+IDEVARS.wControlBlockPort]
     88        %elif previous_parameter + 1 = %1
     89            inc     dx
     90        %elif previous_parameter - 1 = %1
     91            dec     dx
     92        %elif previous_parameter = %1
     93        %else
     94            eMOVZX  bx, [di+DPT.bIdevarsOffset]
     95            %ifnidni %1, dx
     96                mov     dx, %1
     97            %endif
     98            add     dx, [cs:bx+IDEVARS.wControlBlockPort]
     99        %endif
     100        %define previous_parameter %1
     101
     102    %else ; ~IO_SEQUENCE
     103        %undef previous_parameter
     104        eMOVZX  bx, [di+DPT.bIdevarsOffset]
     105        %ifnidni %1, dx
     106            mov     dx, %1
     107        %endif
     108        add     dx, [cs:bx+IDEVARS.wControlBlockPort]
     109    %endif
    64110    out     dx, al
    65111
  • trunk/XTIDE_Universal_BIOS/Inc/Revision.inc

    r629 r630  
    1 629
     1630
  • 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
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/BootSector.asm

    r597 r630  
    44;
    55; XTIDE Universal BIOS and Associated Tools
    6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 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
     
    2828;   Returns:
    2929;       ES:BX:  Ptr to boot sector (if successful)
    30 ;       CF:     Set if boot sector loaded successfully
    31 ;               Cleared if failed to load boot sector
     30;       CF:     Cleared if boot sector loaded successfully
     31;               (only matters when jumping to
     32;               Int19h_JumpToBootSectorInESBXOrRomBoot)
    3233;   Corrupts registers:
    33 ;       AX, CX, DH, SI, DI, (DL if failed to read boot sector)
     34;       AX, CX, DH, SI, DI
    3435;--------------------------------------------------------------------
    3536BootSector_TryToLoadFromDriveDL_AndBoot:
    3637    call    DetectPrint_TryToBootFromDL
    3738    call    BootSector_LoadFirstSectorFromDriveDL
     39    inc     dx                                              ; Determine if hard drive or floppy drive without changing the CF
     40    dec     dl
    3841    jnc     SHORT .FirstSectorLoadedToESBX
    3942
     
    4245    ; display error code every time user intends to boot from hard disk
    4346    ; when A then C boot order is used.
    44     test    dl, dl
    45     js      SHORT .PrintFailedToLoadErrorCode   ; Hard Drive
     47    js      SHORT .PrintFailedToLoadErrorCode               ; Hard Drive
    4648    cmp     ah, RET_HD_TIMEOUT
    47     je      SHORT .ReturnWithCFclearSinceFailedToLoadBootSector
     49    je      SHORT BootSector_LoadFirstSectorFromDriveDL.Return
    4850    cmp     ah, RET_HD_NOMEDIA
    49     je      SHORT .ReturnWithCFclearSinceFailedToLoadBootSector
     51    je      SHORT BootSector_LoadFirstSectorFromDriveDL.Return
    5052.PrintFailedToLoadErrorCode:
    51     call    DetectPrint_FailedToLoadFirstSector
    52     jmp     SHORT .ReturnWithCFclearSinceFailedToLoadBootSector
    53 
     53    jmp     DetectPrint_FailedToLoadFirstSector
    5454
    5555.FirstSectorLoadedToESBX:
    56     test    dl, dl
    57     jns     SHORT .AlwaysBootFromFloppyDriveForBooterGames
    58     cmp     WORD [es:bx+510], 0AA55h        ; Valid boot sector?
    59     jne     SHORT .FirstHardDiskSectorNotBootable
    60 .AlwaysBootFromFloppyDriveForBooterGames:
    61     clc     ; Boot Sector loaded successfully
    62     jmp     SHORT Int19h_JumpToBootSectorInESBXOrRomBoot
    63 
    64 .FirstHardDiskSectorNotBootable:
     56    jns     SHORT Int19h_JumpToBootSectorInESBXOrRomBoot    ; Don't check for boot sector signature for floppy booter games
     57    cmp     WORD [es:bx+510], 0AA55h                        ; Valid boot sector?
     58    je      SHORT Int19h_JumpToBootSectorInESBXOrRomBoot    ; With CF cleared
    6559    mov     si, g_szBootSectorNotFound
    66     call    DetectPrint_NullTerminatedStringFromCSSI
    67 .ReturnWithCFclearSinceFailedToLoadBootSector:
    68     clc
    69     ret
     60    jmp     DetectPrint_NullTerminatedStringFromCSSI
    7061
    7162
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm

    r593 r630  
    44;
    55; XTIDE Universal BIOS and Associated Tools
    6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 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
     
    141141AccessDPT_GetPointerToDRVPARAMStoCSBX:
    142142    call    AccessDPT_GetIdevarsToCSBX
    143     add     bx, BYTE IDEVARS.drvParamsMaster    ; CS:BX points to Master Drive DRVPARAMS
     143    add     bx, BYTE IDEVARS.drvParamsMaster+DRVPARAMS_size ; CS:BX points to Slave Drive DRVPARAMS
    144144    test    BYTE [di+DPT.bFlagsLow], FLGL_DPT_SLAVE
    145     jz      SHORT .ReturnPointerToDRVPARAMS
    146     add     bx, BYTE DRVPARAMS_size             ; CS:BX points to Slave Drive DRVPARAMS
    147 .ReturnPointerToDRVPARAMS:
     145    jnz     SHORT .Return
     146    sub     bx, BYTE DRVPARAMS_size                         ; CS:BX points to Master Drive DRVPARAMS
     147.Return:
    148148    ret
    149149
  • trunk/XTIDE_Universal_BIOS/makefile

    r625 r630  
    4444# USE_386                     Use instructions supported by 386 and later (defines USE_286)        #
    4545# USE_AT                      Use features supported on AT and later systems (not available on XT) #
    46 # USE_PS2                     For use with IBM PS/2 machines only (defines USE_AT)                 #
     46# USE_PS2                     For use with 286+ IBM PS/2 machines only (defines USE_AT)            #
    4747# USE_UNDOC_INTEL             Optimizations for Intel CPUs - do NOT use on NEC V20/V30/Sony CPUs   #
    4848# USE_NEC_V                   Optimizations for use with NEC V20/V30 CPUs only                     #
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Flash.asm

    r620 r630  
    44;
    55; XTIDE Universal BIOS and Associated Tools
    6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 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
     
    5959
    6060.PollingError:
    61     mov     BYTE [bp+FLASHVARS.flashResult], FLASH_RESULT.PollingTimeoutError
    62     ret
     61    mov     al, FLASH_RESULT.PollingTimeoutError
     62    SKIP2B  f
    6363.DataVerifyError:
    64     mov     BYTE [bp+FLASHVARS.flashResult], FLASH_RESULT.DataVerifyError
     64    mov     al, FLASH_RESULT.DataVerifyError
     65    mov     [bp+FLASHVARS.flashResult], al
    6566    ret
    6667
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.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
     
    6666                            db  "EEPROM was not flashed properly!",NULL
    6767g_szPCFlashSuccessful:      db  "EEPROM was written successfully.",LF
    68                             db  "Press any key to reboot.",NULL
     68                            db  "Close dialog to reboot.",NULL
    6969g_szForeignFlash:           db  "EEPROM was written successfully.",NULL
    7070
     
    9898g_szNfoMainFlash:       db  "Flash loaded BIOS image to EEPROM.",NULL
    9999g_szNfoMainSave:        db  "Save BIOS changes back to original file from which it was loaded.",NULL
    100 g_szNfoMainLicense:     db  "XTIDE Universal BIOS and XTIDECFG Copyright (C) 2009-2010 by Tomi Tilli, 2011-2023 by XTIDE Universal BIOS Team."
     100g_szNfoMainLicense:     db  "XTIDE Universal BIOS and XTIDECFG Copyright (C) 2009-2010 by Tomi Tilli, 2011-2024 by XTIDE Universal BIOS Team."
    101101                        db  " Released under GNU GPL v2, with ABSOLUTELY NO WARRANTY. Press ENTER for more details...",NULL
    102102g_szNfoMainHomePage:    db  "Visit http://xtideuniversalbios.org (home page) and http://forum.vcfed.org (support)",NULL
    103103
    104104g_szHelpMainLicense:    db  "XTIDE Universal BIOS and XTIDECFG Configuration program are Copyright 2009-2010 by Tomi Tilli,"
    105                         db  " 2011-2023 by XTIDE Universal BIOS Team. Released under GNU GPL v2. This software comes with ABSOLUTELY NO WARRANTY."
     105                        db  " 2011-2024 by XTIDE Universal BIOS Team. Released under GNU GPL v2. This software comes with ABSOLUTELY NO WARRANTY."
    106106                        db  " This is free software, and you are welcome to redistribute it under certain conditions."
    107107                        db  " See the LICENSE.TXT file that was included with this distribution,"
Note: See TracChangeset for help on using the changeset viewer.