Changeset 505 in xtideuniversalbios for trunk/Assembly_Library


Ignore:
Timestamp:
Feb 25, 2013, 4:23:09 PM (12 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • Reverted the changes to MenuEvents.inc done in r492 since they broke the F1 key function in XTIDECFG.
  • Added a tail-call optimized variant of the CALL_DISPLAY_LIBRARY macro (JMP_DISPLAY_LIBRARY).
  • Put a block size limit in AH1Eh_ChangeXTCFmodeBasedOnControlRegisterInAL. I think it's needed but if not, it's easy to remove.
  • Other optimizations and fixes.
Location:
trunk/Assembly_Library
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Inc/Display.inc

    r407 r505  
    66%ifndef MODULE_STRINGS_COMPRESSED_PRECOMPRESS
    77;--------------------------------------------------------------------
    8 ; Display Library users need to use this macro since it will provide
     8; Display Library users need to use these macros since it will provide
    99; compatibility with future library versions.
    1010;
    1111; CALL_DISPLAY_LIBRARY
     12; JMP_DISPLAY_LIBRARY
    1213;   Parameters:
    1314;       %1:         Function to call (functionName from DISPLAY_LIB)
     
    2829        mov     di, %1
    2930        call    Display_FunctionFromDI
     31    %endif
     32%endmacro
     33
     34%macro JMP_DISPLAY_LIBRARY 1
     35    %ifidn %1, PushDisplayContext
     36        jmp     DisplayContext_Push
     37    %elifidn %1, PopDisplayContext
     38        call    DisplayContext_Pop
     39        ret
     40    %elifidn %1, PrepareOffScreenBufferInESBXwithLengthInCX
     41        jmp     DisplayContext_PrepareOffScreenBufferInESBXwithLengthInCX
     42    %elifidn %1, FormatNullTerminatedStringFromCSSI
     43        mov     di, %1
     44        call    Display_FunctionFromDI
     45        ret
     46    %else
     47        mov     di, %1
     48        jmp     Display_FunctionFromDI
    3049    %endif
    3150%endmacro
  • trunk/Assembly_Library/Inc/MenuEvents.inc

    r492 r505  
    1 ; File name     :   MenuEvents.inc
    21; Project name  :   Assembly Library
    3 ; Created date  :   13.7.2010
    4 ; Last update   :   18.10.2010
    5 ; Author        :   Tomi Tilli
    62; Description   :   Defines for Menu events send to the user.
    73%ifndef MENUEVENTS_INC
     
    2723;
    2824; 2. If the program needs only one menu, %define MENUEVENT_INLINE_OFFSETS before this include file,
    29 ;    and define (through EQU statements) each of the entry points as offsets from a base address. 
    30 ; 
     25;    and define (through EQU statements) each of the entry points as offsets from a base address.
     26;
    3127
    3228;
     
    4945    ; Returns:
    5046    ;   DS:SI:      Ptr to initialized MENUINIT struct
    51     .InitializeMenuinitFromDSSI     resb    2
    52 MENUEVENT_InitializeMenuinitFromDSSI    equ     MENUEVENT.InitializeMenuinitFromDSSI
     47    .InitializeMenuinitFromDSSI resb    2
     48%define MENUEVENT_InitializeMenuinitFromDSSI    MENUEVENT.InitializeMenuinitFromDSSI
    5349
    5450    ; Parameters:
     
    5753    ;   CF:         Set to exit menu
    5854    ;               Clear to cancel exit
    59     .ExitMenu                       resb    2
    60 MENUEVENT_ExitMenu                  equ     MENUEVENT.ExitMenu
     55    .ExitMenu                   resb    2
     56%define MENUEVENT_ExitMenu                      MENUEVENT.ExitMenu
    6157
    6258%ifdef MENUEVENT_IDLEPROCESSING_ENABLE
     
    6460    ;   None
    6561    ; See the definition of MENUEVENT_IDLEPROCESSING_ENABLE below.
    66     .IdleProcessing                 resb    2
    67 MENUEVENT_IdleProcessing            equ     MENUEVENT.IdleProcessing
     62    .IdleProcessing             resb    2
     63%define MENUEVENT_IdleProcessing                MENUEVENT.IdleProcessing
    6864%endif
    6965
     
    7167    ;   CX:         Index of new highlighted item
    7268    ;   DX:         Index of previously highlighted item or NO_ITEM_HIGHLIGHTED
    73     .ItemHighlightedFromCX          resb    2
    74 MENUEVENT_ItemHighlightedFromCX     equ     MENUEVENT.ItemHighlightedFromCX
     69    .ItemHighlightedFromCX      resb    2
     70%define MENUEVENT_ItemHighlightedFromCX         MENUEVENT.ItemHighlightedFromCX
    7571
    7672    ; Parameters:
    7773    ;   CX:         Index of selected item
    78     .ItemSelectedFromCX             resb    2
    79 MENUEVENT_ItemSelectedFromCX        equ     MENUEVENT.ItemSelectedFromCX
     74    .ItemSelectedFromCX         resb    2
     75%define MENUEVENT_ItemSelectedFromCX            MENUEVENT.ItemSelectedFromCX
    8076
    8177    ; Parameters:
    8278    ;   AL:         ASCII character for the key
    8379    ;   AH:         Keyboard library scan code for the key
    84     .KeyStrokeInAX                  resb    2
    85 MENUEVENT_KeyStrokeInAX             equ     MENUEVENT.KeyStrokeInAX
     80    .KeyStrokeInAX              resb    2
     81%define MENUEVENT_KeyStrokeInAX                 MENUEVENT.KeyStrokeInAX
    8682
    8783    ; Parameters:
    8884    ;   CX:         Index of highlighted item
    8985    ;   Cursor has been positioned to the beginning of first line
    90     .RefreshTitle                   resb    2
    91     .RefreshInformation             resb    2
    92 MENUEVENT_RefreshTitle              equ     MENUEVENT.RefreshTitle
    93 MENUEVENT_RefreshInformation        equ     MENUEVENT.RefreshInformation
     86    .RefreshTitle               resb    2
     87    .RefreshInformation         resb    2
     88%define MENUEVENT_RefreshTitle                  MENUEVENT.RefreshTitle
     89%define MENUEVENT_RefreshInformation            MENUEVENT.RefreshInformation
    9490
    9591    ; Parameters:
    9692    ;   CX:         Index of item to refresh
    9793    ;   Cursor has been positioned to the beginning of item line
    98     .RefreshItemFromCX              resb    2
    99 MENUEVENT_RefreshItemFromCX         equ     MENUEVENT.RefreshItemFromCX
     94    .RefreshItemFromCX          resb    2
     95%define MENUEVENT_RefreshItemFromCX             MENUEVENT.RefreshItemFromCX
    10096endstruc
    10197
    102 %endif ; MENUEVENTS_INLINE_OFFSETS
     98%endif ; MENUEVENT_INLINE_OFFSETS
    10399
    104100%endif ; MENUEVENTS_INC
  • trunk/Assembly_Library/Src/Display/DisplayFormatCompressed.asm

    r445 r505  
    139139
    140140.PrintDigit:
    141     add     al, 90h                     ; Convert binary digit in AL to ASCII hex digit (0 - 9 or A - F)
    142     daa
    143     adc     al, 40h
    144     daa
     141    cmp     al, 10                      ; Convert binary digit in AL to ASCII hex digit ('0'-'9' or 'A'-'F')
     142    sbb     al, 69h
     143    das
    145144
    146145    call    DisplayPrint_CharacterFromAL
  • trunk/Assembly_Library/Src/Display/DisplayPrint.asm

    r492 r505  
    306306%endif
    307307
    308 %ifndef EXCLUDE             
     308%ifndef EXCLUDE
    309309;--------------------------------------------------------------------
    310310; DisplayPrint_RepeatCharacterFromALwithCountInCX
     
    397397;   Parameters:
    398398;       AL:     Character to display
    399 ;               Zero value is ignored (no characer is printed)
     399;               Zero value is ignored (no character is printed)
    400400;       DS:     BDA segment (zero)
    401401;       ES:DI:  Ptr to cursor location in video RAM
     
    407407ALIGN DISPLAY_JUMP_ALIGN
    408408DisplayPrint_CharacterFromAL:
    409     test    al,al
     409    test    al, al
    410410    jz      DisplayPrint_Ret
    411411
  • trunk/Assembly_Library/Src/Menu/CharOutLineSplitter.asm

    r445 r505  
    4545    xchg    ax, dx          ; AL = First text line column offset
    4646    mov     ah, dl          ; AH = Last text line column offset
    47     CALL_DISPLAY_LIBRARY SetCharacterOutputParameterFromAX
    48     ret
     47    JMP_DISPLAY_LIBRARY SetCharacterOutputParameterFromAX
    4948
    5049
  • trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm

    r376 r505  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    1717; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    1818;
     
    197197    call    .FindMatchingFilesAndPrintThemToOffScreenBuffer
    198198
    199     CALL_DISPLAY_LIBRARY PopDisplayContext
    200     ret
     199    JMP_DISPLAY_LIBRARY PopDisplayContext
    201200
    202201;--------------------------------------------------------------------
     
    372371ALIGN JUMP_ALIGN
    373372.FormatStringInCSSIandReturn:
    374     CALL_DISPLAY_LIBRARY FormatNullTerminatedStringFromCSSI
    375     ret
     373    JMP_DISPLAY_LIBRARY FormatNullTerminatedStringFromCSSI
    376374
    377375
     
    755753    call    MenuText_PrepareToDrawInformationArea
    756754    mov     si, g_szLoadingPleaseWait
    757     CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI
    758     ret
     755    JMP_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI
    759756
    760757
  • trunk/Assembly_Library/Src/Menu/Dialog/DialogProgress.asm

    r491 r505  
    216216ALIGN JUMP_ALIGN
    217217.RepeatProgressCharacterCXtimesFromAL:
    218     jcxz    .NothingToRepeat
    219     CALL_DISPLAY_LIBRARY PrintRepeatedCharacterFromALwithCountInCX
    220 ALIGN JUMP_ALIGN, ret
    221 .NothingToRepeat:
    222     ret
     218    jcxz    NothingToRepeat
     219    JMP_DISPLAY_LIBRARY PrintRepeatedCharacterFromALwithCountInCX
    223220
    224221
     
    236233    mov     bx, [si+PROGRESS_DIALOG_IO.wMaxProgressValue]
    237234    sub     bx, [si+PROGRESS_DIALOG_IO.wMinProgressValue]
     235NothingToRepeat:
    238236    ret
    239237
  • trunk/Assembly_Library/Src/Menu/Dialog/DialogWord.asm

    r376 r505  
    1 ; File name     :   DialogWord.asm
    21; Project name  :   Assembly Library
    3 ; Created date  :   10.8.2010
    4 ; Last update   :   18.11.2010
    5 ; Author        :   Tomi Tilli
    62; Description   :   Displays word input dialog.
    73
    84;
    9 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    106; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    117;
     
    1410; the Free Software Foundation; either version 2 of the License, or
    1511; (at your option) any later version.
    16 ; 
     12;
    1713; This program is distributed in the hope that it will be useful,
    1814; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1915; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    20 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    2117; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    2218;
    23        
     19
    2420
    2521; Section containing code
     
    142138
    143139    xchg    ax, dx
    144     CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
    145     ret
     140    JMP_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
     141
  • trunk/Assembly_Library/Src/Menu/MenuAttributes.asm

    r376 r505  
    44
    55;
    6 ; XTIDE Universal BIOS and Associated Tools 
     6; XTIDE Universal BIOS and Associated Tools
    77; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    88;
     
    1111; the Free Software Foundation; either version 2 of the License, or
    1212; (at your option) any later version.
    13 ; 
     13;
    1414; This program is distributed in the hope that it will be useful,
    1515; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1616; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    17 ; GNU General Public License for more details.     
     17; GNU General Public License for more details.
    1818; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    1919;
    20        
     20
    2121
    2222; Struct containing border characters for different types of menu window lines
     
    4848MenuAttribute_SetToDisplayContextFromTypeInSI:
    4949    call    MenuAttribute_GetToAXfromTypeInSI
    50     CALL_DISPLAY_LIBRARY SetCharacterAttributeFromAL
    51     ret
     50    JMP_DISPLAY_LIBRARY SetCharacterAttributeFromAL
    5251
    5352
  • trunk/Assembly_Library/Src/Menu/MenuBorders.asm

    r376 r505  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    1717; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    1818;
    19        
     19
    2020
    2121; Struct containing border characters for different types of menu window lines
     
    296296ALIGN MENU_JUMP_ALIGN
    297297PrintNewlineToEndBorderLine:
    298     CALL_DISPLAY_LIBRARY PrintNewlineCharacters
    299     ret
     298    JMP_DISPLAY_LIBRARY PrintNewlineCharacters
    300299
    301300
     
    325324    call    MenuBorders_PrintMultipleBorderCharactersFromAL ; AL does not matter
    326325
    327     CALL_DISPLAY_LIBRARY PopDisplayContext
    328     ret
     326    JMP_DISPLAY_LIBRARY PopDisplayContext
    329327
    330328
     
    365363ALIGN MENU_JUMP_ALIGN
    366364MenuBorders_PrintSingleBorderCharacterFromAL:
    367     CALL_DISPLAY_LIBRARY PrintCharacterFromAL
    368     ret
     365    JMP_DISPLAY_LIBRARY PrintCharacterFromAL
    369366
    370367ALIGN MENU_JUMP_ALIGN
  • trunk/Assembly_Library/Src/Menu/MenuEvent.asm

    r492 r505  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    1717; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    1818;
    19        
     19
    2020
    2121; Section containing code
     
    5858    jmp     SHORT MenuEvent_SendFromBX
    5959%endif
    60        
     60
    6161
    6262%ifdef MENUEVENT_IDLEPROCESSING_ENABLE
     
    155155;       AX, BX, DX
    156156;--------------------------------------------------------------------
    157 %ifdef MENUEVENT_KeyStrokInAX
     157%ifdef MENUEVENT_KeyStrokeInAX
    158158ALIGN MENU_JUMP_ALIGN
    159159MenuEvent_KeyStrokeInAX:
  • trunk/Assembly_Library/Src/Menu/MenuText.asm

    r376 r505  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    1717; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    1818;
    19        
     19
    2020
    2121; Section containing code
     
    4040    jmp     SHORT MenuText_ClearInformationArea.ClearCLlinesOfText
    4141%endif
    42        
     42
    4343ALIGN MENU_JUMP_ALIGN
    4444MenuText_ClearInformationArea:
     
    5353    mov     al, ' '
    5454    CALL_DISPLAY_LIBRARY PrintRepeatedCharacterFromALwithCountInCX
    55     CALL_DISPLAY_LIBRARY PopDisplayContext
    56     ret
     55    JMP_DISPLAY_LIBRARY PopDisplayContext
    5756
    5857
     
    220219
    221220    xchg    ax, bx
    222     CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
    223     ret
     221    JMP_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
    224222
    225223
  • trunk/Assembly_Library/Src/TimerTest.asm

    r376 r505  
    33
    44;
    5 ; XTIDE Universal BIOS and Associated Tools 
     5; XTIDE Universal BIOS and Associated Tools
    66; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    77;
     
    1010; the Free Software Foundation; either version 2 of the License, or
    1111; (at your option) any later version.
    12 ; 
     12;
    1313; This program is distributed in the hope that it will be useful,
    1414; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 ; GNU General Public License for more details.     
     16; GNU General Public License for more details.
    1717; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    18 ;       
     18;
    1919
    2020; Include .inc files
     
    109109;   Parameters:
    110110;       AX:     Difference in register and memory access durations
    111 ;               (Precise Event Timer Ticks) 
     111;               (Precise Event Timer Ticks)
    112112;   Returns:
    113113;       AX:     Duration for single BYTE in nanosecs
     
    182182    push    dx
    183183    push    ax
    184     CALL_DISPLAY_LIBRARY FormatNullTerminatedStringFromCSSI
    185     ret
     184    JMP_DISPLAY_LIBRARY FormatNullTerminatedStringFromCSSI
    186185
    187186
Note: See TracChangeset for help on using the changeset viewer.