Ignore:
Timestamp:
Feb 4, 2012, 6:21:22 PM (12 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

Serial Port: split single byte port and baud into two bytes, taking advantage of the two bytes in DPT_SERIAL, which supports more serial baud rates and in particular fixed a bug where a 4x client machine couldn't talk to a 115.2K server machine. This is a wide change, touching lots of files, but most are shallow changes. DetectPrint.asm took the most significant changes, now it calculates the baud rate to display instead of using characters provided by the Configurator. The Configurator now has a new menu flag, FLG_MENUITEM_CHOICESTRINGS, for specifying that values are not linear and they should be lookedup rather than indexed. Finally, another important bug fixed here is that in some error cases, the serial port code could get into an infinite loop waiting ont the hardware; now it has a timeout.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuitemPrint.asm

    r107 r233  
    156156ALIGN JUMP_ALIGN
    157157MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI:
     158MenuitemPrint_WriteLookupValueStringToBufferInESDIfromRawItemInDSSI:
    158159    call    Menuitem_GetValueToAXfromMenuitemInDSSI
    159160    ; Fall to PrintLookupValueFromAXtoBufferInESDI
     
    173174PrintLookupValueFromAXtoBufferInESDI:
    174175    push    si
     176    test    byte [si+MENUITEM.bFlags], FLG_MENUITEM_CHOICESTRINGS
     177    jnz     .lookupChoice   
     178       
    175179    add     ax, [si+MENUITEM.itemValue+ITEM_VALUE.rgszValueToStringLookup]
    176180    xchg    bx, ax
     181.found:
    177182    mov     si, [bx]
     183.errorReturn:
    178184    call    String_CopyDSSItoESDIandGetLengthToCX
    179185    pop     si
    180186    ret
    181187
     188;
     189; With FLG_MENUITEM_CHOICESTRINGS, the array at .rgszChoiceToStringLookup is based on the
     190; Choice number (offset within .rgwChoiceToValueLookup) instead of the value stored.
     191; Here, we scan the .rgwChoiceToValueLookup array until we find the value there, and then
     192; use the same offset in .rgszChoiceToStringLookup.  If we don't find the value, we
     193; return an "Error!" string instead. 
     194;
     195; Note that the pointer array at .rgszChoiceToStringLookup must be NULL terminated.  Since the
     196; value could be zero, we don't use the .rgwChoiceToValueLookup array to find the end.
     197;
     198.lookupChoice:
     199    mov     bx,[si+MENUITEM.itemValue+ITEM_VALUE.rgszChoiceToStringLookup]     
     200    mov     si,[si+MENUITEM.itemValue+ITEM_VALUE.rgwChoiceToValueLookup]
     201       
     202.wordLoop:
     203    cmp     ax,[si]
     204    jz      .found
     205    inc     si
     206    inc     si
     207    inc     bx
     208    inc     bx
     209    cmp     word [bx],0
     210    jnz     .wordLoop
     211
     212    mov     si,g_szValueUnknownError
     213    jmp     .errorReturn
    182214
    183215;--------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.