Changeset 130 in xtideuniversalbios


Ignore:
Timestamp:
Mar 4, 2011, 5:54:41 PM (11 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • Boot menu finally works but timeout and drive numbers not yet implemented.
Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm

    r128 r130  
    2424    cmp     cx, BYTE NO_ITEM_SELECTED
    2525    je      SHORT BootMenu_DisplayAndReturnSelection    ; Clear screen and display menu
    26     ; Fall through to BootMenu_ConvertMenuitemFromCXtoDriveInDX
     26    ; Fall to BootMenu_GetDriveToDXforMenuitemInCX
    2727
    2828;--------------------------------------------------------------------
    29 ; BootMenu_ConvertMenuitemFromCXtoDriveInDX
     29; BootMenu_GetDriveToDXforMenuitemInCX
    3030;   Parameters:
    3131;       CX:     Index of menuitem selected from Boot Menu
     
    3737;--------------------------------------------------------------------
    3838ALIGN JUMP_ALIGN
    39 BootMenu_ConvertMenuitemFromCXtoDriveInDX:
     39BootMenu_GetDriveToDXforMenuitemInCX:
    4040    mov     dx, cx                  ; Copy menuitem index to DX
    4141    call    FloppyDrive_GetCountToCX
     
    107107
    108108;--------------------------------------------------------------------
    109 ; BootMenu_ConvertAsciiHotkeyFromALtoMenuitemInCX
     109; BootMenu_GetMenuitemToAXforAsciiHotkeyInAL
    110110;   Parameters:
    111 ;       AL:     ASCII hotkey starting from upper case 'A'
     111;       AL:     ASCII hotkey
    112112;   Returns:
    113 ;       CX:     Menuitem index
     113;       AX:     Menuitem index
    114114;   Corrupts registers:
    115 ;       AX
     115;       CX
    116116;--------------------------------------------------------------------
    117117ALIGN JUMP_ALIGN
    118 BootMenu_ConvertAsciiHotkeyFromALtoMenuitemInCX:
     118BootMenu_GetMenuitemToAXforAsciiHotkeyInAL:
     119    call    Char_ALtoUpperCaseLetter
    119120    call    BootMenu_GetLetterForFirstHardDiskToCL
     121    xor     ah, ah
    120122    cmp     al, cl                      ; Letter is for Hard Disk?
    121123    jae     SHORT .StartFromHardDiskLetter
    122124    sub     al, 'A'                     ; Letter to Floppy Drive menuitem
    123     xchg    ax, cx                      ; Menuitem index to CX
    124125    ret
    125126ALIGN JUMP_ALIGN
     
    127128    sub     al, cl                      ; Hard Disk index
    128129    call    FloppyDrive_GetCountToCX
    129     add     cx, ax                      ; Menuitem index
     130    add     ax, cx                      ; Menuitem index
    130131    ret
    131132
     
    188189BootMenu_IsDriveInSystem:
    189190    test    dl, dl                              ; Floppy drive?
    190     jns     SHORT .IsFloppyDriveIsInSystem
     191    jns     SHORT .IsFloppyDriveInSystem
    191192    call    RamVars_GetHardDiskCountFromBDAtoCX ; Hard Disk count to CX
    192193    or      cl, 80h                             ; Set Hard Disk bit to CX
    193194    jmp     SHORT .CompareDriveNumberToDriveCount
    194 .IsFloppyDriveIsInSystem:
     195.IsFloppyDriveInSystem:
    195196    call    FloppyDrive_GetCountToCX
    196197.CompareDriveNumberToDriveCount:
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuEvent.asm

    r128 r130  
    8686    call    RamVars_GetSegmentToDS
    8787    call    DriveXlate_Reset
    88     call    BootMenu_ConvertMenuitemFromCXtoDriveInDX
     88    call    BootMenu_GetDriveToDXforMenuitemInCX
    8989    call    DriveXlate_SetDriveToSwap
    9090    pop     ax      ; Update previous item
     
    107107ALIGN JUMP_ALIGN
    108108.CheckDriveHotkeys:
    109     call    BootMenu_ConvertAsciiHotkeyFromALtoMenuitemInCX
    110     cmp     cx, [bp+MENUINIT.wItems]
     109    call    BootMenu_GetMenuitemToAXforAsciiHotkeyInAL
     110    cmp     ax, [bp+MENUINIT.wItems]
    111111    jae     SHORT .EventCompleted   ; Invalid key
    112     xchg    ax, cx
    113112    CALL_MENU_LIBRARY HighlightItemFromAX
    114113    ; Fall to .ItemSelectedFromCX
     
    150149;       CF:     set since event processed
    151150;--------------------------------------------------------------------
    152 ALIGN JUMP_ALIGN
    153151.RefreshItemOrInformationWithJumpTableInCSBX:
    154152    cmp     cl, NO_ITEM_HIGHLIGHTED
     
    156154
    157155    call    RamVars_GetSegmentToDS
    158     call    BootMenu_ConvertMenuitemFromCXtoDriveInDX
     156    call    BootMenu_GetDriveToDXforMenuitemInCX
    159157    test    dl, dl                  ; Floppy drive?
    160158    jns     SHORT .DrawFloppyDrive
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm

    r128 r130  
    44; Section containing code
    55SECTION .text
     6
     7;--------------------------------------------------------------------
     8; BootMenuPrint_ClearScreen
     9;   Parameters:
     10;       Nothing
     11;   Returns:
     12;       Nothing
     13;   Corrupts registers:
     14;       AX, DI
     15;--------------------------------------------------------------------
     16ALIGN JUMP_ALIGN
     17BootMenuPrint_ClearScreen:
     18    call    BootMenuPrint_InitializeDisplayContext
     19    xor     ax, ax
     20    CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
     21    mov     ax, ' ' | (MONO_NORMAL<<8)
     22    CALL_DISPLAY_LIBRARY ClearScreenWithCharInALandAttrInAH
     23    ret
     24
     25
     26;--------------------------------------------------------------------
     27; BootMenuPrint_InitializeDisplayContext
     28;   Parameters:
     29;       Nothing
     30;   Returns:
     31;       Nothing
     32;   Corrupts registers:
     33;       AX, DI
     34;--------------------------------------------------------------------
     35ALIGN JUMP_ALIGN
     36BootMenuPrint_InitializeDisplayContext:
     37    CALL_DISPLAY_LIBRARY InitializeDisplayContext
     38    ret
     39
    640
    741;--------------------------------------------------------------------
     
    4074    pop     di
    4175    stc
    42     ret
    43 
    44 
    45 ;--------------------------------------------------------------------
    46 ; BootMenuPrint_ClearScreen
    47 ;   Parameters:
    48 ;       Nothing
    49 ;   Returns:
    50 ;       Nothing
    51 ;   Corrupts registers:
    52 ;       AX, DI
    53 ;--------------------------------------------------------------------
    54 ALIGN JUMP_ALIGN
    55 BootMenuPrint_ClearScreen:
    56     mov     ax, ' ' | (MONO_NORMAL<<8)
    57     CALL_DISPLAY_LIBRARY ClearScreenWithCharInALandAttrInAH
    5876    ret
    5977
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootPrint.asm

    r128 r130  
    3737
    3838;--------------------------------------------------------------------
    39 ; BootPrint_BootSectorResultStringFromBX
     39; BootPrint_BootSectorResultStringFromAX
    4040;   Parameters:
    41 ;       CS:BX:  Ptr to "found" or "not found"
     41;       CS:AX:  Ptr to "found" or "not found"
    4242;   Returns:
    4343;       Nothing
    4444;   Corrupts registers:
    45 ;       AX, SI, DI
     45;       AX, CX, SI, DI
    4646;--------------------------------------------------------------------
    4747ALIGN JUMP_ALIGN
    48 BootPrint_BootSectorResultStringFromBX:
     48BootPrint_BootSectorResultStringFromAX:
    4949    push    bp
    5050    mov     bp, sp
    51     ePUSH_T ax, g_szBootSector
    52     push    bx          ; "found" or "not found"
     51    ePUSH_T cx, g_szBootSector
     52    push    ax          ; "found" or "not found"
    5353    mov     si, g_szSectRead
    5454    jmp     BootMenuPrint_FormatCSSIfromParamsInSSBP
     
    6262;       Nothing
    6363;   Corrupts registers:
    64 ;       AX, BX, SI, DI
     64;       AX, CX, SI, DI
    6565;--------------------------------------------------------------------
    6666ALIGN JUMP_ALIGN
     
    6868    push    bp
    6969    mov     bp, sp
    70     eMOVZX  bx, ah
    71     push    bx                  ; Push INT 13h error code
     70    eMOVZX  cx, ah
     71    push    cx                  ; Push INT 13h error code
    7272    mov     si, g_szReadError
    7373    jmp     BootMenuPrint_FormatCSSIfromParamsInSSBP
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootSector.asm

    r128 r130  
    2828    jne     SHORT .FirstHardDiskSectorNotBootable
    2929.AlwaysBootFromFloppyDriveForBooterGames:
    30     mov     bx, g_szFound
    31     call    BootPrint_BootSectorResultStringFromBX
     30    mov     ax, g_szFound
     31    call    BootPrint_BootSectorResultStringFromAX
    3232    stc
    3333    ret
     
    3737    ret
    3838.FirstHardDiskSectorNotBootable:
    39     mov     bx, g_szNotFound
    40     call    BootPrint_BootSectorResultStringFromBX
     39    mov     ax, g_szNotFound
     40    call    BootPrint_BootSectorResultStringFromAX
    4141    clc
    4242    ret
     
    6666    dec     di                              ; Decrement retry counter
    6767    jnz     SHORT .ReadRetryLoop            ; Loop while retries left
    68 ALIGN JUMP_ALIGN
    6968.Return:
    7069    ret
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19hMenu.asm

    r122 r130  
    2020    STORE_POST_STACK_POINTER
    2121    SWITCH_TO_BOOT_MENU_STACK
    22     CALL_DISPLAY_LIBRARY InitializeDisplayContext
     22    call    BootMenuPrint_InitializeDisplayContext
    2323    call    RamVars_GetSegmentToDS
    2424    ; Fall to .ProcessMenuSelectionsUntilBootable
     
    3434.ProcessMenuSelectionsUntilBootable:
    3535    call    BootMenu_DisplayAndReturnSelection
    36     call    DriveXlate_ToOrBack         ; Translate drive number
     36    call    DriveXlate_ToOrBack                         ; Translate drive number
    3737    call    BootSector_TryToLoadFromDriveDL
    3838    jnc     SHORT .ProcessMenuSelectionsUntilBootable   ; Boot failure, show menu again
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm

    r120 r130  
    7070;--------------------------------------------------------------------
    7171Initialize_AndDetectDrives:
    72     CALL_DISPLAY_LIBRARY InitializeDisplayContext
     72    call    BootMenuPrint_InitializeDisplayContext
    7373    call    DetectPrint_RomFoundAtSegment
    7474    call    RamVars_Initialize
  • trunk/XTIDE_Universal_BIOS/Src/Strings.asm

    r127 r130  
    3434g_szCapacity:   db  "Capacity : ",NULL
    3535g_szSizeSingle: db  "%s%u.%u %ciB",NULL
    36 g_szSizeDual:   db  "%s%u.%u %ciB / %u.%u %ciB",LF,CR,NULL
     36g_szSizeDual:   db  "%s%4-u.%u %ciB / %4-u.%u %ciB",LF,CR,NULL
    3737g_szCfgHeader:  db  "Addr.",SINGLE_VERTICAL,"Block",SINGLE_VERTICAL,"Bus",  SINGLE_VERTICAL,"IRQ",  SINGLE_VERTICAL,"Reset",LF,CR,NULL
    38 g_szCfgFormat:  db  "%s"   ,SINGLE_VERTICAL,"%5u",  SINGLE_VERTICAL,"%c%2u",SINGLE_VERTICAL," %c%c",SINGLE_VERTICAL,"%5x",  NULL
     38g_szCfgFormat:  db  "%s"   ,SINGLE_VERTICAL,"%5-u",  SINGLE_VERTICAL,"%c%2u",SINGLE_VERTICAL," %c%c",SINGLE_VERTICAL,"%5-x",  NULL
    3939g_szLCHS:       db  "L-CHS",NULL
    4040g_szPCHS:       db  "P-CHS",NULL
Note: See TracChangeset for help on using the changeset viewer.