Changeset 242 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS_Configurator_v2


Ignore:
Timestamp:
Feb 10, 2012, 3:12:40 AM (12 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • Optimizations (both for size and speed) in IdeTransfer.asm and MemIdeTransfer.asm
  • Fixed a bug where the SingleByteRead/Write functions in IdeTransfer.asm would fail on 128 sector transfers.
  • Fixed some typos and errors in general, comments etc.
Location:
trunk/XTIDE_Universal_BIOS_Configurator_v2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/MenuStructs.inc

    r233 r242  
    3030FLG_MENUITEM_BYTEVALUE      EQU (1<<3)  ; Item value is single byte
    3131FLG_MENUITEM_PROGRAMVAR     EQU (1<<4)  ; Item is for configuring program, not BIOS
    32 FLG_MENUITEM_CHOICESTRINGS  EQU (1<<5)  ; ChoiceToStringLookup table is 1-1 with ChoiceToValueLookup table, 
    33                                         ; ChoiceToStringLookup table must also NULL terminated
     32FLG_MENUITEM_CHOICESTRINGS  EQU (1<<5)  ; ChoiceToStringLookup table is 1-1 with ChoiceToValueLookup table,
     33                                        ; ChoiceToStringLookup table must also be NULL terminated
    3434
    3535; Values for MENUITEM.bType
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm

    r233 r242  
    9898    at  MENUITEM.szHelp,            dw  g_szHelpIdeSerialCOM
    9999    at  MENUITEM.bFlags,            db  FLG_MENUITEM_MODIFY_MENU | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_CHOICESTRINGS
    100     at  MENUITEM.bType,             db  TYPE_MENUITEM_MULTICHOICE 
     100    at  MENUITEM.bType,             db  TYPE_MENUITEM_MULTICHOICE
    101101    at  MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,        dw  NULL
    102102    at  MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,              dw  g_szDlgDevice
     
    122122    at  MENUITEM.itemValue + ITEM_VALUE.fnValueReader,              dw  IdeControllerMenu_SerialReadPort
    123123    at  MENUITEM.itemValue + ITEM_VALUE.fnValueWriter,              dw  IdeControllerMenu_SerialWritePort
    124 iend       
    125 
    126 g_MenuitemIdeControllerSerialBaud:     
     124iend
     125
     126g_MenuitemIdeControllerSerialBaud:
    127127istruc MENUITEM
    128128    at  MENUITEM.fnActivate,        dw  Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
     
    139139    at  MENUITEM.itemValue + ITEM_VALUE.rgszChoiceToStringLookup,   dw  g_rgszChoiceToStringLookupForBaud
    140140iend
    141        
     141
    142142g_MenuitemIdeControllerEnableInterrupt:
    143143istruc MENUITEM
     
    200200    dw  'C'
    201201    dw  'x'             ; must be last entry (see reader/write routines)
    202 g_rgszChoiceToStringLookupForCOM:       
     202g_rgszChoiceToStringLookupForCOM:
    203203    dw  g_szValueCfgCOM1
    204204    dw  g_szValueCfgCOM2
     
    220220PackedCOMPortAddresses:             ; COM1 - COMC (or COM12)
    221221    db      DEVICE_SERIAL_COM1 >> 2
    222     db      DEVICE_SERIAL_COM2 >> 2 
    223     db      DEVICE_SERIAL_COM3 >> 2 
    224     db      DEVICE_SERIAL_COM4 >> 2 
    225     db      DEVICE_SERIAL_COM5 >> 2 
    226     db      DEVICE_SERIAL_COM6 >> 2 
    227     db      DEVICE_SERIAL_COM7 >> 2 
    228     db      DEVICE_SERIAL_COM8 >> 2 
    229     db      DEVICE_SERIAL_COM9 >> 2 
    230     db      DEVICE_SERIAL_COMA >> 2 
    231     db      DEVICE_SERIAL_COMB >> 2 
     222    db      DEVICE_SERIAL_COM2 >> 2
     223    db      DEVICE_SERIAL_COM3 >> 2
     224    db      DEVICE_SERIAL_COM4 >> 2
     225    db      DEVICE_SERIAL_COM5 >> 2
     226    db      DEVICE_SERIAL_COM6 >> 2
     227    db      DEVICE_SERIAL_COM7 >> 2
     228    db      DEVICE_SERIAL_COM8 >> 2
     229    db      DEVICE_SERIAL_COM9 >> 2
     230    db      DEVICE_SERIAL_COMA >> 2
     231    db      DEVICE_SERIAL_COMB >> 2
    232232    db      DEVICE_SERIAL_COMC >> 2
    233233    db      DEVICE_SERIAL_DEFAULT_CUSTOM_PORT >> 2          ; must be last entry (see reader/writer routines)
    234234DEVICE_SERIAL_DEFAULT_COM           EQU     '1'
    235        
     235
    236236g_rgbChoiceToValueLookupForBaud:
    237237    dw      (115200 / 115200) & 0xff
     
    280280    lea     ax, [bx+IDEVARS.wPort]
    281281    mov     [cs:g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
    282        
    283     lea     ax, [bx+IDEVARS.bSerialPort]       
     282
     283    lea     ax, [bx+IDEVARS.bSerialPort]
    284284    mov     [cs:g_MenuitemIdeControllerSerialPort+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
    285285
    286286    lea     ax, [bx+IDEVARS.bSerialBaud]
    287287    mov     [cs:g_MenuitemIdeControllerSerialBaud+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
    288        
     288
    289289    lea     ax, [bx+IDEVARS.wPortCtrl]
    290290    mov     [cs:g_MenuitemIdeControllerControlBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
    291        
     291
    292292    lea     ax, [bx+IDEVARS.bSerialCOMPortChar]
    293     mov     [cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax             
     293    mov     [cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
    294294
    295295    lea     ax, [bx+IDEVARS.bIRQ]
     
    374374    mov     bx, g_MenuitemIdeControllerSerialPort
    375375    call    .DisableMenuitemFromCSBX
    376                
    377     mov     bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]       
     376
     377    mov     bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
    378378    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
    379379    cmp     al,DEVICE_SERIAL_PORT
     
    386386    call    .EnableMenuitemFromCSBX
    387387
    388     mov     bx, [cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]         
     388    mov     bx, [cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
    389389    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
    390390    mov     bx, g_MenuitemIdeControllerSerialPort
     
    402402
    403403    mov     bx, g_MenuitemIdeControllerEnableInterrupt
    404     call    .EnableMenuitemFromCSBX             
     404    call    .EnableMenuitemFromCSBX
    405405
    406406    ret
    407        
     407
    408408;--------------------------------------------------------------------
    409409; MENUITEM activation functions (.fnActivate)
     
    431431;
    432432    push    bx
    433     mov     bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]       
     433    mov     bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
    434434    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
    435435    mov     bx, g_MenuitemMasterSlaveBlockModeTransfers
     
    438438    or      BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
    439439    jmp     .isDone
    440 .isSerial:     
     440.isSerial:
    441441    and     BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
    442442.isDone:
    443443    pop     bx
    444            
     444
    445445    call    MasterSlaveMenu_InitializeToDrvparamsOffsetInBX
    446446    jmp     MasterSlaveMenu_EnterMenuOrModifyItemVisibility
     
    453453; we need to take care to properly read/write just the bits we need.  In addition, since
    454454; we use the Port/PortCtrl bytes in a special way for serial drives, we need to properly
    455 ; default the values stored in both these words  when switching in and out of the Serial
     455; default the values stored in both these words when switching in and out of the Serial
    456456; device choice.
    457457;
     
    479479;
    480480; No change to Device byte, but use this opportunity to change defaults stored in wPort and wPortCtrl if we are
    481 ; changing in/out of a Serial device (since we use these bytes in radically different ways).  Also clear the
    482 ; interrupt informtion is we are moving into Serial (since the serial device does not use interrupts).
     481; changing in/out of a Serial device (since we use these bytes in radically different ways).
    483482;
    484483ALIGN JUMP_ALIGN
     
    489488
    490489        mov     bl,[es:di]                          ; what is the current Device?
    491        
     490
    492491        add     di,IDEVARS.wPort - IDEVARS.bDevice  ; Get ready to set the Port addresses
    493        
     492
    494493        cmp     al,DEVICE_SERIAL_PORT
    495494        jz      .changingToSerial
     
    500499.changingFromSerial:
    501500        cmp     al,DEVICE_16BIT_ATA
    502         jl      .xtide
     501
     502        mov     ax,DEVICE_XTIDE_DEFAULT_PORT        ; Defaults for 8-bit XTIDE devices
     503        mov     bx,DEVICE_XTIDE_DEFAULT_PORTCTRL
     504
     505        jb      .writeNonSerial
    503506
    504507        mov     ax,DEVICE_ATA_DEFAULT_PORT          ; Defaults for 16-bit and better ATA devices
    505508        mov     bx,DEVICE_ATA_DEFAULT_PORTCTRL
    506         jmp     .writeNonSerial
    507 
    508 .xtide:
    509         mov     ax,DEVICE_XTIDE_DEFAULT_PORT        ; Defaults for 8-bit XTIDE devices
    510         mov     bx,DEVICE_XTIDE_DEFAULT_PORTCTRL       
    511 
    512 .writeNonSerial:       
    513         mov     [es:di],ax                          ; Store defaults in IDEVARS.wPort and IDEVARS.wPortCtrl
    514         mov     [es:di+2],bx
     509
     510.writeNonSerial:
     511        stosw                                       ; Store defaults in IDEVARS.wPort and IDEVARS.wPortCtrl
     512        xchg    bx, ax
     513        stosw
    515514
    516515        jmp     .done
    517516
    518 .changingToSerial:     
     517.changingToSerial:
    519518        cmp     bl,DEVICE_SERIAL_PORT
    520519        jz      .done                               ; if we were already serial, nothing to do
     
    525524        add     di,IDEVARS.bSerialCOMPortChar-IDEVARS.wPort
    526525        call    IdeControllerMenu_SerialWriteCOM
    527         mov     [es:di],al
    528                
    529 .done: 
     526        stosb
     527
     528.done:
    530529        pop     di
    531530        pop     bx
     
    536535;
    537536; Doesn't modify COM character (unless it is not recognized, which would be an error case),
    538 ; But does update the port address based on COM port selection 
    539 ;               
     537; But does update the port address based on COM port selection
     538;
    540539ALIGN JUMP_ALIGN
    541540IdeControllerMenu_SerialWriteCOM:
     
    543542        push    bx
    544543        push    si
    545        
     544
    546545        mov     si,g_rgbChoiceToValueLookupForCOM
    547546        mov     bx,PackedCOMPortAddresses
     
    552551        cmp     ah,(DEVICE_SERIAL_DEFAULT_CUSTOM_PORT >> 2)
    553552        jz      .notFound
    554        
     553
    555554        cmp     al,[si]
    556555        jz      .found
    557        
     556
    558557        inc     si
    559558        inc     si
    560559        inc     bx
    561        
     560
    562561        jmp     .loop
    563562
    564563.notFound:
    565564        mov     al, 'x'
    566        
    567 .found:         
     565
     566.found:
    568567        mov     [es:di+IDEVARS.bSerialPort-IDEVARS.bSerialCOMPortChar], ah
    569568
     
    571570        pop     bx
    572571        pop     ax
    573        
     572
    574573        ret
    575        
     574
    576575
    577576;
    578577; Packed Port (byte) -> Numeric Port (word)
    579 ;               
     578;
    580579ALIGN JUMP_ALIGN
    581580IdeControllerMenu_SerialReadPort:
    582581        xor     ah,ah
    583         shl     ax,1
    584         shl     ax,1
     582        eSHL_IM ax, 2
    585583        ret
    586584
     
    590588;
    591589ALIGN JUMP_ALIGN
    592 IdeControllerMenu_SerialWritePort:     
     590IdeControllerMenu_SerialWritePort:
    593591        push    bx
    594592        push    si
    595593
    596         shr     ax,1
    597         shr     ax,1
     594        eSHR_IM ax, 2
    598595        and     al,0feh         ; force 8-byte boundary
    599596
    600         mov     si,g_rgbChoiceToValueLookupForCOM                       
     597        mov     si,g_rgbChoiceToValueLookupForCOM
    601598        mov     bx,PackedCOMPortAddresses           ; loop, looking for port address in known COM address list
    602599
     
    605602        cmp     ah,'x'
    606603        jz      .found
    607                
     604
    608605        cmp     al,[bx]
    609606        jz      .found
    610        
     607
    611608        inc     si
    612609        inc     si
    613610        inc     bx
    614        
     611
    615612        jmp     .loop
    616613
    617 .found: 
     614.found:
    618615        mov     [es:di+IDEVARS.bSerialCOMPortChar-IDEVARS.bSerialPort], ah
    619616
     
    623620        ret
    624621
    625 
    626 
    627 
    628 
    629 
    630 
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm

    r233 r242  
    1414g_szUnidentified:                   db  "Unidentified",NULL
    1515g_szUnsaved:                        db  " ",SINGLE_LEFT_HORIZONTAL_TO_VERTICAL,
    16                                     db  "Unsaved",SINGLE_RIGHT_HORIZONTAL_TO_VERTICAL, NULL
     16                                    db  "Unsaved",SINGLE_RIGHT_HORIZONTAL_TO_VERTICAL,NULL
    1717
    1818; Item formatting
     
    124124g_szDlgIdeEnIRQ:        db  "Enable interrupt?",NULL
    125125g_szDlgIdeIRQ:          db  "Enter IRQ channel (2...7 for 8-bit controllers, 2...15 for any other controller).",NULL
    126        
     126
    127127g_szNfoIdeBackToCfgMenu:db  "Back to XTIDE Universal BIOS Configuration Menu.",NULL
    128128g_szNfoIdeMaster:       db  "Settings for Master Drive.",NULL
     
    135135g_szNfoIdeSerialCOM:    db  "Select a COM port by number.",NULL
    136136g_szNfoIdeSerialBaud:   db  "Select the COM port's Baud Rate. The server must match this speed. Note that UART clock multipliers may impact the actual speed.",NULL
    137 g_szNfoIdeSerialPort:   db  "Select a COM port by custom I/O port address. Any address is valud up to 3f8h, but must be on an 8-byte boundary.", NULL
     137g_szNfoIdeSerialPort:   db  "Select a COM port by custom I/O port address. Any address is valid up to 3f8h, but must be on an 8-byte boundary.",NULL
    138138
    139139g_szHelpIdeCmdPort:     incbin  "IDE_CommandPort.txt"
     
    188188g_szValueCfgCOMC:       db      "COMC",NULL
    189189g_szValueCfgCOMx:       db      "Custom",NULL
    190        
     190
    191191g_szSerialBaudChoice:
    192192                        db  "115.2K baud",LF
     
    196196                        db  "19.2K baud",LF
    197197                        db  "9600 baud",LF
    198                         db  "4800 baud",LF     
     198                        db  "4800 baud",LF
    199199                        db  "2400 baud",NULL
    200200
     
    205205g_szValueCfgBaud19_2:   db      "19.2K",NULL
    206206g_szValueCfgBaud9600:   db      "9600",NULL
    207 g_szValueCfgBaud4800:   db      "4800",NULL     
     207g_szValueCfgBaud4800:   db      "4800",NULL
    208208g_szValueCfgBaud2400:   db      "2400",NULL
    209209
    210        
     210
    211211g_szValueCfgDeviceDual8b:   db  "XTIDE",NULL
    212212g_szValueCfgDeviceMod:      db  "Chuck(G)",NULL
     
    257257g_szDlgBootSwap:        db  "Enable drive number translation?",NULL
    258258g_szDlgSerialDetect:    db  "Scan for serial drives?",NULL
    259        
     259
    260260g_szNfoBootTimeout:     db  "Menu item selection timeout in BIOS timer ticks.",NULL
    261261g_szNfoBootDrive:       db  "Default drive on boot menu.",NULL
     
    375375g_szValueUnknownError:  db  "Error!",NULL
    376376
    377 
    378 
Note: See TracChangeset for help on using the changeset viewer.