Changeset 241 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuEvent.asm


Ignore:
Timestamp:
Feb 9, 2012, 11:08:59 AM (12 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

Space optimizations in the Boot Menu and BootInfo routines, taking advantage of nested %s. Optimization in the init of RamVars to avoid writing the signature twice. Preparing for addition of serial floppy support, starting to break the assumption that our drives are always 80h or higher.

File:
1 edited

Legend:

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

    r212 r241  
    2525
    2626MENUEVENT_InitializeMenuinitFromDSSI equ  (BootMenuEvent_Handler.InitializeMenuinitFromDSSI - BootMenuEvent_Handler)
    27 MENUEVENT_ExitMenu equ  (BootMenuEvent_Handler.EventCompleted - BootMenuEvent_Handler)
     27MENUEVENT_ExitMenu equ  (BootMenuEvent_EventCompleted - BootMenuEvent_Handler)
    2828MENUEVENT_ItemHighlightedFromCX equ (BootMenuEvent_Handler.ItemHighlightedFromCX - BootMenuEvent_Handler)
    2929MENUEVENT_ItemSelectedFromCX equ (BootMenuEvent_Handler.ItemSelectedFromCX - BootMenuEvent_Handler)
    3030MENUEVENT_KeyStrokeInAX equ (BootMenuEvent_Handler.KeyStrokeInAX - BootMenuEvent_Handler)
    3131MENUEVENT_RefreshTitle equ (BootMenuPrint_TitleStrings - BootMenuEvent_Handler)
    32 MENUEVENT_RefreshInformation equ (BootMenuEvent_Handler.RefreshInformation - BootMenuEvent_Handler)
    33 MENUEVENT_RefreshItemFromCX equ (BootMenuEvent_Handler.RefreshItemFromCX - BootMenuEvent_Handler)
     32MENUEVENT_RefreshInformation equ (BootMenuPrint_RefreshInformation - BootMenuEvent_Handler)
     33MENUEVENT_RefreshItemFromCX equ (BootMenuPrint_RefreshItem - BootMenuEvent_Handler)
    3434;
    3535; Note that there is no entry for MENUEVENT_IdleProcessing.  If MENUEVENT_IDLEPROCESSING_ENABLE is not %defined,
     
    4949ALIGN WORD_ALIGN
    5050.rgfnEventSpecificHandlers:
    51     dw      .InitializeMenuinitFromDSSI ; MENUEVENT.InitializeMenuinitFromDSSI
    52     dw      .EventCompleted             ; MENUEVENT.ExitMenu
    53     dw      .EventNotHandled            ; MENUEVENT.IdleProcessing
    54     dw      .ItemHighlightedFromCX      ; MENUEVENT.ItemHighlightedFromCX
    55     dw      .ItemSelectedFromCX         ; MENUEVENT.ItemSelectedFromCX
    56     dw      .KeyStrokeInAX              ; MENUEVENT.KeyStrokeInAX
    57     dw      BootMenuPrint_TitleStrings  ; MENUEVENT.RefreshTitle
    58     dw      .RefreshInformation         ; MENUEVENT.RefreshInformation
    59     dw      .RefreshItemFromCX          ; MENUEVENT.RefreshItemFromCX
     51    dw      .InitializeMenuinitFromDSSI         ; MENUEVENT.InitializeMenuinitFromDSSI
     52    dw      BootMenuEvent_EventCompleted        ; MENUEVENT.ExitMenu
     53    dw      .EventNotHandled                    ; MENUEVENT.IdleProcessing
     54    dw      .ItemHighlightedFromCX              ; MENUEVENT.ItemHighlightedFromCX
     55    dw      .ItemSelectedFromCX                 ; MENUEVENT.ItemSelectedFromCX
     56    dw      .KeyStrokeInAX                      ; MENUEVENT.KeyStrokeInAX
     57    dw      BootMenuPrint_TitleStrings          ; MENUEVENT.RefreshTitle
     58    dw      BootMenuPrint_RefreshInformation    ; MENUEVENT.RefreshInformation
     59    dw      BootMenuPrint_RefreshItem           ; MENUEVENT.RefreshItemFromCX
    6060
    6161%endif
     
    103103.ItemHighlightedFromCX:
    104104    push    cx
    105     call    RamVars_GetSegmentToDS
     105    call    BootMenu_GetDriveToDXforMenuitemInCX_And_RamVars_GetSegmentToDS     
    106106    call    DriveXlate_Reset
    107     call    BootMenu_GetDriveToDXforMenuitemInCX
    108107    call    DriveXlate_SetDriveToSwap
    109108
     
    134133    call    BootMenu_GetMenuitemToAXforAsciiHotkeyInAL
    135134    cmp     ax, [bp+MENUINIT.wItems]
    136     jae     SHORT .EventCompleted   ; Invalid key
     135    jae     SHORT BootMenuEvent_EventCompleted  ; Invalid key
    137136    CALL_MENU_LIBRARY HighlightItemFromAX
    138137    ; Fall to .ItemSelectedFromCX
     
    144143.ItemSelectedFromCX:
    145144    CALL_MENU_LIBRARY Close
    146 .EventCompleted:
     145       
     146BootMenuEvent_EventCompleted:
    147147    stc
    148148    ret
    149149
    150 
    151 ; Parameters:
    152 ;   CX:         Index of item to refresh
    153 ;   Cursor has been positioned to the beginning of item line
    154 ALIGN JUMP_ALIGN
    155 .RefreshItemFromCX:
    156     xor     bl, bl      ; will result in SF being clear in .RefreshItemOrInformation...
    157     SKIP2B  dx          ; dx corrupted below by BootMenu_GetDriveToDXforMenuitemInCX
    158     ; Fall to .RefreshInformation
    159 
    160 ; Parameters:
    161 ;   CX:         Index of highlighted item
    162 ;   Cursor has been positioned to the beginning of first line
    163 ; NO ALIGN - in the shadow of SKIP2B
    164 .RefreshInformation:
    165     mov     bl,040h     ;  will result in SF being set in .RefreshItemOrInformation...
    166     ; Fall to .RefreshItemOrInformationWithJumpTableInCSBX
    167 
    168 ;--------------------------------------------------------------------
    169 ; RefreshItemOrInformationWithJumpTableInCSBX
    170 ;   Parameters:
    171 ;       CX:     Index of selected menuitem
    172 ;       CS:BX:  Ptr to ITEM_TYPE_REFRESH jump table
    173 ;   Returns:
    174 ;       CF:     set since event processed
    175 ;--------------------------------------------------------------------
    176 .RefreshItemOrInformationWithJumpTableInCSBX:
    177     cmp     cl, NO_ITEM_HIGHLIGHTED
    178     je      SHORT .EventCompleted
    179 
    180     call    RamVars_GetSegmentToDS
    181     call    BootMenu_GetDriveToDXforMenuitemInCX
    182     or      bl,dl               ;  or drive number with bit from .RefreshItemFromCX or .RefreshInformation
    183     shl     bl,1                ;  drive letter high order bit to CF, Item/Information bit to SF
    184     jc      SHORT BootMenuPrint_HardDiskMenuitem
    185     ; fall through to BootMenuEvent_FallThroughToFloppyMenuitem
    186 
    187 ;;;
    188 ;;; Fall-through (to BootMenuPrint_FloppyMenuitem)
    189 ;;; (checked at assembler time with the code after BootMenuPrint_FloppyMenuitem)
    190 ;;;
    191 ALIGN JUMP_ALIGN
    192 BootMenuEvent_FallThroughToFloppyMenuitem:
    193     ; fall through to BootMenuPrint_FloppyMenuitem
Note: See TracChangeset for help on using the changeset viewer.