1 | ; Project name : XTIDE Universal BIOS Configurator v2
|
---|
2 | ; Description : Menu page and item structs.
|
---|
3 | %ifndef MENU_STRUCTS_INC
|
---|
4 | %define MENU_STRUCTS_INC
|
---|
5 |
|
---|
6 | struc MENUPAGE
|
---|
7 | .fnEnter resb 2 ; Function to initialize MENUPAGE
|
---|
8 | .fnBack resb 2 ; Function to initialize previous MENUPAGE
|
---|
9 | .wMenuitems resb 2 ; Number of MENUITEM structs
|
---|
10 | .rgMenuitem: ; All MENUITEM structs in this MENUPAGE
|
---|
11 | endstruc
|
---|
12 |
|
---|
13 | struc MENUITEM
|
---|
14 | .fnActivate resb 2 ; Offset to item activation function
|
---|
15 | .fnFormatValue resb 2 ; Offset to item value formatting function
|
---|
16 |
|
---|
17 | .szName resb 2 ; Offset to item name string
|
---|
18 | .szQuickInfo resb 2 ; Offset to item quick information string
|
---|
19 | .szHelp resb 2 ; Offset to item help string
|
---|
20 |
|
---|
21 | .bFlags resb 1 ; Item flags
|
---|
22 | .bType resb 1 ; Item type
|
---|
23 | .itemValue resb ITEM_VALUE_size ; ITEM_VALUE for automated item handling
|
---|
24 | endstruc
|
---|
25 |
|
---|
26 | ; Bit defines for MENUITEM.bFlags
|
---|
27 | FLG_MENUITEM_VISIBLE EQU (1<<0) ; Item is visible
|
---|
28 | FLG_MENUITEM_MODIFY_MENU EQU (1<<1) ; Item modifies visibility of other items
|
---|
29 | FLG_MENUITEM_FLAGVALUE EQU (1<<2) ; Item value is single bit
|
---|
30 | FLG_MENUITEM_BYTEVALUE EQU (1<<3) ; Item value is single byte
|
---|
31 | FLG_MENUITEM_PROGRAMVAR EQU (1<<4) ; Item is for configuring program, not BIOS
|
---|
32 | FLG_MENUITEM_CHOICESTRINGS EQU (1<<5) ; ChoiceToStringLookup table is 1-1 with ChoiceToValueLookup table,
|
---|
33 | ; ChoiceToStringLookup table must also be NULL terminated
|
---|
34 | FLG_MENUITEM_MASKVALUE EQU (1<<6) ; Item value is more than one bit among other bits
|
---|
35 |
|
---|
36 |
|
---|
37 | ; Values for MENUITEM.bType
|
---|
38 | TYPE_MENUITEM_PAGEBACK EQU (0<<1) ; Item returns to previous MENUPAGE
|
---|
39 | TYPE_MENUITEM_PAGENEXT EQU (1<<1) ; Item changes to next MENUPAGE
|
---|
40 | TYPE_MENUITEM_ACTION EQU (2<<1) ; Non-configurable item
|
---|
41 | TYPE_MENUITEM_MULTICHOICE EQU (3<<1) ; Item with multiple predefined choices
|
---|
42 | TYPE_MENUITEM_UNSIGNED EQU (4<<1) ; Menuitem with user inputted unsigned decimal value
|
---|
43 | TYPE_MENUITEM_HEX EQU (5<<1) ; Menuitem with user inputted hexadecimal value
|
---|
44 |
|
---|
45 |
|
---|
46 | struc ITEM_VALUE
|
---|
47 | .wRomvarsValueOffset resb 2 ; ROMVARS offset to actual value to be configured
|
---|
48 | .szDialogTitle resb 2 ; Dialog title string
|
---|
49 |
|
---|
50 | .szMultichoice resb 2 ; Multiple choices in one string
|
---|
51 | .rgwChoiceToValueLookup resb 2 ; Ptr to lookup table for translating selected choice to actual value
|
---|
52 | .rgszValueToStringLookup: ; Ptr to lookup table for translating value to string
|
---|
53 | .rgszChoiceToStringLookup:
|
---|
54 | .wMinValue resb 2 ; Minimum allowed integer value
|
---|
55 | .wMaxValue:
|
---|
56 | .wValueBitmask resb 2 ; Bitmask for item value flag
|
---|
57 | .fnValueReader resb 2 ; Called just after ROMVARS is read, providing a hook for further action
|
---|
58 | .fnValueWriter resb 2 ; Called just before ROMVARS is written, providing a hook for further action
|
---|
59 | endstruc
|
---|
60 |
|
---|
61 |
|
---|
62 | %endif ; MENU_STRUCTS_INC
|
---|