mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2026-02-06 11:17:36 +00:00
Update docs & formating (#991)
* update docs & formating * fix formatting * spaces * remove spaces * CDN info * functions
This commit is contained in:
parent
6acede642b
commit
3794c089fa
59
CHANGES.md
59
CHANGES.md
@ -1,6 +1,7 @@
|
||||
# Changes
|
||||
|
||||
# 4.2.1
|
||||
|
||||
This was a bug-fix only release.
|
||||
|
||||
- Core-fetch failsafe now fetches a pinned version (Thanks to [@gantoine](https://github.com/n-at))
|
||||
@ -19,6 +20,7 @@ This was a bug-fix only release.
|
||||
- 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))
|
||||
@ -45,6 +47,7 @@ In my opinion, this is the most stable release we've had in a while. Many featur
|
||||
- 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))
|
||||
@ -65,6 +68,7 @@ In my opinion, this is the most stable release we've had in a while. Many featur
|
||||
- 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))
|
||||
@ -77,12 +81,14 @@ In my opinion, this is the most stable release we've had in a while. Many featur
|
||||
- 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.
|
||||
@ -97,6 +103,7 @@ In my opinion, this is the most stable release we've had in a while. Many featur
|
||||
- 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))
|
||||
@ -108,6 +115,7 @@ In my opinion, this is the most stable release we've had in a while. Many featur
|
||||
- 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))
|
||||
@ -121,6 +129,7 @@ In my opinion, this is the most stable release we've had in a while. Many featur
|
||||
- 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.
|
||||
@ -138,6 +147,7 @@ In my opinion, this is the most stable release we've had in a while. Many featur
|
||||
- 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))
|
||||
@ -145,6 +155,7 @@ In my opinion, this is the most stable release we've had in a while. Many featur
|
||||
- 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
|
||||
@ -159,20 +170,25 @@ In my opinion, this is the most stable release we've had in a while. Many featur
|
||||
- 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.
|
||||
@ -183,10 +199,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
|
||||
@ -194,6 +212,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.
|
||||
@ -211,63 +230,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.
|
||||
@ -275,16 +310,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!
|
||||
@ -292,25 +330,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
|
||||
@ -322,6 +365,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.
|
||||
@ -329,6 +373,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.
|
||||
@ -337,6 +382,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.
|
||||
@ -351,6 +397,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.
|
||||
@ -366,6 +413,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.
|
||||
@ -381,6 +429,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.
|
||||
@ -389,27 +438,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.
|
||||
@ -417,9 +472,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.
|
||||
|
||||
@ -2,13 +2,15 @@
|
||||
|
||||
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)
|
||||
|
||||
## Attention Visual Studio Code Users
|
||||
|
||||
|
||||
71
README.md
71
README.md
@ -1,4 +1,3 @@
|
||||
|
||||
<div align = center>
|
||||
|
||||
<img width = 300 src = docs/Logo-light.png#gh-dark-mode-only>
|
||||
@ -8,19 +7,17 @@
|
||||
<br>
|
||||
|
||||
[![Badge License]][License]
|
||||
|
||||
|
||||
|
||||
Self-hosted **Javascript** emulation for various systems.
|
||||
|
||||
<br>
|
||||
|
||||
[![Button Website]][Website]
|
||||
[![Button Website]][Website]
|
||||
[![Button Usage]][Usage]<br>
|
||||
[![Button Configurator]][Configurator]<br>
|
||||
[![Button Demo]][Demo]
|
||||
|
||||
[![Button Contributors]][Contributors]
|
||||
|
||||
[![Button Demo]][Demo]<br>
|
||||
[![Button Contributors]][Contributors]
|
||||
|
||||
Join our Discord server:
|
||||
|
||||
[](https://discord.gg/6akryGkETU)
|
||||
@ -37,7 +34,7 @@ Or the Matrix server (#emulatorjs:matrix.emulatorjs.org):
|
||||
> **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 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).
|
||||
> 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.
|
||||
@ -62,30 +59,56 @@ Or the Matrix server (#emulatorjs:matrix.emulatorjs.org):
|
||||
|
||||
<br>
|
||||
|
||||
### 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
|
||||
|
||||
<br>
|
||||
|
||||
### 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 considered alpha.
|
||||
|
||||
<br>
|
||||
|
||||
### 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 get the stable, latest, nightly, and any other main version by setting your `EJS_pathtodata` to `https://cdn.emulatorjs.org/<version>/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/<version>/data/`, replacing `<version>` 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/<version>/data/loader.js`
|
||||
|
||||
<br>
|
||||
|
||||
### 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.
|
||||
|
||||
<br>
|
||||
|
||||
<br>
|
||||
|
||||
@ -138,7 +161,7 @@ If you want to help with localization, please check out the [localization](data/
|
||||
**[Saturn][Sega Saturn]** |
|
||||
**[32X][Sega 32X]** |
|
||||
**[CD][Sega CD]**
|
||||
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
||||
@ -167,7 +190,7 @@ If you want to help with localization, please check out the [localization](data/
|
||||
<br>
|
||||
|
||||
### Other
|
||||
|
||||
|
||||
**[PlayStation]** |
|
||||
**[PlayStation Portable]** |
|
||||
**[Arcade]**
|
||||
@ -175,7 +198,7 @@ If you want to help with localization, please check out the [localization](data/
|
||||
**[3DO]** |
|
||||
**[MAME 2003]** |
|
||||
**[ColecoVision]**
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
@ -196,12 +219,6 @@ If you want to help with localization, please check out the [localization](data/
|
||||
[Issue]: https://github.com/ethanaobrien/emulatorjs/issues
|
||||
[patreon]: https://patreon.com/EmulatorJS
|
||||
|
||||
|
||||
<!-- 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 Extensions 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 --->
|
||||
|
||||
[GameLibrary]: https://github.com/Ramaerel/emulatorjs-GameLibrary
|
||||
|
||||
|
||||
<!-- 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 Quicklinks 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 🎮 --->
|
||||
|
||||
[Configurator]: https://emulatorjs.org/editor
|
||||
@ -260,7 +277,7 @@ If you want to help with localization, please check out the [localization](data/
|
||||
|
||||
[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 Usage]: https://img.shields.io/badge/Usage-2478b5?style=for-the-badge
|
||||
|
||||
6
build.js
6
build.js
@ -7,7 +7,7 @@ try {
|
||||
const packageJsonPath = path.resolve('package.json');
|
||||
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
||||
version = packageJson.version;
|
||||
} catch (error) {
|
||||
} catch(error) {
|
||||
console.error("Error reading version from package.json:", error.message);
|
||||
process.exit(1);
|
||||
}
|
||||
@ -63,7 +63,7 @@ if (!build_type) {
|
||||
$progress: true
|
||||
}).on('progress', function (progress) {
|
||||
progressData['7z'] = progress.percent;
|
||||
}).on('end', function () {
|
||||
}).on('end', function() {
|
||||
progressData['7z'] = 100;
|
||||
|
||||
});
|
||||
@ -73,7 +73,7 @@ if (!build_type) {
|
||||
$progress: true
|
||||
}).on('progress', function (progress) {
|
||||
progressData['zip'] = progress.percent;
|
||||
}).on('end', function () {
|
||||
}).on('end', function() {
|
||||
progressData['zip'] = 100;
|
||||
});
|
||||
} else if (build_type !== "emulatorjs" && build_type !== "cores" && build_type !== "get-cores") {
|
||||
|
||||
11
data/compression/README.md
Normal file
11
data/compression/README.md
Normal file
@ -0,0 +1,11 @@
|
||||
# Compression Libraries
|
||||
|
||||
<!-- ## Extract7z.js
|
||||
|
||||
## Extractzip.js -->
|
||||
|
||||
## Libunrar.js
|
||||
|
||||
Emscripten port of RARLab's open-source unrar library
|
||||
|
||||
Source: https://github.com/tnikolai2/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
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -12,10 +12,10 @@
|
||||
|
||||
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) {
|
||||
return new Promise(function(resolve) {
|
||||
let script = document.createElement('script');
|
||||
script.src = function() {
|
||||
if ('undefined' != typeof EJS_paths && typeof EJS_paths[file] === 'string') {
|
||||
@ -33,16 +33,16 @@
|
||||
document.head.appendChild(script);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function loadStyle(file) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
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') {
|
||||
return EJS_paths[file];
|
||||
} else {
|
||||
return scriptPath+file;
|
||||
return scriptPath + file;
|
||||
}
|
||||
}();
|
||||
css.onload = resolve;
|
||||
@ -56,11 +56,11 @@
|
||||
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<scripts.length; i++) {
|
||||
for (let i = 0; i < scripts.length; i++) {
|
||||
await loadScript(scripts[i]);
|
||||
}
|
||||
} else {
|
||||
@ -68,9 +68,9 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (('undefined' != typeof EJS_DEBUG_XX && true === EJS_DEBUG_XX)) {
|
||||
for (let i=0; i<scripts.length; i++) {
|
||||
for (let i = 0; i < scripts.length; i++) {
|
||||
await loadScript(scripts[i]);
|
||||
}
|
||||
await loadStyle('emulator.css');
|
||||
@ -123,7 +123,7 @@
|
||||
config.videoRotation = window.EJS_videoRotation;
|
||||
config.hideSettings = window.EJS_hideSettings;
|
||||
config.shaders = Object.assign({}, window.EJS_SHADERS, window.EJS_shaders ? window.EJS_shaders : {});
|
||||
|
||||
|
||||
let systemLang;
|
||||
try {
|
||||
systemLang = Intl.DateTimeFormat().resolvedOptions().locale;
|
||||
@ -136,7 +136,7 @@
|
||||
if ('undefined' != typeof EJS_paths && typeof EJS_paths[language] === 'string') {
|
||||
path = EJS_paths[language];
|
||||
} else {
|
||||
path = scriptPath+"localization/"+language+".json";
|
||||
path = scriptPath + "localization/" + language + ".json";
|
||||
}
|
||||
config.language = language;
|
||||
config.langJson = JSON.parse(await (await fetch(path)).text());
|
||||
@ -146,7 +146,7 @@
|
||||
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") {
|
||||
|
||||
@ -32,9 +32,9 @@ class EJS_GameManager {
|
||||
setVSync: this.Module.cwrap('set_vsync', 'null', ['number']),
|
||||
setVideoRoation: this.Module.cwrap('set_video_rotation', 'null', ['number'])
|
||||
}
|
||||
|
||||
|
||||
this.writeFile("/home/web_user/retroarch/userdata/retroarch.cfg", this.getRetroArchCfg());
|
||||
|
||||
|
||||
this.writeConfigFile();
|
||||
this.initShaders();
|
||||
|
||||
@ -59,7 +59,7 @@ class EJS_GameManager {
|
||||
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.mount(this.FS.filesystems.IDBFS, { autoPersist: true }, '/data/saves');
|
||||
this.FS.syncfs(true, resolve);
|
||||
});
|
||||
}
|
||||
@ -69,7 +69,7 @@ class EJS_GameManager {
|
||||
}
|
||||
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);
|
||||
@ -79,7 +79,7 @@ class EJS_GameManager {
|
||||
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], null, true, {responseType: "arraybuffer", method: "GET"}).then(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();
|
||||
@ -94,7 +94,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();
|
||||
}
|
||||
@ -115,7 +115,7 @@ class EJS_GameManager {
|
||||
writeFile(path, data) {
|
||||
const parts = path.split("/");
|
||||
let current = "/";
|
||||
for (let i=0; i<parts.length-1; i++) {
|
||||
for (let i = 0; i < parts.length - 1; i++) {
|
||||
if (!parts[i].trim()) continue;
|
||||
current += parts[i] + "/";
|
||||
this.mkdir(current);
|
||||
@ -129,18 +129,18 @@ class EJS_GameManager {
|
||||
}
|
||||
getRetroArchCfg() {
|
||||
let cfg = "autosave_interval = 60\n" +
|
||||
"screenshot_directory = \"/\"\n" +
|
||||
"block_sram_overwrite = false\n" +
|
||||
"video_gpu_screenshot = false\n" +
|
||||
"audio_latency = 64\n" +
|
||||
"video_top_portrait_viewport = true\n" +
|
||||
"video_vsync = true\n" +
|
||||
"video_smooth = false\n" +
|
||||
"fastforward_ratio = 3.0\n" +
|
||||
"slowmotion_ratio = 3.0\n" +
|
||||
(this.EJS.rewindEnabled ? "rewind_enable = true\n" : "") +
|
||||
(this.EJS.rewindEnabled ? "rewind_granularity = 6\n" : "") +
|
||||
"savefile_directory = \"/data/saves\"\n";
|
||||
"screenshot_directory = \"/\"\n" +
|
||||
"block_sram_overwrite = false\n" +
|
||||
"video_gpu_screenshot = false\n" +
|
||||
"audio_latency = 64\n" +
|
||||
"video_top_portrait_viewport = true\n" +
|
||||
"video_vsync = true\n" +
|
||||
"video_smooth = false\n" +
|
||||
"fastforward_ratio = 3.0\n" +
|
||||
"slowmotion_ratio = 3.0\n" +
|
||||
(this.EJS.rewindEnabled ? "rewind_enable = true\n" : "") +
|
||||
(this.EJS.rewindEnabled ? "rewind_granularity = 6\n" : "") +
|
||||
"savefile_directory = \"/data/saves\"\n";
|
||||
|
||||
if (this.EJS.retroarchOpts && Array.isArray(this.EJS.retroarchOpts)) {
|
||||
this.EJS.retroarchOpts.forEach(option => {
|
||||
@ -189,20 +189,20 @@ class EJS_GameManager {
|
||||
loadState(state) {
|
||||
try {
|
||||
this.FS.unlink('game.state');
|
||||
} catch(e){}
|
||||
} 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){}
|
||||
} catch(e) {}
|
||||
}, 5000)
|
||||
}
|
||||
screenshot() {
|
||||
try {
|
||||
this.FS.unlink('screenshot.png');
|
||||
} catch(e){}
|
||||
} catch(e) {}
|
||||
this.functions.screenshot();
|
||||
return new Promise(async resolve => {
|
||||
while (1) {
|
||||
@ -210,7 +210,6 @@ class EJS_GameManager {
|
||||
this.FS.stat("/screenshot.png");
|
||||
return resolve(this.FS.readFile("/screenshot.png"));
|
||||
} catch(e) {}
|
||||
|
||||
await new Promise(res => setTimeout(res, 50));
|
||||
}
|
||||
})
|
||||
@ -221,9 +220,9 @@ class EJS_GameManager {
|
||||
let name = slot + '-quick.state';
|
||||
try {
|
||||
this.FS.unlink(name);
|
||||
} catch (e) {}
|
||||
} catch(e) {}
|
||||
let data = await this.getState();
|
||||
this.FS.writeFile('/'+name, data);
|
||||
this.FS.writeFile('/' + name, data);
|
||||
})();
|
||||
}
|
||||
quickLoad(slot) {
|
||||
@ -243,12 +242,12 @@ class EJS_GameManager {
|
||||
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);
|
||||
this.EJS.displayMessage(this.EJS.localization("SAVED STATE TO SLOT") + " " + slot);
|
||||
}
|
||||
if (index === 25 && value === 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;
|
||||
@ -258,7 +257,7 @@ class EJS_GameManager {
|
||||
newSlot = 1;
|
||||
}
|
||||
if (newSlot > 9) newSlot = 1;
|
||||
this.EJS.displayMessage(this.EJS.localization("SET SAVE STATE SLOT TO")+" "+newSlot);
|
||||
this.EJS.displayMessage(this.EJS.localization("SET SAVE STATE SLOT TO") + " " + newSlot);
|
||||
this.EJS.changeSettingOption('save-state-slot', newSlot.toString());
|
||||
}
|
||||
if (index === 27) {
|
||||
@ -300,7 +299,7 @@ class EJS_GameManager {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
for (let i=0; i<fileNames.length; i++) {
|
||||
for (let i = 0; i < fileNames.length; i++) {
|
||||
if (fileNames[i].split(".").pop().toLowerCase() === "ccd") {
|
||||
console.warn("Did not auto-create cue file(s). Found a ccd.");
|
||||
return null;
|
||||
@ -314,22 +313,22 @@ class EJS_GameManager {
|
||||
if (baseFileName.includes(".")) {
|
||||
baseFileName = baseFileName.substring(0, baseFileName.length - baseFileName.split(".").pop().length - 1);
|
||||
}
|
||||
for (let i=0; i<fileNames.length; i++) {
|
||||
const contents = " FILE \""+fileNames[i]+"\" BINARY\n TRACK 01 MODE1/2352\n INDEX 01 00:00:00";
|
||||
this.FS.writeFile("/"+baseFileName+"-"+i+".cue", contents);
|
||||
for (let i = 0; i < fileNames.length; i++) {
|
||||
const contents = " FILE \"" + fileNames[i] + "\" BINARY\n TRACK 01 MODE1/2352\n INDEX 01 00:00:00";
|
||||
this.FS.writeFile("/" + baseFileName + "-" + i + ".cue", contents);
|
||||
}
|
||||
if (fileNames.length > 1) {
|
||||
let contents = "";
|
||||
for (let i=0; i<fileNames.length; i++) {
|
||||
contents += "/"+baseFileName+"-"+i+".cue\n";
|
||||
for (let i = 0; i < fileNames.length; i++) {
|
||||
contents += "/" + baseFileName + "-" + i + ".cue\n";
|
||||
}
|
||||
this.FS.writeFile("/"+baseFileName+".m3u", contents);
|
||||
this.FS.writeFile("/" + baseFileName + ".m3u", contents);
|
||||
}
|
||||
return (fileNames.length === 1) ? baseFileName+"-0.cue" : baseFileName+".m3u";
|
||||
return (fileNames.length === 1) ? baseFileName + "-0.cue" : baseFileName + ".m3u";
|
||||
}
|
||||
loadPpssppAssets() {
|
||||
return new Promise(resolve => {
|
||||
this.EJS.downloadFile('cores/ppsspp-assets.zip', null, false, {responseType: "arraybuffer", method: "GET"}).then((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');
|
||||
@ -340,12 +339,12 @@ class EJS_GameManager {
|
||||
|
||||
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<paths.length-1; i++) {
|
||||
for (let i = 0; i < paths.length - 1; i++) {
|
||||
if (paths[i] === "") continue;
|
||||
cp += "/"+paths[i];
|
||||
cp += "/" + paths[i];
|
||||
if (!this.FS.analyzePath(cp).exists) {
|
||||
this.FS.mkdir(cp);
|
||||
}
|
||||
@ -430,7 +429,7 @@ class EJS_GameManager {
|
||||
return this.functions.getFrameNum();
|
||||
}
|
||||
setVideoRotation(rotation) {
|
||||
try {
|
||||
try {
|
||||
this.functions.setVideoRoation(rotation);
|
||||
} catch(e) {
|
||||
console.warn(e);
|
||||
|
||||
@ -19,7 +19,7 @@ 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);
|
||||
}
|
||||
@ -36,20 +36,66 @@ class EJS_COMPRESSION {
|
||||
path = "compression/libunrar.js";
|
||||
obj = "rar";
|
||||
}
|
||||
const res = await this.EJS.downloadFile(path, null, false, {responseType: "text", method: "GET"});
|
||||
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"});
|
||||
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;
|
||||
}
|
||||
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], {
|
||||
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 + `';
|
||||
}
|
||||
};
|
||||
` + 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);
|
||||
@ -73,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) {
|
||||
|
||||
1632
data/src/emulator.js
1632
data/src/emulator.js
File diff suppressed because one or more lines are too long
@ -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<gamepads.length; i++) {
|
||||
gp.push(gamepads[i]);
|
||||
}
|
||||
gamepads = gp;
|
||||
} else if (!Array.isArray(gamepads)) return;
|
||||
|
||||
gamepads.forEach((gamepad, index) => {
|
||||
if (!gamepad) return;
|
||||
let hasGamepad = false;
|
||||
@ -47,7 +59,7 @@ 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];
|
||||
@ -64,7 +76,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,7 +94,7 @@ class GamepadHandler {
|
||||
this.dispatchEvent('buttonup', {index: buttonIndex, label:this.getButtonLabel(buttonIndex), gamepadIndex: gamepad.index});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
this.gamepads[oldIndex] = gamepadToSave;
|
||||
})
|
||||
@ -91,7 +103,7 @@ class GamepadHandler {
|
||||
this.dispatchEvent('connected', {gamepadIndex: gamepad.index});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
for (let j=0; j<this.gamepads.length; j++) {
|
||||
if (!this.gamepads[j]) continue;
|
||||
let has = false;
|
||||
|
||||
@ -34,7 +34,7 @@ class EJS_STORAGE {
|
||||
};
|
||||
openRequest.onupgradeneeded = () => {
|
||||
let db = openRequest.result;
|
||||
if (! db.objectStoreNames.contains(this.storeName)) {
|
||||
if (!db.objectStoreNames.contains(this.storeName)) {
|
||||
db.createObjectStore(this.storeName);
|
||||
};
|
||||
};
|
||||
@ -58,7 +58,7 @@ class EJS_STORAGE {
|
||||
};
|
||||
openRequest.onupgradeneeded = () => {
|
||||
let db = openRequest.result;
|
||||
if (! db.objectStoreNames.contains(this.storeName)) {
|
||||
if (!db.objectStoreNames.contains(this.storeName)) {
|
||||
db.createObjectStore(this.storeName);
|
||||
};
|
||||
};
|
||||
@ -80,7 +80,7 @@ class EJS_STORAGE {
|
||||
};
|
||||
openRequest.onupgradeneeded = () => {
|
||||
let db = openRequest.result;
|
||||
if (! db.objectStoreNames.contains(this.storeName)) {
|
||||
if (!db.objectStoreNames.contains(this.storeName)) {
|
||||
db.createObjectStore(this.storeName);
|
||||
};
|
||||
};
|
||||
@ -92,7 +92,7 @@ class EJS_STORAGE {
|
||||
const keys = await this.get("?EJS_KEYS!");
|
||||
if (!keys) return resolve({});
|
||||
let rv = {};
|
||||
for (let i=0; i<keys.length; i++) {
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
const result = await this.get(keys[i]);
|
||||
if (!result || !result.data || typeof result.data.byteLength !== "number") continue;
|
||||
rv[keys[i]] = result.data.byteLength;
|
||||
|
||||
@ -17,7 +17,7 @@ async function doMinify() {
|
||||
.catch(function (err) {
|
||||
console.error(err);
|
||||
})
|
||||
.then(function () {
|
||||
.then(function() {
|
||||
console.log("Minified JS");
|
||||
});
|
||||
await minify({
|
||||
@ -28,7 +28,7 @@ async function doMinify() {
|
||||
.catch(function (err) {
|
||||
console.error(err);
|
||||
})
|
||||
.then(function () {
|
||||
.then(function() {
|
||||
console.log("Minified CSS");
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user