Ignore:
Timestamp:
Feb 1, 2025, 12:45:33 PM (10 hours ago)
Author:
Krister Nordvall
Message:

Changes:

  • Fixed a bug in XTIDECFG where changing the COM port for a virtual serial device would not work at all. Thanks to Jaroslaw Jablonski for reporting this problem.
  • Added a couple of macros to the library, LPUSH and LPOP, which creates the long (two bytes) encoding of PUSH and POP respectively. They are pretty much useless except LPOP can be used to differentiate between 808x and NEC V CPUs.
File:
1 edited

Legend:

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

    r625 r631  
    44;
    55; XTIDE Universal BIOS and Associated Tools
    6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2023 by XTIDE Universal BIOS Team.
     6; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2025 by XTIDE Universal BIOS Team.
    77;
    88; This program is free software; you can redistribute it and/or modify
     
    133133    at  MENUITEM.bType,             db  TYPE_MENUITEM_HEX
    134134    at  MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset,        dw  NULL
    135     at  MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,              dw  g_szDlgIdeCmdPort
     135    at  MENUITEM.itemValue + ITEM_VALUE.szDialogTitle,              dw  g_szDlgIdeSerialPort
    136136    at  MENUITEM.itemValue + ITEM_VALUE.wMinValue,                  dw  8h
    137137    at  MENUITEM.itemValue + ITEM_VALUE.wMaxValue,                  dw  3F8h
     
    578578    push    ax
    579579    xlat
    580     mov     [es:di+IDEVARS.bIRQ-IDEVARS.wBasePort], al
     580    mov     [es:di+IDEVARS.bIRQ], al
    581581    pop     ax
    582582
     
    639639    ; XT-CF does not support IRQ so it must be disabled (IRQ setting is not visible for XT-CF)
    640640    ; XTIDE does not use IRQs by default
    641     mov     BYTE [es:di+IDEVARS.bIRQ-IDEVARS.wBasePort], 0
     641    mov     BYTE [es:di+IDEVARS.bIRQ], 0
    642642
    643643.WriteNonSerial:
     
    658658
    659659.ChangingToSerial:
    660 ;
    661 ; For serial drives, we pack the port number and baud rate into a single byte, and thus
    662 ; we need to take care to properly read/write just the bits we need.  In addition, since
    663 ; we use the Port/PortCtrl bytes in a special way for serial drives, we need to properly
    664 ; default the values stored in both these words when switching in and out of the Serial
    665 ; device choice.
    666 ;
    667     mov     al, SERIAL_DEFAULT_COM
    668     mov     BYTE [es:di+IDEVARS.bSerialBaud-IDEVARS.wBasePort], SERIAL_DEFAULT_BAUD
    669     mov     [es:di+IDEVARS.bIRQ-IDEVARS.wBasePort], ah  ; Clear .bIRQ to keep the boot menu from printing it
    670 
     660    mov     al, ah                              ; Clear AL to point to the default COM port in the PackedCOMPortAddresses table
     661    mov     BYTE [es:di+IDEVARS.bSerialBaud], SERIAL_DEFAULT_BAUD
     662    mov     [es:di+IDEVARS.bIRQ], ah            ; Clear .bIRQ to keep the boot menu from printing it
    671663    sub     di, IDEVARS.wBasePort - IDEVARS.bSerialCOMPortChar
     664    mov     BYTE [es:di], SERIAL_DEFAULT_COM
    672665    call    IdeControllerMenu_SerialWriteCOM
    673     stosb
    674666
    675667.Done:
     
    685677;
    686678;   Parameters:
    687 ;       AL:     COM port
     679;       AX:     COM port menu choice index
    688680;       ES:DI:  Ptr to IDEVARS.bSerialCOMPortChar
    689681;       DS:SI:  MENUITEM pointer
    690682;   Returns:
    691 ;       Nothing
     683;       AX:     COM port menu choice index
    692684;   Corrupts registers:
    693685;       BX
     
    695687ALIGN JUMP_ALIGN
    696688IdeControllerMenu_SerialWriteCOM:
    697     push    ax
    698     push    si
    699 
    700     mov     bx, PackedCOMPortAddresses - 1
    701     mov     si, g_rgbChoiceToValueLookupForCOM - 2
    702 
    703 .Loop:
    704     inc     bx
    705     inc     si
    706     inc     si
    707 
    708     mov     ah, [bx]
    709     cmp     ah, SERIAL_DEFAULT_CUSTOM_PORT >> 2
    710     je      SHORT .NotFound
    711 
    712     cmp     al, [si]
    713     jne     SHORT .Loop
    714 
    715 .NotFound:
    716     mov     [es:di+IDEVARS.bSerialPort-IDEVARS.bSerialCOMPortChar], ah
    717 
    718     pop     si
    719     pop     ax
     689    xchg    bx, ax
     690    mov     al, [bx+PackedCOMPortAddresses]
     691    mov     [es:di+IDEVARS.bSerialPort-IDEVARS.bSerialCOMPortChar], al
     692    xchg    bx, ax
    720693    ret
    721694
Note: See TracChangeset for help on using the changeset viewer.