Changeset 48 in xtideuniversalbios for trunk/Assembly_Library/Src/Menu/MenuText.asm


Ignore:
Timestamp:
Oct 8, 2010, 3:44:05 PM (14 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to Assembly Library:
Added functions to clear Menu Title and Information areas.
Implemented automatic line change when writing Menu Title and Information areas.
CGA snow related functions have been moved to CgaSnow.asm.
Keyboard input functions no longer produce beep for backspace.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Src/Menu/MenuText.asm

    r45 r48  
    22; Project name  :   Assembly Library
    33; Created date  :   21.7.2010
    4 ; Last update   :   28.9.2010
     4; Last update   :   7.10.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Functions for drawing menu texts by the user.
     
    1010
    1111;--------------------------------------------------------------------
     12; MenuText_ClearTitleArea
     13; MenuText_ClearInformationArea
     14;   Parameters
     15;       SS:BP:  Ptr to MENU
     16;   Returns:
     17;       Nothing
     18;   Corrupts registers:
     19;       AX, BX, CX, DX, SI, DI
     20;--------------------------------------------------------------------
     21ALIGN JUMP_ALIGN
     22MenuText_ClearTitleArea:
     23    call    PrepareToDrawTitleArea
     24    mov     cl, [bp+MENUINIT.bTitleLines]
     25    jmp     SHORT ClearCLlinesOfText
     26
     27ALIGN JUMP_ALIGN
     28MenuText_ClearInformationArea:
     29    call    PrepareToDrawInformationArea
     30    mov     cl, [bp+MENUINIT.bInfoLines]
     31ClearCLlinesOfText:
     32    mov     al, [bp+MENUINIT.bWidth]
     33    sub     al, MENU_HORIZONTAL_BORDER_LINES+MENU_TEXT_COLUMN_OFFSET
     34    mul     cl
     35    xchg    cx, ax
     36    mov     al, ' '
     37    CALL_DISPLAY_LIBRARY PrintRepeatedCharacterFromALwithCountInCX
     38    ret
     39
     40
     41;--------------------------------------------------------------------
    1242; MenuText_RefreshTitle
    1343; MenuText_RefreshInformation
     
    1747;       Nothing
    1848;   Corrupts registers:
    19 ;       AX, BX, DX, SI, DI
     49;       AX, BX, CX, DX, SI, DI
    2050;--------------------------------------------------------------------
    2151ALIGN JUMP_ALIGN
     
    2353    cmp     BYTE [bp+MENUINIT.bTitleLines], 0
    2454    jz      SHORT NothingToRefresh
    25 
    26     mov     si, ATTRIBUTE_CHARS.cTitle
    27     call    AdjustDisplayContextForDrawingTexts
    28     call    MenuLocation_GetTitleTextTopLeftCoordinatesToAX
    29     CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
     55    call    PrepareToDrawTitleArea
    3056    jmp     MenuEvent_RefreshTitle
    3157
     
    3460    cmp     BYTE [bp+MENUINIT.bInfoLines], 0
    3561    jz      SHORT NothingToRefresh
    36 
     62    call    PrepareToDrawInformationArea
     63    jmp     MenuEvent_RefreshInformation
     64
     65;--------------------------------------------------------------------
     66; PrepareToDrawTitleArea
     67; PrepareToDrawInformationArea
     68;   Parameters
     69;       SS:BP:  Ptr to MENU
     70;   Returns:
     71;       Nothing
     72;   Corrupts registers:
     73;       AX, BX, DX, SI, DI
     74;--------------------------------------------------------------------
     75ALIGN JUMP_ALIGN
     76PrepareToDrawTitleArea:
     77    mov     si, ATTRIBUTE_CHARS.cTitle
     78    mov     ax, MenuCharOut_MenuTextTeletypeOutputWithAttributeAndAutomaticLineChange
     79    call    AdjustDisplayContextForDrawingTextsWithCharOutFunctionFromAX
     80    call    MenuLocation_GetTitleTextTopLeftCoordinatesToAX
     81    CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
     82    ret
     83
     84ALIGN JUMP_ALIGN
     85PrepareToDrawInformationArea:
    3786    mov     si, ATTRIBUTE_CHARS.cInformation
    38     call    AdjustDisplayContextForDrawingTexts
     87    mov     ax, MenuCharOut_MenuTextTeletypeOutputWithAttributeAndAutomaticLineChange
     88    call    AdjustDisplayContextForDrawingTextsWithCharOutFunctionFromAX
    3989    call    MenuLocation_GetInformationTextTopLeftCoordinatesToAX
    4090    CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
    41     jmp     MenuEvent_RefreshInformation
     91    ret
    4292
    4393
     
    109159    CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
    110160    call    .GetItemTextAttributeTypeToSIforItemInCX
    111     jmp     SHORT AdjustDisplayContextForDrawingTexts
     161    mov     ax, MenuCharOut_MenuTextTeletypeOutputWithAttribute
     162    jmp     SHORT AdjustDisplayContextForDrawingTextsWithCharOutFunctionFromAX
    112163
    113164;--------------------------------------------------------------------
     
    142193;       Nothing
    143194;   Corrupts registers:
    144 ;       AX, DX, SI, DI
     195;       AX, BX, DX, SI, DI
    145196;--------------------------------------------------------------------
    146197ALIGN JUMP_ALIGN
     
    188239;       Nothing
    189240;   Corrupts registers:
    190 ;       AX, DX, SI, DI
     241;       AX, BX, DX, SI, DI
    191242;--------------------------------------------------------------------
    192243ALIGN JUMP_ALIGN
     
    194245    push    cx
    195246
    196     mov     si, ATTRIBUTE_CHARS.cBordersAndBackground
    197     call    MenuAttribute_SetToDisplayContextFromTypeInSI
     247    call    MenuBorders_AdjustDisplayContextForDrawingBorders
    198248
    199249    mov     ax, cx
     
    211261
    212262;--------------------------------------------------------------------
    213 ; AdjustDisplayContextForDrawingTexts
    214 ;   Parameters
     263; AdjustDisplayContextForDrawingTextsWithCharOutFunctionFromAX
     264;   Parameters
     265;       AX:     Character output function
    215266;       SI:     Attribute type (from ATTRIBUTE_CHARS)
    216267;       SS:BP:  Ptr to MENU
     
    221272;--------------------------------------------------------------------
    222273ALIGN JUMP_ALIGN
    223 AdjustDisplayContextForDrawingTexts:
     274AdjustDisplayContextForDrawingTextsWithCharOutFunctionFromAX:
    224275    mov     bl, ATTRIBUTES_ARE_USED
    225     mov     ax, MenuCharOut_MenuTextTeletypeOutputWithAttribute
    226276    CALL_DISPLAY_LIBRARY SetCharOutputFunctionFromAXwithAttribFlagInBL
    227277
Note: See TracChangeset for help on using the changeset viewer.