[57] | 1 | ; Project name : XTIDE Univeral BIOS Configurator v2
|
---|
| 2 | ; Description : Global variables for configuration program.
|
---|
[376] | 3 |
|
---|
| 4 | ;
|
---|
| 5 | ; XTIDE Universal BIOS and Associated Tools
|
---|
| 6 | ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
|
---|
| 7 | ;
|
---|
| 8 | ; This program is free software; you can redistribute it and/or modify
|
---|
| 9 | ; it under the terms of the GNU General Public License as published by
|
---|
| 10 | ; the Free Software Foundation; either version 2 of the License, or
|
---|
| 11 | ; (at your option) any later version.
|
---|
| 12 | ;
|
---|
| 13 | ; This program is distributed in the hope that it will be useful,
|
---|
| 14 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 15 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 16 | ; GNU General Public License for more details.
|
---|
| 17 | ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
---|
| 18 | ;
|
---|
| 19 |
|
---|
[57] | 20 | %ifndef VARIABLES_INC
|
---|
| 21 | %define VARIABLES_INC
|
---|
| 22 |
|
---|
| 23 | ; Equates and defines
|
---|
[290] | 24 | BOOT_MENU_DEFAULT_TIMEOUT EQU (30 * TICKS_PER_SECOND)
|
---|
[109] | 25 | MAX_ALLOWED_IDE_CONTROLLERS EQU 4 ; Maximum number of IDE controllers
|
---|
[153] | 26 | MAX_LITE_MODE_CONTROLLERS EQU 2
|
---|
[57] | 27 | EEPROM_POLLING_TIMEOUT_TICKS EQU 3 ; 1 tick = 54.9 ms
|
---|
| 28 | XTIDE_SIGNATURE_LENGTH EQU 8 ; XTIDE Universal BIOS signature string length
|
---|
[159] | 29 | NUMBER_OF_EEPROM_TYPES EQU 5
|
---|
[68] | 30 | MAX_EEPROM_SIZE_IN_BYTES EQU 65536
|
---|
[57] | 31 |
|
---|
| 32 |
|
---|
| 33 | ; Program global variables
|
---|
| 34 | struc CFGVARS
|
---|
| 35 | .pMenupage resb 2 ; Offset to MENUPAGE to display
|
---|
| 36 | .wFlags resb 2 ; Program flags
|
---|
[65] | 37 | .wImageSizeInWords resb 2 ; Size in words for loaded ROM or FILE
|
---|
[57] | 38 | .wEepromSegment resb 2 ; Segment where EEPROM is located
|
---|
[59] | 39 | .bEepromType resb 1 ; EEPROM type
|
---|
[65] | 40 | .bEepromPage resb 1 ; EEPROM page size (EEPROM_PAGE)
|
---|
[57] | 41 | .bSdpCommand resb 1 ; Command for Software Data Protection
|
---|
[59] | 42 | resb 1
|
---|
[57] | 43 | .szOpenedFile resb FILENAME_BUFFER_SIZE
|
---|
| 44 | endstruc
|
---|
| 45 |
|
---|
| 46 | ; Bit defines for CFGVARS.wFlags
|
---|
| 47 | FLG_CFGVARS_FILELOADED EQU (1<<0) ; BIOS is loaded from file
|
---|
| 48 | FLG_CFGVARS_ROMLOADED EQU (1<<1) ; BIOS is loaded from EEPROM
|
---|
| 49 | FLG_CFGVARS_UNSAVED EQU (1<<2) ; BIOS has unsaved changes
|
---|
| 50 | FLG_CFGVARS_CHECKSUM EQU (1<<3) ; Generate checksum byte
|
---|
| 51 |
|
---|
[59] | 52 | ; EEPROM types
|
---|
| 53 | struc EEPROM_TYPE
|
---|
| 54 | .2816_2kiB resb 2
|
---|
| 55 | .2864_8kiB resb 2
|
---|
[159] | 56 | .2864_8kiB_MOD resb 2 ; Reversed A0 and A3 address lines
|
---|
[59] | 57 | .28256_32kiB resb 2
|
---|
| 58 | .28512_64kiB resb 2
|
---|
| 59 | endstruc
|
---|
[57] | 60 |
|
---|
[59] | 61 | ; Software Data Protection commands
|
---|
| 62 | struc SDP_COMMAND
|
---|
| 63 | .none resb 2 ; Do not use any SDP command
|
---|
| 64 | .enable resb 2 ; Flash with SDP enable command
|
---|
| 65 | .disable resb 2 ; Flash with SDP disable command
|
---|
| 66 | endstruc
|
---|
| 67 |
|
---|
| 68 | ; Page sizes
|
---|
[65] | 69 | struc EEPROM_PAGE
|
---|
[59] | 70 | .1_byte resb 2
|
---|
| 71 | .2_bytes resb 2
|
---|
| 72 | .4_bytes resb 2
|
---|
| 73 | .8_bytes resb 2
|
---|
| 74 | .16_bytes resb 2
|
---|
| 75 | .32_bytes resb 2
|
---|
| 76 | .64_bytes resb 2
|
---|
| 77 | endstruc
|
---|
| 78 |
|
---|
[57] | 79 | ; Default CFGVARS settings
|
---|
| 80 | DEFAULT_CFGVARS_FLAGS EQU FLG_CFGVARS_CHECKSUM
|
---|
| 81 | DEFAULT_EEPROM_SEGMENT EQU 0D000h
|
---|
[63] | 82 | DEFAULT_EEPROM_TYPE EQU EEPROM_TYPE.2864_8kiB
|
---|
[65] | 83 | DEFAULT_PAGE_SIZE EQU EEPROM_PAGE.1_byte
|
---|
[59] | 84 | DEFAULT_SDP_COMMAND EQU SDP_COMMAND.enable
|
---|
[57] | 85 |
|
---|
| 86 |
|
---|
| 87 | ; Variables required for flashing
|
---|
| 88 | struc FLASHVARS
|
---|
[65] | 89 | .fpNextSourcePage resb 4
|
---|
| 90 | .fpNextComparisonPage resb 4
|
---|
| 91 | .fpNextDestinationPage resb 4
|
---|
| 92 | .wPagesToFlash resb 2 ; 0 = 65536
|
---|
| 93 | .wEepromPageSize resb 2 ; 1, 2, 4, 8, 16, 32 or 64
|
---|
| 94 | .bEepromSdpCommand resb 1
|
---|
| 95 | .bEepromType resb 1
|
---|
| 96 |
|
---|
| 97 | .wProgressUpdateParam resb 2
|
---|
| 98 | .wTimeoutCounter resb 2
|
---|
| 99 | .wLastOffsetWritten resb 2
|
---|
| 100 | .bLastByteWritten resb 1
|
---|
| 101 | .flashResult resb 1
|
---|
[57] | 102 | endstruc
|
---|
| 103 |
|
---|
[65] | 104 | ; Flashing results
|
---|
| 105 | struc FLASH_RESULT
|
---|
| 106 | .success resb 2
|
---|
| 107 | .PollingTimeoutError resb 2
|
---|
| 108 | .DataVerifyError resb 2
|
---|
| 109 | endstruc
|
---|
[57] | 110 |
|
---|
[65] | 111 |
|
---|
[57] | 112 | %endif ; VARIABLES_INC
|
---|