Changeset 48 in xtideuniversalbios for trunk/Assembly_Library/Src/Display/DisplayFormat.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/Display/DisplayFormat.asm

    r47 r48  
    22; Project name  :   Assembly Library
    33; Created date  :   29.6.2010
    4 ; Last update   :   4.10.2010
     4; Last update   :   8.10.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Functions for displaying formatted strings.
     
    220220    dec     di                  ; DI = Offset where to move last byte formatted
    221221    xchg    bx, ax              ; BX = BYTEs to prepend
    222     call    .ReverseMoveCXbytesFromESSItoESDI
     222    call    .ReverseCopyCXbytesFromESSItoESDI
    223223    xchg    ax, bx
    224224    call    .ReversePrintAXspacesStartingFromESDI
     
    231231
    232232;--------------------------------------------------------------------
    233 ; .ReverseMoveCXbytesFromESSItoESDI
    234 ;   Parameters:
    235 ;       CX:     Number of bytes to move
    236 ;       DS:     BDA segment (zero)
    237 ;       ES:SI:  Ptr to source in video RAM
    238 ;       ES:DI:  Ptr to destination in video RAM
    239 ;   Returns:
    240 ;       DI:     Offset to character preceeding string just moved
     233; .ReverseCopyCXbytesFromESSItoESDI
     234;   Parameters:
     235;       CX:     Number of bytes to copy
     236;       DS:     BDA segment (zero)
     237;       ES:SI:  Ptr to old location
     238;       ES:DI:  Ptr to new location
     239;   Returns:
     240;       DI:     Updated to before last character copied
    241241;   Corrupts registers:
    242242;       AX, CX, DX, SI
    243243;--------------------------------------------------------------------
    244244ALIGN JUMP_ALIGN
    245 .ReverseMoveCXbytesFromESSItoESDI:
    246 %ifdef ELIMINATE_CGA_SNOW
    247     call    DisplayCharOut_LoadAndVerifyStatusRegisterFromBDA
    248     je      SHORT .WaitUntilReadyToMoveNextByte
    249 %endif
    250 
     245.ReverseCopyCXbytesFromESSItoESDI:
     246    test    BYTE [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bFlags], FLG_CONTEXT_ATTRIBUTES
     247    jz      SHORT .CopyWithoutDisplayProcessing
     248
     249    WAIT_RETRACE_IF_NECESSARY_THEN rep movsb
     250    dec     di                  ; Point to preceeding character instead of attribute
     251    ret
     252ALIGN JUMP_ALIGN
     253.CopyWithoutDisplayProcessing:
    251254    eSEG_STR rep, es, movsb
    252 
    253 %ifdef ELIMINATE_CGA_SNOW
    254     jmp     SHORT .AlignDIforFirstPreceedingSpace
    255 .WaitUntilReadyToMoveNextByte:
    256     cli             ; Interrupt request would mess up timing
    257     WAIT_UNTIL_SAFE_CGA_WRITE
    258 .MovsbWithoutWaitSinceUnknownPort:
    259     eSEG    es
    260     movsb
    261     sti
    262     loop    .WaitUntilReadyToMoveNextByte
    263 %endif
    264     ; Fall to .AlignDIforFirstPreceedingSpace
    265 
    266 ;--------------------------------------------------------------------
    267 ; .AlignDIforFirstPreceedingSpace
    268 ;   Parameters:
    269 ;       DS:     BDA segment (zero)
    270 ;       ES:DI:  Byte offset before last byte moved
    271 ;   Returns:
    272 ;       DI:     Offset to space preceeding moved string
    273 ;   Corrupts registers:
    274 ;       AX
    275 ;--------------------------------------------------------------------
    276 ALIGN JUMP_ALIGN
    277 .AlignDIforFirstPreceedingSpace:
    278     mov     al, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bFlags]
    279     and     ax, BYTE FLG_CONTEXT_ATTRIBUTES
    280     not     ax
    281     and     di, ax
    282255    ret
    283256
Note: See TracChangeset for help on using the changeset viewer.