Changeset 68 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS_Configurator_v2/Src
- Timestamp:
- Dec 9, 2010, 6:36:00 PM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/BiosFile.asm
r65 r68 2 2 ; Project name : XTIDE Univeral BIOS Configurator v2 3 3 ; Created date : 10.10.2010 4 ; Last update : 30.11.20104 ; Last update : 6.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Functions for loading and saving BIOS image file. … … 23 23 push ds 24 24 25 call .OpenFileForLoadingFromDSSIandGetSizeTo CX26 jc SHORT .DisplayErrorMessage 27 call .LoadFileWithNameInDSSIhandleInBXandSizeIn CXtoRamBuffer25 call .OpenFileForLoadingFromDSSIandGetSizeToDXCX 26 jc SHORT .DisplayErrorMessage 27 call .LoadFileWithNameInDSSIhandleInBXandSizeInDXCXtoRamBuffer 28 28 jc SHORT .DisplayErrorMessage 29 29 30 30 mov ax, FLG_CFGVARS_FILELOADED 31 call Buffers_NewBiosWithSizeIn CXandSourceInAXhasBeenLoadedForConfiguration31 call Buffers_NewBiosWithSizeInDXCXandSourceInAXhasBeenLoadedForConfiguration 32 32 call DisplayFileLoadedSuccesfully 33 33 call FileIO_CloseUsingHandleFromBX … … 43 43 44 44 ;-------------------------------------------------------------------- 45 ; .OpenFileForLoadingFromDSSIandGetSize ToCX45 ; .OpenFileForLoadingFromDSSIandGetSizeInBytesToDXCX 46 46 ; Parameters: 47 47 ; DS:SI: Name of file to open 48 48 ; Returns: 49 49 ; BX: File handle (if succesfull) 50 ; CX:File size (if succesfull)50 ; DX:CX: File size (if succesfull) 51 51 ; CF: Clear if successfull 52 52 ; Set if error 53 53 ; Corrupts registers: 54 ; AX , DX55 ;-------------------------------------------------------------------- 56 ALIGN JUMP_ALIGN 57 .OpenFileForLoadingFromDSSIandGetSizeTo CX:54 ; AX 55 ;-------------------------------------------------------------------- 56 ALIGN JUMP_ALIGN 57 .OpenFileForLoadingFromDSSIandGetSizeToDXCX: 58 58 mov al, FILE_ACCESS.ReadOnly 59 59 call FileIO_OpenWithPathInDSSIandFileAccessInAL … … 62 62 jc SHORT .FileError 63 63 64 cmp dx, BYTE 1 ; File size over 65536 bytes?64 cmp dx, MAX_EEPROM_SIZE_IN_BYTES >> 16 65 65 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: 71 70 xchg cx, ax 72 71 clc … … 79 78 80 79 ;-------------------------------------------------------------------- 81 ; .LoadFileWithNameInDSSIhandleInBXandSizeIn CXtoRamBuffer80 ; .LoadFileWithNameInDSSIhandleInBXandSizeInDXCXtoRamBuffer 82 81 ; Parameters: 83 82 ; BX: File Handle 84 ; CX:File size83 ; DX:CX: File size 85 84 ; DS:SI: File name 86 85 ; Returns: … … 91 90 ;-------------------------------------------------------------------- 92 91 ALIGN JUMP_ALIGN 93 .LoadFileWithNameInDSSIhandleInBXandSizeIn CXtoRamBuffer:92 .LoadFileWithNameInDSSIhandleInBXandSizeInDXCXtoRamBuffer: 94 93 push es 95 94 96 95 call Buffers_GetFileBufferToESDI 97 96 call Registers_ExchangeDSSIwithESDI 98 call FileIO_Read CXbytesToDSSIusingHandleFromBX97 call FileIO_ReadDXCXbytesToDSSIusingHandleFromBX 99 98 jnc SHORT .StoreFileNameToCfgvarsFromESDI 100 99 … … 163 162 call Buffers_GetFileBufferToESDI 164 163 call Registers_CopyESDItoDSSI 164 xor dx, dx 165 165 mov cx, [cs:g_cfgVars+CFGVARS.wImageSizeInWords] 166 166 shl cx, 1 167 call FileIO_WriteCXbytesFromDSSIusingHandleFromBX 167 rcl dx, 1 ; WORDs to BYTEs 168 call FileIO_WriteDXCXbytesFromDSSIusingHandleFromBX 168 169 jc SHORT .DisplayErrorMessage 169 170 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm
r65 r68 2 2 ; Project name : XTIDE Universal BIOS Configurator v2 3 3 ; Created date : 6.10.2010 4 ; Last update : 5.12.20104 ; Last update : 6.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Functions for accessing file and flash buffers. … … 41 41 42 42 call Buffers_GetFileBufferToESDI 43 call Buffers_IsXtideUniversalBiosSignatureInESDI 44 jnz SHORT .NoFileOrBiosLoaded 45 jmp SHORT .IsSupportedVersionOfXtideUniversalBiosLoaded 43 jmp SHORT Buffers_IsXtideUniversalBiosSignatureInESDI 46 44 .NoFileOrBiosLoaded: 47 45 or cl, 1 ; Clear ZF 48 46 ret 49 47 50 51 ALIGN JUMP_ALIGN52 .IsSupportedVersionOfXtideUniversalBiosLoaded:53 54 48 55 49 ;-------------------------------------------------------------------- … … 81 75 ; Parameters: 82 76 ; AX: EEPROM source (FLG_CFGVARS_FILELOADED or FLG_CFGVARS_ROMLOADED) 83 ; CX:EEPROM size in bytes84 ; Returns: 85 ; Nothing 86 ; Corrupts registers: 87 ; AX, CX 88 ;-------------------------------------------------------------------- 89 ALIGN JUMP_ALIGN 90 Buffers_NewBiosWithSizeIn CXandSourceInAXhasBeenLoadedForConfiguration:77 ; DX:CX: EEPROM size in bytes 78 ; Returns: 79 ; Nothing 80 ; Corrupts registers: 81 ; AX, CX, DX 82 ;-------------------------------------------------------------------- 83 ALIGN JUMP_ALIGN 84 Buffers_NewBiosWithSizeInDXCXandSourceInAXhasBeenLoadedForConfiguration: 91 85 and WORD [cs:g_cfgVars+CFGVARS.wFlags], ~(FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED | FLG_CFGVARS_UNSAVED) 92 86 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 96 89 mov [cs:g_cfgVars+CFGVARS.wImageSizeInWords], cx 97 90 ret -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm
r65 r68 2 2 ; Project name : XTIDE Univeral BIOS Configurator v2 3 3 ; Created date : 19.4.2010 4 ; Last update : 3.12.20104 ; Last update : 9.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Functions for managing EEPROM contents. … … 31 31 32 32 ;-------------------------------------------------------------------- 33 ; EEPROM_LoadXtideUniversalBiosFromRomToRamBuffer 33 ; EEPROM_LoadXtideUniversalBiosFromRomToRamBufferAndReturnSizeInDXCX 34 34 ; Parameters: 35 35 ; Nothing 36 36 ; Returns: 37 ; CX:BIOS size in bytes37 ; DX:CX: BIOS size in bytes 38 38 ; Corrupts registers: 39 39 ; AX, BX, SI, DI 40 40 ;-------------------------------------------------------------------- 41 41 ALIGN JUMP_ALIGN 42 EEPROM_LoadXtideUniversalBiosFromRomToRamBuffer :42 EEPROM_LoadXtideUniversalBiosFromRomToRamBufferAndReturnSizeInDXCX: 43 43 push es 44 44 45 45 call EEPROM_FindXtideUniversalBiosROMtoESDI 46 call .GetXtideUniversalBiosSizeFromESto CX46 call .GetXtideUniversalBiosSizeFromEStoDXCX 47 47 xor si, si ; Load from beginning of ROM 48 48 call LoadBytesFromRomToRamBuffer 49 49 50 call .GetXtideUniversalBiosSizeFromESto CX50 call .GetXtideUniversalBiosSizeFromEStoDXCX 51 51 pop es 52 52 ret 53 53 54 54 ;-------------------------------------------------------------------- 55 ; .GetXtideUniversalBiosSizeFromESto CX55 ; .GetXtideUniversalBiosSizeFromEStoDXCX 56 56 ; Parameters: 57 57 ; Nothing 58 58 ; Returns: 59 ; AX:Bios size in bytes59 ; DX:CX: Bios size in bytes 60 60 ; Corrupts registers: 61 ; AX, BX61 ; Nothing 62 62 ;-------------------------------------------------------------------- 63 63 ALIGN JUMP_ALIGN 64 .GetXtideUniversalBiosSizeFromEStoCX: 64 .GetXtideUniversalBiosSizeFromEStoDXCX: 65 xor dx, dx 65 66 eMOVZX cx, BYTE [es:ROMVARS.bRomSize] 66 67 eSHL_IM cx, 9 ; *= 512 for byte count -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Main.asm
r65 r68 2 2 ; Project name : XTIDE Univeral BIOS Configurator v2 3 3 ; Created date : 5.10.2010 4 ; Last update : 3.12.20104 ; Last update : 7.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Program start and exit. … … 54 54 ALIGN JUMP_ALIGN 55 55 Main_Start: 56 CALL_DISPLAY_LIBRARY InitializeDisplayContext57 CALL_DISPLAY_LIBRARY ClearScreen56 mov ax, SCREEN_BACKGROUND_CHARACTER_AND_ATTRIBUTE 57 call InitializeScreenWithBackgroudCharAndAttrInAX 58 58 59 59 call Main_InitializeCfgVars 60 60 call MenuEvents_DisplayMenu 61 mov ax, DOS_BACKGROUND_CHARACTER_AND_ATTRIBUTE 62 call InitializeScreenWithBackgroudCharAndAttrInAX 61 63 62 64 ; Exit to DOS 63 CALL_DISPLAY_LIBRARY SynchronizeDisplayContextToHardware64 65 mov ax, 4C00h ; Exit to DOS 65 66 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 ;-------------------------------------------------------------------- 79 ALIGN JUMP_ALIGN 80 InitializeScreenWithBackgroudCharAndAttrInAX: 81 xchg dx, ax 82 CALL_DISPLAY_LIBRARY InitializeDisplayContext ; Reset cursor etc 83 xchg ax, dx 84 CALL_DISPLAY_LIBRARY ClearScreenWithCharInALandAttrInAH 85 ret 66 86 67 87 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm
r65 r68 185 185 ALIGN JUMP_ALIGN 186 186 StartFlashing: 187 call .MakeSureThatImageFitsInEeprom 188 jc SHORT .InvalidFlashingParameters 187 189 push es 188 190 push ds … … 200 202 pop ds 201 203 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 ;-------------------------------------------------------------------- 216 ALIGN 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 225 ALIGN JUMP_ALIGN 226 .ImageFitsInSelectedEeprom: 227 clc 202 228 ret 203 229 … … 270 296 ALIGN JUMP_ALIGN 271 297 .GetNumberOfPagesToFlashToAX: 272 eMOVZX bx, BYTE [si+FLASHVARS.bEepromType] 273 mov ax, [cs:bx+g_rgwEepromTypeToSizeInWords] 298 call .GetSelectedEepromSizeInWordsToAX 274 299 xor dx, dx 275 300 shl ax, 1 ; Size in bytes to... … … 282 307 ret 283 308 309 ;-------------------------------------------------------------------- 310 ; .GetSelectedEepromSizeInWordsToAX 311 ; Parameters: 312 ; Nothing 313 ; Returns: 314 ; AX: Selected EEPROM size in WORDs 315 ; Corrupts registers: 316 ; BX 317 ;-------------------------------------------------------------------- 318 ALIGN JUMP_ALIGN 319 .GetSelectedEepromSizeInWordsToAX: 320 eMOVZX bx, BYTE [cs:g_cfgVars+CFGVARS.bEepromType] 321 mov ax, [cs:bx+g_rgwEepromTypeToSizeInWords] 322 ret 284 323 285 324 ;-------------------------------------------------------------------- -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MainMenu.asm
r59 r68 2 2 ; Project name : XTIDE Universal BIOS Configurator v2 3 3 ; Created date : 6.10.2010 4 ; Last update : 19.11.20104 ; Last update : 9.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Main menu structs and functions. … … 226 226 LoadXtideUniversalBiosFromRom: 227 227 call Buffers_SaveChangesIfFileLoaded 228 call EEPROM_LoadXtideUniversalBiosFromRomToRamBuffer 228 call EEPROM_LoadXtideUniversalBiosFromRomToRamBufferAndReturnSizeInDXCX 229 229 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 236 233 237 234 … … 241 238 call EEPROM_LoadOldSettingsFromRomToRamBuffer 242 239 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 2 2 ; Project name : XTIDE Universal BIOS Configurator v2 3 3 ; Created date : 5.10.2010 4 ; Last update : 5.12.20104 ; Last update : 9.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : All strings. … … 43 43 44 44 ; Flashing related strings 45 g_szErrEepromTooSmall: db "Image is too large for selected EEPROM type!",NULL 45 46 g_szErrEepromPolling: db "Timeout when polling EEPROM.",LF 46 47 db "EEPROM was not flashed properly!",NULL … … 102 103 g_szNfoCfgIdeCnt: db "Number of IDE controllers to manage.",NULL 103 104 104 g_szHelpCfgFullMode: db "incbin goes here.",NULL 105 g_szHelpCfgStealSize: db "incbin goes here.",NULL 105 g_szHelpCfgFullMode: incbin "Configuration_FullMode.txt" 106 db NULL 107 g_szHelpCfgStealSize: incbin "Configuration_StealSize.txt" 108 db NULL 106 109 107 110 g_szMultichoiseCfgBootLoader: … … 140 143 g_szNfoIdeIRQ: db "IRQ channel to use.",NULL 141 144 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 145 g_szHelpIdeCmdPort: incbin "IDE_CommandPort.txt" 146 db NULL 147 g_szHelpIdeCtrlPort: incbin "IDE_ControlPort.txt" 148 db NULL 149 g_szHelpIdeEnIRQ: incbin "IDE_EnableInterrupt.txt" 150 db NULL 151 g_szHelpIdeIRQ: incbin "IDE_IRQ.txt" 152 db NULL 146 153 147 154 g_szMultichoiseCfgBusType: … … 177 184 g_szNfoDrvSect: db "Number of user specified P-CHS sectors per track.",NULL 178 185 179 g_szHelpDrvBlockMode: db "incbin goes here.",NULL 180 g_szHelpDrvUserCHS: db "incbin goes here.",NULL 186 g_szHelpDrvBlockMode: incbin "Drive_BlockMode.txt" 187 db NULL 188 g_szHelpDrvUserCHS: incbin "Drive_UserCHS.txt" 189 db NULL 181 190 182 191 … … 200 209 g_szNfoBootRomBoot: db "Show ROM Basic or ROM DOS boot option.",NULL 201 210 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 211 g_szHelpBootTimeout: incbin "Bootmenu_Timeout.txt" 212 db NULL 213 g_szHelpBootDrive: incbin "Bootmenu_DefaultDrive.txt" 214 db NULL 215 g_szHelpBootFloppyDrvs: incbin "Bootmenu_FloppyDrives.txt" 216 db NULL 217 g_szHelpBootSwap: incbin "Bootmenu_SwapDrives.txt" 218 db NULL 219 g_szHelpBootRomBoot: incbin "Bootmenu_RomBoot.txt" 220 db NULL 207 221 208 222 g_szMultichoiseBootFloppyDrvs: … … 241 255 g_szNfoFlashChecksum: db "Generate checksum byte to the end of BIOS image.",NULL 242 256 243 g_szHelpFlashSDP: db "incbin goes here.",NULL 244 g_szHelpFlashPageSize: db "incbin goes here.",NULL 245 g_szHelpFlashChecksum: db "incbin goes here.",NULL 257 g_szHelpFlashSDP: incbin "Flash_SdpCommand.txt" 258 db NULL 259 g_szHelpFlashPageSize: incbin "Flash_PageSize.txt" 260 db NULL 261 g_szHelpFlashChecksum: incbin "Flash_Checksum.txt" 262 db NULL 246 263 247 264 g_szMultichoiseEepromType:
Note:
See TracChangeset
for help on using the changeset viewer.