Changeset 83 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src


Ignore:
Timestamp:
Jan 6, 2011, 11:00:54 PM (13 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Minor size optimizations in various files.

Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
2 edited

Legend:

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

    r3 r83  
    22; Project name  :   IDE BIOS
    33; Created date  :   16.3.2010
    4 ; Last update   :   9.4.2010
    5 ; Author        :   Tomi Tilli
     4; Last update   :   6.1.2011
     5; Author        :   Tomi Tilli,
     6;               :   Krister Nordvall (optimizations)
    67; Description   :   Functions for generating and accessing drive
    78;                   information to be displayed on boot menu.
     
    5051    sub     bl, [RAMVARS.bFirstDrv]     ; Drive number to index
    5152    mul     bl                          ; AX = Offset inside BOOTNFO array
    52     mov     bx, ax                      ; Copy offset to BX
    53     add     bx, BOOTVARS.rgBootNfo      ; Add offset to BOOTNFO array
     53    add     ax, BOOTVARS.rgBootNfo      ; Add offset to BOOTNFO array
     54    xchg    bx, ax                      ; Copy result to BX
    5455    ret
    5556
  • trunk/XTIDE_Universal_BIOS/Src/Libraries/menu/menu.asm

    r3 r83  
    22; Project name  :   Menu library
    33; Created date  :   9.11.2009
    4 ; Last update   :   21.1.2010
    5 ; Author        :   Tomi Tilli
     4; Last update   :   6.1.2011
     5; Author        :   Tomi Tilli,
     6;               :   Krister Nordvall (optimizations)
    67; Description   :   ASM library to menu system.
    78;
     
    418419    mov     [bp+MENUVARS.wItemSel], ax
    419420    mov     [bp+MENUVARS.wItemTop], ax
    420     mov     cx, -1                  ; Invalidate all items
     421    xchg    cx, ax                  ; CX = 0
     422    dec     cx                      ; CX = -1 (Invalidate all items)
    421423    or      dl, MFL_UPD_ITEM
    422424%endif
     
    544546    add     dl, [bp+MENUVARS.bVisCnt]       ; Inc to one past...
    545547    adc     dh, 0                           ; ...last visible menuitem
    546     cmp     ax, dx                          ; Over last visible?
    547     jae     .RetFalse                       ;  If so, return false
     548    cmp     ax, dx                          ; Over last visible or not?
     549    cmc                                     ; Either way, fall through
     550ALIGN JUMP_ALIGN                            ; CF will reflect TRUE/FALSE
     551.RetFalse:
     552    cmc
    548553    pop     dx
    549     ret                                     ; Return with CF set
    550 ALIGN JUMP_ALIGN
    551 .RetFalse:
    552     pop     dx
    553     clc
    554554    ret
    555555
     
    631631Menu_ShowYNDlg:
    632632    mov     dx, MenuDlg_YNEvent ; Offset to event handler
     633    jmp     ContinueMenuShowDlg
     634
     635
     636;--------------------------------------------------------------------
     637; Shows dialog that asks any string from user.
     638;
     639; Menu_ShowStrDlg
     640;   Parameters:
     641;       BL:     Dialog width with borders included
     642;       CX:     Buffer length with STOP included
     643;       SS:BP:  Ptr to MENUVARS
     644;       ES:DI:  Ptr to STOP terminated string to display
     645;       DS:SI:  Prt to buffer to receive string
     646;   Returns:
     647;       AX:     String length in characters without STOP
     648;       CF:     Set if string inputted successfully
     649;               Cleared if user cancellation
     650;   Corrupts registers:
     651;       BX, CX, DX
     652;--------------------------------------------------------------------
     653ALIGN JUMP_ALIGN
     654Menu_ShowStrDlg:
     655    mov     dx, MenuDlg_StrEvent    ; Offset to event handler
     656ContinueMenuShowDlg:
    633657    call    MenuDlg_Show
    634658    push    ax
     
    641665
    642666;--------------------------------------------------------------------
    643 ; Shows dialog that asks any string from user.
    644 ;
    645 ; Menu_ShowStrDlg
    646 ;   Parameters:
    647 ;       BL:     Dialog width with borders included
    648 ;       CX:     Buffer length with STOP included
    649 ;       SS:BP:  Ptr to MENUVARS
    650 ;       ES:DI:  Ptr to STOP terminated string to display
    651 ;       DS:SI:  Prt to buffer to receive string
    652 ;   Returns:
    653 ;       AX:     String length in characters without STOP
    654 ;       CF:     Set if string inputted successfully
    655 ;               Cleared if user cancellation
    656 ;   Corrupts registers:
    657 ;       BX, CX, DX
    658 ;--------------------------------------------------------------------
    659 ALIGN JUMP_ALIGN
    660 Menu_ShowStrDlg:
    661     mov     dx, MenuDlg_StrEvent    ; Offset to event handler
    662     call    MenuDlg_Show
    663     push    ax
    664     pushf
    665     call    Menu_RefreshMenu
    666     popf
    667     pop     ax
    668     ret
    669 
    670 
    671 ;--------------------------------------------------------------------
    672667; Shows progress bar dialog.
    673668;
Note: See TracChangeset for help on using the changeset viewer.