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