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