Changeset 593 in xtideuniversalbios for trunk/Assembly_Library


Ignore:
Timestamp:
Jun 30, 2018, 8:27:04 AM (6 years ago)
Author:
Tomi Tilli
Message:

Flashing now works again.
Hack to get Windows 95 to work properly (MODULE_WIN95_CMOS_HACK included for 386 builds by default).
Edited makefile to produce large 386 build.
Fixed recovery time for QDI Vision VLB-IDE controllers.
No more warnings with Nasm 2.13.xx and later.
File dialog now properly restores default drive when file selection is cancelled.

Location:
trunk/Assembly_Library
Files:
4 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Inc/AssemblyLibrary.inc

    r256 r593  
    99%include "BiosData.inc"
    1010%include "BiosFunctions.inc"
     11%include "CMOS.inc"
    1112%include "CgaSnow.inc"
    1213%include "Debug.inc"
    1314%include "Delay.inc"
    1415%include "DosFunctions.inc"
     16%include "CMOS.inc"
    1517%include "File.inc"
    1618%include "Math.inc"
     
    2022
    2123; Library dependencies
    22 %ifdef INCLUDE_MENU_DIALOGS
    23     %include "Dialog.inc"
    24     %define INCLUDE_MENU_LIBRARY
    25     %define INCLUDE_FILE_LIBRARY
    26 %endif
    27 
    28 %ifdef INCLUDE_MENU_LIBRARY
     24%ifdef INCLUDE_MENU_LIBRARY or INCLUDE_MENU_DIALOGS ; To prevent warnings with Nasm 2.13.xx
    2925    %include "Menu.inc"
    3026    %include "MenuEvents.inc"
    3127    %define INCLUDE_KEYBOARD_LIBRARY
    3228    %define INCLUDE_TIME_LIBRARY
     29   
     30    %ifdef INCLUDE_MENU_DIALOGS
     31        %include "Dialog.inc"
     32        %define INCLUDE_MENU_LIBRARY
     33        %define INCLUDE_FILE_LIBRARY
     34    %endif
    3335%endif
    3436
  • trunk/Assembly_Library/Inc/BiosFunctions.inc

    r592 r593  
    1212BIOS_BOOT_FAILURE_INTERRUPT_18h EQU     18h
    1313BIOS_BOOT_LOADER_INTERRUPT_19h  EQU     19h
     14BIOS_TIME_PCI_PNP_1Ah           EQU     1Ah
    1415BIOS_DISKETTE_INTERRUPT_40h     EQU     40h
    1516HD0_DPT_POINTER_41h             EQU     41h
     
    6465EVENT_WAIT                      EQU     86h
    6566
     67; BIOS PCI 2.0+ functions
     68PCI_INSTALLATION_CHECK              EQU     0B101h
     69
    6670
    6771%endif ; BIOS_FUNCTIONS_INC
  • trunk/Assembly_Library/Inc/Dialog.inc

    r54 r593  
    4646endstruc
    4747
     48
     49; Progress bar dialog
     50PROGRESS_COMPLETE_CHARACTER         EQU     BLOCK_FULL_FOREGROUND
     51PROGRESS_INCOMPLETE_CHARACTER       EQU     BLOCK_MOSTLY_BACKGROUND
     52
    4853struc PROGRESS_DIALOG_IO
    4954    .dialogInput                    resb    DIALOG_INPUT_size
     
    6772endstruc
    6873
     74
     75; File dialog
     76FILENAME_BUFFER_SIZE                EQU     14  ; 8+1+3+NULL+alignment
     77MAX_FILE_DIALOG_INFO_LINES          EQU     3
     78FLG_FILEDIALOG_DRIVES               EQU     (1<<0)  ; Allow changing drive
     79FLG_FILEDIALOG_DIRECTORY            EQU     (1<<1)  ; Select directory instead of file
     80FLG_FILEDIALOG_NEW                  EQU     (1<<2)  ; Allow creating new file or directory
     81
     82KEY_FILEDIALOG_CHANGE_DRIVE         EQU     3Ch     ; F2
     83KEY_FILEDIALOG_SELECT_DIRECTORY     EQU     3Dh     ; F3
     84KEY_FILEDIALOG_NEW_FILE_OR_DIR      EQU     3Eh     ; F4
     85
    6986struc FILE_DIALOG_IO
    7087    ; DIALOG_INPUT adjusted for File Dialog
     
    83100
    84101
    85 ; Progress bar dialog
    86 PROGRESS_COMPLETE_CHARACTER         EQU     BLOCK_FULL_FOREGROUND
    87 PROGRESS_INCOMPLETE_CHARACTER       EQU     BLOCK_MOSTLY_BACKGROUND
    88 
    89 ; File dialog
    90 FILENAME_BUFFER_SIZE                EQU     14  ; 8+1+3+NULL+alignment
    91 MAX_FILE_DIALOG_INFO_LINES          EQU     3
    92 FLG_FILEDIALOG_DRIVES               EQU     (1<<0)  ; Allow changing drive
    93 FLG_FILEDIALOG_DIRECTORY            EQU     (1<<1)  ; Select directory instead of file
    94 FLG_FILEDIALOG_NEW                  EQU     (1<<2)  ; Allow creating new file or directory
    95 
    96 KEY_FILEDIALOG_CHANGE_DRIVE         EQU     3Ch     ; F2
    97 KEY_FILEDIALOG_SELECT_DIRECTORY     EQU     3Dh     ; F3
    98 KEY_FILEDIALOG_NEW_FILE_OR_DIR      EQU     3Eh     ; F4
    99 
    100 
    101102%endif ; DIALOG_INC
  • trunk/Assembly_Library/Inc/Macros.inc

    r592 r593  
    124124
    125125
     126;--------------------------------------------------------------------
     127; Small delay between I/O port accessess if needed.
     128;
     129; IO_DELAY
     130;   Parameters:
     131;       Nothing
     132;   Returns:
     133;       Nothing
     134;   Corrupts registers:
     135;       Nothing
     136;--------------------------------------------------------------------
     137%macro IO_DELAY 0
     138    jmp     SHORT %%ClearPrefetchQueue
     139%%ClearPrefetchQueue:
     140%endmacro
     141
     142
    126143%endif ; MACROS_INC
  • trunk/Assembly_Library/Src/AssemblyLibrary.asm

    r592 r593  
    55;
    66; XTIDE Universal BIOS and Associated Tools
    7 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
     7; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2018 by XTIDE Universal BIOS Team.
    88;
    99; This program is free software; you can redistribute it and/or modify
     
    4545    %include "Drive.asm"
    4646    %include "FileIO.asm"
     47    %include "InterruptHandlers.asm"
    4748%endif
    4849
     
    134135        %include "Sort.asm"
    135136    %endif
     137
     138%ifdef INCLUDE_CMOS_LIBRARY
     139    %include "CMOS.asm"
     140%endif
    136141%endif
    137142
  • trunk/Assembly_Library/Src/Display/CgaSnow.asm

    r592 r593  
    3737
    3838    ; All standard CGA modes use 25 rows but only EGA and later store it to BDA.
    39     cmp     BYTE [BDA.bVidRows], 25     ; *FIXME* Shouldn't this be 24 (rows - 1)?
     39    cmp     BYTE [BDA.bVidRows], 24     ; BDA contains rows - 1
    4040    jae     SHORT .CgaNotFound
    4141    ret
  • trunk/Assembly_Library/Src/File/DosCritical.asm

    r592 r593  
    4545    push    ds
    4646
    47     push    cs
    48     pop     ds
    49     mov     ax, (SET_INTERRUPT_VECTOR<<8) | DOS_CRITICAL_ERROR_HANDLER_24h
    50     int     DOS_INTERRUPT_21h
     47    mov     al, DOS_CRITICAL_ERROR_HANDLER_24h
     48    call    HookInterruptVectorInALwithHandlerInCSDX
    5149
    5250    pop     ds
  • trunk/Assembly_Library/Src/File/Drive.asm

    r592 r593  
    131131.IsValidDriveNumberInDL:
    132132    push    ds
     133    push    ax
     134    cmp     dl, 1
     135    jbe     SHORT .FloppyDrive
     136
     137.MessageSuppressedByInt2FhHandler:
     138.MoreThanOneFloppyDrive:
     139.NoFloppyDrive:
    133140    push    bx
    134     push    ax
    135141
    136142    inc     dx          ; Default drive is 00h and first drive is 01h
     
    152158    test    al, al
    153159
     160    pop     bx
     161.ReturnFromFloppyDriveFiltering:
    154162    pop     ax
    155     pop     bx
    156163    pop     ds
    157164    ret
     165
     166.FloppyDrive:
     167; On single-floppy-drive systems, both A: and B: will point to the same physical drive. The problem is that DOS will print a message telling the user
     168; to "insert a disk and press any key to continue" when swapping from one logical drive to the other. To avoid this mess we hook interrupt 2Fh/AX=4A00h
     169; to signal to DOS that we will handle this ourselves. However, this only works on DOS 5+ so on older DOS versions we instead try to filter out
     170; the "other" logical drive (the one that isn't the current drive) during drive enumeration so the user can't select the "phantom" drive to begin with.
     171; This will have the somewhat strange effect of having a drive B: but no drive A: if B: happens to be the current logical floppy drive.
     172
     173    cmp     BYTE [bDosVersionMajor], 5      ; bDosVersionMajor must be provided by the application as it's not part of the library
     174    jae     SHORT .MessageSuppressedByInt2FhHandler
     175    LOAD_BDA_SEGMENT_TO ds, ax
     176    mov     al, [BDA.wEquipment]
     177    test    al, 0C0h
     178    jnz     SHORT .MoreThanOneFloppyDrive   ; No phantom drive so no need for any filtering
     179    test    al, 1                           ; Any floppy drive at all?
     180    jz      SHORT .NoFloppyDrive            ; A pre-DOS 5 machine with no FDD is indeed a strange beast. However, don't trust the BIOS - let DOS decide
     181    cmp     dl, [504h]                      ; MS-DOS - LOGICAL DRIVE FOR SINGLE-FLOPPY SYSTEM (A: / B:)
     182    jmp     SHORT .ReturnFromFloppyDriveFiltering
    158183
    159184;--------------------------------------------------------------------
  • trunk/Assembly_Library/Src/Menu/Dialog/Dialog.asm

    r583 r593  
    3232;       AX:     Selected item
    3333;   Corrupts registers:
    34 ;       BX, CX, DX, SI, DI
     34;       BX, CX, DX, DI
    3535;--------------------------------------------------------------------
    3636ALIGN JUMP_ALIGN
     
    3838    push    es
    3939    push    ds
    40     mov     di, bp                              ; Backup parent MENU
     40    mov     di, bp                          ; Backup parent MENU
    4141    mov     cx, DIALOG_size
    4242    eENTER_STRUCT cx
     
    5252
    5353    mov     ax, [bp+MENUINIT.wHighlightedItem]
     54    mov     si, [bp+DIALOG.fpDialogIO]      ; Restore SI
    5455    eLEAVE_STRUCT DIALOG_size
    5556    pop     ds
  • trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm

    r592 r593  
    3232;       Nothing
    3333;   Corrupts registers:
    34 ;       AX, BX, CX, DX, SI, DI
     34;       AX, BX, CX, DX, DI
    3535;--------------------------------------------------------------------
    3636ALIGN JUMP_ALIGN
    3737DialogFile_GetFileNameWithIoInDSSI:
     38    ; We need to store default drive because user might change drive but
     39    ; then cancel the file selection. In that case the original default directory
     40    ; must be restored.
     41    call    Drive_GetDefaultToAL
     42    push    ax
     43
    3844    mov     bx, FileEventHandler
    3945    mov     BYTE [si+FILE_DIALOG_IO.bUserCancellation], TRUE
    40     jmp     Dialog_DisplayWithDialogInputInDSSIandHandlerInBX
     46    call    Dialog_DisplayWithDialogInputInDSSIandHandlerInBX
     47
     48    ; Now restore the default drive if user cancellation
     49    pop     dx
     50    cmp     BYTE [si+FILE_DIALOG_IO.bUserCancellation], TRUE
     51    je      Drive_SetDefaultFromDL
     52    ret
    4153
    4254
  • trunk/Assembly_Library/Src/Util/Bit.asm

    r592 r593  
    8686    jb      SHORT Bit_SetToAXfromIndexInCL
    8787
     88%ifdef USE_NEC_V
     89    eSET1   dx, cl              ; SET1 ignores bits 7...4 in CL
     90%else
    8891    sub     cl, 16
    8992    xchg    ax, dx
     
    9194    xchg    dx, ax
    9295    add     cl, 16
     96%endif
    9397    ret
    9498
     
    106110ALIGN JUMP_ALIGN
    107111Bit_SetToAXfromIndexInCL:
     112%ifdef USE_NEC_V
     113    eSET1   ax, cl
     114%else
    108115    push    dx
    109116
     
    113120
    114121    pop     dx
     122%endif
    115123    ret
    116124
Note: See TracChangeset for help on using the changeset viewer.