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


Ignore:
Timestamp:
Nov 16, 2011, 6:29:32 AM (12 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

Additional space optimizations, including making IdleProcessing an option in MENUEVENT. Note the fall-through from one file to another, but that there are assembler checks to ensure the proper linkage is maintained. First version of StringsCompress.pl, a perl script to make StringsCompressed.asm from Strings.asm.

File:
1 edited

Legend:

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

    r183 r189  
    44; Section containing code
    55SECTION .text
    6 
    7 struc ITEM_TYPE_REFRESH
    8     .HardDisk           resb    2
    9     .FloppyDrive        resb    2
    10 endstruc
    11 
    126
    137;--------------------------------------------------------------------
     
    2923    add     bx, BootMenuEvent_Handler
    3024    jmp     bx
     25
     26MENUEVENT_InitializeMenuinitFromDSSI equ  (BootMenuEvent_Handler.InitializeMenuinitFromDSSI - BootMenuEvent_Handler)
     27MENUEVENT_ExitMenu equ  (BootMenuEvent_Handler.EventCompleted - BootMenuEvent_Handler)
     28MENUEVENT_ItemHighlightedFromCX equ (BootMenuEvent_Handler.ItemHighlightedFromCX - BootMenuEvent_Handler)
     29MENUEVENT_ItemSelectedFromCX equ (BootMenuEvent_Handler.ItemSelectedFromCX - BootMenuEvent_Handler)
     30MENUEVENT_KeyStrokeInAX equ (BootMenuEvent_Handler.KeyStrokeInAX - BootMenuEvent_Handler)
     31MENUEVENT_RefreshTitle equ (BootMenuPrint_TitleStrings - BootMenuEvent_Handler)
     32MENUEVENT_RefreshInformation equ (BootMenuEvent_Handler.RefreshInformation - BootMenuEvent_Handler)
     33MENUEVENT_RefreshItemFromCX equ (BootMenuEvent_Handler.RefreshItemFromCX - BootMenuEvent_Handler)
     34;
     35; Note that there is no entry for MENUEVENT_IdleProcessing.  If MENUEVENT_IDLEPROCESSING_ENABLE is not %defined,
     36; then the entry point will not be called (saving memory on this end and at the CALL point).
     37;
    3138       
    3239%else
     
    3542    ja      SHORT .EventNotHandled
    3643    jmp     [cs:bx+.rgfnEventSpecificHandlers]
    37        
    38 %endif
    39        
     44
    4045.EventNotHandled:
    4146    clc
    4247    ret
    43 
    44 %ifdef MENUEVENT_INLINE_OFFSETS
    45        
    46 MENUEVENT_InitializeMenuinitFromDSSI equ  (BootMenuEvent_Handler.InitializeMenuinitFromDSSI - BootMenuEvent_Handler)
    47 MENUEVENT_ExitMenu equ  (BootMenuEvent_Handler.EventCompleted - BootMenuEvent_Handler)
    48 MENUEVENT_IdleProcessing equ (BootMenuEvent_Handler.EventNotHandled - BootMenuEvent_Handler)
    49 MENUEVENT_ItemHighlightedFromCX equ (BootMenuEvent_Handler.ItemHighlightedFromCX - BootMenuEvent_Handler)
    50 MENUEVENT_ItemSelectedFromCX equ (BootMenuEvent_Handler.ItemSelectedFromCX - BootMenuEvent_Handler)
    51 MENUEVENT_KeyStrokeInAX equ (BootMenuEvent_Handler.KeyStrokeInAX - BootMenuEvent_Handler)
    52 MENUEVENT_RefreshTitle equ (BootMenuPrint_TitleStrings - BootMenuEvent_Handler)
    53 MENUEVENT_RefreshInformation equ (BootMenuEvent_Handler.RefreshInformation - BootMenuEvent_Handler)
    54 MENUEVENT_RefreshItemFromCX equ (BootMenuEvent_Handler.RefreshItemFromCX - BootMenuEvent_Handler)
    55 
    56 %else
    5748       
    5849ALIGN WORD_ALIGN
     
    162153ALIGN JUMP_ALIGN
    163154.RefreshItemFromCX:
    164     mov     bx, .rgwItemTypeRefresh
    165     jmp     SHORT .RefreshItemOrInformationWithJumpTableInCSBX
    166 
    167 
     155    mov     bl,00h
     156    SKIP2B  dx      ; dx corrupted below by BootMenu_GetDriveToDXforMenuitemInCX
     157    ; Fall to .RefreshInformation
     158       
    168159; Parameters:
    169160;   CX:         Index of highlighted item
    170161;   Cursor has been positioned to the beginning of first line
    171 ALIGN JUMP_ALIGN
    172162.RefreshInformation:
    173     mov     bx, .rgwInformationItemTypeRefresh
     163    mov     bl,040h
    174164    ; Fall to .RefreshItemOrInformationWithJumpTableInCSBX
    175165
     
    188178    call    RamVars_GetSegmentToDS
    189179    call    BootMenu_GetDriveToDXforMenuitemInCX
    190     test    dl, dl                  ; Floppy drive?
    191     jns     SHORT .DrawFloppyDrive
    192     jmp     [cs:bx+ITEM_TYPE_REFRESH.HardDisk]
     180    or      bl,dl
     181    shl     bl,1
     182    jc      SHORT BootMenuPrint_HardDiskMenuitem
     183       
     184;;;
     185;;; Fall-through (to BootMenuPrint_FloppyMenuitem)
     186;;; (checked at assembler time with the code after BootMenuPrint_FloppyMenuitem)
     187;;;
    193188ALIGN JUMP_ALIGN
    194 .DrawFloppyDrive:
    195     jmp     [cs:bx+ITEM_TYPE_REFRESH.FloppyDrive]
     189BootMenuEvent_FallThroughToFloppyMenuitem: 
    196190
    197 ; Jump tables for .RefreshItemOrInformationWithJumpTableInCSBX
    198 ALIGN WORD_ALIGN
    199 .rgwItemTypeRefresh:
    200 istruc ITEM_TYPE_REFRESH
    201     at  ITEM_TYPE_REFRESH.HardDisk,         dw  BootMenuPrint_HardDiskMenuitem
    202     at  ITEM_TYPE_REFRESH.FloppyDrive,      dw  BootMenuPrint_FloppyMenuitem
    203 iend
    204 .rgwInformationItemTypeRefresh:
    205 istruc ITEM_TYPE_REFRESH
    206     at  ITEM_TYPE_REFRESH.HardDisk,         dw  BootMenuPrint_HardDiskMenuitemInformation
    207     at  ITEM_TYPE_REFRESH.FloppyDrive,      dw  BootMenuPrint_FloppyMenuitemInformation
    208 iend
Note: See TracChangeset for help on using the changeset viewer.