Changeset 68 in xtideuniversalbios


Ignore:
Timestamp:
Dec 9, 2010, 6:36:00 PM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to Configurator v2:

  • Finally ready for testing.
Location:
trunk/XTIDE_Universal_BIOS_Configurator_v2
Files:
17 added
9 edited

Legend:

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

    r65 r68  
    22; Project name  :   XTIDE Univeral BIOS Configurator v2
    33; Created date  :   5.10.2010
    4 ; Last update   :   2.12.2010
     4; Last update   :   6.12.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Global variables for configuration program.
     
    1313XTIDE_SIGNATURE_LENGTH              EQU     8   ; XTIDE Universal BIOS signature string length
    1414NUMBER_OF_EEPROM_TYPES              EQU     4
    15 MAX_EEPROM_SIZE                     EQU 65536
     15MAX_EEPROM_SIZE_IN_BYTES            EQU     65536
    1616
    1717
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/BiosFile.asm

    r65 r68  
    22; Project name  :   XTIDE Univeral BIOS Configurator v2
    33; Created date  :   10.10.2010
    4 ; Last update   :   30.11.2010
     4; Last update   :   6.12.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Functions for loading and saving BIOS image file.
     
    2323    push    ds
    2424
    25     call    .OpenFileForLoadingFromDSSIandGetSizeToCX
    26     jc      SHORT .DisplayErrorMessage
    27     call    .LoadFileWithNameInDSSIhandleInBXandSizeInCXtoRamBuffer
     25    call    .OpenFileForLoadingFromDSSIandGetSizeToDXCX
     26    jc      SHORT .DisplayErrorMessage
     27    call    .LoadFileWithNameInDSSIhandleInBXandSizeInDXCXtoRamBuffer
    2828    jc      SHORT .DisplayErrorMessage
    2929
    3030    mov     ax, FLG_CFGVARS_FILELOADED
    31     call    Buffers_NewBiosWithSizeInCXandSourceInAXhasBeenLoadedForConfiguration
     31    call    Buffers_NewBiosWithSizeInDXCXandSourceInAXhasBeenLoadedForConfiguration
    3232    call    DisplayFileLoadedSuccesfully
    3333    call    FileIO_CloseUsingHandleFromBX
     
    4343
    4444;--------------------------------------------------------------------
    45 ; .OpenFileForLoadingFromDSSIandGetSizeToCX
     45; .OpenFileForLoadingFromDSSIandGetSizeInBytesToDXCX
    4646;   Parameters:
    4747;       DS:SI:  Name of file to open
    4848;   Returns:
    4949;       BX:     File handle (if succesfull)
    50 ;       CX:     File size (if succesfull)
     50;       DX:CX:  File size (if succesfull)
    5151;       CF:     Clear if successfull
    5252;               Set if error
    5353;   Corrupts registers:
    54 ;       AX, DX
    55 ;--------------------------------------------------------------------
    56 ALIGN JUMP_ALIGN
    57 .OpenFileForLoadingFromDSSIandGetSizeToCX:
     54;       AX
     55;--------------------------------------------------------------------
     56ALIGN JUMP_ALIGN
     57.OpenFileForLoadingFromDSSIandGetSizeToDXCX:
    5858    mov     al, FILE_ACCESS.ReadOnly
    5959    call    FileIO_OpenWithPathInDSSIandFileAccessInAL
     
    6262    jc      SHORT .FileError
    6363
    64     cmp     dx, BYTE 1      ; File size over 65536 bytes?
     64    cmp     dx, MAX_EEPROM_SIZE_IN_BYTES >> 16
    6565    ja      SHORT .FileTooBig
    66     jb      SHORT .CopyFileSizeToCX
    67     test    ax, ax
    68     jnz     SHORT .FileTooBig
    69     dec     ax              ; Prepare to load 65535 bytes
    70 .CopyFileSizeToCX:
     66    jb      SHORT .FileNotTooBig
     67    cmp     ax, MAX_EEPROM_SIZE_IN_BYTES & 0FFFFh
     68    ja      SHORT .FileTooBig
     69.FileNotTooBig:
    7170    xchg    cx, ax
    7271    clc
     
    7978
    8079;--------------------------------------------------------------------
    81 ; .LoadFileWithNameInDSSIhandleInBXandSizeInCXtoRamBuffer
     80; .LoadFileWithNameInDSSIhandleInBXandSizeInDXCXtoRamBuffer
    8281;   Parameters:
    8382;       BX:     File Handle
    84 ;       CX:     File size
     83;       DX:CX:  File size
    8584;       DS:SI:  File name
    8685;   Returns:
     
    9190;--------------------------------------------------------------------
    9291ALIGN JUMP_ALIGN
    93 .LoadFileWithNameInDSSIhandleInBXandSizeInCXtoRamBuffer:
     92.LoadFileWithNameInDSSIhandleInBXandSizeInDXCXtoRamBuffer:
    9493    push    es
    9594
    9695    call    Buffers_GetFileBufferToESDI
    9796    call    Registers_ExchangeDSSIwithESDI
    98     call    FileIO_ReadCXbytesToDSSIusingHandleFromBX
     97    call    FileIO_ReadDXCXbytesToDSSIusingHandleFromBX
    9998    jnc     SHORT .StoreFileNameToCfgvarsFromESDI
    10099
     
    163162    call    Buffers_GetFileBufferToESDI
    164163    call    Registers_CopyESDItoDSSI
     164    xor     dx, dx
    165165    mov     cx, [cs:g_cfgVars+CFGVARS.wImageSizeInWords]
    166166    shl     cx, 1
    167     call    FileIO_WriteCXbytesFromDSSIusingHandleFromBX
     167    rcl     dx, 1           ; WORDs to BYTEs
     168    call    FileIO_WriteDXCXbytesFromDSSIusingHandleFromBX
    168169    jc      SHORT .DisplayErrorMessage
    169170
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm

    r65 r68  
    22; Project name  :   XTIDE Universal BIOS Configurator v2
    33; Created date  :   6.10.2010
    4 ; Last update   :   5.12.2010
     4; Last update   :   6.12.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Functions for accessing file and flash buffers.
     
    4141
    4242    call    Buffers_GetFileBufferToESDI
    43     call    Buffers_IsXtideUniversalBiosSignatureInESDI
    44     jnz     SHORT .NoFileOrBiosLoaded
    45     jmp     SHORT .IsSupportedVersionOfXtideUniversalBiosLoaded
     43    jmp     SHORT Buffers_IsXtideUniversalBiosSignatureInESDI
    4644.NoFileOrBiosLoaded:
    4745    or      cl, 1       ; Clear ZF
    4846    ret
    4947
    50 
    51 ALIGN JUMP_ALIGN
    52 .IsSupportedVersionOfXtideUniversalBiosLoaded:
    53    
    5448
    5549;--------------------------------------------------------------------
     
    8175;   Parameters:
    8276;       AX:     EEPROM source (FLG_CFGVARS_FILELOADED or FLG_CFGVARS_ROMLOADED)
    83 ;       CX:     EEPROM size in bytes
    84 ;   Returns:
    85 ;       Nothing
    86 ;   Corrupts registers:
    87 ;       AX, CX
    88 ;--------------------------------------------------------------------
    89 ALIGN JUMP_ALIGN
    90 Buffers_NewBiosWithSizeInCXandSourceInAXhasBeenLoadedForConfiguration:
     77;       DX:CX:  EEPROM size in bytes
     78;   Returns:
     79;       Nothing
     80;   Corrupts registers:
     81;       AX, CX, DX
     82;--------------------------------------------------------------------
     83ALIGN JUMP_ALIGN
     84Buffers_NewBiosWithSizeInDXCXandSourceInAXhasBeenLoadedForConfiguration:
    9185    and     WORD [cs:g_cfgVars+CFGVARS.wFlags], ~(FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED | FLG_CFGVARS_UNSAVED)
    9286    or      WORD [cs:g_cfgVars+CFGVARS.wFlags], ax
    93     mov     ax, (64<<10) / 2    ; 32768 WORDs
    94     shr     cx, 1               ; Bytes to WORDs
    95     eCMOVZ  cx, ax
     87    shr     dx, 1
     88    rcr     cx, 1
    9689    mov     [cs:g_cfgVars+CFGVARS.wImageSizeInWords], cx
    9790    ret
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm

    r65 r68  
    22; Project name  :   XTIDE Univeral BIOS Configurator v2
    33; Created date  :   19.4.2010
    4 ; Last update   :   3.12.2010
     4; Last update   :   9.12.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Functions for managing EEPROM contents.
     
    3131
    3232;--------------------------------------------------------------------
    33 ; EEPROM_LoadXtideUniversalBiosFromRomToRamBuffer
     33; EEPROM_LoadXtideUniversalBiosFromRomToRamBufferAndReturnSizeInDXCX
    3434;   Parameters:
    3535;       Nothing
    3636;   Returns:
    37 ;       CX:     BIOS size in bytes
     37;       DX:CX:  BIOS size in bytes
    3838;   Corrupts registers:
    3939;       AX, BX, SI, DI
    4040;--------------------------------------------------------------------
    4141ALIGN JUMP_ALIGN
    42 EEPROM_LoadXtideUniversalBiosFromRomToRamBuffer:
     42EEPROM_LoadXtideUniversalBiosFromRomToRamBufferAndReturnSizeInDXCX:
    4343    push    es
    4444
    4545    call    EEPROM_FindXtideUniversalBiosROMtoESDI
    46     call    .GetXtideUniversalBiosSizeFromEStoCX
     46    call    .GetXtideUniversalBiosSizeFromEStoDXCX
    4747    xor     si, si              ; Load from beginning of ROM
    4848    call    LoadBytesFromRomToRamBuffer
    4949
    50     call    .GetXtideUniversalBiosSizeFromEStoCX
     50    call    .GetXtideUniversalBiosSizeFromEStoDXCX
    5151    pop     es
    5252    ret
    5353
    5454;--------------------------------------------------------------------
    55 ; .GetXtideUniversalBiosSizeFromEStoCX
     55; .GetXtideUniversalBiosSizeFromEStoDXCX
    5656;   Parameters:
    5757;       Nothing
    5858;   Returns:
    59 ;       AX:     Bios size in bytes
     59;       DX:CX:  Bios size in bytes
    6060;   Corrupts registers:
    61 ;       AX, BX
     61;       Nothing
    6262;--------------------------------------------------------------------
    6363ALIGN JUMP_ALIGN
    64 .GetXtideUniversalBiosSizeFromEStoCX:
     64.GetXtideUniversalBiosSizeFromEStoDXCX:
     65    xor     dx, dx
    6566    eMOVZX  cx, BYTE [es:ROMVARS.bRomSize]
    6667    eSHL_IM cx, 9               ; *= 512 for byte count
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Main.asm

    r65 r68  
    22; Project name  :   XTIDE Univeral BIOS Configurator v2
    33; Created date  :   5.10.2010
    4 ; Last update   :   3.12.2010
     4; Last update   :   7.12.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Program start and exit.         
     
    5454ALIGN JUMP_ALIGN
    5555Main_Start:
    56     CALL_DISPLAY_LIBRARY InitializeDisplayContext
    57     CALL_DISPLAY_LIBRARY ClearScreen
     56    mov     ax, SCREEN_BACKGROUND_CHARACTER_AND_ATTRIBUTE
     57    call    InitializeScreenWithBackgroudCharAndAttrInAX
    5858
    5959    call    Main_InitializeCfgVars
    6060    call    MenuEvents_DisplayMenu
     61    mov     ax, DOS_BACKGROUND_CHARACTER_AND_ATTRIBUTE
     62    call    InitializeScreenWithBackgroudCharAndAttrInAX
    6163
    6264    ; Exit to DOS
    63     CALL_DISPLAY_LIBRARY SynchronizeDisplayContextToHardware
    6465    mov     ax, 4C00h           ; Exit to DOS
    6566    int     21h
     67
     68
     69;--------------------------------------------------------------------
     70; InitializeScreenWithBackgroudCharAndAttrInAX
     71;   Parameters:
     72;       AL:     Background character
     73;       AH:     Background attribute
     74;   Returns:
     75;       Nothing
     76;   Corrupts registers:
     77;       AX, DX, DI
     78;--------------------------------------------------------------------
     79ALIGN JUMP_ALIGN
     80InitializeScreenWithBackgroudCharAndAttrInAX:
     81    xchg    dx, ax
     82    CALL_DISPLAY_LIBRARY InitializeDisplayContext   ; Reset cursor etc
     83    xchg    ax, dx
     84    CALL_DISPLAY_LIBRARY ClearScreenWithCharInALandAttrInAH
     85    ret
    6686
    6787
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm

    r65 r68  
    185185ALIGN JUMP_ALIGN
    186186StartFlashing:
     187    call    .MakeSureThatImageFitsInEeprom
     188    jc      SHORT .InvalidFlashingParameters
    187189    push    es
    188190    push    ds
     
    200202    pop     ds
    201203    pop     es
     204.InvalidFlashingParameters:
     205    ret
     206
     207;--------------------------------------------------------------------
     208; .MakeSureThatImageFitsInEeprom
     209;   Parameters:
     210;       SS:BP:  Ptr to MENU
     211;   Returns:
     212;       Nothing
     213;   Corrupts registers:
     214;       AX, BX, DX
     215;--------------------------------------------------------------------
     216ALIGN JUMP_ALIGN
     217.MakeSureThatImageFitsInEeprom:
     218    call    .GetSelectedEepromSizeInWordsToAX
     219    cmp     ax, [cs:g_cfgVars+CFGVARS.wImageSizeInWords]
     220    jae     SHORT .ImageFitsInSelectedEeprom
     221    mov     dx, g_szErrEepromTooSmall
     222    call    Dialogs_DisplayErrorFromCSDX
     223    stc
     224    ret
     225ALIGN JUMP_ALIGN
     226.ImageFitsInSelectedEeprom:
     227    clc
    202228    ret
    203229
     
    270296ALIGN JUMP_ALIGN
    271297.GetNumberOfPagesToFlashToAX:
    272     eMOVZX  bx, BYTE [si+FLASHVARS.bEepromType]
    273     mov     ax, [cs:bx+g_rgwEepromTypeToSizeInWords]
     298    call    .GetSelectedEepromSizeInWordsToAX
    274299    xor     dx, dx
    275300    shl     ax, 1       ; Size in bytes to...
     
    282307    ret
    283308
     309;--------------------------------------------------------------------
     310; .GetSelectedEepromSizeInWordsToAX
     311;   Parameters:
     312;       Nothing
     313;   Returns:
     314;       AX:     Selected EEPROM size in WORDs
     315;   Corrupts registers:
     316;       BX
     317;--------------------------------------------------------------------
     318ALIGN JUMP_ALIGN
     319.GetSelectedEepromSizeInWordsToAX:
     320    eMOVZX  bx, BYTE [cs:g_cfgVars+CFGVARS.bEepromType]
     321    mov     ax, [cs:bx+g_rgwEepromTypeToSizeInWords]
     322    ret
    284323
    285324;--------------------------------------------------------------------
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MainMenu.asm

    r59 r68  
    22; Project name  :   XTIDE Universal BIOS Configurator v2
    33; Created date  :   6.10.2010
    4 ; Last update   :   19.11.2010
     4; Last update   :   9.12.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Main menu structs and functions.
     
    226226LoadXtideUniversalBiosFromRom:
    227227    call    Buffers_SaveChangesIfFileLoaded
    228     call    EEPROM_LoadXtideUniversalBiosFromRomToRamBuffer
     228    call    EEPROM_LoadXtideUniversalBiosFromRomToRamBufferAndReturnSizeInDXCX
    229229    mov     ax, FLG_CFGVARS_ROMLOADED
    230     call    Buffers_NewBiosWithSizeInCXandSourceInAXhasBeenLoadedForConfiguration
    231     push    cs
    232     pop     ds
    233     mov     si, g_szDlgMainLoadROM
    234     CALL_MENU_LIBRARY DisplayMessageWithInputInDSSI
    235     ret
     230    call    Buffers_NewBiosWithSizeInDXCXandSourceInAXhasBeenLoadedForConfiguration
     231    mov     dx, g_szDlgMainLoadROM
     232    jmp     Dialogs_DisplayNotificationFromCSDX
    236233
    237234
     
    241238    call    EEPROM_LoadOldSettingsFromRomToRamBuffer
    242239    and     WORD [g_cfgVars+CFGVARS.wFlags], ~FLG_CFGVARS_UNSAVED
    243     push    cs
    244     pop     ds
    245     mov     si, g_szDlgMainLoadStngs
    246     CALL_MENU_LIBRARY DisplayMessageWithInputInDSSI
    247     ret
     240    mov     dx, g_szDlgMainLoadStngs
     241    jmp     Dialogs_DisplayNotificationFromCSDX
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm

    r65 r68  
    22; Project name  :   XTIDE Universal BIOS Configurator v2
    33; Created date  :   5.10.2010
    4 ; Last update   :   5.12.2010
     4; Last update   :   9.12.2010
    55; Author        :   Tomi Tilli
    66; Description   :   All strings.
     
    4343
    4444; Flashing related strings
     45g_szErrEepromTooSmall:  db  "Image is too large for selected EEPROM type!",NULL
    4546g_szErrEepromPolling:   db  "Timeout when polling EEPROM.",LF
    4647                        db  "EEPROM was not flashed properly!",NULL
     
    102103g_szNfoCfgIdeCnt:       db  "Number of IDE controllers to manage.",NULL
    103104
    104 g_szHelpCfgFullMode:    db  "incbin goes here.",NULL
    105 g_szHelpCfgStealSize:   db  "incbin goes here.",NULL
     105g_szHelpCfgFullMode:    incbin  "Configuration_FullMode.txt"
     106                        db  NULL
     107g_szHelpCfgStealSize:   incbin  "Configuration_StealSize.txt"
     108                        db  NULL
    106109
    107110g_szMultichoiseCfgBootLoader:
     
    140143g_szNfoIdeIRQ:          db  "IRQ channel to use.",NULL
    141144
    142 g_szHelpIdeCmdPort:     db  "incbin goes here.",NULL
    143 g_szHelpIdeCtrlPort:    db  "incbin goes here.",NULL
    144 g_szHelpIdeEnIRQ:       db  "incbin goes here.",NULL
    145 g_szHelpIdeIRQ:         db  "incbin goes here.",NULL
     145g_szHelpIdeCmdPort:     incbin  "IDE_CommandPort.txt"
     146                        db  NULL
     147g_szHelpIdeCtrlPort:    incbin  "IDE_ControlPort.txt"
     148                        db  NULL
     149g_szHelpIdeEnIRQ:       incbin  "IDE_EnableInterrupt.txt"
     150                        db  NULL
     151g_szHelpIdeIRQ:         incbin  "IDE_IRQ.txt"
     152                        db  NULL
    146153
    147154g_szMultichoiseCfgBusType:
     
    177184g_szNfoDrvSect:         db  "Number of user specified P-CHS sectors per track.",NULL
    178185
    179 g_szHelpDrvBlockMode:   db  "incbin goes here.",NULL
    180 g_szHelpDrvUserCHS:     db  "incbin goes here.",NULL
     186g_szHelpDrvBlockMode:   incbin  "Drive_BlockMode.txt"
     187                        db  NULL
     188g_szHelpDrvUserCHS:     incbin  "Drive_UserCHS.txt"
     189                        db  NULL
    181190
    182191
     
    200209g_szNfoBootRomBoot:     db  "Show ROM Basic or ROM DOS boot option.",NULL
    201210
    202 g_szHelpBootTimeout:    db  "incbin goes here.",NULL
    203 g_szHelpBootDrive:      db  "incbin goes here.",NULL
    204 g_szHelpBootFloppyDrvs: db  "incbin goes here.",NULL
    205 g_szHelpBootSwap:       db  "incbin goes here.",NULL
    206 g_szHelpBootRomBoot:    db  "incbin goes here.",NULL
     211g_szHelpBootTimeout:    incbin  "Bootmenu_Timeout.txt"
     212                        db  NULL
     213g_szHelpBootDrive:      incbin  "Bootmenu_DefaultDrive.txt"
     214                        db  NULL
     215g_szHelpBootFloppyDrvs: incbin  "Bootmenu_FloppyDrives.txt"
     216                        db  NULL
     217g_szHelpBootSwap:       incbin  "Bootmenu_SwapDrives.txt"
     218                        db  NULL
     219g_szHelpBootRomBoot:    incbin  "Bootmenu_RomBoot.txt"
     220                        db  NULL
    207221
    208222g_szMultichoiseBootFloppyDrvs:
     
    241255g_szNfoFlashChecksum:   db  "Generate checksum byte to the end of BIOS image.",NULL
    242256
    243 g_szHelpFlashSDP:       db  "incbin goes here.",NULL
    244 g_szHelpFlashPageSize:  db  "incbin goes here.",NULL
    245 g_szHelpFlashChecksum:  db  "incbin goes here.",NULL
     257g_szHelpFlashSDP:       incbin  "Flash_SdpCommand.txt"
     258                        db  NULL
     259g_szHelpFlashPageSize:  incbin  "Flash_PageSize.txt"
     260                        db  NULL
     261g_szHelpFlashChecksum:  incbin  "Flash_Checksum.txt"
     262                        db  NULL
    246263
    247264g_szMultichoiseEepromType:
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/makefile

    r59 r68  
    3535# Subdirectories where included files are:
    3636HEADERS = Inc/
     37HEADERS += Inc/Help/
    3738HEADERS += Src/
    3839HEADERS += Src/Menupages/
Note: See TracChangeset for help on using the changeset viewer.