Skip to content

Commit 952a06e

Browse files
feat: add core options ui
1 parent b432a69 commit 952a06e

File tree

5 files changed

+388
-81
lines changed

5 files changed

+388
-81
lines changed

src/constants/core.ts

+270
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,273 @@ export type CoreName =
3030
| 'stella2014'
3131
| 'tgbdual'
3232
| 'vba_next'
33+
34+
export const coreOptionsMap: Partial<Record<CoreName, { defaultOption?: string; name: string; options: string[] }[]>> =
35+
{
36+
fceumm: [
37+
{
38+
name: 'fceumm_region',
39+
options: ['Auto', 'NTSC', 'PAL', 'Dendy'],
40+
},
41+
{
42+
name: 'fceumm_aspect',
43+
options: ['8:7 PAR', '4:3'],
44+
},
45+
{
46+
name: 'fceumm_palette',
47+
options: [
48+
'default',
49+
'asqrealc',
50+
'nintendo-vc',
51+
'rgb',
52+
'yuv-v3',
53+
'unsaturated-final',
54+
'sony-cxa2025as-us',
55+
'pal',
56+
'bmf-final2',
57+
'bmf-final3',
58+
'smooth-fbx',
59+
'composite-direct-fbx',
60+
'pvm-style-d93-fbx',
61+
'ntsc-hardware-fbx',
62+
'nes-classic-fbx-fs',
63+
'nescap',
64+
'wavebeam',
65+
'raw',
66+
'custom',
67+
],
68+
},
69+
{
70+
name: 'fceumm_turbo_enable',
71+
options: ['Both', 'None', 'Player 1', 'Player 2'],
72+
},
73+
{
74+
name: 'fceumm_turbo_delay',
75+
options: ['2', '3', '5', '10', '15', '30', '60'],
76+
},
77+
{
78+
name: 'fceumm_up_down_allowed',
79+
options: ['disabled', 'enabled'],
80+
},
81+
{
82+
name: 'fceumm_nospritelimit',
83+
options: ['disabled', 'enabled'],
84+
},
85+
{
86+
name: 'fceumm_overclocking',
87+
options: ['disabled', '2x-Postrender', '2x-VBlank'],
88+
},
89+
],
90+
genesis_plus_gx: [
91+
{
92+
name: 'genesis_plus_gx_system_hw',
93+
options: [
94+
'auto',
95+
'sg-1000',
96+
'sg-1000 II',
97+
'sg-1000 II + ram ext.',
98+
'mark-III',
99+
'master system',
100+
'master system II',
101+
'game gear',
102+
'mega drive / genesis',
103+
],
104+
},
105+
{ name: 'genesis_plus_gx_region_detect', options: ['auto', 'ntsc-u', 'pal', 'ntsc-j'] },
106+
{ name: 'genesis_plus_gx_vdp_mode', options: ['auto', '60hz', '50hz'] },
107+
{ name: 'genesis_plus_gx_bios', options: ['disabled', 'enabled'] },
108+
{ name: 'genesis_plus_gx_aspect_ratio', options: ['auto', 'NTSC PAR', 'PAL PAR', '4:3', 'Uncorrected'] },
109+
{ name: 'genesis_plus_gx_overscan', options: ['disabled', 'top/bottom', 'left/right', 'full'] },
110+
],
111+
mgba: [
112+
{
113+
name: 'mgba_solar_sensor_level',
114+
options: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
115+
},
116+
{
117+
name: 'mgba_allow_opposing_directions',
118+
options: ['OFF', 'ON'],
119+
},
120+
{
121+
name: 'mgba_gb_model',
122+
options: ['Autodetect', 'Game Boy', 'Super Game Boy', 'Game Boy Color', 'Game Boy Advance'],
123+
},
124+
{
125+
name: 'mgba_use_bios',
126+
options: ['ON', 'OFF'],
127+
},
128+
{
129+
name: 'mgba_skip_bios',
130+
options: ['OFF', 'ON'],
131+
},
132+
{
133+
name: 'mgba_sgb_borders',
134+
options: ['ON', 'OFF'],
135+
},
136+
{
137+
name: 'mgba_idle_optimization',
138+
options: ['Remove Known', 'Detect and Remove', "Don't Remove"],
139+
},
140+
{
141+
name: 'mgba_frameskip',
142+
options: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
143+
},
144+
],
145+
nestopia: [
146+
{
147+
name: 'nestopia_blargg_ntsc_filter',
148+
options: ['disabled', 'composite', 'svideo', 'rgb', 'monochrome'],
149+
},
150+
{
151+
name: 'nestopia_palette',
152+
options: [
153+
'cxa2025as',
154+
'consumer',
155+
'canonical',
156+
'alternative',
157+
'rgb',
158+
'pal',
159+
'composite-direct-fbx',
160+
'pvm-style-d93-fbx',
161+
'ntsc-hardware-fbx',
162+
'nes-classic-fbx-fs',
163+
'raw',
164+
],
165+
},
166+
{
167+
name: 'nestopia_nospritelimit',
168+
options: ['disabled', 'enabled'],
169+
},
170+
{
171+
name: 'nestopia_overclock',
172+
options: ['1x', '2x'],
173+
},
174+
{
175+
name: 'nestopia_fds_auto_insert',
176+
options: ['enabled', 'disabled'],
177+
},
178+
{
179+
name: 'nestopia_overscan_v',
180+
options: ['enabled', 'disabled'],
181+
},
182+
{
183+
name: 'nestopia_overscan_h',
184+
options: ['disabled', 'enabled'],
185+
},
186+
{
187+
name: 'nestopia_aspect',
188+
options: ['auto', 'ntsc', 'pal', '4:3'],
189+
},
190+
{
191+
name: 'nestopia_favored_system',
192+
options: ['auto', 'ntsc', 'pal', 'famicom', 'dendy'],
193+
},
194+
{
195+
name: 'nestopia_turbo_pulse',
196+
options: ['2', '3', '4', '5', '6', '7', '8', '9'],
197+
},
198+
],
199+
quicknes: [
200+
{ name: 'quicknes_up_down_allowed', options: ['disabled', 'enabled'] },
201+
{ name: 'quicknes_aspect_ratio_par', options: ['PAR', '4:3'] },
202+
{ name: 'quicknes_use_overscan_h', options: ['enabled', 'disabled'] },
203+
{ name: 'quicknes_use_overscan_v', options: ['disabled', 'enabled'] },
204+
{ name: 'quicknes_no_sprite_limit', options: ['enabled', 'disabled'] },
205+
{
206+
name: 'quicknes_palette',
207+
options: [
208+
'default',
209+
'asqrealc',
210+
'nintendo-vc',
211+
'rgb',
212+
'yuv-v3',
213+
'unsaturated-final',
214+
'sony-cxa2025as-us',
215+
'pal',
216+
'bmf-final2',
217+
'bmf-final3',
218+
'smooth-fbx',
219+
'composite-direct-fbx',
220+
'pvm-style-d93-fbx',
221+
'ntsc-hardware-fbx',
222+
'nes-classic-fbx-fs',
223+
'nescap',
224+
'wavebeam',
225+
],
226+
},
227+
],
228+
snes9x: [
229+
{ name: 'snes9x_up_down_allowed', options: ['disabled', 'enabled'] },
230+
{ name: 'snes9x_region', options: ['auto', 'ntsc', 'pal'] },
231+
{
232+
name: 'snes9x_overclock_superfx',
233+
options: [
234+
'50%',
235+
'60%',
236+
'70%',
237+
'80%',
238+
'90%',
239+
'100%',
240+
'150%',
241+
'200%',
242+
'250%',
243+
'300%',
244+
'350%',
245+
'400%',
246+
'450%',
247+
'500%',
248+
],
249+
},
250+
{ name: 'snes9x_overclock_cycles', options: ['disabled', 'light', 'compatible', 'max'] },
251+
{ name: 'snes9x_reduce_sprite_flicker', options: ['disabled', 'enabled'] },
252+
{ name: 'snes9x_blargg', options: ['disabled', 'monochrome', 'rf', 'composite', 's-video', 'rgb'] },
253+
{ name: 'snes9x_overscan', options: ['enabled', 'disabled', 'auto'] },
254+
{ name: 'snes9x_aspect', options: ['4:3', 'uncorrected', 'auto', 'ntsc', 'pal'] },
255+
{ name: 'snes9x_region', options: ['auto', 'ntsc', 'pal'] },
256+
{
257+
defaultOption: '2',
258+
name: 'snes9x_superscope_crosshair',
259+
options: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16'],
260+
},
261+
{
262+
name: 'snes9x_superscope_color',
263+
options: [
264+
'White',
265+
'White (blend)',
266+
'Red',
267+
'Red (blend)',
268+
'Orange',
269+
'Orange (blend)',
270+
'Yellow',
271+
'Yellow (blend)',
272+
'Green',
273+
'Green (blend)',
274+
'Cyan',
275+
'Cyan (blend)',
276+
'Sky',
277+
'Sky (blend)',
278+
'Blue',
279+
'Blue (blend)',
280+
'Violet',
281+
'Violet (blend)',
282+
'Pink',
283+
'Pink (blend)',
284+
'Purple',
285+
'Purple (blend)',
286+
'Black',
287+
'Black (blend)',
288+
'25% Grey',
289+
'25% Grey (blend)',
290+
'50% Grey',
291+
'50% Grey (blend)',
292+
'75% Grey',
293+
'75% Grey (blend)',
294+
],
295+
},
296+
{
297+
name: 'snes9x_block_invalid_vram_access',
298+
options: ['enabled', 'disabled'],
299+
},
300+
],
301+
vba_next: [{ name: 'vbanext_bios', options: ['On', 'Off'] }],
302+
}

src/constants/preference.ts

+29-35
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,10 @@ export interface Preference {
99
core: Partial<Record<CoreName, Record<string, string>>>
1010
platform: Record<PlatformName, { core: CoreName; shader?: string }>
1111
}
12-
ui: {
13-
libraryCoverType: 'boxart'
14-
platformInfoDisplayType: 0
15-
platforms: PlatformName[]
16-
theme: 'rose'
17-
}
18-
user: unknown
12+
libraryCoverType: 'boxart'
13+
platformInfoDisplayType: 0
14+
platforms: PlatformName[]
15+
theme: 'rose'
1916
}
2017

2118
export const defaultPreference: Preference = {
@@ -53,32 +50,29 @@ export const defaultPreference: Preference = {
5350
wonderswancolor: { core: 'mednafen_wswan' },
5451
},
5552
},
56-
ui: {
57-
libraryCoverType: 'boxart',
58-
platformInfoDisplayType: 0,
59-
platforms: [
60-
'arcade',
61-
'atari2600',
62-
'gb',
63-
'gba',
64-
'gbc',
65-
'megadrive',
66-
'nes',
67-
'snes',
68-
'vb',
69-
'wonderswan',
70-
'wonderswancolor',
71-
'sms',
72-
'ngp',
73-
'ngpc',
74-
'gamegear',
75-
'atari5200',
76-
'atari7800',
77-
'atarilynx',
78-
'sega32x',
79-
'sg-1000',
80-
],
81-
theme: 'rose',
82-
},
83-
user: {},
53+
libraryCoverType: 'boxart',
54+
platformInfoDisplayType: 0,
55+
platforms: [
56+
'arcade',
57+
'atari2600',
58+
'gb',
59+
'gba',
60+
'gbc',
61+
'megadrive',
62+
'nes',
63+
'snes',
64+
'vb',
65+
'wonderswan',
66+
'wonderswancolor',
67+
'sms',
68+
'ngp',
69+
'ngpc',
70+
'gamegear',
71+
'atari5200',
72+
'atari7800',
73+
'atarilynx',
74+
'sega32x',
75+
'sg-1000',
76+
],
77+
theme: 'rose',
8478
}

0 commit comments

Comments
 (0)