Ignore:
Timestamp:
Dec 31, 2024, 3:38:24 PM (8 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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.