[57] | 1 | ; Project name : XTIDE Univeral BIOS Configurator v2
|
---|
| 2 | ; Description : Global variables for configuration program.
|
---|
| 3 | %ifndef VARIABLES_INC
|
---|
| 4 | %define VARIABLES_INC
|
---|
| 5 |
|
---|
| 6 | ; Equates and defines
|
---|
[290] | 7 | BOOT_MENU_DEFAULT_TIMEOUT EQU (30 * TICKS_PER_SECOND)
|
---|
[109] | 8 | MAX_ALLOWED_IDE_CONTROLLERS EQU 4 ; Maximum number of IDE controllers
|
---|
[153] | 9 | MAX_LITE_MODE_CONTROLLERS EQU 2
|
---|
[57] | 10 | EEPROM_POLLING_TIMEOUT_TICKS EQU 3 ; 1 tick = 54.9 ms
|
---|
| 11 | XTIDE_SIGNATURE_LENGTH EQU 8 ; XTIDE Universal BIOS signature string length
|
---|
[159] | 12 | NUMBER_OF_EEPROM_TYPES EQU 5
|
---|
[68] | 13 | MAX_EEPROM_SIZE_IN_BYTES EQU 65536
|
---|
[57] | 14 |
|
---|
| 15 |
|
---|
| 16 | ; Program global variables
|
---|
| 17 | struc CFGVARS
|
---|
| 18 | .pMenupage resb 2 ; Offset to MENUPAGE to display
|
---|
| 19 | .wFlags resb 2 ; Program flags
|
---|
[65] | 20 | .wImageSizeInWords resb 2 ; Size in words for loaded ROM or FILE
|
---|
[57] | 21 | .wEepromSegment resb 2 ; Segment where EEPROM is located
|
---|
[59] | 22 | .bEepromType resb 1 ; EEPROM type
|
---|
[65] | 23 | .bEepromPage resb 1 ; EEPROM page size (EEPROM_PAGE)
|
---|
[57] | 24 | .bSdpCommand resb 1 ; Command for Software Data Protection
|
---|
[59] | 25 | resb 1
|
---|
[57] | 26 | .szOpenedFile resb FILENAME_BUFFER_SIZE
|
---|
| 27 | endstruc
|
---|
| 28 |
|
---|
| 29 | ; Bit defines for CFGVARS.wFlags
|
---|
| 30 | FLG_CFGVARS_FILELOADED EQU (1<<0) ; BIOS is loaded from file
|
---|
| 31 | FLG_CFGVARS_ROMLOADED EQU (1<<1) ; BIOS is loaded from EEPROM
|
---|
| 32 | FLG_CFGVARS_UNSAVED EQU (1<<2) ; BIOS has unsaved changes
|
---|
| 33 | FLG_CFGVARS_CHECKSUM EQU (1<<3) ; Generate checksum byte
|
---|
| 34 |
|
---|
[59] | 35 | ; EEPROM types
|
---|
| 36 | struc EEPROM_TYPE
|
---|
| 37 | .2816_2kiB resb 2
|
---|
| 38 | .2864_8kiB resb 2
|
---|
[159] | 39 | .2864_8kiB_MOD resb 2 ; Reversed A0 and A3 address lines
|
---|
[59] | 40 | .28256_32kiB resb 2
|
---|
| 41 | .28512_64kiB resb 2
|
---|
| 42 | endstruc
|
---|
[57] | 43 |
|
---|
[59] | 44 | ; Software Data Protection commands
|
---|
| 45 | struc SDP_COMMAND
|
---|
| 46 | .none resb 2 ; Do not use any SDP command
|
---|
| 47 | .enable resb 2 ; Flash with SDP enable command
|
---|
| 48 | .disable resb 2 ; Flash with SDP disable command
|
---|
| 49 | endstruc
|
---|
| 50 |
|
---|
| 51 | ; Page sizes
|
---|
[65] | 52 | struc EEPROM_PAGE
|
---|
[59] | 53 | .1_byte resb 2
|
---|
| 54 | .2_bytes resb 2
|
---|
| 55 | .4_bytes resb 2
|
---|
| 56 | .8_bytes resb 2
|
---|
| 57 | .16_bytes resb 2
|
---|
| 58 | .32_bytes resb 2
|
---|
| 59 | .64_bytes resb 2
|
---|
| 60 | endstruc
|
---|
| 61 |
|
---|
[57] | 62 | ; Default CFGVARS settings
|
---|
| 63 | DEFAULT_CFGVARS_FLAGS EQU FLG_CFGVARS_CHECKSUM
|
---|
| 64 | DEFAULT_EEPROM_SEGMENT EQU 0D000h
|
---|
[63] | 65 | DEFAULT_EEPROM_TYPE EQU EEPROM_TYPE.2864_8kiB
|
---|
[65] | 66 | DEFAULT_PAGE_SIZE EQU EEPROM_PAGE.1_byte
|
---|
[59] | 67 | DEFAULT_SDP_COMMAND EQU SDP_COMMAND.enable
|
---|
[57] | 68 |
|
---|
| 69 |
|
---|
| 70 | ; Variables required for flashing
|
---|
| 71 | struc FLASHVARS
|
---|
[65] | 72 | .fpNextSourcePage resb 4
|
---|
| 73 | .fpNextComparisonPage resb 4
|
---|
| 74 | .fpNextDestinationPage resb 4
|
---|
| 75 | .wPagesToFlash resb 2 ; 0 = 65536
|
---|
| 76 | .wEepromPageSize resb 2 ; 1, 2, 4, 8, 16, 32 or 64
|
---|
| 77 | .bEepromSdpCommand resb 1
|
---|
| 78 | .bEepromType resb 1
|
---|
| 79 |
|
---|
| 80 | .wProgressUpdateParam resb 2
|
---|
| 81 | .wTimeoutCounter resb 2
|
---|
| 82 | .wLastOffsetWritten resb 2
|
---|
| 83 | .bLastByteWritten resb 1
|
---|
| 84 | .flashResult resb 1
|
---|
[57] | 85 | endstruc
|
---|
| 86 |
|
---|
[65] | 87 | ; Flashing results
|
---|
| 88 | struc FLASH_RESULT
|
---|
| 89 | .success resb 2
|
---|
| 90 | .PollingTimeoutError resb 2
|
---|
| 91 | .DataVerifyError resb 2
|
---|
| 92 | endstruc
|
---|
[57] | 93 |
|
---|
[65] | 94 |
|
---|
[57] | 95 | %endif ; VARIABLES_INC
|
---|