|
| 1 | +import { cdnHost } from '@/utils/cdn.ts' |
| 2 | + |
1 | 3 | export type CoreName =
|
2 | 4 | | 'a5200'
|
3 | 5 | | 'fbalpha2012_cps1'
|
@@ -300,3 +302,24 @@ export const coreOptionsMap: Partial<Record<CoreName, { defaultOption?: string;
|
300 | 302 | ],
|
301 | 303 | vba_next: [{ name: 'vbanext_bios', options: ['On', 'Off'] }],
|
302 | 304 | }
|
| 305 | + |
| 306 | +const vendorsVersionInfo = { |
| 307 | + name: 'retro-assembly-vendors', |
| 308 | + version: '1.17.0-20240225183742', |
| 309 | +} |
| 310 | + |
| 311 | +function getCoreCDNUrl(core: string, ext: string) { |
| 312 | + const { name, version } = vendorsVersionInfo |
| 313 | + const url = new URL('', cdnHost) |
| 314 | + const urlPathSegments = ['npm', `${name}@${version}`, 'dist', 'cores', `${core}_libretro.${ext}`] |
| 315 | + const urlPath = urlPathSegments.join('/') |
| 316 | + url.pathname = urlPath |
| 317 | + return url.href |
| 318 | +} |
| 319 | + |
| 320 | +export const coreUrlMap: Partial<Record<CoreName, { js: string; name: string; wasm: string }>> = { |
| 321 | + a5200: { js: getCoreCDNUrl('a5200', 'js'), name: 'a5200', wasm: getCoreCDNUrl('a5200', 'wasm') }, |
| 322 | + fbneo: { js: getCoreCDNUrl('fbneo', 'js'), name: 'fbneo', wasm: getCoreCDNUrl('fbneo', 'wasm') }, |
| 323 | + prosystem: { js: getCoreCDNUrl('prosystem', 'js'), name: 'prosystem', wasm: getCoreCDNUrl('prosystem', 'wasm') }, |
| 324 | + stella2014: { js: getCoreCDNUrl('stella2014', 'js'), name: 'stella2014', wasm: getCoreCDNUrl('stella2014', 'wasm') }, |
| 325 | +} |
0 commit comments