Changeset 189 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Boot


Ignore:
Timestamp:
Nov 16, 2011, 6:29:32 AM (13 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.

Location:
trunk/XTIDE_Universal_BIOS/Src/Boot
Files:
2 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
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm

    r186 r189  
    55SECTION .text
    66
     7;;;
     8;;; Fall-through from BootMenuEvent.asm!
     9;;; BootMenuPrint_FloppyMenuitem must be the first routine in this file
     10;;; (checked at assembler time with the code after BootMenuPrint_FloppyMenuitem)
     11;;;
     12;--------------------------------------------------------------------
     13; BootMenuPrint_FloppyMenuitem
     14;   Parameters:
     15;       DL:     Untranslated Floppy Drive number
     16;   Returns:
     17;       Nothing
     18;   Corrupts registers:
     19;       AX, DX, SI, DI
     20;--------------------------------------------------------------------
     21ALIGN JUMP_ALIGN
     22BootMenuPrint_FloppyMenuitem:
     23    js      BootMenuPrint_FloppyMenuitemInformation
     24    call    PrintDriveNumberAfterTranslationFromDL
     25    push    bp
     26    mov     bp, sp
     27    mov     si, g_szFDLetter
     28    ePUSH_T ax, g_szFloppyDrv
     29    add     dl, 'A'
     30    push    dx                  ; Drive letter
     31    jmp     BootMenuPrint_FormatCSSIfromParamsInSSBP
     32
     33%if BootMenuPrint_FloppyMenuitem <> BootMenuEvent_FallThroughToFloppyMenuitem
     34%error "BootMenuPrint.asm must follow BootMenuEvent.asm, and BootMenuPrint_FloppyMenuitem must be the first routine in BootMenuPrint.asm"
     35%endif
     36       
    737;--------------------------------------------------------------------
    838; BootMenuPrint_ClearScreen
     
    81111
    82112;--------------------------------------------------------------------
    83 ; BootMenuPrint_FloppyMenuitem
    84 ;   Parameters:
    85 ;       DL:     Untranslated Floppy Drive number
    86 ;   Returns:
    87 ;       Nothing
    88 ;   Corrupts registers:
    89 ;       AX, DX, SI, DI
    90 ;--------------------------------------------------------------------
    91 ALIGN JUMP_ALIGN
    92 BootMenuPrint_FloppyMenuitem:
    93     call    PrintDriveNumberAfterTranslationFromDL
    94     push    bp
    95     mov     bp, sp
    96     mov     si, g_szFDLetter
    97     ePUSH_T ax, g_szFloppyDrv
    98     add     dl, 'A'
    99     push    dx                  ; Drive letter
    100     jmp     BootMenuPrint_FormatCSSIfromParamsInSSBP
    101 
    102 
    103 ;--------------------------------------------------------------------
    104113; BootMenuPrint_HardDiskMenuitem
    105114;   Parameters:
     
    113122ALIGN JUMP_ALIGN
    114123BootMenuPrint_HardDiskMenuitem:
     124    js      BootMenuPrint_HardDiskMenuitemInformation
    115125    call    PrintDriveNumberAfterTranslationFromDL
    116126    call    RamVars_IsDriveHandledByThisBIOS
Note: See TracChangeset for help on using the changeset viewer.