Skip to content

Commit

Permalink
chore: update lint config
Browse files Browse the repository at this point in the history
  • Loading branch information
arianrhodsandlot committed May 3, 2024
1 parent 06c8504 commit 522b566
Show file tree
Hide file tree
Showing 16 changed files with 971 additions and 974 deletions.
6 changes: 1 addition & 5 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
import { createConfig } from '@arianrhodsandlot/eslint-config'

export default createConfig({
perfectionist: false,
})
export { default } from '@arianrhodsandlot/eslint-config'
34 changes: 17 additions & 17 deletions src/constants/core-info.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
interface CoreInfo {
corename: string
cheats?: true
corename: string
savestate?: true
supportsNoGame?: true
}

export const coreInfoMap: Record<string, CoreInfo> = {
'81': { corename: '81', savestate: true },
'2048': { corename: '2048', savestate: true, supportsNoGame: true },
'3dengine': { corename: '3DEngine' },
'4do': { corename: '4DO', savestate: true },
'81': { corename: '81', savestate: true },
a5200: { corename: 'a5200', savestate: true },
advanced_tests: { corename: 'Advanced Test', supportsNoGame: true },
ardens: { corename: 'Ardens', savestate: true },
Expand All @@ -21,9 +21,9 @@ export const coreInfoMap: Record<string, CoreInfo> = {
bnes: { corename: 'bnes/higan', savestate: true },
boom3: { corename: 'boom3' },
boom3_xp: { corename: 'boom3_xp' },
bsnes: { corename: 'bsnes', savestate: true },
bsnes_cplusplus98: { cheats: true, corename: 'bsnes C++98 (v085)', savestate: true },
bsnes_hd_beta: { corename: 'bsnes-hd beta', savestate: true },
bsnes: { corename: 'bsnes', savestate: true },
bsnes_mercury_accuracy: { cheats: true, corename: 'bsnes-mercury Accuracy', savestate: true },
bsnes_mercury_balanced: { cheats: true, corename: 'bsnes-mercury Balanced', savestate: true },
bsnes_mercury_performance: { cheats: true, corename: 'bsnes-mercury Performance', savestate: true },
Expand All @@ -35,8 +35,8 @@ export const coreInfoMap: Record<string, CoreInfo> = {
cdi2015: { corename: 'Philips CDi 2015' },
chailove: { cheats: true, corename: 'ChaiLove', savestate: true },
chimerasnes: { cheats: true, corename: 'ChimeraSNES', savestate: true },
citra_canary: { corename: 'Citra Canary/Experimental' },
citra: { corename: 'Citra', savestate: true },
citra_canary: { corename: 'Citra Canary/Experimental' },
citra2018: { corename: 'Citra 2018' },
craft: { corename: 'Craft', supportsNoGame: true },
crocods: { corename: 'CrocoDS', savestate: true },
Expand All @@ -47,13 +47,13 @@ export const coreInfoMap: Record<string, CoreInfo> = {
dinothawr: { corename: 'Dinothawr', supportsNoGame: true },
directxbox: { corename: 'DirectXBox' },
dirksimple: { corename: 'DirkSimple', savestate: true },
dolphin_launcher: { corename: 'Dolphin Launcher', supportsNoGame: true },
dolphin: { corename: 'Dolphin', savestate: true },
dosbox_core: { corename: 'DOSBox-core', supportsNoGame: true },
dolphin_launcher: { corename: 'Dolphin Launcher', supportsNoGame: true },
dosbox: { corename: 'DOSBox', supportsNoGame: true },
dosbox_core: { corename: 'DOSBox-core', supportsNoGame: true },
dosbox_pure: { cheats: true, corename: 'DOSBox-pure', savestate: true, supportsNoGame: true },
dosbox_svn_ce: { corename: 'DOSBox-SVN CE', supportsNoGame: true },
dosbox_svn: { corename: 'DOSBox-SVN', supportsNoGame: true },
dosbox_svn_ce: { corename: 'DOSBox-SVN CE', supportsNoGame: true },
duckstation: { corename: 'DuckStation', savestate: true },
easyrpg: { corename: 'EasyRPG Player' },
ecwolf: { corename: 'ECWolf', savestate: true },
Expand All @@ -64,18 +64,18 @@ export const coreInfoMap: Record<string, CoreInfo> = {
emux_sms: { corename: 'Emux SMS' },
ep128emu_core: { cheats: true, corename: 'ep128emu-core', savestate: true, supportsNoGame: true },
fake08: { corename: 'FAKE-08', savestate: true },
fbalpha2012: { corename: 'FB Alpha 2012', savestate: true },
fbalpha2012_cps1: { corename: 'FB Alpha 2012 CPS-1', savestate: true },
fbalpha2012_cps2: { corename: 'FB Alpha 2012 CPS-2', savestate: true },
fbalpha2012_cps3: { corename: 'FB Alpha 2012 CPS-3', savestate: true },
fbalpha2012: { corename: 'FB Alpha 2012', savestate: true },
fbalpha2012_neogeo: { corename: 'FB Alpha 2012 Neo Geo', savestate: true },
fbneo: { cheats: true, corename: 'FinalBurn Neo', savestate: true },
fceumm: { cheats: true, corename: 'FCEUmm', savestate: true },
ffmpeg: { corename: 'FFmpeg' },
fixgb: { corename: 'fixGB' },
fixnes: { corename: 'fixNES' },
flycast_gles2: { corename: 'Flycast GLES2', savestate: true },
flycast: { corename: 'Flycast', savestate: true },
flycast_gles2: { corename: 'Flycast GLES2', savestate: true },
fmsx: { corename: 'fMSX' },
freechaf: { corename: 'FreeChaF' },
freeintv: { corename: 'FreeIntv' },
Expand All @@ -97,8 +97,8 @@ export const coreInfoMap: Record<string, CoreInfo> = {
handy: { corename: 'Handy', savestate: true },
hatari: { corename: 'Hatari', savestate: true },
hbmame: { corename: 'HBMAME (Git)' },
higan_sfc_balanced: { corename: 'nSide (Super Famicom Balanced)', savestate: true },
higan_sfc: { corename: 'nSide (Super Famicom Accuracy)', savestate: true },
higan_sfc_balanced: { corename: 'nSide (Super Famicom Balanced)', savestate: true },
imageviewer: { corename: 'Imageviewer' },
ishiiruka: { corename: 'Ishiiruka', savestate: true },
jaxe: { corename: 'JAXE' },
Expand All @@ -120,11 +120,11 @@ export const coreInfoMap: Record<string, CoreInfo> = {
mednafen_gba: { corename: 'Beetle GBA' },
mednafen_lynx: { corename: 'Beetle Lynx' },
mednafen_ngp: { corename: 'Beetle NeoPop', savestate: true },
mednafen_pce_fast: { corename: 'Beetle PCE Fast', savestate: true },
mednafen_pce: { corename: 'Beetle PCE', savestate: true },
mednafen_pce_fast: { corename: 'Beetle PCE Fast', savestate: true },
mednafen_pcfx: { corename: 'Beetle PC-FX' },
mednafen_psx_hw: { cheats: true, corename: 'Beetle PSX HW', savestate: true },
mednafen_psx: { cheats: true, corename: 'Beetle PSX', savestate: true },
mednafen_psx_hw: { cheats: true, corename: 'Beetle PSX HW', savestate: true },
mednafen_saturn: { cheats: true, corename: 'Beetle Saturn', savestate: true },
mednafen_snes: { corename: 'Beetle bsnes', savestate: true },
mednafen_supafaust: { cheats: true, corename: 'Beetle Supafaust', savestate: true },
Expand All @@ -143,10 +143,10 @@ export const coreInfoMap: Record<string, CoreInfo> = {
mpv: { corename: 'MPV' },
mrboom: { corename: 'Mr.Boom', savestate: true, supportsNoGame: true },
mu: { corename: 'Mu', supportsNoGame: true },
mupen64plus_next: { cheats: true, corename: 'Mupen64Plus-Next', savestate: true },
mupen64plus_next_develop: { cheats: true, corename: 'Mupen64Plus-Next', savestate: true },
mupen64plus_next_gles2: { cheats: true, corename: 'Mupen64Plus-Next', savestate: true },
mupen64plus_next_gles3: { cheats: true, corename: 'Mupen64Plus-Next', savestate: true },
mupen64plus_next: { cheats: true, corename: 'Mupen64Plus-Next', savestate: true },
nekop2: { corename: 'Neko Project II', savestate: true },
neocd: { corename: 'NeoCD' },
nes: { corename: 'nes', savestate: true },
Expand All @@ -159,12 +159,12 @@ export const coreInfoMap: Record<string, CoreInfo> = {
openlara: { corename: 'OpenLara' },
opentyrian: { corename: 'OpenTyrian', supportsNoGame: true },
opera: { corename: 'Opera', savestate: true, supportsNoGame: true },
parallel_n64_debug: { corename: 'ParaLLEl (Debug)', savestate: true },
parallel_n64: { corename: 'ParaLLEl N64', savestate: true },
parallel_n64_debug: { corename: 'ParaLLEl (Debug)', savestate: true },
pascal_pong: { corename: 'PascalPong', supportsNoGame: true },
pcem: { corename: 'PCem', supportsNoGame: true },
pcsx_rearmed_interpreter: { cheats: true, corename: 'PCSX ReARMed [Interpreter]', savestate: true },
pcsx_rearmed: { cheats: true, corename: 'PCSX-ReARMed', savestate: true },
pcsx_rearmed_interpreter: { cheats: true, corename: 'PCSX ReARMed [Interpreter]', savestate: true },
pcsx_rearmed_neon: { cheats: true, corename: 'PCSX ReARMed [NEON]', savestate: true },
pcsx1: { corename: 'PCSX1' },
pcsx2: { corename: 'LRPS2', savestate: true },
Expand Down Expand Up @@ -212,15 +212,15 @@ export const coreInfoMap: Record<string, CoreInfo> = {
testaudio_callback: { corename: 'TestAudio Callback', supportsNoGame: true },
testaudio_no_callback: { corename: 'TestAudio NoCallback', supportsNoGame: true },
testaudio_playback_wav: { corename: 'TestAudio Playback Wav', supportsNoGame: true },
testgl: { corename: 'TestGL', supportsNoGame: true },
testgl_compute_shaders: { corename: 'TestGL ComputeShaders', supportsNoGame: true },
testgl_ff: { corename: 'TestGL (FF)', supportsNoGame: true },
testgl: { corename: 'TestGL', supportsNoGame: true },
testinput_buttontest: { corename: 'Button Test', supportsNoGame: true },
testretroluxury: { corename: 'Test RetroLuxury', supportsNoGame: true },
testsw: { corename: 'TestSW', supportsNoGame: true },
testsw_vram: { corename: 'TestSW VRAM', supportsNoGame: true },
testvulkan_async_compute: { corename: 'TestVulkan AsyncCompute', supportsNoGame: true },
testvulkan: { corename: 'TestVulkan', supportsNoGame: true },
testvulkan_async_compute: { corename: 'TestVulkan AsyncCompute', supportsNoGame: true },
tgbdual: { corename: 'TGB Dual', savestate: true },
theodore: { corename: 'theodore', savestate: true, supportsNoGame: true },
thepowdertoy: { corename: 'ThePowderToy', savestate: true, supportsNoGame: true },
Expand Down
76 changes: 38 additions & 38 deletions src/constants/keyboard-code-map.ts
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
export const keyboardCodeMap: Record<string, string> = {
left: 'ArrowLeft',
right: 'ArrowRight',
up: 'ArrowUp',
down: 'ArrowDown',
enter: 'Enter',
kp_enter: 'NumpadEnter',
tab: 'Tab',
insert: 'Insert',
add: 'NumpadAdd', // is this right?
alt: 'AltLeft',
backquote: 'Backquote',
backslash: '', // what's this?
backspace: 'Backspace',
capslock: 'CapsLock',
comma: 'Comma',
ctrl: 'ControlLeft',
del: 'Delete',
divide: 'NumpadDivide',
down: 'ArrowDown',
end: 'End',
home: 'Home',
shift: 'ShiftLeft',
rshift: 'ShiftRight',
ctrl: 'ControlLeft',
alt: 'AltLeft',
space: 'Space',
enter: 'Enter',
equals: 'Equal',
escape: 'Escape',
add: 'NumpadAdd', // is this right?
subtract: 'NumpadSubtract', // is this right?
kp_plus: 'NumpadAdd',
home: 'Home',
insert: 'Insert',
kp_enter: 'NumpadEnter',
kp_equals: 'NumpadEquals', // is this right?
kp_minus: 'NumpadSubtract',
pageup: 'PageUp',
kp_period: 'NumpadDecimal',
kp_plus: 'NumpadAdd',
left: 'ArrowLeft',
leftbracket: 'BracketLeft', // is this right?
minus: 'Minus',
multiply: 'NumpadMultiply',
numlock: 'NumLock',
pagedown: 'PageDown',
pageup: 'PageUp',
pause: 'Pause',
period: 'Period',
capslock: 'CapsLock',
numlock: 'NumLock',
backspace: 'Backspace',
multiply: 'NumpadMultiply',
divide: 'NumpadDivide',
print_screen: 'PrintScreen',
scroll_lock: 'ScrollLock',
tilde: '', // what's this?
backquote: 'Backquote',
pause: 'Pause',
quote: 'Quote',
comma: 'Comma',
minus: 'Minus',
slash: 'Slash',
semicolon: 'Semicolon',
equals: 'Equal',
leftbracket: 'BracketLeft', // is this right?
backslash: '', // what's this?
rightbracket: 'BracketRight', // is this right?
kp_period: 'NumpadDecimal',
kp_equals: 'NumpadEquals', // is this right?
rctrl: 'ControlRight',
ralt: 'AltRight',
rctrl: 'ControlRight',
right: 'ArrowRight',
rightbracket: 'BracketRight', // is this right?
rshift: 'ShiftRight',
scroll_lock: 'ScrollLock',
semicolon: 'Semicolon',
shift: 'ShiftLeft',
slash: 'Slash',
space: 'Space',
subtract: 'NumpadSubtract', // is this right?
tab: 'Tab',
tilde: '', // what's this?
up: 'ArrowUp',
}
19 changes: 10 additions & 9 deletions src/emscripten.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { RetroArchEmscriptenModuleOptions } from './types/retroarch-emscrip

const raUserdataDir = '/home/web_user/retroarch/userdata'

export function createEmscriptenFS({ FS, PATH, ERRNO_CODES }: any) {
export function createEmscriptenFS({ ERRNO_CODES, FS, PATH }: any) {
const inMemoryFS = new FileSystem.InMemory()
const mountableFS = new FileSystem.MountableFileSystem()
try {
Expand All @@ -23,13 +23,21 @@ export function getEmscriptenModuleOverrides(overrides: RetroArchEmscriptenModul
})

const emscriptenModuleOverrides: RetroArchEmscriptenModuleOptions = {
noInitialRun: true,
noExitRuntime: false,
noInitialRun: true,

locateFile(file) {
return file
},

// the return value of `monitorRunDependencies` seems to be misused here, but it works for now
async monitorRunDependencies(left?: number) {
if (left === 0) {
resolveRunDependenciesPromise()
}
return await runDependenciesPromise
},

print(...args: unknown[]) {
console.info(...args)
},
Expand All @@ -45,13 +53,6 @@ export function getEmscriptenModuleOverrides(overrides: RetroArchEmscriptenModul
}
},

// the return value of `monitorRunDependencies` seems to be misused here, but it works for now
async monitorRunDependencies(left?: number) {
if (left === 0) {
resolveRunDependenciesPromise()
}
return await runDependenciesPromise
},
...overrides,
}
return emscriptenModuleOverrides
Expand Down
Loading

0 comments on commit 522b566

Please sign in to comment.