diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..b5e50b47 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +text=auto eol=lf diff --git a/.github/workflows/latest.yml b/.github/workflows/latest.yml index fe8ec17c..f1522df8 100644 --- a/.github/workflows/latest.yml +++ b/.github/workflows/latest.yml @@ -11,8 +11,28 @@ jobs: runs-on: emulatorjs-server steps: - name: Checkout - uses: actions/checkout@v3 - - name: Run Script + uses: actions/checkout@v4 + - name: Set Permissions run: | cd /mnt/HDD/public - ./.latest.sh + chmod -R 755 .EmulatorJS/ + - name: Update Latest + run: | + cd /mnt/HDD/public/.EmulatorJS/ + git fetch --all + git reset --hard origin/main + git pull + - name: Minify Files + run: | + cd /mnt/HDD/public/.EmulatorJS/ + npm i + npm run minify + - name: Zip Minified Files + run: | + cd /mnt/HDD/public/.EmulatorJS/data/ + zip emulator.min.zip emulator.min.js emulator.min.css + - name: Clean Up Minify + run: | + cd /mnt/HDD/public/.EmulatorJS/ + rm -f "minify/package-lock.json" + rm -rf "minify/node_modules/" diff --git a/.github/workflows/newlines.yml b/.github/workflows/newlines.yml new file mode 100644 index 00000000..5dd0f16b --- /dev/null +++ b/.github/workflows/newlines.yml @@ -0,0 +1,42 @@ +name: Check for Newline at End of Files + +on: + pull_request: + types: + - opened + - synchronize + - reopened + +jobs: + check-newlines: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Check for missing newlines + run: | + files=$(git ls-files) + + newline_error=0 + + for file in $files; do + if file --mime "$file" | grep -q "binary"; then + #echo "Skipping binary file: $file" + continue + fi + + last_char=$(tail -c 1 "$file" | xxd -p) + if [[ "$last_char" != "0a" ]]; then + echo "File $file does not end with a newline!" + newline_error=1 + fi + done + + if [[ $newline_error -eq 1 ]]; then + echo "One or more files do not end with a newline." + exit 1 + else + echo "All files end with a newline." + fi diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index 690b8d1d..50bbc84e 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -9,12 +9,59 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: '20.x' registry-url: 'https://registry.npmjs.org' + - name: Get latest release tag (if workflow_dispatch) + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + LATEST_TAG=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name') + echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV + - name: Download cores + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + TAG_NAME=${{ github.event.release.tag_name || env.LATEST_TAG }} + TRIMMED_TAG=${TAG_NAME#v} + echo "TRIMMED_TAG=$TRIMMED_TAG" >> $GITHUB_ENV + gh release download "$TAG_NAME" \ + --repo ${{ github.repository }} \ + --pattern "$TRIMMED_TAG.7z" + - name: Extract cores + run: | + 7z x -y "$TRIMMED_TAG.7z" "data/cores/*" -o./ + rm "$TRIMMED_TAG.7z" - run: npm i - - run: npm ci - - run: npm publish --access public + - name: Make @emulatorjs/emulatorjs + run: | + node build.js --npm=emulatorjs + npm ci + npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Get cores list + run: | + echo "CORES=$(node build.js --npm=get-cores | jq -r '. | join(" ")')" >> $GITHUB_ENV + - name: Setup cores + run: | + node build.js --npm=cores + - name: Publish each core + run: | + cd data/cores + for core in $CORES; do + echo "Processing core: $core" + cd $core + npm publish --access public + cd .. + done + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Make @emulatorjs/cores + run: | + cd data/cores + npm i + npm ci + npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index b2cd9e8c..65ef1989 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -11,8 +11,59 @@ jobs: runs-on: emulatorjs-server steps: - name: Checkout - uses: actions/checkout@v3 - - name: Run Script + uses: actions/checkout@v4 + - name: Set Variables + run: | + cd /mnt/HDD/public/ + wget -q "https://api.github.com/repos/EmulatorJS/EmulatorJS/releases/latest" -O .tmp.json + version=$(jq -r '.tag_name' .tmp.json) + download_url=$(jq -r '.assets[0].browser_download_url' .tmp.json) + name=$(jq -r '.assets[0].name' .tmp.json) + old_version=$(jq -r '.github' versions.json) + v_version="$version" + if [[ $version == v* ]]; then + version="${version:1}" + fi + rm .tmp.json + echo "VERSION=$version" >> $GITHUB_ENV + echo "DOWNLOAD_URL=$download_url" >> $GITHUB_ENV + echo "NAME=$name" >> $GITHUB_ENV + echo "OLD_VERSION=$old_version" >> $GITHUB_ENV + echo "V_VERSION=$v_version" >> $GITHUB_ENV + - name: Download Stable + run: | + cd /mnt/HDD/public/ + mkdir -p ".stable" + wget -q "$DOWNLOAD_URL" -O ".stable/$NAME" + - name: Extract Stable + run: | + cd /mnt/HDD/public/.stable/ + 7z x "$NAME" + - name: Move Versions + run: | + cd /mnt/HDD/public/ + mv ".stable/$NAME" releases/ + mv "$OLD_VERSION" "$VERSION" + mv stable "$OLD_VERSION" + mv .stable stable + jq --arg version "$VERSION" '.github = $version' versions.json | sponge versions.json + - name: Set Permissions run: | cd /mnt/HDD/public - ./.stable.sh + chmod -R 755 stable/ + - name: Update Stable Cores + run: | + rsync -a --delete /mnt/HDD/public/stable/data/cores/ /mnt/HDD/public/.EmulatorJS/data/cores/ + - name: Zip Stable + run: | + cd /mnt/HDD/public/stable/data/ + zip emulator.min.zip emulator.min.js emulator.min.css + - name: Update Version + run: | + cd /mnt/HDD/public/ + jq --arg old_version "$OLD_VERSION" '.versions += {($old_version): ($old_version + "/")}' versions.json | sponge versions.json + - name: Clean Up + run: | + cd /mnt/HDD/public/ + rm -f "$OLD_VERSION/data/emulator.min.zip" + rm -rf "$OLD_VERSION/node_modules/" diff --git a/.gitignore b/.gitignore index 6116e25c..3b86629b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,15 @@ -**/node_modules/ -*.db -data/minify/package-lock.json +node_modules/ package-lock.json yarn.lock roms/ data/emulator.min.js data/emulator.min.css -data/cores +data/cores/* +!data/cores/README.md +!data/cores/core-README.md +!data/cores/package.json +!data/cores/.npmignore .DS_Store -.vscode/* \ No newline at end of file +.vscode/* +*.tgz +dist/ diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000..470e291c --- /dev/null +++ b/.npmignore @@ -0,0 +1,16 @@ +.git +dist/ +node_modules/ +package-lock.json +.github/ +*.tgz +update.js +build.js +data/localization/translate.html +data/cores/* +!data/cores/README.md +!data/cores/package.json +minify/ +.npmignore +.gitignore +roms/ diff --git a/CHANGES.md b/CHANGES.md index 392f81b6..f7699797 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,99 @@ # Changes -# 4.1.1 +# 4.2.3 + +Bug fix release + +- Redo image capture features (Thanks to [@allancoding](https://github.com/allancoding)) +- Fix issue with invalid button names (Thanks to [@michael-j-green](https://github.com/michael-j-green)) +- Fix issues with canvas size +- Update zh-CN translations (Thanks to [@incredibleIdea](https://github.com/incredibleIdea)) + +# 4.2.2 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/a796c4a3866652d1b6cb74a2b90e9552955c2b13) + +- Prioritize gameName over gameUrl for the local storage identifier +- Fix CSS parsing when setting a background image (Thanks to [@kellenmace](https://github.com/kellenmace)) +- Add `EJS_dontExtractBIOS` option (Thanks to [@pjft](https://github.com/pjft)) +- Delete old screenshot file before saving a new one (Thanks to [@gantoine](https://github.com/gantoine)) +- Add `saveSaveFiles` event for when save files are updated +- Add `saveDatabaseLoaded` event, for when the `/data/saves` directory has been mounted +- Add ability to set a system save interval +- Add the ability to hide settings from the settings menu with the `EJS_hideSettings` option +- Attempt to auto-detect system language and attempt to load that file. +- Add `EJS_disableAutoLang` option to disable auto language detection in `loader.js` +- Update Japanese translation file (Thanks to [@noel-forester](https://github.com/noel-forester)) +- Add dropdown selection for gamepads +- Correct N64 virtual gamepad inputs +- Change path to `retroarch.cfg` +- Add `joystickInput` property for virtual gamepad buttons +- Removed `this.listeners` +- Update Korean translation file (Thanks to [@SooHyuck](https://github.com/SooHyuck)) +- Redo touchscreen detection (Thanks to [@allancoding](https://github.com/allancoding)) +- Redo toolbar visibility method (Thanks to [@allancoding](https://github.com/allancoding)) +- Add `dosbox_pure` core (requires threading) +- Add toggle for direct keyboard input +- Redo scrolling in settings menu +- Redo about menu CSS +- Add setting to enable/disable mouse lock +- Properly handle failed save states +- Fix unknown axis events being discarded +- Write core settings file before loading the core (Some core settings are required to be loaded from here on startup) +- Add option to disable `alt` key when using direct keyboard input +- Cleanup famicom controls +- Fix setting gamepad axis to input values 16 to 23 +- Rework internal method of getting user settings, add `this.getSettingValue` function +- Add Romanian translation file (Thanks to [@jurcaalexandrucristian](https://github.com/jurcaalexandrucristian)) +- Fix build stack size when building cores +- Fix CHD support + +# 4.2.1 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/13362ef0786990e93462f06505de772031cfc4c2) + +This was a bug-fix only release. + +- Core-fetch failsafe now fetches a pinned version (Thanks to [@gantoine](https://github.com/n-at)) +- Fixes video rotation on the arcade core (Thanks to [@allancoding](https://github.com/allancoding)) +- Updated French `af-FR` translation (Thanks to [@t3chnob0y](https://github.com/t3chnob0y)) +- Fixes switching between cores. +- Change: Localstorage settings are now stored by game instead of by system. +- Fixed gamepad input for c-down. +- Fixed RetroArch always assuming save is `.srm`. +- Fixed EJS exit event +- Hide the "save/load save files" buttons if unsupported. +- Corrects the order of the core list. +- Corrects behaviour of the placement of bios/parent/patch files. +- Fixed rar decompression. +- Fixed picodrive core (`sega32x`) +- Fixed libretro-uae core (`amiga`) + +# 4.2.0 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/8d42d53d4fdf0166f71eaa07529cadf93350b76e) + +In my opinion, this is the most stable release we've had in a while. Many features added in this release were just side affects of fixing up some bugs. + +- Let same_cdi core handle zipped bios file directly (Thanks to [@pastisme](https://github.com/pastisme)) +- Fix audio sliders/mute button (Thanks to [@n-at](https://github.com/n-at)) +- Add ability to rotate video (Thanks to [@allancoding](https://github.com/allancoding)) +- Added persian `fa-AF` language (Thanks to [@iits-reza](https://github.com/iits-reza)) +- Added more catches for a start-game error +- Fixed default webgl2 option +- Organized settings menu, by dividing entries into sub-menus +- Fixed the EmulatorJS exit button +- Added the ability to internally add configurable retroarch.cfg variables +- Fixed default settings being saved to localstorage +- Fixed in browser SRM saves (finally) +- Read save state from WebAssembly Memory +- Fixed an issue when loading PPSSPP assets +- Refactored the internal downloadFile function to be promised based instead of callback based +- Added checks if core requires threads or webgl2 +- Added ability to switch between cores in the settings menu +- Added the ability to enable/disable threads if SharedArrayBuffer is defined +- Added a PSP controller scheme for the control settings menu +- Fixed the volume slider background height in firefox +- Added handling for lightgun devices +- Refactored the EmulatorJS `build-emulatorjs.sh` build script +- Added `ppsspp` core + +# 4.1.1 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/4951a28de05e072acbe939f46147645a91664a07) + - Fixed 2xScaleHQ and 2xScaleHQ shaders (Thanks to [@n-at](https://github.com/n-at)) - Added Vietnamese (`vi-VN`) (Thanks to [@TimKieu](https://github.com/TimKieu)) - Disable CUE generation for the PUAE core (Thanks to [@michael-j-green](https://github.com/michael-j-green)) @@ -21,6 +114,7 @@ - Added support for `File` objects (Thanks to [@pastisme](https://github.com/pastisme)). # 4.0.12 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/c3ba473d1afc278db136f8e1252d0456050d6047) + - Fix scroll bar css (Thanks to [@allancoding](https://github.com/allancoding)) - Flip the context menu instead of going off the page - Add hooks for save files (Thanks to [@gantoine](https://github.com/gantoine)) @@ -33,12 +127,14 @@ - Added advanced shader configuration support (Thanks to [@n-at](https://github.com/n-at)) # 4.0.11 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/cafd80d023afa9562c7054e89a4240f3381d64ff) + - Added the ability to disable localstorage using `EJS_disableLocalStorage`. (Thanks to [@n-at](https://github.com/n-at)) - Added the ability to trigger `EJS_emulator.displayMessage` with a duration. (Thanks to [@allancoding](https://github.com/allancoding)) - `EJS_emulator.gameManager.getState` now returns a Uint8Array instead of a promise. - Fixed broken save states from the 4.0.10 release. # 4.0.10 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/390605d2ab48db16c07c8fb4fc2815033af5c3a6) + - Fixed bug with duplicate control inputs. - Fixed mobile settings menu positioning. - Ability to load custom files into the wasm instance. @@ -53,6 +149,7 @@ - Fixed volume slider shadow. (Thanks to [@allancoding](https://github.com/allancoding)) # 4.0.9 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/ddb5c6092f12a63a46d74ea67e6469726665ebc2) + - Repository history rewrite - expect faster cloning times. - Prevent Vice64 from creating cue files (Thanks to [@michael-j-green](https://github.com/michael-j-green)) - Chinese translation updated (Thanks to [@oyepriyansh](https://github.com/oyepriyansh)) @@ -64,6 +161,7 @@ - Added legacy nintendo 64 cores for browsers that don't support webgl2. # 4.0.8 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/f579eb4c080f612723fd6a119b02173cafb37503) + - Fixed typo in virtual gamepad dpad. - Added updated desmume core. - Fixed key mapping (Thanks to [@allancoding](https://github.com/allancoding)) @@ -77,6 +175,7 @@ - Added c64 core. # 4.0.7 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/f579eb4c080f612723fd6a119b02173cafb37503) + - Added rewind (Thanks to [@n-at](https://github.com/n-at)) - Added slowdown (Thanks to [@n-at](https://github.com/n-at)) - Fixed "zone" object in front of settings menu. @@ -94,6 +193,7 @@ - Use keycodes instead of labels (Thanks to [@allancoding](https://github.com/allancoding)) # 4.0.6 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/5e338e7a888480cea331f6d4656bc8986a7d6b28) + - Fixed n64 on iOS safari - virtual gamepads for atari2600, atari7800, lynx, jaguar, vb, 3do (Thanks to [@n-at](https://github.com/n-at)) - control buttons for gba, vb, 3do, atari2600, atari7800, lynx, jaguar (Thanks to [@n-at](https://github.com/n-at)) @@ -101,6 +201,7 @@ - Added Fast Forward # 4.0.5 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/5307e6294ed9df5daabd6958b2b307bae01f59f1) + - Added `pcsx_rearmed` core - Made `pcsx_rearmed` core the default `psx` core (better compatibility) - Added `fbneo` core @@ -115,20 +216,25 @@ - Add ***highly beta*** psp core - see readme # 4.0.4 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/41491a738cf92ef9cee7d53f323aa2ab9732c053) + - Fix cheats "x" button - Optimize memory usage - Added ability to set urls to blob/arraybuffer/uint8array if needed # 4.0.3 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/5219ab51227bc0fb60cbc7b60e476b0145c932c9) + - Remove RetroArch messages - Center video at top # 4.0.2 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/06fe386e780bb55ef6baa4fbc6addd486bee747a) + - Add link to RetroArch License on about page - Fix gamepad support for legacy browsers # 4.0.1 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/efbb9dd462ee0e4f2120a6947af312e02fcf657c) + Complete application re-write. Everything changed. Although some changes to note are: + - Optimization for smaller screens. - No more dead code. - Fix Gamepad for firefox. @@ -139,10 +245,12 @@ Complete application re-write. Everything changed. Although some changes to note And much much more was changed... # 3.1.5 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/f7fa5d41487a424233b40e903020455606d68fee) + - Fixed iOS bug for iPads - Added netplay! (only working on old cores) # 3.1.0 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/614f5cb55e2768199ba05b756b47d0ab7ab283fd) + - Added ability to drag and drop save states. - Fixed some "update" and "cancel" and "close" button confustion - Removed save state retroarch messages @@ -150,6 +258,7 @@ And much much more was changed... - (Theoretically) fixed a bug that did not allow iOS devices to work # 3.0.5 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/44c31371fb3c314cd8dea36ccbaad89fb3ab98e6) + - Fixed screen recording on devices that do not support getUserMedia api. - Added C label buttons to nintendo 64 virtual gamepad. - Fixed EJS_color bug. @@ -167,63 +276,79 @@ And much much more was changed... - Added feature that will display the current downloaded size when the content length is not available. # 2.3.9 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/088942083e44510f07133f2074a2d63a8af477cd) + - Fixed incorrect variable referencing when update bios download data callback. - Fixed rom storage size limits. - Fixed download percent not showing with some files. # 2.3.8 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/5f176b963e4b2055983b82396378d1e3837a69c4) + - Remove broken shader. - Add download percent message. - Fixed UI "saving state" message not going away. # 2.3.7 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/8b9607becfe0aaad42b8b8486c7d379821b72125) + - Add more shaders. - Add bold fontsize option to custom virtual gamepad settings. - No longer set "normalOptions" from localization file. # 2.3.6 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/b2919bc2c3d2d4c9fe3ab4f4486790a376b7acfe) + - Remove default control mappings for gamepads. - Upgraded invalid character regex to catch more characters. # 2.3.5 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/a5a9916aba041e75ee73815376ed4fd2e22701bd) + - Use regex to detect and replace invalid characters in filename/gamename settings. # 2.3.4 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/45d982b6362cfd29cb2eda9721066e03893ba0d8) + - Add new arcade core. - Fix patch file game id set bug. # 2.3.4 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/45d982b6362cfd29cb2eda9721066e03893ba0d8) + - Add new arcade core. # 2.3.3 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/11bddd5a4277aa04f80b941f05cc024b3de58bfc) + - Make version in loader.js reasonable. - Created function to return the game id to prevent unnecessary data stored. # 2.3.2 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/e9e017435f2c41c6c2b127024cc88ac51bdf04d9) + - Fix reference error. - Fix bug in custom virtual gamepad processor where if value is set to 0 it will see that as the value being missing. # 2.3.1 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/0fd6d58e2011fa1a39bd2e11ba3d2f17773f0961) + - Use let instead of var. # 2.3.0 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/2fd0f545285151524262cc799efef6d996d7c6c1) + - Added ability to customize virtual gamepad UI. - Fixed bug where shader is not set on start. # 2.2.9 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/018c39d4065b866487f8f18ca88c9488eab69a6d) + - Added feature to save save files to indexeddb every 5 minutes. # 2.2.8 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/9860d662d02b56417044cca11937448041d9cf43) + - Re-write gamepad handler. # 2.2.7 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/c03d18990b6536c1503bba2c640dbc13db982bb3) + - Removed un-needed FS proxy functions. # 2.2.6 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/fd71b5dfc2bd44d8e1f0e7c6c7b3ee1a1127a696) + - Added fps counter. - Fixed gba core aspect. # 2.2.5 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/4b444ec23918149a6052807d778af82f79883c01) + - Added ability to set custom control mappings. - Added ability to set custom default volume value. - Fixed gamepad axis as button, gamepad varaible compared to incorrect value. @@ -231,16 +356,19 @@ And much much more was changed... - Added ability to set game url to other data types. # 2.2.3 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/41eed05677b4927bd114613040bfe4572c92c4b4) + - Fixed rar unarchiving function reference. - Updated rar header detection. - Removed netplay. # 2.2.1 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/19980deb12c3f0790176db6fc7b8b2de4069bf4e) + - Added core menu options for new cores. - Added new mame2003 core. - Added support for debug emscripten setting for new cores. # 2.0.1 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/a72222c39a793c4ff470ebb2b71c04829fee4b5e) + - Control mapping for beta cores. - Updated beta cores. - Beta cores now the default option! @@ -248,25 +376,30 @@ And much much more was changed... - Fixed save state for new n64 core. # 1.2.2 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/8ab7bb3f49da373ed5d291c5f72039bbabf2fbc8) + - Moved virtual gamepad menu button to the top left as 3 lines. - Added screen orientation lock. - Added beta n64 core! # 1.2.1 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/638658e6202fd39cb5c94bedcfa00ccdf8b25840) + - Updated beta core files. # 1.1.6 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/fa153ba76791184d978f9fb8b69991b05b161bc8) + - Replaced axios module with custom script. - Added pause/play for beta cores. - Sepperated css into its own file. - Renamed emu-min.js to emulator.min.js. # 1.1.5 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/2767c635b8a6e05c57e054d2f9d01ae0c4ff6d47) + - Cleaned up fetch error function. - Cleaned up virtual gamepad event listeners. - Add code of conduct. # 1.1.2 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/64731dd8219931155b4e698aa98dbf65c2120038) + - Fixed error where mame files were misnamed. - Fixed bug where variable referenced was not defined in loader.js. - Added .gitignore @@ -278,6 +411,7 @@ And much much more was changed... - Update nodejs buffer module. # 1.1.0 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/715ded4ae23c2135bc9a8b9b7599f12c905393b3) + - Added minify feature. - Added emulatorjs logo. - Added beta nds and gb core. @@ -285,6 +419,7 @@ And much much more was changed... - Added volume setting and cheats to beta cores. # 1.0 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/fde44b095bb89e299daaaa4c8d7deebc79019865) + - Official release of the beta cores. - Ability to use beta cores in production. - Ability to use the old emulatorjs netplay server. @@ -293,6 +428,7 @@ And much much more was changed... - Fixed virtual gamepad bug where a function was referenced to as an array. # 0.4.26 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/0709829a11266b6ab4bbbf3e61d6dd6d3c372133) + - Sepperated emulator.js file into 2 files. - Added support for a custom netplay server. - Fixed netplay room password input bug. @@ -307,6 +443,7 @@ And much much more was changed... - Update webrtc adapter. # 0.4.25 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/ef3200ef87bffe57241e05ae9646cc201142ec46) + - Moved load state on start from loader.js file to emulator.js file. - Moved data path function from loader.js file to emulator.js file. - Added ability to set custom path to data through `EJS_pathtodata` variable. @@ -322,6 +459,7 @@ And much much more was changed... - Created official emulatorjs website. # 0.4.24 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/73ff641616bcd10f088a004002183760832a1afc) + - Deobsfocuted emulator.js and loader.js files to the most of my extent. - Added quick save/load hotkeys. - Added ability to use gamepad axis as button. @@ -337,6 +475,7 @@ And much much more was changed... - Updated n64 core. # 0.4.23-07 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/83e148c82cbc8b4e835a808dcf84456975f82a7c) + - Removed not needed code. - Added reset button to control settings. - Added clear button to control settings. @@ -345,27 +484,33 @@ And much much more was changed... - Fixed RAR unarchiving. # 0.4.23-05 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/018c787ccf6daca58c863d38fff61910f33f98ec) + - No longer cache games with the protocols of `file:`, and `chrome-extension:`. - Changed default keymappings. - Added screen recording button. # 0.4.23-04 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/6464bbedc1cd58c023cd66656540fc174aedde8b) + - Added mame2003, snes2002, snes2005, snes2010, and vbanext cores. - Added asmjs for all supported cores. # 0.4.23-03 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/c883f267e1e56ed6b6472b891f78704c6e4b4c17) + - Start loader.js deobsfocuting. - Deobsfocute extractzip.js. - Added `EJS_gameName`, the ability to change the file name of save states. # 0.4.23-02 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/5d97620b25a81e49c6ba313e586fb37a5ce66002) -- Start emulator.js deobsfocuting. + +- Start emulator.js deobsfocuting. # 0.4.23-01 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/42a7e129cfded266b72539e8d1b5978d5e4119d8) + - Added support for loading "blob:" urls. - Added support for loading state on game start. # 0.4.23 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/5f5cf5cbba29cfd772d525a4c73a4bc5ea26654c) + - Added update available message. - Fixed a bug where the 'x' from the ad iframe was still visible on game start. - Added a2600 and mame cores. @@ -373,9 +518,11 @@ And much much more was changed... - Add rar extraction support. # 0.4.19 [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/4fd22871663e5896bb5d0ce29a50ad508462387a) + - Added support for 32x, 3do, a7800, arcade, bluemsx, jaguar, lynx, ngp, pce, saturn, sega, segacd, and ws cores. # Initial release [View Tree](https://github.com/EmulatorJS/EmulatorJS/tree/be2db16cba8bd85bf901cd89ca6de51414cea792) + - Support for unzipping zip files. - Support for unzipping 7zip files. - Support for vb, snes, psx, nes, nds, n64, gba, and gb systems. Only support for WASM. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f0c885e8..3f3e59a8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,10 +2,54 @@ There are several ways to contribute, be it directly to helping develop features for EmulatorJS, update the documentation, media assets or heading over to libretro and helping them develop the emulator cores that make the magic happen. -* EmulatorJS, take a look through the [issues](https://github.com/EmulatorJS/EmulatorJS/issues) on github and try to help out. +- EmulatorJS, take a look through the [issues](https://github.com/EmulatorJS/EmulatorJS/issues) on github and try to help out. -* Documentation [github page](https://github.com/EmulatorJS/emulatorjs.org). +- Documentation [github page](https://github.com/EmulatorJS/emulatorjs.org). Just wanna donate? That'd help too! -[libretro](https://retroarch.com/index.php?page=donate) -[EmulatorJS](https://www.patreon.com/EmulatorJS) + +Donate to: [EmulatorJS](https://www.patreon.com/EmulatorJS) + +Donate to: [libretro](https://retroarch.com/index.php?page=donate) + +## Project Scripts + +The project has several scripts that can be used to help with updating and deploying the project. + +### Build Script + +Runs the build script, which will compresses the project in 7z and zip output in dist/ folder. Note: Make sure you have the compiled cores in the `data/cores` folder before running this script. + +```bash +npm run build +``` + +### Update Script + +Runs the update script, which updates dependencies and can change version number of project. It also will update the list of contributors. + +```bash +npm run update # Just updates contributors list +npm run update -- --ejs_v=4.3.1 # Updates contributors list and sets version to 4.3.1 +npm run update -- --deps=true # Updates contributors list and updates dependencies +npm run update -- --dev=true # Updates contributors list and enables dev mode +npm run update -- --dev=false # Updates contributors list and disables dev mode +``` + +## Attention Visual Studio Code Users + +By default Visual Studio Code will apply formatting that is not consistent with the standard formatting used by this project. + +Please disable the formatter *before* submitting a Pull Request. + +The formatter can be disabled for this repo only (without affecting your own preferences) by creating a new file called `.vscode/settings.json` (if it doesn't already exist). + +Add the following options to the settings.json file to disable the formatter while working on this repo: +```json +{ + "diffEditor.ignoreTrimWhitespace": false, + "editor.formatOnPaste": false, + "editor.formatOnSave": false, + "editor.formatOnSaveMode": "modifications" +} +``` diff --git a/LICENSE b/LICENSE index 2bb95c24..372f2fd9 100644 --- a/LICENSE +++ b/LICENSE @@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. EmulatorJS: RetroArch on the web - Copyright (C) 2023 Ethan O'Brien + Copyright (C) 2022-2024 Ethan O'Brien This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - EmulatorJS Copyright (C) 2023 Ethan O'Brien + EmulatorJS Copyright (C) 2023-2025 Ethan O'Brien This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/README.md b/README.md index 5cfc84e5..7f1cb76f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -
@@ -8,20 +7,17 @@
[![Badge License]][License] - - -Self-hosted **Javascript** emulation for various system. + +Self-hosted **Javascript** emulation for various systems.
-[![Button Website]][Website]  +[![Button Website]][Website] [![Button Usage]][Usage]
[![Button Configurator]][Configurator]
-[![Button Demo]][Demo]  -[![Button Legacy]][Legacy] - -[![Button Contributors]][Contributors] - +[![Button Demo]][Demo]
+[![Button Contributors]][Contributors] + Join our Discord server: [![Join our Discord server!](https://invidget.switchblade.xyz/6akryGkETU)](https://discord.gg/6akryGkETU) @@ -35,12 +31,10 @@ Or the Matrix server (#emulatorjs:matrix.emulatorjs.org):
> [!NOTE] -> **As of EmulatorJS version 4.0, this project is no longer a reverse-engineered version of the emulatorjs.com project. It is now a complete re-write.** +> **As of EmulatorJS version 4.0, this project is no longer a reverse-engineered version of the emulatorjs.com project. It is now a complete rewrite.** > [!WARNING] -> As of version 4.0.9 cores and minified files are no longer included in the repository. You will need to get them separately. You can get the from [releases](https://github.com/EmulatorJS/EmulatorJS/releases) or the * new CDN (see [this](#CDN) for more info). There is also a new version system that we will be using. (read [here](#Versioning) for more info). -> -> The history of the project has been rewritten and force pushed. You will likely need to redo any active commits you have. Sorry for the inconvenience. +> As of version 4.0.9 cores and minified files are no longer included in the repository. You will need to get them separately. You can get it from [releases](https://github.com/EmulatorJS/EmulatorJS/releases) or the \* new CDN (see [this](#CDN) for more info). There is also a new version system that we will be using. (read [here](#Versioning) for more info). > [!TIP] > Cloning the repository is no longer recommended for production use. You should use [releases](https://github.com/EmulatorJS/EmulatorJS/releases) or the [CDN](https://cdn.emulatorjs.org/) instead. @@ -58,7 +52,6 @@ Or the Matrix server (#emulatorjs:matrix.emulatorjs.org):
- ### Issues *If something doesn't work, please consider opening an* ***[Issue]***
@@ -66,34 +59,74 @@ Or the Matrix server (#emulatorjs:matrix.emulatorjs.org):
+### 3rd Party Projects + +EmulatorJS itself is built to be a plugin, rather than an entire website. This is why there is no docker container of this project. However, there are several projects you can use that use EmulatorJS! + +Looking for projects that integrate EmulatorJS? Check out https://emulatorjs.org/docs/3rd-party + +
+ ### Versioning + There are three different version names that you need to be aware of: + 1. **stable** - This will be the most stable version of the emulator both code and cores will be tested before release. It will be updated every time a new version is released on GitHub. This is the default version on the Demo. 2. **latest** - This will contain the latest code but use the stable cores. This will be updated every time the *main* branch is updated. -3. **nightly** - This will contain the latest code and the latest cores. The cores will be updated every day, so this is consiterd alpha. +3. **nightly** - This will contain the latest code and the latest cores. The cores will be updated every day, so this is considered alpha. + +
### CDN -There is a new CDN that you can use to get any version of the emulator. The cdn is `https://cdn.emulatorjs.org/`. You can use this to get the stable, latest, nightly and any other main version by setting your `EJS_pathtodata` to `https://cdn.emulatorjs.org//data/`. -### Extensions +**EmulatorJS provides a CDN** at `https://cdn.emulatorjs.org/`, allowing access to any version of the emulator. - **[GameLibrary]** +To use it, set `EJS_pathtodata` to `https://cdn.emulatorjs.org//data/`, replacing `` with `stable`, `latest`, `nightly`, or another main release. -   *A library overview for your **ROM** folder.* +Be sure to also update the `loader.js` path to: +`https://cdn.emulatorjs.org//data/loader.js`
### Development: *Run a local server with:* -``` -npm i -npm start -``` + +1. Open a terminal in the root of the project. + +2. Install the dependencies with: + + ```sh + npm i + ``` + +3. Start the minification with: + + ```sh + node start + ``` + +4. Open your browser and go to `http://localhost:8080/` to see the demo page.
-**>> When reporting bugs, please specify that you are using the old version** +
+ +#### Minifying + +Before pushing the script files onto your production server it is recommended to minify them to save on load times as well as bandwidth. + +Read the [minifying](minify/README.md) documentation for more info. + +
+ +#### Localization + +If you want to help with localization, please check out the [localization](data/localization/README.md) documentation. + +
+ +**>> When reporting bugs, please specify what version you are using**

@@ -128,7 +161,7 @@ npm start **[Saturn][Sega Saturn]**   |  **[32X][Sega 32X]**   |  **[CD][Sega CD]** - +

@@ -157,36 +190,40 @@ npm start
### Other - + **[PlayStation]**   |  -**[Arcade]**   |  -**[3DO]** +**[PlayStation Portable]**   |  +**[Arcade]**     +**[3DO]** | **[MAME 2003]** | **[ColecoVision]** - +

+## Star History + + + + + + Star History Chart + + + [License]: LICENSE [Issue]: https://github.com/ethanaobrien/emulatorjs/issues [patreon]: https://patreon.com/EmulatorJS - - - -[GameLibrary]: https://github.com/Ramaerel/emulatorjs-GameLibrary - - [Configurator]: https://emulatorjs.org/editor -[Contributors]: docs/Contributors.md +[Contributors]: docs/contributors.md [Website]: https://emulatorjs.org/ -[Legacy]: https://coldcast.org/games/1/Super-Mario-Bros [Usage]: https://emulatorjs.org/docs/ [Demo]: https://demo.emulatorjs.org/ @@ -221,6 +258,7 @@ npm start [Neo Geo Poket]: https://emulatorjs.org/systems/Neo%20Geo%20Pocket ---> [PlayStation]: https://emulatorjs.org/docs/systems/playstation +[PlayStation Portable]: https://emulatorjs.org/docs/systems/psp [Virtual Boy]: https://emulatorjs.org/docs/systems/virtual-boy [Arcade]: https://emulatorjs.org/docs/systems/arcade [3DO]: https://emulatorjs.org/docs/systems/3do @@ -239,10 +277,9 @@ npm start [Badge License]: https://img.shields.io/badge/License-GPLv3-blue.svg?style=for-the-badge -[Button Configurator]: https://img.shields.io/badge/Configurator-992cb3?style=for-the-badge +[Button Configurator]: https://img.shields.io/badge/Code%20Generator-992cb3?style=for-the-badge [Button Contributors]: https://img.shields.io/badge/Contributors-54b7dd?style=for-the-badge [Button Website]: https://img.shields.io/badge/Website-736e9b?style=for-the-badge -[Button Legacy]: https://img.shields.io/badge/Legacy-ab910b?style=for-the-badge [Button Usage]: https://img.shields.io/badge/Usage-2478b5?style=for-the-badge [Button Demo]: https://img.shields.io/badge/Demo-528116?style=for-the-badge [Button Beta]: https://img.shields.io/badge/Beta-bb044f?style=for-the-badge diff --git a/build.js b/build.js new file mode 100644 index 00000000..668e6d45 --- /dev/null +++ b/build.js @@ -0,0 +1,183 @@ +import fs from 'fs'; +import path from 'path'; +import Seven from 'node-7z'; +let version; + +try { + const packageJsonPath = path.resolve('package.json'); + const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')); + version = packageJson.version; +} catch(error) { + console.error("Error reading version from package.json:", error.message); + process.exit(1); +} + +const args = process.argv.slice(2); +const npmArg = args.find(arg => arg.startsWith('--npm=')); +const build_type = npmArg ? npmArg.split('=')[1] : process.env.npm; + +if (!build_type) { + const progressData = { + '7z': 0, + 'zip': 0 + }; + + const progressInterval = setInterval(() => { + process.stdout.clearLine(); + process.stdout.cursorTo(0); + if (progressData['7z'] < 100 && progressData['zip'] < 100) { + process.stdout.write(`7z Progress: ${progressData['7z']}% | Zip Progress: ${progressData['zip']}%`); + } else if (progressData['7z'] === 100) { + console.log(`${version}.7z created successfully!`); + process.stdout.write(`Zip Progress: ${progressData['zip']}%`); + progressData['7z'] = 101; + } else if (progressData['zip'] === 100) { + console.log(`${version}.zip created successfully!`); + process.stdout.write(`7z Progress: ${progressData['7z']}%`); + progressData['zip'] = 101; + } else if (progressData['zip'] >= 100 && progressData['7z'] >= 100) { + process.stdout.write(`All archives for EmulatorJS version: ${version} created successfully!`); + clearInterval(progressInterval); + console.log('\nArchives are in the dist/ folder.'); + } else if (progressData['7z'] >= 100) { + process.stdout.write(`Zip Progress: ${progressData['zip']}%`); + } else if (progressData['zip'] >= 100) { + process.stdout.write(`7z Progress: ${progressData['7z']}%`); + } + }, 100); + + console.log(`Creating archives for EmulatorJS version: ${version}`); + + const npmIgnorePath = path.resolve('.npmignore'); + if (!fs.existsSync('dist')) { + fs.mkdirSync('dist'); + } + const distNpmIgnorePath = path.resolve('dist', '.ignore'); + fs.copyFileSync(npmIgnorePath, distNpmIgnorePath); + const npmIgnoreContent = fs.readFileSync(npmIgnorePath, 'utf8'); + const updatedNpmIgnoreContent = npmIgnoreContent.replace('data/cores/*', 'data/cores/core-README.md\ndata/cores/package.json'); + fs.writeFileSync(distNpmIgnorePath, updatedNpmIgnoreContent, 'utf8'); + + Seven.add(`dist/${version}.7z`, './', { + $raw: ['-xr@dist/.ignore'], + $progress: true + }).on('progress', function (progress) { + progressData['7z'] = progress.percent; + }).on('end', function() { + progressData['7z'] = 100; + + }); + + Seven.add(`dist/${version}.zip`, './', { + $raw: ['-xr@dist/.ignore'], + $progress: true + }).on('progress', function (progress) { + progressData['zip'] = progress.percent; + }).on('end', function() { + progressData['zip'] = 100; + }); +} else if (build_type !== "emulatorjs" && build_type !== "cores" && build_type !== "get-cores") { + console.log("Invalid argument. Use --npm=emulatorjs, --npm=cores or --npm=get-cores."); + process.exit(1); +} else { + const removeLogo = () => { + const readmePath = path.resolve('README.md'); + const readmeContent = fs.readFileSync(readmePath, 'utf8'); + const updatedContent = readmeContent + .split('\n') + .filter(line => !line.includes('docs/Logo-light.png#gh-dark-mode-only>')) + .join('\n'); + fs.writeFileSync(readmePath, updatedContent, 'utf8'); + }; + + const getCores = async () => { + const coresJsonPath = path.resolve('data', 'cores', 'cores.json'); + if (!fs.existsSync(coresJsonPath)) { + console.error(`Cores JSON file not found at ${coresJsonPath}`); + return; + } + return JSON.parse(fs.readFileSync(coresJsonPath, 'utf8')); + }; + + if (build_type === "emulatorjs") { + console.log(`Current EmulatorJS Version: ${version}`); + removeLogo(); + console.log("Ready to build EmulatorJS!"); + } else if (build_type === "get-cores") { + const cores = await getCores(); + console.log(JSON.stringify(cores.map(coreName => coreName.name))); + } else if (build_type === "cores") { + console.log(`Current EmulatorJS Version: ${version}`); + console.log("Building cores..."); + const allCores = await getCores(); + console.log("Building EmulatorJS cores:"); + const coreNames = allCores.map(coreName => coreName.name); + console.log(coreNames.join(', ')); + if (!coreNames) { + console.error("No cores found."); + process.exit(1); + } + const coresPath = path.resolve('data', 'cores'); + const coresFiles = fs.readdirSync(coresPath); + const dataFiles = coresFiles.filter(file => file.endsWith('.data') || file.endsWith('.zip')); + const cores = {}; + for (const core of coreNames) { + const coreFiles = dataFiles.filter(file => file.startsWith(core + '-')); + if (!cores[core]) { + cores[core] = []; + } + cores[core].push(...coreFiles); + } + const packagePath = path.resolve('data', 'cores', 'package.json'); + const packageContent = fs.readFileSync(packagePath, 'utf8'); + const packageJson = JSON.parse(packageContent); + packageJson.dependencies = { + "@emulatorjs/emulatorjs": "latest" + }; + fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 4), 'utf8'); + for (const core in cores) { + if (!fs.existsSync(path.resolve('data', 'cores', core))) { + fs.mkdirSync(path.resolve('data', 'cores', core)); + } + for (const file of cores[core]) { + const sourcePath = path.resolve('data', 'cores', file); + const destPath = path.resolve('data', 'cores', core, file); + fs.copyFileSync(sourcePath, destPath); + const reportsPath = path.resolve('data', 'cores', core, 'reports'); + if (!fs.existsSync(reportsPath)) { + fs.mkdirSync(reportsPath); + } + } + const coreReportPath = path.resolve('data', 'cores', 'reports', `${core}.json`); + const coreReportDestPath = path.resolve('data', 'cores', core, 'reports', `${core}.json`); + fs.copyFileSync(coreReportPath, coreReportDestPath); + + const corePackagePath = path.resolve('data', 'cores', 'package.json'); + const corePackageDestPath = path.resolve('data', 'cores', core, 'package.json'); + const corePackageContent = fs.readFileSync(corePackagePath, 'utf8'); + const corePackageJson = JSON.parse(corePackageContent); + corePackageJson.name = `@emulatorjs/core-${core}`; + corePackageJson.description = `EmulatorJS Core: ${core}`; + corePackageJson.license = allCores.find(c => c.name === core).license; + corePackageJson.repository.url = allCores.find(c => c.name === core).repo + '.git'; + corePackageJson.bugs.url = allCores.find(c => c.name === core).repo + '/issues'; + corePackageJson.dependencies = { + "@emulatorjs/emulatorjs": "latest" + }; + fs.writeFileSync(corePackageDestPath, JSON.stringify(corePackageJson, null, 4), 'utf8'); + + const coreReadmePath = path.resolve('data', 'cores', 'core-README.md'); + const coreReadmeDestPath = path.resolve('data', 'cores', core, 'README.md'); + const coreReadmeContent = fs.readFileSync(coreReadmePath, 'utf8'); + const updatedCoreReadmeContent = coreReadmeContent + .replace(//g, `${core}`) + .replace(//g, allCores.find(c => c.name === core).repo); + fs.writeFileSync(coreReadmeDestPath, updatedCoreReadmeContent, 'utf8'); + + packageJson.dependencies[`@emulatorjs/core-${core}`] = "latest"; + fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 4), 'utf8'); + } + console.log("EmulatorJS cores built successfully!"); + console.log("Ready to build EmulatorJS!"); + } +} diff --git a/data/compression/README.md b/data/compression/README.md new file mode 100644 index 00000000..86917796 --- /dev/null +++ b/data/compression/README.md @@ -0,0 +1,11 @@ +# Compression Libraries + + + +## Libunrar.js + +Emscripten port of RARLab's open-source unrar library + +Source: https://github.com/tnikolai2/libunrar-js diff --git a/data/compression/libunrar.js b/data/compression/libunrar.js index a30d300b..0ae56ba3 100644 --- a/data/compression/libunrar.js +++ b/data/compression/libunrar.js @@ -510,7 +510,7 @@ function ShowArcInfo(Flags) { if (typeof process === 'object' && typeof require === 'function') { // NODE module.exports = readRARContent } else if (typeof define === 'function' && define.amd) { // AMD - define('readRARContent', [], function () { return readRARContent }) + define('readRARContent', [], function() { return readRARContent }) } else if (typeof window === 'object') { // WEB window['readRARContent'] = readRARContent } else if (typeof importScripts === 'function') { // WORKER diff --git a/data/cores/.npmignore b/data/cores/.npmignore new file mode 100644 index 00000000..0cd7144e --- /dev/null +++ b/data/cores/.npmignore @@ -0,0 +1,3 @@ +* +!README.md +!package.json diff --git a/data/cores/README.md b/data/cores/README.md new file mode 100644 index 00000000..c897e7a0 --- /dev/null +++ b/data/cores/README.md @@ -0,0 +1,21 @@ +# EmulatorJS Cores + +This package contains the stable cores for EmulatorJS. + +Lean more about EmulatorJS at https://emulatorjs.org + +Cores are build using this repository: +https://github.com/EmulatorJS/build + +## How to install + +To install all cores, run the following command: + +```bash +npm install @emulatorjs/cores +``` +To install a specific core, run the following command: + +```bash +npm install @emulatorjs/core- +``` diff --git a/data/cores/core-README.md b/data/cores/core-README.md new file mode 100644 index 00000000..68407ac7 --- /dev/null +++ b/data/cores/core-README.md @@ -0,0 +1,24 @@ +# EmulatorJS Core: + +This package contains the stable EmulatorJS core: + +Lean more about EmulatorJS at https://emulatorjs.org + +Core repository: + + +Core is build using this repository: +https://github.com/EmulatorJS/build + +## How to install + +To install core, run the following command: + +```bash +npm install @emulatorjs/core- +``` +To install all cores, run the following command: + +```bash +npm install @emulatorjs/cores +``` diff --git a/data/cores/package.json b/data/cores/package.json new file mode 100644 index 00000000..2acaa6a8 --- /dev/null +++ b/data/cores/package.json @@ -0,0 +1,65 @@ +{ + "name": "@emulatorjs/cores", + "version": "4.2.3", + "type": "module", + "description": "EmulatorJS Cores", + "homepage": "https://emulatorjs.org", + "license": "GPL-3.0", + "repository": { + "type": "git", + "url": "https://github.com/EmulatorJS/EmulatorJS.git" + }, + "bugs": { + "url": "https://github.com/EmulatorJS/EmulatorJS/issues" + }, + "sideEffects": true, + "dependencies": { + "@emulatorjs/emulatorjs": "latest", + "@emulatorjs/core-81": "latest", + "@emulatorjs/core-mame2003": "latest", + "@emulatorjs/core-vice_x64": "latest", + "@emulatorjs/core-vice_x64sc": "latest", + "@emulatorjs/core-vice_x128": "latest", + "@emulatorjs/core-vice_xpet": "latest", + "@emulatorjs/core-vice_xplus4": "latest", + "@emulatorjs/core-vice_xvic": "latest", + "@emulatorjs/core-fceumm": "latest", + "@emulatorjs/core-nestopia": "latest", + "@emulatorjs/core-snes9x": "latest", + "@emulatorjs/core-gambatte": "latest", + "@emulatorjs/core-mgba": "latest", + "@emulatorjs/core-beetle_vb": "latest", + "@emulatorjs/core-mupen64plus_next": "latest", + "@emulatorjs/core-melonds": "latest", + "@emulatorjs/core-desmume2015": "latest", + "@emulatorjs/core-desmume": "latest", + "@emulatorjs/core-a5200": "latest", + "@emulatorjs/core-fbalpha2012_cps1": "latest", + "@emulatorjs/core-fbalpha2012_cps2": "latest", + "@emulatorjs/core-prosystem": "latest", + "@emulatorjs/core-stella2014": "latest", + "@emulatorjs/core-opera": "latest", + "@emulatorjs/core-genesis_plus_gx": "latest", + "@emulatorjs/core-yabause": "latest", + "@emulatorjs/core-handy": "latest", + "@emulatorjs/core-virtualjaguar": "latest", + "@emulatorjs/core-pcsx_rearmed": "latest", + "@emulatorjs/core-picodrive": "latest", + "@emulatorjs/core-fbneo": "latest", + "@emulatorjs/core-mednafen_psx_hw": "latest", + "@emulatorjs/core-mednafen_pce": "latest", + "@emulatorjs/core-mednafen_pcfx": "latest", + "@emulatorjs/core-mednafen_ngp": "latest", + "@emulatorjs/core-mednafen_wswan": "latest", + "@emulatorjs/core-gearcoleco": "latest", + "@emulatorjs/core-parallel_n64": "latest", + "@emulatorjs/core-mame2003_plus": "latest", + "@emulatorjs/core-puae": "latest", + "@emulatorjs/core-smsplus": "latest", + "@emulatorjs/core-fuse": "latest", + "@emulatorjs/core-cap32": "latest", + "@emulatorjs/core-crocods": "latest", + "@emulatorjs/core-prboom": "latest", + "@emulatorjs/core-ppsspp": "latest" + } +} diff --git a/data/emulator.css b/data/emulator.css index 68e362a8..27f916f2 100644 --- a/data/emulator.css +++ b/data/emulator.css @@ -17,25 +17,29 @@ font-size: 14px; } -.ejs_parent *, .ejs_parent *::after, .ejs_parent *::before { +.ejs_parent *, +.ejs_parent *::after, +.ejs_parent *::before { font-family: Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif; box-sizing: border-box; - + -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } -.ejs_parent ::-webkit-scrollbar{ +.ejs_parent ::-webkit-scrollbar { width: 8px; height: 16px; } -.ejs_parent ::-webkit-scrollbar-thumb{ + +.ejs_parent ::-webkit-scrollbar-thumb { border-radius: 10px; background: rgba(var(--ejs-primary-color)); } -.ejs_parent ::-webkit-scrollbar-track{ + +.ejs_parent ::-webkit-scrollbar-track { border-radius: 10px; background: rgba(64, 64, 64, 0.5) } @@ -47,9 +51,11 @@ z-index: 1; transform: translate(-50%, -50%); } + .ejs_ad_close { cursor: pointer; } + .ejs_ad_close:after { content: ""; position: absolute; @@ -59,6 +65,7 @@ border-bottom: 20px solid transparent; right: 0; } + .ejs_ad_close a { right: 4px; top: 4px; @@ -69,6 +76,7 @@ height: 15px; z-index: 99; } + .ejs_ad_close a:before { content: ""; border-bottom: 1px solid #fff; @@ -80,6 +88,7 @@ top: 0; right: 0; } + .ejs_ad_close a:after { content: ""; border-bottom: 1px solid #fff; @@ -112,20 +121,20 @@ .ejs_game_background_blur:before, .ejs_game_background_blur:after { - content: ""; - position: absolute; - width: 100%; - height: 100%; - background: var(--ejs-background-image); - background-repeat: no-repeat; - background-position: center; - background-size: contain; + content: ""; + position: absolute; + width: 100%; + height: 100%; + background: var(--ejs-background-image); + background-repeat: no-repeat; + background-position: center; + background-size: contain; } .ejs_game_background_blur:before { - background-size: cover; - filter: blur(10px); - transform: scale(1.1); + background-size: cover; + filter: blur(10px); + transform: scale(1.1); } .ejs_start_button { @@ -137,7 +146,7 @@ box-sizing: inherit; display: flex; justify-content: center; - text-shadow: 0 1px 1px rgba(0,0,0,0.5); + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5); font-size: 20px; line-height: 45px; text-transform: uppercase; @@ -153,26 +162,29 @@ color: #fff !important; border-radius: 35px; text-align: center; - background-color: rgba(var(--ejs-primary-color),1); - box-shadow: 0 0 0 0 #222, 0 0px 0px 0 #111, inset 0 0px 0px 0 rgba(250,250,250,0.2), inset 0 0px 0px 0px rgba(0,0,0,0.5); + background-color: rgba(var(--ejs-primary-color), 1); + box-shadow: 0 0 0 0 #222, 0 0px 0px 0 #111, inset 0 0px 0px 0 rgba(250, 250, 250, 0.2), inset 0 0px 0px 0px rgba(0, 0, 0, 0.5); } .ejs_start_button_border { border: 0.5px solid #333; } -.ejs_start_button:active, .ejs_start_button:hover { +.ejs_start_button:active, +.ejs_start_button:hover { animation: ejs_start_button_pulse 2s infinite; } @keyframes ejs_start_button_pulse { 50% { - box-shadow: 0 0 0 0 #222, 0 3px 7px 0 #111, inset 0 1px 1px 0 rgba(250,250,250,0.2), inset 0 0px 15px 1px rgba(0,0,0,0.5); + box-shadow: 0 0 0 0 #222, 0 3px 7px 0 #111, inset 0 1px 1px 0 rgba(250, 250, 250, 0.2), inset 0 0px 15px 1px rgba(0, 0, 0, 0.5); } - 0%, 100% { - box-shadow: 0 0 0 0 #222, 0 0px 0px 0 #111, inset 0 0px 0px 0 rgba(250,250,250,0.2), inset 0 0px 0px 0px rgba(0,0,0,0.5); + + 0%, + 100% { + box-shadow: 0 0 0 0 #222, 0 0px 0px 0 #111, inset 0 0px 0px 0 rgba(250, 250, 250, 0.2), inset 0 0px 0px 0px rgba(0, 0, 0, 0.5); } - } +} .ejs_loading_text { position: absolute; @@ -183,6 +195,8 @@ box-sizing: inherit; font-size: 12px; color: #bcbcbc; + text-align: center; + text-shadow: 0 0 5px rgba(0, 0, 0, 0.5); } .ejs_loading_text_glow { @@ -192,16 +206,31 @@ box-shadow: 0 0 30px rgba(0, 0, 0, 0.9); } +.ejs_error_text { + bottom: 10%; + color: #F82300; + border-radius: 15px; + padding: 1.5px 8px 1.5px 8px; + font-weight: bold; + background-color: rgba(0, 0, 0, 0.6); + box-shadow: 0 0 5px rgba(0, 0, 0, 0.7); +} + .ejs_canvas { width: 100%; height: 100%; } +.ejs_canvas_parent { + width: 100%; + height: 100%; +} + .ejs_context_menu { position: absolute; display: none; z-index: 9; - background: rgba(16,16,16,0.9); + background: rgba(16, 16, 16, 0.9); border-radius: 3px; font-size: 13px; min-width: 140px; @@ -219,6 +248,7 @@ display: block; font-size: 13px; } + .ejs_context_menu ul { color: #999; display: block; @@ -229,30 +259,37 @@ } .ejs_context_menu li:hover { - background: rgba(var(--ejs-primary-color),1); + background: rgba(var(--ejs-primary-color), 1); border-radius: 4px; - box-shadow: 0 0 0 5px rgba(var(--ejs-primary-color),0.5); + box-shadow: 0 0 0 5px rgba(var(--ejs-primary-color), 0.5); outline: 0; } + .ejs_context_menu li:hover a { color: #fff; } +.ejs_context_menu_tab { + text-align: center; + width: 100%; + padding: 10px; + overflow-wrap: anywhere; +} + .ejs_list_selector { - background: rgba(0,0,0,0.5); + background: rgba(0, 0, 0, 0.5); border-radius: 3px; font-size: 13px; min-width: 140px; padding: 8px; box-sizing: inherit; - float: left; - position: absolute; width: 10%; max-width: 15%; top: 10%; left: 0px; height: 80%; overflow: auto; + position: sticky; } .ejs_list_selector li { @@ -261,10 +298,11 @@ } .ejs_list_selector li a { - color: #999 !important; + color: #999; display: block; font-size: 13px; } + .ejs_list_selector ul { color: #999 !important; display: block; @@ -275,61 +313,84 @@ } .ejs_list_selector li:hover { - background: rgba(var(--ejs-primary-color),1); + background: rgba(var(--ejs-primary-color), 1); border-radius: 4px; - box-shadow: 0 0 0 5px rgba(var(--ejs-primary-color),0.5); + box-shadow: 0 0 0 5px rgba(var(--ejs-primary-color), 0.5); outline: 0; } + .ejs_list_selector li:hover a { color: #fff !important; } +.ejs_active_list_element { + background: rgba(var(--ejs-primary-color), 1); + border-radius: 4px; + box-shadow: 0 0 0 5px rgba(var(--ejs-primary-color), 0.25); + outline: 0; + color: #fff !important; +} + +.ejs_active_list_element a { + color: #fff !important; +} + .ejs_svg_rotate { transform: rotate(90deg); } + .ejs_small_screen .ejs_settings_parent::before { border: none; } + .ejs_small_screen .ejs_settings_parent::after { border: none; } + .ejs_small_screen .ejs_settings_center_right { right: -35% } + .ejs_small_screen .ejs_settings_center_left { right: -135% } + .ejs_small_screen .ejs_settings_center_right::after { right: 25%; } + .ejs_small_screen .ejs_settings_center_left::after { left: 25%; } + .ejs_small_screen .ejs_menu_bar { - transition: opacity .4s ease-in-out,transform .4s ease-in-out; + transition: opacity .4s ease-in-out, transform .4s ease-in-out; position: absolute; - transform: translate(-50%,0); + transform: translate(-50%, 0); width: 300px; max-height: 260px; display: flex; flex-wrap: wrap; align-items: flex-start; - background: rgba(0,0,0,.9); + background: rgba(0, 0, 0, .9); padding: 10px; z-index: 9999; left: 50%; bottom: 0; + color: #fff; } + .ejs_small_screen .ejs_menu_bar_hidden { opacity: 0; pointer-events: none; transform: translate(-50%, 100%); } + .ejs_small_screen .ejs_menu_button { width: 135px; margin: 0px; - margin-left: 2px!important; - margin-right: 0!important; + margin-left: 2px !important; + margin-right: 0 !important; line-height: 1; background: 0 0; border: 0; @@ -342,29 +403,36 @@ position: relative; transition: all .3s ease; } + .ejs_small_screen .ejs_menu_button:hover { - background: rgba(var(--ejs-primary-color),1); + background: rgba(var(--ejs-primary-color), 1); color: #fff; + box-shadow: none; } + .ejs_small_screen .ejs_menu_button svg { float: left; transition: transform .3s ease; } + .ejs_small_screen .ejs_menu_text { position: static; color: #fff; background: 0 0; opacity: 1; padding: 0; - transform: scale(.8)!important; + transform: scale(.8) !important; font-size: 12px; } + .ejs_small_screen .ejs_menu_bar_spacer { - display:none; + display: none; } + .ejs_small_screen .ejs_volume_parent span { display: none; } + .ejs_small_screen .ejs_volume_parent button { width: 30px; } @@ -374,24 +442,30 @@ pointer-events: none; transform: translateY(100%); } + .ejs_big_screen .ejs_settings_parent { right: -3px; } + /* .ejs_big_screen .ejs_settings_parent::after { right: 15px; } */ .ejs_big_screen .ejs_settings_text { display: none; } + .ejs_big_screen .ejs_disks_text { display: none; } + .ejs_big_screen .ejs_menu_bar_spacer { - flex:1; + flex: 1; } + .ejs_big_screen .ejs_menu_button svg { transition: transform .3s ease; } + .ejs_big_screen .ejs_menu_button { width: auto; margin: auto; @@ -411,12 +485,13 @@ } .ejs_big_screen .ejs_menu_button:hover { - background: rgba(var(--ejs-primary-color),1); + background: rgba(var(--ejs-primary-color), 1); color: #fff; + box-shadow: none; } .ejs_big_screen .ejs_menu_button:hover .ejs_menu_text { - transform: translate(0,0) scale(1); + transform: translate(0, 0) scale(1); opacity: 1; } @@ -427,10 +502,10 @@ .ejs_big_screen .ejs_menu_text { left: 0; - background: rgba(255,255,255,0.9); + background: rgba(255, 255, 255, 0.9); border-radius: 3px; bottom: 100%; - box-shadow: 0 1px 2px rgba(0,0,0,0.15); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); color: #4f5b5f; font-size: 14px; font-weight: 500; @@ -440,9 +515,9 @@ padding: 5px 7.5px; pointer-events: none; position: absolute; - transform: translate(0,10px) scale(0.8); + transform: translate(0, 10px) scale(0.8); transform-origin: 0 100%; - transition: transform .2s .1s ease,opacity .2s .1s ease; + transition: transform .2s .1s ease, opacity .2s .1s ease; white-space: nowrap; z-index: 2; } @@ -450,7 +525,7 @@ .ejs_big_screen .ejs_menu_text::before { border-left: 4px solid transparent; border-right: 4px solid transparent; - border-top: 4px solid rgba(255,255,255,0.9); + border-top: 4px solid rgba(255, 255, 255, 0.9); bottom: -4px; content: ''; height: 0; @@ -460,14 +535,16 @@ width: 0; z-index: 2; } + .ejs_big_screen .ejs_menu_text_right::before { left: auto !important; right: 16px; transform: translateX(50%) !important; } + .ejs_big_screen .ejs_menu_bar { padding: 15px 10px 10px; - background: linear-gradient(rgba(0,0,0,0),rgba(0,0,0,0.7)); + background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.7)); border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; bottom: 0; @@ -475,7 +552,7 @@ left: 0; position: absolute; right: 0; - transition: opacity .4s ease-in-out,transform .4s ease-in-out; + transition: opacity .4s ease-in-out, transform .4s ease-in-out; z-index: 9999; align-items: center; display: flex; @@ -483,6 +560,10 @@ text-align: center; } +.ejs_menu_button.shadow { + background: rgba(0, 0, 0, 0.7); + box-shadow: 0 0 5px 1px rgba(0, 0, 0, 0.7); +} .ejs_menu_bar svg { display: block; @@ -493,7 +574,7 @@ } .ejs_popup_container { - background: rgba(0,0,0,0.8); + background: rgba(0, 0, 0, 0.8); text-align: center; z-index: 9999; height: 100%; @@ -504,10 +585,12 @@ color: #ccc; } -.ejs_popup_container *, .ejs_popup_container *::after, .ejs_popup_container *::before { +.ejs_popup_container *, +.ejs_popup_container *::after, +.ejs_popup_container *::before { box-sizing: border-box; - color: #bcbcbc !important; - + color: #bcbcbc; + -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; @@ -529,7 +612,7 @@ padding-top: .5rem; padding-bottom: .5rem; display: inline-block; - background-color: rgba(var(--ejs-primary-color),1); + background-color: rgba(var(--ejs-primary-color), 1); margin: 0 10px; color: #fff !important; touch-action: manipulation; @@ -553,17 +636,21 @@ font-weight: 700; color: #000 !important; } + .ejs_control_player_bar { margin: 0; padding: 0; } + .ejs_control_player_bar ul { list-style: none; } + .ejs_control_player_bar li { color: #bcbcbc !important; display: inline-block; } + .ejs_control_player_bar a { padding: 2px 5px; color: #bcbcbc !important; @@ -571,10 +658,16 @@ cursor: pointer; } +.ejs_control_player_bar li:hover:not(.ejs_control_selected) { + background-color: #333; + border-bottom: 1px solid #333; +} + .ejs_control_selected { border-bottom: 1px solid #fff; background-color: #fff; } + .ejs_control_selected a { color: #000 !important; } @@ -582,10 +675,11 @@ .ejs_control_bar:hover { background-color: #2d2d2d; } + .ejs_control_set_button { float: none; padding: .1rem .5rem; - background-color: rgba(var(--ejs-primary-color),1); + background-color: rgba(var(--ejs-primary-color), 1); color: #fff !important; border-radius: .25rem; cursor: pointer; @@ -607,7 +701,7 @@ margin-left: -150px; margin-top: -50px; left: 50%; - background: rgba(0,0,0,0.8) !important; + background: rgba(0, 0, 0, 0.8) !important; padding: 15px 0; } @@ -616,11 +710,13 @@ position: absolute; bottom: 50px; } + .ejs_virtualGamepad_top { position: absolute; bottom: 250px; width: 100%; } + .ejs_virtualGamepad_bottom { position: absolute; bottom: 10px; @@ -629,6 +725,7 @@ left: 50%; margin-left: -62px; } + .ejs_virtualGamepad_left { position: absolute; bottom: 50px; @@ -636,6 +733,7 @@ height: 125px; left: 10px; } + .ejs_virtualGamepad_right { position: absolute; bottom: 50px; @@ -643,6 +741,7 @@ height: 130px; right: 10px; } + .ejs_virtualGamepad_button { position: absolute; font-size: 20px; @@ -654,12 +753,13 @@ border-radius: 50%; font-size: 30px; font-weight: bold; - background-color: rgba(255,255,255,0.15); + background-color: rgba(255, 255, 255, 0.15); user-select: none; transition: all .2s; } + .ejs_virtualGamepad_button_down { - background-color:#000000ad; + background-color: #000000ad; } .ejs_dpad_main { @@ -671,100 +771,112 @@ height: 100%; opacity: .7; } + .ejs_dpad_horizontal { width: 100%; height: 36px; - transform: translate(0,-50%); + transform: translate(0, -50%); position: absolute; left: 0; top: 50%; border-radius: 5px; overflow: hidden; } + .ejs_dpad_horizontal:before { content: ""; position: absolute; left: 0; top: 50%; z-index: 1; - transform: translate(0,-50%); + transform: translate(0, -50%); width: 0; height: 0; border: 8px solid; border-color: transparent #333 transparent transparent; } + .ejs_dpad_horizontal:after { content: ""; position: absolute; right: 0; top: 50%; z-index: 1; - transform: translate(0,-50%); + transform: translate(0, -50%); width: 0; height: 0; border: 8px solid; border-color: transparent transparent transparent #333; } + .ejs_dpad_vertical { width: 36px; height: 100%; - transform: translate(-50%,0); + transform: translate(-50%, 0); position: absolute; left: 50%; border-radius: 5px; overflow: hidden; } + .ejs_dpad_vertical:before { content: ""; position: absolute; top: 0; left: 50%; z-index: 1; - transform: translate(-50%,0); + transform: translate(-50%, 0); width: 0; height: 0; border: 8px solid; border-color: transparent transparent #333 transparent; } + .ejs_dpad_vertical:after { content: ""; position: absolute; bottom: 0; left: 50%; z-index: 1; - transform: translate(-50%,0); + transform: translate(-50%, 0); width: 0; height: 0; border: 8px solid; border-color: #333 transparent transparent transparent; } + .ejs_dpad_bar { position: absolute; width: 100%; height: 100%; background: #787878; } + .ejs_dpad_left_pressed .ejs_dpad_horizontal:before { - border-right-color:#fff; + border-right-color: #fff; } + .ejs_dpad_right_pressed .ejs_dpad_horizontal:after { - border-left-color:#fff; + border-left-color: #fff; } + .ejs_dpad_up_pressed .ejs_dpad_vertical:before { - border-bottom-color:#fff; + border-bottom-color: #fff; } + .ejs_dpad_down_pressed .ejs_dpad_vertical:after { - border-top-color:#fff + border-top-color: #fff } -@keyframes ejs_settings_parent_animation{ - 0%{ - opacity:0.5; - transform:translateY(10px) +@keyframes ejs_settings_parent_animation { + 0% { + opacity: 0.5; + transform: translateY(10px) } - to{ - opacity:1; - transform:translateY(0) + + to { + opacity: 1; + transform: translateY(0) } } @@ -776,7 +888,7 @@ border-style: solid; border-color: rgba(49, 49, 49, 0.9); bottom: 100%; - box-shadow: 0 1px 2px rgba(0,0,0,0.15); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); color: #4f5b5f; font-size: 16px; margin-bottom: 10px; @@ -787,6 +899,7 @@ backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); } + /* .ejs_settings_parent::after { border: 5px solid transparent; border-top-color: rgba(119, 119, 119, 0.9); @@ -796,7 +909,8 @@ top: 100%; width: 0; } */ -.ejs_settings_parent::before, .ejs_settings_parent::after { +.ejs_settings_parent::before, +.ejs_settings_parent::after { position: absolute; right: 15px; width: 0; @@ -807,18 +921,22 @@ border-top-width: 5px; border-top-style: solid; } + .ejs_settings_parent::before { top: calc(100% + 1px); border-top-color: rgba(49, 49, 49, 0.9); } + .ejs_settings_parent::after { top: 100%; border-top-color: rgba(29, 29, 29, 0.9); } + .ejs_settings_transition { overflow: hidden; - transition: height .35s cubic-bezier(0.4,0,0.2,1),width .35s cubic-bezier(0.4,0,0.2,1); + transition: height .35s cubic-bezier(0.4, 0, 0.2, 1), width .35s cubic-bezier(0.4, 0, 0.2, 1); } + .ejs_settings_main_bar { align-items: center; color: #999; @@ -837,28 +955,33 @@ transition: all .3s ease; box-sizing: border-box; } + .ejs_settings_main_bar::after { border: 4px solid transparent; content: ''; position: absolute; top: 50%; transform: translateY(-50%); - border-left-color: rgba(79,91,95,0.8); + border-left-color: rgba(79, 91, 95, 0.8); right: 5px; } + .ejs_settings_main_bar>span { align-items: inherit; display: flex; width: 100%; } + .ejs_settings_main_bar:hover { - background: rgba(var(--ejs-primary-color),1); + background: rgba(var(--ejs-primary-color), 1); color: #fff; cursor: pointer; } + .ejs_settings_main_bar:hover::after { border-left-color: currentColor; } + .ejs_settings_main_bar_selected { align-items: center; display: flex; @@ -868,9 +991,20 @@ padding-left: 25px; pointer-events: none; } + .ejs_setting_menu { padding: 7px; + overflow-x: hidden; + overflow-y: auto; +} + +.ejs_parent_option_div { + display: flex; + flex-direction: column; + max-height: inherit; + overflow: hidden; } + .ejs_back_button { font-weight: 500; margin: 7px; @@ -884,7 +1018,7 @@ font-size: 13px; padding: 4px 11px; user-select: none; - + background: transparent; border: 0; border-radius: 3px; @@ -893,13 +1027,16 @@ overflow: visible; transition: all .3s ease; } + .ejs_back_button:hover { - background: rgba(var(--ejs-primary-color),1); + background: rgba(var(--ejs-primary-color), 1); color: #fff; } + .ejs_back_button:hover::after { border-right-color: currentColor; } + .ejs_back_button::before { background: #b7c5cd; box-shadow: 0 1px 0 #fff; @@ -912,15 +1049,17 @@ right: 0; top: 100%; } + .ejs_back_button::after { border: 4px solid transparent; - border-right-color: rgba(79,91,95,0.8); + border-right-color: rgba(79, 91, 95, 0.8); left: 7px; content: ''; position: absolute; top: 50%; transform: translateY(-50%); } + .ejs_menu_text_a { align-items: center; display: flex; @@ -929,14 +1068,17 @@ user-select: none; width: 100%; } + .ejs_option_row { padding-left: 7px; } + .ejs_option_row:hover::before { - background: rgba(0,0,0,0.1); + background: rgba(0, 0, 0, 0.1); } + .ejs_option_row::before { - background: rgba(204,204,204,0.1); + background: rgba(204, 204, 204, 0.1); content: ''; display: block; flex-shrink: 0; @@ -946,6 +1088,7 @@ width: 16px; border-radius: 100%; } + .ejs_option_row::after { background: #fff; border: 0; @@ -954,24 +1097,28 @@ opacity: 0; top: 50%; transform: translateY(-50%) scale(0); - transition: transform .3s ease,opacity .3s ease; + transition: transform .3s ease, opacity .3s ease; width: 6px; border-radius: 100%; content: ''; position: absolute; } + .ejs_option_row_selected::before { - background: rgba(var(--ejs-primary-color),1); + background: rgba(var(--ejs-primary-color), 1); } + .ejs_option_row_selected::after { opacity: 1; transform: translateY(-50%) scale(1); } + .ejs_option_row>span { align-items: center; display: flex; width: 100%; } + .ejs_button_style { margin: 0px; background: transparent; @@ -983,7 +1130,7 @@ padding: 7px; position: relative; transition: all .3s ease; - + align-items: center; color: #999; display: flex; @@ -991,8 +1138,9 @@ user-select: none; width: 100%; } + .ejs_button_style:hover { - background: rgba(var(--ejs-primary-color),1); + background: rgba(var(--ejs-primary-color), 1); color: #fff; } @@ -1002,8 +1150,9 @@ font-weight: 600 !important; font-size: 1.25rem; line-height: 1.25 !important; - color: rgba(var(--ejs-primary-color),1) !important; + color: rgba(var(--ejs-primary-color), 1) !important; } + .ejs_cheat_close { font: inherit; line-height: inherit; @@ -1013,6 +1162,7 @@ color: #bcbcbc !important; cursor: pointer; } + .ejs_cheat_close::before { content: "\2715"; color: #bcbcbc !important; @@ -1020,37 +1170,43 @@ line-height: inherit; width: auto; } + .ejs_cheat_header { display: flex; justify-content: space-between; align-items: center; } + .ejs_cheat_main { margin-top: 2rem; margin-bottom: 2rem; line-height: 1.5; - color: rgba(0,0,0,0.8); + color: rgba(0, 0, 0, 0.8); text-align: left; color: #bcbcbc !important; border: unset; } + .ejs_cheat_code { color: #000 !important; font-size: 1rem; padding: .4rem; max-width: 100%; } -@keyframes ejs_cheat_animation{ - from{ - transform:translateY(15%) + +@keyframes ejs_cheat_animation { + from { + transform: translateY(15%) } - to{ - transform:translateY(0) + + to { + transform: translateY(0) } } + .ejs_cheat_parent { - background-color: rgba(0,0,0,0.8); - border: 1px solid rgba(238,238,238,0.2); + background-color: rgba(0, 0, 0, 0.8); + border: 1px solid rgba(238, 238, 238, 0.2); padding: 30px; min-width: 200px; max-width: 500px; @@ -1059,26 +1215,29 @@ overflow-y: auto; box-sizing: border-box; will-change: transform; - animation: ejs_cheat_animation .3s cubic-bezier(0,0,0.2,1); + animation: ejs_cheat_animation .3s cubic-bezier(0, 0, 0.2, 1); font-size: 14px; } + .ejs_popup_container_box { position: absolute; top: 0; left: 0; right: 0; bottom: 0; - background: rgba(0,0,0,0.6); + background: rgba(0, 0, 0, 0.6); display: flex; justify-content: center; align-items: center; } + .ejs_popup_submit { touch-action: manipulation; font: inherit; line-height: inherit; width: auto; } + .ejs_button_button { color: #fff !important; padding-left: 1rem; @@ -1096,11 +1255,13 @@ overflow: visible; margin: 0; will-change: transform; - transition: transform .25s ease-out,-webkit-transform .25s ease-out; + transition: transform .25s ease-out, -webkit-transform .25s ease-out; } + .ejs_button_button:hover { transform: scale(1.05); } + .ejs_cheat_rows { max-width: 320px; margin: 0 auto; @@ -1109,15 +1270,18 @@ float: none; user-select: text !important; } + .ejs_cheat_row { padding-left: 2.25rem; position: relative; padding: .2em 0; clear: both; } + .ejs_cheat_row:hover { - background-color: rgba(0,0,0,0.8); + background-color: rgba(0, 0, 0, 0.8); } + .ejs_cheat_row input[type=checkbox] { position: absolute; z-index: -1; @@ -1125,6 +1289,7 @@ box-sizing: border-box; width: auto; } + .ejs_cheat_row label { position: relative; margin-bottom: 0; @@ -1148,8 +1313,8 @@ .ejs_cheat_row input:checked+label::before { color: #fff; - border-color: rgba(var(--ejs-primary-color),1); - background-color: rgba(var(--ejs-primary-color),1); + border-color: rgba(var(--ejs-primary-color), 1); + background-color: rgba(var(--ejs-primary-color), 1); } .ejs_cheat_row label::after { @@ -1164,8 +1329,9 @@ height: calc(1rem - 4px); background-color: #adb5bd; border-radius: .5rem; - transition: transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-transform .15s ease-in-out; + transition: transform .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out, -webkit-transform .15s ease-in-out; } + .ejs_cheat_row input:checked+label::after { background-color: #fff; -webkit-transform: translateX(0.75rem); @@ -1175,7 +1341,7 @@ .ejs_cheat_row_button { position: absolute; padding: .1rem .5rem; - background-color: rgba(var(--ejs-primary-color),1); + background-color: rgba(var(--ejs-primary-color), 1); color: #fff !important; border-radius: .25rem; cursor: pointer; @@ -1186,141 +1352,159 @@ .ejs_small_screen .ejs_volume_parent input[type='range'] { width: 100%; } + .ejs_big_screen .ejs_volume_parent { max-width: 110px; } + .ejs_volume_parent { align-items: center; display: flex; flex: 1; position: relative; } + .ejs_volume_parent { padding-right: 15px; } + +.ejs_volume_parent::-webkit-media-controls { + display: none; +} + .ejs_volume_parent input[type='range'] { display: block; + -webkit-appearance: none; + appearance: none; + border: 0; + border-radius: 28px; + color: rgba(var(--ejs-primary-color), 1); + margin: 0; + padding: 0; + transition: box-shadow 0.3s ease; + width: 100%; + background: white; + height: 6px; } -.ejs_volume_parent::-webkit-media-controls{ - display: none; + +.ejs_volume_parent input[type='range']::-webkit-slider-runnable-track { + background-color: rgba(255, 255, 255, 0.25); + outline: 0; + background: transparent; + border: 0; + border-radius: 3px; + height: 6px; + transition: box-shadow 0.3s ease; + user-select: none; + background-image: linear-gradient(to right, currentColor var(--value, 0%), transparent var(--value, 0%)) } -.ejs_volume_parent input[type='range']{ - -webkit-appearance:none; - appearance: none; - border:0; - border-radius:28px; - color:rgba(var(--ejs-primary-color), 1); - margin:0; - padding:0; - transition:box-shadow 0.3s ease; - width:100% -} - -.ejs_volume_parent input[type='range']::-webkit-slider-runnable-track{ - background-color:rgba(255,255,255,0.25); - outline:0; + +.ejs_volume_parent input[type='range']::-webkit-slider-thumb { + background: #fff; + border: 0; + border-radius: 100%; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(47, 52, 61, 0.2); + height: 14px; + position: relative; + transition: all 0.2s ease; + width: 14px; + -webkit-appearance: none; + margin-top: -4px +} + +.ejs_volume_parent input[type='range']::-moz-range-track { + background-color: rgba(255, 255, 255, 0.25); + outline: 0; + background: transparent; + border: 0; + border-radius: 3px; + height: 6px; + transition: box-shadow 0.3s ease; + user-select: none +} + +.ejs_volume_parent input[type='range']::-moz-range-thumb { + background: #fff; + border: 0; + border-radius: 100%; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(47, 52, 61, 0.2); + height: 14px; + position: relative; + transition: all 0.2s ease; + width: 14px +} + +.ejs_volume_parent input[type='range']::-moz-range-progress { + background: currentColor; + border-radius: 3px; + height: 6px +} + +.ejs_volume_parent input[type='range']::-ms-track { + background-color: rgba(255, 255, 255, 0.25); + outline: 0; background: transparent; - border:0; - border-radius:3px; - height:6px; - transition:box-shadow 0.3s ease; - user-select:none; - background-image:linear-gradient(to right, currentColor var(--value, 0%), transparent var(--value, 0%)) -} -.ejs_volume_parent input[type='range']::-webkit-slider-thumb{ - background:#fff; - border:0; - border-radius:100%; - box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2); - height:14px; - position:relative; - transition:all 0.2s ease; - width:14px; - -webkit-appearance:none; - margin-top:-4px -} -.ejs_volume_parent input[type='range']::-moz-range-track{ - background-color:rgba(255,255,255,0.25); - outline:0; - background:transparent; - border:0; - border-radius:3px; - height:6px; - transition:box-shadow 0.3s ease; - user-select:none -} -.ejs_volume_parent input[type='range']::-moz-range-thumb{ - background:#fff; - border:0; - border-radius:100%; - box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2); - height:14px; - position:relative; - transition:all 0.2s ease; - width:14px -} -.ejs_volume_parent input[type='range']::-moz-range-progress{ - background:currentColor; - border-radius:3px; - height:6px -} -.ejs_volume_parent input[type='range']::-ms-track{ - background-color:rgba(255,255,255,0.25); - outline:0; - background:transparent; - border:0; - border-radius:3px; - height:6px; - transition:box-shadow 0.3s ease; - user-select:none; - color:transparent -} -.ejs_volume_parent input[type='range']::-ms-fill-upper{ - background:transparent; - border:0; - border-radius:3px; - height:6px; - transition:box-shadow 0.3s ease; - user-select:none -} -.ejs_volume_parent input[type='range']::-ms-fill-lower{ - background:transparent; - border:0; - border-radius:3px; - height:6px; - transition:box-shadow 0.3s ease; - user-select:none; - background:currentColor -} -.ejs_volume_parent input[type='range']::-ms-thumb{ - background:#fff; - border:0; - border-radius:100%; - box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2); - height:14px; - position:relative; - transition:all 0.2s ease; - width:14px; - margin-top:0 -} -.ejs_volume_parent input[type='range']::-ms-tooltip{ - display:none -} -.ejs_volume_parent input[type='range']:focus{ - outline:0 -} -.ejs_volume_parent input[type='range']::-moz-focus-outer{ - border:0 + border: 0; + border-radius: 3px; + height: 6px; + transition: box-shadow 0.3s ease; + user-select: none; + color: transparent +} + +.ejs_volume_parent input[type='range']::-ms-fill-upper { + background: transparent; + border: 0; + border-radius: 3px; + height: 6px; + transition: box-shadow 0.3s ease; + user-select: none +} + +.ejs_volume_parent input[type='range']::-ms-fill-lower { + background: transparent; + border: 0; + border-radius: 3px; + height: 6px; + transition: box-shadow 0.3s ease; + user-select: none; + background: currentColor +} + +.ejs_volume_parent input[type='range']::-ms-thumb { + background: #fff; + border: 0; + border-radius: 100%; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(47, 52, 61, 0.2); + height: 14px; + position: relative; + transition: all 0.2s ease; + width: 14px; + margin-top: 0 +} + +.ejs_volume_parent input[type='range']::-ms-tooltip { + display: none +} + +.ejs_volume_parent input[type='range']:focus { + outline: 0 +} + +.ejs_volume_parent input[type='range']::-moz-focus-outer { + border: 0 } .ejs_volume_parent input[type='range']:active::-webkit-slider-thumb { - box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2),0 0 0 3px rgba(255,255,255,0.5) + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(47, 52, 61, 0.2), 0 0 0 3px rgba(255, 255, 255, 0.5) } + .ejs_volume_parent input[type='range']:active::-moz-range-thumb { - box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2),0 0 0 3px rgba(255,255,255,0.5) + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(47, 52, 61, 0.2), 0 0 0 3px rgba(255, 255, 255, 0.5) } + .ejs_volume_parent input[type='range']:active::-ms-thumb { - box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2),0 0 0 3px rgba(255,255,255,0.5) + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(47, 52, 61, 0.2), 0 0 0 3px rgba(255, 255, 255, 0.5) } .ejs_message { @@ -1337,15 +1521,17 @@ .ejs_virtualGamepad_open { display: inline-block; - width: 30px; - height: 30px; + width: 24px; + height: 24px; color: #fff; position: absolute; top: 5px; right: 5px; opacity: .5; z-index: 999; + cursor: pointer; } + .ejs_virtualGamepad_open svg { fill: currentColor; } @@ -1354,45 +1540,75 @@ margin-top: .5rem; margin-bottom: .5rem; line-height: 1.5; - color: rgba(0,0,0,.8); + color: rgba(0, 0, 0, .8); text-align: left; } -.ejs_netplay_header input, .ejs_netplay_header select { + +.ejs_netplay_header input, +.ejs_netplay_header select { font-size: 1rem; padding: .4rem; max-width: 100%; - color: #000!important; - background-color: #fff!important; + color: #000 !important; + background-color: #fff !important; margin: 0; height: 2rem; display: block; font-family: Arial; border: 0px; } + .ejs_netplay_name_heading { - margin-top: 0!important; - margin-bottom: 0!important; - font-weight: 600!important; + margin-top: 0 !important; + margin-bottom: 0 !important; + font-weight: 600 !important; font-size: 1.25rem; - line-height: 1.25!important; - color: rgba(var(--ejs-primary-color),1)!important; + line-height: 1.25 !important; + color: rgba(var(--ejs-primary-color), 1) !important; display: flex; justify-content: space-between; align-items: center; } + .ejs_netplay_table { - font-family: Avenir,"Avenir Next","Helvetica Neue","Segoe UI",Helvetica,Arial,sans-serif; + font-family: Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif; font-size: 0.8rem; padding: 0 10px; } + .ejs_netplay_join_button { float: none; padding: .1rem .5rem; - background-color: rgba(var(--ejs-primary-color),1); - color: #fff!important; + background-color: rgba(var(--ejs-primary-color), 1); + color: #fff !important; border-radius: .25rem; cursor: pointer; } + .ejs_netplay_table_row:hover { background-color: #2d2d2d; } + +.ejs_gamepad_dropdown { + background-color: var(--ejs-background-color); + color: white; + border: none; + padding: 8px 12px; + border-radius: 6px; + font-family: inherit; + outline: none; + cursor: pointer; + font-size: inherit; +} + +.ejs_gamepad_dropdown:focus, .ejs_gamepad_dropdown:active, .ejs_gamepad_dropdown:hover { + box-shadow: 0 0 0 2px rgba(51, 153, 255, 0.6); + background-color: var(--ejs-background-color); +} + +.ejs_gamepad_section { + font-size: 12px; + justify-content: center; + display: flex; + align-items: center; +} diff --git a/data/loader.js b/data/loader.js index b0dd84fc..62d22814 100644 --- a/data/loader.js +++ b/data/loader.js @@ -10,15 +10,15 @@ "compression.js" ]; - const folderPath = (path) => path.substring(0, path.length - path.split('/').pop().length); + const folderPath = (path) => path.substring(0, path.length - path.split("/").pop().length); let scriptPath = (typeof window.EJS_pathtodata === "string") ? window.EJS_pathtodata : folderPath((new URL(document.currentScript.src)).pathname); - if (!scriptPath.endsWith('/')) scriptPath+='/'; + if (!scriptPath.endsWith("/")) scriptPath += "/"; //console.log(scriptPath); function loadScript(file) { - return new Promise(function (resolve, reject) { - let script = document.createElement('script'); + return new Promise(function(resolve) { + let script = document.createElement("script"); script.src = function() { - if ('undefined' != typeof EJS_paths && typeof EJS_paths[file] === 'string') { + if ("undefined" != typeof EJS_paths && typeof EJS_paths[file] === "string") { return EJS_paths[file]; } else if (file.endsWith("emulator.min.js")) { return scriptPath + file; @@ -33,15 +33,16 @@ document.head.appendChild(script); }) } + function loadStyle(file) { - return new Promise(function(resolve, reject) { - let css = document.createElement('link'); - css.rel = 'stylesheet'; + return new Promise(function(resolve) { + let css = document.createElement("link"); + css.rel = "stylesheet"; css.href = function() { - if ('undefined' != typeof EJS_paths && typeof EJS_paths[file] === 'string') { + if ("undefined" != typeof EJS_paths && typeof EJS_paths[file] === "string") { return EJS_paths[file]; } else { - return scriptPath+file; + return scriptPath + file; } }(); css.onload = resolve; @@ -55,27 +56,27 @@ async function filesmissing(file) { console.error("Failed to load " + file); let minifiedFailed = file.includes(".min.") && !file.includes("socket"); - console[minifiedFailed?"warn":"error"]("Failed to load " + file + " beacuse it's likly that the minified files are missing.\nTo fix this you have 3 options:\n1. You can download the zip from the latest release here: https://github.com/EmulatorJS/EmulatorJS/releases/latest - Stable\n2. You can download the zip from here: https://cdn.emulatorjs.org/latest/data/emulator.min.zip and extract it to the data/ folder. (easiest option) - Beta\n3. You can build the files by running `npm i && npm run build` in the data/minify folder. (hardest option) - Beta\nNote: you will probably need to do the same for the cores, extract them to the data/cores/ folder."); + console[minifiedFailed ? "warn" : "error"]("Failed to load " + file + " beacuse it's likly that the minified files are missing.\nTo fix this you have 3 options:\n1. You can download the zip from the latest release here: https://github.com/EmulatorJS/EmulatorJS/releases/latest - Stable\n2. You can download the zip from here: https://cdn.emulatorjs.org/latest/data/emulator.min.zip and extract it to the data/ folder. (easiest option) - Beta\n3. You can build the files by running `npm i && npm run build` in the data/minify folder. (hardest option) - Beta\nNote: you will probably need to do the same for the cores, extract them to the data/cores/ folder."); if (minifiedFailed) { console.log("Attempting to load non-minified files"); if (file === "emulator.min.js") { - for (let i=0; i defaultLangs.includes(lang); + if ((typeof window.EJS_language === "string" && !isDefaultLang(window.EJS_language)) || (systemLang && window.EJS_disableAutoLang !== false)) { + const language = window.EJS_language || systemLang; + const autoLang = !window.EJS_language && typeof systemLang === "string"; try { - let path; - if ('undefined' != typeof EJS_paths && typeof EJS_paths[window.EJS_language] === 'string') { - path = EJS_paths[window.EJS_language]; + let languagePath; + let fallbackPath = false; + console.log("Loading language", language); + if ("undefined" != typeof EJS_paths && typeof EJS_paths[language] === "string") { + languagePath = EJS_paths[language]; } else { - path = scriptPath+"localization/"+window.EJS_language+".json"; + languagePath = scriptPath + "localization/" + language + ".json"; + if (language.includes("-") || language.includes("_")) { + fallbackPath = scriptPath + "localization/" + language.split(/[-_]/)[0] + ".json"; + } + } + config.language = language; + let langJson = {}; + let missingLang = false; + if (!isDefaultLang(language)) { + if (autoLang) { + try { + let languageJson = await fetch(languagePath); + if (!languageJson.ok) throw new Error(`Missing language file: ${languageJson.status}`); + langJson = JSON.parse(await languageJson.text()); + if (fallbackPath) { + let fallbackJson = await fetch(fallbackPath); + missingLang = !fallbackJson.ok; + if (!fallbackJson.ok) throw new Error(`Missing language file: ${fallbackJson.status}`); + langJson = { ...JSON.parse(await fallbackJson.text()), ...langJson }; + } + } catch(e) { + config.language = language.split(/[-_]/)[0]; + console.warn("Failed to load language:", language + ",", "trying default language:", config.language); + if (!missingLang) { + langJson = JSON.parse(await (await fetch(fallbackPath)).text()); + } + } + } else { + langJson = JSON.parse(await (await fetch(languagePath)).text()); + } + config.langJson = langJson; } - config.language = window.EJS_language; - config.langJson = JSON.parse(await (await fetch(path)).text()); } catch(e) { - config.langJson = {}; + console.log("Missing language:", language, "!!"); + delete config.language; + delete config.langJson; } } - + window.EJS_emulator = new EmulatorJS(EJS_player, config); window.EJS_adBlocked = (url, del) => window.EJS_emulator.adBlocked(url, del); if (typeof window.EJS_ready === "function") { diff --git a/data/localization/README.md b/data/localization/README.md new file mode 100644 index 00000000..edbc8c21 --- /dev/null +++ b/data/localization/README.md @@ -0,0 +1,66 @@ +# Localization + +Supported languages + +`en.json`: `en-US` - English (US)
+`pt.json`: `pt-BR` - Portuguese (Brazil)
+`es.json`: `es-419` - Spanish (Latin America)
+`el.json`: `el-GR` - Greek (Modern Greek)
+`ja.json`: `ja-JP` - Japanese (Japan)
+`zh.json`: `zh-CN` - Chinese (Simplified)
+`hi.json`: `hi-IN` - Hindi (India)
+`ar.json`: `ar-SA` - Arabic (Saudi Arabia)
+`jv.json`: `jv-ID` - Javanese (Indonesia)
+`bn.json`: `bn-BD` - Bengali (Bangladesh)
+`ru.json`: `ru-RU` - Russian (Russia)
+`de.json`: `de-DE` - German (Germany)
+`ko.json`: `ko-KR` - Korean (South Korea)
+`fr.json`: `fr-FR` - French (France)
+`it.json`: `it-IT` - Italian (Italy)
+`tr.json`: `tr-TR` - Turkish (Turkey)
+`fa.json`: `fa-AF` - Persian (Afghanistan)
+`ro.json`: `ro-RO` - Romanian (Romania)
+`vi.json`: `vi-VN` - Vietnamese (Vietnam)
+ +default: `en-US` + +add the line to your code to use + +``` +EJS_language = ''; //language +``` + +If the language file is not found or there was an error fetching the file, the emulator will default to english. + +## Credits + +Translated for `es-419` originally by [@cesarcristianodeoliveira](https://github.com/cesarcristianodeoliveira) and updated by [@angelmarfil](https://github.com/angelmarfil)
+Translated for `el-GR` by [@imneckro](https://github.com/imneckro)
+Translated for `pt-BR` by [@zmarteline](https://github.com/zmarteline)
+Translated for `zh-CN` by [@eric183](https://github.com/eric183)
+Translated for `it-IT` by [@IvanMazzoli](https://github.com/IvanMazzoli)
+Translated for `tr-TR` by [@iGoodie](https://github.com/iGoodie)
+Translated for `fa-AF` by [@rezamohdev](https://github.com/rezamohdev)
+Translated for `fr-FR` by [@t3chnob0y](https://github.com/t3chnob0y)
+Translated for `ro-RO` by [@jurcaalexandrucristian](https://github.com/jurcaalexandrucristian)
+Translated for `ja-JP` by [@noel-forester](https://github.com/noel-forester)
+Translated for `vi-VN` by [@TimKieu](https://github.com/TimKieu)
+Translated for `hi-IN`, `ar-SA`, `jv-iD`, `bn-BD`, `ru-RU`, `de-DE`, `ko-KR` by [@allancoding](https://github.com/allancoding), using a translate application
+ +## Contributing + +To contribute, please download the default `en-US.json` language file to use as a template, translate the strings and then submit the file with a Pull Request or Issue. + +The EmulatorJS team will review and add your changes. + +As of version `4.2.2` it will default to the system language. + +The `retroarch.json` are all the setting names for the menu. You can set `EJS_settingsLanguage` to `true` to see the missing retroarch settings names for the current language. You can translate them and add the to the language file. + +The control mapping translations for controllers are diffrent for each controller. They will need to be added to the language file if they are not in the default `en-US.json` file. + +You can also use the [Translation Helper](https://emulatorjs.org/translate) tool to help you translate the file. + +Please contribute!! + +Enything that is incorrect or needs to be fix please perform a pull request! diff --git a/data/localization/Translate.html b/data/localization/Translate.html deleted file mode 100644 index 0970d6a1..00000000 --- a/data/localization/Translate.html +++ /dev/null @@ -1,529 +0,0 @@ - - - - - EmulatorJS | Translate Languages - - - - -
-

Translate Languages

- -
-
-
-
- - -
-
- - -
-
- - -
-
- - - - - diff --git a/data/localization/af-FR.json b/data/localization/af-FR.json deleted file mode 100644 index ebfa601c..00000000 --- a/data/localization/af-FR.json +++ /dev/null @@ -1,301 +0,0 @@ -{ - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7", - "8": "8", - "9": "9", - "Restart": "Redémarrage", - "Pause": "Pause", - "Play": "Jouer", - "Save State": "Enregistrer l'état", - "Load State": "État de chargement", - "Control Settings": "Paramètres de contrôle", - "Cheats": "Astuces", - "Cache Manager": "Gestionnaire de cache", - "Export Save File": "Exporter le fichier de sauvegarde", - "Import Save File": "Importer le fichier de sauvegarde", - "Netplay": "Jeu en réseau", - "Mute": "Muet", - "Unmute": "Rétablir le son", - "Settings": "Paramètres", - "Enter Fullscreen": "Passer en mode plein écran", - "Exit Fullscreen": "Quitter le mode plein écran", - "Reset": "Réinitialiser", - "Clear": "Clair", - "Close": "Fermer", - "QUICK SAVE STATE": "ÉTAT DE SAUVEGARDE RAPIDE", - "QUICK LOAD STATE": "ÉTAT DE CHARGEMENT RAPIDE", - "CHANGE STATE SLOT": "CHANGER L'EMPLACEMENT D'ÉTAT", - "FAST FORWARD": "AVANCE RAPIDE", - "Player": "Joueur", - "Connected Gamepad": "Manette connectée", - "Gamepad": "Manette de jeu", - "Keyboard": "Clavier", - "Set": "Ensemble", - "Add Cheat": "Ajouter une triche", - "Create a Room": "Créer une pièce", - "Rooms": "Pièces", - "Start Game": "Démarrer jeu", - "Loading...": "Chargement...", - "Download Game Core": "Télécharger le noyau du jeu", - "Decompress Game Core": "Décompresser le noyau du jeu", - "Download Game Data": "Télécharger les données du jeu", - "Decompress Game Data": "Décompresser les données de jeu", - "Shaders": "Shaders", - "Disabled": "Désactivé", - "2xScaleHQ": "2xScaleHQ", - "4xScaleHQ": "4xScaleHQ", - "CRT easymode": "Mode facile CRT", - "CRT aperture": "Ouverture CRT", - "CRT geom": "géomètre CRT", - "CRT mattias": "Mattias CRT", - "FPS": "FPS", - "show": "montrer", - "hide": "cacher", - "Fast Forward Ratio": "Rapport d'avance rapide", - "Fast Forward": "Avance rapide", - "Enabled": "Activé", - "Save State Slot": "Enregistrer l'emplacement d'état", - "Save State Location": "Enregistrer l'emplacement de l'état", - "Download": "Télécharger", - "Keep in Browser": "Conserver dans le navigateur", - "Auto": "Auto", - "NTSC": "NTSC", - "PAL": "COPAIN", - "Dendy": "Dendy", - "8:7 PAR": "PAR 8:7", - "4:3": "4:3", - "Low": "Faible", - "High": "Haut", - "Very High": "Très haut", - "None": "Aucun", - "Player 1": "Joueur 1", - "Player 2": "Joueur 2", - "Both": "Les deux", - "SAVED STATE TO SLOT": "ÉTAT SAUVEGARDÉ DANS L'EMPLACEMENT", - "LOADED STATE FROM SLOT": "ÉTAT CHARGÉ À PARTIR DE L'EMPLACEMENT", - "SET SAVE STATE SLOT TO": "SET SAVE STATE SLOT TO", - "Network Error": "Erreur réseau", - "Submit": "Soumettre", - "Description": "Description", - "Code": "Code", - "Add Cheat Code": "Ajouter un code de triche", - "Leave Room": "Quitter la pièce", - "Password": "Mot de passe", - "Password (optional)": "Mot de passe (facultatif)", - "Max Players": "Le maximum de joueurs", - "Room Name": "Nom de la salle", - "Join": "Rejoindre", - "Player Name": "Nom de joueur", - "Set Player Name": "Définir le nom du joueur", - "Left Handed Mode": "Mode gaucher", - "Virtual Gamepad": "Manette de jeu virtuelle", - "Disk": "Disque", - "Press Keyboard": "Appuyez sur le clavier", - "INSERT COIN": "INSÉRER UNE PIÈCE", - "Remove": "Retirer", - "SAVE LOADED FROM BROWSER": "ENREGISTRER CHARGÉ À PARTIR DU NAVIGATEUR", - "SAVE SAVED TO BROWSER": "ENREGISTRER ENREGISTRÉ DANS LE NAVIGATEUR", - "Join the discord": "Rejoignez la discorde", - "View on GitHub": "Afficher sur GitHub", - "Failed to start game": "Impossible de démarrer le jeu", - "Download Game BIOS": "Télécharger le BIOS du jeu", - "Decompress Game BIOS": "Décompresser le BIOS du jeu", - "Download Game Parent": "Télécharger le jeu Parent", - "Decompress Game Parent": "Décompresser le jeu parent", - "Download Game Patch": "Télécharger le patch du jeu", - "Decompress Game Patch": "Décompresser le patch du jeu", - "Download Game State": "Télécharger l'état du jeu", - "Check console": "Vérifier la console", - "Error for site owner": "Erreur pour le propriétaire du site", - "EmulatorJS": "EmulatorJS", - "Clear All": "Tout effacer", - "Take Screenshot": "Prendre une capture d'écran", - "Quick Save": "Sauvegarde rapide", - "Quick Load": "Chargement rapide", - "REWIND": "REMBOBINER", - "Rewind Enabled (requires restart)": "Rewind activé (nécessite un redémarrage)", - "Rewind Granularity": "Rembobiner la granularité", - "Slow Motion Ratio": "Rapport de ralenti", - "Slow Motion": "Ralenti", - "Home": "Maison", - "EmulatorJS License": "Licence EmulatorJS", - "RetroArch License": "Licence RetroArch", - "SLOW MOTION": "RALENTI", - "A": "UN", - "B": "B", - "SELECT": "SÉLECTIONNER", - "START": "COMMENCER", - "UP": "EN HAUT", - "DOWN": "VERS LE BAS", - "LEFT": "GAUCHE", - "RIGHT": "DROITE", - "X": "X", - "Y": "Oui", - "L": "L", - "R": "R", - "Z": "Z", - "STICK UP": "BÂTON VERS LE HAUT", - "STICK DOWN": "COLLER", - "STICK LEFT": "BÂTON GAUCHE", - "STICK RIGHT": "COLLEZ À DROITE", - "C-PAD UP": "C-PAD VERS LE HAUT", - "C-PAD DOWN": "C-PAD EN BAS", - "C-PAD LEFT": "C-PAD GAUCHE", - "C-PAD RIGHT": "C-PAD DROIT", - "MICROPHONE": "MICROPHONE", - "BUTTON 1 / START": "BOUTON 1 / DÉMARRER", - "BUTTON 2": "BOUTON 2", - "BUTTON": "BOUTON", - "LEFT D-PAD UP": "D-PAD GAUCHE HAUT", - "LEFT D-PAD DOWN": "D-PAD GAUCHE BAS", - "LEFT D-PAD LEFT": "D-PAD GAUCHE GAUCHE", - "LEFT D-PAD RIGHT": "D-PAD GAUCHE DROITE", - "RIGHT D-PAD UP": "D-PAD DROIT VERS LE HAUT", - "RIGHT D-PAD DOWN": "D-PAD DROIT BAS", - "RIGHT D-PAD LEFT": "D-PAD DROIT GAUCHE", - "RIGHT D-PAD RIGHT": "DROITE D-PAD DROITE", - "C": "C", - "MODE": "MODE", - "FIRE": "FEU", - "RESET": "RÉINITIALISER", - "LEFT DIFFICULTY A": "GAUCHE DIFFICULTÉ A", - "LEFT DIFFICULTY B": "GAUCHE DIFFICULTÉ B", - "RIGHT DIFFICULTY A": "BONNE DIFFICULTÉ A", - "RIGHT DIFFICULTY B": "DROITE DIFFICULTE B", - "COLOR": "COULEUR", - "B/W": "N/B", - "PAUSE": "PAUSE", - "OPTION": "OPTION", - "OPTION 1": "OPTION 1", - "OPTION 2": "OPTION 2", - "L2": "L2", - "R2": "R2", - "L3": "L3", - "R3": "R3", - "L STICK UP": "L BÂTON VERS LE HAUT", - "L STICK DOWN": "L BÂTON VERS LE BAS", - "L STICK LEFT": "BÂTON L GAUCHE", - "L STICK RIGHT": "L BÂTON DROIT", - "R STICK UP": "R STICK UP", - "R STICK DOWN": "BÂTON R ENFONCÉ", - "R STICK LEFT": "R STICK GAUCHE", - "R STICK RIGHT": "BÂTON R DROIT", - "Start": "Commencer", - "Select": "Sélectionner", - "Fast": "Rapide", - "Slow": "Lent", - "a": "un", - "b": "b", - "c": "c", - "d": "d", - "e": "e", - "f": "F", - "g": "g", - "h": "h", - "i": "je", - "j": "j", - "k": "k", - "l": "je", - "m": "m", - "n": "n", - "o": "o", - "p": "p", - "q": "q", - "r": "r", - "s": "s", - "t": "t", - "u": "tu", - "v": "v", - "w": "w", - "x": "X", - "y": "y", - "z": "z", - "enter": "entrer", - "escape": "s'échapper", - "space": "espace", - "tab": "languette", - "backspace": "retour arrière", - "delete": "supprimer", - "arrowup": "flèche vers le haut", - "arrowdown": "flèche vers le bas", - "arrowleft": "flèche gauche", - "arrowright": "flèche droite", - "f1": "f1", - "f2": "f2", - "f3": "f3", - "f4": "f4", - "f5": "f5", - "f6": "f6", - "f7": "f7", - "f8": "f8", - "f9": "f9", - "f10": "f10", - "f11": "f11", - "f12": "f12", - "shift": "changement", - "control": "contrôle", - "alt": "autre", - "meta": "méta", - "capslock": "verrouillage des majuscules", - "insert": "insérer", - "home": "maison", - "end": "fin", - "pageup": "pageup", - "pagedown": "bas de page", - "!": "!", - "@": "@", - "#": "#", - "$": "$", - "%": "%", - "^": "^", - "&": "&", - "*": "*", - "(": "(", - ")": ")", - "-": "-", - "_": "_", - "+": "+", - "=": "=", - "[": "[", - "]": "]", - "{": "{", - "}": "}", - ";": ";", - ":": ":", - "'": "'", - "\"": "\"", - ",": ",", - ".": ".", - "<": "<", - ">": ">", - "/": "/", - "?": "?", - "LEFT_STICK_X": "LEFT_STICK_X", - "LEFT_STICK_Y": "LEFT_STICK_Y", - "RIGHT_STICK_X": "RIGHT_STICK_X", - "RIGHT_STICK_Y": "RIGHT_STICK_Y", - "LEFT_TRIGGER": "GÂCHETTE GAUCHE", - "RIGHT_TRIGGER": "RIGHT_TRIGGER", - "A_BUTTON": "UN BOUTON", - "B_BUTTON": "B_BUTTON", - "X_BUTTON": "X_BUTTON", - "Y_BUTTON": "Y_BUTTON", - "START_BUTTON": "BOUTON START", - "SELECT_BUTTON": "SELECT_BUTTON", - "L1_BUTTON": "L1_BUTTON", - "R1_BUTTON": "R1_BUTTON", - "L2_BUTTON": "L2_BUTTON", - "R2_BUTTON": "R2_BUTTON", - "LEFT_THUMB_BUTTON": "LEFT_THUMB_BUTTON", - "RIGHT_THUMB_BUTTON": "RIGHT_THUMB_BUTTON", - "DPAD_UP": "DPAD_UP", - "DPAD_DOWN": "DPAD_DOWN", - "DPAD_LEFT": "DPAD_LEFT", - "DPAD_RIGHT": "DPAD_RIGHT" -} \ No newline at end of file diff --git a/data/localization/ar-AR.json b/data/localization/ar.json similarity index 99% rename from data/localization/ar-AR.json rename to data/localization/ar.json index 6c6f715c..50d22e57 100644 --- a/data/localization/ar-AR.json +++ b/data/localization/ar.json @@ -298,4 +298,4 @@ "DPAD_DOWN": "DPAD_DOWN", "DPAD_LEFT": "DPAD_LEFT", "DPAD_RIGHT": "DPAD_RIGHT" -} \ No newline at end of file +} diff --git a/data/localization/ben-BEN.json b/data/localization/bn.json similarity index 99% rename from data/localization/ben-BEN.json rename to data/localization/bn.json index aeee5699..b220966d 100644 --- a/data/localization/ben-BEN.json +++ b/data/localization/bn.json @@ -298,4 +298,4 @@ "DPAD_DOWN": "DPAD_DOWN", "DPAD_LEFT": "DPAD_LEFT", "DPAD_RIGHT": "DPAD_RIGHT" -} \ No newline at end of file +} diff --git a/data/localization/de-GER.json b/data/localization/de.json similarity index 100% rename from data/localization/de-GER.json rename to data/localization/de.json diff --git a/data/localization/el-GR.json b/data/localization/el.json similarity index 99% rename from data/localization/el-GR.json rename to data/localization/el.json index 161daa84..b0c7fc4d 100644 --- a/data/localization/el-GR.json +++ b/data/localization/el.json @@ -298,4 +298,4 @@ "DPAD_DOWN": "DPAD_DOWN", "DPAD_LEFT": "DPAD_LEFT", "DPAD_RIGHT": "DPAD_RIGHT" -} \ No newline at end of file +} diff --git a/data/localization/en.json b/data/localization/en.json index 50333f51..80f69f84 100644 --- a/data/localization/en.json +++ b/data/localization/en.json @@ -1,310 +1,339 @@ { - "0": "-0", - "1": "-1", - "2": "-2", - "3": "-3", - "4": "-4", - "5": "-5", - "6": "-6", - "7": "-7", - "8": "-8", - "9": "-9", - "Restart": "-Restart", - "Pause": "-Pause", - "Play": "-Play", - "Save State": "-Save State", - "Load State": "-Load State", - "Control Settings": "-Control Settings", - "Cheats": "-Cheats", - "Cache Manager": "-Cache Manager", - "Export Save File": "-Export Save File", - "Import Save File": "-Import Save File", - "Netplay": "-Netplay", - "Mute": "-Mute", - "Unmute": "-Unmute", - "Settings": "-Settings", - "Enter Fullscreen": "-Enter Fullscreen", - "Exit Fullscreen": "-Exit Fullscreen", - "Context Menu": "-Context Menu", - "Reset": "-Reset", - "Clear": "-Clear", - "Close": "-Close", - "QUICK SAVE STATE": "-QUICK SAVE STATE", - "QUICK LOAD STATE": "-QUICK LOAD STATE", - "CHANGE STATE SLOT": "-CHANGE STATE SLOT", - "FAST FORWARD": "-FAST FORWARD", - "Player": "-Player", - "Connected Gamepad": "-Connected Gamepad", - "Gamepad": "-Gamepad", - "Keyboard": "-Keyboard", - "Set": "-Set", - "Add Cheat": "-Add Cheat", - "Note that some cheats require a restart to disable": "-Note that some cheats require a restart to disable", - "Create a Room": "-Create a Room", - "Rooms": "-Rooms", - "Start Game": "-Start Game", - "Click to resume Emulator": "-Click to resume Emulator", - "Drop save state here to load": "-Drop save state here to load", - "Loading...": "-Loading...", - "Download Game Core": "-Download Game Core", - "Outdated graphics driver": "-Outdated graphics driver", - "Decompress Game Core": "-Decompress Game Core", - "Download Game Data": "-Download Game Data", - "Decompress Game Data": "-Decompress Game Data", - "Shaders": "-Shaders", - "Disabled": "-Disabled", - "2xScaleHQ": "-2xScaleHQ", - "4xScaleHQ": "-4xScaleHQ", - "CRT easymode": "-CRT easymode", - "CRT aperture": "-CRT aperture", - "CRT geom": "-CRT geom", - "CRT mattias": "-CRT mattias", - "FPS": "-FPS", - "show": "-show", - "hide": "-hide", - "Fast Forward Ratio": "-Fast Forward Ratio", - "Fast Forward": "-Fast Forward", - "Enabled": "-Enabled", - "Save State Slot": "-Save State Slot", - "Save State Location": "-Save State Location", - "Download": "-Download", - "Keep in Browser": "-Keep in Browser", - "Auto": "-Auto", - "NTSC": "-NTSC", - "PAL": "-PAL", - "Dendy": "-Dendy", - "8:7 PAR": "-8:7 PAR", - "4:3": "-4:3", - "Low": "-Low", - "High": "-High", - "Very High": "-Very High", - "None": "-None", - "Player 1": "-Player 1", - "Player 2": "-Player 2", - "Both": "-Both", - "SAVED STATE TO SLOT": "-SAVED STATE TO SLOT", - "LOADED STATE FROM SLOT": "-LOADED STATE FROM SLOT", - "SET SAVE STATE SLOT TO": "-SET SAVE STATE SLOT TO", - "Network Error": "-Network Error", - "Submit": "-Submit", - "Description": "-Description", - "Code": "-Code", - "Add Cheat Code": "-Add Cheat Code", - "Leave Room": "-Leave Room", - "Password": "-Password", - "Password (optional)": "-Password (optional)", - "Max Players": "-Max Players", - "Room Name": "-Room Name", - "Join": "-Join", - "Player Name": "-Player Name", - "Set Player Name": "-Set Player Name", - "Left Handed Mode": "-Left Handed Mode", - "Virtual Gamepad": "-Virtual Gamepad", - "Disk": "-Disk", - "Press Keyboard": "-Press Keyboard", - "INSERT COIN": "-INSERT COIN", - "Remove": "-Remove", - "SAVE LOADED FROM BROWSER": "-SAVE LOADED FROM BROWSER", - "SAVE SAVED TO BROWSER": "-SAVE SAVED TO BROWSER", - "Join the discord": "-Join the discord", - "View on GitHub": "-View on GitHub", - "Failed to start game": "-Failed to start game", - "Download Game BIOS": "-Download Game BIOS", - "Decompress Game BIOS": "-Decompress Game BIOS", - "Download Game Parent": "-Download Game Parent", - "Decompress Game Parent": "-Decompress Game Parent", - "Download Game Patch": "-Download Game Patch", - "Decompress Game Patch": "-Decompress Game Patch", - "Download Game State": "-Download Game State", - "Check console": "-Check console", - "Error for site owner": "-Error for site owner", - "EmulatorJS": "-EmulatorJS", - "Clear All": "-Clear All", - "Take Screenshot": "-Take Screenshot", - "Start screen recording": "-Start screen recording", - "Stop screen recording": "-Stop screen recording", - "Quick Save": "-Quick Save", - "Quick Load": "-Quick Load", - "REWIND": "-REWIND", - "Rewind Enabled (requires restart)": "-Rewind Enabled (requires restart)", - "Rewind Granularity": "-Rewind Granularity", - "Slow Motion Ratio": "-Slow Motion Ratio", - "Slow Motion": "-Slow Motion", - "Home": "-Home", - "EmulatorJS License": "-EmulatorJS License", - "RetroArch License": "-RetroArch License", - "This project is powered by": "-This project is powered by", - "View the RetroArch license here": "-View the RetroArch license here", - "SLOW MOTION": "-SLOW MOTION", - "A": "-A", - "B": "-B", - "SELECT": "-SELECT", - "START": "-START", - "UP": "-UP", - "DOWN": "-DOWN", - "LEFT": "-LEFT", - "RIGHT": "-RIGHT", - "X": "-X", - "Y": "-Y", - "L": "-L", - "R": "-R", - "Z": "-Z", - "STICK UP": "-STICK UP", - "STICK DOWN": "-STICK DOWN", - "STICK LEFT": "-STICK LEFT", - "STICK RIGHT": "-STICK RIGHT", - "C-PAD UP": "-C-PAD UP", - "C-PAD DOWN": "-C-PAD DOWN", - "C-PAD LEFT": "-C-PAD LEFT", - "C-PAD RIGHT": "-C-PAD RIGHT", - "MICROPHONE": "-MICROPHONE", - "BUTTON 1 / START": "-BUTTON 1 / START", - "BUTTON 2": "-BUTTON 2", - "BUTTON": "-BUTTON", - "LEFT D-PAD UP": "-LEFT D-PAD UP", - "LEFT D-PAD DOWN": "-LEFT D-PAD DOWN", - "LEFT D-PAD LEFT": "-LEFT D-PAD LEFT", - "LEFT D-PAD RIGHT": "-LEFT D-PAD RIGHT", - "RIGHT D-PAD UP": "-RIGHT D-PAD UP", - "RIGHT D-PAD DOWN": "-RIGHT D-PAD DOWN", - "RIGHT D-PAD LEFT": "-RIGHT D-PAD LEFT", - "RIGHT D-PAD RIGHT": "-RIGHT D-PAD RIGHT", - "C": "-C", - "MODE": "-MODE", - "FIRE": "-FIRE", - "RESET": "-RESET", - "LEFT DIFFICULTY A": "-LEFT DIFFICULTY A", - "LEFT DIFFICULTY B": "-LEFT DIFFICULTY B", - "RIGHT DIFFICULTY A": "-RIGHT DIFFICULTY A", - "RIGHT DIFFICULTY B": "-RIGHT DIFFICULTY B", - "COLOR": "-COLOR", - "B/W": "-B/W", - "PAUSE": "-PAUSE", - "OPTION": "-OPTION", - "OPTION 1": "-OPTION 1", - "OPTION 2": "-OPTION 2", - "L2": "-L2", - "R2": "-R2", - "L3": "-L3", - "R3": "-R3", - "L STICK UP": "-L STICK UP", - "L STICK DOWN": "-L STICK DOWN", - "L STICK LEFT": "-L STICK LEFT", - "L STICK RIGHT": "-L STICK RIGHT", - "R STICK UP": "-R STICK UP", - "R STICK DOWN": "-R STICK DOWN", - "R STICK LEFT": "-R STICK LEFT", - "R STICK RIGHT": "-R STICK RIGHT", - "Start": "-Start", - "Select": "-Select", - "Fast": "-Fast", - "Slow": "-Slow", - "a": "-a", - "b": "-b", - "c": "-c", - "d": "-d", - "e": "-e", - "f": "-f", - "g": "-g", - "h": "-h", - "i": "-i", - "j": "-j", - "k": "-k", - "l": "-l", - "m": "-m", - "n": "-n", - "o": "-o", - "p": "-p", - "q": "-q", - "r": "-r", - "s": "-s", - "t": "-t", - "u": "-u", - "v": "-v", - "w": "-w", - "x": "-x", - "y": "-y", - "z": "-z", - "enter": "-enter", - "escape": "-escape", - "space": "-space", - "tab": "-tab", - "backspace": "-backspace", - "delete": "-delete", - "arrowup": "-arrowup", - "arrowdown": "-arrowdown", - "arrowleft": "-arrowleft", - "arrowright": "-arrowright", - "f1": "-f1", - "f2": "-f2", - "f3": "-f3", - "f4": "-f4", - "f5": "-f5", - "f6": "-f6", - "f7": "-f7", - "f8": "-f8", - "f9": "-f9", - "f10": "-f10", - "f11": "-f11", - "f12": "-f12", - "shift": "-shift", - "control": "-control", - "alt": "-alt", - "meta": "-meta", - "capslock": "-capslock", - "insert": "-insert", - "home": "-home", - "end": "-end", - "pageup": "-pageup", - "pagedown": "-pagedown", - "!": "-!", - "@": "-@", - "#": "-#", - "$": "-$", - "%": "-%", - "^": "-^", - "&": "-&", - "*": "-*", - "(": "-(", - ")": "-)", - "-": "--", - "_": "-_", - "+": "-+", - "=": "-=", - "[": "-[", - "]": "-]", - "{": "-{", - "}": "-}", - ";": "-;", - ":": "-:", - "'": "-'", - "\"": "-\"", - ",": "-,", - ".": "-.", - "<": "-<", - ">": "->", - "/": "-/", - "?": "-?", - "LEFT_STICK_X": "-LEFT_STICK_X", - "LEFT_STICK_Y": "-LEFT_STICK_Y", - "RIGHT_STICK_X": "-RIGHT_STICK_X", - "RIGHT_STICK_Y": "-RIGHT_STICK_Y", - "LEFT_TRIGGER": "-LEFT_TRIGGER", - "RIGHT_TRIGGER": "-RIGHT_TRIGGER", - "A_BUTTON": "-A_BUTTON", - "B_BUTTON": "-B_BUTTON", - "X_BUTTON": "-X_BUTTON", - "Y_BUTTON": "-Y_BUTTON", - "START_BUTTON": "-START_BUTTON", - "SELECT_BUTTON": "-SELECT_BUTTON", - "L1_BUTTON": "-L1_BUTTON", - "R1_BUTTON": "-R1_BUTTON", - "L2_BUTTON": "-L2_BUTTON", - "R2_BUTTON": "-R2_BUTTON", - "LEFT_THUMB_BUTTON": "-LEFT_THUMB_BUTTON", - "RIGHT_THUMB_BUTTON": "-RIGHT_THUMB_BUTTON", - "DPAD_UP": "-DPAD_UP", - "DPAD_DOWN": "-DPAD_DOWN", - "DPAD_LEFT": "-DPAD_LEFT", - "DPAD_RIGHT": "-DPAD_RIGHT" -} \ No newline at end of file + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "8", + "9": "9", + "Restart": "Restart", + "Pause": "Pause", + "Play": "Play", + "Save State": "Save State", + "Load State": "Load State", + "Control Settings": "Control Settings", + "Cheats": "Cheats", + "Cache Manager": "Cache Manager", + "Export Save File": "Export Save File", + "Import Save File": "Import Save File", + "Netplay": "Netplay", + "Mute": "Mute", + "Unmute": "Unmute", + "Settings": "Settings", + "Enter Fullscreen": "Enter Fullscreen", + "Exit Fullscreen": "Exit Fullscreen", + "Context Menu": "Context Menu", + "Reset": "Reset", + "Clear": "Clear", + "Close": "Close", + "QUICK SAVE STATE": "QUICK SAVE STATE", + "QUICK LOAD STATE": "QUICK LOAD STATE", + "CHANGE STATE SLOT": "CHANGE STATE SLOT", + "FAST FORWARD": "FAST FORWARD", + "Player": "Player", + "Connected Gamepad": "Connected Gamepad", + "Gamepad": "Gamepad", + "Keyboard": "Keyboard", + "Set": "Set", + "Add Cheat": "Add Cheat", + "Note that some cheats require a restart to disable": "Note that some cheats require a restart to disable", + "Create a Room": "Create a Room", + "Rooms": "Rooms", + "Start Game": "Start Game", + "Click to resume Emulator": "Click to resume Emulator", + "Drop save state here to load": "Drop save state here to load", + "Loading...": "Loading...", + "Download Game Core": "Download Game Core", + "Outdated graphics driver": "Outdated graphics driver", + "Decompress Game Core": "Decompress Game Core", + "Download Game Data": "Download Game Data", + "Decompress Game Data": "Decompress Game Data", + "Shaders": "Shaders", + "Disabled": "Disabled", + "2xScaleHQ": "2xScaleHQ", + "4xScaleHQ": "4xScaleHQ", + "CRT easymode": "CRT easymode", + "CRT aperture": "CRT aperture", + "CRT geom": "CRT geom", + "CRT mattias": "CRT mattias", + "FPS": "FPS", + "show": "show", + "hide": "hide", + "Fast Forward Ratio": "Fast Forward Ratio", + "Fast Forward": "Fast Forward", + "Enabled": "Enabled", + "Save State Slot": "Save State Slot", + "Save State Location": "Save State Location", + "Download": "Download", + "Keep in Browser": "Keep in Browser", + "Auto": "Auto", + "NTSC": "NTSC", + "PAL": "PAL", + "Dendy": "Dendy", + "8:7 PAR": "8:7 PAR", + "4:3": "4:3", + "Low": "Low", + "High": "High", + "Very High": "Very High", + "None": "None", + "Player 1": "Player 1", + "Player 2": "Player 2", + "Both": "Both", + "SAVED STATE TO SLOT": "SAVED STATE TO SLOT", + "LOADED STATE FROM SLOT": "LOADED STATE FROM SLOT", + "SET SAVE STATE SLOT TO": "SET SAVE STATE SLOT TO", + "Network Error": "Network Error", + "Submit": "Submit", + "Description": "Description", + "Code": "Code", + "Add Cheat Code": "Add Cheat Code", + "Leave Room": "Leave Room", + "Password": "Password", + "Password (optional)": "Password (optional)", + "Max Players": "Max Players", + "Room Name": "Room Name", + "Join": "Join", + "Player Name": "Player Name", + "Set Player Name": "Set Player Name", + "Left Handed Mode": "Left Handed Mode", + "Virtual Gamepad": "Virtual Gamepad", + "Disk": "Disk", + "Press Keyboard": "Press Keyboard", + "INSERT COIN": "INSERT COIN", + "Remove": "Remove", + "SAVE LOADED FROM BROWSER": "SAVE LOADED FROM BROWSER", + "SAVE SAVED TO BROWSER": "SAVE SAVED TO BROWSER", + "Join the discord": "Join the discord", + "View on GitHub": "View on GitHub", + "Failed to start game": "Failed to start game", + "Download Game BIOS": "Download Game BIOS", + "Decompress Game BIOS": "Decompress Game BIOS", + "Download Game Parent": "Download Game Parent", + "Decompress Game Parent": "Decompress Game Parent", + "Download Game Patch": "Download Game Patch", + "Decompress Game Patch": "Decompress Game Patch", + "Download Game State": "Download Game State", + "Check console": "Check console", + "Error for site owner": "Error for site owner", + "EmulatorJS": "EmulatorJS", + "Clear All": "Clear All", + "Take Screenshot": "Take Screenshot", + "Start Screen Recording": "Start Screen Recording", + "Stop Screen Recording": "Stop Screen Recording", + "Quick Save": "Quick Save", + "Quick Load": "Quick Load", + "REWIND": "REWIND", + "Rewind Enabled (requires restart)": "Rewind Enabled (requires restart)", + "Rewind Granularity": "Rewind Granularity", + "Slow Motion Ratio": "Slow Motion Ratio", + "Slow Motion": "Slow Motion", + "Home": "Home", + "EmulatorJS License": "EmulatorJS License", + "RetroArch License": "RetroArch License", + "This project is powered by": "This project is powered by", + "View the RetroArch license here": "View the RetroArch license here", + "SLOW MOTION": "SLOW MOTION", + "A": "A", + "B": "B", + "SELECT": "SELECT", + "START": "START", + "UP": "UP", + "DOWN": "DOWN", + "LEFT": "LEFT", + "RIGHT": "RIGHT", + "X": "X", + "Y": "Y", + "L": "L", + "R": "R", + "Z": "Z", + "STICK UP": "STICK UP", + "STICK DOWN": "STICK DOWN", + "STICK LEFT": "STICK LEFT", + "STICK RIGHT": "STICK RIGHT", + "C-PAD UP": "C-PAD UP", + "C-PAD DOWN": "C-PAD DOWN", + "C-PAD LEFT": "C-PAD LEFT", + "C-PAD RIGHT": "C-PAD RIGHT", + "MICROPHONE": "MICROPHONE", + "BUTTON 1 / START": "BUTTON 1 / START", + "BUTTON 2": "BUTTON 2", + "BUTTON": "BUTTON", + "LEFT D-PAD UP": "LEFT D-PAD UP", + "LEFT D-PAD DOWN": "LEFT D-PAD DOWN", + "LEFT D-PAD LEFT": "LEFT D-PAD LEFT", + "LEFT D-PAD RIGHT": "LEFT D-PAD RIGHT", + "RIGHT D-PAD UP": "RIGHT D-PAD UP", + "RIGHT D-PAD DOWN": "RIGHT D-PAD DOWN", + "RIGHT D-PAD LEFT": "RIGHT D-PAD LEFT", + "RIGHT D-PAD RIGHT": "RIGHT D-PAD RIGHT", + "C": "C", + "MODE": "MODE", + "FIRE": "FIRE", + "RESET": "RESET", + "LEFT DIFFICULTY A": "LEFT DIFFICULTY A", + "LEFT DIFFICULTY B": "LEFT DIFFICULTY B", + "RIGHT DIFFICULTY A": "RIGHT DIFFICULTY A", + "RIGHT DIFFICULTY B": "RIGHT DIFFICULTY B", + "COLOR": "COLOR", + "B/W": "B/W", + "PAUSE": "PAUSE", + "OPTION": "OPTION", + "OPTION 1": "OPTION 1", + "OPTION 2": "OPTION 2", + "L2": "L2", + "R2": "R2", + "L3": "L3", + "R3": "R3", + "L STICK UP": "L STICK UP", + "L STICK DOWN": "L STICK DOWN", + "L STICK LEFT": "L STICK LEFT", + "L STICK RIGHT": "L STICK RIGHT", + "R STICK UP": "R STICK UP", + "R STICK DOWN": "R STICK DOWN", + "R STICK LEFT": "R STICK LEFT", + "R STICK RIGHT": "R STICK RIGHT", + "Start": "Start", + "Select": "Select", + "Fast": "Fast", + "Slow": "Slow", + "a": "a", + "b": "b", + "c": "c", + "d": "d", + "e": "e", + "f": "f", + "g": "g", + "h": "h", + "i": "i", + "j": "j", + "k": "k", + "l": "l", + "m": "m", + "n": "n", + "o": "o", + "p": "p", + "q": "q", + "r": "r", + "s": "s", + "t": "t", + "u": "u", + "v": "v", + "w": "w", + "x": "x", + "y": "y", + "z": "z", + "enter": "enter", + "escape": "escape", + "space": "space", + "tab": "tab", + "backspace": "backspace", + "delete": "delete", + "arrowup": "arrowup", + "arrowdown": "arrowdown", + "arrowleft": "arrowleft", + "arrowright": "arrowright", + "f1": "f1", + "f2": "f2", + "f3": "f3", + "f4": "f4", + "f5": "f5", + "f6": "f6", + "f7": "f7", + "f8": "f8", + "f9": "f9", + "f10": "f10", + "f11": "f11", + "f12": "f12", + "shift": "shift", + "control": "control", + "alt": "alt", + "meta": "meta", + "capslock": "capslock", + "insert": "insert", + "home": "home", + "end": "end", + "pageup": "pageup", + "pagedown": "pagedown", + "!": "!", + "@": "@", + "#": "#", + "$": "$", + "%": "%", + "^": "^", + "&": "&", + "*": "*", + "(": "(", + ")": ")", + "-": "-", + "_": "_", + "+": "+", + "=": "=", + "[": "[", + "]": "]", + "{": "{", + "}": "}", + ";": ";", + ":": ":", + "'": "'", + "\"": "\"", + ",": ",", + ".": ".", + "<": "<", + ">": ">", + "/": "/", + "?": "?", + "LEFT_STICK_X": "LEFT_STICK_X", + "LEFT_STICK_Y": "LEFT_STICK_Y", + "RIGHT_STICK_X": "RIGHT_STICK_X", + "RIGHT_STICK_Y": "RIGHT_STICK_Y", + "LEFT_TRIGGER": "LEFT_TRIGGER", + "RIGHT_TRIGGER": "RIGHT_TRIGGER", + "A_BUTTON": "A_BUTTON", + "B_BUTTON": "B_BUTTON", + "X_BUTTON": "X_BUTTON", + "Y_BUTTON": "Y_BUTTON", + "START_BUTTON": "START_BUTTON", + "SELECT_BUTTON": "SELECT_BUTTON", + "L1_BUTTON": "L1_BUTTON", + "R1_BUTTON": "R1_BUTTON", + "L2_BUTTON": "L2_BUTTON", + "R2_BUTTON": "R2_BUTTON", + "LEFT_THUMB_BUTTON": "LEFT_THUMB_BUTTON", + "RIGHT_THUMB_BUTTON": "RIGHT_THUMB_BUTTON", + "DPAD_UP": "DPAD_UP", + "DPAD_DOWN": "DPAD_DOWN", + "DPAD_LEFT": "DPAD_LEFT", + "DPAD_RIGHT": "DPAD_RIGHT", + "Disks": "Disks", + "Exit EmulatorJS": "Exit EmulatorJS", + "BUTTON_1": "BUTTON_1", + "BUTTON_2": "BUTTON_2", + "BUTTON_3": "BUTTON_3", + "BUTTON_4": "BUTTON_4", + "up arrow": "up arrow", + "down arrow": "down arrow", + "left arrow": "left arrow", + "right arrow": "right arrow", + "LEFT_TOP_SHOULDER": "LEFT_TOP_SHOULDER", + "RIGHT_TOP_SHOULDER": "RIGHT_TOP_SHOULDER", + "CRT beam": "CRT beam", + "CRT caligari": "CRT caligari", + "CRT lottes": "CRT lottes", + "CRT yeetron": "CRT yeetron", + "CRT zfast": "CRT zfast", + "SABR": "SABR", + "Bicubic": "Bicubic", + "Mix frames": "Mix frames", + "WebGL2": "WebGL2", + "Requires restart": "Requires restart", + "VSync": "VSync", + "Video Rotation": "Video Rotation", + "Rewind Enabled (Requires restart)": "Rewind Enabled (Requires restart)", + "System Save interval": "System Save interval", + "Menu Bar Button": "Menu Bar Button", + "visible": "visible", + "hidden": "hidden" +} diff --git a/data/localization/es-ES.json b/data/localization/es.json similarity index 98% rename from data/localization/es-ES.json rename to data/localization/es.json index 937ce257..d84cb16c 100644 --- a/data/localization/es-ES.json +++ b/data/localization/es.json @@ -121,8 +121,8 @@ "EmulatorJS": "EmulatorJS", "Clear All": "Limpiar todo", "Take Screenshot": "Tomar Captura de Pantalla", - "Start screen recording": "Iniciar grabación de pantalla", - "Stop screen recording": "Detener grabación de pantalla", + "Start Screen Recording": "Iniciar grabación de pantalla", + "Stop Screen Recording": "Detener grabación de pantalla", "Quick Save": "Guardado Rápido", "Quick Load": "Carga Rápida", "REWIND": "REBOBINAR", @@ -307,4 +307,4 @@ "DPAD_DOWN": "DPAD_ABAJO", "DPAD_LEFT": "DPAD_IZQUIERDA", "DPAD_RIGHT": "DPAD_DERECHO" -} \ No newline at end of file +} diff --git a/data/localization/fa-AF.json b/data/localization/fa.json similarity index 98% rename from data/localization/fa-AF.json rename to data/localization/fa.json index 8dd19cc0..2b476892 100644 --- a/data/localization/fa-AF.json +++ b/data/localization/fa.json @@ -121,8 +121,8 @@ "EmulatorJS": "EmulatorJS", "Clear All": "پاک کردن همه", "Take Screenshot": "اسکرین شات بگیرید", - "Start screen recording": "شروع ضبط صفحه", - "Stop screen recording": "ضبط صفحه را متوقف کنید", + "Start Screen Recording": "شروع ضبط صفحه", + "Stop Screen Recording": "ضبط صفحه را متوقف کنید", "Quick Save": "ذخیره سریع", "Quick Load": "بارگذاری سریع", "REWIND": "عقب", diff --git a/data/localization/fr.json b/data/localization/fr.json new file mode 100644 index 00000000..ad9824df --- /dev/null +++ b/data/localization/fr.json @@ -0,0 +1,339 @@ +{ + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "8", + "9": "9", + "Restart": "Redémarrer", + "Pause": "Mettre en pause", + "Play": "Jouer", + "Save State": "Enregistrer l'état", + "Load State": "Ouvrir un état", + "Control Settings": "Paramètres des contrôles", + "Cheats": "Triches", + "Cache Manager": "Gestionnaire du cache", + "Export Save File": "Exporter vers une sauvegarde", + "Import Save File": "Importer une sauvegarde", + "Netplay": "Jouer en ligne", + "Mute": "Désactiver le son", + "Unmute": "Réactiver le son", + "Settings": "Paramètres", + "Enter Fullscreen": "Passer en mode plein écran", + "Exit Fullscreen": "Quitter le mode plein écran", + "Context Menu": "Menu contextuel", + "Reset": "Réinitialiser", + "Clear": "Effacer", + "Close": "Fermer", + "QUICK SAVE STATE": "ENREGISTREMENT RAPIDE DE L'ÉTAT", + "QUICK LOAD STATE": "CHARGEMENT RAPIDE DE L'ÉTAT", + "CHANGE STATE SLOT": "CHANGER L'EMPLACEMENT DE L'ÉTAT", + "FAST FORWARD": "AVANCE RAPIDE", + "Player": "Joueur", + "Connected Gamepad": "Manette de jeu connectée", + "Gamepad": "Manette de jeu", + "Keyboard": "Clavier", + "Set": "Définir", + "Add Cheat": "Ajouter une triche", + "Note that some cheats require a restart to disable": "Notez que certaines triches nécessitent un redémarrage pour être désactivées", + "Create a Room": "Créer un salon", + "Rooms": "Salons", + "Start Game": "Démarrer le jeu", + "Click to resume Emulator": "Cliquez pour reprendre avec l'émulateur", + "Drop save state here to load": "Déposez un état enregistré ici pour le charger", + "Loading...": "Chargement...", + "Download Game Core": "Téléchargement du noyau pour le jeu...", + "Outdated graphics driver": "Pilote graphique obsolète", + "Decompress Game Core": "Décompression du noyau pour le jeu...", + "Download Game Data": "Téléchargement des données du jeu...", + "Decompress Game Data": "Décompression des données du jeu...", + "Shaders": "Shaders", + "Disabled": "Désactivé", + "2xScaleHQ": "2xScaleHQ", + "4xScaleHQ": "4xScaleHQ", + "CRT easymode": "CRT easymode", + "CRT aperture": "CRT aperture", + "CRT geom": "CRT geom", + "CRT mattias": "CRT mattias", + "FPS": "FPS", + "show": "Afficher", + "hide": "Masquer", + "Fast Forward Ratio": "Vitesse de l'avance rapide", + "Fast Forward": "Avance rapide", + "Enabled": "Activé", + "Save State Slot": "Emplacement de l'état", + "Save State Location": "Stockage des états", + "Download": "Télécharger", + "Keep in Browser": "Dans le navigateur", + "Auto": "Auto", + "NTSC": "NTSC", + "PAL": "PAL", + "Dendy": "Dendy", + "8:7 PAR": "8:7 PAR", + "4:3": "4:3", + "Low": "Basse", + "High": "Élevée", + "Very High": "Très élevée", + "None": "Aucun", + "Player 1": "Joueur 1", + "Player 2": "Joueur 2", + "Both": "Les deux", + "SAVED STATE TO SLOT": "ÉTAT ENREGISTRÉ VERS L'EMPLACEMENT", + "LOADED STATE FROM SLOT": "ÉTAT CHARGÉ À PARTIR DE L'EMPLACEMENT", + "SET SAVE STATE SLOT TO": "DÉFINIR L'EMPLACEMENT DE L'ÉTAT ENREGISTRÉ À", + "Network Error": "Erreur réseau", + "Submit": "Soumettre", + "Description": "Description", + "Code": "Code", + "Add Cheat Code": "Ajouter un code de triche", + "Leave Room": "Sortir du salon", + "Password": "Mot de passe", + "Password (optional)": "Mot de passe (facultatif)", + "Max Players": "Nombre maximal de joueurs", + "Room Name": "Nom du salon", + "Join": "Rejoindre", + "Player Name": "Nom du joueur", + "Set Player Name": "Définir le nom du joueur", + "Left Handed Mode": "Mode gaucher", + "Virtual Gamepad": "Manette de jeu virtuelle", + "Disk": "Disque", + "Press Keyboard": "Appuyez sur le clavier", + "INSERT COIN": "INSÉRER UNE PIÈCE", + "Remove": "Retirer", + "SAVE LOADED FROM BROWSER": "SAUVEGARDE CHARGÉE À PARTIR DU NAVIGATEUR", + "SAVE SAVED TO BROWSER": "SAUVEGARDE ENREGISTRÉE DANS LE NAVIGATEUR", + "Join the discord": "Rejoindre le serveur Discord", + "View on GitHub": "Afficher sur GitHub", + "Failed to start game": "Échec au démarrage du jeu", + "Download Game BIOS": "Téléchargement du BIOS du jeu...", + "Decompress Game BIOS": "Décompression du BIOS du jeu...", + "Download Game Parent": "Téléchargement du jeu parent...", + "Decompress Game Parent": "Décompression du jeu parent...", + "Download Game Patch": "Téléchargement du correctif du jeu...", + "Decompress Game Patch": "Décompression du correctif du jeu...", + "Download Game State": "Téléchargement de l'état enregistré...", + "Check console": "Vérifier la console", + "Error for site owner": "Erreur pour le propriétaire du site", + "EmulatorJS": "EmulatorJS", + "Clear All": "Effacer tout", + "Take Screenshot": "Prendre une capture d'écran", + "Start Screen Recording": "Démarrer l'enregistrement de l'écran", + "Stop Screen Recording": "Arrêter l'enregistrement de l'écran", + "Quick Save": "Enregistrement rapide", + "Quick Load": "Chargement rapide", + "REWIND": "REMBOBINER", + "Rewind Enabled (requires restart)": "Rembobinage activé (nécessite un redémarrage)", + "Rewind Granularity": "Granularité du rembobinage", + "Slow Motion Ratio": "Vitesse du ralenti", + "Slow Motion": "Au ralenti", + "Home": "Accueil", + "EmulatorJS License": "Licence EmulatorJS", + "RetroArch License": "Licence RetroArch", + "This project is powered by": "Ce projet est propulsé par", + "View the RetroArch license here": "Consulter la licence de RetroArch", + "SLOW MOTION": "AU RALENTI", + "A": "A", + "B": "B", + "SELECT": "SELECT", + "START": "START", + "UP": "HAUT", + "DOWN": "BAS", + "LEFT": "GAUCHE", + "RIGHT": "DROITE", + "X": "X", + "Y": "Y", + "L": "L", + "R": "R", + "Z": "Z", + "STICK UP": "MANCHE HAUT", + "STICK DOWN": "MANCHE BAS", + "STICK LEFT": "MANCHE GAUCHE", + "STICK RIGHT": "MANCHE DROITE", + "C-PAD UP": "CROIX HAUT", + "C-PAD DOWN": "CROIX BAS", + "C-PAD LEFT": "CROIX GAUCHE", + "C-PAD RIGHT": "CROIX DROITE", + "MICROPHONE": "MICROPHONE", + "BUTTON 1 / START": "BOUTON 1 / START", + "BUTTON 2": "BOUTON 2", + "BUTTON": "BOUTON", + "LEFT D-PAD UP": "CROIX G HAUT", + "LEFT D-PAD DOWN": "CROIX G BAS", + "LEFT D-PAD LEFT": "CROIX G GAUCHE", + "LEFT D-PAD RIGHT": "CROIX G DROITE", + "RIGHT D-PAD UP": "CROIX D HAUT", + "RIGHT D-PAD DOWN": "CROIX D BAS", + "RIGHT D-PAD LEFT": "CROIX D GAUCHE", + "RIGHT D-PAD RIGHT": "CROIX D DROITE", + "C": "C", + "MODE": "MODE", + "FIRE": "FIRE", + "RESET": "RESET", + "LEFT DIFFICULTY A": "LEFT DIFFICULTY A", + "LEFT DIFFICULTY B": "LEFT DIFFICULTY B", + "RIGHT DIFFICULTY A": "RIGHT DIFFICULTY A", + "RIGHT DIFFICULTY B": "RIGHT DIFFICULTY A", + "COLOR": "COLOR", + "B/W": "B/W", + "PAUSE": "PAUSE", + "OPTION": "OPTION", + "OPTION 1": "OPTION 1", + "OPTION 2": "OPTION 2", + "L2": "L2", + "R2": "R2", + "L3": "L3", + "R3": "R3", + "L STICK UP": "MANCHE G HAUT", + "L STICK DOWN": "MANCHE G BAS", + "L STICK LEFT": "MANCHE G GAUCHE", + "L STICK RIGHT": "MANCHE G DROITE", + "R STICK UP": "MANCHE D HAUT", + "R STICK DOWN": "MANCHE D BAS", + "R STICK LEFT": "MANCHE D GAUCHE", + "R STICK RIGHT": "MANCHE D DROITE", + "Start": "START", + "Select": "SELECT", + "Fast": "FAST", + "Slow": "SLOW", + "a": "A", + "b": "B", + "c": "C", + "d": "D", + "e": "E", + "f": "F", + "g": "G", + "h": "H", + "i": "I", + "j": "J", + "k": "K", + "l": "L", + "m": "M", + "n": "N", + "o": "O", + "p": "P", + "q": "Q", + "r": "R", + "s": "S", + "t": "T", + "u": "U", + "v": "V", + "w": "W", + "x": "X", + "y": "Y", + "z": "Z", + "enter": "Entrée", + "escape": "Échap", + "space": "Espace", + "tab": "Tab.", + "backspace": "Retour arrière", + "delete": "Suppr.", + "arrowup": "Flèche vers le haut", + "arrowdown": "Flèche vers le bas", + "arrowleft": "Flèche vers la gauche", + "arrowright": "Flèche vers la droite", + "f1": "F1", + "f2": "F2", + "f3": "F3", + "f4": "F4", + "f5": "F5", + "f6": "F6", + "f7": "F7", + "f8": "F8", + "f9": "F9", + "f10": "F10", + "f11": "F11", + "f12": "F12", + "shift": "Maj", + "control": "Ctrl", + "alt": "Alt", + "meta": "Méta", + "capslock": "Verr. maj", + "insert": "Insér.", + "home": "Début", + "end": "Fin", + "pageup": "Pg préc", + "pagedown": "Pg suiv", + "!": "!", + "@": "@", + "#": "#", + "$": "$", + "%": "%", + "^": "^", + "&": "&", + "*": "*", + "(": "(", + ")": ")", + "-": "-", + "_": "_", + "+": "+", + "=": "=", + "[": "[", + "]": "]", + "{": "{", + "}": "}", + ";": ";", + ":": ":", + "'": "'", + "\"": "\"", + ",": ",", + ".": ".", + "<": "<", + ">": ">", + "/": "/", + "?": "?", + "LEFT_STICK_X": "MANCHE_GAUCHE_X", + "LEFT_STICK_Y": "MANCHE_GAUCHE_Y", + "RIGHT_STICK_X": "MANCHE_DROIT_X", + "RIGHT_STICK_Y": "MANCHE_DROIT_Y", + "LEFT_TRIGGER": "GACHETTE_GAUCHE", + "RIGHT_TRIGGER": "GACHETTE_DROITE", + "A_BUTTON": "BOUTON_A", + "B_BUTTON": "BOUTON_B", + "X_BUTTON": "BOUTON_X", + "Y_BUTTON": "BOUTON_Y", + "START_BUTTON": "BOUTON_START", + "SELECT_BUTTON": "BOUTON_SELECT", + "L1_BUTTON": "BOUTON_L1", + "R1_BUTTON": "BOUTON_R1", + "L2_BUTTON": "BOUTON_L2", + "R2_BUTTON": "BOUTON_R2", + "LEFT_THUMB_BUTTON": "BOUTON_MANCHE_GAUCHE", + "RIGHT_THUMB_BUTTON": "BOUTON_MANCHE_DROIT", + "DPAD_UP": "CROIX_HAUT", + "DPAD_DOWN": "CROIX_BAS", + "DPAD_LEFT": "CROIX_GAUCHE", + "DPAD_RIGHT": "CROIX_DROITE", + "Disks": "Disques", + "Exit EmulatorJS": "Quitter EmulatorJS", + "BUTTON_1": "BOUTON_1", + "BUTTON_2": "BOUTON_2", + "BUTTON_3": "BOUTON_3", + "BUTTON_4": "BOUTON_4", + "up arrow": "Flèche haut", + "down arrow": "Flèche bas", + "left arrow": "Flèche gauche", + "right arrow": "Flèche droite", + "LEFT_TOP_SHOULDER": "BOUTON_EPAULE_GAUCHE", + "RIGHT_TOP_SHOULDER": "BOUTON_EPAULE_DROITE", + "CRT beam": "CRT beam", + "CRT caligari": "CRT caligari", + "CRT lottes": "CRT lottes", + "CRT yeetron": "CRT yeetron", + "CRT zfast": "CRT zfast", + "SABR": "SABR", + "Bicubic": "Bicubique", + "Mix frames": "Mix frames", + "WebGL2": "WebGL2", + "Requires restart": "Redémarrage requis", + "VSync": "VSync", + "Video Rotation": "Rotation vidéo", + "Rewind Enabled (Requires restart)": "Rembobinage activé (Redémarrage requis)", + "System Save interval": "Intervalle de sauvegarde du système", + "Menu Bar Button": "Bouton de la barre de menu", + "visible": "visible", + "hidden": "masqué" +} diff --git a/data/localization/hi-HI.json b/data/localization/hi.json similarity index 99% rename from data/localization/hi-HI.json rename to data/localization/hi.json index 98f13fe7..b7b05b2e 100644 --- a/data/localization/hi-HI.json +++ b/data/localization/hi.json @@ -298,4 +298,4 @@ "DPAD_DOWN": "डीपीएडी_डाउन", "DPAD_LEFT": "DPAD_LEFT", "DPAD_RIGHT": "डीपीएडी_दाएँ" -} \ No newline at end of file +} diff --git a/data/localization/it-IT.json b/data/localization/it.json similarity index 100% rename from data/localization/it-IT.json rename to data/localization/it.json diff --git a/data/localization/ja-JA.json b/data/localization/ja-JA.json deleted file mode 100644 index 1c0b012a..00000000 --- a/data/localization/ja-JA.json +++ /dev/null @@ -1,301 +0,0 @@ -{ - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7", - "8": "8", - "9": "9", - "Restart": "再起動", - "Pause": "一時停止", - "Play": "遊ぶ", - "Save State": "状態を保存", - "Load State": "ロード状態", - "Control Settings": "コントロール設定", - "Cheats": "チート", - "Cache Manager": "キャッシュマネージャー", - "Export Save File": "保存ファイルのエクスポート", - "Import Save File": "保存ファイルのインポート", - "Netplay": "ネットプレイ", - "Mute": "ミュート", - "Unmute": "ミュートを解除する", - "Settings": "設定", - "Enter Fullscreen": "全画面表示に入る", - "Exit Fullscreen": "全画面表示を終了する", - "Reset": "リセット", - "Clear": "クリア", - "Close": "近い", - "QUICK SAVE STATE": "状態のクイック保存", - "QUICK LOAD STATE": "クイックロード状態", - "CHANGE STATE SLOT": "状態スロットの変更", - "FAST FORWARD": "早送り", - "Player": "プレーヤー", - "Connected Gamepad": "接続されたゲームパッド", - "Gamepad": "ゲームパッド", - "Keyboard": "キーボード", - "Set": "セット", - "Add Cheat": "チートの追加", - "Create a Room": "ルームを作成する", - "Rooms": "部屋", - "Start Game": "ゲームをスタート", - "Loading...": "読み込み中...", - "Download Game Core": "ゲームコアをダウンロード", - "Decompress Game Core": "ゲームコアを解凍する", - "Download Game Data": "ゲームデータのダウンロード", - "Decompress Game Data": "ゲームデータを解凍する", - "Shaders": "シェーダ", - "Disabled": "無効", - "2xScaleHQ": "2xスケール本社", - "4xScaleHQ": "4xスケール本社", - "CRT easymode": "CRTイージーモード", - "CRT aperture": "CRTの絞り", - "CRT geom": "CRT ジオム", - "CRT mattias": "CRT マティアス", - "FPS": "FPS", - "show": "見せる", - "hide": "隠れる", - "Fast Forward Ratio": "早送り率", - "Fast Forward": "早送り", - "Enabled": "有効", - "Save State Slot": "状態保存スロット", - "Save State Location": "状態の保存場所", - "Download": "ダウンロード", - "Keep in Browser": "ブラウザ内に保持", - "Auto": "自動", - "NTSC": "NTSC", - "PAL": "パル", - "Dendy": "デンディ", - "8:7 PAR": "8:7 パー", - "4:3": "4:3", - "Low": "低い", - "High": "高い", - "Very High": "すごく高い", - "None": "なし", - "Player 1": "プレイヤー 1", - "Player 2": "プレイヤー2", - "Both": "両方", - "SAVED STATE TO SLOT": "状態をスロットに保存しました", - "LOADED STATE FROM SLOT": "スロットからロードされた状態", - "SET SAVE STATE SLOT TO": "状態保存スロットを次のように設定します", - "Network Error": "ネットワークエラー", - "Submit": "提出する", - "Description": "説明", - "Code": "コード", - "Add Cheat Code": "チートコードを追加する", - "Leave Room": "部屋を出る", - "Password": "パスワード", - "Password (optional)": "パスワード (オプション)", - "Max Players": "最大プレイヤー数", - "Room Name": "部屋の名前", - "Join": "参加する", - "Player Name": "プレーヤの名前", - "Set Player Name": "プレイヤー名の設定", - "Left Handed Mode": "左利きモード", - "Virtual Gamepad": "仮想ゲームパッド", - "Disk": "ディスク", - "Press Keyboard": "キーボードを押す", - "INSERT COIN": "コインを入れる", - "Remove": "取り除く", - "SAVE LOADED FROM BROWSER": "ブラウザからロードして保存", - "SAVE SAVED TO BROWSER": "保存 ブラウザに保存", - "Join the discord": "ディスコードに参加する", - "View on GitHub": "GitHub で見る", - "Failed to start game": "ゲームの開始に失敗しました", - "Download Game BIOS": "ゲーム BIOS をダウンロードする", - "Decompress Game BIOS": "ゲーム BIOS を解凍する", - "Download Game Parent": "ゲームの親をダウンロード", - "Decompress Game Parent": "ゲームの親を解凍する", - "Download Game Patch": "ゲームパッチをダウンロード", - "Decompress Game Patch": "ゲームパッチを解凍する", - "Download Game State": "ゲームステートのダウンロード", - "Check console": "コンソールを確認してください", - "Error for site owner": "サイト所有者のエラー", - "EmulatorJS": "エミュレータJS", - "Clear All": "すべてクリア", - "Take Screenshot": "スクリーンショットを撮ります", - "Quick Save": "クイックセーブ", - "Quick Load": "クイックロード", - "REWIND": "巻き戻し", - "Rewind Enabled (requires restart)": "巻き戻しが有効 (再起動が必要)", - "Rewind Granularity": "巻き戻し粒度", - "Slow Motion Ratio": "スローモーション比率", - "Slow Motion": "スローモーション", - "Home": "家", - "EmulatorJS License": "エミュレータJSライセンス", - "RetroArch License": "RetroArch ライセンス", - "SLOW MOTION": "スローモーション", - "A": "あ", - "B": "B", - "SELECT": "選択する", - "START": "始める", - "UP": "上", - "DOWN": "下", - "LEFT": "左", - "RIGHT": "右", - "X": "バツ", - "Y": "Y", - "L": "L", - "R": "R", - "Z": "Z", - "STICK UP": "上に突き出る", - "STICK DOWN": "スティックダウン", - "STICK LEFT": "左スティック", - "STICK RIGHT": "右スティック", - "C-PAD UP": "Cパッドアップ", - "C-PAD DOWN": "C-パッドを下へ", - "C-PAD LEFT": "C-パッド左", - "C-PAD RIGHT": "Cパッド右", - "MICROPHONE": "マイクロフォン", - "BUTTON 1 / START": "ボタン 1 / スタート", - "BUTTON 2": "ボタン2", - "BUTTON": "ボタン", - "LEFT D-PAD UP": "左方向パッドを上に", - "LEFT D-PAD DOWN": "左方向パッド下", - "LEFT D-PAD LEFT": "左十字キー左", - "LEFT D-PAD RIGHT": "左十字キー右", - "RIGHT D-PAD UP": "右方向パッド上", - "RIGHT D-PAD DOWN": "右方向パッド下", - "RIGHT D-PAD LEFT": "右十字キー左", - "RIGHT D-PAD RIGHT": "右十字キー右", - "C": "C", - "MODE": "モード", - "FIRE": "火", - "RESET": "リセット", - "LEFT DIFFICULTY A": "左の難易度A", - "LEFT DIFFICULTY B": "左の難易度B", - "RIGHT DIFFICULTY A": "右の難易度A", - "RIGHT DIFFICULTY B": "右の難易度B", - "COLOR": "色", - "B/W": "白黒", - "PAUSE": "一時停止", - "OPTION": "オプション", - "OPTION 1": "オプション1", - "OPTION 2": "オプション 2", - "L2": "L2", - "R2": "R2", - "L3": "L3", - "R3": "R3", - "L STICK UP": "Lスティックアップ", - "L STICK DOWN": "Lスティックダウン", - "L STICK LEFT": "Lスティック左", - "L STICK RIGHT": "Lスティック右", - "R STICK UP": "Rスティックアップ", - "R STICK DOWN": "Rスティックダウン", - "R STICK LEFT": "Rスティック左", - "R STICK RIGHT": "R右スティック", - "Start": "始める", - "Select": "選択する", - "Fast": "速い", - "Slow": "遅い", - "a": "ある", - "b": "b", - "c": "c", - "d": "d", - "e": "e", - "f": "f", - "g": "g", - "h": "h", - "i": "私", - "j": "j", - "k": "k", - "l": "私", - "m": "メートル", - "n": "n", - "o": "ああ", - "p": "p", - "q": "q", - "r": "r", - "s": "s", - "t": "t", - "u": "あなた", - "v": "v", - "w": "w", - "x": "バツ", - "y": "y", - "z": "z", - "enter": "入力", - "escape": "逃げる", - "space": "空間", - "tab": "タブ", - "backspace": "バックスペース", - "delete": "消去", - "arrowup": "アローアップ", - "arrowdown": "矢印", - "arrowleft": "矢印左", - "arrowright": "右矢印", - "f1": "f1", - "f2": "f2", - "f3": "f3", - "f4": "f4", - "f5": "f5", - "f6": "f6", - "f7": "f7", - "f8": "f8", - "f9": "f9", - "f10": "f10", - "f11": "f11", - "f12": "f12", - "shift": "シフト", - "control": "コントロール", - "alt": "代替", - "meta": "メタ", - "capslock": "キャップスロック", - "insert": "入れる", - "home": "家", - "end": "終わり", - "pageup": "ページアップ", - "pagedown": "ページダウン", - "!": "!", - "@": "@", - "#": "#", - "$": "$", - "%": "%", - "^": "^", - "&": "&", - "*": "*", - "(": "(", - ")": ")", - "-": "-", - "_": "_", - "+": "+", - "=": "=", - "[": "[", - "]": "】", - "{": "{", - "}": "}", - ";": ";", - ":": ":", - "'": "'", - "\"": "」", - ",": "、", - ".": "。", - "<": "<", - ">": ">", - "/": "/", - "?": "?", - "LEFT_STICK_X": "LEFT_STICK_X", - "LEFT_STICK_Y": "左スティック_Y", - "RIGHT_STICK_X": "RIGHT_STICK_X", - "RIGHT_STICK_Y": "右スティック_Y", - "LEFT_TRIGGER": "LEFT_TRIGGER", - "RIGHT_TRIGGER": "右トリガー", - "A_BUTTON": "ボタン", - "B_BUTTON": "B_ボタン", - "X_BUTTON": "X_ボタン", - "Y_BUTTON": "Y_ボタン", - "START_BUTTON": "スタートボタン", - "SELECT_BUTTON": "SELECT_BUTTON", - "L1_BUTTON": "L1_ボタン", - "R1_BUTTON": "R1_ボタン", - "L2_BUTTON": "L2_ボタン", - "R2_BUTTON": "R2_ボタン", - "LEFT_THUMB_BUTTON": "LEFT_THUMB_BUTTON", - "RIGHT_THUMB_BUTTON": "RIGHT_THUMB_BUTTON", - "DPAD_UP": "DPAD_UP", - "DPAD_DOWN": "DPAD_DOWN", - "DPAD_LEFT": "DPAD_LEFT", - "DPAD_RIGHT": "DPAD_RIGHT" -} \ No newline at end of file diff --git a/data/localization/ja.json b/data/localization/ja.json new file mode 100644 index 00000000..272445a2 --- /dev/null +++ b/data/localization/ja.json @@ -0,0 +1,301 @@ +{ + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "8", + "9": "9", + "Restart": "再起動", + "Pause": "一時停止", + "Play": "開始", + "Save State": "ステートセーブ", + "Load State": "ステートロード", + "Control Settings": "キーコンフィグ", + "Cheats": "チート", + "Cache Manager": "キャッシュマネージャー", + "Export Save File": "セーブデータをエクスポート", + "Import Save File": "セーブデータをインポート", + "Netplay": "ネットプレイ", + "Mute": "ミュート", + "Unmute": "ミュート解除", + "Settings": "設定", + "Enter Fullscreen": "全画面表示", + "Exit Fullscreen": "全画面表示を終了", + "Reset": "リセット", + "Clear": "クリア", + "Close": "閉じる", + "QUICK SAVE STATE": "クイックセーブ", + "QUICK LOAD STATE": "クイックロード", + "CHANGE STATE SLOT": "セーブスロットの変更", + "FAST FORWARD": "早送り", + "Player": "プレイヤー", + "Connected Gamepad": "接続されたゲームパッド", + "Gamepad": "ゲームパッド", + "Keyboard": "キーボード", + "Set": "セット", + "Add Cheat": "チートの追加", + "Create a Room": "部屋を作成", + "Rooms": "部屋", + "Start Game": "ゲームスタート", + "Loading...": "読み込み中...", + "Download Game Core": "ゲームコアをダウンロード", + "Decompress Game Core": "ゲームコアを解凍", + "Download Game Data": "ゲームデータのダウンロード", + "Decompress Game Data": "ゲームデータを解凍", + "Shaders": "シェーダー", + "Disabled": "無効", + "2xScaleHQ": "2xスケール", + "4xScaleHQ": "4xスケール", + "CRT easymode": "CRT (イージーモード)", + "CRT aperture": "CRT (アパーチャ)", + "CRT geom": "CRT (ジオメ)", + "CRT mattias": "CRT (Mattias)", + "FPS": "FPS", + "show": "表示", + "hide": "非表示", + "Fast Forward Ratio": "早送り速度", + "Fast Forward": "早送り", + "Enabled": "有効", + "Save State Slot": "ステートセーブスロット", + "Save State Location": "ステートセーブ保存場所", + "Download": "ダウンロード", + "Keep in Browser": "ブラウザ内に保持", + "Auto": "自動", + "NTSC": "NTSC", + "PAL": "PAL", + "Dendy": "Dendy", + "8:7 PAR": "8:7 PAR", + "4:3": "4:3", + "Low": "低", + "High": "高", + "Very High": "超高", + "None": "なし", + "Player 1": "プレイヤー1", + "Player 2": "プレイヤー2", + "Both": "両方", + "SAVED STATE TO SLOT": "状態をスロットにセーブしました", + "LOADED STATE FROM SLOT": "状態をスロットからロードしました", + "SET SAVE STATE SLOT TO": "状態保存スロットを次のように設定します", + "Network Error": "ネットワークエラー", + "Submit": "適用", + "Description": "説明", + "Code": "コード", + "Add Cheat Code": "チートコードを追加する", + "Leave Room": "部屋を退出", + "Password": "パスワード", + "Password (optional)": "パスワード (オプション)", + "Max Players": "最大プレイヤー数", + "Room Name": "部屋の名前", + "Join": "参加する", + "Player Name": "プレイヤー名", + "Set Player Name": "プレイヤー名の設定", + "Left Handed Mode": "左利きモード", + "Virtual Gamepad": "仮想ゲームパッド", + "Disk": "ディスク", + "Press Keyboard": "キーボードを押す", + "INSERT COIN": "コインを入れる", + "Remove": "削除", + "SAVE LOADED FROM BROWSER": "セーブをブラウザからロード", + "SAVE SAVED TO BROWSER": "セーブをブラウザに保存", + "Join the discord": "ディスコードに参加", + "View on GitHub": "GitHub で見る", + "Failed to start game": "ゲームの開始に失敗しました", + "Download Game BIOS": "ゲームBIOSをダウンロード", + "Decompress Game BIOS": "ゲームBIOSを解凍", + "Download Game Parent": "ゲームの親をダウンロード", + "Decompress Game Parent": "ゲームの親を解凍", + "Download Game Patch": "ゲームパッチをダウンロード", + "Decompress Game Patch": "ゲームパッチを解凍", + "Download Game State": "ゲームステートのダウンロード", + "Check console": "コンソールを確認してください", + "Error for site owner": "サイト所有者のエラー", + "EmulatorJS": "エミュレータJS", + "Clear All": "すべてクリア", + "Take Screenshot": "スクリーンショットを撮影", + "Quick Save": "クイックセーブ", + "Quick Load": "クイックロード", + "REWIND": "巻き戻し", + "Rewind Enabled (requires restart)": "巻き戻しが有効 (再起動が必要)", + "Rewind Granularity": "巻き戻し粒度", + "Slow Motion Ratio": "スローモーション比率", + "Slow Motion": "スローモーション", + "Home": "ホーム", + "EmulatorJS License": "エミュレータJSライセンス", + "RetroArch License": "RetroArch ライセンス", + "SLOW MOTION": "スローモーション", + "A": "A", + "B": "B", + "SELECT": "SELECT", + "START": "START", + "UP": "上", + "DOWN": "下", + "LEFT": "左", + "RIGHT": "右", + "X": "X", + "Y": "Y", + "L": "L", + "R": "R", + "Z": "Z", + "STICK UP": "スティック上", + "STICK DOWN": "スティック下", + "STICK LEFT": "スティック左", + "STICK RIGHT": "スティック右", + "C-PAD UP": "Cボタン上", + "C-PAD DOWN": "Cボタン下", + "C-PAD LEFT": "Cボタン左", + "C-PAD RIGHT": "Cボタン右", + "MICROPHONE": "マイク", + "BUTTON 1 / START": "ボタン1 / スタート", + "BUTTON 2": "ボタン2", + "BUTTON": "ボタン", + "LEFT D-PAD UP": "十字キー上", + "LEFT D-PAD DOWN": "十字キー下", + "LEFT D-PAD LEFT": "十字キー左", + "LEFT D-PAD RIGHT": "十字キー右", + "RIGHT D-PAD UP": "右十字キー上", + "RIGHT D-PAD DOWN": "右十字キー下", + "RIGHT D-PAD LEFT": "右十字キー左", + "RIGHT D-PAD RIGHT": "右十字キー右", + "C": "C", + "MODE": "モード", + "FIRE": "発射", + "RESET": "リセット", + "LEFT DIFFICULTY A": "左難易度A", + "LEFT DIFFICULTY B": "左難易度B", + "RIGHT DIFFICULTY A": "右難易度A", + "RIGHT DIFFICULTY B": "右難易度B", + "COLOR": "カラー", + "B/W": "白黒", + "PAUSE": "一時停止", + "OPTION": "オプション", + "OPTION 1": "オプション1", + "OPTION 2": "オプション2", + "L2": "L2", + "R2": "R2", + "L3": "L3", + "R3": "R3", + "L STICK UP": "左スティック上", + "L STICK DOWN": "左スティック下", + "L STICK LEFT": "左スティック左", + "L STICK RIGHT": "左スティック右", + "R STICK UP": "右スティック上", + "R STICK DOWN": "右スティック下", + "R STICK LEFT": "右スティック左", + "R STICK RIGHT": "右スティック右", + "Start": "Start", + "Select": "Select", + "Fast": "Fast", + "Slow": "Slow", + "a": "a", + "b": "b", + "c": "c", + "d": "d", + "e": "e", + "f": "f", + "g": "g", + "h": "h", + "i": "i", + "j": "j", + "k": "k", + "l": "l", + "m": "m", + "n": "n", + "o": "o", + "p": "p", + "q": "q", + "r": "r", + "s": "s", + "t": "t", + "u": "u", + "v": "v", + "w": "w", + "x": "x", + "y": "y", + "z": "z", + "enter": "enter", + "escape": "escape", + "space": "space", + "tab": "tab", + "backspace": "backspace", + "delete": "delete", + "arrowup": "矢印上", + "arrowdown": "矢印下", + "arrowleft": "矢印左", + "arrowright": "矢印右", + "f1": "f1", + "f2": "f2", + "f3": "f3", + "f4": "f4", + "f5": "f5", + "f6": "f6", + "f7": "f7", + "f8": "f8", + "f9": "f9", + "f10": "f10", + "f11": "f11", + "f12": "f12", + "shift": "shift", + "control": "control", + "alt": "alt", + "meta": "meta", + "capslock": "capslock", + "insert": "insert", + "home": "home", + "end": "end", + "pageup": "pageup", + "pagedown": "pagedown", + "!": "!", + "@": "@", + "#": "#", + "$": "$", + "%": "%", + "^": "^", + "&": "&", + "*": "*", + "(": "(", + ")": ")", + "-": "-", + "_": "_", + "+": "+", + "=": "=", + "[": "[", + "]": "]", + "{": "{", + "}": "}", + ";": ";", + ":": ":", + "'": "'", + "\"": "\"", + ",": ",", + ".": ".", + "<": "<", + ">": ">", + "/": "/", + "?": "?", + "LEFT_STICK_X": "左スティック_X", + "LEFT_STICK_Y": "左スティック_Y", + "RIGHT_STICK_X": "右スティック_X", + "RIGHT_STICK_Y": "右スティック_Y", + "LEFT_TRIGGER": "左トリガー", + "RIGHT_TRIGGER": "右トリガー", + "A_BUTTON": "A_ボタン", + "B_BUTTON": "B_ボタン", + "X_BUTTON": "X_ボタン", + "Y_BUTTON": "Y_ボタン", + "START_BUTTON": "スタートボタン", + "SELECT_BUTTON": "セレクトボタン", + "L1_BUTTON": "L1_ボタン", + "R1_BUTTON": "R1_ボタン", + "L2_BUTTON": "L2_ボタン", + "R2_BUTTON": "R2_ボタン", + "LEFT_THUMB_BUTTON": "左スティック押し込み", + "RIGHT_THUMB_BUTTON": "右スティック押し込み", + "DPAD_UP": "十字キー上", + "DPAD_DOWN": "十字キー下", + "DPAD_LEFT": "十字キー左", + "DPAD_RIGHT": "十字キー右" +} diff --git a/data/localization/jv-JV.json b/data/localization/jv.json similarity index 99% rename from data/localization/jv-JV.json rename to data/localization/jv.json index 7d1a10c2..47c71c91 100644 --- a/data/localization/jv-JV.json +++ b/data/localization/jv.json @@ -298,4 +298,4 @@ "DPAD_DOWN": "DPAD_DOWN", "DPAD_LEFT": "DPAD_LEFT", "DPAD_RIGHT": "DPAD_RIGHT" -} \ No newline at end of file +} diff --git a/data/localization/ko-KO.json b/data/localization/ko-KO.json deleted file mode 100644 index 133c673b..00000000 --- a/data/localization/ko-KO.json +++ /dev/null @@ -1,301 +0,0 @@ -{ - "0": "0", - "1": "1", - "2": "2", - "3": "삼", - "4": "4", - "5": "5", - "6": "6", - "7": "7", - "8": "8", - "9": "9", - "Restart": "재시작", - "Pause": "정지시키다", - "Play": "놀다", - "Save State": "상태 저장", - "Load State": "로드 상태", - "Control Settings": "제어 설정", - "Cheats": "치트", - "Cache Manager": "캐시 관리자", - "Export Save File": "저장 파일 내보내기", - "Import Save File": "저장 파일 가져오기", - "Netplay": "넷플레이", - "Mute": "무음", - "Unmute": "음소거 해제", - "Settings": "설정", - "Enter Fullscreen": "전체 화면 시작", - "Exit Fullscreen": "전체화면 종료", - "Reset": "초기화", - "Clear": "분명한", - "Close": "닫다", - "QUICK SAVE STATE": "빠른 저장 상태", - "QUICK LOAD STATE": "빠른 로드 상태", - "CHANGE STATE SLOT": "상태 슬롯 변경", - "FAST FORWARD": "빨리 감기", - "Player": "플레이어", - "Connected Gamepad": "연결된 게임패드", - "Gamepad": "게임패드", - "Keyboard": "건반", - "Set": "세트", - "Add Cheat": "치트 추가", - "Create a Room": "방 만들기", - "Rooms": "객실", - "Start Game": "게임을 시작하다", - "Loading...": "로드 중...", - "Download Game Core": "게임 코어 다운로드", - "Decompress Game Core": "게임 코어 압축 해제", - "Download Game Data": "게임 데이터 다운로드", - "Decompress Game Data": "게임 데이터 압축 해제", - "Shaders": "셰이더", - "Disabled": "장애가 있는", - "2xScaleHQ": "2xScaleHQ", - "4xScaleHQ": "4xScaleHQ", - "CRT easymode": "브라운관 이지모드", - "CRT aperture": "CRT 조리개", - "CRT geom": "브라운관 검", - "CRT mattias": "CRT 마티아스", - "FPS": "FPS", - "show": "보여주다", - "hide": "숨다", - "Fast Forward Ratio": "빨리 감기 비율", - "Fast Forward": "빨리 감기", - "Enabled": "사용", - "Save State Slot": "상태 슬롯 저장", - "Save State Location": "상태 위치 저장", - "Download": "다운로드", - "Keep in Browser": "브라우저에 보관", - "Auto": "자동", - "NTSC": "NTSC", - "PAL": "단짝", - "Dendy": "덴디", - "8:7 PAR": "8:7 동점", - "4:3": "4:3", - "Low": "낮은", - "High": "높은", - "Very High": "매우 높음", - "None": "없음", - "Player 1": "플레이어 1", - "Player 2": "플레이어 2", - "Both": "둘 다", - "SAVED STATE TO SLOT": "슬롯에 저장된 상태", - "LOADED STATE FROM SLOT": "슬롯에서 로드된 상태", - "SET SAVE STATE SLOT TO": "저장 상태 슬롯을 다음으로 설정", - "Network Error": "네트워크 오류", - "Submit": "제출하다", - "Description": "설명", - "Code": "암호", - "Add Cheat Code": "치트 코드 추가", - "Leave Room": "방 나가기", - "Password": "비밀번호", - "Password (optional)": "비밀번호(선택 사항)", - "Max Players": "최대 플레이어", - "Room Name": "방 이름", - "Join": "가입하다", - "Player Name": "선수 이름", - "Set Player Name": "플레이어 이름 설정", - "Left Handed Mode": "왼손잡이 모드", - "Virtual Gamepad": "가상 게임패드", - "Disk": "디스크", - "Press Keyboard": "키보드 누르기", - "INSERT COIN": "동전을 넣으세요", - "Remove": "제거하다", - "SAVE LOADED FROM BROWSER": "브라우저에서 불러온 저장", - "SAVE SAVED TO BROWSER": "저장 브라우저에 저장됨", - "Join the discord": "불화에 동참하십시오", - "View on GitHub": "GitHub에서 보기", - "Failed to start game": "게임을 시작하지 못했습니다.", - "Download Game BIOS": "게임 BIOS 다운로드", - "Decompress Game BIOS": "게임 BIOS 압축 해제", - "Download Game Parent": "게임 부모 다운로드", - "Decompress Game Parent": "게임 부모 압축 해제", - "Download Game Patch": "게임 패치 다운로드", - "Decompress Game Patch": "게임 패치 압축 해제", - "Download Game State": "게임 상태 다운로드", - "Check console": "콘솔 확인", - "Error for site owner": "사이트 소유자 오류", - "EmulatorJS": "EmulatorJS", - "Clear All": "모두 지우기", - "Take Screenshot": "스크린 샷을 찍다", - "Quick Save": "빠른 저장", - "Quick Load": "빠른 로드", - "REWIND": "되감기", - "Rewind Enabled (requires restart)": "되감기 활성화됨(다시 시작해야 함)", - "Rewind Granularity": "되감기 세분성", - "Slow Motion Ratio": "슬로우 모션 비율", - "Slow Motion": "느린", - "Home": "집", - "EmulatorJS License": "EmulatorJS 라이선스", - "RetroArch License": "레트로아크 라이선스", - "SLOW MOTION": "느린", - "A": "ㅏ", - "B": "비", - "SELECT": "선택하다", - "START": "시작", - "UP": "위로", - "DOWN": "아래에", - "LEFT": "왼쪽", - "RIGHT": "오른쪽", - "X": "엑스", - "Y": "와이", - "L": "엘", - "R": "아르 자형", - "Z": "지", - "STICK UP": "스틱 업", - "STICK DOWN": "스틱 다운", - "STICK LEFT": "스틱 왼쪽", - "STICK RIGHT": "스틱 오른쪽", - "C-PAD UP": "C 패드 위로", - "C-PAD DOWN": "C패드 다운", - "C-PAD LEFT": "C 패드 왼쪽", - "C-PAD RIGHT": "C 패드 오른쪽", - "MICROPHONE": "마이크로폰", - "BUTTON 1 / START": "버튼 1 / 시작", - "BUTTON 2": "버튼 2", - "BUTTON": "단추", - "LEFT D-PAD UP": "왼쪽 방향 패드 위로", - "LEFT D-PAD DOWN": "왼쪽 방향 패드 아래로", - "LEFT D-PAD LEFT": "왼쪽 방향 패드 왼쪽", - "LEFT D-PAD RIGHT": "왼쪽 방향 패드 오른쪽", - "RIGHT D-PAD UP": "오른쪽 방향 패드 위로", - "RIGHT D-PAD DOWN": "오른쪽 방향 패드 아래로", - "RIGHT D-PAD LEFT": "오른쪽 방향 패드 왼쪽", - "RIGHT D-PAD RIGHT": "오른쪽 방향 패드 오른쪽", - "C": "씨", - "MODE": "방법", - "FIRE": "불", - "RESET": "초기화", - "LEFT DIFFICULTY A": "왼쪽 난이도 A", - "LEFT DIFFICULTY B": "왼쪽 난이도 B", - "RIGHT DIFFICULTY A": "오른쪽 난이도 A", - "RIGHT DIFFICULTY B": "오른쪽 난이도 B", - "COLOR": "색상", - "B/W": "흑백", - "PAUSE": "정지시키다", - "OPTION": "옵션", - "OPTION 1": "옵션 1", - "OPTION 2": "옵션 2", - "L2": "L2", - "R2": "R2", - "L3": "L3", - "R3": "R3", - "L STICK UP": "L 스틱 업", - "L STICK DOWN": "L 스틱 다운", - "L STICK LEFT": "왼쪽 스틱", - "L STICK RIGHT": "L 오른쪽 스틱", - "R STICK UP": "R 스틱 업", - "R STICK DOWN": "R 스틱 다운", - "R STICK LEFT": "R 스틱 왼쪽", - "R STICK RIGHT": "R 오른쪽 스틱", - "Start": "시작", - "Select": "선택하다", - "Fast": "빠른", - "Slow": "느린", - "a": "ㅏ", - "b": "비", - "c": "씨", - "d": "디", - "e": "이자형", - "f": "에프", - "g": "g", - "h": "시간", - "i": "나", - "j": "제이", - "k": "케이", - "l": "엘", - "m": "중", - "n": "N", - "o": "영형", - "p": "피", - "q": "큐", - "r": "아르 자형", - "s": "에스", - "t": "티", - "u": "유", - "v": "V", - "w": "승", - "x": "엑스", - "y": "와이", - "z": "지", - "enter": "입력하다", - "escape": "탈출하다", - "space": "공간", - "tab": "탭", - "backspace": "역행 키이", - "delete": "삭제", - "arrowup": "화살촉", - "arrowdown": "화살표 방향", - "arrowleft": "왼쪽 화살표", - "arrowright": "오른쪽 화살표", - "f1": "f1", - "f2": "f2", - "f3": "f3", - "f4": "f4", - "f5": "f5", - "f6": "f6", - "f7": "f7", - "f8": "f8", - "f9": "f9", - "f10": "f10", - "f11": "f11", - "f12": "f12", - "shift": "옮기다", - "control": "제어", - "alt": "대안", - "meta": "메타", - "capslock": "캡스락", - "insert": "끼워 넣다", - "home": "집", - "end": "끝", - "pageup": "페이지 위로", - "pagedown": "페이지 다운", - "!": "!", - "@": "@", - "#": "#", - "$": "$", - "%": "%", - "^": "^^", - "&": "&", - "*": "*", - "(": "(", - ")": ")", - "-": "-", - "_": "_", - "+": "+", - "=": "=", - "[": "[", - "]": "]", - "{": "{", - "}": "}", - ";": ";", - ":": ":", - "'": "'", - "\"": "\"", - ",": ",", - ".": ".", - "<": "<", - ">": ">", - "/": "/", - "?": "?", - "LEFT_STICK_X": "왼쪽_스틱_X", - "LEFT_STICK_Y": "왼쪽_스틱_Y", - "RIGHT_STICK_X": "RIGHT_STICK_X", - "RIGHT_STICK_Y": "오른쪽_스틱_Y", - "LEFT_TRIGGER": "왼쪽_트리거", - "RIGHT_TRIGGER": "RIGHT_TRIGGER", - "A_BUTTON": "단추", - "B_BUTTON": "B_버튼", - "X_BUTTON": "X_버튼", - "Y_BUTTON": "Y_버튼", - "START_BUTTON": "시작 버튼", - "SELECT_BUTTON": "선택_버튼", - "L1_BUTTON": "L1_버튼", - "R1_BUTTON": "R1_버튼", - "L2_BUTTON": "L2_버튼", - "R2_BUTTON": "R2_버튼", - "LEFT_THUMB_BUTTON": "LEFT_THUMB_BUTTON", - "RIGHT_THUMB_BUTTON": "RIGHT_THUMB_BUTTON", - "DPAD_UP": "DPAD_UP", - "DPAD_DOWN": "DPAD_DOWN", - "DPAD_LEFT": "DPAD_LEFT", - "DPAD_RIGHT": "DPAD_RIGHT" -} \ No newline at end of file diff --git a/data/localization/ko.json b/data/localization/ko.json new file mode 100644 index 00000000..a3546fbc --- /dev/null +++ b/data/localization/ko.json @@ -0,0 +1,372 @@ +{ + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "8", + "9": "9", + "Restart": "재시작", + "Pause": "일시정지", + "Play": "플레이", + "Save State": "상태 저장하기", + "Load State": "상태 불러오기", + "Control Settings": "컨트롤 설정", + "Cheats": "치트", + "Cache Manager": "캐시 관리자", + "Export Save File": "세이브 파일 내보내기", + "Import Save File": "세이브 파일 가져오기", + "Netplay": "넷플레이", + "Mute": "무음", + "Unmute": "음소거 해제", + "Settings": "설정", + "Enter Fullscreen": "전체화면 전환", + "Exit Fullscreen": "전체화면 종료", + "Context Menu": "컨텍스트 메뉴", + "Reset": "초기화", + "Clear": "지우기", + "Close": "닫기", + "QUICK SAVE STATE": "빠른 상태 저장하기", + "QUICK LOAD STATE": "빠른 상태 불러오기", + "CHANGE STATE SLOT": "상태 슬롯 변경하기", + "FAST FORWARD": "빨리 감기", + "Player": "플레이어", + "Connected Gamepad": "연결된 게임패드", + "Gamepad": "게임패드", + "Keyboard": "키보드", + "Set": "세트", + "Add Cheat": "치트 추가하기", + "Note that some cheats require a restart to disable": "일부 치트는 다시 시작해야 비활성화할 수 있습니다.", + "Create a Room": "방 만들기", + "Rooms": "방", + "Start Game": "게임 시작하기", + "Click to resume Emulator": "에뮬레이터를 다시 시작하려면 클릭하세요.", + "Drop save state here to load": "저장 상태를 여기에 놓으면 로드됩니다.", + "Loading...": "로딩 중...", + "Download Game Core": "게임 코어 다운로드", + "Outdated graphics driver": "오래된 그래픽 드라이버", + "Decompress Game Core": "게임 코어 압축 해제", + "Download Game Data": "게임 데이터 다운로드", + "Decompress Game Data": "게임 데이터 압축 해제", + "Shaders": "셰이더", + "Disabled": "비활성화됨", + "2xScaleHQ": "2xScaleHQ", + "4xScaleHQ": "4xScaleHQ", + "CRT easymode": "CRT 이지모드", + "CRT aperture": "CRT 조리개", + "CRT geom": "CRT 검", + "CRT mattias": "CRT 마티아스", + "FPS": "FPS", + "show": "보기", + "hide": "숨기기", + "Fast Forward Ratio": "빨리 감기 비율", + "Fast Forward": "빨리 감기", + "Enabled": "활성화됨", + "Save State Slot": "상태 저장 슬롯", + "Save State Location": "상태 저장 위치", + "Download": "다운로드", + "Keep in Browser": "브라우저에 보관하기", + "Auto": "자동", + "NTSC": "NTSC", + "PAL": "PAL", + "Dendy": "덴디", + "8:7 PAR": "8:7 PAR", + "4:3": "4:3", + "Low": "낮음", + "High": "높음", + "Very High": "매우 높음", + "None": "없음", + "Player 1": "플레이어 1", + "Player 2": "플레이어 2", + "Both": "둘 다", + "SAVED STATE TO SLOT": "슬롯에 상태가 저장되었습니다.", + "LOADED STATE FROM SLOT": "슬롯에서 상태를 불러왔습니다.", + "SET SAVE STATE SLOT TO": "저장 상태 슬롯을 다음으로 설정", + "Network Error": "네트워크 오류", + "Submit": "전송", + "Description": "설명", + "Code": "코드", + "Add Cheat Code": "치트 코드 추가", + "Leave Room": "방 나가기", + "Password": "비밀번호", + "Password (optional)": "비밀번호 (선택사항)", + "Max Players": "최대 플레이어 수", + "Room Name": "방 이름", + "Join": "들어가기", + "Player Name": "플레이어 이름", + "Set Player Name": "플레이어 이름 설정", + "Left Handed Mode": "왼손 모드", + "Virtual Gamepad": "가상 게임패드", + "Disk": "디스크", + "Press Keyboard": "키보드를 누르세요.", + "INSERT COIN": "동전을 넣으세요.", + "Remove": "제거", + "SAVE LOADED FROM BROWSER": "브라우저에서 세이브를 불러왔습니다.", + "SAVE SAVED TO BROWSER": "브라우저에 세이브가 저장되었습니다.", + "Join the discord": "디스코드에 참가하기", + "View on GitHub": "GitHub에서 보기", + "Failed to start game": "게임을 시작하지 못했습니다.", + "Download Game BIOS": "게임 BIOS 다운로드", + "Decompress Game BIOS": "게임 BIOS 압축 해제", + "Download Game Parent": "게임 부모 다운로드", + "Decompress Game Parent": "게임 부모 압축 해제", + "Download Game Patch": "게임 패치 다운로드", + "Decompress Game Patch": "게임 패치 압축 해제", + "Download Game State": "게임 상태 다운로드", + "Check console": "콘솔 확인", + "Error for site owner": "사이트 소유자 오류", + "EmulatorJS": "EmulatorJS", + "Clear All": "모두 지우기", + "Take Screenshot": "스크린 샷 찍기", + "Start screen recording": "화면 녹화 시작", + "Stop screen recording": "화면 녹화 정지", + "Quick Save": "빠른 저장하기", + "Quick Load": "빠른 불러오기", + "REWIND": "되감기", + "Rewind Enabled (requires restart)": "되감기 활성화됨 (재시작 필요함)", + "Rewind Granularity": "되감기 세분화", + "Slow Motion Ratio": "슬로우 모션 비율", + "Slow Motion": "슬로우 모션", + "Home": "홈", + "EmulatorJS License": "EmulatorJS 라이센스", + "RetroArch License": "RetroArch 라이센스", + "This project is powered by": "이 프로젝트는 다음의 지원으로 운영됩니다.", + "View the RetroArch license here": "RetroArch 라이센스 보기", + "SLOW MOTION": "슬로우 모션", + "A": "A", + "B": "B", + "SELECT": "선택", + "START": "시작", + "UP": "위", + "DOWN": "아래", + "LEFT": "왼쪽", + "RIGHT": "오른쪽", + "X": "X", + "Y": "Y", + "L": "L", + "R": "R", + "Z": "Z", + "STICK UP": "스틱 위", + "STICK DOWN": "스틱 아래", + "STICK LEFT": "스틱 왼쪽", + "STICK RIGHT": "스틱 오른쪽", + "C-PAD UP": "C 패드 위", + "C-PAD DOWN": "C-패드 아래", + "C-PAD LEFT": "C-패드 왼쪽", + "C-PAD RIGHT": "C-패드 오른쪽", + "MICROPHONE": "마이크", + "BUTTON 1 / START": "버튼 1 / 시작", + "BUTTON 2": "버튼 2", + "BUTTON": "단추", + "LEFT D-PAD UP": "왼쪽 방향 패드 위", + "LEFT D-PAD DOWN": "왼쪽 방향 패드 아래", + "LEFT D-PAD LEFT": "왼쪽 방향 패드 왼쪽", + "LEFT D-PAD RIGHT": "왼쪽 방향 패드 오른쪽", + "RIGHT D-PAD UP": "오른쪽 방향 패드 위", + "RIGHT D-PAD DOWN": "오른쪽 방향 패드 아래", + "RIGHT D-PAD LEFT": "오른쪽 방향 패드 왼쪽", + "RIGHT D-PAD RIGHT": "오른쪽 방향 패드 오른쪽", + "C": "C", + "MODE": "모드", + "FIRE": "발사", + "RESET": "초기화", + "LEFT DIFFICULTY A": "왼쪽 난이도 A", + "LEFT DIFFICULTY B": "왼쪽 난이도 B", + "RIGHT DIFFICULTY A": "오른쪽 난이도 A", + "RIGHT DIFFICULTY B": "오른쪽 난이도 B", + "COLOR": "색상", + "B/W": "흑백", + "PAUSE": "일시정지", + "OPTION": "옵션", + "OPTION 1": "옵션 1", + "OPTION 2": "옵션 2", + "L2": "L2", + "R2": "R2", + "L3": "L3", + "R3": "R3", + "L STICK UP": "L 스틱 위", + "L STICK DOWN": "L 스틱 아래", + "L STICK LEFT": "왼쪽 스틱", + "L STICK RIGHT": "L 스틱 오른쪽", + "R STICK UP": "R 스틱 위", + "R STICK DOWN": "R 스틱 아래", + "R STICK LEFT": "R 스틱 왼쪽", + "R STICK RIGHT": "R 스틱 오른쪽", + "Start": "시작", + "Select": "선택", + "Fast": "빠름", + "Slow": "느림", + "a": "a", + "b": "b", + "c": "c", + "d": "d", + "e": "e", + "f": "f", + "g": "g", + "h": "h", + "i": "i", + "j": "j", + "k": "k", + "l": "l", + "m": "m", + "n": "n", + "o": "o", + "p": "p", + "q": "q", + "r": "r", + "s": "s", + "t": "t", + "u": "u", + "v": "v", + "w": "w", + "x": "x", + "y": "y", + "z": "z", + "enter": "엔터", + "escape": "ESC", + "space": "스페이스 바", + "tab": "탭", + "backspace": "백 스페이스", + "delete": "DEL", + "arrowup": "화살표 위", + "arrowdown": "화살표 아래", + "arrowleft": "화살표 왼쪽", + "arrowright": "화살표 오른쪽", + "f1": "f1", + "f2": "f2", + "f3": "f3", + "f4": "f4", + "f5": "f5", + "f6": "f6", + "f7": "f7", + "f8": "f8", + "f9": "f9", + "f10": "f10", + "f11": "f11", + "f12": "f12", + "shift": "쉬프트", + "control": "컨트롤", + "alt": "알트", + "meta": "메타", + "capslock": "캡스락", + "insert": "Insert", + "home": "HOME", + "end": "END", + "pageup": "페이지 업", + "pagedown": "페이지 다운", + "!": "!", + "@": "@", + "#": "#", + "$": "$", + "%": "%", + "^": "^^", + "&": "&", + "*": "*", + "(": "(", + ")": ")", + "-": "-", + "_": "_", + "+": "+", + "=": "=", + "[": "[", + "]": "]", + "{": "{", + "}": "}", + ";": ";", + ":": ":", + "'": "'", + "\"": "\"", + ",": ",", + ".": ".", + "<": "<", + ">": ">", + "/": "/", + "?": "?", + "LEFT_STICK_X": "왼쪽_스틱_X", + "LEFT_STICK_Y": "왼쪽_스틱_Y", + "RIGHT_STICK_X": "오른쪽_스틱_X", + "RIGHT_STICK_Y": "오른쪽_스틱_Y", + "LEFT_TRIGGER": "왼쪽_트리거", + "RIGHT_TRIGGER": "오른쪽_트리거", + "A_BUTTON": "A_버튼", + "B_BUTTON": "B_버튼", + "X_BUTTON": "X_버튼", + "Y_BUTTON": "Y_버튼", + "START_BUTTON": "시작_버튼", + "SELECT_BUTTON": "선택_버튼", + "L1_BUTTON": "L1_버튼", + "R1_BUTTON": "R1_버튼", + "L2_BUTTON": "L2_버튼", + "R2_BUTTON": "R2_버튼", + "LEFT_THUMB_BUTTON": "왼쪽_엄지_버튼", + "RIGHT_THUMB_BUTTON": "오른쪽_엄지_버튼", + "DPAD_UP": "DPAD_위", + "DPAD_DOWN": "DPAD_아래", + "DPAD_LEFT": "DPAD_왼쪽", + "DPAD_RIGHT": "DPAD_오른쪽", + "Disks": "디스크", + "Exit EmulatorJS": "EmulatorJS 끝내기", + "BUTTON_1": "버튼_1", + "BUTTON_2": "버튼_2", + "BUTTON_3": "버튼_3", + "BUTTON_4": "버튼_4", + "up arrow": "화살표 키 위", + "down arrow": "화살표 키 아래", + "left arrow": "화살표 키 왼쪽", + "right arrow": "화살표 키 오른쪽", + "LEFT_TOP_SHOULDER": "왼쪽 상단 숄더", + "RIGHT_TOP_SHOULDER": "오른쪽 상단 숄더", + "CRT beam": "CRT 빔", + "CRT caligari": "CRT 칼리가리", + "CRT lottes": "CRT 로테스", + "CRT yeetron": "CRT 이트론", + "CRT zfast": "CRT 지패스트", + "SABR": "SABR", + "Bicubic": "쌍입방(Bicubic)", + "Mix frames": "프레임 혼합", + "WebGL2": "WebGL2", + "Requires restart": "재시작 필요함", + "VSync": "수직동기화", + "Video Rotation": "화면 회전", + "System Save interval": "시스템 세이브 간격", + "Menu Bar Button": "메뉴바 버튼", + "visible": "보이기", + "hidden": "숨기기", + "Exit Emulation": "에뮬레이터 종료", + "LEFT_BOTTOM_SHOULDER": "왼쪽 하단 숄더", + "RIGHT_BOTTOM_SHOULDER": "오른쪽 하단 숄더", + "LEFT_STICK": "왼쪽 스틱", + "RIGHT_STICK": "오른쪽 스틱", + "-1": "-1", + "+1": "+1", + "Mode": "모드", + "": "", + "Core (재시작 필요함)": "코어 (재시작 필요함)", + "Rewind Enabled (재시작 필요함)": "되감기 활성화 (재시작 필요함)", + "Menubar Mouse Trigger": "메뉴바 마우스 활성화", + "Downward Movement": "아래쪽 이동", + "Movement Anywhere": "전체 영역 이동", + "Direct Keyboard Input": "키보드 직접 입력", + "Forward Alt key": "Alt 키 전달", + "Lock Mouse": "마우스 잠금", + "Are you sure you want to exit?": "정말로 종료하시겠습니까?", + "Exit": "종료", + "Cancel": "취소", + "EmulatorJS has exited": "에뮬레이터가 종료되었습니다.", + "Start Screen Recording": "화면 녹화 시작", + "Stop Screen Recording": "화면 녹화 중지", + "Screenshot Source": "스크린샷 소스", + "Screenshot Format": "스크린샷 형식", + "Screenshot Upscale": "스크린샷 업스케일", + "Screen Recording FPS": "화면 녹화 프레임율", + "Screen Recording Format": "화면 녹화 형식", + "Screen Recording Upscale": "화면 녹화 업스케일", + "Screen Recording Video Bitrate": "화면 녹화 비디오 비트레이트", + "Screen Recording Audio Bitrate": "화면 녹화 오디오 비트레이트", + "customDownload": "상태 파일 다운로드", + "customUpload": "상태 파일 업로드", + "customScreenshot": "스크린 샷 찍기" +} diff --git a/data/localization/pt-BR.json b/data/localization/pt.json similarity index 100% rename from data/localization/pt-BR.json rename to data/localization/pt.json diff --git a/data/localization/readme.md b/data/localization/readme.md deleted file mode 100644 index 5a9babc7..00000000 --- a/data/localization/readme.md +++ /dev/null @@ -1,57 +0,0 @@ -# Localization - -Supported languages - -`en-US` - English US
-`pt-BR` - Portuguese
-`es-ES` - Spanish
-`el-GR` - Greek
-`ja-JA` - Japanese
-`zh-CN` - Chinese
-`hi-HI` - Hindi
-`ar-AR` - Arabic
-`jv-JV` - Javanese
-`ben-BEN` - Bengali
-`ru-RU` - Russian
-`de-GER` - German
-`ko-KO` - Korean
-`af-FR` - French
-`it-IT` - Italian
-`tr-Tr` - Turkish
-`fa-AF` - Persian
- -default: `en-US` - -add the line to your code to use - -``` -EJS_language = ''; //language -``` - -If the language file is not found or there was an error fetching the file, the emulator will default to english. - -## Credits - -Translated for `es-ES` originally by [@cesarcristianodeoliveira](https://github.com/cesarcristianodeoliveira) and updated by [@angelmarfil](https://github.com/angelmarfil)
-Translated for `el-GR` by [@imneckro](https://github.com/imneckro)
-Translated for `ja-JA`, `hi-HI`, `ar-AR`, `jv-JV`, `ben-BEN`, `ru-RU`, `de-GER`, `ko-KO`, `af-FR` by [@allancoding](https://github.com/allancoding)
-Translated for `pt-BR` originally by [@allancoding](https://github.com/allancoding) and updated by [@zmarteline](https://github.com/zmarteline)
-Translated for `zh-CN` originally by [@allancoding](https://github.com/allancoding) and updated by [@eric183](https://github.com/eric183)
-Translated for `pt-BR` originally by [@allancoding](https://github.com/allancoding) and updated by [@zmarteline](https://github.com/zmarteline)
-Translated for `it-IT` by [@IvanMazzoli](https://github.com/IvanMazzoli)
-Translated for `tr-Tr` by [@iGoodie](https://github.com/iGoodie)
-Translated for `fa-AF` by [@rezamohdev](https://github.com/rezamohdev)
- -## Contributing - -Download the default `en.json` file and simply translate all the words that start with the `-` (remove the dash afterwards) then perform a pull request or open an issue with the file uploaded and I will add your work. - -The `retroarch.json` are all the setting names for the menu. They will default to english if not found. You can set `EJS_settingsLanguage` to `true` to see the missing retroarch settings names for the current language. You can translate them and add the to the language file. - -The control maping traslations for controllers are diffrent for each controller. They will need to be added to the language file if they are not in the default `en.json` file. - -You can also use the [Translation Helper](Translate.html) tool to help you translate the file. - -Please contribute!! - -Enything that is incorrect or needs to be fix please perform a pull request! diff --git a/data/localization/retroarch.json b/data/localization/retroarch.json index 4bd1f9b3..4ea0be5e 100644 --- a/data/localization/retroarch.json +++ b/data/localization/retroarch.json @@ -1,617 +1,617 @@ { - "fceumm region": "-fceumm region", - "fceumm sndquality": "-fceumm sndquality", - "fceumm aspect": "-fceumm aspect", - "fceumm overscan h left": "-fceumm overscan h left", - "fceumm overscan h right": "-fceumm overscan h right", - "fceumm overscan v top": "-fceumm overscan v top", - "fceumm overscan v bottom": "-fceumm overscan v bottom", - "fceumm turbo enable": "-fceumm turbo enable", - "fceumm turbo delay": "-fceumm turbo delay", - "fceumm zapper tolerance": "-fceumm zapper tolerance", - "fceumm mouse sensitivity": "-fceumm mouse sensitivity", - "50%": "-50%", - "60%": "-60%", - "70%": "-70%", - "80%": "-80%", - "90%": "-90%", - "100%": "-100%", - "150%": "-150%", - "200%": "-200%", - "250%": "-250%", - "300%": "-300%", - "350%": "-350%", - "400%": "-400%", - "450%": "-450%", - "500%": "-500%", - "snes9x overclock superfx": "-snes9x overclock superfx", - "snes9x superscope crosshair": "-snes9x superscope crosshair", - "White": "-White", - "White (blend)": "-White (blend)", - "Red": "-Red", - "Red (blend)": "-Red (blend)", - "Orange": "-Orange", - "Orange (blend)": "-Orange (blend)", - "Yellow": "-Yellow", - "Yellow (blend)": "-Yellow (blend)", - "Green": "-Green", - "Green (blend)": "-Green (blend)", - "Cyan": "-Cyan", - "Cyan (blend)": "-Cyan (blend)", - "Sky": "-Sky", - "Sky (blend)": "-Sky (blend)", - "Blue": "-Blue", - "Blue (blend)": "-Blue (blend)", - "Violet": "-Violet", - "Violet (blend)": "-Violet (blend)", - "Pink": "-Pink", - "Pink (blend)": "-Pink (blend)", - "Purple": "-Purple", - "Purple (blend)": "-Purple (blend)", - "Black": "-Black", - "Black (blend)": "-Black (blend)", - "25% Grey": "-25% Grey", - "25% Grey (blend)": "-25% Grey (blend)", - "50% Grey": "-50% Grey", - "50% Grey (blend)": "-50% Grey (blend)", - "75% Grey": "-75% Grey", - "75% Grey (blend)": "-75% Grey (blend)", - "snes9x superscope color": "-snes9x superscope color", - "snes9x justifier1 crosshair": "-snes9x justifier1 crosshair", - "snes9x justifier1 color": "-snes9x justifier1 color", - "snes9x justifier2 crosshair": "-snes9x justifier2 crosshair", - "snes9x justifier2 color": "-snes9x justifier2 color", - "snes9x rifle crosshair": "-snes9x rifle crosshair", - "snes9x rifle color": "-snes9x rifle color", - "1.0x (12.50Mhz)": "-1.0x (12.50Mhz)", - "1.1x (13.75Mhz)": "-1.1x (13.75Mhz)", - "1.2x (15.00Mhz)": "-1.2x (15.00Mhz)", - "1.5x (18.75Mhz)": "-1.5x (18.75Mhz)", - "1.6x (20.00Mhz)": "-1.6x (20.00Mhz)", - "1.8x (22.50Mhz)": "-1.8x (22.50Mhz)", - "2.0x (25.00Mhz)": "-2.0x (25.00Mhz)", - "opera cpu overclock": "-opera cpu overclock", - "0RGB1555": "-0RGB1555", - "RGB565": "-RGB565", - "XRGB8888": "-XRGB8888", - "opera vdlp pixel format": "-opera vdlp pixel format", - "opera nvram version": "-opera nvram version", - "opera active devices": "-opera active devices", - "stella2014 stelladaptor analog sensitivity": "-stella2014 stelladaptor analog sensitivity", - "stella2014 stelladaptor analog center": "-stella2014 stelladaptor analog center", - "handy frameskip threshold": "-handy frameskip threshold", - "320x240": "-320x240", - "640x480": "-640x480", - "960x720": "-960x720", - "1280x960": "-1280x960", - "1440x1080": "-1440x1080", - "1600x1200": "-1600x1200", - "1920x1440": "-1920x1440", - "2240x1680": "-2240x1680", - "2560x1920": "-2560x1920", - "2880x2160": "-2880x2160", - "3200x2400": "-3200x2400", - "3520x2640": "-3520x2640", - "3840x2880": "-3840x2880", - "43screensize": "-43screensize", - "3point": "-3point", - "standard": "-standard", - "BilinearMode": "-BilinearMode", - "MultiSampling": "-MultiSampling", - "FXAA": "-FXAA", - "Software": "-Software", - "FromMem": "-FromMem", - "EnableCopyDepthToRDRAM": "-EnableCopyDepthToRDRAM", - "Stripped": "-Stripped", - "OnePiece": "-OnePiece", - "BackgroundMode": "-BackgroundMode", - "OverscanTop": "-OverscanTop", - "OverscanLeft": "-OverscanLeft", - "OverscanRight": "-OverscanRight", - "OverscanBottom": "-OverscanBottom", - "MaxHiResTxVramLimit": "-MaxHiResTxVramLimit", - "MaxTxCacheSize": "-MaxTxCacheSize", - "Smooth filtering 1": "-Smooth filtering 1", - "Smooth filtering 2": "-Smooth filtering 2", - "Smooth filtering 3": "-Smooth filtering 3", - "Smooth filtering 4": "-Smooth filtering 4", - "Sharp filtering 1": "-Sharp filtering 1", - "Sharp filtering 2": "-Sharp filtering 2", - "txFilterMode": "-txFilterMode", - "As Is": "-As Is", - "X2": "-X2", - "X2SAI": "-X2SAI", - "HQ2X": "-HQ2X", - "HQ2XS": "-HQ2XS", - "LQ2X": "-LQ2X", - "LQ2XS": "-LQ2XS", - "HQ4X": "-HQ4X", - "2xBRZ": "-2xBRZ", - "3xBRZ": "-3xBRZ", - "4xBRZ": "-4xBRZ", - "5xBRZ": "-5xBRZ", - "6xBRZ": "-6xBRZ", - "txEnhancementMode": "-txEnhancementMode", - "Original": "-Original", - "Fullspeed": "-Fullspeed", - "Framerate": "-Framerate", - "virefresh": "-virefresh", - "CountPerOp": "-CountPerOp", - "CountPerOpDenomPot": "-CountPerOpDenomPot", - "deadzone": "-deadzone", - "sensitivity": "-sensitivity", - "C1": "-C1", - "C2": "-C2", - "C3": "-C3", - "C4": "-C4", - "cbutton": "-cbutton", - "none": "-none", - "memory": "-memory", - "rumble": "-rumble", - "transfer": "-transfer", - "pak1": "-pak1", - "pak2": "-pak2", - "pak3": "-pak3", - "pak4": "-pak4", - "Autodetect": "-Autodetect", - "Game Boy": "-Game Boy", - "Super Game Boy": "-Super Game Boy", - "Game Boy Color": "-Game Boy Color", - "Game Boy Advance": "-Game Boy Advance", - "mgba gb model": "-mgba gb model", - "ON": "-ON", - "OFF": "-OFF", - "mgba use bios": "-mgba use bios", - "mgba skip bios": "-mgba skip bios", - "Grayscale": "-Grayscale", - "DMG Green": "-DMG Green", - "GB Pocket": "-GB Pocket", - "GB Light": "-GB Light", - "GBC Brown ↑": "-GBC Brown ↑", - "GBC Red ↑A": "-GBC Red ↑A", - "GBC Dark Brown ↑B": "-GBC Dark Brown ↑B", - "GBC Pale Yellow ↓": "-GBC Pale Yellow ↓", - "GBC Orange ↓A": "-GBC Orange ↓A", - "GBC Yellow ↓B": "-GBC Yellow ↓B", - "GBC Blue ←": "-GBC Blue ←", - "GBC Dark Blue ←A": "-GBC Dark Blue ←A", - "GBC Gray ←B": "-GBC Gray ←B", - "GBC Green →": "-GBC Green →", - "GBC Dark Green →A": "-GBC Dark Green →A", - "GBC Reverse →B": "-GBC Reverse →B", - "SGB 1-A": "-SGB 1-A", - "SGB 1-B": "-SGB 1-B", - "SGB 1-C": "-SGB 1-C", - "SGB 1-D": "-SGB 1-D", - "SGB 1-E": "-SGB 1-E", - "SGB 1-F": "-SGB 1-F", - "SGB 1-G": "-SGB 1-G", - "SGB 1-H": "-SGB 1-H", - "SGB 2-A": "-SGB 2-A", - "SGB 2-B": "-SGB 2-B", - "SGB 2-C": "-SGB 2-C", - "SGB 2-D": "-SGB 2-D", - "SGB 2-E": "-SGB 2-E", - "SGB 2-F": "-SGB 2-F", - "SGB 2-G": "-SGB 2-G", - "SGB 2-H": "-SGB 2-H", - "SGB 3-A": "-SGB 3-A", - "SGB 3-B": "-SGB 3-B", - "SGB 3-C": "-SGB 3-C", - "SGB 3-D": "-SGB 3-D", - "SGB 3-E": "-SGB 3-E", - "SGB 3-F": "-SGB 3-F", - "SGB 3-G": "-SGB 3-G", - "SGB 3-H": "-SGB 3-H", - "SGB 4-A": "-SGB 4-A", - "SGB 4-B": "-SGB 4-B", - "SGB 4-C": "-SGB 4-C", - "SGB 4-D": "-SGB 4-D", - "SGB 4-E": "-SGB 4-E", - "SGB 4-F": "-SGB 4-F", - "SGB 4-G": "-SGB 4-G", - "SGB 4-H": "-SGB 4-H", - "mgba gb colors": "-mgba gb colors", - "mgba sgb borders": "-mgba sgb borders", - "mgba color correction": "-mgba color correction", - "mgba solar sensor level": "-mgba solar sensor level", - "mgba force gbp": "-mgba force gbp", - "Remove Known": "-Remove Known", - "Detect and Remove": "-Detect and Remove", - "Don't Remove": "-Don't Remove", - "mgba idle optimization": "-mgba idle optimization", - "mgba frameskip threshold": "-mgba frameskip threshold", - "mgba frameskip interval": "-mgba frameskip interval", - "GB - DMG": "-GB - DMG", - "GB - Pocket": "-GB - Pocket", - "GB - Light": "-GB - Light", - "GBC - Blue": "-GBC - Blue", - "GBC - Brown": "-GBC - Brown", - "GBC - Dark Blue": "-GBC - Dark Blue", - "GBC - Dark Brown": "-GBC - Dark Brown", - "GBC - Dark Green": "-GBC - Dark Green", - "GBC - Grayscale": "-GBC - Grayscale", - "GBC - Green": "-GBC - Green", - "GBC - Inverted": "-GBC - Inverted", - "GBC - Orange": "-GBC - Orange", - "GBC - Pastel Mix": "-GBC - Pastel Mix", - "GBC - Red": "-GBC - Red", - "GBC - Yellow": "-GBC - Yellow", - "SGB - 1A": "-SGB - 1A", - "SGB - 1B": "-SGB - 1B", - "SGB - 1C": "-SGB - 1C", - "SGB - 1D": "-SGB - 1D", - "SGB - 1E": "-SGB - 1E", - "SGB - 1F": "-SGB - 1F", - "SGB - 1G": "-SGB - 1G", - "SGB - 1H": "-SGB - 1H", - "SGB - 2A": "-SGB - 2A", - "SGB - 2B": "-SGB - 2B", - "SGB - 2C": "-SGB - 2C", - "SGB - 2D": "-SGB - 2D", - "SGB - 2E": "-SGB - 2E", - "SGB - 2F": "-SGB - 2F", - "SGB - 2G": "-SGB - 2G", - "SGB - 2H": "-SGB - 2H", - "SGB - 3A": "-SGB - 3A", - "SGB - 3B": "-SGB - 3B", - "SGB - 3C": "-SGB - 3C", - "SGB - 3D": "-SGB - 3D", - "SGB - 3E": "-SGB - 3E", - "SGB - 3F": "-SGB - 3F", - "SGB - 3G": "-SGB - 3G", - "SGB - 3H": "-SGB - 3H", - "SGB - 4A": "-SGB - 4A", - "SGB - 4B": "-SGB - 4B", - "SGB - 4C": "-SGB - 4C", - "SGB - 4D": "-SGB - 4D", - "SGB - 4E": "-SGB - 4E", - "SGB - 4F": "-SGB - 4F", - "SGB - 4G": "-SGB - 4G", - "SGB - 4H": "-SGB - 4H", - "Special 1": "-Special 1", - "Special 2": "-Special 2", - "Special 3": "-Special 3", - "Special 4 (TI-83 Legacy)": "-Special 4 (TI-83 Legacy)", - "TWB64 - Pack 1": "-TWB64 - Pack 1", - "TWB64 - Pack 2": "-TWB64 - Pack 2", - "PixelShift - Pack 1": "-PixelShift - Pack 1", - "gambatte gb internal palette": "-gambatte gb internal palette", - "TWB64 001 - Aqours Blue": "-TWB64 001 - Aqours Blue", - "TWB64 002 - Anime Expo Ver.": "-TWB64 002 - Anime Expo Ver.", - "TWB64 003 - SpongeBob Yellow": "-TWB64 003 - SpongeBob Yellow", - "TWB64 004 - Patrick Star Pink": "-TWB64 004 - Patrick Star Pink", - "TWB64 005 - Neon Red": "-TWB64 005 - Neon Red", - "TWB64 006 - Neon Blue": "-TWB64 006 - Neon Blue", - "TWB64 007 - Neon Yellow": "-TWB64 007 - Neon Yellow", - "TWB64 008 - Neon Green": "-TWB64 008 - Neon Green", - "TWB64 009 - Neon Pink": "-TWB64 009 - Neon Pink", - "TWB64 010 - Mario Red": "-TWB64 010 - Mario Red", - "TWB64 011 - Nick Orange": "-TWB64 011 - Nick Orange", - "TWB64 012 - Virtual Boy Ver.": "-TWB64 012 - Virtual Boy Ver.", - "TWB64 013 - Golden Wild": "-TWB64 013 - Golden Wild", - "TWB64 014 - Builder Yellow": "-TWB64 014 - Builder Yellow", - "TWB64 015 - Classic Blurple": "-TWB64 015 - Classic Blurple", - "TWB64 016 - 765 Production Ver.": "-TWB64 016 - 765 Production Ver.", - "TWB64 017 - Superball Ivory": "-TWB64 017 - Superball Ivory", - "TWB64 018 - Crunchyroll Orange": "-TWB64 018 - Crunchyroll Orange", - "TWB64 019 - Muse Pink": "-TWB64 019 - Muse Pink", - "TWB64 020 - Nijigasaki Yellow": "-TWB64 020 - Nijigasaki Yellow", - "TWB64 021 - Gamate Ver.": "-TWB64 021 - Gamate Ver.", - "TWB64 022 - Greenscale Ver.": "-TWB64 022 - Greenscale Ver.", - "TWB64 023 - Odyssey Gold": "-TWB64 023 - Odyssey Gold", - "TWB64 024 - Super Saiyan God": "-TWB64 024 - Super Saiyan God", - "TWB64 025 - Super Saiyan Blue": "-TWB64 025 - Super Saiyan Blue", - "TWB64 026 - Bizarre Pink": "-TWB64 026 - Bizarre Pink", - "TWB64 027 - Nintendo Switch Lite Ver.": "-TWB64 027 - Nintendo Switch Lite Ver.", - "TWB64 028 - Game.com Ver.": "-TWB64 028 - Game.com Ver.", - "TWB64 029 - Sanrio Pink": "-TWB64 029 - Sanrio Pink", - "TWB64 030 - BANDAI NAMCO Ver.": "-TWB64 030 - BANDAI NAMCO Ver.", - "TWB64 031 - Cosmo Green": "-TWB64 031 - Cosmo Green", - "TWB64 032 - Wanda Pink": "-TWB64 032 - Wanda Pink", - "TWB64 033 - Link's Awakening DX Ver.": "-TWB64 033 - Link's Awakening DX Ver.", - "TWB64 034 - Travel Wood": "-TWB64 034 - Travel Wood", - "TWB64 035 - Pokemon Ver.": "-TWB64 035 - Pokemon Ver.", - "TWB64 036 - Game Grump Orange": "-TWB64 036 - Game Grump Orange", - "TWB64 037 - Scooby-Doo Mystery Ver.": "-TWB64 037 - Scooby-Doo Mystery Ver.", - "TWB64 038 - Pokemon mini Ver.": "-TWB64 038 - Pokemon mini Ver.", - "TWB64 039 - Supervision Ver.": "-TWB64 039 - Supervision Ver.", - "TWB64 040 - DMG Ver.": "-TWB64 040 - DMG Ver.", - "TWB64 041 - Pocket Ver.": "-TWB64 041 - Pocket Ver.", - "TWB64 042 - Light Ver.": "-TWB64 042 - Light Ver.", - "TWB64 043 - Miraitowa Blue": "-TWB64 043 - Miraitowa Blue", - "TWB64 044 - Someity Pink": "-TWB64 044 - Someity Pink", - "TWB64 045 - Pikachu Yellow": "-TWB64 045 - Pikachu Yellow", - "TWB64 046 - Eevee Brown": "-TWB64 046 - Eevee Brown", - "TWB64 047 - Microvision Ver.": "-TWB64 047 - Microvision Ver.", - "TWB64 048 - TI-83 Ver.": "-TWB64 048 - TI-83 Ver.", - "TWB64 049 - Aegis Cherry": "-TWB64 049 - Aegis Cherry", - "TWB64 050 - Labo Fawn": "-TWB64 050 - Labo Fawn", - "TWB64 051 - MILLION LIVE GOLD!": "-TWB64 051 - MILLION LIVE GOLD!", - "TWB64 052 - Tokyo Midtown Ver.": "-TWB64 052 - Tokyo Midtown Ver.", - "TWB64 053 - VMU Ver.": "-TWB64 053 - VMU Ver.", - "TWB64 054 - Game Master Ver.": "-TWB64 054 - Game Master Ver.", - "TWB64 055 - Android Green": "-TWB64 055 - Android Green", - "TWB64 056 - Ticketmaster Azure": "-TWB64 056 - Ticketmaster Azure", - "TWB64 057 - Google Red": "-TWB64 057 - Google Red", - "TWB64 058 - Google Blue": "-TWB64 058 - Google Blue", - "TWB64 059 - Google Yellow": "-TWB64 059 - Google Yellow", - "TWB64 060 - Google Green": "-TWB64 060 - Google Green", - "TWB64 061 - WonderSwan Ver.": "-TWB64 061 - WonderSwan Ver.", - "TWB64 062 - Neo Geo Pocket Ver.": "-TWB64 062 - Neo Geo Pocket Ver.", - "TWB64 063 - Dew Green": "-TWB64 063 - Dew Green", - "TWB64 064 - Coca-Cola Red": "-TWB64 064 - Coca-Cola Red", - "TWB64 065 - GameKing Ver.": "-TWB64 065 - GameKing Ver.", - "TWB64 066 - Do The Dew Ver.": "-TWB64 066 - Do The Dew Ver.", - "TWB64 067 - Digivice Ver.": "-TWB64 067 - Digivice Ver.", - "TWB64 068 - Bikini Bottom Ver.": "-TWB64 068 - Bikini Bottom Ver.", - "TWB64 069 - Blossom Pink": "-TWB64 069 - Blossom Pink", - "TWB64 070 - Bubbles Blue": "-TWB64 070 - Bubbles Blue", - "TWB64 071 - Buttercup Green": "-TWB64 071 - Buttercup Green", - "TWB64 072 - NASCAR Ver.": "-TWB64 072 - NASCAR Ver.", - "TWB64 073 - Lemon-Lime Green": "-TWB64 073 - Lemon-Lime Green", - "TWB64 074 - Mega Man V Ver.": "-TWB64 074 - Mega Man V Ver.", - "TWB64 075 - Tamagotchi Ver.": "-TWB64 075 - Tamagotchi Ver.", - "TWB64 076 - Phantom Red": "-TWB64 076 - Phantom Red", - "TWB64 077 - Halloween Ver.": "-TWB64 077 - Halloween Ver.", - "TWB64 078 - Christmas Ver.": "-TWB64 078 - Christmas Ver.", - "TWB64 079 - Cardcaptor Pink": "-TWB64 079 - Cardcaptor Pink", - "TWB64 080 - Pretty Guardian Gold": "-TWB64 080 - Pretty Guardian Gold", - "TWB64 081 - Camouflage Ver.": "-TWB64 081 - Camouflage Ver.", - "TWB64 082 - Legendary Super Saiyan": "-TWB64 082 - Legendary Super Saiyan", - "TWB64 083 - Super Saiyan Rose": "-TWB64 083 - Super Saiyan Rose", - "TWB64 084 - Super Saiyan": "-TWB64 084 - Super Saiyan", - "TWB64 085 - Perfected Ultra Instinct": "-TWB64 085 - Perfected Ultra Instinct", - "TWB64 086 - Saint Snow Red": "-TWB64 086 - Saint Snow Red", - "TWB64 087 - Yellow Banana": "-TWB64 087 - Yellow Banana", - "TWB64 088 - Green Banana": "-TWB64 088 - Green Banana", - "TWB64 089 - Super Saiyan 3": "-TWB64 089 - Super Saiyan 3", - "TWB64 090 - Super Saiyan Blue Evolved": "-TWB64 090 - Super Saiyan Blue Evolved", - "TWB64 091 - Pocket Tales Ver.": "-TWB64 091 - Pocket Tales Ver.", - "TWB64 092 - Investigation Yellow": "-TWB64 092 - Investigation Yellow", - "TWB64 093 - S.E.E.S. Blue": "-TWB64 093 - S.E.E.S. Blue", - "TWB64 094 - Game Awards Cyan": "-TWB64 094 - Game Awards Cyan", - "TWB64 095 - Hokage Orange": "-TWB64 095 - Hokage Orange", - "TWB64 096 - Straw Hat Red": "-TWB64 096 - Straw Hat Red", - "TWB64 097 - Sword Art Cyan": "-TWB64 097 - Sword Art Cyan", - "TWB64 098 - Deku Alpha Emerald": "-TWB64 098 - Deku Alpha Emerald", - "TWB64 099 - Blue Stripes Ver.": "-TWB64 099 - Blue Stripes Ver.", - "TWB64 100 - Stone Orange": "-TWB64 100 - Stone Orange", - "gambatte gb palette twb64 1": "-gambatte gb palette twb64 1", - "TWB64 101 - 765PRO Pink": "-TWB64 101 - 765PRO Pink", - "TWB64 102 - CINDERELLA Blue": "-TWB64 102 - CINDERELLA Blue", - "TWB64 103 - MILLION Yellow!": "-TWB64 103 - MILLION Yellow!", - "TWB64 104 - SideM Green": "-TWB64 104 - SideM Green", - "TWB64 105 - SHINY Sky Blue": "-TWB64 105 - SHINY Sky Blue", - "TWB64 106 - Angry Volcano Ver.": "-TWB64 106 - Angry Volcano Ver.", - "TWB64 107 - Yo-kai Pink": "-TWB64 107 - Yo-kai Pink", - "TWB64 108 - Yo-kai Green": "-TWB64 108 - Yo-kai Green", - "TWB64 109 - Yo-kai Blue": "-TWB64 109 - Yo-kai Blue", - "TWB64 110 - Yo-kai Purple": "-TWB64 110 - Yo-kai Purple", - "TWB64 111 - Aquatic Iro": "-TWB64 111 - Aquatic Iro", - "TWB64 112 - Tea Midori": "-TWB64 112 - Tea Midori", - "TWB64 113 - Sakura Pink": "-TWB64 113 - Sakura Pink", - "TWB64 114 - Wisteria Murasaki": "-TWB64 114 - Wisteria Murasaki", - "TWB64 115 - Oni Aka": "-TWB64 115 - Oni Aka", - "TWB64 116 - Golden Kiiro": "-TWB64 116 - Golden Kiiro", - "TWB64 117 - Silver Shiro": "-TWB64 117 - Silver Shiro", - "TWB64 118 - Fruity Orange": "-TWB64 118 - Fruity Orange", - "TWB64 119 - AKB48 Pink": "-TWB64 119 - AKB48 Pink", - "TWB64 120 - Miku Blue": "-TWB64 120 - Miku Blue", - "TWB64 121 - Fairy Tail Red": "-TWB64 121 - Fairy Tail Red", - "TWB64 122 - Survey Corps Brown": "-TWB64 122 - Survey Corps Brown", - "TWB64 123 - Island Green": "-TWB64 123 - Island Green", - "TWB64 124 - Mania Plus Green": "-TWB64 124 - Mania Plus Green", - "TWB64 125 - Ninja Turtle Green": "-TWB64 125 - Ninja Turtle Green", - "TWB64 126 - Slime Blue": "-TWB64 126 - Slime Blue", - "TWB64 127 - Lime Midori": "-TWB64 127 - Lime Midori", - "TWB64 128 - Ghostly Aoi": "-TWB64 128 - Ghostly Aoi", - "TWB64 129 - Retro Bogeda": "-TWB64 129 - Retro Bogeda", - "TWB64 130 - Royal Blue": "-TWB64 130 - Royal Blue", - "TWB64 131 - Neon Purple": "-TWB64 131 - Neon Purple", - "TWB64 132 - Neon Orange": "-TWB64 132 - Neon Orange", - "TWB64 133 - Moonlight Vision": "-TWB64 133 - Moonlight Vision", - "TWB64 134 - Tokyo Red": "-TWB64 134 - Tokyo Red", - "TWB64 135 - Paris Gold": "-TWB64 135 - Paris Gold", - "TWB64 136 - Beijing Blue": "-TWB64 136 - Beijing Blue", - "TWB64 137 - Pac-Man Yellow": "-TWB64 137 - Pac-Man Yellow", - "TWB64 138 - Irish Green": "-TWB64 138 - Irish Green", - "TWB64 139 - Kakarot Orange": "-TWB64 139 - Kakarot Orange", - "TWB64 140 - Dragon Ball Orange": "-TWB64 140 - Dragon Ball Orange", - "TWB64 141 - Christmas Gold": "-TWB64 141 - Christmas Gold", - "TWB64 142 - Pepsi-Cola Blue": "-TWB64 142 - Pepsi-Cola Blue", - "TWB64 143 - Bubblun Green": "-TWB64 143 - Bubblun Green", - "TWB64 144 - Bobblun Blue": "-TWB64 144 - Bobblun Blue", - "TWB64 145 - Baja Blast Storm": "-TWB64 145 - Baja Blast Storm", - "TWB64 146 - Olympic Gold": "-TWB64 146 - Olympic Gold", - "TWB64 147 - Value Orange": "-TWB64 147 - Value Orange", - "TWB64 148 - Liella Purple!": "-TWB64 148 - Liella Purple!", - "TWB64 149 - Olympic Silver": "-TWB64 149 - Olympic Silver", - "TWB64 150 - Olympic Bronze": "-TWB64 150 - Olympic Bronze", - "TWB64 151 - ANA Sky Blue": "-TWB64 151 - ANA Sky Blue", - "TWB64 152 - Nijigasaki Orange": "-TWB64 152 - Nijigasaki Orange", - "TWB64 153 - HoloBlue": "-TWB64 153 - HoloBlue", - "TWB64 154 - Wrestling Red": "-TWB64 154 - Wrestling Red", - "TWB64 155 - Yoshi Egg Green": "-TWB64 155 - Yoshi Egg Green", - "TWB64 156 - Pokedex Red": "-TWB64 156 - Pokedex Red", - "TWB64 157 - Disney Dream Blue": "-TWB64 157 - Disney Dream Blue", - "TWB64 158 - Xbox Green": "-TWB64 158 - Xbox Green", - "TWB64 159 - Sonic Mega Blue": "-TWB64 159 - Sonic Mega Blue", - "TWB64 160 - G4 Orange": "-TWB64 160 - G4 Orange", - "TWB64 161 - Scarlett Green": "-TWB64 161 - Scarlett Green", - "TWB64 162 - Glitchy Blue": "-TWB64 162 - Glitchy Blue", - "TWB64 163 - Classic LCD": "-TWB64 163 - Classic LCD", - "TWB64 164 - 3DS Virtual Console Ver.": "-TWB64 164 - 3DS Virtual Console Ver.", - "TWB64 165 - PocketStation Ver.": "-TWB64 165 - PocketStation Ver.", - "TWB64 166 - Game and Gold": "-TWB64 166 - Game and Gold", - "TWB64 167 - Smurfy Blue": "-TWB64 167 - Smurfy Blue", - "TWB64 168 - Swampy Ogre Green": "-TWB64 168 - Swampy Ogre Green", - "TWB64 169 - Sailor Spinach Green": "-TWB64 169 - Sailor Spinach Green", - "TWB64 170 - Shenron Green": "-TWB64 170 - Shenron Green", - "TWB64 171 - Berserk Blood": "-TWB64 171 - Berserk Blood", - "TWB64 172 - Super Star Pink": "-TWB64 172 - Super Star Pink", - "TWB64 173 - Gamebuino Classic Ver.": "-TWB64 173 - Gamebuino Classic Ver.", - "TWB64 174 - Barbie Pink": "-TWB64 174 - Barbie Pink", - "TWB64 175 - Star Command Green": "-TWB64 175 - Star Command Green", - "TWB64 176 - Nokia 3310 Ver.": "-TWB64 176 - Nokia 3310 Ver.", - "TWB64 177 - Clover Green": "-TWB64 177 - Clover Green", - "TWB64 178 - Crash Orange": "-TWB64 178 - Crash Orange", - "TWB64 179 - Famicom Disk Yellow": "-TWB64 179 - Famicom Disk Yellow", - "TWB64 180 - Team Rocket Red": "-TWB64 180 - Team Rocket Red", - "TWB64 181 - SEIKO Timer Yellow": "-TWB64 181 - SEIKO Timer Yellow", - "TWB64 182 - PINK109": "-TWB64 182 - PINK109", - "TWB64 183 - Doraemon Blue": "-TWB64 183 - Doraemon Blue", - "TWB64 184 - Fury Blue": "-TWB64 184 - Fury Blue", - "TWB64 185 - Rockstar Orange": "-TWB64 185 - Rockstar Orange", - "TWB64 186 - Puyo Puyo Green": "-TWB64 186 - Puyo Puyo Green", - "TWB64 187 - Susan G. Pink": "-TWB64 187 - Susan G. Pink", - "TWB64 188 - Pizza Hut Red": "-TWB64 188 - Pizza Hut Red", - "TWB64 189 - Plumbob Green": "-TWB64 189 - Plumbob Green", - "TWB64 190 - Grand Ivory": "-TWB64 190 - Grand Ivory", - "TWB64 191 - Demon's Gold": "-TWB64 191 - Demon's Gold", - "TWB64 192 - SEGA Tokyo Blue": "-TWB64 192 - SEGA Tokyo Blue", - "TWB64 193 - Champion Blue": "-TWB64 193 - Champion Blue", - "TWB64 194 - DK Barrel Brown": "-TWB64 194 - DK Barrel Brown", - "TWB64 195 - Evangelion Green": "-TWB64 195 - Evangelion Green", - "TWB64 196 - Equestrian Purple": "-TWB64 196 - Equestrian Purple", - "TWB64 197 - Autobot Red": "-TWB64 197 - Autobot Red", - "TWB64 198 - Niconico Sea Green": "-TWB64 198 - Niconico Sea Green", - "TWB64 199 - Duracell Copper": "-TWB64 199 - Duracell Copper", - "TWB64 200 - TOKYO SKYTREE CLOUDY BLUE": "-TWB64 200 - TOKYO SKYTREE CLOUDY BLUE", - "gambatte gb palette twb64 2": "-gambatte gb palette twb64 2", - "PixelShift 01 - Arctic Green": "-PixelShift 01 - Arctic Green", - "PixelShift 02 - Arduboy": "-PixelShift 02 - Arduboy", - "PixelShift 03 - BGB 0.3 Emulator": "-PixelShift 03 - BGB 0.3 Emulator", - "PixelShift 04 - Camouflage": "-PixelShift 04 - Camouflage", - "PixelShift 05 - Chocolate Bar": "-PixelShift 05 - Chocolate Bar", - "PixelShift 06 - CMYK": "-PixelShift 06 - CMYK", - "PixelShift 07 - Cotton Candy": "-PixelShift 07 - Cotton Candy", - "PixelShift 08 - Easy Greens": "-PixelShift 08 - Easy Greens", - "PixelShift 09 - Gamate": "-PixelShift 09 - Gamate", - "PixelShift 10 - Game Boy Light": "-PixelShift 10 - Game Boy Light", - "PixelShift 11 - Game Boy Pocket": "-PixelShift 11 - Game Boy Pocket", - "PixelShift 12 - Game Boy Pocket Alt": "-PixelShift 12 - Game Boy Pocket Alt", - "PixelShift 13 - Game Pocket Computer": "-PixelShift 13 - Game Pocket Computer", - "PixelShift 14 - Game & Watch Ball": "-PixelShift 14 - Game & Watch Ball", - "PixelShift 15 - GB Backlight Blue": "-PixelShift 15 - GB Backlight Blue", - "PixelShift 16 - GB Backlight Faded": "-PixelShift 16 - GB Backlight Faded", - "PixelShift 17 - GB Backlight Orange": "-PixelShift 17 - GB Backlight Orange", - "PixelShift 18 - GB Backlight White ": "-PixelShift 18 - GB Backlight White ", - "PixelShift 19 - GB Backlight Yellow Dark": "-PixelShift 19 - GB Backlight Yellow Dark", - "PixelShift 20 - GB Bootleg": "-PixelShift 20 - GB Bootleg", - "PixelShift 21 - GB Hunter": "-PixelShift 21 - GB Hunter", - "PixelShift 22 - GB Kiosk": "-PixelShift 22 - GB Kiosk", - "PixelShift 23 - GB Kiosk 2": "-PixelShift 23 - GB Kiosk 2", - "PixelShift 24 - GB New": "-PixelShift 24 - GB New", - "PixelShift 25 - GB Nuked": "-PixelShift 25 - GB Nuked", - "PixelShift 26 - GB Old": "-PixelShift 26 - GB Old", - "PixelShift 27 - GBP Bivert": "-PixelShift 27 - GBP Bivert", - "PixelShift 28 - GB Washed Yellow Backlight": "-PixelShift 28 - GB Washed Yellow Backlight", - "PixelShift 29 - Ghost": "-PixelShift 29 - Ghost", - "PixelShift 30 - Glow In The Dark": "-PixelShift 30 - Glow In The Dark", - "PixelShift 31 - Gold Bar": "-PixelShift 31 - Gold Bar", - "PixelShift 32 - Grapefruit": "-PixelShift 32 - Grapefruit", - "PixelShift 33 - Gray Green Mix": "-PixelShift 33 - Gray Green Mix", - "PixelShift 34 - Missingno": "-PixelShift 34 - Missingno", - "PixelShift 35 - MS-Dos": "-PixelShift 35 - MS-Dos", - "PixelShift 36 - Newspaper": "-PixelShift 36 - Newspaper", - "PixelShift 37 - Pip-Boy": "-PixelShift 37 - Pip-Boy", - "PixelShift 38 - Pocket Girl": "-PixelShift 38 - Pocket Girl", - "PixelShift 39 - Silhouette": "-PixelShift 39 - Silhouette", - "PixelShift 40 - Sunburst": "-PixelShift 40 - Sunburst", - "PixelShift 41 - Technicolor": "-PixelShift 41 - Technicolor", - "PixelShift 42 - Tron": "-PixelShift 42 - Tron", - "PixelShift 43 - Vaporwave": "-PixelShift 43 - Vaporwave", - "PixelShift 44 - Virtual Boy": "-PixelShift 44 - Virtual Boy", - "PixelShift 45 - Wish": "-PixelShift 45 - Wish", - "gambatte gb palette pixelshift 1": "-gambatte gb palette pixelshift 1", - "gambatte dark filter level": "-gambatte dark filter level", - "GB": "-GB", - "GBC": "-GBC", - "GBA": "-GBA", - "gambatte gb hwmode": "-gambatte gb hwmode", - "gambatte turbo period": "-gambatte turbo period", - "gambatte rumble level": "-gambatte rumble level", - "pcsx rearmed psxclock": "-pcsx rearmed psxclock", - "pcsx rearmed frameskip threshold": "-pcsx rearmed frameskip threshold", - "pcsx rearmed frameskip interval": "-pcsx rearmed frameskip interval", - "pcsx rearmed input sensitivity": "-pcsx rearmed input sensitivity", - "pcsx rearmed gunconadjustx": "-pcsx rearmed gunconadjustx", - "pcsx rearmed gunconadjusty": "-pcsx rearmed gunconadjusty", - "pcsx rearmed gunconadjustratiox": "-pcsx rearmed gunconadjustratiox", - "pcsx rearmed gunconadjustratioy": "-pcsx rearmed gunconadjustratioy", - "Japan NTSC": "-Japan NTSC", - "Japan PAL": "-Japan PAL", - "US": "-US", - "Europe": "-Europe", - "picodrive region": "-picodrive region", - "Game Gear": "-Game Gear", - "Master System": "-Master System", - "SG-1000": "-SG-1000", - "SC-3000": "-SC-3000", - "picodrive smstype": "-picodrive smstype", - "Sega": "-Sega", - "Codemasters": "-Codemasters", - "Korea": "-Korea", - "Korea MSX": "-Korea MSX", - "Korea X-in-1": "-Korea X-in-1", - "Korea 4-Pak": "-Korea 4-Pak", - "Korea Janggun": "-Korea Janggun", - "Korea Nemesis": "-Korea Nemesis", - "Taiwan 8K RAM": "-Taiwan 8K RAM", - "picodrive smsmapper": "-picodrive smsmapper", - "PAR": "-PAR", - "CRT": "-CRT", - "picodrive aspect": "-picodrive aspect", - "native": "-native", - "picodrive sound rate": "-picodrive sound rate", - "picodrive lowpass range": "-picodrive lowpass range", - "picodrive frameskip threshold": "-picodrive frameskip threshold", - "genesis plus gx frameskip threshold": "-genesis plus gx frameskip threshold", - "genesis plus gx lowpass range": "-genesis plus gx lowpass range", - "genesis plus gx psg preamp": "-genesis plus gx psg preamp", - "genesis plus gx fm preamp": "-genesis plus gx fm preamp", - "genesis plus gx cdda volume": "-genesis plus gx cdda volume", - "genesis plus gx pcm volume": "-genesis plus gx pcm volume", - "genesis plus gx audio eq low": "-genesis plus gx audio eq low", - "genesis plus gx audio eq mid": "-genesis plus gx audio eq mid", - "genesis plus gx audio eq high": "-genesis plus gx audio eq high", - "genesis plus gx enhanced vscroll limit": "-genesis plus gx enhanced vscroll limit", - "genesis plus gx psg channel 0 volume": "-genesis plus gx psg channel 0 volume", - "genesis plus gx psg channel 1 volume": "-genesis plus gx psg channel 1 volume", - "genesis plus gx psg channel 2 volume": "-genesis plus gx psg channel 2 volume", - "genesis plus gx psg channel 3 volume": "-genesis plus gx psg channel 3 volume", - "genesis plus gx md channel 0 volume": "-genesis plus gx md channel 0 volume", - "genesis plus gx md channel 1 volume": "-genesis plus gx md channel 1 volume", - "genesis plus gx md channel 2 volume": "-genesis plus gx md channel 2 volume", - "genesis plus gx md channel 3 volume": "-genesis plus gx md channel 3 volume", - "genesis plus gx md channel 4 volume": "-genesis plus gx md channel 4 volume", - "genesis plus gx md channel 5 volume": "-genesis plus gx md channel 5 volume", - "genesis plus gx sms fm channel 0 volume": "-genesis plus gx sms fm channel 0 volume", - "genesis plus gx sms fm channel 1 volume": "-genesis plus gx sms fm channel 1 volume", - "genesis plus gx sms fm channel 2 volume": "-genesis plus gx sms fm channel 2 volume", - "genesis plus gx sms fm channel 3 volume": "-genesis plus gx sms fm channel 3 volume", - "genesis plus gx sms fm channel 4 volume": "-genesis plus gx sms fm channel 4 volume", - "genesis plus gx sms fm channel 5 volume": "-genesis plus gx sms fm channel 5 volume", - "genesis plus gx sms fm channel 6 volume": "-genesis plus gx sms fm channel 6 volume", - "genesis plus gx sms fm channel 7 volume": "-genesis plus gx sms fm channel 7 volume", - "genesis plus gx sms fm channel 8 volume": "-genesis plus gx sms fm channel 8 volume", - "anaglyph": "-anaglyph", - "cyberscope": "-cyberscope", - "side-by-side": "-side-by-side", - "vli": "-vli", - "hli": "-hli", - "vb 3dmode": "-vb 3dmode", - "black & red": "-black & red", - "black & white": "-black & white", - "black & blue": "-black & blue", - "black & cyan": "-black & cyan", - "black & electric cyan": "-black & electric cyan", - "black & green": "-black & green", - "black & magenta": "-black & magenta", - "black & yellow": "-black & yellow", - "vb color mode": "-vb color mode", - "accurate": "-accurate", - "fast": "-fast", - "vb cpu emulation": "-vb cpu emulation" -} \ No newline at end of file + "fceumm region": "fceumm region", + "fceumm sndquality": "fceumm sndquality", + "fceumm aspect": "fceumm aspect", + "fceumm overscan h left": "fceumm overscan h left", + "fceumm overscan h right": "fceumm overscan h right", + "fceumm overscan v top": "fceumm overscan v top", + "fceumm overscan v bottom": "fceumm overscan v bottom", + "fceumm turbo enable": "fceumm turbo enable", + "fceumm turbo delay": "fceumm turbo delay", + "fceumm zapper tolerance": "fceumm zapper tolerance", + "fceumm mouse sensitivity": "fceumm mouse sensitivity", + "50%": "50%", + "60%": "60%", + "70%": "70%", + "80%": "80%", + "90%": "90%", + "100%": "100%", + "150%": "150%", + "200%": "200%", + "250%": "250%", + "300%": "300%", + "350%": "350%", + "400%": "400%", + "450%": "450%", + "500%": "500%", + "snes9x overclock superfx": "snes9x overclock superfx", + "snes9x superscope crosshair": "snes9x superscope crosshair", + "White": "White", + "White (blend)": "White (blend)", + "Red": "Red", + "Red (blend)": "Red (blend)", + "Orange": "Orange", + "Orange (blend)": "Orange (blend)", + "Yellow": "Yellow", + "Yellow (blend)": "Yellow (blend)", + "Green": "Green", + "Green (blend)": "Green (blend)", + "Cyan": "Cyan", + "Cyan (blend)": "Cyan (blend)", + "Sky": "Sky", + "Sky (blend)": "Sky (blend)", + "Blue": "Blue", + "Blue (blend)": "Blue (blend)", + "Violet": "Violet", + "Violet (blend)": "Violet (blend)", + "Pink": "Pink", + "Pink (blend)": "Pink (blend)", + "Purple": "Purple", + "Purple (blend)": "Purple (blend)", + "Black": "Black", + "Black (blend)": "Black (blend)", + "25% Grey": "25% Grey", + "25% Grey (blend)": "25% Grey (blend)", + "50% Grey": "50% Grey", + "50% Grey (blend)": "50% Grey (blend)", + "75% Grey": "75% Grey", + "75% Grey (blend)": "75% Grey (blend)", + "snes9x superscope color": "snes9x superscope color", + "snes9x justifier1 crosshair": "snes9x justifier1 crosshair", + "snes9x justifier1 color": "snes9x justifier1 color", + "snes9x justifier2 crosshair": "snes9x justifier2 crosshair", + "snes9x justifier2 color": "snes9x justifier2 color", + "snes9x rifle crosshair": "snes9x rifle crosshair", + "snes9x rifle color": "snes9x rifle color", + "1.0x (12.50Mhz)": "1.0x (12.50Mhz)", + "1.1x (13.75Mhz)": "1.1x (13.75Mhz)", + "1.2x (15.00Mhz)": "1.2x (15.00Mhz)", + "1.5x (18.75Mhz)": "1.5x (18.75Mhz)", + "1.6x (20.00Mhz)": "1.6x (20.00Mhz)", + "1.8x (22.50Mhz)": "1.8x (22.50Mhz)", + "2.0x (25.00Mhz)": "2.0x (25.00Mhz)", + "opera cpu overclock": "opera cpu overclock", + "0RGB1555": "0RGB1555", + "RGB565": "RGB565", + "XRGB8888": "XRGB8888", + "opera vdlp pixel format": "opera vdlp pixel format", + "opera nvram version": "opera nvram version", + "opera active devices": "opera active devices", + "stella2014 stelladaptor analog sensitivity": "stella2014 stelladaptor analog sensitivity", + "stella2014 stelladaptor analog center": "stella2014 stelladaptor analog center", + "handy frameskip threshold": "handy frameskip threshold", + "320x240": "320x240", + "640x480": "640x480", + "960x720": "960x720", + "1280x960": "1280x960", + "1440x1080": "1440x1080", + "1600x1200": "1600x1200", + "1920x1440": "1920x1440", + "2240x1680": "2240x1680", + "2560x1920": "2560x1920", + "2880x2160": "2880x2160", + "3200x2400": "3200x2400", + "3520x2640": "3520x2640", + "3840x2880": "3840x2880", + "43screensize": "43screensize", + "3point": "3point", + "standard": "standard", + "BilinearMode": "BilinearMode", + "MultiSampling": "MultiSampling", + "FXAA": "FXAA", + "Software": "Software", + "FromMem": "FromMem", + "EnableCopyDepthToRDRAM": "EnableCopyDepthToRDRAM", + "Stripped": "Stripped", + "OnePiece": "OnePiece", + "BackgroundMode": "BackgroundMode", + "OverscanTop": "OverscanTop", + "OverscanLeft": "OverscanLeft", + "OverscanRight": "OverscanRight", + "OverscanBottom": "OverscanBottom", + "MaxHiResTxVramLimit": "MaxHiResTxVramLimit", + "MaxTxCacheSize": "MaxTxCacheSize", + "Smooth filtering 1": "Smooth filtering 1", + "Smooth filtering 2": "Smooth filtering 2", + "Smooth filtering 3": "Smooth filtering 3", + "Smooth filtering 4": "Smooth filtering 4", + "Sharp filtering 1": "Sharp filtering 1", + "Sharp filtering 2": "Sharp filtering 2", + "txFilterMode": "txFilterMode", + "As Is": "As Is", + "X2": "X2", + "X2SAI": "X2SAI", + "HQ2X": "HQ2X", + "HQ2XS": "HQ2XS", + "LQ2X": "LQ2X", + "LQ2XS": "LQ2XS", + "HQ4X": "HQ4X", + "2xBRZ": "2xBRZ", + "3xBRZ": "3xBRZ", + "4xBRZ": "4xBRZ", + "5xBRZ": "5xBRZ", + "6xBRZ": "6xBRZ", + "txEnhancementMode": "txEnhancementMode", + "Original": "Original", + "Fullspeed": "Fullspeed", + "Framerate": "Framerate", + "virefresh": "virefresh", + "CountPerOp": "CountPerOp", + "CountPerOpDenomPot": "CountPerOpDenomPot", + "deadzone": "deadzone", + "sensitivity": "sensitivity", + "C1": "C1", + "C2": "C2", + "C3": "C3", + "C4": "C4", + "cbutton": "cbutton", + "none": "none", + "memory": "memory", + "rumble": "rumble", + "transfer": "transfer", + "pak1": "pak1", + "pak2": "pak2", + "pak3": "pak3", + "pak4": "pak4", + "Autodetect": "Autodetect", + "Game Boy": "Game Boy", + "Super Game Boy": "Super Game Boy", + "Game Boy Color": "Game Boy Color", + "Game Boy Advance": "Game Boy Advance", + "mgba gb model": "mgba gb model", + "ON": "ON", + "OFF": "OFF", + "mgba use bios": "mgba use bios", + "mgba skip bios": "mgba skip bios", + "Grayscale": "Grayscale", + "DMG Green": "DMG Green", + "GB Pocket": "GB Pocket", + "GB Light": "GB Light", + "GBC Brown ↑": "GBC Brown ↑", + "GBC Red ↑A": "GBC Red ↑A", + "GBC Dark Brown ↑B": "GBC Dark Brown ↑B", + "GBC Pale Yellow ↓": "GBC Pale Yellow ↓", + "GBC Orange ↓A": "GBC Orange ↓A", + "GBC Yellow ↓B": "GBC Yellow ↓B", + "GBC Blue ←": "GBC Blue ←", + "GBC Dark Blue ←A": "GBC Dark Blue ←A", + "GBC Gray ←B": "GBC Gray ←B", + "GBC Green →": "GBC Green →", + "GBC Dark Green →A": "GBC Dark Green →A", + "GBC Reverse →B": "GBC Reverse →B", + "SGB 1-A": "SGB 1-A", + "SGB 1-B": "SGB 1-B", + "SGB 1-C": "SGB 1-C", + "SGB 1-D": "SGB 1-D", + "SGB 1-E": "SGB 1-E", + "SGB 1-F": "SGB 1-F", + "SGB 1-G": "SGB 1-G", + "SGB 1-H": "SGB 1-H", + "SGB 2-A": "SGB 2-A", + "SGB 2-B": "SGB 2-B", + "SGB 2-C": "SGB 2-C", + "SGB 2-D": "SGB 2-D", + "SGB 2-E": "SGB 2-E", + "SGB 2-F": "SGB 2-F", + "SGB 2-G": "SGB 2-G", + "SGB 2-H": "SGB 2-H", + "SGB 3-A": "SGB 3-A", + "SGB 3-B": "SGB 3-B", + "SGB 3-C": "SGB 3-C", + "SGB 3-D": "SGB 3-D", + "SGB 3-E": "SGB 3-E", + "SGB 3-F": "SGB 3-F", + "SGB 3-G": "SGB 3-G", + "SGB 3-H": "SGB 3-H", + "SGB 4-A": "SGB 4-A", + "SGB 4-B": "SGB 4-B", + "SGB 4-C": "SGB 4-C", + "SGB 4-D": "SGB 4-D", + "SGB 4-E": "SGB 4-E", + "SGB 4-F": "SGB 4-F", + "SGB 4-G": "SGB 4-G", + "SGB 4-H": "SGB 4-H", + "mgba gb colors": "mgba gb colors", + "mgba sgb borders": "mgba sgb borders", + "mgba color correction": "mgba color correction", + "mgba solar sensor level": "mgba solar sensor level", + "mgba force gbp": "mgba force gbp", + "Remove Known": "Remove Known", + "Detect and Remove": "Detect and Remove", + "Don't Remove": "Don't Remove", + "mgba idle optimization": "mgba idle optimization", + "mgba frameskip threshold": "mgba frameskip threshold", + "mgba frameskip interval": "mgba frameskip interval", + "GB - DMG": "GB - DMG", + "GB - Pocket": "GB - Pocket", + "GB - Light": "GB - Light", + "GBC - Blue": "GBC - Blue", + "GBC - Brown": "GBC - Brown", + "GBC - Dark Blue": "GBC - Dark Blue", + "GBC - Dark Brown": "GBC - Dark Brown", + "GBC - Dark Green": "GBC - Dark Green", + "GBC - Grayscale": "GBC - Grayscale", + "GBC - Green": "GBC - Green", + "GBC - Inverted": "GBC - Inverted", + "GBC - Orange": "GBC - Orange", + "GBC - Pastel Mix": "GBC - Pastel Mix", + "GBC - Red": "GBC - Red", + "GBC - Yellow": "GBC - Yellow", + "SGB - 1A": "SGB - 1A", + "SGB - 1B": "SGB - 1B", + "SGB - 1C": "SGB - 1C", + "SGB - 1D": "SGB - 1D", + "SGB - 1E": "SGB - 1E", + "SGB - 1F": "SGB - 1F", + "SGB - 1G": "SGB - 1G", + "SGB - 1H": "SGB - 1H", + "SGB - 2A": "SGB - 2A", + "SGB - 2B": "SGB - 2B", + "SGB - 2C": "SGB - 2C", + "SGB - 2D": "SGB - 2D", + "SGB - 2E": "SGB - 2E", + "SGB - 2F": "SGB - 2F", + "SGB - 2G": "SGB - 2G", + "SGB - 2H": "SGB - 2H", + "SGB - 3A": "SGB - 3A", + "SGB - 3B": "SGB - 3B", + "SGB - 3C": "SGB - 3C", + "SGB - 3D": "SGB - 3D", + "SGB - 3E": "SGB - 3E", + "SGB - 3F": "SGB - 3F", + "SGB - 3G": "SGB - 3G", + "SGB - 3H": "SGB - 3H", + "SGB - 4A": "SGB - 4A", + "SGB - 4B": "SGB - 4B", + "SGB - 4C": "SGB - 4C", + "SGB - 4D": "SGB - 4D", + "SGB - 4E": "SGB - 4E", + "SGB - 4F": "SGB - 4F", + "SGB - 4G": "SGB - 4G", + "SGB - 4H": "SGB - 4H", + "Special 1": "Special 1", + "Special 2": "Special 2", + "Special 3": "Special 3", + "Special 4 (TI-83 Legacy)": "Special 4 (TI-83 Legacy)", + "TWB64 - Pack 1": "TWB64 - Pack 1", + "TWB64 - Pack 2": "TWB64 - Pack 2", + "PixelShift - Pack 1": "PixelShift - Pack 1", + "gambatte gb internal palette": "gambatte gb internal palette", + "TWB64 001 - Aqours Blue": "TWB64 001 - Aqours Blue", + "TWB64 002 - Anime Expo Ver.": "TWB64 002 - Anime Expo Ver.", + "TWB64 003 - SpongeBob Yellow": "TWB64 003 - SpongeBob Yellow", + "TWB64 004 - Patrick Star Pink": "TWB64 004 - Patrick Star Pink", + "TWB64 005 - Neon Red": "TWB64 005 - Neon Red", + "TWB64 006 - Neon Blue": "TWB64 006 - Neon Blue", + "TWB64 007 - Neon Yellow": "TWB64 007 - Neon Yellow", + "TWB64 008 - Neon Green": "TWB64 008 - Neon Green", + "TWB64 009 - Neon Pink": "TWB64 009 - Neon Pink", + "TWB64 010 - Mario Red": "TWB64 010 - Mario Red", + "TWB64 011 - Nick Orange": "TWB64 011 - Nick Orange", + "TWB64 012 - Virtual Boy Ver.": "TWB64 012 - Virtual Boy Ver.", + "TWB64 013 - Golden Wild": "TWB64 013 - Golden Wild", + "TWB64 014 - Builder Yellow": "TWB64 014 - Builder Yellow", + "TWB64 015 - Classic Blurple": "TWB64 015 - Classic Blurple", + "TWB64 016 - 765 Production Ver.": "TWB64 016 - 765 Production Ver.", + "TWB64 017 - Superball Ivory": "TWB64 017 - Superball Ivory", + "TWB64 018 - Crunchyroll Orange": "TWB64 018 - Crunchyroll Orange", + "TWB64 019 - Muse Pink": "TWB64 019 - Muse Pink", + "TWB64 020 - Nijigasaki Yellow": "TWB64 020 - Nijigasaki Yellow", + "TWB64 021 - Gamate Ver.": "TWB64 021 - Gamate Ver.", + "TWB64 022 - Greenscale Ver.": "TWB64 022 - Greenscale Ver.", + "TWB64 023 - Odyssey Gold": "TWB64 023 - Odyssey Gold", + "TWB64 024 - Super Saiyan God": "TWB64 024 - Super Saiyan God", + "TWB64 025 - Super Saiyan Blue": "TWB64 025 - Super Saiyan Blue", + "TWB64 026 - Bizarre Pink": "TWB64 026 - Bizarre Pink", + "TWB64 027 - Nintendo Switch Lite Ver.": "TWB64 027 - Nintendo Switch Lite Ver.", + "TWB64 028 - Game.com Ver.": "TWB64 028 - Game.com Ver.", + "TWB64 029 - Sanrio Pink": "TWB64 029 - Sanrio Pink", + "TWB64 030 - BANDAI NAMCO Ver.": "TWB64 030 - BANDAI NAMCO Ver.", + "TWB64 031 - Cosmo Green": "TWB64 031 - Cosmo Green", + "TWB64 032 - Wanda Pink": "TWB64 032 - Wanda Pink", + "TWB64 033 - Link's Awakening DX Ver.": "TWB64 033 - Link's Awakening DX Ver.", + "TWB64 034 - Travel Wood": "TWB64 034 - Travel Wood", + "TWB64 035 - Pokemon Ver.": "TWB64 035 - Pokemon Ver.", + "TWB64 036 - Game Grump Orange": "TWB64 036 - Game Grump Orange", + "TWB64 037 - Scooby-Doo Mystery Ver.": "TWB64 037 - Scooby-Doo Mystery Ver.", + "TWB64 038 - Pokemon mini Ver.": "TWB64 038 - Pokemon mini Ver.", + "TWB64 039 - Supervision Ver.": "TWB64 039 - Supervision Ver.", + "TWB64 040 - DMG Ver.": "TWB64 040 - DMG Ver.", + "TWB64 041 - Pocket Ver.": "TWB64 041 - Pocket Ver.", + "TWB64 042 - Light Ver.": "TWB64 042 - Light Ver.", + "TWB64 043 - Miraitowa Blue": "TWB64 043 - Miraitowa Blue", + "TWB64 044 - Someity Pink": "TWB64 044 - Someity Pink", + "TWB64 045 - Pikachu Yellow": "TWB64 045 - Pikachu Yellow", + "TWB64 046 - Eevee Brown": "TWB64 046 - Eevee Brown", + "TWB64 047 - Microvision Ver.": "TWB64 047 - Microvision Ver.", + "TWB64 048 - TI-83 Ver.": "TWB64 048 - TI-83 Ver.", + "TWB64 049 - Aegis Cherry": "TWB64 049 - Aegis Cherry", + "TWB64 050 - Labo Fawn": "TWB64 050 - Labo Fawn", + "TWB64 051 - MILLION LIVE GOLD!": "TWB64 051 - MILLION LIVE GOLD!", + "TWB64 052 - Tokyo Midtown Ver.": "TWB64 052 - Tokyo Midtown Ver.", + "TWB64 053 - VMU Ver.": "TWB64 053 - VMU Ver.", + "TWB64 054 - Game Master Ver.": "TWB64 054 - Game Master Ver.", + "TWB64 055 - Android Green": "TWB64 055 - Android Green", + "TWB64 056 - Ticketmaster Azure": "TWB64 056 - Ticketmaster Azure", + "TWB64 057 - Google Red": "TWB64 057 - Google Red", + "TWB64 058 - Google Blue": "TWB64 058 - Google Blue", + "TWB64 059 - Google Yellow": "TWB64 059 - Google Yellow", + "TWB64 060 - Google Green": "TWB64 060 - Google Green", + "TWB64 061 - WonderSwan Ver.": "TWB64 061 - WonderSwan Ver.", + "TWB64 062 - Neo Geo Pocket Ver.": "TWB64 062 - Neo Geo Pocket Ver.", + "TWB64 063 - Dew Green": "TWB64 063 - Dew Green", + "TWB64 064 - Coca-Cola Red": "TWB64 064 - Coca-Cola Red", + "TWB64 065 - GameKing Ver.": "TWB64 065 - GameKing Ver.", + "TWB64 066 - Do The Dew Ver.": "TWB64 066 - Do The Dew Ver.", + "TWB64 067 - Digivice Ver.": "TWB64 067 - Digivice Ver.", + "TWB64 068 - Bikini Bottom Ver.": "TWB64 068 - Bikini Bottom Ver.", + "TWB64 069 - Blossom Pink": "TWB64 069 - Blossom Pink", + "TWB64 070 - Bubbles Blue": "TWB64 070 - Bubbles Blue", + "TWB64 071 - Buttercup Green": "TWB64 071 - Buttercup Green", + "TWB64 072 - NASCAR Ver.": "TWB64 072 - NASCAR Ver.", + "TWB64 073 - Lemon-Lime Green": "TWB64 073 - Lemon-Lime Green", + "TWB64 074 - Mega Man V Ver.": "TWB64 074 - Mega Man V Ver.", + "TWB64 075 - Tamagotchi Ver.": "TWB64 075 - Tamagotchi Ver.", + "TWB64 076 - Phantom Red": "TWB64 076 - Phantom Red", + "TWB64 077 - Halloween Ver.": "TWB64 077 - Halloween Ver.", + "TWB64 078 - Christmas Ver.": "TWB64 078 - Christmas Ver.", + "TWB64 079 - Cardcaptor Pink": "TWB64 079 - Cardcaptor Pink", + "TWB64 080 - Pretty Guardian Gold": "TWB64 080 - Pretty Guardian Gold", + "TWB64 081 - Camouflage Ver.": "TWB64 081 - Camouflage Ver.", + "TWB64 082 - Legendary Super Saiyan": "TWB64 082 - Legendary Super Saiyan", + "TWB64 083 - Super Saiyan Rose": "TWB64 083 - Super Saiyan Rose", + "TWB64 084 - Super Saiyan": "TWB64 084 - Super Saiyan", + "TWB64 085 - Perfected Ultra Instinct": "TWB64 085 - Perfected Ultra Instinct", + "TWB64 086 - Saint Snow Red": "TWB64 086 - Saint Snow Red", + "TWB64 087 - Yellow Banana": "TWB64 087 - Yellow Banana", + "TWB64 088 - Green Banana": "TWB64 088 - Green Banana", + "TWB64 089 - Super Saiyan 3": "TWB64 089 - Super Saiyan 3", + "TWB64 090 - Super Saiyan Blue Evolved": "TWB64 090 - Super Saiyan Blue Evolved", + "TWB64 091 - Pocket Tales Ver.": "TWB64 091 - Pocket Tales Ver.", + "TWB64 092 - Investigation Yellow": "TWB64 092 - Investigation Yellow", + "TWB64 093 - S.E.E.S. Blue": "TWB64 093 - S.E.E.S. Blue", + "TWB64 094 - Game Awards Cyan": "TWB64 094 - Game Awards Cyan", + "TWB64 095 - Hokage Orange": "TWB64 095 - Hokage Orange", + "TWB64 096 - Straw Hat Red": "TWB64 096 - Straw Hat Red", + "TWB64 097 - Sword Art Cyan": "TWB64 097 - Sword Art Cyan", + "TWB64 098 - Deku Alpha Emerald": "TWB64 098 - Deku Alpha Emerald", + "TWB64 099 - Blue Stripes Ver.": "TWB64 099 - Blue Stripes Ver.", + "TWB64 100 - Stone Orange": "TWB64 100 - Stone Orange", + "gambatte gb palette twb64 1": "gambatte gb palette twb64 1", + "TWB64 101 - 765PRO Pink": "TWB64 101 - 765PRO Pink", + "TWB64 102 - CINDERELLA Blue": "TWB64 102 - CINDERELLA Blue", + "TWB64 103 - MILLION Yellow!": "TWB64 103 - MILLION Yellow!", + "TWB64 104 - SideM Green": "TWB64 104 - SideM Green", + "TWB64 105 - SHINY Sky Blue": "TWB64 105 - SHINY Sky Blue", + "TWB64 106 - Angry Volcano Ver.": "TWB64 106 - Angry Volcano Ver.", + "TWB64 107 - Yo-kai Pink": "TWB64 107 - Yo-kai Pink", + "TWB64 108 - Yo-kai Green": "TWB64 108 - Yo-kai Green", + "TWB64 109 - Yo-kai Blue": "TWB64 109 - Yo-kai Blue", + "TWB64 110 - Yo-kai Purple": "TWB64 110 - Yo-kai Purple", + "TWB64 111 - Aquatic Iro": "TWB64 111 - Aquatic Iro", + "TWB64 112 - Tea Midori": "TWB64 112 - Tea Midori", + "TWB64 113 - Sakura Pink": "TWB64 113 - Sakura Pink", + "TWB64 114 - Wisteria Murasaki": "TWB64 114 - Wisteria Murasaki", + "TWB64 115 - Oni Aka": "TWB64 115 - Oni Aka", + "TWB64 116 - Golden Kiiro": "TWB64 116 - Golden Kiiro", + "TWB64 117 - Silver Shiro": "TWB64 117 - Silver Shiro", + "TWB64 118 - Fruity Orange": "TWB64 118 - Fruity Orange", + "TWB64 119 - AKB48 Pink": "TWB64 119 - AKB48 Pink", + "TWB64 120 - Miku Blue": "TWB64 120 - Miku Blue", + "TWB64 121 - Fairy Tail Red": "TWB64 121 - Fairy Tail Red", + "TWB64 122 - Survey Corps Brown": "TWB64 122 - Survey Corps Brown", + "TWB64 123 - Island Green": "TWB64 123 - Island Green", + "TWB64 124 - Mania Plus Green": "TWB64 124 - Mania Plus Green", + "TWB64 125 - Ninja Turtle Green": "TWB64 125 - Ninja Turtle Green", + "TWB64 126 - Slime Blue": "TWB64 126 - Slime Blue", + "TWB64 127 - Lime Midori": "TWB64 127 - Lime Midori", + "TWB64 128 - Ghostly Aoi": "TWB64 128 - Ghostly Aoi", + "TWB64 129 - Retro Bogeda": "TWB64 129 - Retro Bogeda", + "TWB64 130 - Royal Blue": "TWB64 130 - Royal Blue", + "TWB64 131 - Neon Purple": "TWB64 131 - Neon Purple", + "TWB64 132 - Neon Orange": "TWB64 132 - Neon Orange", + "TWB64 133 - Moonlight Vision": "TWB64 133 - Moonlight Vision", + "TWB64 134 - Tokyo Red": "TWB64 134 - Tokyo Red", + "TWB64 135 - Paris Gold": "TWB64 135 - Paris Gold", + "TWB64 136 - Beijing Blue": "TWB64 136 - Beijing Blue", + "TWB64 137 - Pac-Man Yellow": "TWB64 137 - Pac-Man Yellow", + "TWB64 138 - Irish Green": "TWB64 138 - Irish Green", + "TWB64 139 - Kakarot Orange": "TWB64 139 - Kakarot Orange", + "TWB64 140 - Dragon Ball Orange": "TWB64 140 - Dragon Ball Orange", + "TWB64 141 - Christmas Gold": "TWB64 141 - Christmas Gold", + "TWB64 142 - Pepsi-Cola Blue": "TWB64 142 - Pepsi-Cola Blue", + "TWB64 143 - Bubblun Green": "TWB64 143 - Bubblun Green", + "TWB64 144 - Bobblun Blue": "TWB64 144 - Bobblun Blue", + "TWB64 145 - Baja Blast Storm": "TWB64 145 - Baja Blast Storm", + "TWB64 146 - Olympic Gold": "TWB64 146 - Olympic Gold", + "TWB64 147 - Value Orange": "TWB64 147 - Value Orange", + "TWB64 148 - Liella Purple!": "TWB64 148 - Liella Purple!", + "TWB64 149 - Olympic Silver": "TWB64 149 - Olympic Silver", + "TWB64 150 - Olympic Bronze": "TWB64 150 - Olympic Bronze", + "TWB64 151 - ANA Sky Blue": "TWB64 151 - ANA Sky Blue", + "TWB64 152 - Nijigasaki Orange": "TWB64 152 - Nijigasaki Orange", + "TWB64 153 - HoloBlue": "TWB64 153 - HoloBlue", + "TWB64 154 - Wrestling Red": "TWB64 154 - Wrestling Red", + "TWB64 155 - Yoshi Egg Green": "TWB64 155 - Yoshi Egg Green", + "TWB64 156 - Pokedex Red": "TWB64 156 - Pokedex Red", + "TWB64 157 - Disney Dream Blue": "TWB64 157 - Disney Dream Blue", + "TWB64 158 - Xbox Green": "TWB64 158 - Xbox Green", + "TWB64 159 - Sonic Mega Blue": "TWB64 159 - Sonic Mega Blue", + "TWB64 160 - G4 Orange": "TWB64 160 - G4 Orange", + "TWB64 161 - Scarlett Green": "TWB64 161 - Scarlett Green", + "TWB64 162 - Glitchy Blue": "TWB64 162 - Glitchy Blue", + "TWB64 163 - Classic LCD": "TWB64 163 - Classic LCD", + "TWB64 164 - 3DS Virtual Console Ver.": "TWB64 164 - 3DS Virtual Console Ver.", + "TWB64 165 - PocketStation Ver.": "TWB64 165 - PocketStation Ver.", + "TWB64 166 - Game and Gold": "TWB64 166 - Game and Gold", + "TWB64 167 - Smurfy Blue": "TWB64 167 - Smurfy Blue", + "TWB64 168 - Swampy Ogre Green": "TWB64 168 - Swampy Ogre Green", + "TWB64 169 - Sailor Spinach Green": "TWB64 169 - Sailor Spinach Green", + "TWB64 170 - Shenron Green": "TWB64 170 - Shenron Green", + "TWB64 171 - Berserk Blood": "TWB64 171 - Berserk Blood", + "TWB64 172 - Super Star Pink": "TWB64 172 - Super Star Pink", + "TWB64 173 - Gamebuino Classic Ver.": "TWB64 173 - Gamebuino Classic Ver.", + "TWB64 174 - Barbie Pink": "TWB64 174 - Barbie Pink", + "TWB64 175 - Star Command Green": "TWB64 175 - Star Command Green", + "TWB64 176 - Nokia 3310 Ver.": "TWB64 176 - Nokia 3310 Ver.", + "TWB64 177 - Clover Green": "TWB64 177 - Clover Green", + "TWB64 178 - Crash Orange": "TWB64 178 - Crash Orange", + "TWB64 179 - Famicom Disk Yellow": "TWB64 179 - Famicom Disk Yellow", + "TWB64 180 - Team Rocket Red": "TWB64 180 - Team Rocket Red", + "TWB64 181 - SEIKO Timer Yellow": "TWB64 181 - SEIKO Timer Yellow", + "TWB64 182 - PINK109": "TWB64 182 - PINK109", + "TWB64 183 - Doraemon Blue": "TWB64 183 - Doraemon Blue", + "TWB64 184 - Fury Blue": "TWB64 184 - Fury Blue", + "TWB64 185 - Rockstar Orange": "TWB64 185 - Rockstar Orange", + "TWB64 186 - Puyo Puyo Green": "TWB64 186 - Puyo Puyo Green", + "TWB64 187 - Susan G. Pink": "TWB64 187 - Susan G. Pink", + "TWB64 188 - Pizza Hut Red": "TWB64 188 - Pizza Hut Red", + "TWB64 189 - Plumbob Green": "TWB64 189 - Plumbob Green", + "TWB64 190 - Grand Ivory": "TWB64 190 - Grand Ivory", + "TWB64 191 - Demon's Gold": "TWB64 191 - Demon's Gold", + "TWB64 192 - SEGA Tokyo Blue": "TWB64 192 - SEGA Tokyo Blue", + "TWB64 193 - Champion Blue": "TWB64 193 - Champion Blue", + "TWB64 194 - DK Barrel Brown": "TWB64 194 - DK Barrel Brown", + "TWB64 195 - Evangelion Green": "TWB64 195 - Evangelion Green", + "TWB64 196 - Equestrian Purple": "TWB64 196 - Equestrian Purple", + "TWB64 197 - Autobot Red": "TWB64 197 - Autobot Red", + "TWB64 198 - Niconico Sea Green": "TWB64 198 - Niconico Sea Green", + "TWB64 199 - Duracell Copper": "TWB64 199 - Duracell Copper", + "TWB64 200 - TOKYO SKYTREE CLOUDY BLUE": "TWB64 200 - TOKYO SKYTREE CLOUDY BLUE", + "gambatte gb palette twb64 2": "gambatte gb palette twb64 2", + "PixelShift 01 - Arctic Green": "PixelShift 01 - Arctic Green", + "PixelShift 02 - Arduboy": "PixelShift 02 - Arduboy", + "PixelShift 03 - BGB 0.3 Emulator": "PixelShift 03 - BGB 0.3 Emulator", + "PixelShift 04 - Camouflage": "PixelShift 04 - Camouflage", + "PixelShift 05 - Chocolate Bar": "PixelShift 05 - Chocolate Bar", + "PixelShift 06 - CMYK": "PixelShift 06 - CMYK", + "PixelShift 07 - Cotton Candy": "PixelShift 07 - Cotton Candy", + "PixelShift 08 - Easy Greens": "PixelShift 08 - Easy Greens", + "PixelShift 09 - Gamate": "PixelShift 09 - Gamate", + "PixelShift 10 - Game Boy Light": "PixelShift 10 - Game Boy Light", + "PixelShift 11 - Game Boy Pocket": "PixelShift 11 - Game Boy Pocket", + "PixelShift 12 - Game Boy Pocket Alt": "PixelShift 12 - Game Boy Pocket Alt", + "PixelShift 13 - Game Pocket Computer": "PixelShift 13 - Game Pocket Computer", + "PixelShift 14 - Game & Watch Ball": "PixelShift 14 - Game & Watch Ball", + "PixelShift 15 - GB Backlight Blue": "PixelShift 15 - GB Backlight Blue", + "PixelShift 16 - GB Backlight Faded": "PixelShift 16 - GB Backlight Faded", + "PixelShift 17 - GB Backlight Orange": "PixelShift 17 - GB Backlight Orange", + "PixelShift 18 - GB Backlight White ": "PixelShift 18 - GB Backlight White ", + "PixelShift 19 - GB Backlight Yellow Dark": "PixelShift 19 - GB Backlight Yellow Dark", + "PixelShift 20 - GB Bootleg": "PixelShift 20 - GB Bootleg", + "PixelShift 21 - GB Hunter": "PixelShift 21 - GB Hunter", + "PixelShift 22 - GB Kiosk": "PixelShift 22 - GB Kiosk", + "PixelShift 23 - GB Kiosk 2": "PixelShift 23 - GB Kiosk 2", + "PixelShift 24 - GB New": "PixelShift 24 - GB New", + "PixelShift 25 - GB Nuked": "PixelShift 25 - GB Nuked", + "PixelShift 26 - GB Old": "PixelShift 26 - GB Old", + "PixelShift 27 - GBP Bivert": "PixelShift 27 - GBP Bivert", + "PixelShift 28 - GB Washed Yellow Backlight": "PixelShift 28 - GB Washed Yellow Backlight", + "PixelShift 29 - Ghost": "PixelShift 29 - Ghost", + "PixelShift 30 - Glow In The Dark": "PixelShift 30 - Glow In The Dark", + "PixelShift 31 - Gold Bar": "PixelShift 31 - Gold Bar", + "PixelShift 32 - Grapefruit": "PixelShift 32 - Grapefruit", + "PixelShift 33 - Gray Green Mix": "PixelShift 33 - Gray Green Mix", + "PixelShift 34 - Missingno": "PixelShift 34 - Missingno", + "PixelShift 35 - MS-Dos": "PixelShift 35 - MS-Dos", + "PixelShift 36 - Newspaper": "PixelShift 36 - Newspaper", + "PixelShift 37 - Pip-Boy": "PixelShift 37 - Pip-Boy", + "PixelShift 38 - Pocket Girl": "PixelShift 38 - Pocket Girl", + "PixelShift 39 - Silhouette": "PixelShift 39 - Silhouette", + "PixelShift 40 - Sunburst": "PixelShift 40 - Sunburst", + "PixelShift 41 - Technicolor": "PixelShift 41 - Technicolor", + "PixelShift 42 - Tron": "PixelShift 42 - Tron", + "PixelShift 43 - Vaporwave": "PixelShift 43 - Vaporwave", + "PixelShift 44 - Virtual Boy": "PixelShift 44 - Virtual Boy", + "PixelShift 45 - Wish": "PixelShift 45 - Wish", + "gambatte gb palette pixelshift 1": "gambatte gb palette pixelshift 1", + "gambatte dark filter level": "gambatte dark filter level", + "GB": "GB", + "GBC": "GBC", + "GBA": "GBA", + "gambatte gb hwmode": "gambatte gb hwmode", + "gambatte turbo period": "gambatte turbo period", + "gambatte rumble level": "gambatte rumble level", + "pcsx rearmed psxclock": "pcsx rearmed psxclock", + "pcsx rearmed frameskip threshold": "pcsx rearmed frameskip threshold", + "pcsx rearmed frameskip interval": "pcsx rearmed frameskip interval", + "pcsx rearmed input sensitivity": "pcsx rearmed input sensitivity", + "pcsx rearmed gunconadjustx": "pcsx rearmed gunconadjustx", + "pcsx rearmed gunconadjusty": "pcsx rearmed gunconadjusty", + "pcsx rearmed gunconadjustratiox": "pcsx rearmed gunconadjustratiox", + "pcsx rearmed gunconadjustratioy": "pcsx rearmed gunconadjustratioy", + "Japan NTSC": "Japan NTSC", + "Japan PAL": "Japan PAL", + "US": "US", + "Europe": "Europe", + "picodrive region": "picodrive region", + "Game Gear": "Game Gear", + "Master System": "Master System", + "SG-1000": "SG-1000", + "SC-3000": "SC-3000", + "picodrive smstype": "picodrive smstype", + "Sega": "Sega", + "Codemasters": "Codemasters", + "Korea": "Korea", + "Korea MSX": "Korea MSX", + "Korea X-in-1": "Korea X-in-1", + "Korea 4-Pak": "Korea 4-Pak", + "Korea Janggun": "Korea Janggun", + "Korea Nemesis": "Korea Nemesis", + "Taiwan 8K RAM": "Taiwan 8K RAM", + "picodrive smsmapper": "picodrive smsmapper", + "PAR": "PAR", + "CRT": "CRT", + "picodrive aspect": "picodrive aspect", + "native": "native", + "picodrive sound rate": "picodrive sound rate", + "picodrive lowpass range": "picodrive lowpass range", + "picodrive frameskip threshold": "picodrive frameskip threshold", + "genesis plus gx frameskip threshold": "genesis plus gx frameskip threshold", + "genesis plus gx lowpass range": "genesis plus gx lowpass range", + "genesis plus gx psg preamp": "genesis plus gx psg preamp", + "genesis plus gx fm preamp": "genesis plus gx fm preamp", + "genesis plus gx cdda volume": "genesis plus gx cdda volume", + "genesis plus gx pcm volume": "genesis plus gx pcm volume", + "genesis plus gx audio eq low": "genesis plus gx audio eq low", + "genesis plus gx audio eq mid": "genesis plus gx audio eq mid", + "genesis plus gx audio eq high": "genesis plus gx audio eq high", + "genesis plus gx enhanced vscroll limit": "genesis plus gx enhanced vscroll limit", + "genesis plus gx psg channel 0 volume": "genesis plus gx psg channel 0 volume", + "genesis plus gx psg channel 1 volume": "genesis plus gx psg channel 1 volume", + "genesis plus gx psg channel 2 volume": "genesis plus gx psg channel 2 volume", + "genesis plus gx psg channel 3 volume": "genesis plus gx psg channel 3 volume", + "genesis plus gx md channel 0 volume": "genesis plus gx md channel 0 volume", + "genesis plus gx md channel 1 volume": "genesis plus gx md channel 1 volume", + "genesis plus gx md channel 2 volume": "genesis plus gx md channel 2 volume", + "genesis plus gx md channel 3 volume": "genesis plus gx md channel 3 volume", + "genesis plus gx md channel 4 volume": "genesis plus gx md channel 4 volume", + "genesis plus gx md channel 5 volume": "genesis plus gx md channel 5 volume", + "genesis plus gx sms fm channel 0 volume": "genesis plus gx sms fm channel 0 volume", + "genesis plus gx sms fm channel 1 volume": "genesis plus gx sms fm channel 1 volume", + "genesis plus gx sms fm channel 2 volume": "genesis plus gx sms fm channel 2 volume", + "genesis plus gx sms fm channel 3 volume": "genesis plus gx sms fm channel 3 volume", + "genesis plus gx sms fm channel 4 volume": "genesis plus gx sms fm channel 4 volume", + "genesis plus gx sms fm channel 5 volume": "genesis plus gx sms fm channel 5 volume", + "genesis plus gx sms fm channel 6 volume": "genesis plus gx sms fm channel 6 volume", + "genesis plus gx sms fm channel 7 volume": "genesis plus gx sms fm channel 7 volume", + "genesis plus gx sms fm channel 8 volume": "genesis plus gx sms fm channel 8 volume", + "anaglyph": "anaglyph", + "cyberscope": "cyberscope", + "side-by-side": "side-by-side", + "vli": "vli", + "hli": "hli", + "vb 3dmode": "vb 3dmode", + "black & red": "black & red", + "black & white": "black & white", + "black & blue": "black & blue", + "black & cyan": "black & cyan", + "black & electric cyan": "black & electric cyan", + "black & green": "black & green", + "black & magenta": "black & magenta", + "black & yellow": "black & yellow", + "vb color mode": "vb color mode", + "accurate": "accurate", + "fast": "fast", + "vb cpu emulation": "vb cpu emulation" +} diff --git a/data/localization/ro.json b/data/localization/ro.json new file mode 100644 index 00000000..5411dd2a --- /dev/null +++ b/data/localization/ro.json @@ -0,0 +1,310 @@ +{ + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "8", + "9": "9", + "Restart": "Repornire", + "Pause": "Pauză", + "Play": "Pornire", + "Save State": "Salvare Status", + "Load State": "Încărcare Status", + "Control Settings": "Setări Controale", + "Cheats": "Cheats", + "Cache Manager": "Manager Cache", + "Export Save File": "Exportează Fișierul Salvat", + "Import Save File": "Importează Fișierul Salvat", + "Netplay": "Netplay", + "Mute": "Mute", + "Unmute": "Unmute", + "Settings": "Setări", + "Enter Fullscreen": "Intrați în modul ecran complet", + "Exit Fullscreen": "Ieșire din modul ecran complet", + "Context Menu": "Meniu Context", + "Reset": "Resetare", + "Clear": "Ștergere", + "Close": "Ieșire", + "QUICK SAVE STATE": "QUICK SAVE STATE", + "QUICK LOAD STATE": "QUICK LOAD STATE", + "CHANGE STATE SLOT": "CHANGE STATE SLOT", + "FAST FORWARD": "FAST FORWARD", + "Player": "Player", + "Connected Gamepad": "Gamepad Conectat", + "Gamepad": "Gamepad", + "Keyboard": "Tastatură", + "Set": "Setare", + "Add Cheat": "Adaugă Cheat", + "Note that some cheats require a restart to disable": "Rețineți că unele cheat-uri necesită o repornire pentru a fi dezactivate", + "Create a Room": "Creați o cameră", + "Rooms": "Camere", + "Start Game": "Pornire Joc", + "Click to resume Emulator": "Click pentru a relua Emulatorul", + "Drop save state here to load": "Aruncați starea de salvare aici pentru a încărca", + "Loading...": "Încărcare...", + "Download Game Core": "Descărcați nucleul jocului", + "Outdated graphics driver": "Placă grafică învechită", + "Decompress Game Core": "Decompresați nucleul jocului", + "Download Game Data": "Descărcați datele jocului", + "Decompress Game Data": "Decompresați datele jocului", + "Shaders": "Shaders", + "Disabled": "Dezactivat", + "2xScaleHQ": "2xScaleHQ", + "4xScaleHQ": "4xScaleHQ", + "CRT easymode": "CRT easymode", + "CRT aperture": "CRT aperture", + "CRT geom": "CRT geom", + "CRT mattias": "CRT mattias", + "FPS": "FPS (cadre pe secundă)", + "show": "Afișare", + "hide": "Ascundere", + "Fast Forward Ratio": "Rată de Avans Rapid", + "Fast Forward": "Avansare Rapidă", + "Enabled": "Activat", + "Save State Slot": "Salvare Slotul pentru Stare", + "Save State Location": "Salvare Locație pentru Stare", + "Download": "Descărcați", + "Keep in Browser": "Păstrați în Browser", + "Auto": "Auto", + "NTSC": "NTSC", + "PAL": "PAL", + "Dendy": "Dendy", + "8:7 PAR": "8:7 PAR", + "4:3": "4:3", + "Low": "Scăzut", + "High": "Ridicat", + "Very High": "Foarte Ridicat", + "None": "Deloc", + "Player 1": "Player 1", + "Player 2": "Player 2", + "Both": "Ambele", + "SAVED STATE TO SLOT": "SAVED STATE TO SLOT", + "LOADED STATE FROM SLOT": "LOADED STATE FROM SLOT", + "SET SAVE STATE SLOT TO": "SET SAVE STATE SLOT TO", + "Network Error": "Eroare de Conectare", + "Submit": "Trimite", + "Description": "Descriere", + "Code": "Cod", + "Add Cheat Code": "Adaugă Cod Cheat", + "Leave Room": "Părăsește Camera", + "Password": "Parolă", + "Password (optional)": "Parolă (opțional)", + "Max Players": "Maximum Jucători", + "Room Name": "Numele Camerei", + "Join": "Alătură-te", + "Player Name": "Nume Jucător", + "Set Player Name": "Setează Numele Jucătorului", + "Left Handed Mode": "Modul Mâna Stângă", + "Virtual Gamepad": "Gamepad Virtual", + "Disk": "Disc", + "Press Keyboard": "Apasă Tastatură", + "INSERT COIN": "INSERT COIN", + "Remove": "Înlăturare", + "SAVE LOADED FROM BROWSER": "SAVE LOADED FROM BROWSER", + "SAVE SAVED TO BROWSER": "SAVE SAVED TO BROWSER", + "Join the discord": "Alăturăte pe Discord", + "View on GitHub": "Vezi în GitHub", + "Failed to start game": "Pornirea jocului a eșuat", + "Download Game BIOS": "Descărcați BIOS-ul Jocului", + "Decompress Game BIOS": "Decompresați BIOS-ul Jocului", + "Download Game Parent": "Descărcați Jocul părinte", + "Decompress Game Parent": "Decompresați Jocul părinte", + "Download Game Patch": "Descărcați Patch-ul pentru joc", + "Decompress Game Patch": "Decompresați Patch-ul jocului", + "Download Game State": "-Download Game State", + "Check console": "Verifcare consolă", + "Error for site owner": "Eroare pentru deținătorul site-ului", + "EmulatorJS": "EmulatorJS", + "Clear All": "Șterge tot", + "Take Screenshot": "Fă o captură de ecran", + "Start screen recording": "Pornește înregistrarea ecranului", + "Stop screen recording": "Oprește înregistrarea ecranului", + "Quick Save": "Salvare Rapidă", + "Quick Load": "Încărcare Rapidă", + "REWIND": "REWIND", + "Rewind Enabled (requires restart)": "Delurare Activată (necesită repornire)", + "Rewind Granularity": "Granularitatea de Derulare", + "Slow Motion Ratio": "Raport de Latență", + "Slow Motion": "Latență", + "Home": "Acasă", + "EmulatorJS License": "Licența EmulatorJS", + "RetroArch License": "Licența RetroArch", + "This project is powered by": "Proiectul este dezvoltat de către", + "View the RetroArch license here": "Vezi licența RetroArch aici", + "SLOW MOTION": "SLOW MOTION", + "A": "A", + "B": "B", + "SELECT": "SELECT", + "START": "START", + "UP": "UP", + "DOWN": "DOWN", + "LEFT": "LEFT", + "RIGHT": "RIGHT", + "X": "X", + "Y": "Y", + "L": "L", + "R": "R", + "Z": "Z", + "STICK UP": "STICK UP", + "STICK DOWN": "STICK DOWN", + "STICK LEFT": "STICK LEFT", + "STICK RIGHT": "STICK RIGHT", + "C-PAD UP": "C-PAD UP", + "C-PAD DOWN": "C-PAD DOWN", + "C-PAD LEFT": "C-PAD LEFT", + "C-PAD RIGHT": "C-PAD RIGHT", + "MICROPHONE": "MICROPHONE", + "BUTTON 1 / START": "BUTTON 1 / START", + "BUTTON 2": "BUTTON 2", + "BUTTON": "BUTTON", + "LEFT D-PAD UP": "LEFT D-PAD UP", + "LEFT D-PAD DOWN": "LEFT D-PAD DOWN", + "LEFT D-PAD LEFT": "LEFT D-PAD LEFT", + "LEFT D-PAD RIGHT": "LEFT D-PAD RIGHT", + "RIGHT D-PAD UP": "RIGHT D-PAD UP", + "RIGHT D-PAD DOWN": "RIGHT D-PAD DOWN", + "RIGHT D-PAD LEFT": "RIGHT D-PAD LEFT", + "RIGHT D-PAD RIGHT": "RIGHT D-PAD RIGHT", + "C": "C", + "MODE": "MODE", + "FIRE": "FIRE", + "RESET": "RESET", + "LEFT DIFFICULTY A": "LEFT DIFFICULTY A", + "LEFT DIFFICULTY B": "LEFT DIFFICULTY B", + "RIGHT DIFFICULTY A": "RIGHT DIFFICULTY A", + "RIGHT DIFFICULTY B": "RIGHT DIFFICULTY B", + "COLOR": "COLOR", + "B/W": "B/W", + "PAUSE": "PAUSE", + "OPTION": "OPTION", + "OPTION 1": "OPTION 1", + "OPTION 2": "OPTION 2", + "L2": "L2", + "R2": "R2", + "L3": "L3", + "R3": "R3", + "L STICK UP": "L STICK UP", + "L STICK DOWN": "L STICK DOWN", + "L STICK LEFT": "L STICK LEFT", + "L STICK RIGHT": "L STICK RIGHT", + "R STICK UP": "R STICK UP", + "R STICK DOWN": "R STICK DOWN", + "R STICK LEFT": "R STICK LEFT", + "R STICK RIGHT": "R STICK RIGHT", + "Start": "Pornire", + "Select": "Selectare", + "Fast": "Rapid", + "Slow": "Lent", + "a": "a", + "b": "b", + "c": "c", + "d": "d", + "e": "e", + "f": "f", + "g": "g", + "h": "h", + "i": "i", + "j": "j", + "k": "k", + "l": "l", + "m": "m", + "n": "n", + "o": "o", + "p": "p", + "q": "q", + "r": "r", + "s": "s", + "t": "t", + "u": "u", + "v": "v", + "w": "w", + "x": "x", + "y": "y", + "z": "z", + "enter": "enter", + "escape": "escape", + "space": "space", + "tab": "tab", + "backspace": "backspace", + "delete": "delete", + "arrowup": "arrowup", + "arrowdown": "arrowdown", + "arrowleft": "arrowleft", + "arrowright": "arrowright", + "f1": "f1", + "f2": "f2", + "f3": "f3", + "f4": "f4", + "f5": "f5", + "f6": "f6", + "f7": "f7", + "f8": "f8", + "f9": "f9", + "f10": "f10", + "f11": "f11", + "f12": "f12", + "shift": "shift", + "control": "control", + "alt": "alt", + "meta": "meta", + "capslock": "capslock", + "insert": "insert", + "home": "home", + "end": "end", + "pageup": "pageup", + "pagedown": "pagedown", + "!": "!", + "@": "@", + "#": "#", + "$": "$", + "%": "%", + "^": "^", + "&": "&", + "*": "*", + "(": "(", + ")": ")", + "-": "-", + "_": "_", + "+": "+", + "=": "=", + "[": "[", + "]": "]", + "{": "{", + "}": "}", + ";": ";", + ":": ":", + "'": "'", + "\"": "\"", + ",": ",", + ".": ".", + "<": "<", + ">": ">", + "/": "/", + "?": "?", + "LEFT_STICK_X": "LEFT_STICK_X", + "LEFT_STICK_Y": "LEFT_STICK_Y", + "RIGHT_STICK_X": "RIGHT_STICK_X", + "RIGHT_STICK_Y": "RIGHT_STICK_Y", + "LEFT_TRIGGER": "LEFT_TRIGGER", + "RIGHT_TRIGGER": "RIGHT_TRIGGER", + "A_BUTTON": "A_BUTTON", + "B_BUTTON": "B_BUTTON", + "X_BUTTON": "X_BUTTON", + "Y_BUTTON": "Y_BUTTON", + "START_BUTTON": "START_BUTTON", + "SELECT_BUTTON": "SELECT_BUTTON", + "L1_BUTTON": "L1_BUTTON", + "R1_BUTTON": "R1_BUTTON", + "L2_BUTTON": "L2_BUTTON", + "R2_BUTTON": "R2_BUTTON", + "LEFT_THUMB_BUTTON": "LEFT_THUMB_BUTTON", + "RIGHT_THUMB_BUTTON": "RIGHT_THUMB_BUTTON", + "DPAD_UP": "DPAD_UP", + "DPAD_DOWN": "DPAD_DOWN", + "DPAD_LEFT": "DPAD_LEFT", + "DPAD_RIGHT": "DPAD_RIGHT" +} diff --git a/data/localization/ru-RU.json b/data/localization/ru.json similarity index 99% rename from data/localization/ru-RU.json rename to data/localization/ru.json index 55a85f3b..be4d5fe3 100644 --- a/data/localization/ru-RU.json +++ b/data/localization/ru.json @@ -298,4 +298,4 @@ "DPAD_DOWN": "DPAD_ВНИЗ", "DPAD_LEFT": "DPAD_ВЛЕВО", "DPAD_RIGHT": "DPAD_СПРАВО" -} \ No newline at end of file +} diff --git a/data/localization/tr-TR.json b/data/localization/tr.json similarity index 98% rename from data/localization/tr-TR.json rename to data/localization/tr.json index 0a57f569..7948f578 100644 --- a/data/localization/tr-TR.json +++ b/data/localization/tr.json @@ -121,8 +121,8 @@ "EmulatorJS": "EmulatorJS", "Clear All": "Hepsini Temizle", "Take Screenshot": "Ekran Görüntüsü Al", - "Start screen recording": "Ekran kaydı başlat", - "Stop screen recording": "Ekran kaydını durdur", + "Start Screen Recording": "Ekran kaydı başlat", + "Stop Screen Recording": "Ekran kaydını durdur", "Quick Save": "Hızlı Kaydet", "Quick Load": "Hızlı Yükle", "REWIND": "GERİ SAR", diff --git a/data/localization/vi-VN.json b/data/localization/vi.json similarity index 100% rename from data/localization/vi-VN.json rename to data/localization/vi.json diff --git a/data/localization/zh-CN.json b/data/localization/zh.json similarity index 79% rename from data/localization/zh-CN.json rename to data/localization/zh.json index 3b220205..2c321732 100644 --- a/data/localization/zh-CN.json +++ b/data/localization/zh.json @@ -297,5 +297,55 @@ "DPAD_UP": "十字键向上", "DPAD_DOWN": "十字键向下", "DPAD_LEFT": "十字键向左", - "DPAD_RIGHT": "十字键向右" -} \ No newline at end of file + "DPAD_RIGHT": "十字键向右", + "BUTTON_1": "按钮1", + "BUTTON_2": "按钮2", + "up arrow": "方向上", + "down arrow": "方向下", + "left arrow": "方向左", + "right arrow": "方向右", + "Start Screen Recording": "开始屏幕录制", + "Stop Screen Recording": "停止屏幕录制", + "Context Menu": "菜单", + "Exit Emulation": "退出模拟器", + "System Save interval": "系统保存间隔", + "Are you sure you want to exit?": "您确定要退出吗?", + "Exit": "退出", + "Cancel": "取消", + "Note that some cheats require a restart to disable": "请注意,某些作弊码需要重新启动才能禁用", + "Drop save state here to load": "将状态保存文件拖放到此处以加载", + + "Disks": "Disks", + "SWAP DISKS": "SWAP DISKS", + "EJECT/INSERT DISK": "EJECT/INSERT DISK", + "LEFT_TOP_SHOULDER": "LEFT_TOP_SHOULDER", + "RIGHT_TOP_SHOULDER": "RIGHT_TOP_SHOULDER", + "Requires restart": "Requires restart", + "Core (Requires restart)": "Core (Requires restart)", + "CRT beam": "CRT beam", + "CRT caligari": "CRT caligari", + "CRT lottes": "CRT lottes", + "CRT yeetron": "CRT yeetron", + "CRT zfast": "CRT zfast", + "SABR": "SABR", + "Bicubic": "Bicubic", + "Mix frames": "Mix frames", + "WebGL2": "WebGL2", + "VSync": "VSync", + "Video Rotation": "Video Rotation", + "Screenshot Source": "Screenshot Source", + "Screenshot Format": "Screenshot Format", + "Screenshot Upscale": "Screenshot Upscale", + "Screen Recording FPS": "Screen Recording FPS", + "Screen Recording Format": "Screen Recording Format", + "Screen Recording Upscale": "Screen Recording Upscale", + "Screen Recording Video Bitrate": "Screen Recording Video Bitrate", + "Screen Recording Audio Bitrate": "Screen Recording Audio Bitrate", + "Rewind Enabled (Requires restart)": "Rewind Enabled (Requires restart)", + "Menubar Mouse Trigger": "Menubar Mouse Trigger", + "Downward Movement": "Downward Movement", + "Movement Anywhere": "Movement Anywhere", + "Direct Keyboard Input": "Direct Keyboard Input", + "Forward Alt key": "Forward Alt key", + "Lock Mouse": "Lock Mouse" +} diff --git a/data/minify/index.js b/data/minify/index.js deleted file mode 100644 index afd81f37..00000000 --- a/data/minify/index.js +++ /dev/null @@ -1,28 +0,0 @@ -const UglifyJS = require("uglify-js"); -const fs = require('fs'); -const uglifycss = require('uglifycss'); - -const scripts = [ - "emulator.js", - "nipplejs.js", - "shaders.js", - "storage.js", - "gamepad.js", - "GameManager.js", - "socket.io.min.js", - "compression.js" -]; -let code = "(function() {\n"; -for (let i=0; i {}); - + + this.writeFile("/home/web_user/.config/retroarch/retroarch.cfg", this.getRetroArchCfg()); + this.writeConfigFile(); this.initShaders(); + this.setupPreLoadSettings(); this.EJS.on("exit", () => { + if (!this.EJS.failedToStart) { + this.saveSaveFiles(); + this.functions.restart(); + this.saveSaveFiles(); + } this.toggleMainLoop(0); - this.functions.saveSaveFiles(); + this.FS.unmount("/data/saves"); setTimeout(() => { - try {window.abort()} catch(e){}; + try { + this.Module.abort(); + } catch(e) { + console.warn(e); + }; }, 1000); }) } + setupPreLoadSettings() { + this.Module.callbacks.setupCoreSettingFile = (filePath) => { + if (this.EJS.debug) console.log("Setting up core settings with path:", filePath); + this.writeFile(filePath, this.EJS.getCoreSettings()); + } + } + mountFileSystems() { + return new Promise(async resolve => { + this.mkdir("/data"); + this.mkdir("/data/saves"); + this.FS.mount(this.FS.filesystems.IDBFS, { autoPersist: true }, "/data/saves"); + this.FS.syncfs(true, resolve); + }); + } writeConfigFile() { if (!this.EJS.defaultCoreOpts.file || !this.EJS.defaultCoreOpts.settings) { return; } let output = ""; for (const k in this.EJS.defaultCoreOpts.settings) { - output += k + ' = "' + this.EJS.defaultCoreOpts.settings[k] +'"\n'; + output += k + ' = "' + this.EJS.defaultCoreOpts.settings[k] + '"\n'; } this.writeFile("/home/web_user/retroarch/userdata/config/" + this.EJS.defaultCoreOpts.file, output); } loadExternalFiles() { return new Promise(async (resolve, reject) => { - if (this.EJS.config.externalFiles && this.EJS.config.externalFiles.constructor.name === 'Object') { + if (this.EJS.config.externalFiles && this.EJS.config.externalFiles.constructor.name === "Object") { for (const key in this.EJS.config.externalFiles) { await new Promise(done => { - this.EJS.downloadFile(this.EJS.config.externalFiles[key], async (res) => { + this.EJS.downloadFile(this.EJS.config.externalFiles[key], null, true, { responseType: "arraybuffer", method: "GET" }).then(async (res) => { if (res === -1) { if (this.EJS.debug) console.warn("Failed to fetch file from '" + this.EJS.config.externalFiles[key] + "'. Make sure the file exists."); return done(); @@ -81,7 +103,7 @@ class EJS_GameManager { path += name; } else { for (const k in files) { - this.writeFile(path+k, files[k]); + this.writeFile(path + k, files[k]); } return done(); } @@ -92,7 +114,7 @@ class EJS_GameManager { if (this.EJS.debug) console.warn("Failed to write file to '" + path + "'. Make sure there are no conflicting files."); } done(); - }, null, true, {responseType: "arraybuffer", method: "GET"}); + }); }) } } @@ -102,7 +124,7 @@ class EJS_GameManager { writeFile(path, data) { const parts = path.split("/"); let current = "/"; - for (let i=0; i { + let selected = this.EJS.preGetSetting(option.name); + console.log(selected); + if (!selected) { + selected = option.default; + } + const value = option.isString === false ? selected : '"' + selected + '"'; + cfg += option.name + " = " + value + "\n" + }) + } + return cfg; } initShaders() { if (!this.EJS.config.shaders) return; this.mkdir("/shader"); for (const shaderFileName in this.EJS.config.shaders) { const shader = this.EJS.config.shaders[shaderFileName]; - if (typeof shader === 'string') { + if (typeof shader === "string") { this.FS.writeFile(`/shader/${shaderFileName}`, shader); } } @@ -151,23 +185,33 @@ class EJS_GameManager { this.functions.restart(); } getState() { - this.functions.saveStateInfo(); - return this.FS.readFile("/current.state"); + const state = this.functions.saveStateInfo().split("|"); + if (state[2] !== "1") { + console.error(state[0]); + throw new Error(state[0]); + } + const size = parseInt(state[0]); + const dataStart = parseInt(state[1]); + const data = this.Module.HEAPU8.subarray(dataStart, dataStart + size); + return new Uint8Array(data); } loadState(state) { try { - this.FS.unlink('game.state'); - } catch(e){} - this.FS.writeFile('/game.state', state); + this.FS.unlink("game.state"); + } catch(e) {} + this.FS.writeFile("/game.state", state); this.clearEJSResetTimer(); this.functions.loadState("game.state", 0); setTimeout(() => { try { - this.FS.unlink('game.state'); - } catch(e){} + this.FS.unlink("game.state"); + } catch(e) {} }, 5000) } screenshot() { + try { + this.FS.unlink("screenshot.png"); + } catch(e) {} this.functions.screenshot(); return new Promise(async resolve => { while (1) { @@ -175,26 +219,28 @@ class EJS_GameManager { this.FS.stat("/screenshot.png"); return resolve(this.FS.readFile("/screenshot.png")); } catch(e) {} - await new Promise(res => setTimeout(res, 50)); } }) } quickSave(slot) { if (!slot) slot = 1; - (async () => { - let name = slot + '-quick.state'; - try { - this.FS.unlink(name); - } catch (e) {} - let data = await this.getState(); - this.FS.writeFile('/'+name, data); - })(); + let name = slot + "-quick.state"; + try { + this.FS.unlink(name); + } catch(e) {} + try { + let data = this.getState(); + this.FS.writeFile("/" + name, data); + } catch(e) { + return false; + } + return true; } quickLoad(slot) { if (!slot) slot = 1; (async () => { - let name = slot + '-quick.state'; + let name = slot + "-quick.state"; this.clearEJSResetTimer(); this.functions.loadState(name, 0); })(); @@ -206,25 +252,28 @@ class EJS_GameManager { } if ([24, 25, 26, 27, 28, 29].includes(index)) { if (index === 24 && value === 1) { - const slot = this.EJS.settings['save-state-slot'] ? this.EJS.settings['save-state-slot'] : "1"; - this.quickSave(slot); - this.EJS.displayMessage(this.EJS.localization("SAVED STATE TO SLOT")+" "+slot); + const slot = this.EJS.settings["save-state-slot"] ? this.EJS.settings["save-state-slot"] : "1"; + if (this.quickSave(slot)) { + this.EJS.displayMessage(this.EJS.localization("SAVED STATE TO SLOT") + " " + slot); + } else { + this.EJS.displayMessage(this.EJS.localization("FAILED TO SAVE STATE")); + } } if (index === 25 && value === 1) { - const slot = this.EJS.settings['save-state-slot'] ? this.EJS.settings['save-state-slot'] : "1"; + const slot = this.EJS.settings["save-state-slot"] ? this.EJS.settings["save-state-slot"] : "1"; this.quickLoad(slot); - this.EJS.displayMessage(this.EJS.localization("LOADED STATE FROM SLOT")+" "+slot); + this.EJS.displayMessage(this.EJS.localization("LOADED STATE FROM SLOT") + " " + slot); } if (index === 26 && value === 1) { let newSlot; try { - newSlot = parseFloat(this.EJS.settings['save-state-slot'] ? this.EJS.settings['save-state-slot'] : "1") + 1; + newSlot = parseFloat(this.EJS.settings["save-state-slot"] ? this.EJS.settings["save-state-slot"] : "1") + 1; } catch(e) { newSlot = 1; } if (newSlot > 9) newSlot = 1; - this.EJS.displayMessage(this.EJS.localization("SET SAVE STATE SLOT TO")+" "+newSlot); - this.EJS.changeSettingOption('save-state-slot', newSlot.toString()); + this.EJS.displayMessage(this.EJS.localization("SET SAVE STATE SLOT TO") + " " + newSlot); + this.EJS.changeSettingOption("save-state-slot", newSlot.toString()); } if (index === 27) { this.functions.toggleFastForward(this.EJS.isFastForward ? !value : value); @@ -265,7 +314,7 @@ class EJS_GameManager { return null; } } - for (let i=0; i 1) { let contents = ""; - for (let i=0; i { - this.EJS.downloadFile('cores/ppsspp-assets.zip', (res) => { + this.EJS.downloadFile("cores/ppsspp-assets.zip", null, false, { responseType: "arraybuffer", method: "GET" }).then((res) => { this.EJS.checkCompression(new Uint8Array(res.data), this.EJS.localization("Decompress Game Data")).then((pspassets) => { if (pspassets === -1) { - this.EJS.textElem.innerText = this.localization('Network Error'); + this.EJS.textElem.innerText = this.localization("Network Error"); this.EJS.textElem.style.color = "red"; return; } this.mkdir("/PPSSPP"); - + for (const file in pspassets) { const data = pspassets[file]; - const path = "/PPSSPP/"+file; + const path = "/PPSSPP/" + file; const paths = path.split("/"); let cp = ""; - for (let i=0; i {}); } supportsStates() { return !!this.functions.supportsStates(); } - getSaveFile() { - this.saveSaveFiles(); + getSaveFile(save) { + if (save !== false) { + this.saveSaveFiles(); + } const exists = this.FS.analyzePath(this.getSaveFilePath()).exists; return (exists ? this.FS.readFile(this.getSaveFilePath()) : null); } @@ -389,6 +443,22 @@ class EJS_GameManager { getFrameNum() { return this.functions.getFrameNum(); } + setVideoRotation(rotation) { + this.functions.setVideoRoation(rotation); + } + getVideoDimensions(type) { + try { + return this.functions.getVideoDimensions(type); + } catch(e) { + console.warn(e); + } + } + setKeyboardEnabled(enabled) { + this.functions.setKeyboardEnabled(enabled === true ? 1 : 0); + } + setAltKeyEnabled(enabled) { + this.functions.setKeyboardEnabled(enabled === true ? 3 : 2); + } } window.EJS_GameManager = EJS_GameManager; diff --git a/data/src/compression.js b/data/src/compression.js index 2b8d7a09..1db5fa27 100644 --- a/data/src/compression.js +++ b/data/src/compression.js @@ -5,11 +5,11 @@ class EJS_COMPRESSION { isCompressed(data) { //https://www.garykessler.net/library/file_sigs.html //todo. Use hex instead of numbers if ((data[0] === 80 && data[1] === 75) && ((data[2] === 3 && data[3] === 4) || (data[2] === 5 && data[3] === 6) || (data[2] === 7 && data[3] === 8))) { - return 'zip'; + return "zip"; } else if (data[0] === 55 && data[1] === 122 && data[2] === 188 && data[3] === 175 && data[4] === 39 && data[5] === 28) { - return '7z'; + return "7z"; } else if ((data[0] === 82 && data[1] === 97 && data[2] === 114 && data[3] === 33 && data[4] === 26 && data[5] === 7) && ((data[6] === 0) || (data[6] === 1 && data[7] == 0))) { - return 'rar'; + return "rar"; } return null; } @@ -19,12 +19,12 @@ class EJS_COMPRESSION { if (typeof fileCbFunc === "function") { fileCbFunc("!!notCompressedData", data); } - return new Promise(resolve => resolve({"!!notCompressedData": data})); + return new Promise(resolve => resolve({ "!!notCompressedData": data })); } return this.decompressFile(compressed, data, updateMsg, fileCbFunc); } getWorkerFile(method) { - return new Promise((resolve, reject) => { + return new Promise(async (resolve, reject) => { let path, obj; if (method === "7z") { path = "compression/extract7z.js"; @@ -36,31 +36,75 @@ class EJS_COMPRESSION { path = "compression/libunrar.js"; obj = "rar"; } - this.EJS.downloadFile(path, (res) => { - if (res === -1) { - this.EJS.startGameError(this.EJS.localization('Network Error')); + const res = await this.EJS.downloadFile(path, null, false, { responseType: "text", method: "GET" }); + if (res === -1) { + this.EJS.startGameError(this.EJS.localization("Network Error")); + return; + } + if (method === "rar") { + const res2 = await this.EJS.downloadFile("compression/libunrar.wasm", null, false, { responseType: "arraybuffer", method: "GET" }); + if (res2 === -1) { + this.EJS.startGameError(this.EJS.localization("Network Error")); return; } - if (method === "rar") { - this.EJS.downloadFile("compression/libunrar.wasm", (res2) => { - if (res2 === -1) { - this.EJS.startGameError(this.EJS.localization('Network Error')); - return; + const path = URL.createObjectURL(new Blob([res2.data], { type: "application/wasm" })); + let script = ` + let dataToPass = []; + Module = { + monitorRunDependencies: function(left) { + if (left == 0) { + setTimeout(function() { + unrar(dataToPass, null); + }, 100); + } + }, + onRuntimeInitialized: function() {}, + locateFile: function(file) { + console.log("locateFile"); + return "` + path + `"; } - const path = URL.createObjectURL(new Blob([res2.data], {type: "application/wasm"})); - let data = '\nlet dataToPass = [];\nModule = {\n monitorRunDependencies: function(left) {\n if (left == 0) {\n setTimeout(function() {\n unrar(dataToPass, null);\n }, 100);\n }\n },\n onRuntimeInitialized: function() {\n },\n locateFile: function(file) {\n return \''+path+'\';\n }\n};\n'+res.data+'\nlet unrar = function(data, password) {\n let cb = function(fileName, fileSize, progress) {\n postMessage({"t":4,"current":progress,"total":fileSize, "name": fileName});\n };\n\n let rarContent = readRARContent(data.map(function(d) {\n return {\n name: d.name,\n content: new Uint8Array(d.content)\n }\n }), password, cb)\n let rec = function(entry) {\n if (!entry) return;\n if (entry.type === \'file\') {\n postMessage({"t":2,"file":entry.fullFileName,"size":entry.fileSize,"data":entry.fileContent});\n } else if (entry.type === \'dir\') {\n Object.keys(entry.ls).forEach(function(k) {\n rec(entry.ls[k]);\n })\n } else {\n throw "Unknown type";\n }\n }\n rec(rarContent);\n postMessage({"t":1});\n return rarContent;\n};\nonmessage = function(data) {\n dataToPass.push({name: \'test.rar\', content: data.data});\n};\n '; - const blob = new Blob([data], { - type: 'application/javascript' - }) - resolve(blob); - }, null, false, {responseType: "arraybuffer", method: "GET"}); - } else { - const blob = new Blob([res.data], { - type: 'application/javascript' - }) - resolve(blob); - } - }, null, false, {responseType: "arraybuffer", method: "GET"}); + }; + ` + res.data + ` + let unrar = function(data, password) { + let cb = function(fileName, fileSize, progress) { + postMessage({ "t": 4, "current": progress, "total": fileSize, "name": fileName }); + }; + let rarContent = readRARContent(data.map(function(d) { + return { + name: d.name, + content: new Uint8Array(d.content) + } + }), password, cb) + let rec = function(entry) { + if (!entry) return; + if (entry.type === "file") { + postMessage({ "t": 2, "file": entry.fullFileName, "size": entry.fileSize, "data": entry.fileContent }); + } else if (entry.type === "dir") { + Object.keys(entry.ls).forEach(function(k) { + rec(entry.ls[k]); + }); + } else { + throw "Unknown type"; + } + } + rec(rarContent); + postMessage({ "t": 1 }); + return rarContent; + }; + onmessage = function(data) { + dataToPass.push({ name: "test.rar", content: data.data }); + }; + `; + const blob = new Blob([script], { + type: "application/javascript" + }) + resolve(blob); + } else { + const blob = new Blob([res.data], { + type: "application/javascript" + }) + resolve(blob); + } }) } decompressFile(method, data, updateMsg, fileCbFunc) { @@ -75,7 +119,7 @@ class EJS_COMPRESSION { const pg = data.data; const num = Math.floor(pg.current / pg.total * 100); if (isNaN(num)) return; - const progress = ' '+num.toString()+'%'; + const progress = " " + num.toString() + "%"; updateMsg(progress, true); } if (data.data.t === 2) { diff --git a/data/src/emulator.js b/data/src/emulator.js index 1f63296d..92668939 100644 --- a/data/src/emulator.js +++ b/data/src/emulator.js @@ -1,93 +1,75 @@ class EmulatorJS { + getCores() { + let rv = { + "atari5200": ["a5200"], + "vb": ["beetle_vb"], + "nds": ["melonds", "desmume", "desmume2015"], + "arcade": ["fbneo", "fbalpha2012_cps1", "fbalpha2012_cps2"], + "nes": ["fceumm", "nestopia"], + "gb": ["gambatte"], + "coleco": ["gearcoleco"], + "segaMS": ["smsplus", "genesis_plus_gx", "picodrive"], + "segaMD": ["genesis_plus_gx", "picodrive"], + "segaGG": ["genesis_plus_gx"], + "segaCD": ["genesis_plus_gx", "picodrive"], + "sega32x": ["picodrive"], + "sega": ["genesis_plus_gx", "picodrive"], + "lynx": ["handy"], + "mame": ["mame2003_plus", "mame2003"], + "ngp": ["mednafen_ngp"], + "pce": ["mednafen_pce"], + "pcfx": ["mednafen_pcfx"], + "psx": ["pcsx_rearmed", "mednafen_psx_hw"], + "ws": ["mednafen_wswan"], + "gba": ["mgba"], + "n64": ["mupen64plus_next", "parallel_n64"], + "3do": ["opera"], + "psp": ["ppsspp"], + "atari7800": ["prosystem"], + "snes": ["snes9x"], + "atari2600": ["stella2014"], + "jaguar": ["virtualjaguar"], + "segaSaturn": ["yabause"], + "amiga": ["puae"], + "c64": ["vice_x64sc"], + "c128": ["vice_x128"], + "pet": ["vice_xpet"], + "plus4": ["vice_xplus4"], + "vic20": ["vice_xvic"], + "dos": ["dosbox_pure"] + }; + if (this.isSafari && this.isMobile) { + rv.n64 = rv.n64.reverse(); + } + return rv; + } + requiresThreads(core) { + const requiresThreads = ["ppsspp", "dosbox_pure"]; + return requiresThreads.includes(core); + } + requiresWebGL2(core) { + const requiresWebGL2 = ["ppsspp"]; + return requiresWebGL2.includes(core); + } getCore(generic) { + const cores = this.getCores(); const core = this.config.system; if (generic) { - const options = { - 'a5200': 'atari5200', - 'beetle_vb': 'vb', - 'desmume': 'nds', - 'desmume2015': 'nds', - 'fbalpha2012_cps1': 'arcade', - 'fbalpha2012_cps2': 'arcade', - 'fbneo': 'arcade', - 'fceumm': 'nes', - 'gambatte': 'gb', - 'gearcoleco': 'coleco', - 'genesis_plus_gx': 'sega', - 'handy': 'lynx', - 'mame2003': 'mame', - 'mame2003_plus': 'mame', - 'mednafen_ngp': 'ngp', - 'mednafen_pce': 'pce', - 'mednafen_pcfx': 'pcfx', - 'mednafen_psx_hw': 'psx', - 'mednafen_wswan': 'ws', - 'melonds': 'nds', - 'mgba': 'gba', - 'mupen64plus_next': 'n64', - 'nestopia': 'nes', - 'opera': '3do', - 'parallel_n64': 'n64', - 'pcsx_rearmed': 'psx', - 'picodrive': 'sega', - 'ppsspp': 'psp', - 'prosystem': 'atari7800', - 'snes9x': 'snes', - 'stella2014': 'atari2600', - 'virtualjaguar': 'jaguar', - 'yabause': 'segaSaturn', - 'puae': 'amiga', - 'vice_x64sc': 'c64', - 'vice_x128': 'c128', - 'vice_xpet': 'pet', - 'vice_xplus4': 'plus4', - 'vice_xvic': 'vic20' - } - return options[core] || core; - } - const options = { - 'jaguar': 'virtualjaguar', - 'lynx': 'handy', - 'segaSaturn': 'yabause', - 'segaMS': 'smsplus', - 'segaMD': 'genesis_plus_gx', - 'segaGG': 'genesis_plus_gx', - 'segaCD': 'genesis_plus_gx', - 'sega32x': 'picodrive', - 'atari2600': 'stella2014', - 'atari7800': 'prosystem', - 'nes': 'fceumm', - 'snes': 'snes9x', - 'atari5200': 'a5200', - 'gb': 'gambatte', - 'gba': 'mgba', - 'vb': 'beetle_vb', - 'n64': 'mupen64plus_next', - 'nds': 'melonds', - 'mame': 'mame2003_plus', - 'arcade': 'fbneo', - 'psx': 'pcsx_rearmed', - '3do': 'opera', - 'psp': 'ppsspp', - 'pce': 'mednafen_pce', - 'pcfx': 'mednafen_pcfx', - 'ngp': 'mednafen_ngp', - 'ws': 'mednafen_wswan', - 'coleco': 'gearcoleco', - 'amiga': 'puae', - 'c64': 'vice_x64sc', - 'c128': 'vice_x128', - 'pet': 'vice_xpet', - 'plus4': 'vice_xplus4', - 'vic20': 'vice_xvic' - } - if (this.isSafari && this.isMobile && this.getCore(true) === "n64") { - return "parallel_n64"; - } - if (!this.supportsWebgl2 && this.getCore(true) === "psx") { - return "mednafen_psx_hw"; - } - return options[core] || core; + for (const k in cores) { + if (cores[k].includes(core)) { + return k; + } + } + return core; + } + const gen = this.getCore(true); + if (cores[gen] && cores[gen].includes(this.preGetSetting("retroarch_core"))) { + return this.preGetSetting("retroarch_core"); + } + if (cores[core]) { + return cores[core][0]; + } + return core; } createElement(type) { return document.createElement(type); @@ -95,47 +77,63 @@ class EmulatorJS { addEventListener(element, listener, callback) { const listeners = listener.split(" "); let rv = []; - for (let i=0; i { - if (opts.method === 'HEAD') { - cb({headers:{}}); - return; - } else { - cb({headers:{}, data:game}); + downloadFile(path, progressCB, notWithPath, opts) { + return new Promise(async cb => { + const data = this.toData(path); //check other data types + if (data) { + data.then((game) => { + if (opts.method === "HEAD") { + cb({ headers: {} }); + } else { + cb({ headers: {}, data: game }); + } + }) + return; + } + const basePath = notWithPath ? "" : this.config.dataPath; + path = basePath + path; + if (!notWithPath && this.config.filePaths && typeof this.config.filePaths[path.split("/").pop()] === "string") { + path = this.config.filePaths[path.split("/").pop()]; + } + let url; + try { url = new URL(path) } catch(e) {}; + if (url && !["http:", "https:"].includes(url.protocol)) { + //Most commonly blob: urls. Not sure what else it could be + if (opts.method === "HEAD") { + cb({ headers: {} }); return; } - }) - return; - } - const basePath = notWithPath ? '' : this.config.dataPath; - path = basePath + path; - if (!notWithPath && this.config.filePaths) { - if (typeof this.config.filePaths[path.split('/').pop()] === "string") { - path = this.config.filePaths[path.split('/').pop()]; + try { + let res = await fetch(path) + if ((opts.type && opts.type.toLowerCase() === "arraybuffer") || !opts.type) { + res = await res.arrayBuffer(); + } else { + res = await res.text(); + try { res = JSON.parse(res) } catch(e) {} + } + if (path.startsWith("blob:")) URL.revokeObjectURL(path); + cb({ data: res, headers: {} }); + } catch(e) { + cb(-1); + } + return; } - } - let url; - try {url=new URL(path)}catch(e){}; - if ((url && ['http:', 'https:'].includes(url.protocol)) || !url) { const xhr = new XMLHttpRequest(); if (progressCB instanceof Function) { - xhr.addEventListener('progress', (e) => { - const progress = e.total ? ' '+Math.floor(e.loaded / e.total * 100).toString()+'%' : ' '+(e.loaded/1048576).toFixed(2)+'MB'; + xhr.addEventListener("progress", (e) => { + const progress = e.total ? " " + Math.floor(e.loaded / e.total * 100).toString() + "%" : " " + (e.loaded / 1048576).toFixed(2) + "MB"; progressCB(progress); }); } @@ -146,11 +144,11 @@ class EmulatorJS { cb(-1); return; } - try {data=JSON.parse(data)}catch(e){} + try { data = JSON.parse(data) } catch(e) {} cb({ data: data, headers: { - "content-length": xhr.getResponseHeader('content-length') + "content-length": xhr.getResponseHeader("content-length") } }); } @@ -159,32 +157,7 @@ class EmulatorJS { xhr.onerror = () => cb(-1); xhr.open(opts.method, path, true); xhr.send(); - } else { - (async () => { - //Most commonly blob: urls. Not sure what else it could be - if (opts.method === 'HEAD') { - cb({headers:{}}); - return; - } - let res; - try { - res = await fetch(path); - if ((opts.type && opts.type.toLowerCase() === 'arraybuffer') || !opts.type) { - res = await res.arrayBuffer(); - } else { - res = await res.text(); - try {res = JSON.parse(res)} catch(e) {} - } - } catch(e) { - cb(-1); - } - if (path.startsWith('blob:')) URL.revokeObjectURL(path); - cb({ - data: res, - headers: {} - }); - })(); - } + }) } toData(data, rv) { if (!(data instanceof ArrayBuffer) && !(data instanceof Uint8Array) && !(data instanceof Blob)) return null; @@ -205,12 +178,12 @@ class EmulatorJS { console.warn("Using EmulatorJS beta. Not checking for updates. This instance may be out of date. Using stable is highly recommended unless you build and ship your own cores."); return; } - fetch('https://cdn.emulatorjs.org/stable/data/version.json').then(response => { + fetch("https://cdn.emulatorjs.org/stable/data/version.json").then(response => { if (response.ok) { response.text().then(body => { let version = JSON.parse(body); if (this.versionAsInt(this.ejs_version) < this.versionAsInt(version.version)) { - console.log('Using EmulatorJS version ' + this.ejs_version + ' but the newest version is ' + version.current_version + '\nopen https://github.com/EmulatorJS/EmulatorJS to update'); + console.log(`Using EmulatorJS version ${this.ejs_version} but the newest version is ${version.current_version}\nopen https://github.com/EmulatorJS/EmulatorJS to update`); } }) } @@ -221,24 +194,42 @@ class EmulatorJS { return 99999999; } let rv = ver.split("."); - if (rv[rv.length-1].length === 1) { - rv[rv.length-1] = "0" + rv[rv.length-1]; + if (rv[rv.length - 1].length === 1) { + rv[rv.length - 1] = "0" + rv[rv.length - 1]; } return parseInt(rv.join("")); } constructor(element, config) { - this.ejs_version = "4.1.1"; + this.ejs_version = "4.2.3"; this.extensions = []; this.initControlVars(); this.debug = (window.EJS_DEBUG_XX === true); - if (this.debug || (window.location && ['localhost', '127.0.0.1'].includes(location.hostname))) this.checkForUpdates(); + if (this.debug || (window.location && ["localhost", "127.0.0.1"].includes(location.hostname))) this.checkForUpdates(); this.netplayEnabled = (window.EJS_DEBUG_XX === true) && (window.EJS_EXPERIMENTAL_NETPLAY === true); - this.settingsLanguage = window.EJS_settingsLanguage || false; this.config = config; + this.config.buttonOpts = this.buildButtonOptions(this.config.buttonOpts); + this.config.settingsLanguage = window.EJS_settingsLanguage || false; + switch (this.config.browserMode) { + case 1: // Force mobile + case "1": + case "mobile": + if (this.debug) { console.log("Force mobile mode is enabled"); } + this.config.browserMode = 1; + break; + case 2: // Force desktop + case "2": + case "desktop": + if (this.debug) { console.log("Force desktop mode is enabled"); } + this.config.browserMode = 2; + break; + default: // Auto detect + config.browserMode = undefined; + } this.currentPopup = null; this.isFastForward = false; this.isSlowMotion = false; - this.rewindEnabled = this.preGetSetting("rewindEnabled") === 'enabled'; + this.failedToStart = false; + this.rewindEnabled = this.preGetSetting("rewindEnabled") === "enabled"; this.touch = false; this.cheats = []; this.started = false; @@ -246,7 +237,6 @@ class EmulatorJS { if (this.config.defaultControllers) this.defaultControllers = this.config.defaultControllers; this.muted = false; this.paused = true; - this.listeners = []; this.missingLang = []; this.setElements(element); this.setColor(this.config.color || ""); @@ -256,18 +246,53 @@ class EmulatorJS { this.config.adSize = (Array.isArray(this.config.adSize)) ? this.config.adSize : ["300px", "250px"]; this.setupAds(this.config.adUrl, this.config.adSize[0], this.config.adSize[1]); } - this.isMobile = (function() { + this.isMobile = (() => { + // browserMode can be either a 1 (force mobile), 2 (force desktop) or undefined (auto detect) + switch (this.config.browserMode) { + case 1: + return true; + case 2: + return false; + } + let check = false; - (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera); + (function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true; })(navigator.userAgent || navigator.vendor || window.opera); return check; })(); - this.canvas = this.createElement('canvas'); - this.canvas.classList.add('ejs_canvas'); + this.hasTouchScreen = (function() { + if (window.PointerEvent && ("maxTouchPoints" in navigator)) { + if (navigator.maxTouchPoints > 0) { + return true; + } + } else { + if (window.matchMedia && window.matchMedia("(any-pointer:coarse)").matches) { + return true; + } else if (window.TouchEvent || ("ontouchstart" in window)) { + return true; + } + } + return false; + })(); + this.canvas = this.createElement("canvas"); + this.canvas.classList.add("ejs_canvas"); this.videoRotation = ([0, 1, 2, 3].includes(this.config.videoRotation)) ? this.config.videoRotation : this.preGetSetting("videoRotation") || 0; + this.videoRotationChanged = false; + this.capture = this.capture || {}; + this.capture.photo = this.capture.photo || {}; + this.capture.photo.source = ["canvas", "retroarch"].includes(this.capture.photo.source) ? this.capture.photo.source : "canvas"; + this.capture.photo.format = (typeof this.capture.photo.format === "string") ? this.capture.photo.format : "png"; + this.capture.photo.upscale = (typeof this.capture.photo.upscale === "number") ? this.capture.photo.upscale : 1; + this.capture.video = this.capture.video || {}; + this.capture.video.format = (typeof this.capture.video.format === "string") ? this.capture.video.format : "detect"; + this.capture.video.upscale = (typeof this.capture.video.upscale === "number") ? this.capture.video.upscale : 1; + this.capture.video.fps = (typeof this.capture.video.fps === "number") ? this.capture.video.fps : 30; + this.capture.video.videoBitrate = (typeof this.capture.video.videoBitrate === "number") ? this.capture.video.videoBitrate : 2.5 * 1024 * 1024; + this.capture.video.audioBitrate = (typeof this.capture.video.audioBitrate === "number") ? this.capture.video.audioBitrate : 192 * 1024; this.bindListeners(); this.config.netplayUrl = this.config.netplayUrl || "https://netplay.emulatorjs.org"; this.fullscreen = false; - this.supportsWebgl2 = !!document.createElement('canvas').getContext('webgl2') && (this.config.forceLegacyCores !== true); + this.enableMouseLock = false; + this.supportsWebgl2 = !!document.createElement("canvas").getContext("webgl2") && (this.config.forceLegacyCores !== true); this.webgl2Enabled = (() => { let setting = this.preGetSetting("webgl2Enabled"); if (setting === "disabled" || !this.supportsWebgl2) { @@ -293,22 +318,22 @@ class EmulatorJS { } // This is not cache. This is save data this.storage.states = new window.EJS_STORAGE("EmulatorJS-states", "states"); - + this.game.classList.add("ejs_game"); if (typeof this.config.backgroundImg === "string") { this.game.classList.add("ejs_game_background"); if (this.config.backgroundBlur) this.game.classList.add("ejs_game_background_blur"); - this.game.setAttribute("style", "--ejs-background-image: url("+this.config.backgroundImg+"); --ejs-background-color: "+this.config.backgroundColor+";"); + this.game.setAttribute("style", `--ejs-background-image: url("${this.config.backgroundImg}"); --ejs-background-color: ${this.config.backgroundColor};`); this.on("start", () => { this.game.classList.remove("ejs_game_background"); if (this.config.backgroundBlur) this.game.classList.remove("ejs_game_background_blur"); }) } else { - this.game.setAttribute("style", "--ejs-background-color: "+this.config.backgroundColor+";"); + this.game.setAttribute("style", "--ejs-background-color: " + this.config.backgroundColor + ";"); } - + if (Array.isArray(this.config.cheats)) { - for (let i=0; i { div.remove(); }) - + this.on("start-clicked", () => { if (this.config.adMode === 0) div.remove(); - if (this.config.adMode === 1){ + if (this.config.adMode === 1) { this.elements.parent.appendChild(div); } }) - + this.on("start", () => { closeParent.removeAttribute("hidden"); const time = (typeof this.config.adTimer === "number" && this.config.adTimer > 0) ? this.config.adTimer : 10000; @@ -390,10 +415,10 @@ class EmulatorJS { div.remove(); }, time); }) - + } adBlocked(url, del) { - if (del){ + if (del) { document.querySelector('div[class="ejs_ad_iframe"]').remove(); } else { try { @@ -420,7 +445,7 @@ class EmulatorJS { elem.innerHTML = ""; elem.appendChild(game); this.game = game; - + this.elements = { main: this.game, parent: elem @@ -433,15 +458,15 @@ class EmulatorJS { const button = this.createElement("div"); button.classList.add("ejs_start_button"); let border = 0; - if (typeof this.config.backgroundImg === "string"){ + if (typeof this.config.backgroundImg === "string") { button.classList.add("ejs_start_button_border"); border = 1; } - button.innerText = (typeof this.config.startBtnName === 'string') ? this.config.startBtnName : this.localization("Start Game"); - if (this.config.alignStartButton == "top"){ + button.innerText = (typeof this.config.startBtnName === "string") ? this.config.startBtnName : this.localization("Start Game"); + if (this.config.alignStartButton == "top") { button.style.bottom = "calc(100% - 20px)"; - }else if (this.config.alignStartButton == "center"){ - button.style.bottom = "calc(50% + 22.5px + "+border+"px)"; + } else if (this.config.alignStartButton == "center") { + button.style.bottom = "calc(50% + 22.5px + " + border + "px)"; } this.elements.parent.appendChild(button); this.addEventListener(button, "touchstart", () => { @@ -478,14 +503,14 @@ class EmulatorJS { this.elements.parent.appendChild(this.textElem); } localization(text, log) { - if (typeof text === "undefined") return; + if (typeof text === "undefined" || text.length === 0) return; text = text.toString(); if (text.includes("EmulatorJS v")) return text; if (this.config.langJson) { if (typeof log === "undefined") log = true; if (!this.config.langJson[text] && log) { if (!this.missingLang.includes(text)) this.missingLang.push(text); - console.log("Translation not found for '"+text+"'. Language set to '"+this.config.language+"'"); + console.log(`Translation not found for '${text}'. Language set to '${this.config.language}'`); } return this.config.langJson[text] || text; } @@ -511,19 +536,28 @@ class EmulatorJS { startGameError(message) { console.log(message); this.textElem.innerText = message; - this.textElem.style.color = "red"; - this.textElem.style.bottom = "10%"; + this.textElem.classList.add("ejs_error_text"); this.setupSettingsMenu(); this.loadSettings(); this.menu.failedToStart(); this.handleResize(); + this.failedToStart = true; } downloadGameCore() { this.textElem.innerText = this.localization("Download Game Core"); - if (this.config.threads && ((typeof window.SharedArrayBuffer) !== "function")) { - this.startGameError(this.localization('Error for site owner')+"\n"+this.localization("Check console")); + if (!this.config.threads && this.requiresThreads(this.getCore())) { + this.startGameError(this.localization("Error for site owner") + "\n" + this.localization("Check console")); + console.warn("This core requires threads, but EJS_threads is not set!"); + return; + } + if (!this.supportsWebgl2 && this.requiresWebGL2(this.getCore())) { + this.startGameError(this.localization("Outdated graphics driver")); + return; + } + if (this.config.threads && typeof window.SharedArrayBuffer !== "function") { + this.startGameError(this.localization("Error for site owner") + "\n" + this.localization("Check console")); console.warn("Threads is set to true, but the SharedArrayBuffer function is not exposed. Threads requires 2 headers to be set when sending you html page. See https://stackoverflow.com/a/68630724"); return; } @@ -546,71 +580,89 @@ class EmulatorJS { this.coreName = core.name; this.repository = core.repo; this.defaultCoreOpts = core.options; + this.enableMouseLock = core.options.supportsMouse; + this.retroarchOpts = core.retroarchOpts; + this.saveFileExt = core.save; } else if (k === "license.txt") { this.license = new TextDecoder().decode(data[k]); } } + + if (this.saveFileExt === false) { + this.elements.bottomBar.saveSavFiles[0].style.display = "none"; + this.elements.bottomBar.loadSavFiles[0].style.display = "none"; + } + this.initGameCore(js, wasm, thread); }); } const report = "cores/reports/" + this.getCore() + ".json"; - this.downloadFile(report, (rep) => { - if (rep === -1 || typeof report === "string") { + this.downloadFile(report, null, false, { responseType: "text", method: "GET" }).then(async rep => { + if (rep === -1 || typeof rep === "string" || typeof rep.data === "string") { rep = {}; } else { rep = rep.data; } if (!rep.buildStart) { + console.warn("Could not fetch core report JSON! Core caching will be disabled!"); rep.buildStart = Math.random() * 100; } if (this.webgl2Enabled === null) { - this.webgl2Enabled = rep.options && rep.options.defaultWebGL2; + this.webgl2Enabled = rep.options ? rep.options.defaultWebGL2 : false; + } + if (this.requiresWebGL2(this.getCore())) { + this.webgl2Enabled = true; } + let threads = false; + if (typeof window.SharedArrayBuffer === "function") { + const opt = this.preGetSetting("ejs_threads"); + if (opt) { + threads = (opt === "enabled"); + } else { + threads = this.config.threads; + } + } + let legacy = (this.supportsWebgl2 && this.webgl2Enabled ? "" : "-legacy"); - let filename = this.getCore()+(this.config.threads ? "-thread" : "")+legacy+"-wasm.data"; - this.storage.core.get(filename).then((result) => { - if (result && result.version === rep.buildStart && !this.debug) { + let filename = this.getCore() + (threads ? "-thread" : "") + legacy + "-wasm.data"; + if (!this.debug) { + const result = await this.storage.core.get(filename); + if (result && result.version === rep.buildStart) { gotCore(result.data); return; } - const corePath = 'cores/'+filename; - this.downloadFile(corePath, (res) => { - if (res === -1) { - console.log("File not found, attemping to fetch from emulatorjs cdn"); - this.downloadFile("https://cdn.emulatorjs.org/stable/data/"+corePath, (res) => { - if (res === -1) { - if (!this.supportsWebgl2) { - this.startGameError(this.localization('Outdated graphics driver')); - } else { - this.startGameError(this.localization('Network Error')); - } - return; - } - console.warn("File was not found locally, but was found on the emulatorjs cdn.\nIt is recommended to download the stable release from here: https://cdn.emulatorjs.org/releases/"); - gotCore(res.data); - this.storage.core.put(filename, { - version: rep.buildStart, - data: res.data - }); - }, (progress) => { - this.textElem.innerText = this.localization("Download Game Core") + progress; - }, true, {responseType: "arraybuffer", method: "GET"}) - return; - } - gotCore(res.data); - this.storage.core.put(filename, { - version: rep.buildStart, - data: res.data - }); - }, (progress) => { + } + const corePath = "cores/" + filename; + let res = await this.downloadFile(corePath, (progress) => { + this.textElem.innerText = this.localization("Download Game Core") + progress; + }, false, { responseType: "arraybuffer", method: "GET" }); + if (res === -1) { + console.log("File not found, attemping to fetch from emulatorjs cdn."); + console.error("**THIS METHOD IS A FAILSAFE, AND NOT OFFICIALLY SUPPORTED. USE AT YOUR OWN RISK**"); + let version = this.ejs_version.endsWith("-beta") ? "nightly" : this.ejs_version; + res = await this.downloadFile(`https://cdn.emulatorjs.org/${version}/data/${corePath}`, (progress) => { this.textElem.innerText = this.localization("Download Game Core") + progress; - }, false, {responseType: "arraybuffer", method: "GET"}); - }) - }, null, false, {responseType: "text", method: "GET"}); + }, true, { responseType: "arraybuffer", method: "GET" }); + if (res === -1) { + if (!this.supportsWebgl2) { + this.startGameError(this.localization("Outdated graphics driver")); + } else { + this.startGameError(this.localization("Error downloading core") + " (" + filename + ")"); + } + return; + } + console.warn("File was not found locally, but was found on the emulatorjs cdn.\nIt is recommended to download the stable release from here: https://cdn.emulatorjs.org/releases/"); + } + gotCore(res.data); + this.storage.core.put(filename, { + version: rep.buildStart, + data: res.data + }); + }); } initGameCore(js, wasm, thread) { let script = this.createElement("script"); - script.src = URL.createObjectURL(new Blob([js], {type: "application/javascript"})); + script.src = URL.createObjectURL(new Blob([js], { type: "application/javascript" })); script.addEventListener("load", () => { this.initModule(wasm, thread); }); @@ -620,7 +672,7 @@ class EmulatorJS { //Only once game and core is loaded if (!this.started && !force) return null; if (force && this.config.gameUrl !== "game" && !this.config.gameUrl.startsWith("blob:")) { - return this.config.gameUrl.split('/').pop().split("#")[0].split("?")[0]; + return this.config.gameUrl.split("/").pop().split("#")[0].split("?")[0]; } if (typeof this.config.gameName === "string") { const invalidCharacters = /[#<$+%>!`&*'|{}/\\?"=@:^\r\n]/ig; @@ -629,7 +681,7 @@ class EmulatorJS { } if (!this.fileName) return "game"; let parts = this.fileName.split("."); - parts.splice(parts.length-1, 1); + parts.splice(parts.length - 1, 1); return parts.join("."); } saveInBrowserSupported() { @@ -654,10 +706,12 @@ class EmulatorJS { return; } this.textElem.innerText = this.localization("Download Game State"); - - this.downloadFile(this.config.loadState, (res) => { + + this.downloadFile(this.config.loadState, (progress) => { + this.textElem.innerText = this.localization("Download Game State") + progress; + }, true, { responseType: "arraybuffer", method: "GET" }).then((res) => { if (res === -1) { - this.startGameError(this.localization('Network Error')); + this.startGameError(this.localization("Error downloading game state")); return; } this.on("start", () => { @@ -666,174 +720,83 @@ class EmulatorJS { }, 10); }) resolve(); - }, (progress) => { - this.textElem.innerText = this.localization("Download Game State") + progress; - }, true, {responseType: "arraybuffer", method: "GET"}); + }); }) } - downloadGamePatch() { - return new Promise((resolve, reject) => { - if ((typeof this.config.gamePatchUrl !== "string" || !this.config.gamePatchUrl.trim()) && !this.toData(this.config.gamePatchUrl, true)) { - resolve(); - return; - } - this.textElem.innerText = this.localization("Download Game Patch"); - const gotData = (data) => { - this.checkCompression(new Uint8Array(data), this.localization("Decompress Game Patch")).then((data) => { - for (const k in data) { - if (k === "!!notCompressedData") { - this.gameManager.FS.writeFile(this.config.gamePatchUrl.split('/').pop().split("#")[0].split("?")[0], data[k]); - break; - } - if (k.endsWith('/')) continue; - this.gameManager.FS.writeFile("/" + k.split('/').pop(), data[k]); + downloadGameFile(assetUrl, type, progressMessage, decompressProgressMessage) { + return new Promise(async (resolve, reject) => { + if ((typeof assetUrl !== "string" || !assetUrl.trim()) && !this.toData(assetUrl, true)) { + return resolve(assetUrl); + } + const gotData = async (input) => { + if (this.config.dontExtractBIOS === true) { + this.gameManager.FS.writeFile(assetUrl, new Uint8Array(input)); + return resolve(assetUrl); + } + const data = await this.checkCompression(new Uint8Array(input), decompressProgressMessage); + for (const k in data) { + const coreFilename = "/" + this.fileName; + const coreFilePath = coreFilename.substring(0, coreFilename.length - coreFilename.split("/").pop().length); + if (k === "!!notCompressedData") { + this.gameManager.FS.writeFile(coreFilePath + assetUrl.split("/").pop().split("#")[0].split("?")[0], data[k]); + break; } - resolve(); - }) + if (k.endsWith("/")) continue; + this.gameManager.FS.writeFile(coreFilePath + k.split("/").pop(), data[k]); + } } - - this.downloadFile(this.config.gamePatchUrl, (res) => { - this.storage.rom.get(this.config.gamePatchUrl.split("/").pop()).then((result) => { - if (result && result['content-length'] === res.headers['content-length'] && !this.debug) { - gotData(result.data); - return; - } - this.downloadFile(this.config.gamePatchUrl, (res) => { - if (res === -1) { - this.startGameError(this.localization('Network Error')); - return; - } - if (this.config.gamePatchUrl instanceof File) { - this.config.gamePatchUrl = this.config.gamePatchUrl.name; - } else if (this.toData(this.config.gamePatchUrl, true)) { - this.config.gamePatchUrl = "game"; - } - gotData(res.data); - const limit = (typeof this.config.cacheLimit === "number") ? this.config.cacheLimit : 1073741824; - if (parseFloat(res.headers['content-length']) < limit && this.saveInBrowserSupported() && this.config.gamePatchUrl !== "game") { - this.storage.rom.put(this.config.gamePatchUrl.split("/").pop(), { - "content-length": res.headers['content-length'], - data: res.data - }) - } - }, (progress) => { - this.textElem.innerText = this.localization("Download Game Patch") + progress; - }, true, {responseType: "arraybuffer", method: "GET"}); - }) - }, null, true, {method: "HEAD"}) - }) - } - downloadGameParent() { - return new Promise((resolve, reject) => { - if ((typeof this.config.gameParentUrl !== "string" || !this.config.gameParentUrl.trim()) && !this.toData(this.config.gameParentUrl, true)) { - resolve(); + + this.textElem.innerText = progressMessage; + if (!this.debug) { + const res = await this.downloadFile(assetUrl, null, true, { method: "HEAD" }); + const result = await this.storage.rom.get(assetUrl.split("/").pop()); + if (result && result["content-length"] === res.headers["content-length"] && result.type === type) { + await gotData(result.data); + return resolve(assetUrl); + } + } + const res = await this.downloadFile(assetUrl, (progress) => { + this.textElem.innerText = progressMessage + progress; + }, true, { responseType: "arraybuffer", method: "GET" }); + if (res === -1) { + this.startGameError(this.localization("Network Error")); + resolve(assetUrl); return; } - this.textElem.innerText = this.localization("Download Game Parent"); - const gotData = (data) => { - this.checkCompression(new Uint8Array(data), this.localization("Decompress Game Parent")).then((data) => { - for (const k in data) { - if (k === "!!notCompressedData") { - this.gameManager.FS.writeFile(this.config.gameParentUrl.split('/').pop().split("#")[0].split("?")[0], data[k]); - break; - } - if (k.endsWith('/')) continue; - this.gameManager.FS.writeFile("/" + k.split('/').pop(), data[k]); - } - resolve(); + if (assetUrl instanceof File) { + assetUrl = assetUrl.name; + } else if (this.toData(assetUrl, true)) { + assetUrl = "game"; + } + await gotData(res.data); + resolve(assetUrl); + const limit = (typeof this.config.cacheLimit === "number") ? this.config.cacheLimit : 1073741824; + if (parseFloat(res.headers["content-length"]) < limit && this.saveInBrowserSupported() && assetUrl !== "game") { + this.storage.rom.put(assetUrl.split("/").pop(), { + "content-length": res.headers["content-length"], + data: res.data, + type: type }) } - - this.downloadFile(this.config.gameParentUrl, (res) => { - this.storage.rom.get(this.config.gameParentUrl.split("/").pop()).then((result) => { - if (result && result['content-length'] === res.headers['content-length'] && !this.debug) { - gotData(result.data); - return; - } - this.downloadFile(this.config.gameParentUrl, (res) => { - if (res === -1) { - this.startGameError(this.localization('Network Error')); - return; - } - if (this.config.gameParentUrl instanceof File) { - this.config.gameParentUrl = this.config.gameParentUrl.name; - } else if (this.toData(this.config.gameParentUrl, true)) { - this.config.gameParentUrl = "game"; - } - gotData(res.data); - const limit = (typeof this.config.cacheLimit === "number") ? this.config.cacheLimit : 1073741824; - if (parseFloat(res.headers['content-length']) < limit && this.saveInBrowserSupported() && this.config.gameParentUrl !== "game") { - this.storage.rom.put(this.config.gameParentUrl.split("/").pop(), { - "content-length": res.headers['content-length'], - data: res.data - }) - } - }, (progress) => { - this.textElem.innerText = this.localization("Download Game Parent") + progress; - }, true, {responseType: "arraybuffer", method: "GET"}); - }) - }, null, true, {method: "HEAD"}) - }) + }); + } + downloadGamePatch() { + return new Promise(async (resolve) => { + this.config.gamePatchUrl = await this.downloadGameFile(this.config.gamePatchUrl, "patch", this.localization("Download Game Patch"), this.localization("Decompress Game Patch")); + resolve(); + }); + } + downloadGameParent() { + return new Promise(async (resolve) => { + this.config.gameParentUrl = await this.downloadGameFile(this.config.gameParentUrl, "parent", this.localization("Download Game Parent"), this.localization("Decompress Game Parent")); + resolve(); + }); } downloadBios() { - return new Promise((resolve, reject) => { - if ((typeof this.config.biosUrl !== "string" || !this.config.biosUrl.trim()) && !this.toData(this.config.biosUrl, true)) { - resolve(); - return; - } - this.textElem.innerText = this.localization("Download Game BIOS"); - const gotBios = (data) => { - if (this.getCore() === "same_cdi") { - this.gameManager.FS.writeFile(this.config.biosUrl.split('/').pop().split("#")[0].split("?")[0], new Uint8Array(data)); - resolve(); - return; - } - this.checkCompression(new Uint8Array(data), this.localization("Decompress Game BIOS")).then((data) => { - for (const k in data) { - if (k === "!!notCompressedData") { - this.gameManager.FS.writeFile(this.config.biosUrl.split('/').pop().split("#")[0].split("?")[0], data[k]); - break; - } - if (k.endsWith('/')) continue; - this.gameManager.FS.writeFile("/" + k.split('/').pop(), data[k]); - } - resolve(); - }) - } - - this.downloadFile(this.config.biosUrl, (res) => { - if (res === -1) { - this.startGameError(this.localization('Network Error')); - return; - } - this.storage.bios.get(this.config.biosUrl.split("/").pop()).then((result) => { - if (result && result['content-length'] === res.headers['content-length'] && !this.debug) { - gotBios(result.data); - return; - } - this.downloadFile(this.config.biosUrl, (res) => { - if (res === -1) { - this.startGameError(this.localization('Network Error')); - return; - } - if (this.config.biosUrl instanceof File) { - this.config.biosUrl = this.config.biosUrl.name; - } else if (this.toData(this.config.biosUrl, true)) { - this.config.biosUrl = "game"; - } - gotBios(res.data); - if (this.saveInBrowserSupported() && this.config.biosUrl !== "game") { - this.storage.bios.put(this.config.biosUrl.split("/").pop(), { - "content-length": res.headers['content-length'], - data: res.data - }) - } - }, (progress) => { - this.textElem.innerText = this.localization("Download Game BIOS") + progress; - }, true, {responseType: "arraybuffer", method: "GET"}); - }) - }, null, true, {method: "HEAD"}) - }) + return new Promise(async (resolve) => { + this.config.biosUrl = await this.downloadGameFile(this.config.biosUrl, "bios", this.localization("Download Game BIOS"), this.localization("Decompress Game BIOS")); + resolve(); + }); } downloadRom() { const supportsExt = (ext) => { @@ -846,7 +809,7 @@ class EmulatorJS { this.textElem.innerText = this.localization("Download Game Data"); const gotGameData = (data) => { - if (['arcade', 'mame'].includes(this.getCore(true))) { + if (["arcade", "mame"].includes(this.getCore(true))) { this.fileName = this.getBaseFileName(true); this.gameManager.FS.writeFile(this.fileName, new Uint8Array(data)); resolve(); @@ -856,7 +819,7 @@ class EmulatorJS { const altName = this.getBaseFileName(true); let disableCue = false; - if (['pcsx_rearmed', 'genesis_plus_gx', 'picodrive', 'mednafen_pce', 'smsplus', 'vice_x64', 'vice_x64sc', 'vice_x128', 'vice_xvic', 'vice_xplus4', 'vice_xpet', 'puae'].includes(this.getCore()) && this.config.disableCue === undefined) { + if (["pcsx_rearmed", "genesis_plus_gx", "picodrive", "mednafen_pce", "smsplus", "vice_x64", "vice_x64sc", "vice_x128", "vice_xvic", "vice_xplus4", "vice_xpet", "puae"].includes(this.getCore()) && this.config.disableCue === undefined) { disableCue = true; } else { disableCue = this.config.disableCue; @@ -867,7 +830,7 @@ class EmulatorJS { if (fileName.includes("/")) { const paths = fileName.split("/"); let cp = ""; - for (let i=0; i { - const ext = fileName.split('.').pop().toLowerCase(); + const ext = fileName.split(".").pop().toLowerCase(); if (supportedFile === null && supportsExt(ext)) { supportedFile = fileName; } - if (isoFile === null && ['iso', 'cso', 'chd', 'elf'].includes(ext)) { + if (isoFile === null && ["iso", "cso", "chd", "elf"].includes(ext)) { isoFile = fileName; } - if (['cue', 'ccd', 'toc', 'm3u'].includes(ext)) { - if (this.getCore(true) === 'psx') { + if (["cue", "ccd", "toc", "m3u"].includes(ext)) { + if (this.getCore(true) === "psx") { //always prefer m3u files for psx cores - if (selectedCueExt !== 'm3u') { - if (cueFile === null || ext === 'm3u') { + if (selectedCueExt !== "m3u") { + if (cueFile === null || ext === "m3u") { cueFile = fileName; selectedCueExt = ext; } } } else { //prefer cue or ccd files over toc or m3u - if (!['cue', 'ccd'].includes(selectedCueExt)) { - if (cueFile === null || ['cue', 'ccd'].includes(ext)) { + if (!["cue", "ccd"].includes(selectedCueExt)) { + if (cueFile === null || ["cue", "ccd"].includes(ext)) { cueFile = fileName; selectedCueExt = ext; } @@ -924,9 +887,9 @@ class EmulatorJS { } else { this.fileName = fileNames[0]; } - if (isoFile !== null && (supportsExt('iso') || supportsExt('cso') || supportsExt('chd') || supportsExt('elf'))) { + if (isoFile !== null && (supportsExt("iso") || supportsExt("cso") || supportsExt("chd") || supportsExt("elf"))) { this.fileName = isoFile; - } else if (supportsExt('cue') || supportsExt('ccd') || supportsExt('toc') || supportsExt('m3u')) { + } else if (supportsExt("cue") || supportsExt("ccd") || supportsExt("toc") || supportsExt("m3u")) { if (cueFile !== null) { this.fileName = cueFile; } else if (!disableCue) { @@ -936,47 +899,50 @@ class EmulatorJS { resolve(); }); } - - this.downloadFile(this.config.gameUrl, (res) => { + const downloadFile = async () => { + const res = await this.downloadFile(this.config.gameUrl, (progress) => { + this.textElem.innerText = this.localization("Download Game Data") + progress; + }, true, { responseType: "arraybuffer", method: "GET" }); if (res === -1) { - this.startGameError(this.localization('Network Error')); + this.startGameError(this.localization("Network Error")); return; } - const name = (typeof this.config.gameUrl === "string") ? this.config.gameUrl.split('/').pop() : "game"; - this.storage.rom.get(name).then((result) => { - if (result && result['content-length'] === res.headers['content-length'] && !this.debug && name !== "game") { + if (this.config.gameUrl instanceof File) { + this.config.gameUrl = this.config.gameUrl.name; + } else if (this.toData(this.config.gameUrl, true)) { + this.config.gameUrl = "game"; + } + gotGameData(res.data); + const limit = (typeof this.config.cacheLimit === "number") ? this.config.cacheLimit : 1073741824; + if (parseFloat(res.headers["content-length"]) < limit && this.saveInBrowserSupported() && this.config.gameUrl !== "game") { + this.storage.rom.put(this.config.gameUrl.split("/").pop(), { + "content-length": res.headers["content-length"], + data: res.data + }) + } + } + + if (!this.debug) { + this.downloadFile(this.config.gameUrl, null, true, { method: "HEAD" }).then(async (res) => { + const name = (typeof this.config.gameUrl === "string") ? this.config.gameUrl.split("/").pop() : "game"; + const result = await this.storage.rom.get(name); + if (result && result["content-length"] === res.headers["content-length"] && name !== "game") { gotGameData(result.data); return; } - this.downloadFile(this.config.gameUrl, (res) => { - if (res === -1) { - this.startGameError(this.localization('Network Error')); - return; - } - if (this.config.gameUrl instanceof File) { - this.config.gameUrl = this.config.gameUrl.name; - } else if (this.toData(this.config.gameUrl, true)) { - this.config.gameUrl = "game"; - } - gotGameData(res.data); - const limit = (typeof this.config.cacheLimit === "number") ? this.config.cacheLimit : 1073741824; - if (parseFloat(res.headers['content-length']) < limit && this.saveInBrowserSupported() && this.config.gameUrl !== "game") { - this.storage.rom.put(this.config.gameUrl.split("/").pop(), { - "content-length": res.headers['content-length'], - data: res.data - }) - } - }, (progress) => { - this.textElem.innerText = this.localization("Download Game Data") + progress; - }, true, {responseType: "arraybuffer", method: "GET"}); + downloadFile(); }) - }, null, true, {method: "HEAD"}) + } else { + downloadFile(); + } }) } downloadFiles() { (async () => { this.gameManager = new window.EJS_GameManager(this.Module, this); await this.gameManager.loadExternalFiles(); + await this.gameManager.mountFileSystems(); + this.callEvent("saveDatabaseLoaded", this.gameManager.FS); if (this.getCore() === "ppsspp") { await this.gameManager.loadPpssppAssets(); } @@ -989,6 +955,11 @@ class EmulatorJS { })(); } initModule(wasmData, threadData) { + if (typeof window.EJS_Runtime !== "function") { + console.warn("EJS_Runtime is not defined!"); + this.startGameError(this.localization("Error loading EmulatorJS runtime")); + throw new Error("EJS_Runtime is not defined!"); + } window.EJS_Runtime({ noInitialRun: true, onRuntimeInitialized: null, @@ -996,6 +967,8 @@ class EmulatorJS { preRun: [], postRun: [], canvas: this.canvas, + callbacks: {}, + parent: this.elements.parent, print: (msg) => { if (this.debug) { console.log(msg); @@ -1004,30 +977,36 @@ class EmulatorJS { printErr: (msg) => { if (this.debug) { console.log(msg); - } - }, totalDependencies: 0, - monitorRunDependencies: () => {}, - locateFile: function(fileName) { + locateFile: function (fileName) { if (this.debug) console.log(fileName); if (fileName.endsWith(".wasm")) { - return URL.createObjectURL(new Blob([wasmData], {type: "application/wasm"})); + return URL.createObjectURL(new Blob([wasmData], { type: "application/wasm" })); } else if (fileName.endsWith(".worker.js")) { - return URL.createObjectURL(new Blob([threadData], {type: "application/javascript"})); + return URL.createObjectURL(new Blob([threadData], { type: "application/javascript" })); } + }, + getSavExt: () => { + if (this.saveFileExt) { + return "." + this.saveFileExt; + } + return ".srm"; } }).then(module => { this.Module = module; this.downloadFiles(); + }).catch(e => { + console.warn(e); + this.startGameError(this.localization("Failed to start game")); }); } startGame() { try { const args = []; - if (this.debug) args.push('-v'); - args.push('/'+this.fileName); + if (this.debug) args.push("-v"); + args.push("/" + this.fileName); if (this.debug) console.log(args); this.Module.callMain(args); if (typeof this.config.softLoad === "number" && this.config.softLoad > 0) { @@ -1040,7 +1019,7 @@ class EmulatorJS { this.setupDisksMenu(); // hide the disks menu if the disk count is not greater than 1 if (!(this.gameManager.getDiskCount() > 1)) { - this.diskParent.style.display = 'none'; + this.diskParent.style.display = "none"; } this.setupSettingsMenu(); this.loadSettings(); @@ -1051,6 +1030,7 @@ class EmulatorJS { this.textElem.remove(); this.textElem = null; this.game.classList.remove("ejs_game"); + this.game.classList.add("ejs_canvas_parent"); this.game.appendChild(this.canvas); this.handleResize(); this.started = true; @@ -1072,14 +1052,15 @@ class EmulatorJS { this.checkStarted(); } } catch(e) { - console.warn("failed to start game", e); + console.warn("Failed to start game", e); this.startGameError(this.localization("Failed to start game")); + this.callEvent("exit"); return; } this.callEvent("start"); } checkStarted() { - (async() => { + (async () => { let sleep = (ms) => new Promise(r => setTimeout(r, ms)); let state = "suspended"; let popup; @@ -1118,13 +1099,13 @@ class EmulatorJS { }) this.addEventListener(window, "resize", this.handleResize.bind(this)); //this.addEventListener(window, "blur", e => console.log(e), true); //TODO - add "click to make keyboard keys work" message? - + let counter = 0; this.elements.statePopupPanel = this.createPopup("", {}, true); this.elements.statePopupPanel.innerText = this.localization("Drop save state here to load"); this.elements.statePopupPanel.style["text-align"] = "center"; this.elements.statePopupPanel.style["font-size"] = "28px"; - + //to fix a funny apple bug this.addEventListener(window, "webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange", () => { setTimeout(() => { @@ -1132,6 +1113,10 @@ class EmulatorJS { if (this.config.noAutoFocus !== true) this.elements.parent.focus(); }, 0); }); + this.addEventListener(window, "beforeunload", (e) => { + if (!this.started) return; + this.callEvent("exit"); + }); this.addEventListener(this.elements.parent, "dragenter", (e) => { e.preventDefault(); if (!this.started) return; @@ -1155,6 +1140,7 @@ class EmulatorJS { counter = 0; this.elements.statePopupPanel.parentElement.style.display = "none"; }); + this.addEventListener(this.elements.parent, "drop", (e) => { e.preventDefault(); if (!this.started) return; @@ -1162,8 +1148,8 @@ class EmulatorJS { counter = 0; const items = e.dataTransfer.items; let file; - for (let i=0; i { + this.gamepad.on("connected", (e) => { if (!this.gamepadLabels) return; + for (let i = 0; i < this.gamepadSelection.length; i++) { + if (this.gamepadSelection[i] === "") { + this.gamepadSelection[i] = this.gamepad.gamepads[e.gamepadIndex].id + "_" + this.gamepad.gamepads[e.gamepadIndex].index; + break; + } + } this.updateGamepadLabels(); }) - this.gamepad.on('disconnected', (e) => { + this.gamepad.on("disconnected", (e) => { + const gamepadIndex = this.gamepad.gamepads.indexOf(this.gamepad.gamepads.find(f => f.index == e.gamepadIndex)); + const gamepadSelection = this.gamepad.gamepads[gamepadIndex].id + "_" + this.gamepad.gamepads[gamepadIndex].index; + for (let i = 0; i < this.gamepadSelection.length; i++) { + if (this.gamepadSelection[i] === gamepadSelection) { + this.gamepadSelection[i] = ""; + } + } setTimeout(this.updateGamepadLabels.bind(this), 10); }) - this.gamepad.on('axischanged', this.gamepadEvent.bind(this)); - this.gamepad.on('buttondown', this.gamepadEvent.bind(this)); - this.gamepad.on('buttonup', this.gamepadEvent.bind(this)); + this.gamepad.on("axischanged", this.gamepadEvent.bind(this)); + this.gamepad.on("buttondown", this.gamepadEvent.bind(this)); + this.gamepad.on("buttonup", this.gamepadEvent.bind(this)); } checkSupportedOpts() { if (!this.gameManager.supportsStates()) { @@ -1199,12 +1198,19 @@ class EmulatorJS { } } updateGamepadLabels() { - for (let i=0; i', + displayName: "Play" + }, + pause: { + visible: true, + icon: '', + displayName: "Pause" + }, + restart: { + visible: true, + icon: '', + displayName: "Restart" + }, + mute: { + visible: true, + icon: '', + displayName: "Mute" + }, + unmute: { + visible: true, + icon: '', + displayName: "Unmute" + }, + settings: { + visible: true, + icon: '', + displayName: "Settings" + }, + fullscreen: { + visible: true, + icon: "fullscreen", + displayName: "Fullscreen" + }, + enterFullscreen: { + visible: true, + icon: '', + displayName: "Enter Fullscreen" + }, + exitFullscreen: { + visible: true, + icon: '', + displayName: "Exit Fullscreen" + }, + saveState: { + visible: true, + icon: '', + displayName: "Save State" + }, + loadState: { + visible: true, + icon: '', + displayName: "Load State" + }, + screenRecord: { + visible: true + }, + gamepad: { + visible: true, + icon: '', + displayName: "Control Settings" + }, + cheat: { + visible: true, + icon: '', + displayName: "Cheats" + }, + volumeSlider: { + visible: true + }, + saveSavFiles: { + visible: true, + icon: '', + displayName: "Export Save File" + }, + loadSavFiles: { + visible: true, + icon: '', + displayName: "Import Save File" + }, + quickSave: { + visible: true + }, + quickLoad: { + visible: true + }, + screenshot: { + visible: true + }, + cacheManager: { + visible: true, + icon: '', + displayName: "Cache Manager" + }, + exitEmulation: { + visible: true, + icon: '', + displayName: "Exit Emulation" + }, + netplay: { + visible: false, + icon: '', + displayName: "Netplay" + }, + diskButton: { + visible: true, + icon: '', + displayName: "Disks" + }, + contextMenu: { + visible: true, + icon: '', + displayName: "Context Menu" + } + }; + defaultButtonAliases = { + volume: "volumeSlider" + }; + buildButtonOptions(buttonUserOpts) { + let mergedButtonOptions = this.defaultButtonOptions; + + // merge buttonUserOpts with mergedButtonOptions + if (buttonUserOpts) { + for (const key in buttonUserOpts) { + let searchKey = key; + // If the key is an alias, find the actual key in the default buttons + if (this.defaultButtonAliases[key]) { + // Use the alias to find the actual key + // and update the searchKey to the actual key + searchKey = this.defaultButtonAliases[key]; + } + + // Check if the button exists in the default buttons, and update its properties + // If the button does not exist, create a custom button + if (!mergedButtonOptions[searchKey]) { + // If the button does not exist in the default buttons, create a custom button + // Custom buttons must have a displayName, icon, and callback property + if (!buttonUserOpts[searchKey] || !buttonUserOpts[searchKey].displayName || !buttonUserOpts[searchKey].icon || !buttonUserOpts[searchKey].callback) { + console.warn(`Custom button "${searchKey}" is missing required properties`); + continue; + } + + mergedButtonOptions[searchKey] = { + visible: true, + displayName: buttonUserOpts[searchKey].displayName || searchKey, + icon: buttonUserOpts[searchKey].icon || "", + callback: buttonUserOpts[searchKey].callback || (() => { }), + custom: true + }; + } + + // if the value is a boolean, set the visible property to the value + if (typeof buttonUserOpts[searchKey] === "boolean") { + mergedButtonOptions[searchKey].visible = buttonUserOpts[searchKey]; + } else if (typeof buttonUserOpts[searchKey] === "object") { + // If the value is an object, merge it with the default button properties + + // if the button is the contextMenu, only allow the visible property to be set + if (searchKey === "contextMenu") { + mergedButtonOptions[searchKey].visible = buttonUserOpts[searchKey].visible !== undefined ? buttonUserOpts[searchKey].visible : true; + } else if (this.defaultButtonOptions[searchKey]) { + // copy properties from the button definition if they aren't null + for (const prop in buttonUserOpts[searchKey]) { + if (buttonUserOpts[searchKey][prop] !== null) { + mergedButtonOptions[searchKey][prop] = buttonUserOpts[searchKey][prop]; + } + } + } else { + // button was not in the default buttons list and is therefore a custom button + // verify that the value has a displayName, icon, and callback property + if (buttonUserOpts[searchKey].displayName && buttonUserOpts[searchKey].icon && buttonUserOpts[searchKey].callback) { + mergedButtonOptions[searchKey] = { + visible: true, + displayName: buttonUserOpts[searchKey].displayName, + icon: buttonUserOpts[searchKey].icon, + callback: buttonUserOpts[searchKey].callback, + custom: true + }; + } else { + console.warn(`Custom button "${searchKey}" is missing required properties`); + } + } + } + + // behaviour exceptions + switch (searchKey) { + case "playPause": + mergedButtonOptions.play.visible = mergedButtonOptions.playPause.visible; + mergedButtonOptions.pause.visible = mergedButtonOptions.playPause.visible; + break; + + case "mute": + mergedButtonOptions.unmute.visible = mergedButtonOptions.mute.visible; + break; + + case "fullscreen": + mergedButtonOptions.enterFullscreen.visible = mergedButtonOptions.fullscreen.visible; + mergedButtonOptions.exitFullscreen.visible = mergedButtonOptions.fullscreen.visible; + break; + } + } + } + + return mergedButtonOptions; + } createContextMenu() { - this.elements.contextmenu = this.createElement('div'); + this.elements.contextmenu = this.createElement("div"); this.elements.contextmenu.classList.add("ejs_context_menu"); - this.addEventListener(this.game, 'contextmenu', (e) => { + this.addEventListener(this.game, "contextmenu", (e) => { e.preventDefault(); if ((this.config.buttonOpts && this.config.buttonOpts.rightClick === false) || !this.started) return; const parentRect = this.elements.parent.getBoundingClientRect(); this.elements.contextmenu.style.display = "block"; const rect = this.elements.contextmenu.getBoundingClientRect(); - const up = e.offsetY + rect.height > parentRect.bottom - 25; - const left = e.offsetX + rect.width > parentRect.right - 5; + const up = e.offsetY + rect.height > parentRect.height - 25; + const left = e.offsetX + rect.width > parentRect.width - 5; this.elements.contextmenu.style.left = (e.offsetX - (left ? rect.width : 0)) + "px"; this.elements.contextmenu.style.top = (e.offsetY - (up ? rect.height : 0)) + "px"; }) const hideMenu = () => { this.elements.contextmenu.style.display = "none"; } - this.addEventListener(this.elements.contextmenu, 'contextmenu', (e) => e.preventDefault()); - this.addEventListener(this.elements.parent, 'contextmenu', (e) => e.preventDefault()); - this.addEventListener(this.game, 'mousedown', hideMenu); + this.addEventListener(this.elements.contextmenu, "contextmenu", (e) => e.preventDefault()); + this.addEventListener(this.elements.parent, "contextmenu", (e) => e.preventDefault()); + this.addEventListener(this.game, "mousedown touchend", hideMenu); const parent = this.createElement("ul"); const addButton = (title, hidden, functi0n) => { //
  • '+title+'
  • @@ -1247,7 +1465,7 @@ class EmulatorJS { if (hidden) li.hidden = true; const a = this.createElement("a"); if (functi0n instanceof Function) { - this.addEventListener(li, 'click', (e) => { + this.addEventListener(li, "click", (e) => { e.preventDefault(); functi0n(); }); @@ -1263,20 +1481,20 @@ class EmulatorJS { let screenshotUrl; const screenshot = addButton("Take Screenshot", false, () => { if (screenshotUrl) URL.revokeObjectURL(screenshotUrl); - this.gameManager.screenshot().then(screenshot => { - const blob = new Blob([screenshot]); + const date = new Date(); + const fileName = this.getBaseFileName() + "-" + date.getMonth() + "-" + date.getDate() + "-" + date.getFullYear(); + this.screenshot((blob, format) => { screenshotUrl = URL.createObjectURL(blob); const a = this.createElement("a"); a.href = screenshotUrl; - const date = new Date(); - a.download = this.getBaseFileName()+"-"+date.getMonth()+"-"+date.getDate()+"-"+date.getFullYear()+".png"; + a.download = fileName + "." + format; a.click(); hideMenu(); }); }); let screenMediaRecorder = null; - const startScreenRecording = addButton("Start screen recording", false, () => { + const startScreenRecording = addButton("Start Screen Recording", false, () => { if (screenMediaRecorder !== null) { screenMediaRecorder.stop(); } @@ -1285,7 +1503,7 @@ class EmulatorJS { stopScreenRecording.removeAttribute("hidden"); hideMenu(); }); - const stopScreenRecording = addButton("Stop screen recording", true, () => { + const stopScreenRecording = addButton("Stop Screen Recording", true, () => { if (screenMediaRecorder !== null) { screenMediaRecorder.stop(); screenMediaRecorder = null; @@ -1296,15 +1514,18 @@ class EmulatorJS { }); const qSave = addButton("Quick Save", false, () => { - const slot = this.settings['save-state-slot'] ? this.settings['save-state-slot'] : "1"; - this.gameManager.quickSave(slot); - this.displayMessage(this.localization("SAVED STATE TO SLOT")+" "+slot); + const slot = this.getSettingValue("save-state-slot") ? this.getSettingValue("save-state-slot") : "1"; + if (this.gameManager.quickSave(slot)) { + this.displayMessage(this.localization("SAVED STATE TO SLOT") + " " + slot); + } else { + this.displayMessage(this.localization("FAILED TO SAVE STATE")); + } hideMenu(); }); const qLoad = addButton("Quick Load", false, () => { - const slot = this.settings['save-state-slot'] ? this.settings['save-state-slot'] : "1"; + const slot = this.getSettingValue("save-state-slot") ? this.getSettingValue("save-state-slot") : "1"; this.gameManager.quickLoad(slot); - this.displayMessage(this.localization("LOADED STATE FROM SLOT")+" "+slot); + this.displayMessage(this.localization("LOADED STATE FROM SLOT") + " " + slot); hideMenu(); }); this.elements.contextMenu = { @@ -1314,15 +1535,18 @@ class EmulatorJS { save: qSave, load: qLoad } - addButton("EmulatorJS v"+this.ejs_version, false, () => { + addButton("EmulatorJS v" + this.ejs_version, false, () => { hideMenu(); const body = this.createPopup("EmulatorJS", { "Close": () => { this.closePopup(); } }); - - const menu = this.createElement('div'); + + body.style.display = "flex"; + + const menu = this.createElement("div"); + body.appendChild(menu); menu.classList.add("ejs_list_selector"); const parent = this.createElement("ul"); const addButton = (title, hidden, functi0n) => { @@ -1330,9 +1554,9 @@ class EmulatorJS { if (hidden) li.hidden = true; const a = this.createElement("a"); if (functi0n instanceof Function) { - this.addEventListener(li, 'click', (e) => { + this.addEventListener(li, "click", (e) => { e.preventDefault(); - functi0n(); + functi0n(li); }); } a.href = "#"; @@ -1355,12 +1579,16 @@ class EmulatorJS { body.appendChild(license); body.appendChild(retroarch); body.appendChild(coreLicense); - - let current = home; - home.innerText = "EmulatorJS v"+this.ejs_version; + + home.innerText = "EmulatorJS v" + this.ejs_version; home.appendChild(this.createElement("br")); home.appendChild(this.createElement("br")); + home.classList.add("ejs_context_menu_tab"); + license.classList.add("ejs_context_menu_tab"); + retroarch.classList.add("ejs_context_menu_tab"); + coreLicense.classList.add("ejs_context_menu_tab"); + this.createLink(home, "https://github.com/EmulatorJS/EmulatorJS", "View on GitHub", true); this.createLink(home, "https://discord.gg/6akryGkETU", "Join the discord", true); @@ -1383,34 +1611,37 @@ class EmulatorJS { home.appendChild(this.createElement("br")); menu.appendChild(parent); - body.appendChild(menu); - const setElem = (element) => { + let current = home; + const setElem = (element, li) => { if (current === element) return; if (current) { current.style.display = "none"; } + let activeLi = li.parentElement.querySelector(".ejs_active_list_element"); + if (activeLi) { + activeLi.classList.remove("ejs_active_list_element"); + } + li.classList.add("ejs_active_list_element"); current = element; element.style.display = ""; } - addButton("Home", false, () => { - setElem(home); - }) - addButton("EmulatorJS License", false, () => { - setElem(license); - }) - addButton("RetroArch License", false, () => { - setElem(retroarch); - }) + addButton("Home", false, (li) => { + setElem(home, li); + }).classList.add("ejs_active_list_element"); + addButton("EmulatorJS License", false, (li) => { + setElem(license, li); + }); + addButton("RetroArch License", false, (li) => { + setElem(retroarch, li); + }); if (this.coreName && this.license) { - addButton(this.coreName + " License", false, () => { - setElem(coreLicense); + addButton(this.coreName + " License", false, (li) => { + setElem(coreLicense, li); }) - coreLicense.style['text-align'] = "center"; - coreLicense.style['padding'] = "10px"; coreLicense.innerText = this.license; } //Todo - Contributors. - + retroarch.innerText = this.localization("This project is powered by") + " "; const a = this.createElement("a"); a.href = "https://github.com/libretro/RetroArch"; @@ -1423,50 +1654,47 @@ class EmulatorJS { licenseLink.innerText = this.localization("View the RetroArch license here"); a.appendChild(this.createElement("br")); a.appendChild(licenseLink); - - license.style['text-align'] = "center"; - license.style['padding'] = "10px"; - //license.style["white-space"] = "pre-wrap"; - license.innerText = ' GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. \n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n Preamble\n\n The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works. By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users. We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors. You can apply it to\nyour programs, too.\n\n When we speak of free software, we are referring to freedom, not\nprice. Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights. Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received. You must make sure that they, too, receive\nor can get the source code. And you must show them these terms so they\nknow their rights.\n\n Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n For the developers\' and authors\' protection, the GPL clearly explains\nthat there is no warranty for this free software. For both users\' and\nauthors\' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so. This is fundamentally incompatible with the aim of\nprotecting users\' freedom to change the software. The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable. Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts. If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary. To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n The precise terms and conditions for copying, distribution and\nmodification follow.\n\n TERMS AND CONDITIONS\n\n 0. Definitions.\n\n "This License" refers to version 3 of the GNU General Public License.\n\n "Copyright" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n "The Program" refers to any copyrightable work licensed under this\nLicense. Each licensee is addressed as "you". "Licensees" and\n"recipients" may be individuals or organizations.\n\n To "modify" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy. The resulting work is called a "modified version" of the\nearlier work or a work "based on" the earlier work.\n\n A "covered work" means either the unmodified Program or a work based\non the Program.\n\n To "propagate" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy. Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n To "convey" a work means any kind of propagation that enables other\nparties to make or receive copies. Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n An interactive user interface displays "Appropriate Legal Notices"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License. If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n 1. Source Code.\n\n The "source code" for a work means the preferred form of the work\nfor making modifications to it. "Object code" means any non-source\nform of a work.\n\n A "Standard Interface" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n The "System Libraries" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form. A\n"Major Component", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n The "Corresponding Source" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities. However, it does not include the work\'s\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work. For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n The Corresponding Source for a work in source code form is that\nsame work.\n\n 2. Basic Permissions.\n\n All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met. This License explicitly affirms your unlimited\npermission to run the unmodified Program. The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work. This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force. You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright. Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n Conveying under any other circumstances is permitted solely under\nthe conditions stated below. Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n 3. Protecting Users\' Legal Rights From Anti-Circumvention Law.\n\n No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work\'s\nusers, your or third parties\' legal rights to forbid circumvention of\ntechnological measures.\n\n 4. Conveying Verbatim Copies.\n\n You may convey verbatim copies of the Program\'s source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n 5. Conveying Modified Source Versions.\n\n You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n a) The work must carry prominent notices stating that you modified\n it, and giving a relevant date.\n\n b) The work must carry prominent notices stating that it is\n released under this License and any conditions added under section\n 7. This requirement modifies the requirement in section 4 to\n "keep intact all notices".\n\n c) You must license the entire work, as a whole, under this\n License to anyone who comes into possession of a copy. This\n License will therefore apply, along with any applicable section 7\n additional terms, to the whole of the work, and all its parts,\n regardless of how they are packaged. This License gives no\n permission to license the work in any other way, but it does not\n invalidate such permission if you have separately received it.\n\n d) If the work has interactive user interfaces, each must display\n Appropriate Legal Notices; however, if the Program has interactive\n interfaces that do not display Appropriate Legal Notices, your\n work need not make them do so.\n\n A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n"aggregate" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation\'s users\nbeyond what the individual works permit. Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n 6. Conveying Non-Source Forms.\n\n You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n a) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by the\n Corresponding Source fixed on a durable physical medium\n customarily used for software interchange.\n\n b) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by a\n written offer, valid for at least three years and valid for as\n long as you offer spare parts or customer support for that product\n model, to give anyone who possesses the object code either (1) a\n copy of the Corresponding Source for all the software in the\n product that is covered by this License, on a durable physical\n medium customarily used for software interchange, for a price no\n more than your reasonable cost of physically performing this\n conveying of source, or (2) access to copy the\n Corresponding Source from a network server at no charge.\n\n c) Convey individual copies of the object code with a copy of the\n written offer to provide the Corresponding Source. This\n alternative is allowed only occasionally and noncommercially, and\n only if you received the object code with such an offer, in accord\n with subsection 6b.\n\n d) Convey the object code by offering access from a designated\n place (gratis or for a charge), and offer equivalent access to the\n Corresponding Source in the same way through the same place at no\n further charge. You need not require recipients to copy the\n Corresponding Source along with the object code. If the place to\n copy the object code is a network server, the Corresponding Source\n may be on a different server (operated by you or a third party)\n that supports equivalent copying facilities, provided you maintain\n clear directions next to the object code saying where to find the\n Corresponding Source. Regardless of what server hosts the\n Corresponding Source, you remain obligated to ensure that it is\n available for as long as needed to satisfy these requirements.\n\n e) Convey the object code using peer-to-peer transmission, provided\n you inform other peers where the object code and Corresponding\n Source of the work are being offered to the general public at no\n charge under subsection 6d.\n\n A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n A "User Product" is either (1) a "consumer product", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling. In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage. For a particular\nproduct received by a particular user, "normally used" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product. A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n "Installation Information" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source. The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information. But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed. Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n 7. Additional Terms.\n\n "Additional permissions" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law. If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit. (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.) You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n a) Disclaiming warranty or limiting liability differently from the\n terms of sections 15 and 16 of this License; or\n\n b) Requiring preservation of specified reasonable legal notices or\n author attributions in that material or in the Appropriate Legal\n Notices displayed by works containing it; or\n\n c) Prohibiting misrepresentation of the origin of that material, or\n requiring that modified versions of such material be marked in\n reasonable ways as different from the original version; or\n\n d) Limiting the use for publicity purposes of names of licensors or\n authors of the material; or\n\n e) Declining to grant rights under trademark law for use of some\n trade names, trademarks, or service marks; or\n\n f) Requiring indemnification of licensors and authors of that\n material by anyone who conveys the material (or modified versions of\n it) with contractual assumptions of liability to the recipient, for\n any liability that these contractual assumptions directly impose on\n those licensors and authors.\n\n All other non-permissive additional terms are considered "further\nrestrictions" within the meaning of section 10. If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term. If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n 8. Termination.\n\n You may not propagate or modify a covered work except as expressly\nprovided under this License. Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License. If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n 9. Acceptance Not Required for Having Copies.\n\n You are not required to accept this License in order to receive or\nrun a copy of the Program. Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance. However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work. These actions infringe copyright if you do\nnot accept this License. Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n 10. Automatic Licensing of Downstream Recipients.\n\n Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License. You are not responsible\nfor enforcing compliance by third parties with this License.\n\n An "entity transaction" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations. If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party\'s predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License. For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n 11. Patents.\n\n A "contributor" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based. The\nwork thus licensed is called the contributor\'s "contributor version".\n\n A contributor\'s "essential patent claims" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version. For\npurposes of this definition, "control" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor\'s essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n In the following three paragraphs, a "patent license" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement). To "grant" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients. "Knowingly relying" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient\'s use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n A patent license is "discriminatory" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License. You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n 12. No Surrender of Others\' Freedom.\n\n If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License. If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all. For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n 13. Use with the GNU Affero General Public License.\n\n Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work. The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n 14. Revised Versions of this License.\n\n The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time. Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n Each version is given a distinguishing version number. If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License "or any later version" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation. If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy\'s\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n Later license versions may give you additional or different\npermissions. However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n 15. Disclaimer of Warranty.\n\n THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n 16. Limitation of Liability.\n\n IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n 17. Interpretation of Sections 15 and 16.\n\n If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n END OF TERMS AND CONDITIONS\n\n How to Apply These Terms to Your New Programs\n\n If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n To do so, attach the following notices to the program. It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe "copyright" line and a pointer to where the full notice is found.\n\n EmulatorJS: RetroArch on the web\n Copyright (C) 2023 Ethan O\'Brien\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see .\n\nAlso add information on how to contact you by electronic and paper mail.\n\n If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n EmulatorJS Copyright (C) 2023 Ethan O\'Brien\n This program comes with ABSOLUTELY NO WARRANTY; for details type `show w\'.\n This is free software, and you are welcome to redistribute it\n under certain conditions; type `show c\' for details.\n\nThe hypothetical commands `show w\' and `show c\' should show the appropriate\nparts of the General Public License. Of course, your program\'s commands\nmight be different; for a GUI interface, you would use an "about box".\n\n You should also get your employer (if you work as a programmer) or school,\nif any, to sign a "copyright disclaimer" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n.\n\n The GNU General Public License does not permit incorporating your program\ninto proprietary programs. If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library. If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License. But first, please read\n.\n'; + + license.innerText = ' GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. \n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n Preamble\n\n The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works. By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users. We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors. You can apply it to\nyour programs, too.\n\n When we speak of free software, we are referring to freedom, not\nprice. Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights. Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received. You must make sure that they, too, receive\nor can get the source code. And you must show them these terms so they\nknow their rights.\n\n Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n For the developers\' and authors\' protection, the GPL clearly explains\nthat there is no warranty for this free software. For both users\' and\nauthors\' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so. This is fundamentally incompatible with the aim of\nprotecting users\' freedom to change the software. The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable. Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts. If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary. To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n The precise terms and conditions for copying, distribution and\nmodification follow.\n\n TERMS AND CONDITIONS\n\n 0. Definitions.\n\n "This License" refers to version 3 of the GNU General Public License.\n\n "Copyright" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n "The Program" refers to any copyrightable work licensed under this\nLicense. Each licensee is addressed as "you". "Licensees" and\n"recipients" may be individuals or organizations.\n\n To "modify" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy. The resulting work is called a "modified version" of the\nearlier work or a work "based on" the earlier work.\n\n A "covered work" means either the unmodified Program or a work based\non the Program.\n\n To "propagate" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy. Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n To "convey" a work means any kind of propagation that enables other\nparties to make or receive copies. Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n An interactive user interface displays "Appropriate Legal Notices"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License. If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n 1. Source Code.\n\n The "source code" for a work means the preferred form of the work\nfor making modifications to it. "Object code" means any non-source\nform of a work.\n\n A "Standard Interface" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n The "System Libraries" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form. A\n"Major Component", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n The "Corresponding Source" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities. However, it does not include the work\'s\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work. For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n The Corresponding Source for a work in source code form is that\nsame work.\n\n 2. Basic Permissions.\n\n All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met. This License explicitly affirms your unlimited\npermission to run the unmodified Program. The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work. This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force. You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright. Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n Conveying under any other circumstances is permitted solely under\nthe conditions stated below. Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n 3. Protecting Users\' Legal Rights From Anti-Circumvention Law.\n\n No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work\'s\nusers, your or third parties\' legal rights to forbid circumvention of\ntechnological measures.\n\n 4. Conveying Verbatim Copies.\n\n You may convey verbatim copies of the Program\'s source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n 5. Conveying Modified Source Versions.\n\n You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n a) The work must carry prominent notices stating that you modified\n it, and giving a relevant date.\n\n b) The work must carry prominent notices stating that it is\n released under this License and any conditions added under section\n 7. This requirement modifies the requirement in section 4 to\n "keep intact all notices".\n\n c) You must license the entire work, as a whole, under this\n License to anyone who comes into possession of a copy. This\n License will therefore apply, along with any applicable section 7\n additional terms, to the whole of the work, and all its parts,\n regardless of how they are packaged. This License gives no\n permission to license the work in any other way, but it does not\n invalidate such permission if you have separately received it.\n\n d) If the work has interactive user interfaces, each must display\n Appropriate Legal Notices; however, if the Program has interactive\n interfaces that do not display Appropriate Legal Notices, your\n work need not make them do so.\n\n A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n"aggregate" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation\'s users\nbeyond what the individual works permit. Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n 6. Conveying Non-Source Forms.\n\n You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n a) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by the\n Corresponding Source fixed on a durable physical medium\n customarily used for software interchange.\n\n b) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by a\n written offer, valid for at least three years and valid for as\n long as you offer spare parts or customer support for that product\n model, to give anyone who possesses the object code either (1) a\n copy of the Corresponding Source for all the software in the\n product that is covered by this License, on a durable physical\n medium customarily used for software interchange, for a price no\n more than your reasonable cost of physically performing this\n conveying of source, or (2) access to copy the\n Corresponding Source from a network server at no charge.\n\n c) Convey individual copies of the object code with a copy of the\n written offer to provide the Corresponding Source. This\n alternative is allowed only occasionally and noncommercially, and\n only if you received the object code with such an offer, in accord\n with subsection 6b.\n\n d) Convey the object code by offering access from a designated\n place (gratis or for a charge), and offer equivalent access to the\n Corresponding Source in the same way through the same place at no\n further charge. You need not require recipients to copy the\n Corresponding Source along with the object code. If the place to\n copy the object code is a network server, the Corresponding Source\n may be on a different server (operated by you or a third party)\n that supports equivalent copying facilities, provided you maintain\n clear directions next to the object code saying where to find the\n Corresponding Source. Regardless of what server hosts the\n Corresponding Source, you remain obligated to ensure that it is\n available for as long as needed to satisfy these requirements.\n\n e) Convey the object code using peer-to-peer transmission, provided\n you inform other peers where the object code and Corresponding\n Source of the work are being offered to the general public at no\n charge under subsection 6d.\n\n A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n A "User Product" is either (1) a "consumer product", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling. In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage. For a particular\nproduct received by a particular user, "normally used" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product. A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n "Installation Information" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source. The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information. But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed. Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n 7. Additional Terms.\n\n "Additional permissions" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law. If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit. (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.) You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n a) Disclaiming warranty or limiting liability differently from the\n terms of sections 15 and 16 of this License; or\n\n b) Requiring preservation of specified reasonable legal notices or\n author attributions in that material or in the Appropriate Legal\n Notices displayed by works containing it; or\n\n c) Prohibiting misrepresentation of the origin of that material, or\n requiring that modified versions of such material be marked in\n reasonable ways as different from the original version; or\n\n d) Limiting the use for publicity purposes of names of licensors or\n authors of the material; or\n\n e) Declining to grant rights under trademark law for use of some\n trade names, trademarks, or service marks; or\n\n f) Requiring indemnification of licensors and authors of that\n material by anyone who conveys the material (or modified versions of\n it) with contractual assumptions of liability to the recipient, for\n any liability that these contractual assumptions directly impose on\n those licensors and authors.\n\n All other non-permissive additional terms are considered "further\nrestrictions" within the meaning of section 10. If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term. If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n 8. Termination.\n\n You may not propagate or modify a covered work except as expressly\nprovided under this License. Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License. If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n 9. Acceptance Not Required for Having Copies.\n\n You are not required to accept this License in order to receive or\nrun a copy of the Program. Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance. However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work. These actions infringe copyright if you do\nnot accept this License. Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n 10. Automatic Licensing of Downstream Recipients.\n\n Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License. You are not responsible\nfor enforcing compliance by third parties with this License.\n\n An "entity transaction" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations. If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party\'s predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License. For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n 11. Patents.\n\n A "contributor" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based. The\nwork thus licensed is called the contributor\'s "contributor version".\n\n A contributor\'s "essential patent claims" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version. For\npurposes of this definition, "control" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor\'s essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n In the following three paragraphs, a "patent license" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement). To "grant" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients. "Knowingly relying" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient\'s use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n A patent license is "discriminatory" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License. You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n 12. No Surrender of Others\' Freedom.\n\n If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License. If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all. For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n 13. Use with the GNU Affero General Public License.\n\n Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work. The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n 14. Revised Versions of this License.\n\n The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time. Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n Each version is given a distinguishing version number. If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License "or any later version" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation. If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy\'s\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n Later license versions may give you additional or different\npermissions. However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n 15. Disclaimer of Warranty.\n\n THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n 16. Limitation of Liability.\n\n IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n 17. Interpretation of Sections 15 and 16.\n\n If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n END OF TERMS AND CONDITIONS\n\n How to Apply These Terms to Your New Programs\n\n If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n To do so, attach the following notices to the program. It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe "copyright" line and a pointer to where the full notice is found.\n\n EmulatorJS: RetroArch on the web\n Copyright (C) 2022-2024 Ethan O\'Brien\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see .\n\nAlso add information on how to contact you by electronic and paper mail.\n\n If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n EmulatorJS Copyright (C) 2023-2025 Ethan O\'Brien\n This program comes with ABSOLUTELY NO WARRANTY; for details type `show w\'.\n This is free software, and you are welcome to redistribute it\n under certain conditions; type `show c\' for details.\n\nThe hypothetical commands `show w\' and `show c\' should show the appropriate\nparts of the General Public License. Of course, your program\'s commands\nmight be different; for a GUI interface, you would use an "about box".\n\n You should also get your employer (if you work as a programmer) or school,\nif any, to sign a "copyright disclaimer" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n.\n\n The GNU General Public License does not permit incorporating your program\ninto proprietary programs. If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library. If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License. But first, please read\n.\n'; }); - + if (this.config.buttonOpts) { - if (this.config.buttonOpts.screenshot === false) screenshot.setAttribute("hidden", ""); - if (this.config.buttonOpts.screenRecord === false) startScreenRecording.setAttribute("hidden", ""); - if (this.config.buttonOpts.quickSave === false) qSave.setAttribute("hidden", ""); - if (this.config.buttonOpts.quickLoad === false) qLoad.setAttribute("hidden", ""); + if (this.config.buttonOpts.screenshot.visible === false) screenshot.setAttribute("hidden", ""); + if (this.config.buttonOpts.screenRecord.visible === false) startScreenRecording.setAttribute("hidden", ""); + if (this.config.buttonOpts.quickSave.visible === false) qSave.setAttribute("hidden", ""); + if (this.config.buttonOpts.quickLoad.visible === false) qLoad.setAttribute("hidden", ""); } - + this.elements.contextmenu.appendChild(parent); - + this.elements.parent.appendChild(this.elements.contextmenu); } closePopup() { if (this.currentPopup !== null) { try { this.currentPopup.remove(); - } catch(e){} + } catch(e) {} this.currentPopup = null; } } //creates a full box popup. createPopup(popupTitle, buttons, hidden) { if (!hidden) this.closePopup(); - const popup = this.createElement('div'); + const popup = this.createElement("div"); popup.classList.add("ejs_popup_container"); this.elements.parent.appendChild(popup); const title = this.createElement("h4"); title.innerText = this.localization(popupTitle); const main = this.createElement("div"); main.classList.add("ejs_popup_body"); - + popup.appendChild(title); popup.appendChild(main); - + const padding = this.createElement("div"); padding.style["padding-top"] = "10px"; popup.appendChild(padding); - + for (let k in buttons) { const button = this.createElement("a"); if (buttons[k] instanceof Function) { @@ -1484,7 +1712,7 @@ class EmulatorJS { } else { popup.style.display = "none"; } - + return main; } selectFile() { @@ -1506,7 +1734,7 @@ class EmulatorJS { if (first === second) return true; - if (adown.contains) { + if (adown.contains) { return adown.contains(second); } @@ -1514,7 +1742,7 @@ class EmulatorJS { } createBottomMenuBar() { this.elements.menu = this.createElement("div"); - + //prevent weird glitch on some devices this.elements.menu.style.opacity = 0; this.on("start", (e) => { @@ -1522,22 +1750,20 @@ class EmulatorJS { }) this.elements.menu.classList.add("ejs_menu_bar"); this.elements.menu.classList.add("ejs_menu_bar_hidden"); - + let timeout = null; let ignoreEvents = false; const hide = () => { if (this.paused || this.settingsMenuOpen || this.disksMenuOpen) return; this.elements.menu.classList.add("ejs_menu_bar_hidden"); } - - this.addEventListener(this.elements.parent, 'mousemove click', (e) => { - if (e.pointerType === "touch") return; - if (!this.started || ignoreEvents || document.pointerLockElement === this.canvas) return; - if (this.isPopupOpen()) return; + + const show = () => { clearTimeout(timeout); timeout = setTimeout(hide, 3000); this.elements.menu.classList.remove("ejs_menu_bar_hidden"); - }) + } + this.menu = { close: () => { clearTimeout(timeout); @@ -1555,11 +1781,48 @@ class EmulatorJS { if (this.elements.menu.classList.contains("ejs_menu_bar_hidden")) { timeout = setTimeout(hide, 3000); } - this.elements.menu.classList.toggle("ejs_menu_bar_hidden"); + this.elements.menu.classList.toggle("ejs_menu_bar_hidden"); + } + } + + this.createBottomMenuBarListeners = () => { + const clickListener = (e) => { + if (e.pointerType === "touch") return; + if (!this.started || ignoreEvents || document.pointerLockElement === this.canvas) return; + if (this.isPopupOpen()) return; + show(); + } + const mouseListener = (e) => { + if (!this.started || ignoreEvents || document.pointerLockElement === this.canvas) return; + if (this.isPopupOpen()) return; + const deltaX = e.movementX; + const deltaY = e.movementY; + const threshold = this.elements.menu.offsetHeight + 30; + const mouseY = e.clientY; + + if (mouseY >= window.innerHeight - threshold) { + show(); + return; + } + let angle = Math.atan2(deltaY, deltaX) * (180 / Math.PI); + if (angle < 0) angle += 360; + if (angle < 85 || angle > 95) return; + show(); } + if (this.menu.mousemoveListener) this.removeEventListener(this.menu.mousemoveListener); + + if ((this.preGetSetting("menubarBehavior") || "downward") === "downward") { + this.menu.mousemoveListener = this.addEventListener(this.elements.parent, "mousemove", mouseListener); + } else { + this.menu.mousemoveListener = this.addEventListener(this.elements.parent, "mousemove", clickListener); + } + + this.addEventListener(this.elements.parent, "click", clickListener); } + this.createBottomMenuBarListeners(); + this.elements.parent.appendChild(this.elements.menu); - + let tmout; this.addEventListener(this.elements.parent, "mousedown touchstart", (e) => { if (this.isChild(this.elements.menu, e.target) || this.isChild(this.elements.menuToggle, e.target)) return; @@ -1573,22 +1836,21 @@ class EmulatorJS { ignoreEvents = true; this.menu.close(); }) - - + let paddingSet = false; //Now add buttons - const addButton = (title, image, callback, element, both) => { + const addButton = (buttonConfig, callback, element, both) => { const button = this.createElement("button"); button.type = "button"; - const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); + const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"); svg.setAttribute("role", "presentation"); svg.setAttribute("focusable", "false"); - svg.innerHTML = image; + svg.innerHTML = buttonConfig.icon; const text = this.createElement("span"); - text.innerText = this.localization(title); + text.innerText = this.localization(buttonConfig.displayName); if (paddingSet) text.classList.add("ejs_menu_text_right"); text.classList.add("ejs_menu_text"); - + button.classList.add("ejs_menu_button"); button.appendChild(svg); button.appendChild(text); @@ -1598,34 +1860,38 @@ class EmulatorJS { this.elements.menu.appendChild(button); } if (callback instanceof Function) { - this.addEventListener(button, 'click', callback); + this.addEventListener(button, "click", callback); + } + + if (buttonConfig.callback instanceof Function) { + this.addEventListener(button, "click", buttonConfig.callback); } return both ? [button, svg, text] : button; } - const restartButton = addButton("Restart", '', () => { + const restartButton = addButton(this.config.buttonOpts.restart, () => { if (this.isNetplay && this.netplay.owner) { this.gameManager.restart(); this.netplay.reset(); - this.netplay.sendMessage({restart:true}); + this.netplay.sendMessage({ restart: true }); this.play(); } else if (!this.isNetplay) { this.gameManager.restart(); } }); - const pauseButton = addButton("Pause", '', () => { + const pauseButton = addButton(this.config.buttonOpts.pause, () => { if (this.isNetplay && this.netplay.owner) { this.pause(); this.gameManager.saveSaveFiles(); - this.netplay.sendMessage({pause:true}); + this.netplay.sendMessage({ pause: true }); } else if (!this.isNetplay) { this.pause(); } }); - const playButton = addButton("Play", '', () => { + const playButton = addButton(this.config.buttonOpts.play, () => { if (this.isNetplay && this.netplay.owner) { this.play(); - this.netplay.sendMessage({play:true}); + this.netplay.sendMessage({ play: true }); } else if (!this.isNetplay) { this.play(); } @@ -1643,9 +1909,9 @@ class EmulatorJS { } } this.gameManager.toggleMainLoop(this.paused ? 0 : 1); - + //I now realize its not easy to pause it while the cursor is locked, just in case I guess - if (this.defaultCoreOpts.supportsMouse) { + if (this.enableMouseLock) { if (this.canvas.exitPointerLock) { this.canvas.exitPointerLock(); } else if (this.canvas.mozExitPointerLock) { @@ -1659,33 +1925,41 @@ class EmulatorJS { this.pause = (dontUpdate) => { if (!this.paused) this.togglePlaying(dontUpdate); } - + let stateUrl; - const saveState = addButton("Save State", '', async () => { - const state = this.gameManager.getState(); + const saveState = addButton(this.config.buttonOpts.saveState, async () => { + let state; + try { + state = this.gameManager.getState(); + } catch(e) { + this.displayMessage(this.localization("FAILED TO SAVE STATE")); + return; + } + const { screenshot, format } = await this.takeScreenshot(this.capture.photo.source, this.capture.photo.format, this.capture.photo.upscale); const called = this.callEvent("saveState", { - screenshot: await this.gameManager.screenshot(), + screenshot: screenshot, + format: format, state: state }); if (called > 0) return; if (stateUrl) URL.revokeObjectURL(stateUrl); - if (this.settings['save-state-location'] === "browser" && this.saveInBrowserSupported()) { - this.storage.states.put(this.getBaseFileName()+".state", state); + if (this.getSettingValue("save-state-location") === "browser" && this.saveInBrowserSupported()) { + this.storage.states.put(this.getBaseFileName() + ".state", state); this.displayMessage(this.localization("SAVE SAVED TO BROWSER")); } else { const blob = new Blob([state]); stateUrl = URL.createObjectURL(blob); const a = this.createElement("a"); a.href = stateUrl; - a.download = this.getBaseFileName()+".state"; + a.download = this.getBaseFileName() + ".state"; a.click(); } }); - const loadState = addButton("Load State", '', async () => { + const loadState = addButton(this.config.buttonOpts.loadState, async () => { const called = this.callEvent("loadState"); if (called > 0) return; - if (this.settings['save-state-location'] === "browser" && this.saveInBrowserSupported()) { - this.storage.states.get(this.getBaseFileName()+".state").then(e => { + if (this.getSettingValue("save-state-location") === "browser" && this.saveInBrowserSupported()) { + this.storage.states.get(this.getBaseFileName() + ".state").then(e => { this.gameManager.loadState(e); this.displayMessage(this.localization("SAVE LOADED FROM BROWSER")); }) @@ -1695,24 +1969,27 @@ class EmulatorJS { this.gameManager.loadState(state); } }); - const controlMenu = addButton("Control Settings", '', () => { + const controlMenu = addButton(this.config.buttonOpts.gamepad, () => { this.controlMenu.style.display = ""; }); - const cheatMenu = addButton("Cheats", '', () => { + const cheatMenu = addButton(this.config.buttonOpts.cheat, () => { this.cheatMenu.style.display = ""; }); - - const cache = addButton("Cache Manager", '', () => { + + const cache = addButton(this.config.buttonOpts.cacheManager, () => { this.openCacheMenu(); }); + if (this.config.disableDatabases) cache.style.display = "none"; - + let savUrl; - - const saveSavFiles = addButton("Export Save File", '', async () => { + + const saveSavFiles = addButton(this.config.buttonOpts.saveSavFiles, async () => { const file = await this.gameManager.getSaveFile(); + const { screenshot, format } = await this.takeScreenshot(this.capture.photo.source, this.capture.photo.format, this.capture.photo.upscale); const called = this.callEvent("saveSave", { - screenshot: await this.gameManager.screenshot(), + screenshot: screenshot, + format: format, save: file }); if (called > 0) return; @@ -1723,7 +2000,7 @@ class EmulatorJS { a.download = this.gameManager.getSaveFilePath().split("/").pop(); a.click(); }); - const loadSavFiles = addButton("Import Save File", '', async () => { + const loadSavFiles = addButton(this.config.buttonOpts.loadSavFiles, async () => { const called = this.callEvent("loadSave"); if (called > 0) return; const file = await this.selectFile(); @@ -1731,33 +2008,43 @@ class EmulatorJS { const path = this.gameManager.getSaveFilePath(); const paths = path.split("/"); let cp = ""; - for (let i=0; i', async () => { + const netplay = addButton(this.config.buttonOpts.netplay, async () => { this.openNetplayMenu(); }); + // add custom buttons + // get all elements from this.config.buttonOpts with custom: true + if (this.config.buttonOpts) { + for (const [key, value] of Object.entries(this.config.buttonOpts)) { + if (value.custom === true) { + const customBtn = addButton(value); + } + } + } + const spacer = this.createElement("span"); spacer.classList.add("ejs_menu_bar_spacer"); this.elements.menu.appendChild(spacer); paddingSet = true; - + const volumeSettings = this.createElement("div"); volumeSettings.classList.add("ejs_volume_parent"); - const muteButton = addButton("Mute", '', () => { + const muteButton = addButton(this.config.buttonOpts.mute, () => { muteButton.style.display = "none"; unmuteButton.style.display = ""; this.muted = true; this.setVolume(0); }, volumeSettings); - const unmuteButton = addButton("Unmute", '', () => { + const unmuteButton = addButton(this.config.buttonOpts.unmute, () => { if (this.volume === 0) this.volume = 0.5; muteButton.style.display = ""; unmuteButton.style.display = "none"; @@ -1765,7 +2052,7 @@ class EmulatorJS { this.setVolume(this.volume); }, volumeSettings); unmuteButton.style.display = "none"; - + const volumeSlider = this.createElement("input"); volumeSlider.setAttribute("data-range", "volume"); volumeSlider.setAttribute("type", "range"); @@ -1777,14 +2064,14 @@ class EmulatorJS { volumeSlider.setAttribute("aria-label", "Volume"); volumeSlider.setAttribute("aria-valuemin", 0); volumeSlider.setAttribute("aria-valuemax", 100); - + this.setVolume = (volume) => { this.saveSettings(); this.muted = (volume === 0); volumeSlider.value = volume; - volumeSlider.setAttribute("aria-valuenow", volume*100); - volumeSlider.setAttribute("aria-valuetext", (volume*100).toFixed(1) + "%"); - volumeSlider.setAttribute("style", "--value: "+volume*100+"%;margin-left: 5px;position: relative;z-index: 2;"); + volumeSlider.setAttribute("aria-valuenow", volume * 100); + volumeSlider.setAttribute("aria-valuetext", (volume * 100).toFixed(1) + "%"); + volumeSlider.setAttribute("style", "--value: " + volume * 100 + "%;margin-left: 5px;position: relative;z-index: 2;"); if (this.Module.AL && this.Module.AL.currentCtx && this.Module.AL.currentCtx.sources) { this.Module.AL.currentCtx.sources.forEach(e => { e.gain.gain.value = volume; @@ -1795,7 +2082,7 @@ class EmulatorJS { muteButton.style.display = (volume === 0) ? "none" : ""; } } - + this.addEventListener(volumeSlider, "change mousemove touchmove mousedown touchstart mouseup", (e) => { setTimeout(() => { const newVal = parseFloat(volumeSlider.value); @@ -1811,21 +2098,21 @@ class EmulatorJS { this.elements.menu.appendChild(volumeSettings); - const contextMenuButton = addButton("Context Menu", '', () => { + const contextMenuButton = addButton(this.config.buttonOpts.contextMenu, () => { if (this.elements.contextmenu.style.display === "none") { this.elements.contextmenu.style.display = "block"; - this.elements.contextmenu.style.left = (getComputedStyle(this.elements.parent).width.split("px")[0]/2 - getComputedStyle(this.elements.contextmenu).width.split("px")[0]/2)+"px"; - this.elements.contextmenu.style.top = (getComputedStyle(this.elements.parent).height.split("px")[0]/2 - getComputedStyle(this.elements.contextmenu).height.split("px")[0]/2)+"px"; + this.elements.contextmenu.style.left = (getComputedStyle(this.elements.parent).width.split("px")[0] / 2 - getComputedStyle(this.elements.contextmenu).width.split("px")[0] / 2) + "px"; + this.elements.contextmenu.style.top = (getComputedStyle(this.elements.parent).height.split("px")[0] / 2 - getComputedStyle(this.elements.contextmenu).height.split("px")[0] / 2) + "px"; setTimeout(this.menu.close.bind(this), 20); } else { this.elements.contextmenu.style.display = "none"; } }); - + this.diskParent = this.createElement("div"); this.diskParent.id = "ejs_disksMenu"; this.disksMenuOpen = false; - const diskButton = addButton("Disks", '', () => { + const diskButton = addButton(this.config.buttonOpts.diskButton, () => { this.disksMenuOpen = !this.disksMenuOpen; diskButton[1].classList.toggle("ejs_svg_rotate", this.disksMenuOpen); this.disksMenu.style.display = this.disksMenuOpen ? "" : "none"; @@ -1848,7 +2135,7 @@ class EmulatorJS { this.settingParent = this.createElement("div"); this.settingsMenuOpen = false; - const settingButton = addButton("Settings", '', () => { + const settingButton = addButton(this.config.buttonOpts.settings, () => { this.settingsMenuOpen = !this.settingsMenuOpen; settingButton[1].classList.toggle("ejs_svg_rotate", this.settingsMenuOpen); this.settingsMenu.style.display = this.settingsMenuOpen ? "" : "none"; @@ -1871,7 +2158,7 @@ class EmulatorJS { this.addEventListener(this.canvas, "click", (e) => { if (e.pointerType === "touch") return; - if (this.defaultCoreOpts.supportsMouse && !this.paused) { + if (this.enableMouseLock && !this.paused) { if (this.canvas.requestPointerLock) { this.canvas.requestPointerLock(); } else if (this.canvas.mozRequestPointerLock) { @@ -1880,15 +2167,15 @@ class EmulatorJS { this.menu.close(); } }) - - const enter = addButton("Enter Fullscreen", '', () => { + + const enter = addButton(this.config.buttonOpts.enterFullscreen, () => { this.toggleFullscreen(true); }); - const exit = addButton("Exit Fullscreen", '', () => { + const exit = addButton(this.config.buttonOpts.exitFullscreen, () => { this.toggleFullscreen(false); }); exit.style.display = "none"; - + this.toggleFullscreen = (fullscreen) => { if (fullscreen) { if (this.elements.parent.requestFullscreen) { @@ -1928,7 +2215,7 @@ class EmulatorJS { } let exitMenuIsOpen = false; - const exitEmulation = addButton("Exit EmulatorJS", '', async () => { + const exitEmulation = addButton(this.config.buttonOpts.exitEmulation, async () => { if (exitMenuIsOpen) return; exitMenuIsOpen = true; const popups = this.createSubPopup(); @@ -1981,8 +2268,7 @@ class EmulatorJS { }) setTimeout(this.menu.close.bind(this), 20); }); - - + this.addEventListener(document, "webkitfullscreenchange mozfullscreenchange fullscreenchange", (e) => { if (e.target !== this.elements.parent) return; if (document.fullscreenElement === null) { @@ -1994,14 +2280,14 @@ class EmulatorJS { enter.style.display = "none"; } }) - + const hasFullscreen = !!(this.elements.parent.requestFullscreen || this.elements.parent.mozRequestFullScreen || this.elements.parent.webkitRequestFullscreen || this.elements.parent.msRequestFullscreen); - + if (!hasFullscreen) { exit.style.display = "none"; enter.style.display = "none"; } - + this.elements.bottomBar = { playPause: [pauseButton, playButton], restart: [restartButton], @@ -2018,36 +2304,35 @@ class EmulatorJS { netplay: [netplay], exit: [exitEmulation] } - - + if (this.config.buttonOpts) { if (this.debug) console.log(this.config.buttonOpts); - if (this.config.buttonOpts.playPause === false) { + if (this.config.buttonOpts.playPause.visible === false) { pauseButton.style.display = "none"; playButton.style.display = "none"; } - if (this.config.buttonOpts.contextMenuButton === false && this.config.buttonOpts.rightClick !== false && this.isMobile === false) contextMenuButton.style.display = "none" - if (this.config.buttonOpts.restart === false) restartButton.style.display = "none" - if (this.config.buttonOpts.settings === false) settingButton[0].style.display = "none" - if (this.config.buttonOpts.fullscreen === false) { + if (this.config.buttonOpts.contextMenu.visible === false && this.config.buttonOpts.rightClick !== false && this.isMobile === false) contextMenuButton.style.display = "none" + if (this.config.buttonOpts.restart.visible === false) restartButton.style.display = "none" + if (this.config.buttonOpts.settings.visible === false) settingButton[0].style.display = "none" + if (this.config.buttonOpts.fullscreen.visible === false) { enter.style.display = "none"; exit.style.display = "none"; } - if (this.config.buttonOpts.mute === false) { + if (this.config.buttonOpts.mute.visible === false) { muteButton.style.display = "none"; unmuteButton.style.display = "none"; } - if (this.config.buttonOpts.saveState === false) saveState.style.display = "none"; - if (this.config.buttonOpts.loadState === false) loadState.style.display = "none"; - if (this.config.buttonOpts.saveSavFiles === false) saveSavFiles.style.display = "none"; - if (this.config.buttonOpts.loadSavFiles === false) loadSavFiles.style.display = "none"; - if (this.config.buttonOpts.gamepad === false) controlMenu.style.display = "none"; - if (this.config.buttonOpts.cheat === false) cheatMenu.style.display = "none"; - if (this.config.buttonOpts.cacheManager === false) cache.style.display = "none"; - if (this.config.buttonOpts.netplay === false) netplay.style.display = "none"; - if (this.config.buttonOpts.diskButton === false) diskButton[0].style.display = "none"; - if (this.config.buttonOpts.volumeSlider === false) volumeSlider.style.display = "none"; - if (this.config.buttonOpts.exitEmulation === false) exitEmulation.style.display = "none"; + if (this.config.buttonOpts.saveState.visible === false) saveState.style.display = "none"; + if (this.config.buttonOpts.loadState.visible === false) loadState.style.display = "none"; + if (this.config.buttonOpts.saveSavFiles.visible === false) saveSavFiles.style.display = "none"; + if (this.config.buttonOpts.loadSavFiles.visible === false) loadSavFiles.style.display = "none"; + if (this.config.buttonOpts.gamepad.visible === false) controlMenu.style.display = "none"; + if (this.config.buttonOpts.cheat.visible === false) cheatMenu.style.display = "none"; + if (this.config.buttonOpts.cacheManager.visible === false) cache.style.display = "none"; + if (this.config.buttonOpts.netplay.visible === false) netplay.style.display = "none"; + if (this.config.buttonOpts.diskButton.visible === false) diskButton[0].style.display = "none"; + if (this.config.buttonOpts.volumeSlider.visible === false) volumeSlider.style.display = "none"; + if (this.config.buttonOpts.exitEmulation.visible === false) exitEmulation.style.display = "none"; } this.menu.failedToStart = () => { @@ -2078,6 +2363,9 @@ class EmulatorJS { exitEmulation.style.display = "none"; this.elements.menu.style.opacity = ""; + this.elements.menu.style.background = "transparent"; + this.virtualGamepad.style.display = "none"; + settingButton[0].classList.add("shadow"); this.menu.open(true); } } @@ -2103,12 +2391,12 @@ class EmulatorJS { list.style["text-align"] = "left"; body.appendChild(list); list.appendChild(tbody); - const getSize = function(size) { + const getSize = function (size) { let i = -1; do { size /= 1024, i++; } while (size > 1024); - return Math.max(size, 0.1).toFixed(1) + [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB'][i]; + return Math.max(size, 0.1).toFixed(1) + [" kB", " MB", " GB", " TB", "PB", "EB", "ZB", "YB"][i]; } for (const k in roms) { const line = this.createElement("tr"); @@ -2118,7 +2406,7 @@ class EmulatorJS { remove.style.cursor = "pointer"; name.innerText = k; size.innerText = getSize(roms[k]); - + const a = this.createElement("a"); a.innerText = this.localization("Remove"); this.addEventListener(remove, "click", () => { @@ -2126,17 +2414,16 @@ class EmulatorJS { line.remove(); }) remove.appendChild(a); - + line.appendChild(name); line.appendChild(size); line.appendChild(remove); tbody.appendChild(line); } - })(); } getControlScheme() { - if (this.config.controlScheme && typeof this.config.controlScheme === 'string') { + if (this.config.controlScheme && typeof this.config.controlScheme === "string") { return this.config.controlScheme; } else { return this.getCore(true); @@ -2146,6 +2433,7 @@ class EmulatorJS { let buttonListeners = []; this.checkGamepadInputs = () => buttonListeners.forEach(elem => elem()); this.gamepadLabels = []; + this.gamepadSelection = []; this.controls = JSON.parse(JSON.stringify(this.defaultControllers)); const body = this.createPopup("Control Settings", { "Reset": () => { @@ -2155,7 +2443,7 @@ class EmulatorJS { this.saveSettings(); }, "Clear": () => { - this.controls = {0:{},1:{},2:{},3:{}}; + this.controls = { 0: {}, 1: {}, 2: {}, 3: {} }; this.setupKeys(); this.checkGamepadInputs(); this.saveSettings(); @@ -2167,351 +2455,374 @@ class EmulatorJS { this.setupKeys(); this.controlMenu = body.parentElement; body.classList.add("ejs_control_body"); - + let buttons; if ("gb" === this.getControlScheme()) { buttons = [ - {id: 8, label: this.localization('A')}, - {id: 0, label: this.localization('B')}, - {id: 2, label: this.localization('SELECT')}, - {id: 3, label: this.localization('START')}, - {id: 4, label: this.localization('UP')}, - {id: 5, label: this.localization('DOWN')}, - {id: 6, label: this.localization('LEFT')}, - {id: 7, label: this.localization('RIGHT')}, + { id: 8, label: this.localization("A") }, + { id: 0, label: this.localization("B") }, + { id: 2, label: this.localization("SELECT") }, + { id: 3, label: this.localization("START") }, + { id: 4, label: this.localization("UP") }, + { id: 5, label: this.localization("DOWN") }, + { id: 6, label: this.localization("LEFT") }, + { id: 7, label: this.localization("RIGHT") }, ]; } else if ("nes" === this.getControlScheme()) { buttons = [ - {id: 8, label: this.localization('A')}, - {id: 0, label: this.localization('B')}, - {id: 2, label: this.localization('SELECT')}, - {id: 3, label: this.localization('START')}, - {id: 4, label: this.localization('UP')}, - {id: 5, label: this.localization('DOWN')}, - {id: 6, label: this.localization('LEFT')}, - {id: 7, label: this.localization('RIGHT')}, - {id: 10, label: this.localization('EJECT')},//Famicon games only - {id: 11, label: this.localization('SWAP DISKS')}, + { id: 8, label: this.localization("A") }, + { id: 0, label: this.localization("B") }, + { id: 2, label: this.localization("SELECT") }, + { id: 3, label: this.localization("START") }, + { id: 4, label: this.localization("UP") }, + { id: 5, label: this.localization("DOWN") }, + { id: 6, label: this.localization("LEFT") }, + { id: 7, label: this.localization("RIGHT") }, ]; - } else if ('snes' === this.getControlScheme()) { + if (this.getCore() === "nestopia") { + buttons.push({ id: 10, label: this.localization("SWAP DISKS") }); + } else { + buttons.push({ id: 10, label: this.localization("SWAP DISKS") }); + buttons.push({ id: 11, label: this.localization("EJECT/INSERT DISK") }); + } + } else if ("snes" === this.getControlScheme()) { + buttons = [ + { id: 8, label: this.localization("A") }, + { id: 0, label: this.localization("B") }, + { id: 9, label: this.localization("X") }, + { id: 1, label: this.localization("Y") }, + { id: 2, label: this.localization("SELECT") }, + { id: 3, label: this.localization("START") }, + { id: 4, label: this.localization("UP") }, + { id: 5, label: this.localization("DOWN") }, + { id: 6, label: this.localization("LEFT") }, + { id: 7, label: this.localization("RIGHT") }, + { id: 10, label: this.localization("L") }, + { id: 11, label: this.localization("R") }, + ]; + } else if ("n64" === this.getControlScheme()) { buttons = [ - {id: 8, label: this.localization('A')}, - {id: 0, label: this.localization('B')}, - {id: 9, label: this.localization('X')}, - {id: 1, label: this.localization('Y')}, - {id: 2, label: this.localization('SELECT')}, - {id: 3, label: this.localization('START')}, - {id: 4, label: this.localization('UP')}, - {id: 5, label: this.localization('DOWN')}, - {id: 6, label: this.localization('LEFT')}, - {id: 7, label: this.localization('RIGHT')}, - {id: 10, label: this.localization('L')}, - {id: 11, label: this.localization('R')}, + { id: 0, label: this.localization("A") }, + { id: 1, label: this.localization("B") }, + { id: 3, label: this.localization("START") }, + { id: 4, label: this.localization("D-PAD UP") }, + { id: 5, label: this.localization("D-PAD DOWN") }, + { id: 6, label: this.localization("D-PAD LEFT") }, + { id: 7, label: this.localization("D-PAD RIGHT") }, + { id: 10, label: this.localization("L") }, + { id: 11, label: this.localization("R") }, + { id: 12, label: this.localization("Z") }, + { id: 19, label: this.localization("STICK UP") }, + { id: 18, label: this.localization("STICK DOWN") }, + { id: 17, label: this.localization("STICK LEFT") }, + { id: 16, label: this.localization("STICK RIGHT") }, + { id: 23, label: this.localization("C-PAD UP") }, + { id: 22, label: this.localization("C-PAD DOWN") }, + { id: 21, label: this.localization("C-PAD LEFT") }, + { id: 20, label: this.localization("C-PAD RIGHT") }, ]; - } else if ('n64' === this.getControlScheme()) { + } else if ("gba" === this.getControlScheme()) { buttons = [ - {id: 0, label: this.localization('A')}, - {id: 1, label: this.localization('B')}, - {id: 3, label: this.localization('START')}, - {id: 4, label: this.localization('D-PAD UP')}, - {id: 5, label: this.localization('D-PAD DOWN')}, - {id: 6, label: this.localization('D-PAD LEFT')}, - {id: 7, label: this.localization('D-PAD RIGHT')}, - {id: 10, label: this.localization('L')}, - {id: 11, label: this.localization('R')}, - {id: 12, label: this.localization('Z')}, - {id: 19, label: this.localization('STICK UP')}, - {id: 18, label: this.localization('STICK DOWN')}, - {id: 17, label: this.localization('STICK LEFT')}, - {id: 16, label: this.localization('STICK RIGHT')}, - {id: 23, label: this.localization('C-PAD UP')}, - {id: 22, label: this.localization('C-PAD DOWN')}, - {id: 21, label: this.localization('C-PAD LEFT')}, - {id: 20, label: this.localization('C-PAD RIGHT')}, + { id: 8, label: this.localization("A") }, + { id: 0, label: this.localization("B") }, + { id: 10, label: this.localization("L") }, + { id: 11, label: this.localization("R") }, + { id: 2, label: this.localization("SELECT") }, + { id: 3, label: this.localization("START") }, + { id: 4, label: this.localization("UP") }, + { id: 5, label: this.localization("DOWN") }, + { id: 6, label: this.localization("LEFT") }, + { id: 7, label: this.localization("RIGHT") }, ]; - } else if ('gba' === this.getControlScheme()) { + } else if ("nds" === this.getControlScheme()) { buttons = [ - {id: 8, label: this.localization('A')}, - {id: 0, label: this.localization('B')}, - {id: 10, label: this.localization('L')}, - {id: 11, label: this.localization('R')}, - {id: 2, label: this.localization('SELECT')}, - {id: 3, label: this.localization('START')}, - {id: 4, label: this.localization('UP')}, - {id: 5, label: this.localization('DOWN')}, - {id: 6, label: this.localization('LEFT')}, - {id: 7, label: this.localization('RIGHT')}, + { id: 8, label: this.localization("A") }, + { id: 0, label: this.localization("B") }, + { id: 9, label: this.localization("X") }, + { id: 1, label: this.localization("Y") }, + { id: 2, label: this.localization("SELECT") }, + { id: 3, label: this.localization("START") }, + { id: 4, label: this.localization("UP") }, + { id: 5, label: this.localization("DOWN") }, + { id: 6, label: this.localization("LEFT") }, + { id: 7, label: this.localization("RIGHT") }, + { id: 10, label: this.localization("L") }, + { id: 11, label: this.localization("R") }, + { id: 14, label: this.localization("Microphone") }, ]; - } else if ('nds' === this.getControlScheme()) { + } else if ("vb" === this.getControlScheme()) { buttons = [ - {id: 8, label: this.localization('A')}, - {id: 0, label: this.localization('B')}, - {id: 9, label: this.localization('X')}, - {id: 1, label: this.localization('Y')}, - {id: 2, label: this.localization('SELECT')}, - {id: 3, label: this.localization('START')}, - {id: 4, label: this.localization('UP')}, - {id: 5, label: this.localization('DOWN')}, - {id: 6, label: this.localization('LEFT')}, - {id: 7, label: this.localization('RIGHT')}, - {id: 10, label: this.localization('L')}, - {id: 11, label: this.localization('R')}, - {id: 14, label: this.localization('Microphone')}, + { id: 8, label: this.localization("A") }, + { id: 0, label: this.localization("B") }, + { id: 10, label: this.localization("L") }, + { id: 11, label: this.localization("R") }, + { id: 2, label: this.localization("SELECT") }, + { id: 3, label: this.localization("START") }, + { id: 4, label: this.localization("LEFT D-PAD UP") }, + { id: 5, label: this.localization("LEFT D-PAD DOWN") }, + { id: 6, label: this.localization("LEFT D-PAD LEFT") }, + { id: 7, label: this.localization("LEFT D-PAD RIGHT") }, + { id: 19, label: this.localization("RIGHT D-PAD UP") }, + { id: 18, label: this.localization("RIGHT D-PAD DOWN") }, + { id: 17, label: this.localization("RIGHT D-PAD LEFT") }, + { id: 16, label: this.localization("RIGHT D-PAD RIGHT") }, ]; - } else if ('vb' === this.getControlScheme()) { + } else if (["segaCD", "sega32x"].includes(this.getControlScheme())) { buttons = [ - {id: 8, label: this.localization('A')}, - {id: 0, label: this.localization('B')}, - {id: 10, label: this.localization('L')}, - {id: 11, label: this.localization('R')}, - {id: 2, label: this.localization('SELECT')}, - {id: 3, label: this.localization('START')}, - {id: 4, label: this.localization('LEFT D-PAD UP')}, - {id: 5, label: this.localization('LEFT D-PAD DOWN')}, - {id: 6, label: this.localization('LEFT D-PAD LEFT')}, - {id: 7, label: this.localization('LEFT D-PAD RIGHT')}, - {id: 19, label: this.localization('RIGHT D-PAD UP')}, - {id: 18, label: this.localization('RIGHT D-PAD DOWN')}, - {id: 17, label: this.localization('RIGHT D-PAD LEFT')}, - {id: 16, label: this.localization('RIGHT D-PAD RIGHT')}, + { id: 1, label: this.localization("A") }, + { id: 0, label: this.localization("B") }, + { id: 8, label: this.localization("C") }, + { id: 10, label: this.localization("X") }, + { id: 9, label: this.localization("Y") }, + { id: 11, label: this.localization("Z") }, + { id: 3, label: this.localization("START") }, + { id: 2, label: this.localization("MODE") }, + { id: 4, label: this.localization("UP") }, + { id: 5, label: this.localization("DOWN") }, + { id: 6, label: this.localization("LEFT") }, + { id: 7, label: this.localization("RIGHT") }, ]; - } else if (['segaMD', 'segaCD', 'sega32x'].includes(this.getControlScheme())) { + } else if ("segaMS" === this.getControlScheme()) { buttons = [ - {id: 1, label: this.localization('A')}, - {id: 0, label: this.localization('B')}, - {id: 8, label: this.localization('C')}, - {id: 10, label: this.localization('X')}, - {id: 9, label: this.localization('Y')}, - {id: 11, label: this.localization('Z')}, - {id: 3, label: this.localization('START')}, - {id: 2, label: this.localization('MODE')}, - {id: 4, label: this.localization('UP')}, - {id: 5, label: this.localization('DOWN')}, - {id: 6, label: this.localization('LEFT')}, - {id: 7, label: this.localization('RIGHT')}, + { id: 0, label: this.localization("BUTTON 1 / START") }, + { id: 8, label: this.localization("BUTTON 2") }, + { id: 4, label: this.localization("UP") }, + { id: 5, label: this.localization("DOWN") }, + { id: 6, label: this.localization("LEFT") }, + { id: 7, label: this.localization("RIGHT") }, ]; - } else if ('segaMS' === this.getControlScheme()) { + } else if ("segaGG" === this.getControlScheme()) { buttons = [ - {id: 0, label: this.localization('BUTTON 1 / START')}, - {id: 8, label: this.localization('BUTTON 2')}, - {id: 4, label: this.localization('UP')}, - {id: 5, label: this.localization('DOWN')}, - {id: 6, label: this.localization('LEFT')}, - {id: 7, label: this.localization('RIGHT')}, + { id: 0, label: this.localization("BUTTON 1") }, + { id: 8, label: this.localization("BUTTON 2") }, + { id: 3, label: this.localization("START") }, + { id: 4, label: this.localization("UP") }, + { id: 5, label: this.localization("DOWN") }, + { id: 6, label: this.localization("LEFT") }, + { id: 7, label: this.localization("RIGHT") }, ]; - } else if ('segaGG' === this.getControlScheme()) { + } else if ("segaSaturn" === this.getControlScheme()) { buttons = [ - {id: 0, label: this.localization('BUTTON 1')}, - {id: 8, label: this.localization('BUTTON 2')}, - {id: 3, label: this.localization('START')}, - {id: 4, label: this.localization('UP')}, - {id: 5, label: this.localization('DOWN')}, - {id: 6, label: this.localization('LEFT')}, - {id: 7, label: this.localization('RIGHT')}, + { id: 1, label: this.localization("A") }, + { id: 0, label: this.localization("B") }, + { id: 8, label: this.localization("C") }, + { id: 9, label: this.localization("X") }, + { id: 10, label: this.localization("Y") }, + { id: 11, label: this.localization("Z") }, + { id: 12, label: this.localization("L") }, + { id: 13, label: this.localization("R") }, + { id: 3, label: this.localization("START") }, + { id: 4, label: this.localization("UP") }, + { id: 5, label: this.localization("DOWN") }, + { id: 6, label: this.localization("LEFT") }, + { id: 7, label: this.localization("RIGHT") }, ]; - } else if ('segaSaturn' === this.getControlScheme()) { + } else if ("3do" === this.getControlScheme()) { buttons = [ - {id: 1, label: this.localization('A')}, - {id: 0, label: this.localization('B')}, - {id: 8, label: this.localization('C')}, - {id: 9, label: this.localization('X')}, - {id: 10, label: this.localization('Y')}, - {id: 11, label: this.localization('Z')}, - {id: 12, label: this.localization('L')}, - {id: 13, label: this.localization('R')}, - {id: 3, label: this.localization('START')}, - {id: 4, label: this.localization('UP')}, - {id: 5, label: this.localization('DOWN')}, - {id: 6, label: this.localization('LEFT')}, - {id: 7, label: this.localization('RIGHT')}, + { id: 1, label: this.localization("A") }, + { id: 0, label: this.localization("B") }, + { id: 8, label: this.localization("C") }, + { id: 10, label: this.localization("L") }, + { id: 11, label: this.localization("R") }, + { id: 2, label: this.localization("X") }, + { id: 3, label: this.localization("P") }, + { id: 4, label: this.localization("UP") }, + { id: 5, label: this.localization("DOWN") }, + { id: 6, label: this.localization("LEFT") }, + { id: 7, label: this.localization("RIGHT") }, ]; - } else if ('3do' === this.getControlScheme()) { + } else if ("atari2600" === this.getControlScheme()) { buttons = [ - {id: 1, label: this.localization('A')}, - {id: 0, label: this.localization('B')}, - {id: 8, label: this.localization('C')}, - {id: 10, label: this.localization('L')}, - {id: 11, label: this.localization('R')}, - {id: 2, label: this.localization('X')}, - {id: 3, label: this.localization('P')}, - {id: 4, label: this.localization('UP')}, - {id: 5, label: this.localization('DOWN')}, - {id: 6, label: this.localization('LEFT')}, - {id: 7, label: this.localization('RIGHT')}, + { id: 0, label: this.localization("FIRE") }, + { id: 2, label: this.localization("SELECT") }, + { id: 3, label: this.localization("RESET") }, + { id: 4, label: this.localization("UP") }, + { id: 5, label: this.localization("DOWN") }, + { id: 6, label: this.localization("LEFT") }, + { id: 7, label: this.localization("RIGHT") }, + { id: 10, label: this.localization("LEFT DIFFICULTY A") }, + { id: 12, label: this.localization("LEFT DIFFICULTY B") }, + { id: 11, label: this.localization("RIGHT DIFFICULTY A") }, + { id: 13, label: this.localization("RIGHT DIFFICULTY B") }, + { id: 14, label: this.localization("COLOR") }, + { id: 15, label: this.localization("B/W") }, ]; - } else if ('atari2600' === this.getControlScheme()) { + } else if ("atari7800" === this.getControlScheme()) { buttons = [ - {id: 0, label: this.localization('FIRE')}, - {id: 2, label: this.localization('SELECT')}, - {id: 3, label: this.localization('RESET')}, - {id: 4, label: this.localization('UP')}, - {id: 5, label: this.localization('DOWN')}, - {id: 6, label: this.localization('LEFT')}, - {id: 7, label: this.localization('RIGHT')}, - {id: 10, label: this.localization('LEFT DIFFICULTY A')}, - {id: 12, label: this.localization('LEFT DIFFICULTY B')}, - {id: 11, label: this.localization('RIGHT DIFFICULTY A')}, - {id: 13, label: this.localization('RIGHT DIFFICULTY B')}, - {id: 14, label: this.localization('COLOR')}, - {id: 15, label: this.localization('B/W')}, + { id: 0, label: this.localization("BUTTON 1") }, + { id: 8, label: this.localization("BUTTON 2") }, + { id: 2, label: this.localization("SELECT") }, + { id: 3, label: this.localization("PAUSE") }, + { id: 9, label: this.localization("RESET") }, + { id: 4, label: this.localization("UP") }, + { id: 5, label: this.localization("DOWN") }, + { id: 6, label: this.localization("LEFT") }, + { id: 7, label: this.localization("RIGHT") }, + { id: 10, label: this.localization("LEFT DIFFICULTY") }, + { id: 11, label: this.localization("RIGHT DIFFICULTY") }, ]; - } else if ('atari7800' === this.getControlScheme()) { + } else if ("lynx" === this.getControlScheme()) { buttons = [ - {id: 0, label: this.localization('BUTTON 1')}, - {id: 8, label: this.localization('BUTTON 2')}, - {id: 2, label: this.localization('SELECT')}, - {id: 3, label: this.localization('PAUSE')}, - {id: 9, label: this.localization('RESET')}, - {id: 4, label: this.localization('UP')}, - {id: 5, label: this.localization('DOWN')}, - {id: 6, label: this.localization('LEFT')}, - {id: 7, label: this.localization('RIGHT')}, - {id: 10, label: this.localization('LEFT DIFFICULTY')}, - {id: 11, label: this.localization('RIGHT DIFFICULTY')}, + { id: 8, label: this.localization("A") }, + { id: 0, label: this.localization("B") }, + { id: 10, label: this.localization("OPTION 1") }, + { id: 11, label: this.localization("OPTION 2") }, + { id: 3, label: this.localization("START") }, + { id: 4, label: this.localization("UP") }, + { id: 5, label: this.localization("DOWN") }, + { id: 6, label: this.localization("LEFT") }, + { id: 7, label: this.localization("RIGHT") }, ]; - } else if ('lynx' === this.getControlScheme()) { + } else if ("jaguar" === this.getControlScheme()) { buttons = [ - {id: 8, label: this.localization('A')}, - {id: 0, label: this.localization('B')}, - {id: 10, label: this.localization('OPTION 1')}, - {id: 11, label: this.localization('OPTION 2')}, - {id: 3, label: this.localization('START')}, - {id: 4, label: this.localization('UP')}, - {id: 5, label: this.localization('DOWN')}, - {id: 6, label: this.localization('LEFT')}, - {id: 7, label: this.localization('RIGHT')}, + { id: 8, label: this.localization("A") }, + { id: 0, label: this.localization("B") }, + { id: 1, label: this.localization("C") }, + { id: 2, label: this.localization("PAUSE") }, + { id: 3, label: this.localization("OPTION") }, + { id: 4, label: this.localization("UP") }, + { id: 5, label: this.localization("DOWN") }, + { id: 6, label: this.localization("LEFT") }, + { id: 7, label: this.localization("RIGHT") }, ]; - } else if ('jaguar' === this.getControlScheme()) { + } else if ("pce" === this.getControlScheme()) { buttons = [ - {id: 8, label: this.localization('A')}, - {id: 0, label: this.localization('B')}, - {id: 1, label: this.localization('C')}, - {id: 2, label: this.localization('PAUSE')}, - {id: 3, label: this.localization('OPTION')}, - {id: 4, label: this.localization('UP')}, - {id: 5, label: this.localization('DOWN')}, - {id: 6, label: this.localization('LEFT')}, - {id: 7, label: this.localization('RIGHT')}, + { id: 8, label: this.localization("I") }, + { id: 0, label: this.localization("II") }, + { id: 2, label: this.localization("SELECT") }, + { id: 3, label: this.localization("RUN") }, + { id: 4, label: this.localization("UP") }, + { id: 5, label: this.localization("DOWN") }, + { id: 6, label: this.localization("LEFT") }, + { id: 7, label: this.localization("RIGHT") }, ]; - } else if ('pce' === this.getControlScheme()) { + } else if ("ngp" === this.getControlScheme()) { buttons = [ - {id: 8, label: this.localization('I')}, - {id: 0, label: this.localization('II')}, - {id: 2, label: this.localization('SELECT')}, - {id: 3, label: this.localization('RUN')}, - {id: 4, label: this.localization('UP')}, - {id: 5, label: this.localization('DOWN')}, - {id: 6, label: this.localization('LEFT')}, - {id: 7, label: this.localization('RIGHT')}, + { id: 0, label: this.localization("A") }, + { id: 8, label: this.localization("B") }, + { id: 3, label: this.localization("OPTION") }, + { id: 4, label: this.localization("UP") }, + { id: 5, label: this.localization("DOWN") }, + { id: 6, label: this.localization("LEFT") }, + { id: 7, label: this.localization("RIGHT") }, ]; - } else if ('ngp' === this.getControlScheme()) { + } else if ("ws" === this.getControlScheme()) { buttons = [ - {id: 0, label: this.localization('A')}, - {id: 8, label: this.localization('B')}, - {id: 3, label: this.localization('OPTION')}, - {id: 4, label: this.localization('UP')}, - {id: 5, label: this.localization('DOWN')}, - {id: 6, label: this.localization('LEFT')}, - {id: 7, label: this.localization('RIGHT')}, + { id: 8, label: this.localization("A") }, + { id: 0, label: this.localization("B") }, + { id: 3, label: this.localization("START") }, + { id: 4, label: this.localization("X UP") }, + { id: 5, label: this.localization("X DOWN") }, + { id: 6, label: this.localization("X LEFT") }, + { id: 7, label: this.localization("X RIGHT") }, + { id: 13, label: this.localization("Y UP") }, + { id: 12, label: this.localization("Y DOWN") }, + { id: 10, label: this.localization("Y LEFT") }, + { id: 11, label: this.localization("Y RIGHT") }, ]; - } else if ('ws' === this.getControlScheme()) { + } else if ("coleco" === this.getControlScheme()) { buttons = [ - {id: 8, label: this.localization('A')}, - {id: 0, label: this.localization('B')}, - {id: 3, label: this.localization('START')}, - {id: 4, label: this.localization('X UP')}, - {id: 5, label: this.localization('X DOWN')}, - {id: 6, label: this.localization('X LEFT')}, - {id: 7, label: this.localization('X RIGHT')}, - {id: 13, label: this.localization('Y UP')}, - {id: 12, label: this.localization('Y DOWN')}, - {id: 10, label: this.localization('Y LEFT')}, - {id: 11, label: this.localization('Y RIGHT')}, + { id: 8, label: this.localization("LEFT BUTTON") }, + { id: 0, label: this.localization("RIGHT BUTTON") }, + { id: 9, label: this.localization("1") }, + { id: 1, label: this.localization("2") }, + { id: 11, label: this.localization("3") }, + { id: 10, label: this.localization("4") }, + { id: 13, label: this.localization("5") }, + { id: 12, label: this.localization("6") }, + { id: 15, label: this.localization("7") }, + { id: 14, label: this.localization("8") }, + { id: 2, label: this.localization("*") }, + { id: 3, label: this.localization("#") }, + { id: 4, label: this.localization("UP") }, + { id: 5, label: this.localization("DOWN") }, + { id: 6, label: this.localization("LEFT") }, + { id: 7, label: this.localization("RIGHT") }, ]; - } else if ('coleco' === this.getControlScheme()) { + } else if ("pcfx" === this.getControlScheme()) { buttons = [ - {id: 8, label: this.localization('LEFT BUTTON')}, - {id: 0, label: this.localization('RIGHT BUTTON')}, - {id: 9, label: this.localization('1')}, - {id: 1, label: this.localization('2')}, - {id: 11, label: this.localization('3')}, - {id: 10, label: this.localization('4')}, - {id: 13, label: this.localization('5')}, - {id: 12, label: this.localization('6')}, - {id: 15, label: this.localization('7')}, - {id: 14, label: this.localization('8')}, - {id: 2, label: this.localization('*')}, - {id: 3, label: this.localization('#')}, - {id: 4, label: this.localization('UP')}, - {id: 5, label: this.localization('DOWN')}, - {id: 6, label: this.localization('LEFT')}, - {id: 7, label: this.localization('RIGHT')}, + { id: 8, label: this.localization("I") }, + { id: 0, label: this.localization("II") }, + { id: 9, label: this.localization("III") }, + { id: 1, label: this.localization("IV") }, + { id: 10, label: this.localization("V") }, + { id: 11, label: this.localization("VI") }, + { id: 3, label: this.localization("RUN") }, + { id: 2, label: this.localization("SELECT") }, + { id: 12, label: this.localization("MODE1") }, + { id: 13, label: this.localization("MODE2") }, + { id: 4, label: this.localization("UP") }, + { id: 5, label: this.localization("DOWN") }, + { id: 6, label: this.localization("LEFT") }, + { id: 7, label: this.localization("RIGHT") }, ]; - } else if ('pcfx' === this.getControlScheme()) { + } else if ("psp" === this.getControlScheme()) { buttons = [ - {id: 8, label: this.localization('I')}, - {id: 0, label: this.localization('II')}, - {id: 9, label: this.localization('III')}, - {id: 1, label: this.localization('IV')}, - {id: 10, label: this.localization('V')}, - {id: 11, label: this.localization('VI')}, - {id: 3, label: this.localization('RUN')}, - {id: 2, label: this.localization('SELECT')}, - {id: 12, label: this.localization('MODE1')}, - {id: 13, label: this.localization('MODE2')}, - {id: 4, label: this.localization('UP')}, - {id: 5, label: this.localization('DOWN')}, - {id: 6, label: this.localization('LEFT')}, - {id: 7, label: this.localization('RIGHT')}, + { id: 9, label: this.localization("\u25B3") }, // △ + { id: 1, label: this.localization("\u25A1") }, // □ + { id: 0, label: this.localization("\uFF58") }, // x + { id: 8, label: this.localization("\u25CB") }, // ○ + { id: 2, label: this.localization("SELECT") }, + { id: 3, label: this.localization("START") }, + { id: 4, label: this.localization("UP") }, + { id: 5, label: this.localization("DOWN") }, + { id: 6, label: this.localization("LEFT") }, + { id: 7, label: this.localization("RIGHT") }, + { id: 10, label: this.localization("L") }, + { id: 11, label: this.localization("R") }, + { id: 19, label: this.localization("STICK UP") }, + { id: 18, label: this.localization("STICK DOWN") }, + { id: 17, label: this.localization("STICK LEFT") }, + { id: 16, label: this.localization("STICK RIGHT") }, ]; } else { buttons = [ - {id: 0, label: this.localization('B')}, - {id: 1, label: this.localization('Y')}, - {id: 2, label: this.localization('SELECT')}, - {id: 3, label: this.localization('START')}, - {id: 4, label: this.localization('UP')}, - {id: 5, label: this.localization('DOWN')}, - {id: 6, label: this.localization('LEFT')}, - {id: 7, label: this.localization('RIGHT')}, - {id: 8, label: this.localization('A')}, - {id: 9, label: this.localization('X')}, - {id: 10, label: this.localization('L')}, - {id: 11, label: this.localization('R')}, - {id: 12, label: this.localization('L2')}, - {id: 13, label: this.localization('R2')}, - {id: 14, label: this.localization('L3')}, - {id: 15, label: this.localization('R3')}, - {id: 19, label: this.localization('L STICK UP')}, - {id: 18, label: this.localization('L STICK DOWN')}, - {id: 17, label: this.localization('L STICK LEFT')}, - {id: 16, label: this.localization('L STICK RIGHT')}, - {id: 23, label: this.localization('R STICK UP')}, - {id: 22, label: this.localization('R STICK DOWN')}, - {id: 21, label: this.localization('R STICK LEFT')}, - {id: 20, label: this.localization('R STICK RIGHT')}, + { id: 0, label: this.localization("B") }, + { id: 1, label: this.localization("Y") }, + { id: 2, label: this.localization("SELECT") }, + { id: 3, label: this.localization("START") }, + { id: 4, label: this.localization("UP") }, + { id: 5, label: this.localization("DOWN") }, + { id: 6, label: this.localization("LEFT") }, + { id: 7, label: this.localization("RIGHT") }, + { id: 8, label: this.localization("A") }, + { id: 9, label: this.localization("X") }, + { id: 10, label: this.localization("L") }, + { id: 11, label: this.localization("R") }, + { id: 12, label: this.localization("L2") }, + { id: 13, label: this.localization("R2") }, + { id: 14, label: this.localization("L3") }, + { id: 15, label: this.localization("R3") }, + { id: 19, label: this.localization("L STICK UP") }, + { id: 18, label: this.localization("L STICK DOWN") }, + { id: 17, label: this.localization("L STICK LEFT") }, + { id: 16, label: this.localization("L STICK RIGHT") }, + { id: 23, label: this.localization("R STICK UP") }, + { id: 22, label: this.localization("R STICK DOWN") }, + { id: 21, label: this.localization("R STICK LEFT") }, + { id: 20, label: this.localization("R STICK RIGHT") }, ]; } - if (['arcade', 'mame'].includes(this.getControlScheme())) { + if (["arcade", "mame"].includes(this.getControlScheme())) { for (const buttonIdx in buttons) { if (buttons[buttonIdx].id === 2) { - buttons[buttonIdx].label = this.localization('INSERT COIN'); + buttons[buttonIdx].label = this.localization("INSERT COIN"); } } } buttons.push( - {id: 24, label: this.localization('QUICK SAVE STATE')}, - {id: 25, label: this.localization('QUICK LOAD STATE')}, - {id: 26, label: this.localization('CHANGE STATE SLOT')}, - {id: 27, label: this.localization('FAST FORWARD')}, - {id: 29, label: this.localization('SLOW MOTION')}, - {id: 28, label: this.localization('REWIND')} + { id: 24, label: this.localization("QUICK SAVE STATE") }, + { id: 25, label: this.localization("QUICK LOAD STATE") }, + { id: 26, label: this.localization("CHANGE STATE SLOT") }, + { id: 27, label: this.localization("FAST FORWARD") }, + { id: 29, label: this.localization("SLOW MOTION") }, + { id: 28, label: this.localization("REWIND") } ); let nums = []; - for (let i=0; i { e.preventDefault(); players[selectedPlayer].classList.remove("ejs_control_selected"); playerDivs[selectedPlayer].setAttribute("hidden", ""); - selectedPlayer = i-1; - players[i-1].classList.add("ejs_control_selected"); - playerDivs[i-1].removeAttribute("hidden"); + selectedPlayer = i - 1; + players[i - 1].classList.add("ejs_control_selected"); + playerDivs[i - 1].removeAttribute("hidden"); }) playerContainer.appendChild(player); playerSelect.appendChild(playerContainer); players.push(playerContainer); } body.appendChild(playerSelect); - + const controls = this.createElement("div"); - for (let i=0; i<4; i++) { + for (let i = 0; i < 4; i++) { if (!this.controls[i]) this.controls[i] = {}; const player = this.createElement("div"); const playerTitle = this.createElement("div"); - + const gamepadTitle = this.createElement("div"); - gamepadTitle.style = "font-size:12px;"; - gamepadTitle.innerText = this.localization("Connected Gamepad")+": "; - - const gamepadName = this.createElement("span"); + gamepadTitle.innerText = this.localization("Connected Gamepad") + ": "; + + const gamepadName = this.createElement("select"); + gamepadName.classList.add("ejs_gamepad_dropdown"); + gamepadName.setAttribute("title", "gamepad-" + i); + gamepadName.setAttribute("index", i); this.gamepadLabels.push(gamepadName); - gamepadName.innerText = "n/a"; + this.gamepadSelection.push(""); + this.addEventListener(gamepadName, "change", e => { + const controller = e.target.value; + const player = parseInt(e.target.getAttribute("index")); + if (controller === "notconnected") { + this.gamepadSelection[player] = ""; + } else { + for (let i = 0; i < this.gamepadSelection.length; i++) { + if (player === i) continue; + if (this.gamepadSelection[i] === controller) { + this.gamepadSelection[i] = ""; + } + } + this.gamepadSelection[player] = controller; + this.updateGamepadLabels(); + } + }); + const def = this.createElement("option"); + def.setAttribute("value", "notconnected"); + def.innerText = "Not Connected"; + gamepadName.appendChild(def); gamepadTitle.appendChild(gamepadName); - + gamepadTitle.classList.add("ejs_gamepad_section"); + const leftPadding = this.createElement("div"); leftPadding.style = "width:25%;float:left;"; leftPadding.innerHTML = " "; - + const aboutParent = this.createElement("div"); aboutParent.style = "font-size:12px;width:50%;float:left;"; const gamepad = this.createElement("div"); @@ -2588,15 +2922,15 @@ class EmulatorJS { keyboard.style = "text-align:center;width:50%;float:left;"; keyboard.innerText = this.localization("Keyboard"); aboutParent.appendChild(keyboard); - + const headingPadding = this.createElement("div"); headingPadding.style = "clear:both;"; - + playerTitle.appendChild(gamepadTitle); playerTitle.appendChild(leftPadding); playerTitle.appendChild(aboutParent); - - if ((this.touch || navigator.maxTouchPoints > 0) && i === 0) { + + if ((this.touch || this.hasTouchScreen) && i === 0) { const vgp = this.createElement("div"); vgp.style = "width:25%;float:right;clear:none;padding:0;font-size: 11px;padding-left: 2.25rem;"; vgp.classList.add("ejs_control_row"); @@ -2613,21 +2947,20 @@ class EmulatorJS { vgp.appendChild(label); label.addEventListener("click", (e) => { input.checked = !input.checked; - this.changeSettingOption('virtual-gamepad', input.checked ? 'enabled' : "disabled"); + this.changeSettingOption("virtual-gamepad", input.checked ? "enabled" : "disabled"); }) this.on("start", (e) => { - if (this.settings["virtual-gamepad"] === "disabled") { + if (this.getSettingValue("virtual-gamepad") === "disabled") { input.checked = false; } }) playerTitle.appendChild(vgp); } - + playerTitle.appendChild(headingPadding); - - + player.appendChild(playerTitle); - + for (const buttonIdx in buttons) { const k = buttons[buttonIdx].id; const controlLabel = buttons[buttonIdx].label; @@ -2638,17 +2971,16 @@ class EmulatorJS { buttonText.setAttribute("data-label", controlLabel); buttonText.style = "margin-bottom:10px;"; buttonText.classList.add("ejs_control_bar"); - - + const title = this.createElement("div"); title.style = "width:25%;float:left;font-size:12px;"; const label = this.createElement("label"); - label.innerText = controlLabel+":"; + label.innerText = controlLabel + ":"; title.appendChild(label); - + const textBoxes = this.createElement("div"); textBoxes.style = "width:50%;float:left;"; - + const textBox1Parent = this.createElement("div"); textBox1Parent.style = "width:50%;float:left;padding: 0 5px;"; const textBox1 = this.createElement("input"); @@ -2657,7 +2989,7 @@ class EmulatorJS { textBox1.setAttribute("readonly", ""); textBox1.setAttribute("placeholder", ""); textBox1Parent.appendChild(textBox1); - + const textBox2Parent = this.createElement("div"); textBox2Parent.style = "width:50%;float:left;padding: 0 5px;"; const textBox2 = this.createElement("input"); @@ -2666,7 +2998,7 @@ class EmulatorJS { textBox2.setAttribute("readonly", ""); textBox2.setAttribute("placeholder", ""); textBox2Parent.appendChild(textBox2); - + buttonListeners.push(() => { textBox2.value = ""; textBox1.value = ""; @@ -2680,15 +3012,15 @@ class EmulatorJS { if (value2.includes(":")) { value2 = value2.split(":"); value2 = this.localization(value2[0]) + ":" + this.localization(value2[1]) - } else if (!isNaN(value2)){ - value2 = this.localization("BUTTON")+" "+this.localization(value2); + } else if (!isNaN(value2)) { + value2 = this.localization("BUTTON") + " " + this.localization(value2); } else { value2 = this.localization(value2); } textBox1.value = value2; } }) - + if (this.controls[i][k] && this.controls[i][k].value) { let value = this.keyMap[this.controls[i][k].value]; value = this.localization(value); @@ -2699,42 +3031,42 @@ class EmulatorJS { if (value2.includes(":")) { value2 = value2.split(":"); value2 = this.localization(value2[0]) + ":" + this.localization(value2[1]) - } else if (!isNaN(value2)){ - value2 = this.localization("BUTTON")+" "+this.localization(value2); + } else if (!isNaN(value2)) { + value2 = this.localization("BUTTON") + " " + this.localization(value2); } else { value2 = this.localization(value2); } textBox1.value = value2; } - + textBoxes.appendChild(textBox1Parent); textBoxes.appendChild(textBox2Parent); - + const padding = this.createElement("div"); padding.style = "clear:both;"; textBoxes.appendChild(padding); - + const setButton = this.createElement("div"); setButton.style = "width:25%;float:left;"; const button = this.createElement("a"); button.classList.add("ejs_control_set_button"); button.innerText = this.localization("Set"); setButton.appendChild(button); - + const padding2 = this.createElement("div"); padding2.style = "clear:both;"; - + buttonText.appendChild(title); buttonText.appendChild(textBoxes); buttonText.appendChild(setButton); buttonText.appendChild(padding2); - + player.appendChild(buttonText); - + this.addEventListener(buttonText, "mousedown", (e) => { e.preventDefault(); this.controlPopup.parentElement.parentElement.removeAttribute("hidden"); - this.controlPopup.innerText = "[ " + controlLabel + " ]\n"+this.localization("Press Keyboard"); + this.controlPopup.innerText = "[ " + controlLabel + " ]\n" + this.localization("Press Keyboard"); this.controlPopup.setAttribute("button-num", k); this.controlPopup.setAttribute("player-num", i); }) @@ -2744,14 +3076,12 @@ class EmulatorJS { playerDivs.push(player); } body.appendChild(controls); - - + selectedPlayer = 0; players[0].classList.add("ejs_control_selected"); playerDivs[0].removeAttribute("hidden"); - - - const popup = this.createElement('div'); + + const popup = this.createElement("div"); popup.classList.add("ejs_popup_container"); const popupMsg = this.createElement("div"); this.addEventListener(popup, "mousedown click touchstart", (e) => { @@ -2783,115 +3113,114 @@ class EmulatorJS { popupMsg.appendChild(this.createElement("br")); popupMsg.appendChild(btn); this.controlMenu.appendChild(popup); - } initControlVars() { this.defaultControllers = { 0: { 0: { - 'value': 'x', - 'value2': 'BUTTON_2' + "value": "x", + "value2": "BUTTON_2" }, 1: { - 'value': 's', - 'value2': 'BUTTON_4' + "value": "s", + "value2": "BUTTON_4" }, 2: { - 'value': 'v', - 'value2': 'SELECT' + "value": "v", + "value2": "SELECT" }, 3: { - 'value': 'enter', - 'value2': 'START' + "value": "enter", + "value2": "START" }, 4: { - 'value': 'up arrow', - 'value2': 'DPAD_UP' + "value": "up arrow", + "value2": "DPAD_UP" }, 5: { - 'value': 'down arrow', - 'value2': 'DPAD_DOWN' + "value": "down arrow", + "value2": "DPAD_DOWN" }, 6: { - 'value': 'left arrow', - 'value2': 'DPAD_LEFT' + "value": "left arrow", + "value2": "DPAD_LEFT" }, 7: { - 'value': 'right arrow', - 'value2': 'DPAD_RIGHT' + "value": "right arrow", + "value2": "DPAD_RIGHT" }, 8: { - 'value': 'z', - 'value2': 'BUTTON_1' + "value": "z", + "value2": "BUTTON_1" }, 9: { - 'value': 'a', - 'value2': 'BUTTON_3' + "value": "a", + "value2": "BUTTON_3" }, 10: { - 'value': 'q', - 'value2': 'LEFT_TOP_SHOULDER' + "value": "q", + "value2": "LEFT_TOP_SHOULDER" }, 11: { - 'value': 'e', - 'value2': 'RIGHT_TOP_SHOULDER' + "value": "e", + "value2": "RIGHT_TOP_SHOULDER" }, 12: { - 'value': 'tab', - 'value2': 'LEFT_BOTTOM_SHOULDER' + "value": "tab", + "value2": "LEFT_BOTTOM_SHOULDER" }, 13: { - 'value': 'r', - 'value2': 'RIGHT_BOTTOM_SHOULDER' + "value": "r", + "value2": "RIGHT_BOTTOM_SHOULDER" }, 14: { - 'value': '', - 'value2': 'LEFT_STICK', + "value": "", + "value2": "LEFT_STICK", }, 15: { - 'value': '', - 'value2': 'RIGHT_STICK', + "value": "", + "value2": "RIGHT_STICK", }, 16: { - 'value': 'h', - 'value2': 'LEFT_STICK_X:+1' + "value": "h", + "value2": "LEFT_STICK_X:+1" }, 17: { - 'value': 'f', - 'value2': 'LEFT_STICK_X:-1' + "value": "f", + "value2": "LEFT_STICK_X:-1" }, 18: { - 'value': 'g', - 'value2': 'LEFT_STICK_Y:+1' + "value": "g", + "value2": "LEFT_STICK_Y:+1" }, 19: { - 'value': 't', - 'value2': 'LEFT_STICK_Y:-1' + "value": "t", + "value2": "LEFT_STICK_Y:-1" }, 20: { - 'value': 'l', - 'value2': 'RIGHT_STICK_X:+1' + "value": "l", + "value2": "RIGHT_STICK_X:+1" }, 21: { - 'value': 'j', - 'value2': 'RIGHT_STICK_X:-1' + "value": "j", + "value2": "RIGHT_STICK_X:-1" }, 22: { - 'value': 'k', - 'value2': 'RIGHT_STICK_Y:+1' + "value": "k", + "value2": "RIGHT_STICK_Y:+1" }, 23: { - 'value': 'i', - 'value2': 'RIGHT_STICK_Y:-1' + "value": "i", + "value2": "RIGHT_STICK_Y:-1" }, 24: { - 'value': '1' + "value": "1" }, 25: { - 'value': '2' + "value": "2" }, 26: { - 'value': '3' + "value": "3" }, 27: {}, 28: {}, @@ -2902,116 +3231,116 @@ class EmulatorJS { 3: {} } this.keyMap = { - 0: '', - 8: 'backspace', - 9: 'tab', - 13: 'enter', - 16: 'shift', - 17: 'ctrl', - 18: 'alt', - 19: 'pause/break', - 20: 'caps lock', - 27: 'escape', - 32: 'space', - 33: 'page up', - 34: 'page down', - 35: 'end', - 36: 'home', - 37: 'left arrow', - 38: 'up arrow', - 39: 'right arrow', - 40: 'down arrow', - 45: 'insert', - 46: 'delete', - 48: '0', - 49: '1', - 50: '2', - 51: '3', - 52: '4', - 53: '5', - 54: '6', - 55: '7', - 56: '8', - 57: '9', - 65: 'a', - 66: 'b', - 67: 'c', - 68: 'd', - 69: 'e', - 70: 'f', - 71: 'g', - 72: 'h', - 73: 'i', - 74: 'j', - 75: 'k', - 76: 'l', - 77: 'm', - 78: 'n', - 79: 'o', - 80: 'p', - 81: 'q', - 82: 'r', - 83: 's', - 84: 't', - 85: 'u', - 86: 'v', - 87: 'w', - 88: 'x', - 89: 'y', - 90: 'z', - 91: 'left window key', - 92: 'right window key', - 93: 'select key', - 96: 'numpad 0', - 97: 'numpad 1', - 98: 'numpad 2', - 99: 'numpad 3', - 100: 'numpad 4', - 101: 'numpad 5', - 102: 'numpad 6', - 103: 'numpad 7', - 104: 'numpad 8', - 105: 'numpad 9', - 106: 'multiply', - 107: 'add', - 109: 'subtract', - 110: 'decimal point', - 111: 'divide', - 112: 'f1', - 113: 'f2', - 114: 'f3', - 115: 'f4', - 116: 'f5', - 117: 'f6', - 118: 'f7', - 119: 'f8', - 120: 'f9', - 121: 'f10', - 122: 'f11', - 123: 'f12', - 144: 'num lock', - 145: 'scroll lock', - 186: 'semi-colon', - 187: 'equal sign', - 188: 'comma', - 189: 'dash', - 190: 'period', - 191: 'forward slash', - 192: 'grave accent', - 219: 'open bracket', - 220: 'back slash', - 221: 'close braket', - 222: 'single quote' + 0: "", + 8: "backspace", + 9: "tab", + 13: "enter", + 16: "shift", + 17: "ctrl", + 18: "alt", + 19: "pause/break", + 20: "caps lock", + 27: "escape", + 32: "space", + 33: "page up", + 34: "page down", + 35: "end", + 36: "home", + 37: "left arrow", + 38: "up arrow", + 39: "right arrow", + 40: "down arrow", + 45: "insert", + 46: "delete", + 48: "0", + 49: "1", + 50: "2", + 51: "3", + 52: "4", + 53: "5", + 54: "6", + 55: "7", + 56: "8", + 57: "9", + 65: "a", + 66: "b", + 67: "c", + 68: "d", + 69: "e", + 70: "f", + 71: "g", + 72: "h", + 73: "i", + 74: "j", + 75: "k", + 76: "l", + 77: "m", + 78: "n", + 79: "o", + 80: "p", + 81: "q", + 82: "r", + 83: "s", + 84: "t", + 85: "u", + 86: "v", + 87: "w", + 88: "x", + 89: "y", + 90: "z", + 91: "left window key", + 92: "right window key", + 93: "select key", + 96: "numpad 0", + 97: "numpad 1", + 98: "numpad 2", + 99: "numpad 3", + 100: "numpad 4", + 101: "numpad 5", + 102: "numpad 6", + 103: "numpad 7", + 104: "numpad 8", + 105: "numpad 9", + 106: "multiply", + 107: "add", + 109: "subtract", + 110: "decimal point", + 111: "divide", + 112: "f1", + 113: "f2", + 114: "f3", + 115: "f4", + 116: "f5", + 117: "f6", + 118: "f7", + 119: "f8", + 120: "f9", + 121: "f10", + 122: "f11", + 123: "f12", + 144: "num lock", + 145: "scroll lock", + 186: "semi-colon", + 187: "equal sign", + 188: "comma", + 189: "dash", + 190: "period", + 191: "forward slash", + 192: "grave accent", + 219: "open bracket", + 220: "back slash", + 221: "close braket", + 222: "single quote" } } setupKeys() { - for (let i=0; i<4; i++) { - for (let j=0; j<30; j++) { + for (let i = 0; i < 4; i++) { + for (let j = 0; j < 30; j++) { if (this.controls[i][j]) { this.controls[i][j].value = parseInt(this.keyLookup(this.controls[i][j].value)); if (this.controls[i][j].value === -1 && this.debug) { delete this.controls[i][j].value; - console.warn("Invalid key for control "+j+" player "+i); + console.warn("Invalid key for control " + j + " player " + i); } } } @@ -3043,20 +3372,24 @@ class EmulatorJS { this.saveSettings(); return; } - if (this.settingsMenu.style.display !== "none" || this.isPopupOpen()) return; + if (this.settingsMenu.style.display !== "none" || this.isPopupOpen() || this.getSettingValue("keyboardInput") === "enabled") return; e.preventDefault(); const special = [16, 17, 18, 19, 20, 21, 22, 23]; - for (let i=0; i<4; i++) { - for (let j=0; j<30; j++) { + for (let i = 0; i < 4; i++) { + for (let j = 0; j < 30; j++) { if (this.controls[i][j] && this.controls[i][j].value === e.keyCode) { - this.gameManager.simulateInput(i, j, (e.type === 'keyup' ? 0 : (special.includes(j) ? 0x7fff : 1))); + this.gameManager.simulateInput(i, j, (e.type === "keyup" ? 0 : (special.includes(j) ? 0x7fff : 1))); } } } } gamepadEvent(e) { if (!this.started) return; - const value = function(value) { + const gamepadIndex = this.gamepadSelection.indexOf(this.gamepad.gamepads[e.gamepadIndex].id + "_" + this.gamepad.gamepads[e.gamepadIndex].index); + if (gamepadIndex < 0) { + return; // Gamepad not set anywhere + } + const value = function (value) { if (value > 0.5 || value < -0.5) { return (value > 0) ? 1 : -1; } else { @@ -3064,10 +3397,10 @@ class EmulatorJS { } }(e.value || 0); if (this.controlPopup.parentElement.parentElement.getAttribute("hidden") === null) { - if ('buttonup' === e.type || (e.type === "axischanged" && value === 0)) return; + if ("buttonup" === e.type || (e.type === "axischanged" && value === 0)) return; const num = this.controlPopup.getAttribute("button-num"); const player = parseInt(this.controlPopup.getAttribute("player-num")); - if (e.gamepadIndex !== player) return; + if (gamepadIndex !== player) return; if (!this.controls[player][num]) { this.controls[player][num] = {}; } @@ -3079,20 +3412,20 @@ class EmulatorJS { } if (this.settingsMenu.style.display !== "none" || this.isPopupOpen()) return; const special = [16, 17, 18, 19, 20, 21, 22, 23]; - for (let i=0; i<4; i++) { - if (e.gamepadIndex !== i) continue; - for (let j=0; j<30; j++) { + for (let i = 0; i < 4; i++) { + if (gamepadIndex !== i) continue; + for (let j = 0; j < 30; j++) { if (!this.controls[i][j] || this.controls[i][j].value2 === undefined) { continue; } const controlValue = this.controls[i][j].value2; - if (['buttonup', 'buttondown'].includes(e.type) && (controlValue === e.label || controlValue === e.index)) { - this.gameManager.simulateInput(i, j, (e.type === 'buttonup' ? 0 : (special.includes(j) ? 0x7fff : 1))); + if (["buttonup", "buttondown"].includes(e.type) && (controlValue === e.label || controlValue === e.index)) { + this.gameManager.simulateInput(i, j, (e.type === "buttonup" ? 0 : (special.includes(j) ? 0x7fff : 1))); } else if (e.type === "axischanged") { - if (typeof controlValue === 'string' && controlValue.split(":")[0] === e.axis) { + if (typeof controlValue === "string" && controlValue.split(":")[0] === e.axis) { if (special.includes(j)) { - if (e.axis === 'LEFT_STICK_X') { + if (j === 16 || j === 17) { if (e.value > 0) { this.gameManager.simulateInput(i, 16, 0x7fff * e.value); this.gameManager.simulateInput(i, 17, 0); @@ -3100,7 +3433,7 @@ class EmulatorJS { this.gameManager.simulateInput(i, 17, -0x7fff * e.value); this.gameManager.simulateInput(i, 16, 0); } - } else if (e.axis === 'LEFT_STICK_Y') { + } else if (j === 18 || j === 19) { if (e.value > 0) { this.gameManager.simulateInput(i, 18, 0x7fff * e.value); this.gameManager.simulateInput(i, 19, 0); @@ -3108,7 +3441,7 @@ class EmulatorJS { this.gameManager.simulateInput(i, 19, -0x7fff * e.value); this.gameManager.simulateInput(i, 18, 0); } - } else if (e.axis === 'RIGHT_STICK_X') { + } else if (j === 20 || j === 21) { if (e.value > 0) { this.gameManager.simulateInput(i, 20, 0x7fff * e.value); this.gameManager.simulateInput(i, 21, 0); @@ -3116,12 +3449,12 @@ class EmulatorJS { this.gameManager.simulateInput(i, 21, -0x7fff * e.value); this.gameManager.simulateInput(i, 20, 0); } - } else if (e.axis === 'RIGHT_STICK_Y') { + } else if (j === 22 || j === 23) { if (e.value > 0) { this.gameManager.simulateInput(i, 22, 0x7fff * e.value); this.gameManager.simulateInput(i, 23, 0); } else { - this.gameManager.simulateInput(i, 23, 0x7fff * e.value); + this.gameManager.simulateInput(i, 23, -0x7fff * e.value); this.gameManager.simulateInput(i, 22, 0); } } @@ -3142,15 +3475,15 @@ class EmulatorJS { this.elements.parent.appendChild(this.virtualGamepad); const speedControlButtons = [ - {"type":"button","text":"Fast","id":"speed_fast","location":"center","left":-35,"top":50,"fontSize":15,"block":true,"input_value":27}, - {"type":"button","text":"Slow","id":"speed_slow","location":"center","left":95,"top":50,"fontSize":15,"block":true,"input_value":29}, + { "type": "button", "text": "Fast", "id": "speed_fast", "location": "center", "left": -35, "top": 50, "fontSize": 15, "block": true, "input_value": 27 }, + { "type": "button", "text": "Slow", "id": "speed_slow", "location": "center", "left": 95, "top": 50, "fontSize": 15, "block": true, "input_value": 29 }, ]; if (this.rewindEnabled) { - speedControlButtons.push({"type":"button","text":"Rewind","id":"speed_rewind","location":"center","left":30,"top":50,"fontSize":15,"block":true,"input_value":28}); + speedControlButtons.push({ "type": "button", "text": "Rewind", "id": "speed_rewind", "location": "center", "left": 30, "top": 50, "fontSize": 15, "block": true, "input_value": 28 }); } let info; - if (this.config.VirtualGamepadSettings && function(set) { + if (this.config.VirtualGamepadSettings && function (set) { if (!Array.isArray(set)) { console.warn("Virtual gamepad settings is not array! Using default gamepad settings"); return false; @@ -3159,30 +3492,30 @@ class EmulatorJS { console.warn("Virtual gamepad settings is empty! Using default gamepad settings"); return false; } - for (let i=0; i { left.classList.toggle("ejs_virtualGamepad_left", !enabled); right.classList.toggle("ejs_virtualGamepad_right", !enabled); left.classList.toggle("ejs_virtualGamepad_right", enabled); right.classList.toggle("ejs_virtualGamepad_left", enabled); } - + const leftHandedMode = false; - const blockCSS = 'height:31px;text-align:center;border:1px solid #ccc;border-radius:5px;line-height:31px;'; - const controlSchemeCls = `cs_${this.getControlScheme()}`.split(/\s/g).join('_'); - - for (let i=0; i { e.preventDefault(); - if (e.type === 'touchend' || e.type === 'touchcancel') { + if (e.type === "touchend" || e.type === "touchcancel") { e.target.classList.remove("ejs_virtualGamepad_button_down"); window.setTimeout(() => { this.gameManager.simulateInput(0, value, 0); }) } else { e.target.classList.add("ejs_virtualGamepad_button_down"); - this.gameManager.simulateInput(0, value, 1); + this.gameManager.simulateInput(0, value, downValue); } }) } } - + const createDPad = (opts) => { const container = opts.container; const callback = opts.event; @@ -3530,12 +3863,12 @@ class EmulatorJS { bar1.classList.add("ejs_dpad_bar"); const bar2 = this.createElement("div"); bar2.classList.add("ejs_dpad_bar"); - + horizontal.appendChild(bar1); vertical.appendChild(bar2); dpadMain.appendChild(vertical); dpadMain.appendChild(horizontal); - + const updateCb = (e) => { e.preventDefault(); const touch = e.targetTouches[0]; @@ -3548,14 +3881,14 @@ class EmulatorJS { left = 0, right = 0, angle = Math.atan(x / y) / (Math.PI / 180); - + if (y <= -10) { up = 1; } if (y >= 10) { down = 1; } - + if (x >= 10) { right = 1; left = 0; @@ -3565,7 +3898,7 @@ class EmulatorJS { up = (angle < 0 && angle >= -55 ? 1 : 0); down = (angle > 0 && angle <= 55 ? 1 : 0); } - + if (x <= -10) { right = 0; left = 1; @@ -3575,12 +3908,12 @@ class EmulatorJS { up = (angle > 0 && angle <= 55 ? 1 : 0); down = (angle < 0 && angle >= -55 ? 1 : 0); } - + dpadMain.classList.toggle("ejs_dpad_up_pressed", up); dpadMain.classList.toggle("ejs_dpad_down_pressed", down); dpadMain.classList.toggle("ejs_dpad_right_pressed", right); dpadMain.classList.toggle("ejs_dpad_left_pressed", left); - + callback(up, down, left, right); } const cancelCb = (e) => { @@ -3589,21 +3922,21 @@ class EmulatorJS { dpadMain.classList.remove("ejs_dpad_down_pressed"); dpadMain.classList.remove("ejs_dpad_right_pressed"); dpadMain.classList.remove("ejs_dpad_left_pressed"); - + callback(0, 0, 0, 0); } - - this.addEventListener(dpadMain, 'touchstart touchmove', updateCb); - this.addEventListener(dpadMain, 'touchend touchcancel', cancelCb); - - + + this.addEventListener(dpadMain, "touchstart touchmove", updateCb); + this.addEventListener(dpadMain, "touchend touchcancel", cancelCb); + + container.appendChild(dpadMain); } - + info.forEach((dpad, index) => { - if (dpad.type !== 'dpad') return; - if (leftHandedMode && ['left', 'right'].includes(dpad.location)) { - dpad.location = (dpad.location==='left') ? 'right' : 'left'; + if (dpad.type !== "dpad") return; + if (leftHandedMode && ["left", "right"].includes(dpad.location)) { + dpad.location = (dpad.location === "left") ? "right" : "left"; const amnt = JSON.parse(JSON.stringify(dpad)); if (amnt.left) { dpad.right = amnt.left; @@ -3613,15 +3946,15 @@ class EmulatorJS { } } const elem = this.createElement("div"); - let style = ''; + let style = ""; if (dpad.left) { - style += 'left:'+dpad.left+';'; + style += "left:" + dpad.left + ";"; } if (dpad.right) { - style += 'right:'+dpad.right+';'; + style += "right:" + dpad.right + ";"; } if (dpad.top) { - style += 'top:'+dpad.top+';'; + style += "top:" + dpad.top + ";"; } elem.classList.add(controlSchemeCls); if (dpad.id) { @@ -3629,25 +3962,27 @@ class EmulatorJS { } elem.style = style; elems[dpad.location].appendChild(elem); - createDPad({container: elem, event: (up, down, left, right) => { - if (dpad.joystickInput) { - if (up === 1) up=0x7fff; - if (down === 1) down=0x7fff; - if (left === 1) left=0x7fff; - if (right === 1) right=0x7fff; + createDPad({ + container: elem, + event: (up, down, left, right) => { + if (dpad.joystickInput) { + if (up === 1) up = 0x7fff; + if (down === 1) down = 0x7fff; + if (left === 1) left = 0x7fff; + if (right === 1) right = 0x7fff; + } + this.gameManager.simulateInput(0, dpad.inputValues[0], up); + this.gameManager.simulateInput(0, dpad.inputValues[1], down); + this.gameManager.simulateInput(0, dpad.inputValues[2], left); + this.gameManager.simulateInput(0, dpad.inputValues[3], right); } - this.gameManager.simulateInput(0, dpad.inputValues[0], up); - this.gameManager.simulateInput(0, dpad.inputValues[1], down); - this.gameManager.simulateInput(0, dpad.inputValues[2], left); - this.gameManager.simulateInput(0, dpad.inputValues[3], right); - }}); + }); }) - - + info.forEach((zone, index) => { - if (zone.type !== 'zone') return; - if (leftHandedMode && ['left', 'right'].includes(zone.location)) { - zone.location = (zone.location==='left') ? 'right' : 'left'; + if (zone.type !== "zone") return; + if (leftHandedMode && ["left", "right"].includes(zone.location)) { + zone.location = (zone.location === "left") ? "right" : "left"; const amnt = JSON.parse(JSON.stringify(zone)); if (amnt.left) { zone.right = amnt.left; @@ -3666,21 +4001,21 @@ class EmulatorJS { } elems[zone.location].appendChild(elem); const zoneObj = nipplejs.create({ - 'zone': elem, - 'mode': 'static', - 'position': { - 'left': zone.left, - 'top': zone.top + "zone": elem, + "mode": "static", + "position": { + "left": zone.left, + "top": zone.top }, - 'color': zone.color || 'red' + "color": zone.color || "red" }); - zoneObj.on('end', () => { + zoneObj.on("end", () => { this.gameManager.simulateInput(0, zone.inputValues[0], 0); this.gameManager.simulateInput(0, zone.inputValues[1], 0); this.gameManager.simulateInput(0, zone.inputValues[2], 0); this.gameManager.simulateInput(0, zone.inputValues[3], 0); }); - zoneObj.on('move', (e, info) => { + zoneObj.on("move", (e, info) => { const degree = info.angle.degree; const distance = info.distance; if (zone.joystickInput === true) { @@ -3731,7 +4066,7 @@ class EmulatorJS { this.gameManager.simulateInput(0, zone.inputValues[3], 0x7fff * -y); this.gameManager.simulateInput(0, zone.inputValues[2], 0); } - + } else { if (degree >= 30 && degree < 150) { this.gameManager.simulateInput(0, zone.inputValues[0], 1); @@ -3764,13 +4099,19 @@ class EmulatorJS { } }); }) - - if (this.touch || navigator.maxTouchPoints > 0) { + + if (this.touch || this.hasTouchScreen) { const menuButton = this.createElement("div"); menuButton.innerHTML = ''; menuButton.classList.add("ejs_virtualGamepad_open"); menuButton.style.display = "none"; - this.on("start", () => menuButton.style.display = ""); + this.on("start", () => { + menuButton.style.display = ""; + if (matchMedia('(pointer:fine)').matches && this.getSettingValue("menu-bar-button") !== "visible") { + menuButton.style.opacity = 0; + this.changeSettingOption('menu-bar-button', 'hidden', true); + } + }); this.elements.parent.appendChild(menuButton); let timeout; let ready = true; @@ -3786,7 +4127,7 @@ class EmulatorJS { }) this.elements.menuToggle = menuButton; } - + this.virtualGamepad.style.display = "none"; } handleResize() { @@ -3804,30 +4145,26 @@ class EmulatorJS { this.game.parentElement.classList.toggle("ejs_small_screen", positionInfo.width <= 575); //This wouldnt work using :not()... strange. this.game.parentElement.classList.toggle("ejs_big_screen", positionInfo.width > 575); - - if (!this.Module) return; - const dpr = window.devicePixelRatio || 1; - const width = positionInfo.width * dpr; - const height = (positionInfo.height * dpr); - this.Module.setCanvasSize(width, height); + if (!this.handleSettingsResize) return; this.handleSettingsResize(); } getElementSize(element) { let elem = element.cloneNode(true); - elem.style.position = 'absolute'; + elem.style.position = "absolute"; elem.style.opacity = 0; - elem.removeAttribute('hidden'); + elem.removeAttribute("hidden"); element.parentNode.appendChild(elem); const res = elem.getBoundingClientRect(); elem.remove(); return { - 'width': res.width, - 'height': res.height + "width": res.width, + "height": res.height }; } saveSettings() { if (!window.localStorage || this.config.disableLocalStorage || !this.settingsLoaded) return; + if (!this.started && !this.failedToStart) return; const coreSpecific = { controlSettings: this.controls, settings: this.settings, @@ -3838,32 +4175,77 @@ class EmulatorJS { muted: this.muted } localStorage.setItem("ejs-settings", JSON.stringify(ejs_settings)); - localStorage.setItem("ejs-"+this.getCore()+"-settings", JSON.stringify(coreSpecific)); + localStorage.setItem(this.getLocalStorageKey(), JSON.stringify(coreSpecific)); + } + getLocalStorageKey() { + let identifier = (this.config.gameId || 1) + "-" + this.getCore(true); + if (typeof this.config.gameName === "string") { + identifier += "-" + this.config.gameName; + } else if (typeof this.config.gameUrl === "string" && !this.config.gameUrl.toLowerCase().startsWith("blob:")) { + identifier += "-" + this.config.gameUrl; + } else if (this.config.gameUrl instanceof File) { + identifier += "-" + this.config.gameUrl.name; + } else if (typeof this.config.gameId !== "number") { + console.warn("gameId (EJS_gameID) is not set. This may result in settings persisting across games."); + } + return "ejs-" + identifier + "-settings"; } preGetSetting(setting) { - if (!window.localStorage || this.config.disableLocalStorage) { - if (this.config.defaultOptions && this.config.defaultOptions[setting]) { - return this.config.defaultOptions[setting]; + if (window.localStorage && !this.config.disableLocalStorage) { + let coreSpecific = localStorage.getItem(this.getLocalStorageKey()); + try { + coreSpecific = JSON.parse(coreSpecific); + if (coreSpecific && coreSpecific.settings) { + return coreSpecific.settings[setting]; + } + } catch(e) { + console.warn("Could not load previous settings", e); } - return false; } - let coreSpecific = localStorage.getItem("ejs-"+this.getCore()+"-settings"); - try { - coreSpecific = JSON.parse(coreSpecific); - if (!coreSpecific || !coreSpecific.settings) { - return false; - } - return coreSpecific.settings[setting]; - } catch (e) { - console.warn("Could not load previous settings", e); - return false; + if (this.config.defaultOptions && this.config.defaultOptions[setting]) { + return this.config.defaultOptions[setting]; + } + return null; + } + getCoreSettings() { + if (!window.localStorage || this.config.disableLocalStorage) { + if (this.config.defaultOptions) { + let rv = ""; + for (const k in this.config.defaultOptions) { + let value = isNaN(this.config.defaultOptions[k]) ? `"${this.config.defaultOptions[k]}"` : this.config.defaultOptions[k]; + rv += `${k} = ${value}\n`; + } + return rv; + } + return ""; + }; + let coreSpecific = localStorage.getItem(this.getLocalStorageKey()); + if (coreSpecific) { + try { + coreSpecific = JSON.parse(coreSpecific); + if (!(coreSpecific.settings instanceof Object)) throw new Error("Not a JSON object"); + let rv = ""; + for (const k in coreSpecific.settings) { + let value = isNaN(coreSpecific.settings[k]) ? `"${coreSpecific.settings[k]}"` : coreSpecific.settings[k]; + rv += `${k} = ${value}\n`; + } + for (const k in this.config.defaultOptions) { + if (rv.includes(k)) continue; + let value = isNaN(this.config.defaultOptions[k]) ? `"${this.config.defaultOptions[k]}"` : this.config.defaultOptions[k]; + rv += `${k} = ${value}\n`; + } + return rv; + } catch(e) { + console.warn("Could not load previous settings", e); + } } + return ""; } loadSettings() { if (!window.localStorage || this.config.disableLocalStorage) return; this.settingsLoaded = true; let ejs_settings = localStorage.getItem("ejs-settings"); - let coreSpecific = localStorage.getItem("ejs-"+this.getCore()+"-settings"); + let coreSpecific = localStorage.getItem(this.getLocalStorageKey()); if (coreSpecific) { try { coreSpecific = JSON.parse(coreSpecific); @@ -3873,10 +4255,10 @@ class EmulatorJS { for (const k in coreSpecific.settings) { this.changeSettingOption(k, coreSpecific.settings[k]); } - for (let i=0; i { if (this.isSlowMotion) this.gameManager.toggleSlowMotion(1); }, 10); - } else if (option === 'slowMotion') { + } else if (option === "slowMotion") { if (value === "enabled") { this.isSlowMotion = true; this.gameManager.toggleSlowMotion(1); @@ -3955,7 +4335,44 @@ class EmulatorJS { } } else if (option === "vsync") { this.gameManager.setVSync(value === "enabled"); + } else if (option === "videoRotation") { + value = parseInt(value); + if (this.videoRotationChanged === true || value !== 0) { + this.gameManager.setVideoRotation(value); + this.videoRotationChanged = true; + } else if (this.videoRotationChanged === true && value === 0) { + this.gameManager.setVideoRotation(0); + this.videoRotationChanged = true; + } + } else if (option === "save-save-interval") { + value = parseInt(value); + if (this.saveSaveInterval && this.saveSaveInterval !== null) { + clearInterval(this.saveSaveInterval); + this.saveSaveInterval = null; + } + // Disabled + if (value === 0 || isNaN(value)) return; + if (this.started) this.gameManager.saveSaveFiles(); + if (this.debug) console.log("Saving every", value * 1000, "miliseconds"); + this.saveSaveInterval = setInterval(() => { + if (this.started) this.gameManager.saveSaveFiles(); + }, value * 1000); + } else if (option === "menubarBehavior") { + this.createBottomMenuBarListeners(); + } else if (option === "keyboardInput") { + this.gameManager.setKeyboardEnabled(value === "enabled"); + } else if (option === "altKeyboardInput") { + this.gameManager.setAltKeyEnabled(value === "enabled"); + } else if (option === "lockMouse") { + this.enableMouseLock = (value === "enabled"); } + } + menuOptionChanged(option, value) { + this.saveSettings(); + this.allSettings[option] = value; + if (this.debug) console.log(option, value); + if (!this.gameManager) return; + this.handleSpecialOptions(option, value); this.gameManager.setVariable(option, value); this.saveSettings(); } @@ -3965,7 +4382,7 @@ class EmulatorJS { const nested = this.createElement("div"); nested.classList.add("ejs_settings_transition"); this.disks = {}; - + const home = this.createElement("div"); home.style.overflow = "auto"; const menus = []; @@ -3980,12 +4397,12 @@ class EmulatorJS { let w2 = this.diskParent.parentElement.getBoundingClientRect().width; let disksX = this.diskParent.getBoundingClientRect().x; if (w2 > window.innerWidth) disksX += (w2 - window.innerWidth); - const onTheRight = disksX > (w2-15)/2; + const onTheRight = disksX > (w2 - 15) / 2; if (height > 375) height = 375; - home.style['max-height'] = (height - 95) + "px"; - nested.style['max-height'] = (height - 95) + "px"; - for (let i=0; i e(title)); } let allOpts = {}; - + + // TODO - Why is this duplicated? const addToMenu = (title, id, options, defaultOption) => { const span = this.createElement("span"); span.innerText = title; - + const current = this.createElement("div"); current.innerText = ""; current.classList.add("ejs_settings_main_bar_selected"); span.appendChild(current); - + const menu = this.createElement("div"); menus.push(menu); - menu.style.overflow = "auto"; menu.setAttribute("hidden", ""); + menu.classList.add("ejs_parent_option_div"); const button = this.createElement("button"); const goToHome = () => { const homeSize = this.getElementSize(home); - nested.style.width = (homeSize.width+20) + "px"; + nested.style.width = (homeSize.width + 20) + "px"; nested.style.height = homeSize.height + "px"; menu.setAttribute("hidden", ""); home.removeAttribute("hidden"); } this.addEventListener(button, "click", goToHome); - + button.type = "button"; button.classList.add("ejs_back_button"); menu.appendChild(button); @@ -4034,29 +4452,29 @@ class EmulatorJS { pageTitle.innerText = title; pageTitle.classList.add("ejs_menu_text_a"); button.appendChild(pageTitle); - + const optionsMenu = this.createElement("div"); optionsMenu.classList.add("ejs_setting_menu"); - + let buttons = []; let opts = options; if (Array.isArray(options)) { opts = {}; - for (let i=0; i { if (id !== title) return; - for (let j=0; j { this.disks[id] = opt; - for (let j=0; j 1) { const diskLabels = {}; let isM3U = false; let disks = {}; if (this.fileName.split(".").pop() === "m3u") { - disks = this.gameManager.Module.FS.readFile(this.fileName, { encoding: 'utf8' }).split("\n"); + disks = this.gameManager.Module.FS.readFile(this.fileName, { encoding: "utf8" }).split("\n"); isM3U = true; } - for (let i=0; i { + const rv = this.createElement("div"); + rv.classList.add("ejs_setting_menu"); + + if (child) { + const menuOption = this.createElement("div"); + menuOption.classList.add("ejs_settings_main_bar"); + const span = this.createElement("span"); + span.innerText = title; + + menuOption.appendChild(span); + parentElement.appendChild(menuOption); + + const menu = this.createElement("div"); + const menuChild = this.createElement("div"); + menus.push(menu); + parentMenuCt++; + menu.setAttribute("hidden", ""); + menuChild.classList.add("ejs_parent_option_div"); + const button = this.createElement("button"); + const goToHome = () => { + const homeSize = this.getElementSize(parentElement); + nested.style.width = (homeSize.width + 20) + "px"; + nested.style.height = homeSize.height + "px"; + menu.setAttribute("hidden", ""); + parentElement.removeAttribute("hidden"); + } + this.addEventListener(menuOption, "click", (e) => { + const targetSize = this.getElementSize(menu); + nested.style.width = (targetSize.width + 20) + "px"; + nested.style.height = targetSize.height + "px"; + menu.removeAttribute("hidden"); + rv.scrollTo(0, 0); + parentElement.setAttribute("hidden", ""); + }) + const observer = new MutationObserver((list) => { + for (const k of list) { + for (const removed of k.removedNodes) { + if (removed === menu) { + menuOption.remove(); + observer.disconnect(); + const index = menus.indexOf(menu); + if (index !== -1) menus.splice(index, 1); + this.settingsMenu.style.display = ""; + const homeSize = this.getElementSize(parentElement); + nested.style.width = (homeSize.width + 20) + "px"; + nested.style.height = homeSize.height + "px"; + // This SHOULD always be called before the game started - this SHOULD never be an issue + this.settingsMenu.style.display = "none"; + } + } + } + }); + this.addEventListener(button, "click", goToHome); + + button.type = "button"; + button.classList.add("ejs_back_button"); + menuChild.appendChild(button); + const pageTitle = this.createElement("span"); + pageTitle.innerText = title; + pageTitle.classList.add("ejs_menu_text_a"); + button.appendChild(pageTitle); + + // const optionsMenu = this.createElement("div"); + // optionsMenu.classList.add("ejs_setting_menu"); + // menu.appendChild(optionsMenu); + + menuChild.appendChild(rv); + menu.appendChild(menuChild); + nested.appendChild(menu); + observer.observe(nested, { + childList: true, + subtree: true, + }); + } + + return rv; + } + + const checkForEmptyMenu = (element) => { + if (element.firstChild === null) { + element.parentElement.remove(); // No point in keeping an empty menu + parentMenuCt--; + } + } + + const home = createSettingParent(); + this.handleSettingsResize = () => { let needChange = false; if (this.settingsMenu.style.display !== "") { @@ -4165,12 +4674,12 @@ class EmulatorJS { let w2 = this.settingParent.parentElement.getBoundingClientRect().width; let settingsX = this.settingParent.getBoundingClientRect().x; if (w2 > window.innerWidth) settingsX += (w2 - window.innerWidth); - const onTheRight = settingsX > (w2-15)/2; + const onTheRight = settingsX > (w2 - 15) / 2; if (height > 375) height = 375; - home.style['max-height'] = (height - 95) + "px"; - nested.style['max-height'] = (height - 95) + "px"; - for (let i=0; i { - this.settings[title] = newValue; + let settings = {}; + this.changeSettingOption = (title, newValue, startup) => { + this.allSettings[title] = newValue; + if (startup !== true) { + this.settings[title] = newValue; + } + settings[title] = newValue; funcs.forEach(e => e(title)); } let allOpts = {}; - - const addToMenu = (title, id, options, defaultOption) => { + + const addToMenu = (title, id, options, defaultOption, parentElement, useParentParent) => { + if (Array.isArray(this.config.hideSettings) && this.config.hideSettings.includes(id)) { + return; + } + parentElement = parentElement || home; + const transitionElement = useParentParent ? parentElement.parentElement.parentElement : parentElement; const menuOption = this.createElement("div"); menuOption.classList.add("ejs_settings_main_bar"); const span = this.createElement("span"); span.innerText = title; - + const current = this.createElement("div"); current.innerText = ""; current.classList.add("ejs_settings_main_bar_selected"); span.appendChild(current); - + menuOption.appendChild(span); - home.appendChild(menuOption); - + parentElement.appendChild(menuOption); + const menu = this.createElement("div"); menus.push(menu); - menu.style.overflow = "auto"; + const menuChild = this.createElement("div"); menu.setAttribute("hidden", ""); + menuChild.classList.add("ejs_parent_option_div"); + + const optionsMenu = this.createElement("div"); + optionsMenu.classList.add("ejs_setting_menu"); + const button = this.createElement("button"); const goToHome = () => { - const homeSize = this.getElementSize(home); - nested.style.width = (homeSize.width+20) + "px"; - nested.style.height = homeSize.height + "px"; + transitionElement.removeAttribute("hidden"); menu.setAttribute("hidden", ""); - home.removeAttribute("hidden"); + const homeSize = this.getElementSize(transitionElement); + nested.style.width = (homeSize.width + 20) + "px"; + nested.style.height = homeSize.height + "px"; + transitionElement.removeAttribute("hidden"); } this.addEventListener(menuOption, "click", (e) => { const targetSize = this.getElementSize(menu); - nested.style.width = (targetSize.width+20) + "px"; + nested.style.width = (targetSize.width + 20) + "px"; nested.style.height = targetSize.height + "px"; menu.removeAttribute("hidden"); - home.setAttribute("hidden", ""); + optionsMenu.scrollTo(0, 0); + transitionElement.setAttribute("hidden", ""); + transitionElement.setAttribute("hidden", ""); }) this.addEventListener(button, "click", goToHome); - + button.type = "button"; button.classList.add("ejs_back_button"); - menu.appendChild(button); + menuChild.appendChild(button); const pageTitle = this.createElement("span"); pageTitle.innerText = title; pageTitle.classList.add("ejs_menu_text_a"); button.appendChild(pageTitle); - - const optionsMenu = this.createElement("div"); - optionsMenu.classList.add("ejs_setting_menu"); - + let buttons = []; let opts = options; if (Array.isArray(options)) { opts = {}; - for (let i=0; i { if (id !== title) return; - for (let j=0; j { - this.settings[id] = opt; - for (let j=0; j 1) { + addToMenu(this.localization("Core" + " (" + this.localization("Requires restart") + ")"), "retroarch_core", core, this.getCore(), home); + } + if (typeof window.SharedArrayBuffer === "function" && !this.requiresThreads(this.getCore())) { + addToMenu(this.localization("Threads"), "ejs_threads", { + "enabled": this.localization("Enabled"), + "disabled": this.localization("Disabled") + }, this.config.threads ? "enabled" : "disabled", home); + } + + const graphicsOptions = createSettingParent(true, "Graphics Settings", home); if (this.config.shaders) { const builtinShaders = { - '2xScaleHQ.glslp': this.localization("2xScaleHQ"), - '4xScaleHQ.glslp': this.localization("4xScaleHQ"), - 'crt-aperture.glslp': this.localization('CRT aperture'), - 'crt-beam': this.localization('CRT beam'), - 'crt-caligari': this.localization('CRT caligari'), - 'crt-easymode.glslp': this.localization('CRT easymode'), - 'crt-geom.glslp': this.localization('CRT geom'), - 'crt-lottes': this.localization('CRT lottes'), - 'crt-mattias.glslp': this.localization('CRT mattias'), - 'crt-yeetron': this.localization('CRT yeetron'), - 'crt-zfast': this.localization('CRT zfast'), - 'sabr': this.localization('SABR'), - 'bicubic': this.localization('Bicubic'), - 'mix-frames': this.localization('Mix frames'), + "2xScaleHQ.glslp": this.localization("2xScaleHQ"), + "4xScaleHQ.glslp": this.localization("4xScaleHQ"), + "crt-aperture.glslp": this.localization("CRT aperture"), + "crt-beam": this.localization("CRT beam"), + "crt-caligari": this.localization("CRT caligari"), + "crt-easymode.glslp": this.localization("CRT easymode"), + "crt-geom.glslp": this.localization("CRT geom"), + "crt-lottes": this.localization("CRT lottes"), + "crt-mattias.glslp": this.localization("CRT mattias"), + "crt-yeetron": this.localization("CRT yeetron"), + "crt-zfast": this.localization("CRT zfast"), + "sabr": this.localization("SABR"), + "bicubic": this.localization("Bicubic"), + "mix-frames": this.localization("Mix frames"), }; let shaderMenu = { - 'disabled': this.localization("Disabled"), + "disabled": this.localization("Disabled"), }; for (const shaderName in this.config.shaders) { if (builtinShaders[shaderName]) { @@ -4318,123 +4855,305 @@ class EmulatorJS { shaderMenu[shaderName] = shaderName; } } - addToMenu(this.localization('Shaders'), 'shader', shaderMenu, 'disabled'); + addToMenu(this.localization("Shaders"), "shader", shaderMenu, "disabled", graphicsOptions, true); } - if (this.supportsWebgl2) { - addToMenu(this.localization('WebGL2') + " (" + this.localization('Requires page reload') + ")", 'webgl2Enabled', { - 'enabled': this.localization("Enabled"), - 'disabled': this.localization("Disabled") - }, this.webgl2Enabled ? "enabled" : "disabled"); + if (this.supportsWebgl2 && !this.requiresWebGL2(this.getCore())) { + addToMenu(this.localization("WebGL2") + " (" + this.localization("Requires restart") + ")", "webgl2Enabled", { + "enabled": this.localization("Enabled"), + "disabled": this.localization("Disabled") + }, this.webgl2Enabled ? "enabled" : "disabled", graphicsOptions, true); } - - addToMenu(this.localization('FPS'), 'fps', { - 'show': this.localization("show"), - 'hide': this.localization("hide") - }, 'hide'); - + + addToMenu(this.localization("FPS"), "fps", { + "show": this.localization("show"), + "hide": this.localization("hide") + }, "hide", graphicsOptions, true); + addToMenu(this.localization("VSync"), "vsync", { - 'enabled': this.localization("Enabled"), - 'disabled': this.localization("Disabled") - }, "enabled"); - - addToMenu(this.localization('Fast Forward Ratio'), 'ff-ratio', [ + "enabled": this.localization("Enabled"), + "disabled": this.localization("Disabled") + }, "enabled", graphicsOptions, true); + + addToMenu(this.localization("Video Rotation"), "videoRotation", { + "0": "0 deg", + "1": "90 deg", + "2": "180 deg", + "3": "270 deg" + }, this.videoRotation.toString(), graphicsOptions, true); + + const screenCaptureOptions = createSettingParent(true, "Screen Capture", home); + + addToMenu(this.localization("Screenshot Source"), "screenshotSource", { + "canvas": "canvas", + "retroarch": "retroarch" + }, this.capture.photo.source, screenCaptureOptions, true); + + let screenshotFormats = { + "png": "png", + "jpeg": "jpeg", + "webp": "webp" + } + if (this.isSafari) { + delete screenshotFormats["webp"]; + } + if (!(this.capture.photo.format in screenshotFormats)) { + this.capture.photo.format = "png"; + } + addToMenu(this.localization("Screenshot Format"), "screenshotFormat", screenshotFormats, this.capture.photo.format, screenCaptureOptions, true); + + const screenshotUpscale = this.capture.photo.upscale.toString(); + let screenshotUpscales = { + "0": "native", + "1": "1x", + "2": "2x", + "3": "3x" + } + if (!(screenshotUpscale in screenshotUpscales)) { + screenshotUpscales[screenshotUpscale] = screenshotUpscale + "x"; + } + addToMenu(this.localization("Screenshot Upscale"), "screenshotUpscale", screenshotUpscales, screenshotUpscale, screenCaptureOptions, true); + + const screenRecordFPS = this.capture.video.fps.toString(); + let screenRecordFPSs = { + "30": "30", + "60": "60" + } + if (!(screenRecordFPS in screenRecordFPSs)) { + screenRecordFPSs[screenRecordFPS] = screenRecordFPS; + } + addToMenu(this.localization("Screen Recording FPS"), "screenRecordFPS", screenRecordFPSs, screenRecordFPS, screenCaptureOptions, true); + + let screenRecordFormats = { + "mp4": "mp4", + "webm": "webm" + } + for (const format in screenRecordFormats) { + if (!MediaRecorder.isTypeSupported("video/" + format)) { + delete screenRecordFormats[format]; + } + } + if (!(this.capture.video.format in screenRecordFormats)) { + this.capture.video.format = Object.keys(screenRecordFormats)[0]; + } + addToMenu(this.localization("Screen Recording Format"), "screenRecordFormat", screenRecordFormats, this.capture.video.format, screenCaptureOptions, true); + + const screenRecordUpscale = this.capture.video.upscale.toString(); + let screenRecordUpscales = { + "1": "1x", + "2": "2x", + "3": "3x", + "4": "4x" + } + if (!(screenRecordUpscale in screenRecordUpscales)) { + screenRecordUpscales[screenRecordUpscale] = screenRecordUpscale + "x"; + } + addToMenu(this.localization("Screen Recording Upscale"), "screenRecordUpscale", screenRecordUpscales, screenRecordUpscale, screenCaptureOptions, true); + + const screenRecordVideoBitrate = this.capture.video.videoBitrate.toString(); + let screenRecordVideoBitrates = { + "1048576": "1 Mbit/sec", + "2097152": "2 Mbit/sec", + "2621440": "2.5 Mbit/sec", + "3145728": "3 Mbit/sec", + "4194304": "4 Mbit/sec" + } + if (!(screenRecordVideoBitrate in screenRecordVideoBitrates)) { + screenRecordVideoBitrates[screenRecordVideoBitrate] = screenRecordVideoBitrate + " Bits/sec"; + } + addToMenu(this.localization("Screen Recording Video Bitrate"), "screenRecordVideoBitrate", screenRecordVideoBitrates, screenRecordVideoBitrate, screenCaptureOptions, true); + + const screenRecordAudioBitrate = this.capture.video.audioBitrate.toString(); + let screenRecordAudioBitrates = { + "65536": "64 Kbit/sec", + "131072": "128 Kbit/sec", + "196608": "192 Kbit/sec", + "262144": "256 Kbit/sec", + "327680": "320 Kbit/sec" + } + if (!(screenRecordAudioBitrate in screenRecordAudioBitrates)) { + screenRecordAudioBitrates[screenRecordAudioBitrate] = screenRecordAudioBitrate + " Bits/sec"; + } + addToMenu(this.localization("Screen Recording Audio Bitrate"), "screenRecordAudioBitrate", screenRecordAudioBitrates, screenRecordAudioBitrate, screenCaptureOptions, true); + + checkForEmptyMenu(screenCaptureOptions); + + const speedOptions = createSettingParent(true, "Speed Options", home); + + addToMenu(this.localization("Fast Forward"), "fastForward", { + "enabled": this.localization("Enabled"), + "disabled": this.localization("Disabled") + }, "disabled", speedOptions, true); + + addToMenu(this.localization("Fast Forward Ratio"), "ff-ratio", [ "1.5", "2.0", "2.5", "3.0", "3.5", "4.0", "4.5", "5.0", "5.5", "6.0", "6.5", "7.0", "7.5", "8.0", "8.5", "9.0", "9.5", "10.0", "unlimited" - ], "3.0"); + ], "3.0", speedOptions, true); - addToMenu(this.localization('Slow Motion Ratio'), 'sm-ratio', [ + addToMenu(this.localization("Slow Motion"), "slowMotion", { + "enabled": this.localization("Enabled"), + "disabled": this.localization("Disabled") + }, "disabled", speedOptions, true); + + addToMenu(this.localization("Slow Motion Ratio"), "sm-ratio", [ "1.5", "2.0", "2.5", "3.0", "3.5", "4.0", "4.5", "5.0", "5.5", "6.0", "6.5", "7.0", "7.5", "8.0", "8.5", "9.0", "9.5", "10.0" - ], "3.0"); + ], "3.0", speedOptions, true); + + addToMenu(this.localization("Rewind Enabled" + " (" + this.localization("Requires restart") + ")"), "rewindEnabled", { + "enabled": this.localization("Enabled"), + "disabled": this.localization("Disabled") + }, "disabled", speedOptions, true); + + if (this.rewindEnabled) { + addToMenu(this.localization("Rewind Granularity"), "rewind-granularity", [ + "1", "3", "6", "12", "25", "50", "100" + ], "6", speedOptions, true); + } + + const inputOptions = createSettingParent(true, "Input Options", home); - addToMenu(this.localization('Fast Forward'), 'fastForward', { - 'enabled': this.localization("Enabled"), - 'disabled': this.localization("Disabled") - }, "disabled"); + addToMenu(this.localization("Menubar Mouse Trigger"), "menubarBehavior", { + "downward": this.localization("Downward Movement"), + "anywhere": this.localization("Movement Anywhere"), + }, "downward", inputOptions, true); - addToMenu(this.localization('Slow Motion'), 'slowMotion', { - 'enabled': this.localization("Enabled"), - 'disabled': this.localization("Disabled") - }, "disabled"); + addToMenu(this.localization("Direct Keyboard Input"), "keyboardInput", { + "disabled": this.localization("Disabled"), + "enabled": this.localization("Enabled"), + }, ((this.defaultCoreOpts && this.defaultCoreOpts.useKeyboard === true) ? "enabled" : "disabled"), inputOptions, true); - addToMenu(this.localization('Rewind Enabled (requires restart)'), 'rewindEnabled', { - 'enabled': this.localization("Enabled"), - 'disabled': this.localization("Disabled") - }, 'disabled'); + addToMenu(this.localization("Forward Alt key"), "altKeyboardInput", { + "disabled": this.localization("Disabled"), + "enabled": this.localization("Enabled"), + }, "disabled", inputOptions, true); - addToMenu(this.localization('Rewind Granularity'), 'rewind-granularity', [ - '1', '3', '6', '12', '25', '50', '100' - ], '6'); + addToMenu(this.localization("Lock Mouse"), "lockMouse", { + "disabled": this.localization("Disabled"), + "enabled": this.localization("Enabled"), + }, (this.enableMouseLock === true ? "enabled" : "disabled"), inputOptions, true); + + checkForEmptyMenu(inputOptions); if (this.saveInBrowserSupported()) { - addToMenu(this.localization('Save State Slot'), 'save-state-slot', ["1", "2", "3", "4", "5", "6", "7", "8", "9"], "1"); - addToMenu(this.localization('Save State Location'), 'save-state-location', { - 'download': this.localization("Download"), - 'browser': this.localization("Keep in Browser") - }, 'download'); - } - - addToMenu(this.localization('Video Rotation (requires restart)'), 'videoRotation', { - '0': "0 deg", - '1': "90 deg", - '2': "180 deg", - '3': "270 deg" - }, this.videoRotation.toString()); - - if (this.touch || navigator.maxTouchPoints > 0) { - addToMenu(this.localization('Virtual Gamepad'), 'virtual-gamepad', { - 'enabled': this.localization("Enabled"), - 'disabled': this.localization("Disabled") - }, this.isMobile ? 'enabled' : 'disabled'); - addToMenu(this.localization('Left Handed Mode'), 'virtual-gamepad-left-handed-mode', { - 'enabled': this.localization("Enabled"), - 'disabled': this.localization("Disabled") - }, 'disabled'); + const saveStateOpts = createSettingParent(true, "Save States", home); + addToMenu(this.localization("Save State Slot"), "save-state-slot", ["1", "2", "3", "4", "5", "6", "7", "8", "9"], "1", saveStateOpts, true); + addToMenu(this.localization("Save State Location"), "save-state-location", { + "download": this.localization("Download"), + "browser": this.localization("Keep in Browser") + }, "download", saveStateOpts, true); + addToMenu(this.localization("System Save interval"), "save-save-interval", { + "0": "Disabled", + "30": "30 seconds", + "60": "1 minute", + "300": "5 minutes", + "600": "10 minutes", + "900": "15 minutes", + "1800": "30 minutes" + }, "300", saveStateOpts, true); + checkForEmptyMenu(saveStateOpts); + } + + if (this.touch || this.hasTouchScreen) { + const virtualGamepad = createSettingParent(true, "Virtual Gamepad", home); + addToMenu(this.localization("Virtual Gamepad"), "virtual-gamepad", { + "enabled": this.localization("Enabled"), + "disabled": this.localization("Disabled") + }, this.isMobile ? "enabled" : "disabled", virtualGamepad, true); + addToMenu(this.localization("Menu Bar Button"), "menu-bar-button", { + "visible": this.localization("visible"), + "hidden": this.localization("hidden") + }, "visible", virtualGamepad, true); + addToMenu(this.localization("Left Handed Mode"), "virtual-gamepad-left-handed-mode", { + "enabled": this.localization("Enabled"), + "disabled": this.localization("Disabled") + }, "disabled", virtualGamepad, true); + checkForEmptyMenu(virtualGamepad); } + let coreOpts; try { coreOpts = this.gameManager.getCoreOptions(); - } catch(e){} + } catch(e) {} if (coreOpts) { - coreOpts.split('\n').forEach((line, index) => { - let option = line.split('; '); + const coreOptions = createSettingParent(true, "Backend Core Options", home); + coreOpts.split("\n").forEach((line, index) => { + let option = line.split("; "); let name = option[0]; - let options = option[1].split('|'), - optionName = name.split("|")[0].replace(/_/g, ' ').replace(/.+\-(.+)/, '$1'); + let options = option[1].split("|"), + optionName = name.split("|")[0].replace(/_/g, " ").replace(/.+\-(.+)/, "$1"); options.slice(1, -1); if (options.length === 1) return; let availableOptions = {}; - for (let i=0; i 1) ? name.split("|")[1] : options[0].replace('(Default) ', '')); + addToMenu(this.localization(optionName, this.config.settingsLanguage), + name.split("|")[0], availableOptions, + (name.split("|").length > 1) ? name.split("|")[1] : options[0].replace("(Default) ", ""), + coreOptions, + true); }) + checkForEmptyMenu(coreOptions); } - + + /* + this.retroarchOpts = [ + { + title: "Audio Latency", // String + name: "audio_latency", // String - value to be set in retroarch.cfg + // options should ALWAYS be strings here... + options: ["8", "16", "32", "64", "128"], // values + options: {"8": "eight", "16": "sixteen", "32": "thirty-two", "64": "sixty-four", "128": "one hundred-twenty-eight"}, // This also works + default: "128", // Default + isString: false // Surround value with quotes in retroarch.cfg file? + } + ];*/ + + if (this.retroarchOpts && Array.isArray(this.retroarchOpts)) { + const retroarchOptsMenu = createSettingParent(true, "RetroArch Options" + " (" + this.localization("Requires restart") + ")", home); + this.retroarchOpts.forEach(option => { + addToMenu(this.localization(option.title, this.config.settingsLanguage), + option.name, + option.options, + option.default, + retroarchOptsMenu, + true); + }) + checkForEmptyMenu(retroarchOptsMenu); + } + + checkForEmptyMenu(graphicsOptions); + checkForEmptyMenu(speedOptions); + this.settingsMenu.appendChild(nested); - + this.settingParent.appendChild(this.settingsMenu); this.settingParent.style.position = "relative"; - + + this.settingsMenu.style.display = ""; const homeSize = this.getElementSize(home); - nested.style.width = (homeSize.width+20) + "px"; + nested.style.width = (homeSize.width + 20) + "px"; nested.style.height = homeSize.height + "px"; - + this.settingsMenu.style.display = "none"; - + if (this.debug) { console.log("Available core options", allOpts); } - + if (this.config.defaultOptions) { for (const k in this.config.defaultOptions) { - this.changeSettingOption(k, this.config.defaultOptions[k]); + this.changeSettingOption(k, this.config.defaultOptions[k], true); } } + + if (parentMenuCt === 0) { + this.on("start", () => { + this.elements.bottomBar.settings[0][0].style.display = "none"; + }); + } } createSubPopup(hidden) { - const popup = this.createElement('div'); + const popup = this.createElement("div"); popup.classList.add("ejs_popup_container"); popup.classList.add("ejs_popup_container_box"); const popupMsg = this.createElement("div"); @@ -4481,12 +5200,11 @@ class EmulatorJS { addToHeader("").style.width = "80px"; //"join" button table.appendChild(thead); const tbody = this.createElement("tbody"); - + table.appendChild(tbody); rooms.appendChild(title); rooms.appendChild(table); - - + const joined = this.createElement("div"); const title2 = this.createElement("strong"); title2.innerText = "{roomname}"; @@ -4510,16 +5228,16 @@ class EmulatorJS { addToHeader2("").style.width = "80px"; //"join" button table2.appendChild(thead2); const tbody2 = this.createElement("tbody"); - + table2.appendChild(tbody2); joined.appendChild(title2); joined.appendChild(password); joined.appendChild(table2); - + joined.style.display = "none"; body.appendChild(rooms); body.appendChild(joined); - + this.openNetplayMenu = () => { this.netplayMenu.style.display = ""; if (!this.netplay || (this.netplay && !this.netplay.name)) { @@ -4535,14 +5253,14 @@ class EmulatorJS { this.netplayMenu.appendChild(popups[0]); popups[1].classList.add("ejs_cheat_parent"); //Hehe const popup = popups[1]; - + const header = this.createElement("div"); const title = this.createElement("h2"); title.innerText = this.localization("Set Player Name"); title.classList.add("ejs_netplay_name_heading"); header.appendChild(title); popup.appendChild(header); - + const main = this.createElement("div"); main.classList.add("ejs_netplay_header"); const head = this.createElement("strong"); @@ -4550,12 +5268,12 @@ class EmulatorJS { const input = this.createElement("input"); input.type = "text"; input.setAttribute("maxlength", 20); - + main.appendChild(head); main.appendChild(this.createElement("br")); main.appendChild(input); popup.appendChild(main); - + popup.appendChild(this.createElement("br")); const submit = this.createElement("button"); submit.classList.add("ejs_button_button"); @@ -4575,17 +5293,17 @@ class EmulatorJS { defineNetplayFunctions() { function guidGenerator() { const S4 = function() { - return (((1+Math.random())*0x10000)|0).toString(16).substring(1); + return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); }; - return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4()); + return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); } this.netplay.url = this.config.netplayUrl; while (this.netplay.url.endsWith("/")) { - this.netplay.url = this.netplay.url.substring(0, this.netplay.url.length-1); + this.netplay.url = this.netplay.url.substring(0, this.netplay.url.length - 1); } this.netplay.current_frame = 0; this.netplay.getOpenRooms = async () => { - return JSON.parse(await (await fetch(this.netplay.url+"/list?domain="+window.location.host+"&game_id="+this.config.gameId)).text()); + return JSON.parse(await (await fetch(this.netplay.url + "/list?domain=" + window.location.host + "&game_id=" + this.config.gameId)).text()); } this.netplay.updateTableList = async () => { const addToTable = (id, name, current, max) => { @@ -4601,7 +5319,7 @@ class EmulatorJS { } addToHeader(name).style["text-align"] = "left"; addToHeader(current + "/" + max).style.width = "80px"; - + const parent = addToHeader(""); parent.style.width = "80px"; this.netplay.table.appendChild(row); @@ -4630,23 +5348,23 @@ class EmulatorJS { this.netplayMenu.appendChild(popups[0]); popups[1].classList.add("ejs_cheat_parent"); //Hehe const popup = popups[1]; - + const header = this.createElement("div"); const title = this.createElement("h2"); title.innerText = this.localization("Create a room"); title.classList.add("ejs_netplay_name_heading"); header.appendChild(title); popup.appendChild(header); - + const main = this.createElement("div"); - + main.classList.add("ejs_netplay_header"); const rnhead = this.createElement("strong"); rnhead.innerText = this.localization("Room Name"); const rninput = this.createElement("input"); rninput.type = "text"; rninput.setAttribute("maxlength", 20); - + const maxhead = this.createElement("strong"); maxhead.innerText = this.localization("Max Players"); const maxinput = this.createElement("select"); @@ -4663,28 +5381,27 @@ class EmulatorJS { maxinput.appendChild(val2); maxinput.appendChild(val3); maxinput.appendChild(val4); - - + const pwhead = this.createElement("strong"); pwhead.innerText = this.localization("Password (optional)"); const pwinput = this.createElement("input"); pwinput.type = "text"; pwinput.setAttribute("maxlength", 20); - + main.appendChild(rnhead); main.appendChild(this.createElement("br")); main.appendChild(rninput); - + main.appendChild(maxhead); main.appendChild(this.createElement("br")); main.appendChild(maxinput); - + main.appendChild(pwhead); main.appendChild(this.createElement("br")); main.appendChild(pwinput); - + popup.appendChild(main); - + popup.appendChild(this.createElement("br")); const submit = this.createElement("button"); submit.classList.add("ejs_button_button"); @@ -4737,7 +5454,7 @@ class EmulatorJS { } this.netplay.players[this.netplay.playerID] = this.netplay.extra; this.netplay.users = {}; - + this.netplay.startSocketIO((error) => { this.netplay.socket.emit("open-room", { extra: this.netplay.extra, @@ -4768,7 +5485,7 @@ class EmulatorJS { sessionid: sessionid } this.netplay.players[this.netplay.playerID] = this.netplay.extra; - + this.netplay.startSocketIO((error) => { this.netplay.socket.emit("join-room", { extra: this.netplay.extra//, @@ -4795,7 +5512,7 @@ class EmulatorJS { this.netplay.tabs[1].style.display = ""; if (password) { this.netplay.passwordElem.style.display = ""; - this.netplay.passwordElem.innerText = this.localization("Password")+": "+password + this.netplay.passwordElem.innerText = this.localization("Password") + ": " + password } else { this.netplay.passwordElem.style.display = "none"; } @@ -4848,7 +5565,7 @@ class EmulatorJS { addToHeader("").style.width = "80px"; //"join" button table.appendChild(row); } - let i=1; + let i = 1; for (const k in this.netplay.players) { addToTable(i, this.netplay.players[k].player_name); i++; @@ -4899,7 +5616,7 @@ class EmulatorJS { syncing = false; } this.netplay.getUserIndex = (user) => { - let i=0; + let i = 0; for (const k in this.netplay.players) { if (k === user) return i; i++; @@ -4907,7 +5624,7 @@ class EmulatorJS { return -1; } this.netplay.getUserCount = () => { - let i=0; + let i = 0; for (const k in this.netplay.players) i++; return i; } @@ -4922,7 +5639,7 @@ class EmulatorJS { this.netplay.setLoading(true); this.pause(true); this.gameManager.loadState(new Uint8Array(data.state)); - this.netplay.sendMessage({ready:true}); + this.netplay.sendMessage({ ready: true }); } if (data.play && !this.owner) { this.play(true); @@ -4933,7 +5650,7 @@ class EmulatorJS { if (data.ready && this.netplay.owner) { this.netplay.ready++; if (this.netplay.ready === this.netplay.getUserCount()) { - this.netplay.sendMessage({readyready:true}); + this.netplay.sendMessage({ readyready: true }); this.netplay.reset(); setTimeout(() => this.play(true), 48); this.netplay.setLoading(false); @@ -4980,7 +5697,7 @@ class EmulatorJS { this.play(true); } if (frame + 10 <= inFrame && inFrame > this.netplay.init_frame + 100) { - this.netplay.sendMessage({shortPause:this.netplay.playerID}); + this.netplay.sendMessage({ shortPause: this.netplay.playerID }); } } }); @@ -5008,7 +5725,7 @@ class EmulatorJS { } else { this.netplay.sendMessage({ "sync-control": [{ - frame: frame+10, + frame: frame + 10, connected_input: [player, index, value] }] }) @@ -5031,19 +5748,18 @@ class EmulatorJS { //fps = 1000 / (newTime - lastTime); //console.log(fps); //lastTime = newTime; - //frame syncing - working //control syncing - broken this.netplay.currentFrame = parseInt(this.gameManager.getFrameNum()) - this.netplay.init_frame; if (!this.isNetplay) return; if (this.netplay.owner) { let to_send = []; - let i = this.netplay.currentFrame-1; + let i = this.netplay.currentFrame - 1; this.netplay.inputsData[i] ? this.netplay.inputsData[i].forEach((value) => { - value.frame+=10; + value.frame += 10; to_send.push(value); - }) : to_send.push({frame: i+10}); - this.netplay.sendMessage({"sync-control": to_send}); + }) : to_send.push({ frame: i + 10 }); + this.netplay.sendMessage({ "sync-control": to_send }); } else { if (this.netplay.currentFrame <= 0 || this.netplay.inputsData[this.netplay.currentFrame]) { this.netplay.wait = false; @@ -5056,7 +5772,7 @@ class EmulatorJS { } else if (!this.netplay.syncing) { console.log("sync"); this.pause(true); - this.netplay.sendMessage({sync:true}); + this.netplay.sendMessage({ sync: true }); this.netplay.syncing = true; } } @@ -5068,10 +5784,8 @@ class EmulatorJS { } }) } - - } - + this.netplay.updateList = { start: () => { this.netplay.updateList.interval = setInterval(this.netplay.updateTableList.bind(this), 1000); @@ -5102,7 +5816,7 @@ class EmulatorJS { this.addEventListener(close, "click", (e) => { popups[0].remove(); }) - + const main = this.createElement("div"); main.classList.add("ejs_cheat_main"); const header3 = this.createElement("strong"); @@ -5125,7 +5839,7 @@ class EmulatorJS { main.appendChild(mainText2); main.appendChild(this.createElement("br")); popup.appendChild(main); - + const footer = this.createElement("footer"); const submit = this.createElement("button"); const closeButton = this.createElement("button"); @@ -5142,7 +5856,7 @@ class EmulatorJS { footer.appendChild(span); footer.appendChild(closeButton); popup.appendChild(footer); - + this.addEventListener(submit, "click", (e) => { if (!mainText.value.trim() || !mainText2.value.trim()) return; popups[0].remove(); @@ -5157,7 +5871,6 @@ class EmulatorJS { this.addEventListener(closeButton, "click", (e) => { popups[0].remove(); }) - }, "Close": () => { this.cheatMenu.style.display = "none"; @@ -5178,7 +5891,7 @@ class EmulatorJS { updateCheatUI() { if (!this.gameManager) return; this.elements.cheatRows.innerHTML = ""; - + const addToMenu = (desc, checked, code, is_permanent, i) => { const row = this.createElement("div"); row.classList.add("ejs_cheat_row"); @@ -5186,10 +5899,10 @@ class EmulatorJS { input.type = "checkbox"; input.checked = checked; input.value = i; - input.id = "ejs_cheat_switch_"+i; + input.id = "ejs_cheat_switch_" + i; row.appendChild(input); const label = this.createElement("label"); - label.for = "ejs_cheat_switch_"+i; + label.for = "ejs_cheat_switch_" + i; label.innerText = desc; row.appendChild(label); label.addEventListener("click", (e) => { @@ -5214,7 +5927,7 @@ class EmulatorJS { this.cheatChanged(checked, code, i); } this.gameManager.resetCheat(); - for (let i=0; i { - this.Module.FS.writeFile(`/shader/${resource.name}`, resource.type === 'base64' ? atob(resource.value) : resource.value, {}, 'w+'); + this.Module.FS.writeFile(`/shader/${resource.name}`, resource.type === "base64" ? atob(resource.value) : resource.value, {}, "w+"); }); } } @@ -5251,13 +5964,113 @@ class EmulatorJS { this.gameManager.toggleShader(1); } + screenshot(callback, source, format, upscale) { + const imageFormat = format || this.getSettingValue("screenshotFormat") || this.capture.photo.format; + const imageUpscale = upscale || parseInt(this.getSettingValue("screenshotUpscale") || this.capture.photo.upscale); + const screenshotSource = source || this.getSettingValue("screenshotSource") || this.capture.photo.source; + const videoRotation = parseInt(this.getSettingValue("videoRotation") || 0); + const aspectRatio = this.gameManager.getVideoDimensions("aspect") || 1.333333; + const gameWidth = this.gameManager.getVideoDimensions("width") || 256; + const gameHeight = this.gameManager.getVideoDimensions("height") || 224; + const videoTurned = (videoRotation === 1 || videoRotation === 3); + let width = this.canvas.width; + let height = this.canvas.height; + let scaleHeight = imageUpscale; + let scaleWidth = imageUpscale; + let scale = 1; + + if (screenshotSource === "retroarch") { + if (width >= height) { + width = height * aspectRatio; + } else if (width < height) { + height = width / aspectRatio; + } + this.gameManager.screenshot().then(screenshot => { + const blob = new Blob([screenshot], { type: "image/png" }); + if (imageUpscale === 0) { + callback(blob, "png"); + } else if (imageUpscale > 1) { + scale = imageUpscale; + const img = new Image(); + const screenshotUrl = URL.createObjectURL(blob); + img.src = screenshotUrl; + img.onload = () => { + const canvas = document.createElement("canvas"); + canvas.width = width * scale; + canvas.height = height * scale; + const ctx = canvas.getContext("2d", { alpha: false }); + ctx.imageSmoothingEnabled = false; + ctx.scale(scaleWidth, scaleHeight); + ctx.drawImage(img, 0, 0, width, height); + canvas.toBlob((blob) => { + callback(blob, imageFormat); + img.remove(); + URL.revokeObjectURL(screenshotUrl); + canvas.remove(); + }, "image/" + imageFormat, 1); + } + } + }); + } else if (screenshotSource === "canvas") { + if (width >= height && !videoTurned) { + width = height * aspectRatio; + } else if (width < height && !videoTurned) { + height = width / aspectRatio; + } else if (width >= height && videoTurned) { + width = height * (1/aspectRatio); + } else if (width < height && videoTurned) { + width = height / (1/aspectRatio); + } + if (imageUpscale === 0) { + scale = gameHeight / height; + scaleHeight = scale; + scaleWidth = scale; + } else if (imageUpscale > 1) { + scale = imageUpscale; + } + const captureCanvas = document.createElement("canvas"); + captureCanvas.width = width * scale; + captureCanvas.height = height * scale; + captureCanvas.style.display = "none"; + const captureCtx = captureCanvas.getContext("2d", { alpha: false }); + captureCtx.imageSmoothingEnabled = false; + captureCtx.scale(scale, scale); + const imageAspect = this.canvas.width / this.canvas.height; + const canvasAspect = width / height; + let offsetX = 0; + let offsetY = 0; + + if (imageAspect > canvasAspect) { + offsetX = (this.canvas.width - width) / -2; + } else if (imageAspect < canvasAspect) { + offsetY = (this.canvas.height - height) / -2; + } + const drawNextFrame = () => { + captureCtx.drawImage(this.canvas, offsetX, offsetY, this.canvas.width, this.canvas.height); + captureCanvas.toBlob((blob) => { + callback(blob, imageFormat); + captureCanvas.remove(); + }, "image/" + imageFormat, 1); + }; + requestAnimationFrame(drawNextFrame); + } + } + + async takeScreenshot(source, format, upscale) { + return new Promise((resolve) => { + this.screenshot((blob, format) => { + resolve({ blob, format }); + }, source, format, upscale); + }); + } + collectScreenRecordingMediaTracks(canvasEl, fps) { let videoTrack = null; const videoTracks = canvasEl.captureStream(fps).getVideoTracks(); if (videoTracks.length !== 0) { videoTrack = videoTracks[0]; } else { - console.error('Unable to capture video stream'); + console.error("Unable to capture video stream"); return null; } @@ -5284,44 +6097,67 @@ class EmulatorJS { } const stream = new MediaStream(); - if (videoTrack && videoTrack.readyState === 'live') { + if (videoTrack && videoTrack.readyState === "live") { stream.addTrack(videoTrack); } - if (audioTrack && audioTrack.readyState === 'live') { + if (audioTrack && audioTrack.readyState === "live") { stream.addTrack(audioTrack); } return stream; } screenRecord() { - const captureScreenWidth= (this.config.screenRecording && (typeof this.config.screenRecording.width == "number")) ? this.config.screenRecording.width : 800; - const captureScreenHeight = (this.config.screenRecording && (typeof this.config.screenRecording.height == "number")) ? this.config.screenRecording.height : 600; - const captureFps = (this.config.screenRecording && (typeof this.config.screenRecording.fps == "number")) ? this.config.screenRecording.fps : 30; - const captureVideoBitrate = (this.config.screenRecording && (typeof this.config.screenRecording.videoBitrate == "number")) ? this.config.screenRecording.videoBitrate : 2 * 1024 * 1014; - const captureAudioBitrate = (this.config.screenRecording && (typeof this.config.screenRecording.audioBitrate == "number")) ? this.config.screenRecording.audioBitrate : 256 * 1024; - - const captureCanvas = document.createElement('canvas'); - captureCanvas.width = captureScreenWidth; - captureCanvas.height = captureScreenHeight; - captureCanvas.style.position = 'absolute'; - captureCanvas.style.top = '-999px'; - captureCanvas.style.bottom = '-999px'; - document.getElementsByTagName('body')[0].append(captureCanvas); - - const captureCtx = captureCanvas.getContext('2d', { alpha: false }); - captureCtx.fillStyle = '#000'; + const captureFps = this.getSettingValue("screenRecordingFPS") || this.capture.video.fps; + const captureFormat = this.getSettingValue("screenRecordFormat") || this.capture.video.format; + const captureUpscale = this.getSettingValue("screenRecordUpscale") || this.capture.video.upscale; + const captureVideoBitrate = this.getSettingValue("screenRecordVideoBitrate") || this.capture.video.videoBitrate; + const captureAudioBitrate = this.getSettingValue("screenRecordAudioBitrate") || this.capture.video.audioBitrate; + const aspectRatio = this.gameManager.getVideoDimensions("aspect") || 1.333333; + const videoRotation = parseInt(this.getSettingValue("videoRotation") || 0); + const videoTurned = (videoRotation === 1 || videoRotation === 3); + let width = 800; + let height = 600; + let frameAspect = this.canvas.width / this.canvas.height; + let canvasAspect = width / height; + let offsetX = 0; + let offsetY = 0; + + const captureCanvas = document.createElement("canvas"); + const captureCtx = captureCanvas.getContext("2d", { alpha: false }); + captureCtx.fillStyle = "#000"; + captureCtx.imageSmoothingEnabled = false; + const updateSize = () => { + width = this.canvas.width; + height = this.canvas.height; + frameAspect = width / height + if (width >= height && !videoTurned) { + width = height * aspectRatio; + } else if (width < height && !videoTurned) { + height = width / aspectRatio; + } else if (width >= height && videoTurned) { + width = height * (1/aspectRatio); + } else if (width < height && videoTurned) { + width = height / (1/aspectRatio); + } + canvasAspect = width / height; + captureCanvas.width = width * captureUpscale; + captureCanvas.height = height * captureUpscale; + captureCtx.scale(captureUpscale, captureUpscale); + if (frameAspect > canvasAspect) { + offsetX = (this.canvas.width - width) / -2; + } else if (frameAspect < canvasAspect) { + offsetY = (this.canvas.height - height) / -2; + } + } + updateSize(); + this.addEventListener(this.canvas, "resize", () => { + updateSize(); + }); let animation = true; const drawNextFrame = () => { - const scaleX = captureScreenWidth / this.canvas.width; - const scaleY = captureScreenHeight / this.canvas.height; - const scale = Math.max(scaleY, scaleX); - const width = this.canvas.width * scale; - const height = this.canvas.height * scale; - const startX = (captureScreenWidth - width) / 2; - const startY = (captureScreenHeight - height) / 2; - captureCtx.drawImage(this.canvas, Math.round(startX), Math.round(startY), Math.round(width), Math.round(height)); + captureCtx.drawImage(this.canvas, offsetX, offsetY, this.canvas.width, this.canvas.height); if (animation) { requestAnimationFrame(drawNextFrame); } @@ -5333,17 +6169,18 @@ class EmulatorJS { const recorder = new MediaRecorder(tracks, { videoBitsPerSecond: captureVideoBitrate, audioBitsPerSecond: captureAudioBitrate, + mimeType: "video/" + captureFormat }); - recorder.addEventListener('dataavailable', e => { + recorder.addEventListener("dataavailable", e => { chunks.push(e.data); }); - recorder.addEventListener('stop', () => { + recorder.addEventListener("stop", () => { const blob = new Blob(chunks); const url = URL.createObjectURL(blob); const date = new Date(); - const a = document.createElement('a'); + const a = document.createElement("a"); a.href = url; - a.download = this.getBaseFileName()+"-"+date.getMonth()+"-"+date.getDate()+"-"+date.getFullYear()+".webm"; + a.download = this.getBaseFileName() + "-" + date.getMonth() + "-" + date.getDate() + "-" + date.getFullYear() + "." + captureFormat; a.click(); animation = false; @@ -5353,6 +6190,5 @@ class EmulatorJS { return recorder; } - } window.EmulatorJS = EmulatorJS; diff --git a/data/src/gamepad.js b/data/src/gamepad.js index 9a1d82c4..22095ab1 100644 --- a/data/src/gamepad.js +++ b/data/src/gamepad.js @@ -1,4 +1,7 @@ class GamepadHandler { + gamepads; + timeout; + listeners; constructor() { this.buttonLabels = { 0: 'BUTTON_1', @@ -34,7 +37,16 @@ class GamepadHandler { this.timeout = setTimeout(this.loop.bind(this), 10); } updateGamepadState() { - const gamepads = Array.from(this.getGamepads()); + let gamepads = Array.from(this.getGamepads()); + if (!gamepads) return; + if (!Array.isArray(gamepads) && gamepads.length) { + let gp = []; + for (let i=0; i { if (!gamepad) return; let hasGamepad = false; @@ -47,13 +59,15 @@ class GamepadHandler { id: oldGamepad.id } hasGamepad = true; - + oldGamepad.axes.forEach((axis, axisIndex) => { const val = (axis < 0.01 && axis > -0.01) ? 0 : axis; const newVal = (gamepad.axes[axisIndex] < 0.01 && gamepad.axes[axisIndex] > -0.01) ? 0 : gamepad.axes[axisIndex]; if (newVal !== val) { - const axis = ['LEFT_STICK_X', 'LEFT_STICK_Y', 'RIGHT_STICK_X', 'RIGHT_STICK_Y'][axisIndex]; - if (!axis) return; + let axis = ['LEFT_STICK_X', 'LEFT_STICK_Y', 'RIGHT_STICK_X', 'RIGHT_STICK_Y'][axisIndex]; + if (!axis) { + axis = "EXTRA_STICK_" + axisIndex; + } this.dispatchEvent('axischanged', { axis: axis, value: newVal, @@ -64,7 +78,7 @@ class GamepadHandler { } gamepadToSave.axes[axisIndex] = newVal; }) - + gamepad.buttons.forEach((button, buttonIndex) => { let pressed = oldGamepad.buttons[buttonIndex] === 1.0; if (typeof oldGamepad.buttons[buttonIndex] === "object") { @@ -82,16 +96,22 @@ class GamepadHandler { this.dispatchEvent('buttonup', {index: buttonIndex, label:this.getButtonLabel(buttonIndex), gamepadIndex: gamepad.index}); } } - + }) this.gamepads[oldIndex] = gamepadToSave; }) if (!hasGamepad) { this.gamepads.push(gamepads[index]); + this.gamepads.sort((a, b) => { + if (a == null && b == null) return 0; + if (a == null) return 1; + if (b == null) return -1; + return a.index - b.index; + }); this.dispatchEvent('connected', {gamepadIndex: gamepad.index}); } }); - + for (let j=0; j=0&&this._handlers_[t].splice(this._handlers_[t].indexOf(i),1),this},_.prototype.trigger=function(t,i){var e,o=this,n=t.split(/[ ,]+/g);o._handlers_=o._handlers_||{};for(var s=0;ss&&n<3*s&&!t.lockX?i="up":n>-s&&n<=s&&!t.lockY?i="left":n>3*-s&&n<=-s&&!t.lockX?i="down":t.lockY||(i="right"),t.lockY||(e=n>-r&&n0?"up":"down"),t.force>this.options.threshold){var d,a={};for(d in this.direction)this.direction.hasOwnProperty(d)&&(a[d]=this.direction[d]);var p={};for(d in this.direction={x:e,y:o,angle:i},t.direction=this.direction,a)a[d]===this.direction[d]&&(p[d]=!0);if(p.x&&p.y&&p.angle)return t;p.x&&p.y||this.trigger("plain",t),p.x||this.trigger("plain:"+e,t),p.y||this.trigger("plain:"+o,t),p.angle||this.trigger("dir dir:"+i,t)}else this.resetDirection();return t};var P=k;function E(t,i){this.nipples=[],this.idles=[],this.actives=[],this.ids=[],this.pressureIntervals={},this.manager=t,this.id=E.id,E.id+=1,this.defaults={zone:document.body,multitouch:!1,maxNumberOfNipples:10,mode:"dynamic",position:{top:0,left:0},catchDistance:200,size:100,threshold:.1,color:"white",fadeTime:250,dataOnly:!1,restJoystick:!0,restOpacity:.5,lockX:!1,lockY:!1,shape:"circle",dynamicPage:!1,follow:!1},this.config(i),"static"!==this.options.mode&&"semi"!==this.options.mode||(this.options.multitouch=!1),this.options.multitouch||(this.options.maxNumberOfNipples=1);var e=getComputedStyle(this.options.zone.parentElement);return e&&"flex"===e.display&&(this.parentIsFlex=!0),this.updateBox(),this.prepareNipples(),this.bindings(),this.begin(),this.nipples}E.prototype=new T,E.constructor=E,E.id=0,E.prototype.prepareNipples=function(){var t=this.nipples;t.on=this.on.bind(this),t.off=this.off.bind(this),t.options=this.options,t.destroy=this.destroy.bind(this),t.ids=this.ids,t.id=this.id,t.processOnMove=this.processOnMove.bind(this),t.processOnEnd=this.processOnEnd.bind(this),t.get=function(i){if(void 0===i)return t[0];for(var e=0,o=t.length;e