Changeset 83 in xtideuniversalbios for trunk/Configurator


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/Configurator/Src/Libraries/menu
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Configurator/Src/Libraries/menu/menu.asm

    r78 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;
  • trunk/Configurator/Src/Libraries/menu/menufile.asm

    r2 r83  
    22; Project name  :   Menu library
    33; Created date  :   20.11.2009
    4 ; Last update   :   8.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;                   Contains functions for displaying file dialog.
     
    7273    mov     [bp+FDLGVARS.wDrvCnt], cx
    7374    mov     WORD [bp+MENUVARS.fnEvent], MenuFile_Event
    74     mov     BYTE [bp+FDLGVARS.fSuccess], 0  ; For user cancel
     75    mov     [bp+FDLGVARS.fSuccess], cl      ; For user cancel
    7576    call    MenuMsg_GetLineCnt              ; Get Info line count to CX
    7677    xchg    cl, ch                          ; CH=Info lines, CL=Title lines
Note: See TracChangeset for help on using the changeset viewer.