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