-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcore-constants.js
More file actions
182 lines (170 loc) · 3.17 KB
/
core-constants.js
File metadata and controls
182 lines (170 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
// ============================================================================
// CORE CONSTANTS AND CONFIGURATION
// ============================================================================
export const prefixArray = ['M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T'];
export const sizePrefixMap = {
M: 'Bit0',
N: 'Bit1',
O: 'Bit2',
P: 'Bit3',
Q: 'Bit4',
R: 'Bit5',
S: 'Bit6',
T: 'Bit7',
L: 'Lower4',
U: 'Upper4',
H: '8-bit',
W: '24-bit',
X: '32-bit',
I: '16-bit BE',
J: '24-bit BE',
G: '32-bit BE',
K: 'BitCount',
fF: 'Float',
fB: 'Float BE',
fH: 'Double32',
fI: 'Double32 BE',
fM: 'MBF32',
fL: 'MBF32 LE',
'': '16-bit',
};
export const sizePrefixOrder = [
'fF',
'fB',
'fH',
'fI',
'fM',
'fL',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'L',
'U',
'H',
'W',
'X',
'I',
'J',
'G',
'K',
];
export const sizeMapForText = {
Bit0: 'M',
Bit1: 'N',
Bit2: 'O',
Bit3: 'P',
Bit4: 'Q',
Bit5: 'R',
Bit6: 'S',
Bit7: 'T',
Lower4: 'L',
Upper4: 'U',
'8-bit': 'H',
'16-bit': '',
'24-bit': 'W',
'32-bit': 'X',
'16-bit BE': 'I',
'24-bit BE': 'J',
'32-bit BE': 'G',
BitCount: 'K',
Float: 'fF',
'Float BE': 'fB',
Double32: 'fH',
'Double32 BE': 'fI',
MBF32: 'fM',
'MBF32 LE': 'fL',
};
// Size options for different types
export const SIZE_OPTIONS = {
BCD: ['8-bit', '16-bit', '32-bit', '16-bit BE', '32-bit BE'],
Float: ['32-bit', '32-bit BE'],
Mem: [
'8-bit',
'Bit0',
'Bit1',
'Bit2',
'Bit3',
'Bit4',
'Bit5',
'Bit6',
'Bit7',
'Lower4',
'Upper4',
'16-bit',
'24-bit',
'32-bit',
'16-bit BE',
'24-bit BE',
'32-bit BE',
'BitCount',
'Float',
'Float BE',
'Double32',
'Double32 BE',
'MBF32',
'MBF32 LE',
],
};
// Type options for different flags
export const TYPE_OPTIONS = {
AddAddress: ['Mem', 'Prior', 'Value', 'Recall'],
All: ['Mem', 'Value', 'Delta', 'Prior', 'BCD', 'Float', 'Invert', 'Recall'],
};
// Memory types that need hex normalization
export const MEMORY_TYPES = [
'Mem',
'Delta',
'Prior',
'Invert',
'BCD',
'Float',
];
// Types that need size selection
export const SIZE_NEEDED_TYPES = [
'Mem',
'Delta',
'Prior',
'Invert',
'BCD',
'Float',
];
// Bit types
export const BIT_TYPES = [
'Bit0',
'Bit1',
'Bit2',
'Bit3',
'Bit4',
'Bit5',
'Bit6',
'Bit7',
'BitCount',
];
// 4-bit types
export const FOUR_BIT_TYPES = ['Lower4', 'Upper4'];
// Operand flags
export const OPERAND_FLAGS = ['A:', 'B:', 'I:', 'K:'];
// Flag definitions
export const FLAG_OPTIONS = [
{ value: '', label: '' },
{ value: 'P:', label: 'Pause If' },
{ value: 'R:', label: 'Reset If' },
{ value: 'Z:', label: 'Reset Next If' },
{ value: 'A:', label: 'Add Source' },
{ value: 'B:', label: 'Sub Source' },
{ value: 'C:', label: 'Add Hits' },
{ value: 'D:', label: 'Sub Hits' },
{ value: 'I:', label: 'Add Address' },
{ value: 'N:', label: 'And Next' },
{ value: 'O:', label: 'Or Next' },
{ value: 'M:', label: 'Measured' },
{ value: 'G:', label: 'Measured %' },
{ value: 'Q:', label: 'Measured If' },
{ value: 'T:', label: 'Trigger' },
{ value: 'K:', label: 'Remember' },
];