Changeset 104 in xtideuniversalbios for trunk/Assembly_Library/Src/Menu/CharOutLineSplitter.asm


Ignore:
Timestamp:
Feb 2, 2011, 3:53:52 AM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to Assembly Library:

  • Some more optimizations.
  • Moved macros.inc from XTIDE Universal BIOS to Assembly Library.
File:
1 edited

Legend:

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

    r52 r104  
    1 ; File name     :   CharOutLineSplitter.asm
    21; Project name  :   Assembly Library
    3 ; Created date  :   11.10.2010
    4 ; Last update   :   12.10.2010
    5 ; Author        :   Tomi Tilli
    62; Description   :   Functions for splitting menu lines during character output.
    73
     
    2016ALIGN JUMP_ALIGN
    2117CharOutLineSplitter_PrepareForPrintingTextLines:
    22     call    .GetLastTextLineColumnOffsetToDX
    23     call    CharOutLineSplitter_GetFirstTextLineColumnOffsetToAX
    24     mov     ah, dl          ; AL = Text line first column, AH = Text line last column
     18    ; Get first text line column offset to DX
     19    call    CharOutLineSplitter_GetFirstBorderLineColumnOffsetToAX
     20    add     al, MENU_TEXT_COLUMN_OFFSET<<1
     21    xchg    dx, ax
     22
     23    ; Get last text line column offset to AX
     24    call    MenuLocation_GetMaxTextLineLengthToAX
     25    shl     ax, 1           ; Characters to BYTEs
     26    add     ax, dx
     27
     28    xchg    ax, dx          ; AL = First text line column offset
     29    mov     ah, dl          ; AH = Last text line column offset
    2530    CALL_DISPLAY_LIBRARY SetCharacterOutputParameterFromAX
    26     ret
    27 
    28 ;--------------------------------------------------------------------
    29 ; .GetLastTextLineColumnOffsetToDX
    30 ;   Parameters:
    31 ;       SS:BP:  Ptr to MENU
    32 ;   Returns:
    33 ;       DX:     Offset to last (allowed) character in text line
    34 ;   Corrupts registers:
    35 ;       AX
    36 ;--------------------------------------------------------------------
    37 ALIGN JUMP_ALIGN
    38 .GetLastTextLineColumnOffsetToDX:
    39     call    CharOutLineSplitter_GetFirstTextLineColumnOffsetToAX
    40     xchg    dx, ax
    41     call    MenuLocation_GetMaxTextLineLengthToAX
    42     shl     ax, 1
    43     add     dx, ax
    4431    ret
    4532
    4633
    4734;--------------------------------------------------------------------
    48 ; CharOutLineSplitter_GetFirstTextLineColumnOffsetToAX
    4935; CharOutLineSplitter_GetFirstBorderLineColumnOffsetToAX
    5036;   Parameters:
     
    5541;       Nothing
    5642;--------------------------------------------------------------------
    57 ALIGN JUMP_ALIGN
    58 CharOutLineSplitter_GetFirstTextLineColumnOffsetToAX:
    59     call    CharOutLineSplitter_GetFirstBorderLineColumnOffsetToAX
    60     add     al, MENU_TEXT_COLUMN_OFFSET<<1
    61     ret
    62 
    6343ALIGN JUMP_ALIGN
    6444CharOutLineSplitter_GetFirstBorderLineColumnOffsetToAX:
     
    11191    push    cx
    11292    push    ax
    113 
    114     call    GetOffsetToPartialWordToSIandSizeToCX
    115     call    MenuCharOut_PrintLFCRandAdjustOffsetForStartOfLine
    116     jcxz    .NothingToMove
    117     call    MovePartialWordFromPreviousLineInESSItoNewLineInESDIwithSizeInCX
    118 .NothingToMove:
    119     pop     ax
    120     pop     cx
    121     pop     si
    122     ret
    123 
     93    ; Fall to .GetOffsetToPartialWordToSIandSizeToCX
    12494
    12595;--------------------------------------------------------------------
    126 ; GetOffsetToPartialWordToSIandSizeToCX
     96; .GetOffsetToPartialWordToSIandSizeToCX
    12797;   Parameters:
    12898;       ES:DI:  Ptr to space before border character
     
    133103;       Nothing
    134104;--------------------------------------------------------------------
    135 ALIGN JUMP_ALIGN
    136 GetOffsetToPartialWordToSIandSizeToCX:
     105.GetOffsetToPartialWordToSIandSizeToCX:
    137106    xor     cx, cx
    138107    mov     si, di
     
    150119    inc     si          ; SI now points one past space
    151120    shl     cx, 1       ; Characters to bytes
    152     ret
    153 
     121    ; Fall to .ChangeLine
    154122
    155123;--------------------------------------------------------------------
    156 ; MovePartialWordFromPreviousLineInESSItoNewLineInESDIwithSizeInCX
     124; .ChangeLine
     125;   Parameters:
     126;       Nothing
     127;   Returns:
     128;       Nothing
     129;   Corrupts registers:
     130;       AX, DX
     131;--------------------------------------------------------------------
     132.ChangeLine:
     133    call    MenuCharOut_PrintLFCRandAdjustOffsetForStartOfLine
     134    jcxz    .ReturnFromMovePartialWordToNewTextLine
     135    ; Fall to .MovePartialWordFromPreviousLineInESSItoNewLineInESDIwithSizeInCX
     136
     137;--------------------------------------------------------------------
     138; .MovePartialWordFromPreviousLineInESSItoNewLineInESDIwithSizeInCX
    157139;   Parameters:
    158140;       CX:     Number of BYTEs in partial word
     
    165147;       AX, CX, DX, SI
    166148;--------------------------------------------------------------------
    167 ALIGN JUMP_ALIGN
    168 MovePartialWordFromPreviousLineInESSItoNewLineInESDIwithSizeInCX:
     149.MovePartialWordFromPreviousLineInESSItoNewLineInESDIwithSizeInCX:
    169150    push    si
    170151    push    cx
     
    178159    call    DisplayPrint_RepeatCharacterFromALwithCountInCX
    179160    mov     di, si
     161
     162.ReturnFromMovePartialWordToNewTextLine:
     163    pop     ax
     164    pop     cx
     165    pop     si
    180166    ret
Note: See TracChangeset for help on using the changeset viewer.