Ignore:
Timestamp:
Apr 8, 2012, 6:17:37 PM (13 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • Added code to XTIDECFG for Power Management (standby timer) support in the BIOS.
  • Some minor optimizations.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/ConfigurationMenu.asm

    r376 r380  
    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; Section containing initialized data
     
    2626    at  MENUPAGE.fnEnter,           dw  ConfigurationMenu_EnterMenuOrModifyItemVisibility
    2727    at  MENUPAGE.fnBack,            dw  MainMenu_EnterMenuOrModifyItemVisibility
    28     at  MENUPAGE.wMenuitems,        dw  9
     28    at  MENUPAGE.wMenuitems,        dw  10
    2929iend
    3030
     
    135135iend
    136136
     137g_MenuitemConfigurationIdleTimeout:
     138istruc MENUITEM
     139    at  MENUITEM.fnActivate,        dw  Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
     140    at  MENUITEM.fnFormatValue,     dw  MenuitemPrint_WriteLookupValueStringToBufferInESDIfromRawItemInDSSI
     141    at  MENUITEM.szName,            dw  g_szItemCfgIdleTimeout
     142    at  MENUITEM.szQuickInfo,       dw  g_szNfoCfgIdleTimeout
     143    at  MENUITEM.szHelp,            dw  g_szHelpCfgIdleTimeout
     144    at  MENUITEM.bFlags,            db  FLG_MENUITEM_VISIBLE | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_CHOICESTRINGS
     145    at  MENUITEM.bType,             db  TYPE_MENUITEM_MULTICHOICE
     146    at  MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,        dw  ROMVARS.bIdleTimeout
     147    at  MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,              dw  g_szDlgCfgIdleTimeout
     148    at  MENUITEM.itemValue + ITEM_VALUE.szMultichoice,              dw  g_szMultichoiceIdleTimeout
     149    at  MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup,     dw  g_rgwChoiceToValueLookupForIdleTimeout
     150    at  MENUITEM.itemValue + ITEM_VALUE.rgszChoiceToStringLookup,   dw  g_rgszChoiceToStringLookupForIdleTimeout
     151iend
     152
     153g_rgwChoiceToValueLookupForIdleTimeout:
     154    %assign i -12
     155    %rep 21
     156        %assign i i+12
     157        dw  i       ; i / 12 = 0 (disabled) or 1...20 minutes
     158    %endrep
     159    %rep 4
     160        %assign i i+1
     161        dw  i       ; 241...244 = (i - 240) * 30 minutes
     162    %endrep
     163g_rgszChoiceToStringLookupForIdleTimeout:
     164    %assign i 0
     165    %rep 25
     166        dw  g_szIdleTimeoutChoice%[i]
     167        %assign i i+1
     168    %endrep
     169    ;   dw  NULL    ; Is this needed? *FIXME*
    137170
    138171; Section containing code
     
    297330; ConfigurationMenu_CheckAndMoveSerialDrivesToBottom
    298331;
    299 ; Checks to ensure that serial adapters are at the end of the 
    300 ; IDEVARS structures list, as serial floppies (if present) need to be 
     332; Checks to ensure that serial adapters are at the end of the
     333; IDEVARS structures list, as serial floppies (if present) need to be
    301334; the last drives detected by the BIOS.  If there are other controllers
    302335; after a serial controller, the other controllers are moved up on the list
     
    309342;   Corrupts registers:
    310343;       All
    311 ;----------------------------------------------------------------------     
    312 ConfigurationMenu_CheckAndMoveSerialDrivesToBottom:     
     344;----------------------------------------------------------------------
     345ConfigurationMenu_CheckAndMoveSerialDrivesToBottom:
    313346    push    es
    314347    push    ds
     
    319352    push    es
    320353    pop     ds
    321     mov     ch, 0                       ; clearing high order of CX and notification flag
    322     mov     dx, cx                      ; (probably unncessary, CX should be less than 127, but just to be sure)
    323     jcxz    .done                       ; probably unnecessary, but make sure there is at least one controller     
    324 
    325     add     di, ROMVARS.ideVars0        ; add in offset of first idevars
    326     mov     bx, di
     354    xor     ch, ch                      ; clearing high order of CX and notification flag
     355    mov     dx, cx                      ; (probably unnecessary, CX should be less than 127, but just to be sure)
     356    jcxz    .done                       ; probably unnecessary, but make sure there is at least one controller
     357
     358    lea     bx, [di+ROMVARS.ideVars0]   ; add in offset of first idevars
    327359
    328360.outerLoop:
     
    331363    xor     ax, ax                      ; first non-serial found
    332364    mov     cl, dl                      ; idevars count
    333     mov     ch, 0
     365    xor     ch, ch
    334366
    335367.loop:
     
    337369    jnz     .notSerial
    338370
    339     test    si, si                      ; record the first serial controllert that we find
    340     jnz     .next   
     371    test    si, si                      ; record the first serial controller that we find
     372    jnz     .next
    341373    mov     si, di
    342374    jmp     .next
     
    345377    mov     ax, di                      ; record the *last* non-serial controller that we find
    346378
    347 .next: 
     379.next:
    348380    add     di, IDEVARS_size
    349381    loop    .loop
    350382
    351     test    si,si                       ; no serial drives, nothing to do
     383    test    si, si                      ; no serial drives, nothing to do
    352384    jz      .done
    353     cmp     si,ax                       ; serial port is already later on the list than any other controllers
    354     ja      .done                       ; (also takes care of the case where ther are no other controllers)
     385    cmp     si, ax                      ; serial port is already later on the list than any other controllers
     386    ja      .done                       ; (also takes care of the case where there are no other controllers)
    355387
    356388;
     
    371403    rep movsb
    372404
    373     mov     di, si                      ; move up all the idevars below the serial, by one slot
    374     sub     di, IDEVARS_size
     405    lea     di, [si-IDEVARS_size]       ; move up all the idevars below the serial, by one slot
    375406
    376407    mov     cx, ax                      ; restore end pointer of list, subtract off end of serial idevars
     
    387418    mov     cx, IDEVARS_size
    388419    ; di is already at last IDEVARS position
    389    
     420
    390421    rep movsb
    391422
    392     add     sp, IDEVARS_size           
     423    add     sp, IDEVARS_size
    393424
    394425    push    es
     
    396427
    397428    mov     dh, 1                       ; set flag that we have done a relocation
    398    
     429
    399430    jmp     .outerLoop
    400431
     
    407438    test    dh, dh
    408439    jz      .noWorkDone
    409        
     440
    410441    mov     dx, g_szSerialMoved
    411442    call    Dialogs_DisplayNotificationFromCSDX
    412443
    413 .noWorkDone:       
     444.noWorkDone:
    414445    ret
Note: See TracChangeset for help on using the changeset viewer.