Changeset 293 in xtideuniversalbios for trunk/Configurator/Src/Libraries


Ignore:
Timestamp:
Mar 4, 2012, 1:33:52 AM (12 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Commit 1/2 (Library, Configurators and Serial Server):

  • Changed Emulate.inc so that making 286 and 386 versions now works. Additionally, only one processor type define is needed in the makefile.
  • Minor optimizations.
  • Fixed spelling and did some cleaning.
Location:
trunk/Configurator/Src/Libraries
Files:
7 edited

Legend:

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

    r162 r293  
    162162;       ES:DI:  Ptr to destination buffer
    163163;   Returns:
    164 ;       AX:     Number of bytes actually read if successfull (EOF check)
     164;       AX:     Number of bytes actually read if successful (EOF check)
    165165;               DOS error code if CF set
    166 ;       CF:     Clear if successfull
     166;       CF:     Clear if successful
    167167;               Set if error
    168168;   Corrupts registers:
     
    194194;       ES:DI:  Ptr to source buffer
    195195;   Returns:
    196 ;       AX:     Number of bytes actually written if successfull (EOF check)
     196;       AX:     Number of bytes actually written if successful (EOF check)
    197197;               DOS error code if CF set
    198 ;       CF:     Clear if successfull
     198;       CF:     Clear if successful
    199199;               Set if error
    200200;   Corrupts registers:
     
    224224;   Returns:
    225225;       AX:     DOS error code if CF set
    226 ;       CF:     Clear if successfull
     226;       CF:     Clear if successful
    227227;               Set if error
    228228;   Corrupts registers:
     
    373373;   Returns:
    374374;       AX:     DOS Error code
    375 ;       CF:     Clear if successfull
     375;       CF:     Clear if successful
    376376;               Set if error
    377377;   Corrupts registers:
  • trunk/Configurator/Src/Libraries/menu/menudraw.asm

    r181 r293  
    6161    push    cx
    6262    call    MenuCrsr_GetCursor              ; Get current cursor to DX
    63     eMOVZX  cx, BYTE [bp+MENUVARS.bWidth]   ; Load menu width
     63    eMOVZX  cx, [bp+MENUVARS.bWidth]        ; Load menu width
    6464    add     cl, [bp+MENUVARS.bInitX]        ; Add menu start X coord
    6565    sub     cl, W_OFF_CRSR_STR & 0FFh       ; Subtract right borders
     
    164164    call    MenuCrsr_Point1stItem           ; Set cursor position
    165165    mov     cx, [bp+MENUVARS.wItemTop]      ; Load idx of first menuitem to draw
    166     eMOVZX  dx, BYTE [bp+MENUVARS.bVisCnt]  ; Load number of visible menuitems
     166    eMOVZX  dx, [bp+MENUVARS.bVisCnt]       ; Load number of visible menuitems
    167167    MIN_U   dx, [bp+MENUVARS.wItemCnt]      ; Limit to item count
    168168    add     dx, cx                          ; One past last menuitem to draw
     
    266266    call    MenuDraw_TopBorder              ; Draw top border
    267267    call    MenuDraw_NewlineBrdr            ; Change line
    268     eMOVZX  cx, BYTE [bp+MENUVARS.bTitleH]  ; Load number of title strings
     268    eMOVZX  cx, [bp+MENUVARS.bTitleH]       ; Load number of title strings
    269269    jcxz    .Return                         ; Return if no title strings
    270270ALIGN JUMP_ALIGN
     
    284284    xor     dx, dx                          ; Zero DX
    285285    call    MenuCrsr_PointNfoBrdr           ; Set cursor
    286     eMOVZX  cx, BYTE [bp+MENUVARS.bInfoH]   ; Load number of info strings
     286    eMOVZX  cx, [bp+MENUVARS.bInfoH]        ; Load number of info strings
    287287    test    BYTE [bp+MENUVARS.bFlags], FLG_MNU_HIDENFO  ; Information hidden?
    288288    jnz     SHORT .JumpToBottomBorder
     
    320320    xor     dx, dx                          ; Zero DX
    321321    call    MenuCrsr_PointItemBrdr          ; Set cursor
    322     eMOVZX  cx, BYTE [bp+MENUVARS.bVisCnt]  ; Load max number of item strings
     322    eMOVZX  cx, [bp+MENUVARS.bVisCnt]       ; Load max number of item strings
    323323ALIGN JUMP_ALIGN
    324324.LineLoop:
     
    374374    mov     dl, bh                          ; Leftmost
    375375    PRINT_CHAR
    376     eMOVZX  cx, BYTE [bp+MENUVARS.bWidth]
     376    eMOVZX  cx, [bp+MENUVARS.bWidth]
    377377    times 2 dec cx                          ; Subtract borders
    378378    mov     dl, bl                          ; Middle
     
    438438    mov     dh, B_V                     ; Assume no scroll bars needed
    439439    mov     ax, [bp+MENUVARS.wItemCnt]  ; Load menuitem count to AX
    440     eMOVZX  bx, BYTE [bp+MENUVARS.bVisCnt]  ; Load visible menuitems to BX
     440    eMOVZX  bx, [bp+MENUVARS.bVisCnt]   ; Load visible menuitems to BX
    441441    cmp     ax, bx                      ; Need scroll bars?
    442442    jbe     .Return                     ;  If not, return
  • trunk/Configurator/Src/Libraries/menu/menufile.asm

    r83 r293  
    1 ; File name     :   menufile.asm
    21; Project name  :   Menu library
    3 ; Created date  :   20.11.2009
    4 ; Last update   :   6.1.2011
    5 ; Author        :   Tomi Tilli,
    6 ;               :   Krister Nordvall (Optimizations)
    7 ; Description   :   ASM library to menu system.
     2; Description   :   ASM library for menu system.
    83;                   Contains functions for displaying file dialog.
    94
     
    276271ALIGN JUMP_ALIGN
    277272.ChangeDone:
    278     mov     dx, [bp+FDLGVARS.fpFileSrch]    ; Load ptr to file search str
    279     mov     ds, [bp+FDLGVARS.fpFileSrch+2]
     273    lds     dx, [bp+FDLGVARS.fpFileSrch]    ; Load ptr to file search str
    280274    call    MenuFile_GetItemCnt             ; Get file count from new dir
    281275    pop     ds
     
    314308    mov     di, [bp+MSGVARS.wStrOff]        ; Load string offset
    315309    mov     es, [bp+MSGVARS.wStrSeg]        ; Load string segment
    316     eMOVZX  cx, BYTE [bp+MENUVARS.bInfoH]   ; Load info line count to CX
     310    eMOVZX  cx, [bp+MENUVARS.bInfoH]        ; Load info line count to CX
    317311    call    MenuDraw_MultilineStr           ; Draw multiline str
    318312    pop     di
  • trunk/Configurator/Src/Libraries/menu/menuloop.asm

    r9 r293  
    1 ; File name     :   menuloop.asm
    21; Project name  :   Menu library
    3 ; Created date  :   11.11.2009
    4 ; Last update   :   25.5.2010
    5 ; Author        :   Tomi Tilli
    6 ; Description   :   ASM library to menu system.
     2; Description   :   ASM library for menu system.
    73;                   Contains event dispatching loop.
    84
     
    143139
    144140    ; Jump to process menu key
    145     mov     di, CNT_MENU_KEYS-1 ; Convert CX... 
     141    mov     di, CNT_MENU_KEYS-1 ; Convert CX...
    146142    sub     di, cx              ; ...to lookup index
    147143    shl     di, 1               ; Prepare for word lookup
     
    186182    jnz     .TextScrollUp                   ;  If so, go to text scrolling
    187183%endif
    188     mov     ax, [bp+MENUVARS.wItemSel]      ; Load selected index 
     184    mov     ax, [bp+MENUVARS.wItemSel]      ; Load selected index
    189185    test    ax, ax                          ; Already at top?
    190186    jz      .KeyEnd                         ;  If so, go to end
     
    222218    je      .KeyHome                        ;  If so, go to beginning
    223219    mov     [bp+MENUVARS.wItemSel], ax      ; Store new menuitem index
    224     eMOVZX  bx, BYTE [bp+MENUVARS.bVisCnt]  ; Load number of visible items
     220    eMOVZX  bx, [bp+MENUVARS.bVisCnt]       ; Load number of visible items
    225221    add     bx, [bp+MENUVARS.wItemTop]      ; BX to one past last visible index
    226222    cmp     ax, bx                          ; Need to scroll?
     
    235231ALIGN JUMP_ALIGN
    236232.TextScrollDown:
    237     eMOVZX  ax, BYTE [bp+MENUVARS.bVisCnt]  ; Load visible items
     233    eMOVZX  ax, [bp+MENUVARS.bVisCnt]       ; Load visible items
    238234    add     ax, [bp+MENUVARS.wItemTop]      ; Add topmost menuitem index
    239235    cmp     ax, [bp+MENUVARS.wItemCnt]      ; Already at the bottom?
     
    261257    sbb     bh, 0
    262258    mov     [bp+MENUVARS.wItemTop], bx      ; Store first menuitem to draw
    263     jnc     .ScrollMenu 
     259    jnc     .ScrollMenu
    264260    mov     WORD [bp+MENUVARS.wItemTop], 0  ; Overflow, start with 0
    265261    jmp     .ScrollMenu
     
    284280    inc     ax                              ; Increment page
    285281    mul     BYTE [bp+MENUVARS.bVisCnt]      ; AX=First menuitem on page
    286     eMOVZX  bx, BYTE [bp+MENUVARS.bVisCnt]  ; Load number of visible items
     282    eMOVZX  bx, [bp+MENUVARS.bVisCnt]       ; Load number of visible items
    287283    add     bx, ax                          ; BX now one past last visible
    288284    cmp     bx, [bp+MENUVARS.wItemCnt]      ; Went over last?
     
    331327    dw      .KeyEnd     ; KEY_END
    332328; Scan code to jump index translation table
    333 .rgbKeyToIdx:   
     329.rgbKeyToIdx:
    334330    db  KEY_ENTER,  KEY_ESC,    KEY_UP,     KEY_DOWN,
    335331    db  KEY_PGUP,   KEY_PGDN,   KEY_HOME,   KEY_END
  • trunk/Configurator/Src/Libraries/menu/menumsg.asm

    r181 r293  
    212212    call    MenuMsg_GetTokenForLine         ; Get ptr to first token, length to AX
    213213    jnc     .EndOfString                    ; Return if no tokens
    214     eMOVZX  dx, BYTE [bp+MENUVARS.bWidth]   ; Menu width
     214    eMOVZX  dx, [bp+MENUVARS.bWidth]        ; Menu width
    215215    sub     dl, SIZE_MSG_HBRDR              ; To line length
    216216    mov     bl, ' '                         ; Space character
  • trunk/Configurator/Src/Libraries/menu/menuprog.asm

    r2 r293  
    1 ; File name     :   menuprog.asm
    21; Project name  :   Menu library
    3 ; Created date  :   23.11.2009
    4 ; Last update   :   23.11.2009
    5 ; Author        :   Tomi Tilli
    6 ; Description   :   ASM library to menu system.
     2; Description   :   ASM library for menu system.
    73;                   Contains functions for displaying progress bar dialog.
    84
     
    110106MenuProg_DrawBar:
    111107    ; Calculate number of chars to draw
    112     eMOVZX  cx, BYTE [bp+MENUVARS.bWidth]   ; Dialog width to CX
     108    eMOVZX  cx, [bp+MENUVARS.bWidth]        ; Dialog width to CX
    113109    sub     cl, 4                           ; Sub borders, CX=bar width
    114110    mul     cl                              ; AX=bar with * percentage
     
    117113    sub     cl, al                          ; CX=Empty char cnt
    118114    mov     bl, al                          ; BX=full char cnt
    119    
     115
    120116    ; Draw full chars
    121117    mov     dl, FULL_BLCK                   ; Load full block char
     
    180176    push    ds
    181177    push    si
    182     mov     si, [bp+PDLGVARS.fpUser]    ; Load offset to user ptr
    183     mov     ds, [bp+PDLGVARS.fpUser+2]  ; Load segment to user ptr
     178    lds     si, [bp+PDLGVARS.fpUser]    ; Load user defined ptr
    184179    xor     ax, ax                      ; Zero percent
    185180ALIGN JUMP_ALIGN
  • trunk/Configurator/Src/Libraries/menu/prntvram.asm

    r2 r293  
    1 ; File name     :   prntvram.asm
    21; Project name  :   Print library
    3 ; Created date  :   7.12.2009
    4 ; Last update   :   7.12.2009
    5 ; Author        :   Tomi Tilli
    6 ; Description   :   ASM library to for character and string
     2; Description   :   ASM library for character and string
    73;                   printing using direct access to VRAM.
    84;
     
    2723;--------------------------------------------------------------------
    2824; Return pointer to VRAM for current cursor position.
    29 ; 
     25;
    3026; PrntVram_GetPtr
    3127;   Parameters:
     
    4339
    4440    ; Calculate offset to VRAM
    45     eMOVZX  di, BYTE [es:BDA.bVidPageIdx]   ; Load page index
     41    eMOVZX  di, [es:BDA.bVidPageIdx]        ; Load page index
    4642    shl     di, 1                           ; Shift for word lookup
    4743    mov     ax, [es:di+BDA.rgwVidCurPos]    ; Load cursor position
     
    7066; use this macro to print characters (so printing implementation
    7167; can be easily modified when needed).
    72 ; 
     68;
    7369; PRINT_CHAR
    7470;   Parameters:
     
    117113    pop     es
    118114    je      .IncRow
    119    
     115
    120116    ; Inc column only
    121117    push    dx
     
    147143; use this macro to print strings (so printing implementation
    148144; can be easily modified when needed).
    149 ; 
     145;
    150146; PRINT_STR
    151147;   Parameters:
     
    167163; All string printing functions must use this macro to print strings
    168164; (so printing implementation can be easily modified when needed).
    169 ; 
     165;
    170166; PRINT_STR_LEN
    171167;   Parameters:
     
    194190    cmp     al, 20h                 ; Printable character?
    195191    jb      .Bios                   ;  If not, use BIOS functions
    196    
     192
    197193    push    dx
    198194    mov     al, dl
    199195    PRINT_CHAR
    200196    pop     dx
    201    
     197
    202198    ;stosb                          ; Store char to [ES:DI]
    203199    inc     dx                      ; Increment chars printed
Note: See TracChangeset for help on using the changeset viewer.